捌玖网络工作室's Archiver

野人e族 发表于 2008-1-27 22:16

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 %H"_;r ^7\.Xp2?
  
W3e\l V7N`#I   现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
#~3NyI4Z   
:K5e9A(I;Hrv6|   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
~-a1`F YIV4s_"\'~:|   
Gy6@?1ZhG}$WPD]   Options: 'x]o&m(q,}~.Wm'G)Ps
  
8L#MRiV   -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. ,R g2slq Z
  
8vO0\D6C/qA+nVb   不停的ping地方主机,直到你按下Control-C。
dkO|!RI   
{6~Bn6Ci!d   此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
JVc0`U ]r,h   
d pu.A]z[   -a Resolve addresses to hostnames. 0tlKD*ndw_$zTx
   B'H_nI6Z/m}P
  解析计算机NetBios名。
A {:Wt gM8m    X})x _Z6C%`
  示例:C:\>ping -a 192.168.1.21
Q#e Dz{m1d4A;h   
8sl&I%A'q"{N   Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
}i rL)jiA~&q-x   
o8J$\2z@"q5Z-~s n&@   Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 )B dx\:L"g1~
  
#z A)n#a'vvs   Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
}F^m7@DD.Q)V7Y    l%P7f0g8syLp
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 &Ld3`)|n*} f%G

O-s+Tcj3pY!{8FE;{    )`s:L-l@8|5}h
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 Bpl_i$c"K
   Nf'NV)I p[`
  Ping statistics for 192.168.1.21: G_P9@[ gY?
   c `,h&y [,K8ss"v
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
Wa&w DV6ZLFZ    s@5Y1T dR
  Minimum = 0ms, Maximum = 0ms, Average = 0ms t |[T"X"L
  
B-I-Sq7j#Y)s   从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
}#XF ?.W;^a$z    n9TnM-B;S(d}"Z w
  -n count Number of echo requests to send. -LS(PV;W1|C
   9h7|4I'Vf#QL/G'C
  发送count指定的Echo数据包数。
)n:F L8MR f5_%o.j   
:E D+@)iD4@3T   在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
/c4k}(krwr[R&f   
c,y w [q?4b&A*w   C:\>ping -n 50 202.103.96.68
.k0q#B6Ct;{    $EX O'M.em)d
  Pinging 202.103.96.68 with 32 bytes of data:
c9W*_"{zO"FZO&O    9aK V/Y8n Q4rc
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 /\E$X9mtz(W,] Y
   *Gs)oQ7k
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
|2](hx7sPH2C[3_?    2i/M ?G_ p_7`kO
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
U3a\2gJ HKm   
#t|1f3p:ZZ%W   Request timed out.
%r6U C x/I,u)z j)~;x   
5O8}m7ld#R   ………………
7d*QL:e m0`#j:E    J x;Gx _F
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 7Ep!W2n(YTwx
  
!MOh_Mlkp   Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
f6A(I![c2a9e    aA/W eip
  Ping statistics for 202.103.96.68: c*E#c:W@7J3{u1E~
   &Q4ouU'm"g9hZ;h V1}
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: -P-NI2j |X;q
   R"BL CHK?u
  Minimum = 40ms, Maximum = 51ms, Average = 46ms Da ckR T8QhT
   KK.m2m7E7LtC
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 [2F/?1[ lpW-y-rw
  
Ta*eL}G   -l size Send buffer size.
8S?|P-F$^s   
6{~|RCx[.rg   定义echo数据包大小。

冷雨清心 发表于 2008-9-25 15:54

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

页: [1]
【捌玖网络】已经运行:


Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.