Board logo

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

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

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
/ p2 I, c: a. J! @' K2 h" Z  
$ e. E/ K  X8 j; u' \  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 2 }* J+ k8 R3 t! P* E/ M
  
! X0 U  j0 c* A/ n8 \  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 - j8 [) X0 l6 |4 U: H5 Y
   7 {. K+ j! h' T' M% M' R
  Options: , v: Z0 j8 f( a- m& ~3 s1 w
   ) d) L. W4 @: T0 Y0 V
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
1 T) x# t7 A. q  [  
/ ~* d% C- n$ E  E8 O  不停的ping地方主机,直到你按下Control-C。 ; \4 C2 l! q+ y$ Y+ [4 y' t4 H
   ; w: E2 E3 O; k
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
4 Y; ]! ^, [# D, O' c  
! {( i! m9 B8 V" b1 y  -a Resolve addresses to hostnames. ( d& E% U" B2 G' A, O; V
   7 l0 u4 c( k6 ~# L/ v. Q$ }
  解析计算机NetBios名。 ' G1 c/ _& I6 j: `
   ) c1 ^/ P5 O9 y) h. H) b5 ~
  示例:C:\>ping -a 192.168.1.21 1 ?! I( |: n7 s1 m2 ^8 k
     t, G- b. W# |7 x! P
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
+ Z: w  I! R3 E' O5 G   7 `8 U1 w* v* [# _
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
% `  y# O) `" m; w' T" T7 s  
( C" o4 T7 t' B6 ~# f! @# V  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 3 o$ b* a$ m: G4 U! S% l' p
  
1 l9 s: E9 `% ]' u; `  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
9 d) @; f4 b9 G" z- m5 K. S: G8 o9 X
   3 X" a8 _4 c7 v9 S9 T! s' h' T
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
8 R% `0 G, q- w( ^   . H6 `; u, T& \
  Ping statistics for 192.168.1.21:
+ Z$ y8 W( r: D- c+ W4 R6 b  
$ C& D. O3 H% c  o, g8 r% J  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
7 y& D, L' I: ]# B3 W* ?   1 I3 S8 Q" }* W6 c7 h- C3 ?
  Minimum = 0ms, Maximum = 0ms, Average = 0ms ' U6 }' ?' r3 {* E3 A
   . m) @: s, j7 H* z" u" X  E$ j
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 8 G8 B3 p5 \% r0 T/ G- x
   + `& P) ?/ L9 M5 ^9 A1 {7 K% r' `
  -n count Number of echo requests to send. / ~2 w8 K: ~1 R8 S  U
  
; p9 f0 j+ }6 I# ~; W0 A: n  发送count指定的Echo数据包数。
% P- ]/ Z( L8 F7 ~9 i* q/ F; `  
4 K6 ^" N4 d' {- R& M* u* G  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
) h$ ~. G* K: G2 ?7 a* D  
5 P1 I5 f( \/ p/ i, _' A  C:\>ping -n 50 202.103.96.68 : h& X; E" P0 g- ~
  
$ j2 u3 @# |# {  Pinging 202.103.96.68 with 32 bytes of data:
4 Y1 {/ f* f' C* p& f& A   ) V4 F2 Y: x0 I
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
4 {* D" @1 z( \* _7 B# }   " S# I- M0 i1 c, Y0 _
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 7 I. Q! R9 p( d% ^. W3 V2 s: V% _
  
$ J; U1 W$ P2 Z$ y3 ~& \+ X& K5 g& r  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 2 o3 d: C$ V2 G' p# C. _$ ~- h
     |. a- E' ]% j4 G- p
  Request timed out. 6 H$ G; D6 Y+ C7 {# @
   % Z" m8 R9 m9 k- [6 X0 z4 L
  ……………… 8 Y$ b. D/ e4 Y9 R
   $ e& y( Z; v7 L- e7 S6 [
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 6 O/ i* r+ ~" w/ H- y9 e
  
2 z1 F) e4 f% g/ f5 L' g  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 & Q- p) i0 t  M. D) K" ]$ f( s
  
+ Q: [1 c8 `8 W' ]3 H4 p* S  Ping statistics for 202.103.96.68: " U+ r6 R+ }6 ?8 P/ b
   ' b% z& b( R; O
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: , Y' w, V, V2 W; F# B& a
  
% Z- E( y" @* p" y4 ^) S9 B" P  Minimum = 40ms, Maximum = 51ms, Average = 46ms
: W6 J; G& y2 Y+ A) \: q+ u* a# z   ) C! x( `* r4 O4 i
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
' I2 S3 j3 g1 V3 ?" h9 S  
, a4 Y2 E2 i1 J  Y* Y8 V) I' K  -l size Send buffer size.
5 [5 ]2 h" E; g- a* H. v5 c  
, Z' ~# K  Y$ S6 y$ F. a  定义echo数据包大小。
作者: 冷雨清心    时间: 2008-9-25 15:54

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




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