贊助商

欄目分類

贊助商

大家感興趣的文章

搜索

    使用ping命令來進行網站測速

    作者:admin    時間:2010-5-1 0:25:16    瀏覽:
    • 說到網速測試,測試網速,大家?guī)缀醵际鞘褂靡恍?a target="_blank" href="http://www.gazebo2go.com/info/archives/speedtest/2010/04/23331/">測速工具,或者測速網站來進行測速的。其實使用Ping命令也可以測速。

      我們先了解一下Ping命令的使用

      Ping命令幫助說明


      C:\Documents and Settings\Administrator>ping /?

      Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]
                  [-r count] [-s count] [[-j host-list] | [-k host-list]]
                  [-w timeout] [-R] [-S srcaddr] [-4] [-6] target_name

      Options:
          -t             Ping the specified host until stopped.
                         To see statistics and continue - type Control-Break;
                         To stop - type Control-C.
          -a             Resolve addresses to hostnames.
          -n count       Number of echo requests to send.
          -l size        Send buffer size.
          -f             Set Don't Fragment flag in packet (IPv4-only).
          -i TTL         Time To Live.
          -v TOS         Type Of Service (IPv4-only).
          -r count       Record route for count hops (IPv4-only).
          -s count       Timestamp for count hops (IPv4-only).
          -j host-list   Loose source route along host-list (IPv4-only).
          -k host-list   Strict source route along host-list (IPv4-only).
          -w timeout     Timeout in milliseconds to wait for each reply.
          -R             Trace round-trip path (IPv6-only).
          -S srcaddr     Source address to use (IPv6-only).
          -4             Force using IPv4.
          -6             Force using IPv6.

      Ping命令詳解

      使用 ping可以測試計算機名和計算機的 ip 地址,驗證與遠程計算機的連接,通過將 icmp 回顯數(shù)據(jù)包發(fā)送到計算機并偵聽回顯回復數(shù)據(jù)包來驗證與一臺或多臺遠程計算機的連接,該命令只有在安裝了 tcp/ip 協(xié)議后才可以使用。 現(xiàn)在打開你的ms-dos(開始→程序→ms-dos),用win2000的朋友打開cmd.exe(這是win2000下的ms-dos,開始→程序→附件→"命令提示符" 或 開始→搜索文件或文件夾→"填入cmd.exe",找到后雙擊運行就可以了。) 下面我們來看看他的命令:

      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

      參數(shù)

      -t

      ping 指定的計算機直到中斷。ctrl+c停止

      -a

      將地址解析為計算機名。例:c:\>ping -a 127.0.0.1

      pinging china-hacker [127.0.0.1] with 32 bytes of data:(china-hacker就是他的計算機名)

      reply from 127.0.0.1: bytes=32 time<10ms ttl=128reply from 127.0.0.1: bytes=32 time<10ms ttl=128reply from 127.0.0.1: bytes=32 time<10ms ttl=128reply from 127.0.0.1: bytes=32 time<10ms ttl=128

      ping statistics for 127.0.0.1:packets: sent = 4, received = 4, lost = 0 (0% loss),approximate round trip times in milli-seconds:minimum = 0ms, maximum = 0ms, average = 0ms

      -n count

      發(fā)送 count 指定的 echo 數(shù)據(jù)包數(shù)。默認值為 4。

      -l length

      發(fā)送包含由 length 指定的數(shù)據(jù)量的 echo 數(shù)據(jù)包。默認為 32 字節(jié);最大值是 65,527。

      -f

      在數(shù)據(jù)包中發(fā)送“不要分段”標志。數(shù)據(jù)包就不會被路由上的網關分段。

      -i ttl

      將“生存時間”字段設置為 ttl 指定的值。

      -v tos

      將“服務類型”字段設置為 tos 指定的值。

      -r count

      在“記錄路由”字段中記錄傳出和返回數(shù)據(jù)包的路由。count 可以指定最少 1 臺,最多 9 臺計算機。

      -s count

      指定 count 指定的躍點數(shù)的時間戳。

      -j computer-list

      利用 computer-list 指定的計算機列表路由數(shù)據(jù)包。連續(xù)計算機可以被中間網關分隔(路由稀疏源)ip 允許的最大數(shù)量為 9。

      -k computer-list

      利用 computer-list 指定的計算機列表路由數(shù)據(jù)包。連續(xù)計算機不能被中間網關分隔(路由嚴格源)ip 允許的最大數(shù)量為 9。

      -w timeout

      指定超時間隔,單位為毫秒。

      destination-list

      指定要 ping 的遠程計算機。

      c:\>ping ds.internic.net

      pinging ds.internic.net [192.20.239.132] with 32 bytes of data: (192.20.239.132 他的ip地址)

      reply from 192.20.239.132:bytes=32 time=101ms ttl=243

      reply from 192.20.239.132:bytes=32 time=100ms ttl=243

      reply from 192.20.239.132:bytes=32 time=120ms ttl=243

      reply from 192.20.239.132:bytes=32 time=120ms ttl=243

       

            Ping命令格式:

      ping ip地址 -l 字節(jié)數(shù)

      注:上面的命令中 l 是字母l,不是數(shù)字1

      網速等于≈(發(fā)送的字節(jié)數(shù)/返回的時間[毫秒])K字節(jié)

      以上計算的結果速為字節(jié)(byte),不是我們通常說的位(bps)

      如:

      C:\Documents and Settings\Administrator>ping 202.101.224.68 -l 1000

      Pinging 202.101.224.68 with 1000 bytes of data:

      Reply from 202.101.224.68: bytes=1000 time=38ms TTL=251
            Reply from 202.101.224.68: bytes=1000 time=38ms TTL=251
            Reply from 202.101.224.68: bytes=1000 time=38ms TTL=251
            Reply from 202.101.224.68: bytes=1000 time=38ms TTL=251

      Ping statistics for 202.101.224.68:
                Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
            Approximate round trip times in milli-seconds:
                Minimum = 38ms, Maximum = 38ms, Average = 38ms

      根據(jù)上述發(fā)送及返回的信息可以簡單得出到地址202.101.224.68的網速為:

      網速等于≈(發(fā)送的字節(jié)數(shù)/返回的時間[毫秒])K字節(jié)
                    ≈1000/38K字節(jié)
                    ≈26.32K字節(jié)

    標簽: 網速測試  
    x