|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 3 G8 O' G! d/ I8 [
* a4 j9 G+ O5 v) ]* T) ` 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
2 d. f9 W6 a1 ~2 Z9 ~ b. n9 X# z+ M
- D6 H2 a8 J# Y1 R ping [-t] [-a] [-n count] [-l length] [-f] [-i ttl] [-v tos] [-r count] [-s count] [[-j computer-list] [-k computer-list]] [-w timeout] destination-list
. }% R: `6 Y4 ?# i% O+ W 6 @+ k* y5 C( n# q4 T
Options: * z6 R p. d5 ?! ]. N- {5 G
/ s% {( w0 ?+ K- T4 y& T5 Q5 i -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
: M) T: b+ M' M7 P
/ K! H" S; x8 P6 v 不停的ping地方主机,直到你按下Control-C。
: F: b% I0 L$ I# j6 J
8 V. G0 F' _7 S* Q) R' |) ]; Z2 p 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 $ c& v$ K: W$ V2 `9 G
! v! v/ _% J {
-a Resolve addresses to hostnames.
; b! Z6 O. G5 w$ j
( k3 [' s+ b! U9 c7 a 解析计算机NetBios名。
4 o/ X0 ^1 B8 w7 e( `) j6 g+ W 9 O7 h+ a; D& f2 T0 m! u! R3 z, o
示例:C:\>ping -a 192.168.1.21 # W0 O! N+ Y+ e* Q) \
% D" X; U5 D1 D. d, A Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
9 K9 b. b& h; W$ s. r9 ` 4 b8 \9 X& _( C+ ]; ]! U/ K3 z
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
5 u7 L" Y; H X' Z! o
! M4 U$ Z7 I, n4 h Y7 e5 ?% q* C Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 R6 n- W* U6 `+ y6 S& D n
K/ s- j; o. X8 {. } Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
) \; Z$ x. N: [& u; A0 J. k. C
* @: s. T4 e& @5 W3 h8 z f4 |* ^) \; E1 b- k( Z
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
9 Y& w7 f9 [; D: ~
% r+ a" ?/ e! N: r7 b$ O3 T# l- O Ping statistics for 192.168.1.21:
& I; U# o5 C! t# C
. H6 w: T* \- l/ Z Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
: ~/ x. W0 z/ t: d 7 Y4 H, |4 l) P5 |. |" J
Minimum = 0ms, Maximum = 0ms, Average = 0ms & ~# e- b/ Z- J& i& Y& x1 J7 l6 r' Y
/ q( u7 B4 x7 `& ?3 b6 z 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 0 r2 o. j& ~3 c- z2 d" [ R/ d& S
2 L# \! g, k& L2 x( u+ O -n count Number of echo requests to send.
$ `- }) l1 L2 x8 B# }
9 m/ Z0 R) D0 H* Z8 J* r: ~ 发送count指定的Echo数据包数。
1 |3 t( }! H1 r+ x+ f
' n8 D9 e$ f# Q t8 R 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: " s- A! Q$ o7 N9 |
# S+ r' {, L' s
C:\>ping -n 50 202.103.96.68
, }* D3 M X0 q9 |, M 0 q0 v6 D4 w# i7 W
Pinging 202.103.96.68 with 32 bytes of data: 8 S4 j3 K, Z1 u" }1 |7 p% Z5 h
2 q" [0 D; a- J7 _$ u& A6 n
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ( i- Y. z( g: r- T
3 j4 e+ \8 t R* L3 j/ B/ g0 g
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
( P) W! G9 d5 {5 f, Y + m: A8 }- e4 S9 m
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 + i! Y- T$ y l% U f
; b) X- N4 v7 {0 t$ ? Request timed out.
+ R* M! {$ x5 w, K% J
9 ^ C5 V; ]2 H# h( r8 [ ………………
) V2 |& j. p( l! H3 F6 i" C9 k, W
" Z& X8 x3 @0 ?* P# s Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 5 ]. F% i* a2 C
, g9 r- v9 @5 H5 E
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; s4 v: d( }: t# a
$ v! d1 g/ e, U, X/ R# E7 J Ping statistics for 202.103.96.68:
3 \7 W) O- d- b- m; D+ I+ @
: z6 i2 \9 I( w+ ^: a) Q( R6 s. s Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
2 A8 F3 M8 j1 V9 i" t0 } ! A% M! H S) P! v
Minimum = 40ms, Maximum = 51ms, Average = 46ms
# c- r. f, f# |. f9 g
* s6 t) m2 ?1 m- z 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 . ^# d! v+ d1 l+ H4 e0 S
N( e3 z$ W. `) f% J( b+ h6 ]
-l size Send buffer size.
% _3 p5 i3 G2 K; ]
) Q( A# ^' i; L 定义echo数据包大小。 |
|