返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 9 j: c5 K# e7 F% G8 R2 Z2 y
   4 k! l- S8 [& T8 [" y/ N: J8 b% a  A' {. e
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: & ?- J& y) x" D2 I" k
   " R! h% K1 Z& w  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 L/ h1 m- J0 \0 m0 `  
- J: I5 r+ L! p4 n. u  Options:
/ x4 u& b  W: Z0 C% S   8 P$ g: }/ e( Z8 @
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
1 I4 a- z4 N6 X5 Q1 V( ]* z! r  S+ r  
5 e8 H* Y7 n  ^; L% l4 M  不停的ping地方主机,直到你按下Control-C。
. j3 F, g$ L- `/ h$ F( v/ \5 a   2 |! _5 y# }/ S! c' [
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 ! o+ p. K5 i( [. ^  u; t
  
4 `2 }/ M6 ^/ A* R. E. Z8 f  -a Resolve addresses to hostnames.
; T; z/ A( P4 r! V) W* ^, \" C) ?! U   9 h! L6 q4 _: c! \+ v- q3 d
  解析计算机NetBios名。
- f. v- Z: @6 X9 n8 l; y% z5 J  
& D  X( J! P& y$ {% @4 m. ^& h  示例:C:\>ping -a 192.168.1.21 ' g; Y9 T/ X+ h9 m3 I' E
  
" q) m1 k, I' ]8 n( N  ^9 Q  ?  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
5 O- x- Q+ y# a. o  
" {; z# n  N$ }  Z0 G9 c& h- k1 L  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 * Z( P( z5 M" [+ m9 Q4 W% E! D% w! F
  
1 ~" x; D& e) P, ]* W  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
$ R: h+ @5 k0 u) Y  
$ s0 o9 _( g1 g5 m5 C" K  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 : z3 c" M6 C9 f
8 K0 H7 `5 o) S$ H, Q5 w, n: |
   7 C( I* @6 ~" o% ]: Z% P
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 , V; U( s8 L$ u- }4 M
  
  s1 Q1 b7 W9 _. z' v' E! {  Ping statistics for 192.168.1.21:
/ s! u- D! w5 s  
" P7 }0 B% U' d  `. [/ o+ v3 u  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: / h4 O6 ?1 l) x  ?
  
. ^$ I7 ]- O0 X# d) g* s" M  Minimum = 0ms, Maximum = 0ms, Average = 0ms ; l0 m: o/ z. F. y% }) I
   6 K6 P# f# D4 Z3 w- _
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 - ~6 K* x1 P! D7 z/ f
  
+ z- Q2 n7 W) [/ s# t  -n count Number of echo requests to send. 6 Q" j& D1 L  f% H8 X- d
  
2 z- J0 M! y! p/ K8 [  发送count指定的Echo数据包数。
% ?+ r! y7 ~' o& g( p  
0 Q2 ?4 S' X3 @  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: - O7 l4 c$ V) z8 Q( C
  
" _2 Y: J! G* k. d$ {1 n  C:\>ping -n 50 202.103.96.68   v0 Q5 m$ p0 t& I) j
   , ]' e: |' A9 i4 H7 c2 h  S
  Pinging 202.103.96.68 with 32 bytes of data:
% E9 y+ x. X* t1 m  
/ a& l( ]! k  x1 r0 U& q  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
$ G6 }% k1 f, |% l  x: {/ l$ L% o! F  
. o2 O$ Z' _8 v  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 7 b# {. E* M8 W6 b* e
   - B7 g& `9 {' ~* @
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; @/ P, l4 g# e1 {  D   " e  Q/ s  j3 b, v. m
  Request timed out.
; a  _3 z0 ?5 _  s  
/ E1 [+ `& |" w$ L" l3 Q  ……………… $ X' H: O6 t9 e' e* E
  
* s" w: w9 F( o! e2 k  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
8 w' }% L  T( N) O3 R7 |# I  B% i/ u  
; g( O# F; H. c6 Y# J" Z  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
/ y% X, d9 i( {. q/ h5 T   2 [/ M- z; r! J6 R) Y5 y* b$ X
  Ping statistics for 202.103.96.68:
$ T' ~, K/ y5 A9 C7 @1 _9 H   8 ?0 P* h$ A9 Y1 T
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: & O  i- s$ g; X% a3 z: E  P2 n5 A
  
6 t+ g; Z5 c4 t* \  Minimum = 40ms, Maximum = 51ms, Average = 46ms
3 V* \4 j. e1 h0 Y  o  
. b" w8 s# \1 L/ D  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
! b& |2 C$ ]' {; P/ r/ e7 m  
6 ?7 `- b# M/ I/ S8 n  -l size Send buffer size.
$ i  k; Q, b- |' w- d; w) S     ^0 z6 C* @) j9 I. u1 K  I
  定义echo数据包大小。
89w.org捌玖网络

强大,但是我看得不是很懂!

TOP

返回列表
【捌玖网络】已经运行: