|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
2 z% y! c' s, s& k7 i
( j; m: c! g7 c* }5 c3 q' P 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: ) x9 M& O/ u! W% q- ^
& N# x' X8 x' t 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 : t- \, W7 g; N
9 I& a o7 C1 w/ p/ p Options: 2 T8 w; A! Y, Y1 o3 m. \; e
; [) @6 ~) M1 t1 e -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
8 k2 [1 B" Z- E# [$ e( u1 i
& W: K0 ?7 }5 ?+ {2 N9 }! X$ ? 不停的ping地方主机,直到你按下Control-C。 z. O9 z, P* e
. v3 S+ t, o' b$ A! F) R# ~ 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 0 X' Z$ c- O- R6 t' |
: S' \% i' f; T2 h -a Resolve addresses to hostnames. / L2 b, s+ _- ^1 O
2 U- o0 N0 s2 k& G0 T0 B2 e
解析计算机NetBios名。
3 I0 q/ g, A1 M- c
! w8 F7 U2 H8 K- }. G 示例:C:\>ping -a 192.168.1.21 7 ^& I: [' O- v6 |% k6 R2 V
. {( t/ Y& p! o; L, z7 \' M Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
. a# g6 M7 z+ [1 @- {" L7 I
7 W* m3 i) [: D: ]% I( { Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ?1 Z0 M$ ?$ V) o
" W0 \1 P7 Y, c+ ` Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 6 T5 ^) B9 n5 ?3 p. C( e0 w# y
: l2 B' E0 N% [$ h
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 : N" m3 Y0 _- m$ ?6 m% X
6 m: G* J# B1 t; n
9 {' g7 j O2 m Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ( d9 y# L! N8 t
1 M1 n$ N% W% f$ Q
Ping statistics for 192.168.1.21: / d6 \6 K- ]. X2 {+ G: H; @
$ O d# U$ U1 q* X1 f( ^
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: o \9 U6 R" E& u. @9 |. L
0 G: s3 l* c P1 ] ]
Minimum = 0ms, Maximum = 0ms, Average = 0ms & h, C& @+ q t2 y+ Q' Q& f
! K+ C N% J; W+ z$ p) p 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
' l; h L D8 k7 L* P% | 8 Q# c, {, ]7 m3 L& H
-n count Number of echo requests to send.
v% a+ K5 y# H9 ~" N% ^- v' [
! E* v* e" V! \ W1 f) J 发送count指定的Echo数据包数。
o3 H( H1 x( x" m% o& B! i
H1 g$ I& K1 z ^" w 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 5 b& t. ]9 D$ O1 z+ T8 R
3 h1 K% Y( J" r a
C:\>ping -n 50 202.103.96.68 3 r. T$ i; g; O4 @3 D9 v" u1 P% G
/ t0 d1 }/ `% E r U( a Pinging 202.103.96.68 with 32 bytes of data:
3 c9 o/ R3 @5 k! U. I: u6 J
# V! o) X/ A$ O0 T; @; K Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 5 O7 | a6 { T- v: i
5 B+ o* z& q1 m6 z8 f; |: B
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
9 n+ |5 ]! K' W/ o6 z1 L! k3 V: T M1 n2 p9 u0 U6 v/ M6 e
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
7 c9 Z- W8 j ^) q
% b' a0 K2 a+ t8 o Request timed out.
: c% n' Z t5 \& O
" h0 k' t9 Y+ g# U( t3 C ………………
3 ~" T' q2 ^/ o% v& U
; k; c8 G4 L, k6 n9 q5 Z; x: w Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
) {/ S, ~9 F! [% T9 h" ]# C5 c
# ]6 ^3 s8 T: s" o- ^+ U# a Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 4 \# k) o) R1 K8 U: S' {/ V9 ~
' J7 {4 T; k7 _ Ping statistics for 202.103.96.68:
0 z* D" p+ g0 t& [6 g* v
9 a5 u f" y1 n6 ~1 j+ [ Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
. F+ t1 X) D- e& r: s1 C+ Z0 \
" ]$ h4 ?3 m6 A7 Q Minimum = 40ms, Maximum = 51ms, Average = 46ms
. c; b; X& M" U$ @- o
0 h, N& ]2 f+ o4 I. W 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
z7 s9 R) f5 J" t. t$ \2 Q . M5 d7 U: ]4 R4 _
-l size Send buffer size.
7 M+ G$ H( U2 C" }1 E
8 g+ F$ k% B& m1 b! E% `. | 定义echo数据包大小。 |
|