|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 0 o4 d0 |2 h( I2 j5 g
! U; s' k: @5 \& }% m% E z, t+ w
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: & r4 T# u+ ~4 a' ] @' O
" S4 C( r0 |6 m0 q! g 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
! v7 R, A2 Q& W/ O# o8 c , {9 @ I) o( G V4 u4 _( [
Options:
( A: n) {* Z# ~. X* ] n2 G4 n + D( @* [3 Y% m. \
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 3 a1 ?! N- U& W
; t% A8 r! N, Z. [. s 不停的ping地方主机,直到你按下Control-C。
( `- j- |* D% f- V
7 l- o, t+ |( V, _( f7 t, i 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
7 T5 _; Z1 c) E% f5 x 3 x; r6 H/ y1 b$ S. ^* {( ?
-a Resolve addresses to hostnames. + d4 o% d' P9 `9 Y0 T; y, V
9 ^9 d {, k% x0 | 解析计算机NetBios名。 ! C# R% E0 n2 Z, J
$ y4 z, x- L: n5 {+ Y* K+ v 示例:C:\>ping -a 192.168.1.21 x% C; Q* d- Q- S
* z7 g1 w" X2 c1 C9 c2 m! z1 D/ Q7 Z, `
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 8 f1 J) L6 Q C' }9 W$ M
3 B# c7 l2 W5 a2 Q
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 , W; x5 S! z* h) \8 k+ K
/ a/ N$ ^+ G7 f0 p0 a$ ~/ s
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 # ^" c& |2 s+ d( V. @
% e* b8 E* A. `1 _, G Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
. [) H3 L2 `: M1 [/ V t' z
1 ^4 C: o( d3 V3 f5 i+ k 3 e6 x y% Y8 v. |6 ~# ]
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 V C5 }' Z' ^1 t |; Q0 A8 u: e. F3 h
Ping statistics for 192.168.1.21: % G4 H0 i- S" @. w2 O1 R# X
& B! }3 Y) n% J' }8 s2 I: k0 j/ X6 Q Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: % _# p/ A5 x( [8 s2 H; D7 p. r
. [# o' U' e0 \& _8 N
Minimum = 0ms, Maximum = 0ms, Average = 0ms
# [$ p' V+ x2 h2 o9 s ~ . @. r+ d( i- h. E0 O
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 / W3 s# I H- r. ?; r, n$ @ \* l
3 I( i! X, Q( f -n count Number of echo requests to send. 5 D* f) N* z, u8 {( t
, F2 Z- g* O, G, K3 d% b
发送count指定的Echo数据包数。
( L1 N o9 U( @& [( {
( ]: t3 a) t2 J f a2 h 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 7 c+ v7 ?3 v) ]) o. t
# O5 B: m& _7 S5 t C:\>ping -n 50 202.103.96.68
+ ?' r5 i5 P3 U7 g$ m/ X2 J0 ?2 V ( |) N+ r; x- h+ C+ b* S1 P, f
Pinging 202.103.96.68 with 32 bytes of data:
+ w* d4 t( X5 l! p
+ u7 {, z- d' Q- l8 |% H% s Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
# S9 L) A0 {3 N3 u% `3 Q
. |5 I' S% h- G5 w! b- {6 R7 v Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
% }4 M% g6 r- T# T e; G
: f. O. {) Y) }3 Q P G Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 A! y+ g9 D" d; H
$ J$ @0 X* b& v Request timed out. . ]& a. n2 C+ L
! o E& j2 X4 Y6 a ………………
6 G2 | ^* G& v9 c8 y' b4 p
6 I7 }# }4 d: h* K4 r' W Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 0 I$ d5 J4 F7 Y% f! \! l
! _" D0 b7 b* V2 o Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 9 }* f" ]' v1 p' V6 ?
/ O8 a# U2 W* B2 T Ping statistics for 202.103.96.68: ) {; ^( N: W* J# i% { k1 d! T
7 ~; U3 {' ~+ C6 F+ E4 o Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
8 ?9 l, U) `' S6 u3 Q' u - ~2 ?" e* m0 S6 R D
Minimum = 40ms, Maximum = 51ms, Average = 46ms
) ^& s8 Z! G+ }$ s
7 F* c, h* M0 o" }2 `/ j3 R. { 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 5 [( j+ H( K$ C- C
- g5 W. f7 C, B2 h; v( G" l
-l size Send buffer size.
0 h0 c6 J7 H* z) \# b9 t
: a+ V6 F# s& P2 @ \* _8 q# n, b 定义echo数据包大小。 |
|