标题:
教你正确使用Windows的Ping命令
[打印本页]
作者:
野人e族
时间:
2008-1-27 22:16
标题:
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
) b& D! y, l8 Y+ d/ a
% M( s+ I. S8 m; }0 O
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
: n3 }7 e+ \+ P0 L
- }- ~ }0 D4 a+ Y; k
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
$ l# e6 R) j: t+ |6 J
8 i( }- [0 M2 ~' M: n% G. D
Options:
5 H) |2 t5 R& c2 h' A$ R0 ?- E
1 o9 w9 v2 ^5 @+ Z9 V& |0 o
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
9 I$ ~$ }3 s, s4 W; W3 h- i
1 k% M, Y# i: F+ {: |" h
不停的ping地方主机,直到你按下Control-C。
' O4 _7 P+ h j5 h: ?
* G8 |% H; y& o4 z1 x+ y' e
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
' _. d% L7 Q" Z3 G6 p9 j
- z6 I. j; ~- b
-a Resolve addresses to hostnames.
8 D# R2 f; v/ `" b
) a/ o2 K" Z: ?4 f- y) N d9 F: o7 R
解析计算机NetBios名。
: f7 p9 E0 Z4 q$ x1 I4 L
- R4 K" c( ]+ u3 s2 |
示例:C:\>ping -a 192.168.1.21
6 R& e3 P- G, x9 e, q" R
& J3 V3 G* b: {8 m0 r2 s0 @
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
) w( H4 w! C* I" S5 \- ~4 e
) R8 w8 }/ t4 k0 g: O9 E* o
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
; Q, `$ h( S( ^$ m6 ^2 @/ a( Y
( I( y, e6 D; v: E }: h
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
* S) S' H. A$ L% f! B
+ B' l! v/ [; `8 m
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
- e: J4 H( P( A5 S) ~& K! X
- e/ ]9 m4 b( s1 u
- t. a' B! S# e
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
4 w% g* |! f- O' q# N4 V
- o+ d4 ~4 ^% k" L. m/ b5 r
Ping statistics for 192.168.1.21:
1 ]0 p4 J* ~4 u; E
+ k; l: i) d& A3 V3 G S8 _
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
( ?$ s9 {8 J& ^ |3 e! G3 u2 ~: f
# |2 |3 m2 p9 m8 R4 x1 A$ T5 {3 a
Minimum = 0ms, Maximum = 0ms, Average = 0ms
' B3 s, f- V& ~4 K- [7 O6 O4 ~
& D. ^; m* Q" G
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
$ }% x, B8 v. F! ^/ a& x! C
) Q% e9 L! q; X! Q& o
-n count Number of echo requests to send.
- ]/ f) q0 P$ R! `5 u0 A3 M9 N
* P7 z% G# Q' w9 ~6 h' [ Y
发送count指定的Echo数据包数。
* `+ a3 p+ ]) X( e% L$ k8 T
5 g, P) \, ]4 Z! T7 h3 N
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
4 h. K# I' m1 K( O$ F4 v
* d; b# k( }0 D' f
C:\>ping -n 50 202.103.96.68
) y- R) ~/ W" y5 I* G
7 X" e' R3 {2 n; }
Pinging 202.103.96.68 with 32 bytes of data:
# N$ f9 ~0 s0 u' a" b9 P) r6 t$ e
( S3 |$ h6 r a& i6 \8 h
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
" {6 M# H! q5 o0 Z/ U* e# A6 w
. Y" X k1 s6 C* y3 b9 N4 o3 x
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
6 ~3 N- _8 C$ `" y* W- n( U# V
# P3 P6 d4 R/ u- l% O
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
- E4 M% p) A( T* K6 E
: Q0 K8 T# ?8 G" i0 P' ?- F$ A+ |' c
Request timed out.
" d F8 K( J) p' t3 q; [6 }
. q$ o$ j5 A$ N7 c# _. O
………………
( {7 G* L$ H" g7 q. R
* x) ^; p* f4 e4 l# A o% k4 z
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
" a \4 x# S* E
$ l! b3 M7 D2 Z% k. P% f3 J1 E: \
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
/ n+ t, s& Z# g. U9 L6 Z" h
; v; Q; V( K3 q0 d
Ping statistics for 202.103.96.68:
) L: O' M8 \2 U; _/ @
N, g+ T; @, p6 B4 ^3 C
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
* v$ a. a8 X5 P- @. E0 U/ G( a
8 M# Q( n4 w# G9 M
Minimum = 40ms, Maximum = 51ms, Average = 46ms
. n0 D& N( V* Y6 Z6 A0 A
2 ~+ A9 {4 U2 r( o7 ~5 g2 O
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
; c6 X8 p4 r0 C# y' Z
7 C6 B3 J% M8 `6 u( I# U* e# A Q
-l size Send buffer size.
, A7 s: v: n4 s
: ^/ {; Y$ h- J: E7 x
定义echo数据包大小。
作者:
冷雨清心
时间:
2008-9-25 15:54
强大,但是我看得不是很懂!
欢迎光临 捌玖网络工作室 (http://www.89w.org/)
Powered by Discuz! 7.2