在课堂上开始使用 Mininet 和 OpenFlow。我想做的是给 ping 数据包增加一些延迟。我有一个基本的 python 脚本,它将添加带宽和延迟约束,如下所示:
self.addLink(host1, switch1, bw=10, delay='10ms')
self.addLink(host2, switch1, bw=10, delay='10ms')
self.addLink(host3, switch1, bw=10, delay='10ms')
现在,让我感到困惑的是,每个 ping 数据包的时间对我来说似乎有点奇怪。毫不拖延地,我的数据包看起来像这样:
mininet> h1 ping h2
PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=1.22 ms
64 bytes from 10.0.0.2: icmp_seq=2 ttl=64 time=1.51 ms
64 bytes from 10.0.0.2: icmp_seq=3 ttl=64 time=1.53 ms
64 bytes from 10.0.0.2: icmp_seq=4 ttl=64 time=1.27 ms
64 bytes from 10.0.0.2: icmp_seq=5 ttl=64 time=1.25 ms
64 bytes from 10.0.0.2: icmp_seq=6 ttl=64 time=0.760 ms
64 bytes from 10.0.0.2: icmp_seq=7 ttl=64 time=1.04 ms
^C
--- 10.0.0.2 ping statistics ---
7 packets transmitted, 7 received, 0% packet loss, time 6013ms
rtt min/avg/max/mdev = 0.760/1.230/1.534/0.247 ms
我预计延迟会“为每个数据包增加 10 毫秒”,但是当我以 10 毫秒的延迟运行 ping 时会得到以下输出:
mininet> h1 ping h2
PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=85.1 ms
64 bytes from 10.0.0.2: icmp_seq=2 ttl=64 time=46.3 ms
64 bytes from 10.0.0.2: icmp_seq=3 ttl=64 time=43.5 ms
64 bytes from 10.0.0.2: icmp_seq=4 ttl=64 time=43.9 ms
64 bytes from 10.0.0.2: icmp_seq=5 ttl=64 time=42.3 ms
64 bytes from 10.0.0.2: icmp_seq=6 ttl=64 time=43.1 ms
64 bytes from 10.0.0.2: icmp_seq=7 ttl=64 time=45.0 ms
64 bytes from 10.0.0.2: icmp_seq=8 ttl=64 time=43.2 ms
64 bytes from 10.0.0.2: icmp_seq=9 ttl=64 time=45.5 ms
64 bytes from 10.0.0.2: icmp_seq=10 ttl=64 time=44.5 ms
64 bytes from 10.0.0.2: icmp_seq=11 ttl=64 time=43.3 ms
^C
--- 10.0.0.2 ping statistics ---
11 packets transmitted, 11 received, 0% packet loss, time 10019ms
rtt min/avg/max/mdev = 42.373/47.836/85.146/11.851 ms
我看不到数据包已显式延迟了“10ms”
我的数据包时间有这么大的价值有什么原因吗?是不是因为交换机和两个主机在我 ping 它们时都增加了延迟,因此时间增加了?