gpt4 book ai didi

bandwidth - tc netem 中的选项限制是什么意思和做什么?

转载 作者:行者123 更新时间:2023-12-03 08:14:11 28 4
gpt4 key购买 nike

我正在尝试使用命令 tc 模拟慢速网络链接.我用 netem模拟延迟和丢包,htb 模拟窄带宽,但我发现 netem 中有一个限制选项,这个选项有什么作用?会影响最终带宽吗?

我用谷歌搜索并在 http://manpages.ubuntu.com/manpages/raring/man8/tc-netem.8.html 中找到了一些东西

其中说:

limits the effect of selected options to the indicated number of next packets.



但我仍然无法理解它的作用。

最佳答案

我不知道 netem 到底在做什么,但我发现如果您不将“限制”设置为更高的值,netem 将无法正常工作 - 即它会以更高的速度丢弃数据包,并且可能还有其他问题,基本上没有准确模拟真实网络。

来自 mailing list CarlH 提到,Stephen Hemminger 说:

The limit value is in packets at least when using the default qdisc inside netem (tfifo). You can also use pfifo and configure it for packet limit, or bfifo same only bytes. The value 1000 is low, you want about 50% more than the max packet rate * delay, unless you are trying to emulate a router with a small queue.



因此,对于 1 Gbps 链路,1 Gbps/1500 字节 MTU * 100 毫秒 * 1.5 = 12500 .

命令:
sudo tc qdisc add dev eth1 root netem limit 12500 delay 100ms loss 1%

我一直在使用 limit 100000,这似乎工作正常,但似乎较低的值可能没问题。

关于bandwidth - tc netem 中的选项限制是什么意思和做什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18792347/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com