实验代码:
https://github.com/ramonfontes/reproducible-research/blob/master/mininet-wifi/ACROSS-Sweden-2017/handover.py
wget https://raw.githubusercontent.com/ramonfontes/reproducible-research/master/mininet-wifi/ACROSS-Sweden-2017/handover.py
mininet-wifi> sh ovs-ofctl dump-flows s3
NXST_FLOW reply (xid=0x4):
cookie=0x0, duration=55.718s, table=0, n_packets=1, n_bytes=42, idle_timeout=60, idle_age=55, priority=65535,arp,in_port=3,vlan_tci=0x0000,dl_src=00:00:00:00:00:02,dl_dst=00:00:00:00:00:01,arp_spa=10.0.0.2,arp_tpa=10.0.0.1,arp_op=1 actions=output:1
cookie=0x0, duration=55.716s, table=0, n_packets=1, n_bytes=42, idle_timeout=60, idle_age=55, priority=65535,arp,in_port=1,vlan_tci=0x0000,dl_src=00:00:00:00:00:01,dl_dst=00:00:00:00:00:02,arp_spa=10.0.0.1,arp_tpa=10.0.0.2,arp_op=1 actions=output:3
cookie=0x0, duration=55.714s, table=0, n_packets=1, n_bytes=42, idle_timeout=60, idle_age=55, priority=65535,arp,in_port=3,vlan_tci=0x0000,dl_src=00:00:00:00:00:02,dl_dst=00:00:00:00:00:01,arp_spa=10.0.0.2,arp_tpa=10.0.0.1,arp_op=2 actions=output:1
cookie=0x0, duration=55.713s, table=0, n_packets=1, n_bytes=42, idle_timeout=60, idle_age=55, priority=65535,arp,in_port=1,vlan_tci=0x0000,dl_src=00:00:00:00:00:01,dl_dst=00:00:00:00:00:02,arp_spa=10.0.0.1,arp_tpa=10.0.0.2,arp_op=2 actions=output:3
其中idle_timeout
指,这条flow entry过多久没匹配到flow就会过期失效;而idle_age
指,真的已经多久没有匹配到这种flow了。。。等idle_age
的值到了idle_timeout
就真的失效了。
比较一下,就会发现第一次dump的时候的那条59s的flow entry,在第二次dump的时候已经过期了。
本来这个flow entry就是由于ping才加上的,一旦一段时间内(idle_timeout)得不到这种特定类型源/目的的ping数据包,这条flow就会失效。
再过一会,等所有的flow entry都过期(60s)之后,flow table就没了。
mininet-wifi> sh ovs-ofctl dump-flows s3
NXST_FLOW reply (xid=0x4):