  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 2 X; S! v- E# B
9 @. }( b' C3 h) ~+ x) {+ H0 m
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
R( e- O" c3 a$ N; P1 d 9 m6 H: ^ c; k7 G8 z
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
# }6 F6 J* g: K& a & u# X" N$ L+ _
Options:
6 R) U8 v; `' B( g, q3 ^6 f* ]4 {+ V
3 N" f, O( I7 y% y/ D3 }. g ~ -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. b2 e( U5 \5 V/ B5 x4 k( _
6 E7 S6 x# h3 i$ |* M! |* T( L 不停的ping地方主机,直到你按下Control-C。 , R3 Q4 ]& i( x' J( N% `
, ~$ @/ P% n& _# c9 H 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 ( p; [* y C ]# C
5 b5 ]8 }! j. [ -a Resolve addresses to hostnames. ( s% q3 Y. i9 N! k* ?( f3 z2 n* Z! V
+ G2 T+ `4 i5 N% M5 C# l 解析计算机NetBios名。 % U" U2 x6 i+ @1 N& V
8 V2 Z9 c2 D% x( g3 y
示例:C:\>ping -a 192.168.1.21
+ H* q, J2 G& @! J) Q8 s' }2 T
. f) W+ O( x3 |( i* i Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
+ |1 ?, s3 T7 S, W& }
, {& B1 S' E9 g7 L5 E, }8 ] Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 - |; H% ?9 O5 [
. h9 i# w: g+ Z Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 4 `' j/ I) N. |3 t
0 r# `8 u4 ]' f. Q Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
* E5 X. F4 |/ z1 E2 e+ z
3 W7 w; V0 a0 u. {
' `$ a. P5 C/ f) S( Y \ Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 5 r+ R. l; [5 ?+ Q
# _, g1 R3 i0 B8 l2 E Ping statistics for 192.168.1.21: - P& ^0 G2 s6 U8 [* n
2 T8 p- I' w" b' a
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
& U! E# k) q# X; j }) f 0 s. ?! v# H; d" w# G
Minimum = 0ms, Maximum = 0ms, Average = 0ms 0 j- a! L0 K) L7 u
* {7 N0 Y1 v- H; ~ 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 % G( _+ n8 U1 L$ _ ~# g
1 G( ^0 W/ J* g. R2 { -n count Number of echo requests to send.
4 j% p7 H5 i$ A " A$ Z O+ e, j9 l- e+ z$ X0 C( G9 B
发送count指定的Echo数据包数。 ) I f& G' m; M& l2 K, V2 o
3 \: ?4 Z/ Y& V& \! t 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ) z8 h0 t9 m, e9 q
7 c" ?2 N' d7 S" D* z- r3 |, \ C:\>ping -n 50 202.103.96.68 X: d9 e, @/ X4 W0 P
. t8 J, w8 b6 ^/ m$ Z1 z* g Pinging 202.103.96.68 with 32 bytes of data:
. v% W( c; n% V5 X8 I k- X, Z 6 D) B% E" c* L, [5 n
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
q# h S% K: a5 ~; ^ 2 ]0 ]( _, N; M; y$ u* Y
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 , ^ p5 Z9 B- P1 r& `; x7 I$ ]9 R
; B/ T: r6 ^& g) J
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 v$ [) I( R$ J4 b( m) ?! l
; H# z3 \- Q7 C& O9 p$ | Request timed out.
9 u5 y: h& g, z3 ?5 P
; ~8 Z: G! R* H& c! e; W ……………… 8 T$ H0 L; t1 r0 c
& `' s+ d5 f9 F' {5 h Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 2 Z' V6 r* z+ p; v
: [; ?0 p! m+ W5 ? Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 E3 _: Y' e: M# [
/ X, t2 R, O& ~
Ping statistics for 202.103.96.68: / r5 p3 L- Z) W& M
; d5 d; v, P9 }) ~4 j Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
4 [9 ~6 |9 V8 L1 ?. A ) J. r- E1 d) r) j( q$ K ?' A
Minimum = 40ms, Maximum = 51ms, Average = 46ms - o5 H8 L1 V. u: F/ X
( c% y2 K! i/ n/ [0 b
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
0 o6 p& q( G( X# C4 n2 Z
+ I4 I, X! L6 w: D" C -l size Send buffer size. 7 H* ?& V& O# I* n+ q- X2 G
& t" t) Z% A( C5 r P9 \0 _" `
定义echo数据包大小。 |
|