|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 ' V, s9 L' \* D7 r; _
; ~; ~1 P. ?# [0 v3 q1 W 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: , T/ X( g& i# o. z2 Y) o" K8 [
4 l8 y( a( s( R$ W* d; e9 Y
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
% c9 J0 l: L! x' v# m
9 F: {2 D- k; Y1 u3 t5 F2 N1 O- X Options:
3 |3 [/ o* w) a& _- ?! N2 q7 _
1 \6 C7 M" w) m E/ u -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. / u; H, n5 Z6 }5 [' P! [
) S8 f3 o# W1 o) |
不停的ping地方主机,直到你按下Control-C。 ' u- ], D$ q5 n; m0 C
& v: c* b3 @+ p
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 7 A& c7 v; n; f% Z0 Q
3 o5 L" B! H/ M3 u1 j
-a Resolve addresses to hostnames. & v% ]0 [. ]$ ]! w. y, T& e3 @5 x* }
( Y2 j' q) V4 a8 P, M0 b
解析计算机NetBios名。
$ v3 M6 _# J' |0 L$ Z
+ t$ D& }$ E/ _9 y 示例:C:\>ping -a 192.168.1.21
/ ?# b. B6 d5 D3 ?2 |3 ^4 j4 }
3 ~; h, b. V4 U$ ~# n* F Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
% s; n2 H/ ~! |7 {- n$ @/ O # `) T' B2 ?6 z2 B+ }+ I" D c
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 7 k2 J( {- e/ w& {0 q
% L; u% K! b3 p, i
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
. Y A( ^) O5 Q H
* J0 Z8 w; o4 V' B% a; _5 a Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
! Q; l- j6 d; q1 Y+ X# U( K- G1 I" f& g$ ?- ?% W% ^0 K8 h. s
" e4 o! v$ E3 ]4 \( N4 j0 C2 i7 t' X" s
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 , L7 q# o. R! ~0 @
5 h% z9 E" B, T9 F
Ping statistics for 192.168.1.21: / |& r+ c% g3 ~3 `4 b) ?
" b G2 b1 k8 W7 G$ T% t Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
6 c$ \8 ]+ O3 o1 E0 G4 p6 s7 d 2 X+ l, l5 A7 n$ w0 [$ n# D$ t/ H
Minimum = 0ms, Maximum = 0ms, Average = 0ms 9 Y) U' ~0 @0 k) t9 b5 P
; x! g$ K& A8 D! m 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 0 p: v: V# g4 v( k) f
3 ~5 j! ^0 {# n/ S2 l) B7 @4 W
-n count Number of echo requests to send. ' a# \7 o$ Z8 L# V7 M! K
3 n6 n# Z) G, n. t+ g 发送count指定的Echo数据包数。
6 F% G" r* R! X% y8 P; n
8 E5 b. ~/ I! d @- C+ {; a 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 9 q: \4 j8 P) m2 {3 P
, l0 g8 W8 T+ k- a) u8 F9 q9 k C:\>ping -n 50 202.103.96.68
/ V' k" }# M" y, W
; Q3 A$ M# D4 N, \ U( Z1 @: t ]; y Pinging 202.103.96.68 with 32 bytes of data: ! a5 X0 G3 E+ E5 d, I" Q& _
, ~) [ S4 o { R* I3 ^2 h Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
* q* t+ N" v# d. K+ f- H
/ w2 W' N- W1 f6 P* E; p Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 3 L# t+ Z' G! n% ~9 I
) F- a* c/ V; u" A# w
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
9 ?1 q L- X, z {
* B* j9 ]( x4 i' r! A! ^0 G Request timed out.
0 V9 }. y D p 8 r' a' R7 b7 m Q' L1 Y) `; z
………………
' N2 w% w/ L3 @# L& |5 \& m
& D& |0 ~) m- p Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
! N) \8 G+ h0 ?# c9 d: O - [$ |6 v3 E/ ~% Q
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
+ _. e3 l6 h$ L' A) D0 u$ m 4 t- h1 \/ l& M- @' P( @
Ping statistics for 202.103.96.68:
" K7 z ^6 n5 L: q ' t- u; B' U' |* o: t
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ; K5 n z5 g& _/ a7 n* Z; w
H0 a; d% N! G L
Minimum = 40ms, Maximum = 51ms, Average = 46ms 7 X6 N0 S" v; b* Z3 b* P
; ?- e( P2 c- p2 Q& ^- ? 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 . s' `' D* x! r* r3 L7 H
3 }* B# Y% q' H -l size Send buffer size.
+ Y( _5 x/ t' w
% }6 E& A4 W( H* B3 Q 定义echo数据包大小。 |
|