标题:
教你正确使用Windows的Ping命令
[打印本页]
作者:
野人e族
时间:
2008-1-27 22:16
标题:
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
- K6 G3 ~1 A! C8 t/ ?
+ {7 r; K; @/ e+ w: J2 W, ]0 C
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
V* J# y7 E% _% c: V. Y& x
( @; q; U4 ~- D9 A0 L7 h& _
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
- u# R! ^% D: N. Y: e/ d( b
! g) t' Q F' W
Options:
2 [+ Y4 P. m* {! F' e! k- _
\; W( j: ]3 Z- v! N' q
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
k% a% s% G! S+ Y* r+ q3 W
' y) x O5 y A& \8 a& B0 R
不停的ping地方主机,直到你按下Control-C。
' G) c, W" S" v6 v1 y
. t: u, \' X/ _' t2 k- S/ b% m
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
/ ?4 p( t% _; q4 r
& T" d2 g8 u; H
-a Resolve addresses to hostnames.
) I5 ?) R, _7 a% g4 C
( O% J, }! U2 Q& n
解析计算机NetBios名。
; ]1 O* w2 k+ O/ @+ U( k
0 D/ Z) e8 D8 v+ [( ]; Q0 }5 U
示例:C:\>ping -a 192.168.1.21
- k- E1 o) V, E+ W
8 x+ L/ \/ ~* P7 j# a/ i; c
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
9 L* m! C0 W1 \4 t3 |
! C- y4 H5 N( p$ `( u! e
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
Y: V& l0 y3 k* L3 f/ u. Y
9 s# b0 I0 f W/ P9 H
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
9 t1 L. h/ W# A4 g7 i" T
8 [1 b% m7 K( }; E
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
s0 o& M& [7 W& D. l$ \
7 d& t/ q/ ?3 E
E% D7 g4 ~0 e; {' z" E0 j7 |
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
! P$ b, O; i1 Z+ i
4 e6 a$ l. p2 o0 d$ N
Ping statistics for 192.168.1.21:
9 b) n# Q7 s$ S- v% p% _( l
! M; J' s( E9 k) @" z$ e4 @! v
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
: j4 `% O# P" Z" q/ C3 O2 x+ V
' y; @. G. | W
Minimum = 0ms, Maximum = 0ms, Average = 0ms
8 Y0 c" e% M4 f0 h' I
e L+ v' ^' ] G; `2 a, {
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
9 s; E- t w( I5 T
. F* A+ e6 }* h0 p6 \0 J2 p) C
-n count Number of echo requests to send.
( J( N! `7 {) M; w
a# }4 @" J* q# y! Z4 i
发送count指定的Echo数据包数。
* V1 x u7 B+ e
* O: T" i1 d, @5 k1 ]1 w. a4 m
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
" A% z0 A& x s
+ G* k6 j5 S% A6 ^) q$ r
C:\>ping -n 50 202.103.96.68
' L5 h& \1 s4 O+ ~3 o0 ] \7 Z5 d
/ r7 O$ v; @& K2 [
Pinging 202.103.96.68 with 32 bytes of data:
; {# P! V( O% d: Z$ Y
% k- V/ C% J1 Q: Y! G
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; R' X) R' `1 J5 l. @3 j( U: W: y
9 J6 J- p- C' I1 a- T
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
6 c/ l& f! q$ _) {8 B
1 F# R$ S* X+ c s3 h
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
9 b% h* u3 j% _3 {; R8 T
& D2 }8 k: F! T5 b) n. E* a8 S
Request timed out.
/ n6 L+ S7 P! G7 p8 R i; z. F0 f
( W4 T7 W) @, y) l9 @- f
………………
& ]2 J; n1 ]; X: }* m
& R* ?) ]3 C. d% d; u" n( J) S
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
5 p7 }6 ?2 T! b, B9 j
: m* ]( U7 P& z8 m
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
6 M/ A' v9 e. E# O6 `
/ [+ A7 t. i" f. k( I
Ping statistics for 202.103.96.68:
6 a( a% Y* S, O) X* [9 u+ h! u9 m
" O1 F) q3 K6 ~' |+ Y$ i4 i
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
9 G& Q' r I6 e* h6 W. W) _' G2 s g
. Z9 C( G' A8 w5 V
Minimum = 40ms, Maximum = 51ms, Average = 46ms
4 S- H6 ~" d2 ?% z. o5 d. K
( x% b, a1 Q0 e B1 `4 c6 g
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
- |' o% ^ O+ P# r% @. l
6 u9 v6 o6 z) Q
-l size Send buffer size.
' I0 P) [* y9 h- S2 n$ W
- ?! R. `" ?, t, I" n! A
定义echo数据包大小。
作者:
冷雨清心
时间:
2008-9-25 15:54
强大,但是我看得不是很懂!
欢迎光临 捌玖网络工作室 (http://89w.org/)
Powered by Discuz! 7.2