我正在运行以下命令来模拟 veth 对(Mininet)上的延迟+抖动。
sudo tc qdisc add dev h1-eth0 root netem delay 100ms 5ms
当仅指定 100 毫秒(在我的示例中没有 5 毫秒)延迟时,一切都会按预期工作,因为接口之间的 ping 可以显示确实存在 100 毫秒延迟。
64 bytes from 10.0.0.2: icmp_seq=17 ttl=64 time=100 ms
64 bytes from 10.0.0.2: icmp_seq=18 ttl=64 time=100 ms
64 bytes from 10.0.0.2: icmp_seq=19 ttl=64 time=100 ms
64 bytes from 10.0.0.2: icmp_seq=20 ttl=64 time=100 ms
64 bytes from 10.0.0.2: icmp_seq=21 ttl=64 time=100 ms
64 bytes from 10.0.0.2: icmp_seq=22 ttl=64 time=100 ms
64 bytes from 10.0.0.2: icmp_seq=23 ttl=64 time=100 ms
然而,当添加抖动参数时,大多数时候确实存在 100ms 到 5ms 的变化,但我也得到了大约 4000ms 的巨大延迟
64 bytes from 10.0.0.2: icmp_seq=64 ttl=64 time=104 ms
64 bytes from 10.0.0.2: icmp_seq=65 ttl=64 time=104 ms
64 bytes from 10.0.0.2: icmp_seq=63 ttl=64 time=4391 ms
64 bytes from 10.0.0.2: icmp_seq=68 ttl=64 time=101 ms
64 bytes from 10.0.0.2: icmp_seq=70 ttl=64 time=101 ms
64 bytes from 10.0.0.2: icmp_seq=66 ttl=64 time=4393 ms
64 bytes from 10.0.0.2: icmp_seq=71 ttl=64 time=105 ms
64 bytes from 10.0.0.2: icmp_seq=67 ttl=64 time=4393 ms
64 bytes from 10.0.0.2: icmp_seq=72 ttl=64 time=103 ms
64 bytes from 10.0.0.2: icmp_seq=73 ttl=64 time=100 ms
64 bytes from 10.0.0.2: icmp_seq=69 ttl=64 time=4390 ms
64 bytes from 10.0.0.2: icmp_seq=78 ttl=64 time=102 ms
64 bytes from 10.0.0.2: icmp_seq=74 ttl=64 time=4392 ms
64 bytes from 10.0.0.2: icmp_seq=75 ttl=64 time=4393 ms
64 bytes from 10.0.0.2: icmp_seq=80 ttl=64 time=102 ms
64 bytes from 10.0.0.2: icmp_seq=76 ttl=64 time=4393 ms
64 bytes from 10.0.0.2: icmp_seq=77 ttl=64 time=4390 ms
编辑:我刚刚检查了这个问题是否也发生在真实的界面上,确实如此。
我错过了什么还是确实存在问题?