|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
; n" A% `, J1 F3 G! F& b/ j
5 {9 H! h0 \5 T- W2 z 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
, Y, l" m2 i1 j7 V) p . H8 X5 E7 {2 }& ?+ M* H# t
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 . s% F; r2 c5 o, ]( y5 O5 Q+ r6 V& y
+ ]' P0 E) s5 m
Options:
# d& g/ d' @: @+ n/ k7 a 2 C; ?/ N/ Q! g( t8 d {
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. ; u5 \( V& @5 ^
$ K3 k5 U, p1 M# `+ ]0 b 不停的ping地方主机,直到你按下Control-C。 ) T. Z. P2 `* E7 L4 A6 @
% P0 f3 q3 H& [% r/ ~4 X$ N- {
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
; r- }5 L- f3 z# v
6 {% m( f7 U* ] -a Resolve addresses to hostnames.
, n( A I+ `( o1 r 0 {3 P) S( z! W9 L
解析计算机NetBios名。 - R$ U7 [; h8 j' z
_: @; j7 g" ~& U 示例:C:\>ping -a 192.168.1.21
8 R# }; p! W6 e# P& O , d; V% @, a) s9 K* O1 j6 s7 O
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: ! H$ J2 P6 |0 ~4 u: t# }9 a
9 M* Y( s6 _, L# W) c
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
) F' ^+ Z: T6 F0 ?9 X $ M1 W1 o/ }+ {5 n1 g
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 3 h% B7 r- y; z4 _4 g/ P
4 L* s$ \; O# S7 b8 z% y' t* M% E. D! V Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
( L# Y; n# d5 P" C: ^3 M: _/ a- t% I/ Z, n& H# c1 N
! D3 ]+ D: u* N2 |, r& y Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
* V2 G: {; q! l% j9 b4 ~ # }# j& ]7 l9 \5 g) _7 K# P; ]/ c% m' _
Ping statistics for 192.168.1.21:
* D1 s# ~9 U! M8 z 3 {& h2 t) Q6 I# z" O9 L2 x$ q5 l$ v
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
2 E& \( G* G5 o Y5 H* c) C
9 p ]2 _+ { C4 W; } Minimum = 0ms, Maximum = 0ms, Average = 0ms $ j) b/ V) r& J; W; M& I
5 J. h2 m2 P. S) L% y; M 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
4 L- ~" Q7 O0 f 7 e1 |: A# ?: F$ G# }
-n count Number of echo requests to send. 8 s! n. |; E' r9 a! j
1 x- J6 V, u) G
发送count指定的Echo数据包数。
; `9 k" N( O9 q( r0 q/ i& E + a$ H6 R+ c. Z5 Q
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
) A: t i/ K9 _0 @4 P
% h1 ]" @' q" h0 m; P C:\>ping -n 50 202.103.96.68 % r. r! |3 n- K
9 n" X% |- N; P' c
Pinging 202.103.96.68 with 32 bytes of data:
2 X; |* S% W1 x$ o! G7 N
$ j$ s# C) H, }" a. [$ N; O4 ^ Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
8 U$ g7 F Y1 d B' b/ ?
5 q2 L' D$ r; K9 p0 Q& D Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
& q+ @# X4 b' k0 D4 V: ?' } ( C0 y ?4 M3 X, k
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
. J' E2 }8 V* m$ p* d
0 O- Y1 {8 V) T! V Request timed out.
E$ @+ ~& X& F4 x* G , t( |5 i9 Z ]5 |6 D( z
………………
1 u/ l" R( O3 W 0 @& M+ g n% p0 j u5 Y5 H
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 0 S( y2 \) O4 Z Z! ?; I1 U
3 C! K9 j, [- p
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; r3 D* x: o$ U1 a4 k; ]
* ] i) y1 e' z Ping statistics for 202.103.96.68: " [( F2 a9 [* K6 _+ h
! J1 d: E+ ]7 C! j; s, t6 x5 t
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
7 e! i6 A) X( }; t
0 n; M6 \; D* m" ? Minimum = 40ms, Maximum = 51ms, Average = 46ms ) W( ^8 J4 c4 P* k" y
2 r* K$ |" b/ F! X; u1 A
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
2 r9 p3 n& U8 R, P
# q" H' {: m5 `# V5 T -l size Send buffer size.
/ k% ?/ n( W, p7 A4 V& H/ O
* L% }1 G8 \3 i. s8 R$ A 定义echo数据包大小。 |
|