|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
7 B* W6 l. g! f- F& \1 ?/ v+ z
/ ]9 o' Q' e; R# @3 W- J+ u 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: W6 k7 F& F2 P
% w; P4 P+ Y& D- O( x |- t
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
) E1 A! @7 u- M 6 s, E; m* C( i, R' t, b
Options: / Z4 h+ ?0 o+ Y) T) u
D: u2 p5 y% a
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. $ X6 t; D1 J& Z2 @1 {
" ~0 \* @, O( D+ _. u 不停的ping地方主机,直到你按下Control-C。
5 R" }" L6 _( E d
8 m6 F7 E8 C! m5 C1 U 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
) w0 [* D9 x% f
X! ] q) x; e P* ] -a Resolve addresses to hostnames.
2 ^6 E9 ] e- i: {' {# T
. R3 L% i) [ S 解析计算机NetBios名。 ) \" w& J* n, z, K" Y
6 P7 Z6 _" Y/ y% ~
示例:C:\>ping -a 192.168.1.21
1 f6 e# U' Q, o/ I( U z7 x" t \
]* {4 [3 r2 R9 t$ ]4 j, c5 e Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 9 L+ Y ^& Z; o& I$ J3 a
4 a6 f, \0 D1 y5 B2 M% e3 u$ A
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 P3 i' U! a% y) k4 F3 o
9 V/ [5 F A* f' @6 N: w2 t Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ' C- v$ a1 j }2 w: ?- S% x) Z
( Y5 m( `2 \" ?9 ]4 p4 J* S* S Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
3 w7 h5 A! V2 z" {* z8 S' J& s. q+ R! \% M. i' k2 l d. t
$ @9 q2 {) `9 y: u0 t/ r3 ]% u' H Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
+ `# @ o) ?1 U' B& P7 x
' ~# C0 R0 N0 s! ?7 O Ping statistics for 192.168.1.21: * ^4 \, M. p6 ?3 M1 X! o+ w7 m
9 P8 ~* r2 _2 U7 a% }+ h" O$ e
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: - u, w& ~ i- S, K, U4 h, m8 {
" d4 a: H: P' N; z Minimum = 0ms, Maximum = 0ms, Average = 0ms
1 {5 |/ E, G3 O! `% z$ X ) b4 V4 P. q. z' X- O, o$ v2 Y" r
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
# Y% o3 g$ c+ l& h 2 [" n% h- e; h" x9 p5 q" u4 o' V
-n count Number of echo requests to send.
! @( l3 a$ n& L 2 G6 m: G; H/ x3 E* q
发送count指定的Echo数据包数。 o! J! z7 q8 c& P; d
+ D3 S- W B/ |5 ^; E. |
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: - L; v9 _ ~5 B/ |' S0 K
' _# `7 m V1 x+ Q C:\>ping -n 50 202.103.96.68 ; n2 q) y. V2 X6 h7 {# |: @ @% u3 W
( `, P) D2 Z1 K( t% ?- b; { Pinging 202.103.96.68 with 32 bytes of data: 6 \# N6 V. n3 J5 @6 X' n
$ F' g8 W/ M! ^) w/ s Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
$ L$ D/ _. u5 R0 o3 ]
( q! C$ Z2 S8 C! U" M! s8 s Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: n9 }3 @2 |5 D7 ~7 L! O3 O - Z# {& w7 Z2 D2 t
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
0 L" s7 M+ q& a
. \- X" M) h6 K' h* y5 s6 I Request timed out. 1 x) e( ], C+ _6 R! d' n
. l7 \4 N8 a3 y" ]- t' S' Y ………………
% F9 ?; K! L( Q6 [: N( w 1 u, L2 I0 J1 E) j& P* N) G
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
4 }' n+ B% s; L% q' }' G* ^2 k5 N, | D. E% ?6 r7 `, R
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 3 {5 ^/ y7 T! V$ X% n
7 S+ s% p/ R+ q% Y
Ping statistics for 202.103.96.68: 9 Y7 i( ]5 ]& z# Z, f
9 O* ]: ^& \8 ~8 ` Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: & @' d$ L5 P I# }, p: \
* k& u4 N* f) B/ M; m; l7 E- `
Minimum = 40ms, Maximum = 51ms, Average = 46ms
& ^, T l9 y7 D& Y' t# t/ E
. \& c0 e0 J y1 E4 g/ m" j1 @ 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
1 k- m1 [& u/ H) b $ }7 Z0 Q* N3 F, |# g9 a3 A, C
-l size Send buffer size. : H$ l2 z7 z" W) S
x [$ [: t9 q( t* t5 n
定义echo数据包大小。 |
|