使用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毫秒」
是否有一個原因,我的包的時間有這麼大的價值明確延遲?是否因爲交換機和兩臺主機都在加入延遲時間,因此會增加時間?