|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 0 [$ j2 d' i& a# c8 T. e
2 w. T( }1 ~$ m3 E 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 6 Q$ k; V2 n& M( s: a5 E# S4 ?
" E( c# ~. }0 r! V) M: b+ ]
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" E7 W0 _- V
, @" E4 ~+ b' z Options:
8 G" _& Q# v1 i2 k* B+ S) m
+ h Z3 D) h& k -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
& G( F9 r2 p2 ~' a; |- g
. `6 Q. ~" [: _, X* I Q- `0 |: u 不停的ping地方主机,直到你按下Control-C。 3 I P* P) E" f6 U0 m
* x4 ~2 B! D1 D+ ~
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 % k5 Z! x- K! b) L3 y, W
" k7 P7 Q$ v9 o% r
-a Resolve addresses to hostnames. # k0 [4 f4 N% A' B- b* i
/ l) @7 G1 Y# M: B1 ] g 解析计算机NetBios名。 ' I3 ?5 h2 M- K3 l! v
6 d, s6 Z2 F( L8 Q 示例:C:\>ping -a 192.168.1.21
% g) I) G6 ^3 B5 K* h! Z
: O1 i9 v3 h' I( H L( I3 U8 Y Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: ' }( F0 ^+ T- o+ r6 K( h
+ g7 `- H i; L* V1 X9 V Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ' Q4 R& v" y% W4 F/ N" K
( Z ^% o1 a" s. X4 }3 b; i
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 & ~/ L" P% E3 v2 r
- k: |! o( V6 i Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
+ d) R1 V' _0 K. e! `
, M9 `- h/ K |% m
* P1 @: Q1 S1 O9 _4 v9 x Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
_, _4 K& G! ~! z! G ( }5 |: @' q- S: C- a* |
Ping statistics for 192.168.1.21: + q% x3 `9 Z* ^! w
7 m- d. A) @' Q2 M
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 5 [) b+ {9 j* l
+ s2 V2 Z0 w' O3 A3 u* W9 }- B
Minimum = 0ms, Maximum = 0ms, Average = 0ms
( H/ f C- k5 w# {3 s
$ ^" }: n; |& I 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
" b8 W- [+ A# O
! I# C8 s, s2 A% g -n count Number of echo requests to send.
2 k( G6 ~4 j* V4 ?+ l" W( {8 N b% n ( S! S! {% ~8 O8 O
发送count指定的Echo数据包数。
$ M5 D; ~% w# s
' E0 K+ j/ v9 T4 S ~ 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
$ @% A5 `, \( m; B, }9 l q
% T* t% x: I: H' N8 |. ]5 p C:\>ping -n 50 202.103.96.68
0 D2 a- }4 L) g/ b8 k5 ]
" N' d7 q) B4 b% x8 W Pinging 202.103.96.68 with 32 bytes of data:
+ w' l5 G6 i+ @* S2 I
9 h8 V; c/ a9 a5 A2 p& X/ c* E Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 d. K, y! m S7 c# C/ u 6 `" x; D, R6 @; L" t
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
6 q' a- U4 D2 j6 V ( L( U9 c# O' k
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ! [8 N: [9 I1 R% S. l0 W
, T& G1 v: Z) B. M" r* M: m! O R
Request timed out. , Z' ^0 `5 }( `) T- c
1 D" r, Q2 h; x! r ………………
" W. c8 {! Y. D Q# Q" g9 M' J. K1 D
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 , q# ^0 d, X$ b; D
( x$ I" g" V8 B$ v5 l" L Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
/ R) L- s M q& w+ I; |
0 q7 o# e: G% D# u* p- t Ping statistics for 202.103.96.68: - ^: u( s9 K, `1 r0 J; P' U1 I
- n9 ~3 A$ r1 A3 T
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
2 j* z9 h, r. u+ f
1 C2 q! T# T t& f' s Minimum = 40ms, Maximum = 51ms, Average = 46ms
- ^) n% u; g4 z% y9 h* m
( K3 z! `3 V; y( P' l/ F 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
/ H* Q1 P3 S0 _7 f$ `2 J 9 _8 A7 a1 n2 H% e1 c$ g9 u
-l size Send buffer size.
' L% T. y' d0 @) E) j$ f
/ Z3 O) y! w) q$ c! C 定义echo数据包大小。 |
|