|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 : c- R; F9 u0 _! v8 W7 o8 q
' a2 h9 |0 J0 R) d+ k/ U9 G# r 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: , Z% g g9 p. t5 D& ^. b
% d5 V: B0 J9 Z% S2 H
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
+ i: o% |1 q; f8 O5 u
' J5 @2 h) A$ n9 y6 r3 O3 A Options:
$ Z' J1 z7 M! s" K2 H0 }
) S! ~- p# O4 A -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
8 q, Q5 T4 H2 X3 D
/ [ n E& B$ k 不停的ping地方主机,直到你按下Control-C。 4 z2 u; ~, r1 ~+ C! v, _& p7 b
, [* ?' J+ X7 C4 H( v$ Y' a 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 1 \5 s V3 \. l& o: ?" _4 _5 N2 D
6 s( j: f' V% Z3 R: Q: P' a -a Resolve addresses to hostnames. . k9 K$ w, |% v% p0 V' y$ q% z1 X
1 a. ?, a( T8 H1 H% l2 y# a
解析计算机NetBios名。 1 u0 R& `/ I u( @1 N
. r4 h3 E4 o- M" o" {0 @5 x
示例:C:\>ping -a 192.168.1.21
. G6 j7 d$ [0 t; @
2 J( I( o5 Y4 w8 h! D. t Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: # n) V5 S9 | S. q9 b/ t
x( i6 {3 n) X9 \
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
, c( h9 A3 p& U. V4 S' z : E% F8 x" O2 h0 U: g
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
7 K4 O T# e a4 w
( P8 r$ O" w M" X5 G Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 7 L( u* n7 U; M2 \8 F
6 q' U- c+ O7 K3 |0 N: q! |
, P! ^8 ~# A% a/ u6 N: b8 Z. q Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
* Y. S/ k2 v1 {( ?" t* l) r
8 C: v4 e8 u) w" i+ ?( \ Ping statistics for 192.168.1.21: 3 s4 {) Z& G5 [) B
* ?% x6 ]1 |: q
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 3 H* ?0 ?% N. P
3 p o4 _( e) v2 b( T6 z. T
Minimum = 0ms, Maximum = 0ms, Average = 0ms * m9 Y, H4 C1 ?
8 X' r7 |/ s4 v4 b/ |
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 \, e' z% R% T8 G% N: t
1 |* M* o. q- `( h0 L( E& W
-n count Number of echo requests to send. # q: G& ^6 Q. e" p4 l& S% h' }
/ Q: v+ `& n1 g/ ^ 发送count指定的Echo数据包数。
' r) v, d. s6 H0 H. d
3 U1 j: a5 S G; G) v4 i 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 1 k! q0 u+ A; u) R$ P
7 e6 ~7 d( R8 Y( [9 w C:\>ping -n 50 202.103.96.68 $ R* X- V; e! y+ U( u5 M1 I+ M
# l; @/ C2 j8 G7 b3 N# o4 W2 X
Pinging 202.103.96.68 with 32 bytes of data: * D5 y# H! _; g7 V* L9 j
t2 H6 P+ W+ S/ [5 s
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 / ?! I1 R8 F) ^# T2 M) `! [
2 }2 F& Q; O9 T3 y Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
- A2 K) k) c; E: _
) _4 ^4 V+ g" K% `% i3 c( { Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 " s) q$ V4 M" L, g! o. k, l
" \2 D& X4 x; E) s8 B2 M/ a Request timed out.
! x* |( { C( V3 b [- E4 r E5 y4 l/ L' q
………………
* v; w/ t7 R6 C% [* y6 |& ~ ( D8 G6 @, N- s/ |! [; ~
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
$ \5 J0 ~5 W8 P9 \+ M& O) A 8 `. d! l- |. ~3 h# g* N0 b
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ?; m+ ^! ?2 S5 c
8 v: q( f) X. J& T$ u Ping statistics for 202.103.96.68: , d% h6 X' r: r
3 L/ w, i$ j9 T4 _. g Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 3 N4 I( Z. X3 P+ p
+ ~& C: x) P- Q" d* n0 q) L
Minimum = 40ms, Maximum = 51ms, Average = 46ms 6 `* P. v% w3 V' Z% _ R, n1 }
! @( |/ y" g' U) D# U3 _
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 - G# G! u$ q' U, g- @- [- ?
4 D) w4 O8 q3 F& h' D -l size Send buffer size.
3 X/ m S- Z* y / P7 ]6 \7 w- V0 a3 j* g- @/ t
定义echo数据包大小。 |
|