linux – 限制传入流量的速率

前端之家收集整理的这篇文章主要介绍了linux – 限制传入流量的速率前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我从未完全理解是否可以对传入流量进行速率限制.我意识到没有直接的方法来控制远程服务器发送数据包的速率(除非你控制两个端点),但考虑到这个限制,下载管理器究竟是如何让我成功设置下载速度限制的?

TCP slow-start和速率限制传入流量之间是否有任何链接?是否可以使用慢启动描述的方法人为地限制发送方的发送速率?

另外需要注意的是,我想要实现流量整形的服务器本身建立PPPoE连接,并充当网络其余部分的路由器.

更新:到目前为止的答案已经对我提出的问题进行了公平的概述,但我仍然不知道下载管理器如何能够限制传入流量,更具体地说,是否可以实现类似的策略. Linux网关盒.

解决方法

下载管理器最有可能按照 trickle paper中的说明工作.

A process utilizing BSD sockets may perform its own rate limiting.
For upstream limiting,the application
can do this by simply limiting the
rate of data that is written to a
socket. Similarly,for downstream
limiting,an application may limit the
rate of data it reads from a socket.
However,the reason why this works is
not immediately obvIoUs. When the
application neglects to read some data
from a socket,its socket receive
buffers fill up. This in turn will
cause the receiving TCP to advertise a
smaller receiver window (rwnd),
creating back pressure on the
underlying TCP connection thus
limiting its data flow. Eventually
this “trickle-down” effect achieves
end-to-end rate limiting. Depending on
buffering in all layers of the network
stack,this effect may take some time
to propagate.

如果您偶尔需要对UNIX系统上的单个程序进行速率限制,那么简单的解决方案就是trickle.真正的流量整形就像您在网关上执行一样,可以使用tc完成.这在Linux Advanced Routing& Sons的Chapter 9. Queueing Disciplines for Bandwidth Management中有记载.交通管制HOWTO.

猜你在找的Linux相关文章