Board logo

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

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

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
6 o9 G& P; `9 ~     C% U! M/ L! _, M+ j$ ~
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
- I7 V7 R2 e1 y   7 `7 i6 m$ n5 A* A0 l1 ^: E, F2 m7 U
  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 1 C8 r' ~" v6 k8 b5 N, ]1 A4 n
  
5 m: `2 }& a8 z6 I5 P7 y  Options: 3 F5 i/ d! k$ P1 ~- n  w
  
5 f% n/ [' C) e) k  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
1 `1 q) Q; y+ O* `  
7 _; j" s4 u& _4 q- ?" h  不停的ping地方主机,直到你按下Control-C。 * x8 b7 B+ J, o
  
: F. z! ^, R+ K! j2 P4 ~  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
4 r/ T& U* ]3 e, k, G  
/ E+ x% |; X- f7 k( c$ s& o( p" l  -a Resolve addresses to hostnames. % B8 t. W! I: r4 z) U" g9 y
  
2 }( w/ R9 h; r. `& B7 k) k; H  解析计算机NetBios名。
9 g( j( t7 p  T$ _. u  
' F3 v  b8 E7 p) C6 O' Y  示例:C:\>ping -a 192.168.1.21 " q) |7 ?) u  d3 [
  
8 c/ V2 T2 e9 x' m( V3 _& k0 O  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: / z5 ~5 }' b* E6 a- S" {7 l
  
, o# a6 ~4 g3 W5 g2 c) v  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254   \# W, e& N! U5 f  L) x
  
) }& E8 h1 c8 J2 k  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 + ^& x  ~+ r8 T* U0 W' W
  
& B7 b7 Q: c: D" n. q: r/ Z9 K. J  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
, z% C1 l& `' ^
! c7 r# b1 n- J% w. Q3 s0 T( l   ) s3 @/ W. a$ S  O$ w( M
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
& O) u/ v9 D+ }8 E% y   . s2 t1 y! x8 p$ B
  Ping statistics for 192.168.1.21:
. Q0 R0 m) r% F0 ^( c$ S* X! b  
% Q$ b$ @; @/ N: C  S  D  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
" y1 }1 D6 q+ f7 f/ d* V9 k6 ?   5 r9 @1 V, r3 R* c4 s
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
- m4 H* N, f; |/ t7 r+ S  
; t7 d' S2 P% J  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
1 X  O8 T2 [, D* {; c  
* _& \0 [+ q  i# l2 D6 {- L- `  -n count Number of echo requests to send.
0 ~- P: P+ k  P   " J: C% t3 D4 T% {
  发送count指定的Echo数据包数。 * s6 z8 v2 v' O! u3 b$ [, t
  
2 ]0 t; P9 u' h! \/ Z  a  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ) x" O0 d+ {4 l1 J, Q) ?0 X1 y# b
  
+ o: V9 K4 F# E5 Q, M$ P/ o  C:\>ping -n 50 202.103.96.68
( D; D5 A6 S+ Q+ F* _  
; @3 `! W8 I$ }6 A! Y8 W* K; E  Pinging 202.103.96.68 with 32 bytes of data: % l' {0 b2 r# z5 s, W6 ~" i3 m  f
   8 I4 N# G% b4 }/ A/ p/ O
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
) R0 H' N) L- a8 ?6 z& \, Q   ! K' b$ J) q' q. I+ ~, c
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; X5 V1 B# c, ]. F( o- a
   7 o0 Q# C+ O9 f% H7 e. l
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 6 I# |6 n/ c( I$ z9 T  \8 s8 p
  
9 V. N( K$ I3 K. {0 h: I. N  Request timed out.
* \1 d1 \1 O3 O   . K; J; p! Z  ~0 g- n1 f5 r  G
  ………………
' l+ q& _/ i$ ?) p2 h  
8 X. n, q6 a% b. v) n  A9 w6 Z  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
! M* D1 C' e+ b  
/ Z/ Y; b" ^' ^  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 `' L6 c2 ~1 S" [& H$ p
   % X8 a0 W$ L5 q* Q1 I2 E1 f
  Ping statistics for 202.103.96.68:
% n+ J- Y' k( s0 c  
2 I5 o6 j# L  c, R# {  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
) a+ V* `: [8 ]/ R9 [  
! n# Z0 q2 K) J  Minimum = 40ms, Maximum = 51ms, Average = 46ms
3 A$ W& a# _. L/ g' B   9 T  J, q9 d# m
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 4 n7 O  U5 C! s0 T+ [' K+ T
  
( c( i) Q, w; z2 z6 D% O  -l size Send buffer size.
# H4 B3 n. l" L% B! K   6 p2 C& J1 k4 @( a# }
  定义echo数据包大小。
作者: 冷雨清心    时间: 2008-9-25 15:54

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




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