捌玖网络工作室's Archiver

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

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 #HR2wp eI KQK%C ~s0Z
  
4n-C\dEW5}R Q*O(U;kSC   现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
-h;obazptF   
{K~1R%~m%lZG2U   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
QZ,`n'a0F ]A4}'q    Gu%U'~9uh?@*D
  Options: /Zn}sWg\
   BV8K Zv#a4KzqA^0}
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 8xuOXj(G~
  
~-b,C\y#D*\)I   不停的ping地方主机,直到你按下Control-C。
@IL'^0P*j|   
#l*} [2@(c+yy4u   此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 8~ r1O,oD FW [a
  
${ s bO4Z!^'T.?}   -a Resolve addresses to hostnames. &y+hR#?C$[ZR:S
  
@u:CP-y\   解析计算机NetBios名。 E Ofkh?!u
   *`S Q7g1K$kO
  示例:C:\>ping -a 192.168.1.21 T N~6Yc9Xl'M
   (V/|dqLhB,u
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
z&A,Mf_.L    BTnJ/F
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 iT1q:b3y?%F
   6q\E(k(e
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
NR$V3V8Ig1i    z@4V&|u}}6Y^5fS:T.O
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 7zCK3u\]

1})y!LVJs~   
.x\^4eS#bH   Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
e@$h;QeYz$k    -Y+A7c&E6i m
  Ping statistics for 192.168.1.21: 0g [ B ZC/I X Q3q
  
K!r_ ["]6t K_   Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: Cuf+s0U.Y8za+x
  
*yEs[9B)I#h5J5]7H   Minimum = 0ms, Maximum = 0ms, Average = 0ms D@ |j6wo+o"j4}
  
U,XE9I)qx Tog   从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
@`1\6Q5L2\'J"D9T   
.?zz0Oo   -n count Number of echo requests to send. 4^vIV c;?t6|%P
  
3N'r_Y[   发送count指定的Echo数据包数。
G Mq/x*ow    ]QT@,y$H
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
ts MW l*C3y    -H.c5v n A n'e'b
  C:\>ping -n 50 202.103.96.68 _ B2D!Uu]5K
   d&ki+k9A.uF
  Pinging 202.103.96.68 with 32 bytes of data: 'e(` nJ2~r
  
D4o%h;C.W{f   Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
$~%Z:V3};y&Q,W`    D{nf:UU6| \8q
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
W7c%l%lG.I9A j7wckx+`   
7@P&mBV~   Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 .Z%ri7Y9v)G TMw
   1\2ZguP(Z+v
  Request timed out.
v u!K?:^ i   
Kfq$T{5|w   ………………
w:F+zbC`    2Py/{+NI5Du)J
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
_4\m1E(m N$fR|    !|$RX!r%vpj
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 J:oR1]%W?j ],|N%N
  
I5J1h6t L/n&V   Ping statistics for 202.103.96.68:
*| ~9U5V)n4|9r    l_:Ee jS?
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: -xb`N V-TVA}
   5~-|h:wJC1TL6n
  Minimum = 40ms, Maximum = 51ms, Average = 46ms c;dII"CG%[']X?
   :n0K&p+]1d J&j
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 !}Hw@ aTw
  
*aUr ?B2tM H9ZF   -l size Send buffer size.
+E-ou,K+[Q   
3H%{7E@x4Nl_   定义echo数据包大小。

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

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

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


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