可用带宽

发布于 2024-10-04 11:54:24 字数 152 浏览 4 评论 0原文

我想编写一段代码来获取可用带宽。 使用 algorithm.ex.spruce / pathload 之一。

我想要在 Windows 中使用 C++ 编写代码。 我有linux代码。 但我想要一个基于 Windows 的代码,它可以让我上下带宽。

I want write a code to get the available bandwidth.
Using one of the algorithm.ex.spruce / pathload.

I wanted to a code in C++ in Windows.
I have got linux code .
But i wanted a Windows based code , which can get me up and down bandwidth.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

岁月苍老的讽刺 2024-10-11 11:54:24

什么资源的带宽?如果这是一个网络资源,则任何语言或操作系统中都没有任何内容可以为您提供任何真实的带宽估计。您需要调用您需要遍历的链路另一端的某些内容,并及时估计该时间点的带宽。

或者更好地说...您需要调用网络服务器上的文件来测试某人家庭互联网连接的下载速度。请记住,获得的数字仅在该时间点准确。由于任何资源的带宽在实际使用时都可能更高或更低,因为外部因素总是影响带宽(其他进程、用户等)。

为什么需要带宽以及什么资源?

Bandwidth for what resource? If this is a network resource there isn't anything in any language or the OS that will give you any real estimation of bandwidth. You would need to call out to something at the other end of the link you need to traverse and get an estimation of bandwidth at that point in time.

Or better said... You would need to call a file on a web server to test the download speed of someone's home Internet connection. Keep in mind that the numbers obtained are only accurate for that point in time though. As the bandwidth on any resource can be higher or lower when you actually use them since external factors always affect bandwidth (other prorcesses, users, etc.)

Why do you need the bandwidth and for what resource?

此岸叶落 2024-10-11 11:54:24

如果你问,那你就达不到要求。将 Linux 转换为 Windows 需要了解这两个平台,而您显然不具备这些知识。

根据我的经验,几乎所有网络友好的带宽估计算法(路径负载、路径线性调频等)都不适合高速带宽。如果带宽在 1mb 左右,那些旧算法是合适且实用的。此外,这些算法假设网络是“干净的”(没有其他流量)。如今,几乎所有这些“网络友好”算法都不实用。

其他变体带宽估计工具如 netperf、netcps 都是基于强力方法。暴力破解方法对网络不友好。大多数该算法都存在延迟问题(如果基于 TCP)并达到了 HDD 读/写速度(如果写入 HDD 而不是内存)。

IMO,最好的带宽估计工具是基于 UDP(与 tcp 不同,不受延迟影响)的暴力破解(不受其他流量的影响),并具有针对高速网络调整的定制控制流。

您将遇到的其他问题是代码优化。您必须确保您的代码是高度优化的。如果你使用c#,GC可能会带来问题。

If you asking, you not up to it. Converting linux to windows requires knowledge of both platform, which you clearly doesnt have.

In my experience, almost all network friendly bandwidth estimation algorithm (pathload, pathchirp etc) are unsuitable for high speed bandwidth. Those old algorithm are suitable and practical if the bandwidth is around 1mb. Also, these algorithm assume the network is 'clean'(no other traffic). Nowadays, almost all of these 'network friendly' algorithm is not practical.

Other variant bandwidth estimation tools like netperf, netcps is based on brute force method. Brute force method are not network friendly. Most of this algorithm have problem with latency(if tcp based) and reached hdd read/write speed(if write to hdd instead of memory).

IMO, the best bandwidth estimation tools is UDP based(not influenced by latency unlike tcp) brute force(not influenced by other traffic) with custom made control flow tuned for high speed networks.

Other problem you will encounter is code optimization. You must ensure that your code is highly optimized. If you use c#, GC will pose a possible problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文