|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
! `# V! t! R6 C. i, D4 ]/ s
# |: F( V4 X3 y4 W% I) V5 q4 i 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
% e% P1 @# b1 M) o3 t2 v e& M 8 @& n7 X8 C8 H& q4 ~
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
: K5 X/ T5 j8 O8 [' a) w# r
3 T2 G5 `3 V. U Options:
: S0 o H$ q x" U5 b 6 C0 l# g/ Q1 `9 ~# Z
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. ) f7 ^& c0 o" d% G4 u: A
! X( \5 G' r2 i9 u. u/ I8 `# t* R 不停的ping地方主机,直到你按下Control-C。 $ @1 a. }' C, s
! M- m9 K8 Q) N2 G) J. q& @! h$ c
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
1 S/ j9 H- r2 ~8 @/ ?" I4 m
" w* n, z. d% y5 I- x3 A6 t' m -a Resolve addresses to hostnames. 4 X. V7 D: q* n
( B2 s$ M3 V) M1 t6 ]9 o6 V1 z
解析计算机NetBios名。 - \1 F- i9 H, W! S+ a
6 @* d- e1 s3 l! c) @ J 示例:C:\>ping -a 192.168.1.21 w, m x1 @* J6 I
: |# R0 H% O2 V8 Q6 ^/ w
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
/ ^, F7 T$ `1 ^/ V4 e. p: h' z
t2 A' I. V2 G* V4 U2 k Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 1 y& ]+ ~$ K5 A9 ]( L# e0 R
: I4 v @, Q, Y/ S) H# X J0 i
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
8 L0 o7 L! f& b
! X+ ?0 C J C \ Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
6 r, ~. l; m5 q7 W1 p
' E" l, L8 h; O6 r, H' i( c
; S! l6 @* ?/ [ Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 % h) [; p4 J% B- R) T
) v1 L5 w$ Y; ` E. z Ping statistics for 192.168.1.21: . D# K- M) F8 ?9 }# ~
8 {% e+ J9 A, V- A Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: * f/ H; U& `2 b K/ `
2 o/ o: L. r# f, I7 W Minimum = 0ms, Maximum = 0ms, Average = 0ms
1 y1 i- f0 v7 d# H$ {& f8 }7 r/ I% c
9 _* U/ ~! ?7 a" F 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 " j0 n5 V' q( I
* `; y/ Z) L; U8 _. V -n count Number of echo requests to send.
0 B( ~, ^. B0 I( h' s2 h, D4 U
% f" r* a. G7 U8 m 发送count指定的Echo数据包数。 D2 z7 r, ~+ R# C( j& l% G
! e3 `/ y& E# _0 m* K5 ]
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: . F) `* B' D3 l( _
9 S2 m f8 d1 D0 m
C:\>ping -n 50 202.103.96.68 y9 ~, D3 W9 ~1 `7 E' \
4 g, P, U# g- k- a
Pinging 202.103.96.68 with 32 bytes of data: ( J. G9 M0 M c) L/ ?
$ }$ @+ ^/ Q1 x7 }/ w" t Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 G+ Y; E# t2 w3 _) \/ g; f$ } ( q! _7 I& R8 R* Q9 W
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 g$ {5 B8 i6 \9 P: x5 l
' }& i Y) L+ d$ A/ S# \! t Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 6 c! f! P6 i. `+ a: o' L
' e6 N" i' W1 g3 V* A
Request timed out.
2 l' X" B; ^) e
7 w+ H+ f* a$ s1 Z: c1 }. ]* A; n ………………
. K5 g2 H( r9 e7 r/ b - S# ^9 Y# x; m) h
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ' h4 i; D+ j+ ?$ I
, C# W% r7 s9 N4 Z0 `- m' `3 o$ d Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 m) Z. y& j5 Z3 v
2 A4 Y' y+ X/ n, D' b Ping statistics for 202.103.96.68: * C& W1 p% d# [6 H
$ Y% ~; I) u, R7 l1 z
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
/ Q. ?. S! f0 [, e1 c3 ~* m 7 B7 x, [3 z5 J( A, _' r8 i" ~9 F/ W
Minimum = 40ms, Maximum = 51ms, Average = 46ms ) F2 f, Q; k8 i$ k3 E1 r' Q+ }
6 L O9 C2 w* J4 P9 N1 Z# `3 c3 y 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 9 M: g+ F1 e4 r! Y; K' s9 i4 h4 g$ ]
5 B: l- A; s! d$ ^; p: N1 ^2 D -l size Send buffer size.
( {. K' K* B. v0 D' Z & Y3 W ?5 x& `* H) o4 C2 G
定义echo数据包大小。 |
|