是否可以使用 ping 来测量带宽?
我们能否从 ping 服务器所需的时间找到互联网带宽(如果是的话)是如何完成的
Can we find the internet bandwidth from the time it takes to ping a server if yes how is it done
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
不,ping 不会告诉您任何有关带宽的信息,它只是测量延迟。 测量带宽最好通过专门的测试来完成,即传输一堆比特并测量它需要多长时间。 您可能需要考虑带宽可能会因许多因素而发生巨大变化,例如:
No, ping tells you nothing about the bandwidth, it just measures latency. Measuring bandwidth is best done by a dedicated test, i.e. transferring a bunch of bits and measuring how long time it takes. You might want to consider that the bandwidth can vary dramatically with many factors, such as:
您可以通过创建不同大小的 ping 来进行非常粗略的测量,
然后可以使用较小和较大 ping 之间的延迟差异来形成延迟计算的基础。
实际上,对于宽带速度来说,这不会产生任何有意义的数据。 在调制解调器速度或更慢的情况下,您也许能够获得带宽指示,但不太可能准确且可重复。
但正如其他人已经指出的那样,ping 最好用作延迟的指示,并且有更好的方法来测量带宽。
You might be able to make a very crude measure by creating pings of differing sizes
You could then use the difference in the latency between the smaller and larger pings to form the basis of your latency calculation.
Practically though with broadband speeds this would yield no meaningful data. At modem speeds or slower you may be able to get an indication of bandwidth, but it is unlikely to be accurate and repeatable.
But as others have already indicated pings are best used as an indication of latency and there are better ways to measure bandwidth.
几年前,我对电缆延迟和带宽使用之间的关系进行了一些调查。
基本上,如果您从零带宽开始并增加带宽使用,延迟会非常缓慢地增加 - 直到您达到大约 90% 的带宽。 然后,延迟时间会达到顶峰,到达另一个平台,之后再次缓慢增加。
Some years ago, I did some investigation into the relationship between latency and bandwidth use over cable.
Basically, if you start from zero bandwidth and increase bandwidth use, latency very slowly increases - until you hit about 90% of your bandwidth. Then latency goes through the roof, up to another plateau, after which it again increases slowly.
不,但您也许能够估计延迟。
No, but you might be able to estimate the latency.
请看一下
top-5-unix-network-monitoring -实用程序
Please take a look at
top-5-unix-network-monitoring-utilities
如果您事先知道通道的延迟,则可以测量带宽。
您可以使用大 ping 包并在了解通道类型和预期 RTT 的情况下估计带宽。
You can measure bandwidth if you know the latency of the channel beforehand.
You can use big ping packages and estimate the bandwidth knowing the type of channel and the expected RTT.
我问了同样的问题,但每个人都说 ping 不能很好地测量带宽。 下面列出的这批是使用 ping 进行的带宽速度测试,但其最大限制为 1000kb/s,并且在这种简单的形式中不会进行舍入,但您可以使用它并进行实验。
I asked the same thing but what everybody says is true ping will not measure bandwidth well. this batch listed below is a bandwidth speed test with ping but its limited to a max of 1000kb/s and in this simple form doesn't round up but you can play with it and experiment.