|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 7 p; b* u r1 o( ?9 V/ `6 u g
+ P& R6 j6 ~% y5 g
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 2 ?) t C) v0 m5 V* m1 I& m
) L% p! J0 V9 w1 ^
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 ! X* z1 Z7 K' e' i' Z W
$ A) w2 I# g7 p9 w6 K' A( \1 m: P Options: 0 t/ [& z$ L. J+ L6 l
6 H5 z- G1 A2 Y
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
. w$ K2 ^ U4 I, H
7 Q8 [; ]! h* A/ u% \, t# `4 e 不停的ping地方主机,直到你按下Control-C。 1 H7 }5 L& a! \; j% m
! D" h# v3 L; f2 z( L! Q 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 ! n3 {7 x2 ^4 c4 _% @0 K! X7 Z
7 T1 A/ \ S: G# h+ y) H! m. Q -a Resolve addresses to hostnames. : u3 M2 g2 ]& h8 U% f" @
$ l3 L' } d( R& | 解析计算机NetBios名。 3 V/ B, E m' y5 ?+ D E: A
1 u; ~5 N$ g& g, O2 d" @
示例:C:\>ping -a 192.168.1.21 9 E' t; x/ X5 h' G6 m1 R! |# C( G* @
8 @5 O5 b }- W Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
% x/ Z' P; n/ x0 O% r 0 j( c: c8 m4 q, y) H2 h( a
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
; ~8 Z D3 G6 D $ s. T$ n$ \4 I& F% @3 P
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
) U9 O* r0 h1 s& Y4 J$ {
( T% w. T' U# g Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 3 a( B' w( ?6 r% j" w1 F9 z
" u$ C* g8 ^. D / k3 N- J# O1 H3 v' W. o
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
3 T$ P" H( F1 J4 x* d' d
/ T, I. ]2 ?; G C( @ Ping statistics for 192.168.1.21:
6 h3 g. V% N* [! ]$ x6 W+ p* B% Y ; A& L6 L1 S; u* L
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
! E% }1 \, f1 y2 h# x5 g 9 y( }1 N& }3 f
Minimum = 0ms, Maximum = 0ms, Average = 0ms / v d& [" j/ ?
! h8 ~+ n2 d& t) M3 m
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
- D) L; T, ?& u9 s9 X4 n
, q+ D! e0 S7 p# j& J. Y -n count Number of echo requests to send. * O# k3 L. u- _6 j3 G
! I% f& X2 D0 w- {9 T3 s, F- I
发送count指定的Echo数据包数。
# v& {) T* O, r" f# m2 j5 U% p' |
: W' l, d. W8 E# S' ] z' Y 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
) c3 ~. e# L, Z5 k% T
" a8 U6 y! L' C0 e C:\>ping -n 50 202.103.96.68 + Q+ h# H- W+ [% b) r$ x2 T3 O
. j% H3 I( o" Z
Pinging 202.103.96.68 with 32 bytes of data: & T* N- \& A/ ] ?" y( _- @. P
; A2 g' n) o2 c. E
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 * j7 t* B4 ?4 t
) {# w3 k C$ V: p$ ]$ s. a+ R, [) B Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
5 {* M+ Y) C& ?/ I- o$ \ ; x; ~, f" L( z6 y# F
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
" b1 T6 z. n5 s4 s# O7 h3 @, R
, }& d0 l8 T9 S2 H Request timed out. , t4 t3 w3 Q$ c( g3 U' j
- p: _& D. i' J, W# d
……………… ' U5 {4 R7 G! }% o9 z: L/ d6 T. O
% F, F& m7 V, K0 j$ m Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 r0 X9 B9 n7 E/ X! \3 K: y * d% V. e z. @/ t6 [- \; M
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; G* j" ~9 ~& `
+ W5 e% s# N7 k% u: N Ping statistics for 202.103.96.68: + j9 T) p; F& O; w% s3 _, Z9 w
& _7 D5 P, B n2 t+ J Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
' b* f% j2 {2 J. o% M( J @
% w8 X% \' g$ Y% H0 g7 Z4 d Minimum = 40ms, Maximum = 51ms, Average = 46ms
" b1 V. ^8 |& `- ]! @ 4 G- A3 e$ r( ]- A1 e
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
* V/ {" u% a- C3 q/ r& s% O
) t$ Z/ B; O. E. ?3 {, A1 e -l size Send buffer size. , }- u) w7 r3 V! n3 f
: C3 C8 ?4 S! K/ t1 P
定义echo数据包大小。 |
|