通过 ping 计算上传/下载速度 [英] Calculate upload/download speed by ping

查看:40
本文介绍了通过 ping 计算上传/下载速度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过一些平均 ping 速率计算 Internet 连接的速度.其中涉及哪些计算.是否可以通过 ping 速率计算上传/下载限制

How to calculate the speed of an internet connection by some average ping rates.What are the calculations involved in it.IS it possible to calculate upload/download limit by ping rate

编辑如果 ping 不是解决方案,还有什么办法?

EDIT If ping is not a solution what else is?

推荐答案

我使用ping计算本地网络的带宽.我认为它与其他测量带宽的方法(例如下载大文件)一样准确.如果您有到 Internet 的对称链接(即不是 adsl),您也可以将它用于您的 Internet 连接.

I used ping to calculate bandwidth in local network. I think it's as accurate as other means of measuring bandwidth (e.g. downloading a big file). You can use it too for your internet connection if you have a symmetric link to the internet (i.e. not adsl).

我是这样做的:

我有一个千兆以太网 LAN,我想测量我的计算机和服务器机房中的主机之间的速度.我的 MTU 是 1500,所以我使用数据包大小 1472.只是随机的,我在这个测试中使用了 83,333 个数据包(大约 1 千兆位).那么:

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

在我得到的结果的最后:

at the end of the result i get:

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

因此发送 1500 字节和接收 1500 字节平均需要 0.219 毫秒,即 24 kb.

so in average it takes 0.219 ms to send 1500 bytes and receive 1500 bytes, that's 24 kb.

24 kb / 0.219 ms = 110 Mb/s

如果您想将它用于 Internet 上的服务器,您需要将数据包大小降低到 1464(对于 MTU 1492),删除 -f 选项并降低计数,这样就不会花费太长时间完成.

If you want to use that to a server on the internet, you need to lower the packet size to something like 1464 (for MTU 1492), drop the -f option and lower the count so it won't take too long to finish.

附言我认为这应该交给超级用户,而不是 stackoverflow.

p.s. I think this should go to superuser, not stackoverflow.

这篇关于通过 ping 计算上传/下载速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆