|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 5 l$ v8 }9 l3 ^+ d1 O M: ]
* F, L& O+ `2 Y) r7 X, C
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
% A; n# }2 }7 L* d: }: @ % @1 o) O! [+ @) b
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
; j, _% y7 h- c' w 7 N. T m s+ Y5 v
Options: & C" t9 l% P7 ?9 O
% ]5 f2 t. v4 C7 }0 a4 f
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
" I9 \3 p2 L; A. x
- b9 V7 T! D' \2 a/ v6 N" e. |/ F 不停的ping地方主机,直到你按下Control-C。 # ^- T _, O# G3 s+ ^, A
r, P$ `0 h* K. ?) e- d n 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
/ ^# l1 h( d( I' \ 5 n* n, n; p* ], p
-a Resolve addresses to hostnames. . Z4 A+ f7 s' d8 o. |
9 V) l) \1 L( s, Z 解析计算机NetBios名。
; `7 @3 L8 E& V! Z y) [* h
. D5 ^: t" l* D, O; x% m D, K( S% B 示例:C:\>ping -a 192.168.1.21
0 ]1 X1 N' W, B1 Y0 O5 L 2 [0 ], I/ C; s0 R/ G
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: & Y4 X, F: C F% M# F" }
' u# {' Y4 n+ G6 g
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
2 z. w& I2 t% `3 F
7 z5 |1 Y/ Z! X8 K/ s3 d* d4 d Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ( j3 `: A0 ^3 T
& e, K* D7 c- q: g% g7 ]4 E
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
% D4 M; E. Z" G& m& g7 j, ^. d* M. O7 O& j8 x
. B' v4 J$ ]' Q+ E: P/ r0 b+ o
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
" y' w5 R/ S) P8 s ' g* d; t8 m- Y. m5 N+ p4 W
Ping statistics for 192.168.1.21: & K3 m. Y/ |' {! P, w4 U/ G
8 O8 O6 H1 F6 Y L) G1 e1 h Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
5 }( \( j' B( o/ l . Y9 Z( e2 Q0 P5 w9 K! X' O* X
Minimum = 0ms, Maximum = 0ms, Average = 0ms 9 ]$ T& U# ^, x/ h8 h6 L
2 M3 p# {2 _% j% t+ t. e
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 / {( M& G* e. X# a8 X9 B4 w
3 S2 T& j. w. I -n count Number of echo requests to send.
+ K9 i4 q1 c% \( V $ L5 }9 B6 O1 c5 i" s, d! X
发送count指定的Echo数据包数。 1 s# i2 M7 \2 R T( E3 a
9 \7 r0 T! W0 v" ]$ K% z/ O9 F8 U
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
5 U9 P- m$ y1 o
+ e H9 k7 V) m$ d C:\>ping -n 50 202.103.96.68 0 t% z$ z8 }; }% P' T
; q/ m6 L2 f) s$ G. _ Pinging 202.103.96.68 with 32 bytes of data:
1 Z' Q7 K# j; h. A2 [; w, ?: S, ?* n , @4 n- ]0 P) R" @0 ?
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
. K) e/ b+ R. \
5 P8 j+ m& s1 n; b Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ' v& Z! ~+ q% P1 R5 Z9 @6 k
0 h6 A5 t6 Q& s {6 R( A Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
e! D6 r1 }2 T) s5 d
# C2 O0 x' K( m6 z! e9 b Request timed out. c" Z; g4 m9 h4 I
, p0 I& r$ _! m1 i9 k
……………… $ I- ]' Z* H9 j$ D* b% c# d+ B
3 O& @! Y% f' P. o3 M' E8 |" E6 W
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ) l" A/ ~: j4 |6 W7 y
3 b( G4 O5 F) b1 \ Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
7 {$ |1 V1 v, [/ S0 I
3 C/ f2 Z2 P0 D$ t, S$ G Ping statistics for 202.103.96.68:
; q' S% x4 F6 \- b& K; u; G, ~ 4 {8 A# _" ?% I( b& t+ k/ y
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
# G; ?" p5 k1 O0 l& @
) ?8 t. p: _) c9 T( m! R Minimum = 40ms, Maximum = 51ms, Average = 46ms
5 N T* y; m# e4 C" O
3 N% n# U" p s) _' V0 m$ _ 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
. o- f4 p1 w S; v/ @8 z" {- P
+ H q+ e2 U; ~ -l size Send buffer size. + H3 d3 Y: y+ u/ Y& g" j
/ y8 d& I, ^! T; z; [ 定义echo数据包大小。 |
|