  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 i |0 v2 Z& g! T( h& x4 j
' A" _- h& |+ O1 H1 @ 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: / c2 K# p, h2 Q; c4 R! j
: q( f3 `1 I8 a8 _% ~! _ 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
/ w# m) J$ _( F7 t& \ I5 p4 ~8 T& H4 I/ Y- D5 i
Options:
" P0 P6 S3 a( c) ~ 3 T" K/ w2 t- D6 m1 q
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
, M7 A$ S8 L# u8 m
4 x3 @$ A: r% C/ J0 D 不停的ping地方主机,直到你按下Control-C。 0 e; T5 m @6 q( E7 _& a0 I# P, F
% l/ N8 i9 @( P( [8 ^ 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 9 z. d: S9 ~2 z- f2 k
$ P7 |' `( O0 V2 M# \$ B' L1 ^+ ^
-a Resolve addresses to hostnames. 6 N1 l8 _7 }6 U* a4 g3 p3 x
8 R& H* @: T r7 V3 |! Q3 w) ^
解析计算机NetBios名。
8 A8 U2 A. ~$ Z' E" ` | 4 a2 @. p5 |. s. R. D5 V, W: [
示例:C:\>ping -a 192.168.1.21 1 Q9 _: I4 g3 j" y3 O
' q% _; w) C( G; f
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
+ A; [6 D% d4 e! U* s ( O8 p3 m, n% Q% x/ p( V F
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
: a% Q( c! K4 b5 e z- B- h3 M/ g2 u/ n+ Y4 I& a' f" B
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
! R; E- F2 W2 c4 S- C. |# T! l( \ n , e+ W* f8 G6 j
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 " P# g# t+ k9 M& E& P
" W8 a% K# w% S* q7 N
1 F4 \7 d$ q, Q
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
& l0 v+ q$ l! k" }, U6 Z
8 _4 c3 w: A) T3 i1 z Ping statistics for 192.168.1.21:
' E- i9 w2 f; s5 Z4 [2 ?
V, ~ @5 H- g; Z) C% I Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: + K7 x- U! x" Q1 ]5 ?( `( Q$ i
0 }) ?" U, F/ }+ `! H
Minimum = 0ms, Maximum = 0ms, Average = 0ms $ h" m: B# b9 l4 W
/ n* k$ P1 e& w 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
# r* [( w; a, {9 g ! J- I! p' m: a
-n count Number of echo requests to send.
) X, p: h# ` H3 Y; y" ~& M; X # r" c! V9 s7 J( c0 S
发送count指定的Echo数据包数。 ( s" h4 j) S y- B1 ~2 g6 w; V
6 y+ }4 D' z4 |$ l' w 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
8 J* s# } d7 F5 B% R ( i! r/ T: M' ?2 ~( j+ j6 B
C:\>ping -n 50 202.103.96.68 4 V; X3 H4 p" ]
I; H9 c: @# |! R Pinging 202.103.96.68 with 32 bytes of data: l3 M: \5 o, M. T& }$ s
$ s1 E( L7 `: V" S( A+ E/ g
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; M) d8 j2 T+ g. z9 Z8 z
+ _9 i3 W' x C; d6 } Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
9 V! N6 r7 Z ]# z5 i! |
3 ^ U, }) T l6 D4 B Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 e/ ~( g" N' ^! {& J: q7 U! e
7 p- @9 D- ~" R6 ~2 ]
Request timed out. 8 A5 T: l6 t" f
0 B7 v3 i3 ?* \6 O3 I- p ………………
& C: @2 ]+ C6 S9 v$ K $ R8 x, o* L. u) k: S" G
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
/ D8 a5 I& b+ T% @
0 Y7 a3 T7 R2 T$ T( L2 x Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ! E( a$ u1 k. [4 ?) K X* G
' L! J% _9 ~) c- p7 H Ping statistics for 202.103.96.68:
- z4 O1 m" }+ Q2 r) {) d i% Q: v& _+ L4 d
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: + V Y+ \' M( A. i& `$ y+ r2 ?4 d
, y/ H- W5 e9 a
Minimum = 40ms, Maximum = 51ms, Average = 46ms 3 K% w& N- S, N7 m. o
! ~, n) k" f, B8 Y! a6 C& g) w 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
$ x, Y ?; v/ L 6 H; }4 Q6 B3 j8 l, Y( [' ^
-l size Send buffer size. - \. E/ A5 U* k# e3 E3 ]5 R
/ Y- U: U. s, h2 Y
定义echo数据包大小。 |
|