捌玖网络工作室's Archiver

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

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 $rS ?Oy(`9k
  
)ay \4}!m   现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
,y`S-v#v5{8ZO    lB,Lv!a
  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 lyLs-Fy2Z
   [([ u"TKA
  Options:
Z4ibI0M   
6n'nO,v1m{ GD)pM }   -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
"vW0r c b   
v@#qEK7y:r)W   不停的ping地方主机,直到你按下Control-C。 | hs{ Q!^#kO
   {bRW[1k@
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
B1Q4r.Q y0E]+CV    AY6Xo7x~2q.w
  -a Resolve addresses to hostnames. &E&@2qk6pd |8Xt
   ;]1K$n}H:b*x
  解析计算机NetBios名。
!rTk5K!T#E!H   
U^2n:?9P:d`   示例:C:\>ping -a 192.168.1.21 0s*i#?+}P"l
   '`/`r&sq4]9H?w^
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: #bUt"T0_-k.Z7C-D
  
6Kc k tY:n   Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 :X'P0^)E#O
  
2g.s7f"~/d   Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
6B9b,_5t0p-]    {"{ i vT0W1~ i$e
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
^MvM3i
f/\t}{t(R E   
.zW:Y [2Pc+A   Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
/mhG[ I(w8ts{    Lony)?@)[
  Ping statistics for 192.168.1.21: x'e+sC$bc
   F mGl M
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: ,C|zCAcm_
  
xSlt]]   Minimum = 0ms, Maximum = 0ms, Average = 0ms
c ZB*YG&P)i:h    Z*}y]s s0U.n.gAc
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 Lp iR A%Tt Ry
   2z d`~!pL
  -n count Number of echo requests to send. M8@2[ ?};k
   ~kqic)|%P
  发送count指定的Echo数据包数。
}:[@-LQOt   
f8Q}g YTY   在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 1tj4q c mFJG7Q N
   .^4ld;l9W5B*a/VW
  C:\>ping -n 50 202.103.96.68
YmQ]5o'i   
;S8hDz(`*K X}*C   Pinging 202.103.96.68 with 32 bytes of data:
$M h'k%wis0p(qE2r    %qw2M x6@6d
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
0\H^ b0Z3xt   
$d(pN#U:f)E2H+f(A   Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 -H"zZ6Ru,x
   w Z-Q]fE2t2h3xe
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 vC+Y}'e po
   oC*Rmk!H3p#u
  Request timed out. ;L-B9LK4y[
   4F-~B-vN
  ………………
k D{VL%\    6qh#Io)N+^
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 {,jGT-wAnn
  
d#x wIlPG%{   Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
(a3|?/l n7o/g   
6?o0Q4~(zAh   Ping statistics for 202.103.96.68: }9yD5f[#B/X
   EL&[.r w#|W
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 6Cjc&y V7K)wh
   B6a'_/y,ih_+Lo M M
  Minimum = 40ms, Maximum = 51ms, Average = 46ms 'r"Rp.J1R N+|
  
1\!s|'^zHTR D   从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
-E:PD7`1k]   
~_ u)XU   -l size Send buffer size.
#MsX![~d(G?E   
$[n&P"{2N1Usk7V1Wq   定义echo数据包大小。

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

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

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


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