标题:
教你正确使用Windows的Ping命令
[打印本页]
作者:
野人e族
时间:
2008-1-27 22:16
标题:
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
D) ^0 W+ X+ h1 g6 h( U' C Z( C
+ e; F; @. n2 E( u% U9 H
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
- V4 ]5 O% g1 v6 _2 Q( |6 C
$ d( j. n6 S6 O" x
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
7 x7 V W$ A' ~& r% t$ F% |8 b& N& V
, N n4 |" i) \ {' g
Options:
/ g) r& ^! c8 Z- F% W7 f
0 l' \( A) n5 y% p! t; p, u' j9 T
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
7 } T7 p2 Z2 E# [/ c V' c
0 {3 E- U4 [! W5 J+ b) v
不停的ping地方主机,直到你按下Control-C。
7 l* S" E/ S& B, q' O
8 n K! \* S G" F
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
7 |$ r( A3 a% p9 [! N5 |9 |
4 Z( i/ [& G6 G. s; l
-a Resolve addresses to hostnames.
: s, i5 w: B7 z5 k" m$ _
0 F" u$ L; o: _9 |3 u
解析计算机NetBios名。
, [; p" I2 |3 O/ `
! S, M6 q1 D# ?
示例:C:\>ping -a 192.168.1.21
+ N z; a7 i) E% x$ d/ d% Y
: W# X' J+ a7 N5 J% p
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
! E1 S" t; ^3 ^. `( A
- n9 L1 f7 Z" M, C. e& A- t
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
: _9 B( Q: _; N" D5 g
* X C+ l' f, B
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
: s# h$ @. R3 p5 p
0 q0 n. y9 N1 ^8 \
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
9 q; b& r$ V* `/ @- O/ U I
! @9 s# V3 E/ v2 w, y2 {! ~
' k) i; o2 c& X/ d
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
( s2 T/ G8 m3 p! e R5 {4 A
& k4 e f; i3 o0 p) Z
Ping statistics for 192.168.1.21:
8 J8 ?. l5 m2 r. x) q4 R* T7 C7 d
! M9 H& D% q' G2 Z
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
$ o2 a) W) |( F5 K2 u
, e- |8 \0 R4 J) h$ L: j( a$ ]$ l
Minimum = 0ms, Maximum = 0ms, Average = 0ms
3 o ]/ e# |. k+ w$ R
?) \* X6 {0 {, f
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
" S, k* r! z$ m7 k
' Y% S- O: q! L
-n count Number of echo requests to send.
% {( W5 x" H7 H( X) n2 W1 m& T* l
4 S8 G# l1 t5 a; F3 `6 B
发送count指定的Echo数据包数。
+ M* Z6 q; Z0 _0 E
- s- m' L) D) B8 S% A
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
0 |6 r% I; B, { _/ W
6 M/ }6 i3 z$ k
C:\>ping -n 50 202.103.96.68
- r% A5 c, r- M; I0 ?5 x
! i( `& z# A, e7 ^ i$ Z
Pinging 202.103.96.68 with 32 bytes of data:
! `3 w, c X4 P1 k, s" G. _
" W6 `1 m( C; X! H
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 R/ T7 J7 V+ Q. F& q+ R
0 O0 n- b6 a- x# o9 e% }
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
8 f) J- W$ _' X: F
& d6 ?( |, p$ ~
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
( |. t& k9 n* J0 X, [% C+ k+ a) M
% q2 u' l: A1 b& Y9 o+ }
Request timed out.
: _ f* }$ H5 V
$ j: d& ]1 ^" B8 }6 ~
………………
9 h& M; {# p2 ]1 \0 z, `
+ a. O4 V6 `0 Z+ w
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
a% N& R8 |: ^ q7 H
% w' a& x' {+ O3 l# K* X
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
" X1 T3 A3 m5 ~; O# ^
7 X2 m/ {, s1 K* _5 j
Ping statistics for 202.103.96.68:
, X9 p% _. O& [3 p8 n
- m1 |; y; ? C! I, j
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
# H" P u7 |0 \1 u
0 P A1 E2 s4 _2 i& O' v! ^9 \; x; v
Minimum = 40ms, Maximum = 51ms, Average = 46ms
5 O$ Y" l9 b- `# ~8 n
2 Z7 u8 G3 o# j- M5 G
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
! ]4 E, V* a1 ]" I" b
. Q* n @8 X t1 d3 X! }
-l size Send buffer size.
0 s4 N5 E1 |; ]& q* z) O% k
# O3 F4 M, w5 f8 R( s4 |! [8 t
定义echo数据包大小。
作者:
冷雨清心
时间:
2008-9-25 15:54
强大,但是我看得不是很懂!
欢迎光临 捌玖网络工作室 (http://89w.org/)
Powered by Discuz! 7.2