标题:
教你正确使用Windows的Ping命令
[打印本页]
作者:
野人e族
时间:
2008-1-27 22:16
标题:
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
1 ~ Q" v; G2 T
0 p; ]( Y) X3 g7 y, x" _
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
4 K/ r3 z( } T4 T- Y
/ |8 H! i1 w' h7 V$ c% H: R0 `
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
; w3 v" w& _, }2 ]& a1 \
( {5 U7 B* Q/ j- U! ]
Options:
9 v/ ^/ s# r) P+ m" v, `
! K( C+ I8 i0 |% F) o3 ]
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
7 ]( U7 v1 E I- ~3 o) I# L, K
1 C, l+ {9 F5 ^( h! X, i0 w
不停的ping地方主机,直到你按下Control-C。
( W# H& J+ ]% ^: K% |) H
+ K3 F- H& d5 Z$ D* k4 a" z
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
3 @! p6 \4 H3 b6 Q c
0 }0 v' ?. _; N! r! q
-a Resolve addresses to hostnames.
5 {, S* Z/ @' T- L5 J
- |: u) B$ x" @' f) Y. g9 [/ P
解析计算机NetBios名。
5 w8 y9 n7 T& g& E$ I
m u0 ]1 v& D0 o6 \9 R6 i
示例:C:\>ping -a 192.168.1.21
, L4 F! i$ {6 w7 ^* `! m M
! E" L7 [% M( Z2 b
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
$ L2 x9 {) C( a' K: T! C& J
" f' O6 w4 o4 x& Z
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
( m$ q4 {$ D% F- g# S0 v8 p1 a; W
- P' z* |% z5 T& T. v# `- `
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
4 {" l6 o, a. s& w8 l: a+ ]
4 \7 y3 j3 h* C
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
6 {) B+ ]/ Q8 M0 O1 N
) c4 [+ d( M* W: B3 z
7 z' \/ | F9 R
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
7 n: [0 m' R, d/ _; ~
. e! ?$ b2 N# }" a& L
Ping statistics for 192.168.1.21:
) p. H/ M: E0 d) e
3 q/ h0 m7 U% b* P O' i1 l# R& v
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
0 K- j. Q" A+ s6 d# e0 O2 z
" J( {& h; e& H; H
Minimum = 0ms, Maximum = 0ms, Average = 0ms
, D: v$ A# W, ^2 Z# U* p/ _
" M; K6 r+ M$ U. ?
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
1 H1 D9 }8 p: r% m: I% {! ^: I
* Y/ u" q2 F& Z* s6 x/ j
-n count Number of echo requests to send.
" ^+ r1 p" d5 I! V/ h' ?% J: ]& H
0 c0 o2 Q" D- c% g5 @" ?3 s
发送count指定的Echo数据包数。
" ~% T7 x) ?, ?1 |' }* U' W
* k% S( B! y* ~
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
& c3 a. U, X9 w; A7 V
& a! O+ O. T! h) T# Q
C:\>ping -n 50 202.103.96.68
. c& G+ ?) K. Z6 ?$ M1 r
/ M5 N; K& ~2 N: T j4 D
Pinging 202.103.96.68 with 32 bytes of data:
, u9 H4 l$ V, {2 }
" ?* V' _1 l+ {- H
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
$ Q; J7 A. t6 T" V
! O; H3 _2 r6 p# f
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: l0 w* u4 S2 K
9 G" r0 W" x( C8 d
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
h/ }2 }. W" I+ \8 T) j% C
" T+ I* L" J8 J% v8 S% J, I
Request timed out.
5 u9 J5 @! S9 y
$ S- U6 e6 D; s! Y: `0 q* v
………………
0 V8 |% ?4 s) j* f z
7 B* h! H! o [ S/ c( T
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
( m* l3 J4 f! k0 M a% j
5 N" N h/ P5 R3 A) \' g/ s
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
/ l# I, e% v W% a1 }$ `
. y7 \- }4 O# {. t
Ping statistics for 202.103.96.68:
7 P8 D( x! H+ U9 f+ }4 Y
) Q! s `! D/ @" K: j
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
4 J" j2 w0 d" \9 H5 \
: a' s m, b/ e" V% a+ c/ p9 Z
Minimum = 40ms, Maximum = 51ms, Average = 46ms
& ?# N' y$ ~& l/ ~' I
5 n L$ U. H* U' L1 E
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
; l d7 x& a; T! q! Z
$ _0 q3 e. O- Q
-l size Send buffer size.
$ |6 R0 D/ j+ P! [/ w" Y3 [. s2 y
7 q2 I! B$ N- u! ^. q3 {
定义echo数据包大小。
作者:
冷雨清心
时间:
2008-9-25 15:54
强大,但是我看得不是很懂!
欢迎光临 捌玖网络工作室 (http://89w.org/)
Powered by Discuz! 7.2