English 中文(简体)
计算上载/下载速度时,
原标题:Calculate upload/download speed by ping

如何以某种平均 p速计算互联网连接的速度。 所涉及的计算是什么。 IS 可以通过定时计算上载/下载限

EDIT If ping is not a solution what else is?

问题回答

我用假计算当地网络的带宽。 我认为,它与衡量带宽的其他手段一样准确(例如下载大卷宗)。 如果你与互联网(即不是信条)有不对称的联系,你也可以使用因特网连接。

这里我如何做:

I have a gigabit ethernet LAN and I want to measure speed between my computer and a host in server room. My MTU is 1500, so I use packet size 1472. Just randomly, I use 83,333 packets in this test (about 1 gigabit). Then:

sudo ping -f -c 83333 -s 1472 192.168.3.103

在结果结束时:

round-trip min/avg/max/stddev = 0.174/0.219/2.078/0.020 ms

平均而言,运送1 500个tes子和接收1 500个 by,即24个 k。

24 kb / 0.219 ms = 110 Mb/s

如果你想把这用在互联网上的一个服务器上,那么你需要将包装尺寸降低到1464(MTU 1492),放弃——f 选择,降低计数,这样它就算得太长了。

页: 1

宽度不同于带宽。 Imagine a carload of DVDs being enforced. 带宽度很高,但排位为huge

它实际上有可能仅仅从像样测量中得出带宽估计数。

在吉杰里连接线上发送1 500个包裹,总需要12.3微克。 换言之,如果你能够按照议定书允许的那样迅速从一台机器向另一台发送两套15千兆克的吉欧连线,就会达到12.3微克。 观察到这种情况确实证实了你的GigE联系,但事实上并不令人信服。

如今,在广域网内进行测量的一个简单例子(假设它不会被拥抱):

HostA -------- RouterA -------- RouterB -------- HostB
        GigE             OC-3             GigE

东道A在迅速继承时分送两包1 500by。 当路由A接收第一个包裹时,它就开始将它推向OC-3 广域网(155Mbps)。 在从A组收到第二批包装单时,将A号运载器放在第一组包装的中间。 它必须问第二包,直到它发出第一份。

When router B finishes receiving the first packet, it forwards it to host B which takes only 12.3µs; meanwhile router B is beginning to receive the second packet. When router B finishes receiving the second packet, it forwards it to host B.

因此,B号接收器的接收量为12.3微克,沉默度为69.2微克,然后是12.3微克的包装接收器,换言之,是81.5微克的越野时间。 从这一观察来看,B号主机可以推断,路带宽仅限于155Mbps。


现在,这在理论上是巨大的,但在实践中,事情变得更加复杂。 拥堵事件往往很杂乱,因此,一度路人点可能很满,其次空。 许多样本对于取得任何有意义的成果是必要的。 精确测量也是trick。 终端到终端的相对值可能是帐篷或数以百计的流体,而您则重新审视了几个微秒的差异。 如果从A到B有多种途径,则有好uck。

It s usually just easier to just blast traffic and see how much gets through. Then you ll know for sure what your available bandwidth is—zero.

一种穿透器是经由国际捕鲸委员会向网络发送的一个单箱。 通常每秒一个包裹被送至一台遥远的机器,其路线可能不同于通常用于数据传输的TCP和UDP;遥控机器可能拒绝对假装申请作出答复。 因此,通过粉碎申请衡量网络投入是不可靠的,而且可能毫无用处。

安排一个偏远的东道国将使你能够衡量网络的相对性(即东道方的反应)。 它将不向您提供有关这一网络连接的带宽的有用信息。

无。

包装单是小的,只是用来核实从A点到B点的速度(更为常见的用法——国际红十字与红新月联会之间完全有一条路,如果计算机完全对等)

The process of a Ping (to a Pong) is that a small packet is sent from A to B When B gets the packet, it responds with a Pong, which is instantly sent back to A. At the point A gets the Pong, the total time (which is in milliseconds, hopefully) is registered, and there you have your Ping in ms.

当然,这假设B isn t set to prevent pings or only don t Recs, 或者支持缓刑或其他措施。

归根结底,你们的到来是从A到B和回到A的跳板所需要的时间。

相比之下,试图绕过街道和背部。 衡量时间。 现在找到一种办法,计算你们的重量。

As others have said, ping will tell you latency but not bandwidth.
Try netperf. http://www.netperf.org/netperf/. You may have to give specific options (like TCP/UDP) etc.

尽管做法不实际和不可靠,但还是有可能。

它将在你的地方网络(局域网)上发挥最佳作用。

违约时,<代码>ping/code>发送小包装单,只注明了相对值。 但是,指挥官提出理由修改包装大小和费率。 理论是,你可以把包装单的大小和速度提高到能够支撑连接点的地步,然后,你可以利用包装统计来计算其速度。

相应措施(可能迅速)。 不是产出(能力)。 此外,时间用四舍五入计算。 采用备选办法——c 您可以具体说明(按字体排列)佩带的有效载荷大小。 数据总尺寸是有效载荷大小+头盔。

为了衡量数据率(能力或投递率),你需要具体说明允许有效载荷的乘数,即65536英特(每方位2小时允许的0xFF法郎)。

  • in the most rated answer above, I saw 1500 bytes used per transfer. (and 83333 transfers! - why? ). It will give the wrong results because even if you have a large data pipeline, you are placing a very small data into it; and the data throughput rate will be incorrect - You need to saturate the ping with MAX allowed payload.

下面是我指挥的,随后是我的测量:

 ping -v -f -c 100 -s 65507 192.168.0.24
  • MAX payload used: 65507(i.e. 65535 including headers) bytes
  • Number of round-trips: 100
  • -f option used to flood (i.e. don t wait in between transfers)

我利用这个网络将另一个PC连接到我的子网。 连接使用电离辐射网。 成果如下:

linuxlab@linuxlab-murugan:/boot$ sudo ping -v -f -c 100 -s 65507 192.168.0.24
[sudo] password for linuxlab: 
ping: socket: Permission denied, attempting raw socket...
PING 192.168.0.24 (192.168.0.24) 65507(65535) bytes of data.
 
--- 192.168.0.24 ping statistics ---
100 packets transmitted, 100 received, 0% packet loss, time 1146ms
rtt min/avg/max/mdev = 11.428/11.490/11.702/0.153 ms, ipg/ewma 11.576/11.483 ms

<>计算:

寄出65535tes×2,100次。 所需时间为11.490毫米。

*Therefore: ( 65535 bytes x 2 to-and-fro ) x 8 bits-per-byte / 0.01149 sec = 91259878 bits per second i.e. 91.3 Mbps.

-如果我的回答不正确或需要改进,请提出意见——<>。





相关问题
What to look for in performance analyzer in VS 2008

What to look for in performance analyzer in VS 2008 I am using VS Team system and got the performance wizard and reports going. What benchmarks/process do I use? There is a lot of stuff in the ...

SQL Table Size And Query Performance

We have a number of items coming in from a web service; each item containing an unknown number of properties. We are storing them in a database with the following Schema. Items - ItemID - ...

How to speed up Visual Studio 2008? Add more resources?

I m using Visual Studio 2008 (with the latest service pack) I also have ReSharper 4.5 installed. ReSharper Code analysis/ scan is turned off. OS: Windows 7 Enterprise Edition It takes me a long time ...

Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

热门标签