Board logo

标题: 教你正确使用Windows的Ping命令 [打印本页]

作者: 野人e族    时间: 2008-1-27 22:16     标题: 教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
- V" J5 E. `; y* b  
. ^% @. h2 J# Y! |4 e# }# p8 f  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: . ~# ?+ ~4 h$ e% T3 E6 x
   7 b0 w  `# d- j5 I
  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 1 U/ [# }- ^% E0 @
  
- A1 `) f* {! N  Options:
4 ?/ k% }  V, c1 ~( o' M; Y  
2 t# |1 Z. G! w2 v, E$ b1 j! @& y  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
# n. q+ U. t+ m) E  
7 W! d  H5 K2 Z  p2 \% N% ^( B  不停的ping地方主机,直到你按下Control-C。
/ `" p1 u* s2 f: v  
3 }% v( V  V; g" I* i, X  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 ( ?" C( Y" H- }* }, I: j
   * T3 U( Y4 ?# I, a1 f4 g* I
  -a Resolve addresses to hostnames. & J$ J+ C  X, z
  
. s9 i5 V4 X3 ?  T6 ?! M  解析计算机NetBios名。 1 J0 s4 f8 Z5 g# n5 [9 {
   # E0 q6 n, g- @: _! j' ~4 B; t
  示例:C:\>ping -a 192.168.1.21
3 x/ X0 L, f/ S; J) Q) {( b4 L  
+ ~! T) ~" Z% [7 c' s* y, \4 D  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
& X3 @+ N% C' E1 r5 P  
6 o$ E2 Z2 l# @) t: w$ @* A* z  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
3 g" V* b7 O3 p  
- _% k% `4 E) w/ B7 |9 Q  P  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
( n) B$ Z+ S' g0 i  
8 e5 N& i, t% e5 A) ^" c  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 5 o0 ?: S% l8 R4 E' i1 k

/ |4 E# d6 Z0 D( B4 T. o8 {! C   7 a( Z/ U+ U  `5 r' Z4 T
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254   x. H0 r1 T: K. {# g" }
  
& w4 b3 Z' b& g  Ping statistics for 192.168.1.21:
: t% L4 o8 x* W: S8 d   3 B: h6 i4 x( i
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 6 W6 i3 h/ I$ s; A  m% O
  
4 I% R2 Q- }/ s9 N! A* _  Minimum = 0ms, Maximum = 0ms, Average = 0ms % C6 }& R; ?7 U7 P: ~/ ^, P, O. }% ~
  
2 r% q: P# U! E% p  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
% [" P/ i: V0 q1 p8 }% u! Y( g7 f- l   / `! h1 g. I: n- l; e. B
  -n count Number of echo requests to send.
' O8 F; w! I" a2 E) J) E     H9 @# I. [1 b, f: H# K4 A9 {
  发送count指定的Echo数据包数。 + U. S: J7 N, D; }  s! Z/ e( v
     K7 t& X+ [; V. \7 ]( i
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
: O' d! ~* J/ Z. e' h3 c7 H, d  
) I" E+ N4 |! F$ o# u$ ^  C:\>ping -n 50 202.103.96.68 & l1 k, W2 z5 p1 k8 i2 K9 v. k
   ) b" Q2 {5 a' s4 M/ @
  Pinging 202.103.96.68 with 32 bytes of data: 6 H# y* j+ s1 h- P" C; I& [
   8 d( h0 r, U  D# E
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 3 Z" d* r' K0 ]+ I; U% h( _! R  K
  
, x& s4 [+ g+ S( H9 ?  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ! E, J% Y+ g% B; b
   ; s( d) L9 Y8 D0 ?: u; G( u2 K
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
  S, Q4 \$ J% [5 y) p2 J  D' u  
* }& i3 W8 U9 m  Request timed out.
3 a0 {& Y* \, o6 @, {   , O0 m  K' n2 c
  ……………… / G6 A  |2 P7 c4 _7 d2 w4 s
  
0 G. Q6 L) |/ H4 i4 l- U) c  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
. B8 ]8 k! f3 w; ]/ t   ! G9 Q! X8 c4 m% N/ z, {; h
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ) }' H$ E5 b3 B7 y* L3 @
  
/ n6 Q+ Z! ~2 E9 w/ ]  Ping statistics for 202.103.96.68: 8 [" o7 B) i) O4 D4 j' X: H% k; J! y
   ) S0 B0 p* h/ t
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
) c1 S- }% `- z( w& x  
4 o5 `6 S; f' j6 {. j  Minimum = 40ms, Maximum = 51ms, Average = 46ms
! y; V4 p) y. I5 u- D$ }3 h   2 y. J" D! c3 N$ m' f' c
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
) Y; l3 G$ ^9 P- i0 x% Y( U( J  
2 `5 ~( _1 o2 C+ A4 J& X: g/ b& o  -l size Send buffer size. . m" x, s+ x! S' W' {
  
% X9 ]7 i3 e! m/ L- @  定义echo数据包大小。
作者: 冷雨清心    时间: 2008-9-25 15:54

强大,但是我看得不是很懂!




欢迎光临 捌玖网络工作室 (http://89w.org/) Powered by Discuz! 7.2