捌玖网络工作室's Archiver

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

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
3f.j P'h]^ DB    +a K;A[:| t
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
-N.jetp!M+b    B#o^6E!|/P|
  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
RA"qvN&@(p H9i   
j x6scXJ/N   Options:
1N_`_4df8q4K8h   
]-R7`2])O V   -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
Rb&b3n+^]    9VolI}x_
  不停的ping地方主机,直到你按下Control-C。 EJ;A3z%W:@)J
  
Y5E z,~(OWm5E*M R   此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 /g6sb7aV'E+b#u:U w
   %YXpDw:R ?
  -a Resolve addresses to hostnames.
)KD F%D(A    _9P3x8Gm
  解析计算机NetBios名。
/U2xa7y+?K   
.pz2[E,e5F` `   示例:C:\>ping -a 192.168.1.21
_8I3?R#PdN    2Gf/_Xe8E
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
(a O){%n'm~%\` V    5Os q]4O%j.G
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
a|NyZ o%EFe&j4x x   
-iqK5z#| Tt   Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 XuHq2P6Er
  
6{p K6p9x+{#e   Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 $X N&Kcg7U'Z}%\!Y
U[5pj1Zj
  
5c'Md r:vE0zN+Y   Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
r8@.\W`CR U P   
E3L rJa so   Ping statistics for 192.168.1.21:
(Vs&t fG o rx    O,NCiN
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: ].M4i7Z3WN&?
   %ch]T%h Q
  Minimum = 0ms, Maximum = 0ms, Average = 0ms l e!~C%Q5b6~V E
  
.@%X*}!|"\,W   从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 :p\;zEv U(pI0I
  
NT mevx'~ JU.]!?#F   -n count Number of echo requests to send. +Wz's*i4l [2?^!_{
   1D"W P;N.d4`o(P"p"ZD
  发送count指定的Echo数据包数。
ThhF~:J.W$w   
Uf6Tk`n*j9h   在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
$f&q6]:C*J5E:`lNP   
f CBF5ibR \ Fp9^   C:\>ping -n 50 202.103.96.68 D4AZ,j#Ecw
  
j(O:VKDR/V   Pinging 202.103.96.68 with 32 bytes of data: $Vz4bQ V!l
  
x xgT JFt   Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 P T:pv:M4M
  
p/y9a{{(J`   Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
?7b.R+@[L\B9X   
d&O ^,Aq2T%J,iv   Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
9P hO k;}   
]2^]J3|y   Request timed out. &hF|X(g/KL
   ~2s"nkt*q;a f Cbj
  ………………
L H)uDw6dw    {_3hw/w!g1z
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 u'N/?&~]I*sh5s
  
lpI HP&L-s   Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 -IW/K1F cbn$p%L
  
#zdk{)@7E1`-p jk   Ping statistics for 202.103.96.68:
b&Dah/ljtf    dt?1H h Dl`
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
8ryDo%j6Px   
!VI\b{"{&AJk   Minimum = 40ms, Maximum = 51ms, Average = 46ms nc2]Lw.kA
  
C%Oel D0^   从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 7]7t*w-C]PUi?E
   /N{#i/xm"W
  -l size Send buffer size. !d;E iz.g}"z'O)i
   &W5V3xGj(UNs
  定义echo数据包大小。

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

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

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


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