使用Mininet和OpenFlow开始上课。我想要做的是给ping数据包添加一些延迟。我有一个基本的Python脚本,将增加带宽和延迟限制如下:了解ping延迟
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
我期待延迟到“添加10ms的每个数据包”,但我得到下面的输出,当我跑平与10ms的延迟:
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
我不能看到包已经由“10毫秒”
是否有一个原因,我的包的时间有这么大的价值明确延迟?是否因为交换机和两台主机都在加入延迟时间,因此会增加时间?