|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 1 a' A3 i% h; H% P+ k" i
5 F* b$ G' R& o* @& ] 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: . \4 q% Q5 Q6 |4 [
* z" \9 s A( ^7 k* h- Z 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 4 V& w% z& v- C- N# h. f
+ a% t. h, E' k& I! M1 y
Options: ( j) ~3 {; a. F& c. m
9 W l$ t* p# W o3 x* Y }$ W -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. ! x+ G: J/ i! x7 Q! ?4 s5 R/ `# O
/ \4 m* Z J& d: Y' a% V4 H
不停的ping地方主机,直到你按下Control-C。
1 ], p4 E( w, U9 V- Z6 }
8 T! o* E0 T# X5 | 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
1 E" o9 r! b8 i
0 ]0 d; \3 F. {* [* D. z% y* M -a Resolve addresses to hostnames.
# @! f* Y# D1 ~3 \
: b0 h1 N5 ` ~% G; z3 ? 解析计算机NetBios名。
# O' m2 I( {/ Z
; c% m" U% x/ U9 V3 D 示例:C:\>ping -a 192.168.1.21
% h4 Q( J; q% H" D: ~+ f
( R# t8 E$ ^; _/ w Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: " P9 Z# ] L7 V# C
' e) z7 \$ @/ w) T+ H Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ) z7 z0 ]2 J8 t
( F- ]8 X' S+ h7 q9 E, f- L5 ?1 D! k0 [
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
8 @0 W, A/ T# M; }5 V6 R) q0 A 4 |% Q5 d2 T! R2 g8 M+ B& e
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 / h5 N! ~6 ^' O
! \( `% }7 s; O+ ? N) S9 { 0 B, \ P* f4 x/ J. W) l6 ~4 N
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
( s) H7 s8 i. ^) j" _+ |
; d, U4 Z( [+ @1 n Ping statistics for 192.168.1.21:
7 `& o1 g/ D! ^4 Q/ b 7 x3 n# L$ B7 B8 `4 {4 U6 C
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: " y H8 \" T% a7 q
9 [$ J' Q! D% g0 M3 U
Minimum = 0ms, Maximum = 0ms, Average = 0ms
; p( T, U: r) h$ M, J
+ l7 z9 f" ]2 N# T 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 6 U3 L7 ]/ j [! W3 u
- s! ?: b5 n& A% w1 W1 J -n count Number of echo requests to send.
+ m% q+ ]* c# ~. ]; s
5 c) j' j% v1 ~/ T3 n3 R' z" d 发送count指定的Echo数据包数。
$ B/ K# M8 p0 P; f! Q 6 V$ _ N& n# r3 L& L5 P
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 9 c! Y/ k9 P5 c! A9 @
p9 b# _7 u. Q$ j7 b
C:\>ping -n 50 202.103.96.68 2 G/ r0 r1 q1 _
; D4 @; b+ c' e% U
Pinging 202.103.96.68 with 32 bytes of data: 0 k- e+ s- U; [2 U7 t+ D8 c$ h
/ l* m' Y5 S( I6 ?7 g Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 7 [/ k$ J" E8 x4 n8 e* J
3 G* X# B% L. u* z' F& W Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
1 B T. ~$ K+ t$ z+ Y1 ~( d
0 }7 }9 M( |6 T, q! j+ U8 s Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
# s8 V: V+ F" E " p0 X) i. P0 [9 h: a
Request timed out.
$ j3 d- F" L* A, x" v& W+ E
; Z+ M$ R* a2 N ……………… % z& `7 u1 V6 C) z$ Y
, R# b, E+ t& {5 x2 W% Y4 @ Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
' n7 j! M5 u6 Z! F; G 7 o, R/ E1 y2 K2 s) V+ J
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
9 ~7 F& g2 n' }% V! \9 F4 |( n
! ?, q) M) f9 b Ping statistics for 202.103.96.68: ( ?/ \" }" U% _1 x, `; R5 [
g9 S* O8 q( `5 P
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
}6 V7 U6 g1 r0 y1 e' R
; h: c# n+ j3 P$ ? O |) Z, E Minimum = 40ms, Maximum = 51ms, Average = 46ms $ M* X! F* X9 c+ z
) g; U8 E8 H# r 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
/ U0 \5 a% E' {& Y) q; ?
8 B. K$ R. l- a3 v- I. H4 n -l size Send buffer size.
9 k4 Q; V0 O$ B$ u( m9 E 5 y* J, T8 o% n
定义echo数据包大小。 |
|