强制 tbf qdisc 丢弃流量

强制 tbf qdisc 丢弃流量

我的服务器上有多个通过虚拟适配器连接的虚拟网络空间。其中一个网络空间之间的连接限制为 10 Mbps:

root@core-wkst:/var/log# tc -s qdisc show dev veth7dbb.0.1
qdisc tbf 1: root refcnt 2 rate 10Mbit burst 10000b lat 44.4ms
 Sent 3210158 bytes 43503 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 66b 1p requeues 0
qdisc netem 10: parent 1:1 limit 1000 delay 1.0ms
 Sent 3210068 bytes 43502 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 66b 1p requeues 0

此 TBF 工作正常 - 我可以运行 iperf,它的最大速度为 10Mbps,但它从不丢弃数据包。因此,如果我在 iperf 运行时在虚拟网络空间之间运行 ping,我的延迟可以达到 2500 毫秒,但不会丢弃任何数据包。有没有办法强制 TBF 具有固定大小的队列并丢弃不适合队列的数据包?

相关内容