Netem 抖动产生问题

Netem 抖动产生问题

我正在使用netemtc在我的网络中生成网络损伤。我注意到,在将服务器从 16.04 升级到 18.04 后,抖动功能无法正常工作。时间延迟和数据包丢失都正常工作,但抖动却不行。这是我的命令:

sudo tc qdisc change dev eth0 root netem delay 200ms 100ms

这是 ping 命令的输出:

$ ping 10.82.96.5 -c 10
PING 10.82.96.5 (10.82.96.5) 56(84) bytes of data.
64 bytes from 10.82.96.5: icmp_seq=4 ttl=64 time=258 ms
64 bytes from 10.82.96.5: icmp_seq=5 ttl=64 time=272 ms
64 bytes from 10.82.96.5: icmp_seq=1 ttl=64 time=4418 ms
64 bytes from 10.82.96.5: icmp_seq=6 ttl=64 time=230 ms
64 bytes from 10.82.96.5: icmp_seq=2 ttl=64 time=4704 ms
64 bytes from 10.82.96.5: icmp_seq=7 ttl=64 time=295 ms
64 bytes from 10.82.96.5: icmp_seq=3 ttl=64 time=4420 ms
64 bytes from 10.82.96.5: icmp_seq=9 ttl=64 time=240 ms
64 bytes from 10.82.96.5: icmp_seq=10 ttl=64 time=290 ms
64 bytes from 10.82.96.5: icmp_seq=8 ttl=64 time=4398 ms

--- 10.82.96.5 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9064ms
rtt min/avg/max/mdev = 230.158/1953.160/4704.921/2069.517 ms, pipe 5

考虑到配置的延迟为 200 毫秒且抖动为 100 毫秒(200+/-100),但所有 RTT 值都是 200 或更高,我预计这里的 RTT 在 100 毫秒和 300 毫秒之间。

如果我只生成时间延迟或延迟和数据包丢失,一切正常:

sudo tc qdisc change dev eth0 root netem delay 200ms loss 10%

ping 命令的输出:

$ ping 10.82.96.5 -c 10
PING 10.82.96.5 (10.82.96.5) 56(84) bytes of data.
64 bytes from 10.82.96.5: icmp_seq=1 ttl=64 time=200 ms
64 bytes from 10.82.96.5: icmp_seq=2 ttl=64 time=200 ms
64 bytes from 10.82.96.5: icmp_seq=3 ttl=64 time=200 ms
64 bytes from 10.82.96.5: icmp_seq=5 ttl=64 time=200 ms
64 bytes from 10.82.96.5: icmp_seq=6 ttl=64 time=200 ms
64 bytes from 10.82.96.5: icmp_seq=7 ttl=64 time=200 ms
64 bytes from 10.82.96.5: icmp_seq=8 ttl=64 time=200 ms
64 bytes from 10.82.96.5: icmp_seq=9 ttl=64 time=200 ms
64 bytes from 10.82.96.5: icmp_seq=10 ttl=64 time=200 ms

--- 10.82.96.5 ping statistics ---
10 packets transmitted, 9 received, 10% packet loss, time 9038ms
rtt min/avg/max/mdev = 200.183/200.220/200.306/0.517 ms

我很确定这些命令在 16.04 LTS 中有效,所以我猜这是一个错误。

事实上,我在桥接接口上应用这些网络损伤,但这并不那么重要。

相关内容