kytos / flow_manager

MIT License
1 stars 16 forks source link

Flow consistency create flows for removed EVCs #108

Closed italovalcy closed 3 years ago

italovalcy commented 3 years ago

Hi,

The flow consistency routine seems to be outdated in terms of the actual flows it should manager. If you create a EVC, wait a little bit to have all the flows installed and then remove the EVC, the flow_manager will reinstall them later.

Steps to reproduce:

  1. Start Kytos
  2. Start Mininet (e.g. using this topology: https://www.dropbox.com/s/pabgr1qqnwsdxwh/vip-students-mirror.py?dl=0)
  3. Create an EVC:
    $ curl -s -X POST -d '{"name": "Vlan_77_ClientA","enabled": true,"dynamic_backup_path":true, "uni_a": { "interface_id": "00:00:00:00:00:00:00:02:1" , "tag": {"tag_type":1, "value": 77}}, "uni_z": {"interface_id": "00:00:00:00:00:00:00:06:1", "tag": {"tag_type":1, "value": 77}}}' -H 'Content-Type: application/json' http://127.0.0.1:8181/api/kytos/mef_eline/v2/evc/
    {"circuit_id":"c1f684394a25444b"}
  4. wait a couple of minutes to have all the flows installed
  5. Remove the EVC:
    $ curl -X DELETE http://127.0.0.1:8181/api/kytos/mef_eline/v2/evc/c1f684394a25444b
    {"response":"Circuit c1f684394a25444b removed"}
    $ curl -s http://127.0.0.1:8181/api/kytos/mef_eline/v2/evc/
    {}
  6. Wait more a couple of minutes just to let the Flows Consistency routine to run

Expected result:

The flows related to the EVC should be removed.

Actual result:

The Flows Consistency routing recreates the flows:

mininet> sh for s in mia2 mia1 spo1 scl1; do echo "==== $s"; ovs-ofctl dump-flows $s; done
==== mia2
 cookie=0xc1f684394a25444b, duration=10.063s, table=0, n_packets=0, n_bytes=0, in_port="mia2-eth1",dl_vlan=77 actions=mod_vlan_vid:77,mod_vlan_vid:2036,output:"mia2-eth3"
 cookie=0xc1f684394a25444b, duration=10.061s, table=0, n_packets=0, n_bytes=0, in_port="mia2-eth3",dl_vlan=2036 actions=strip_vlan,output:"mia2-eth1"
 cookie=0x0, duration=370.340s, table=0, n_packets=405, n_bytes=17010, priority=1000,dl_vlan=3799,dl_type=0x88cc actions=CONTROLLER:65535
==== mia1
 cookie=0xc1f684394a25444b, duration=10.061s, table=0, n_packets=0, n_bytes=0, in_port="mia1-eth3",dl_vlan=2036 actions=mod_vlan_vid:1169,output:"mia1-eth6"
 cookie=0xc1f684394a25444b, duration=10.058s, table=0, n_packets=0, n_bytes=0, in_port="mia1-eth6",dl_vlan=1169 actions=mod_vlan_vid:2036,output:"mia1-eth3"
 cookie=0x0, duration=370.343s, table=0, n_packets=540, n_bytes=22680, priority=1000,dl_vlan=3799,dl_type=0x88cc actions=CONTROLLER:65535
==== spo1
 cookie=0xc1f684394a25444b, duration=10.060s, table=0, n_packets=0, n_bytes=0, in_port="spo1-eth2",dl_vlan=1169 actions=mod_vlan_vid:3887,output:"spo1-eth4"
 cookie=0xc1f684394a25444b, duration=10.057s, table=0, n_packets=0, n_bytes=0, in_port="spo1-eth4",dl_vlan=3887 actions=mod_vlan_vid:1169,output:"spo1-eth2"
 cookie=0x0, duration=370.347s, table=0, n_packets=405, n_bytes=17010, priority=1000,dl_vlan=3799,dl_type=0x88cc actions=CONTROLLER:65535
==== scl1
 cookie=0xc1f684394a25444b, duration=10.082s, table=0, n_packets=0, n_bytes=0, in_port="scl1-eth1",dl_vlan=77 actions=mod_vlan_vid:77,mod_vlan_vid:3887,output:"scl1-eth2"
 cookie=0xc1f684394a25444b, duration=10.080s, table=0, n_packets=0, n_bytes=0, in_port="scl1-eth2",dl_vlan=3887 actions=strip_vlan,output:"scl1-eth1"
 cookie=0x0, duration=411.382s, table=0, n_packets=270, n_bytes=11340, priority=1000,dl_vlan=3799,dl_type=0x88cc actions=CONTROLLER:65535

From the Kytos log:

Jan 21 22:02:22 6c486f4e0951 kytos.napps.kytos/mef_eline:INFO main:247:  EVC removed. EVC(c1f684394a25444b, Vlan_77_ClientA)
Jan 21 22:03:13 6c486f4e0951 kytos.napps.kytos/flow_manager:INFO main:154:  Flows loaded.
Jan 21 22:03:13 6c486f4e0951 kytos.napps.kytos/flow_manager:INFO main:104:  A consistency problem was detected in switch 00:00:00:00:00:00:00:06.
Jan 21 22:03:13 6c486f4e0951 kytos.napps.kytos/flow_manager:INFO main:107:  Flow forwarded to switch 00:00:00:00:00:00:00:06 to be installed.
Jan 21 22:03:13 6c486f4e0951 kytos.napps.kytos/flow_manager:INFO main:104:  A consistency problem was detected in switch 00:00:00:00:00:00:00:06.
Jan 21 22:03:13 6c486f4e0951 kytos.napps.kytos/flow_manager:INFO main:107:  Flow forwarded to switch 00:00:00:00:00:00:00:06 to be installed.
Jan 21 22:03:13 6c486f4e0951 kytos.napps.kytos/flow_manager:INFO main:104:  A consistency problem was detected in switch 00:00:00:00:00:00:00:02.
Jan 21 22:03:13 6c486f4e0951 kytos.napps.kytos/flow_manager:INFO main:107:  Flow forwarded to switch 00:00:00:00:00:00:00:02 to be installed.
Jan 21 22:03:13 6c486f4e0951 kytos.napps.kytos/flow_manager:INFO main:104:  A consistency problem was detected in switch 00:00:00:00:00:00:00:02.
Jan 21 22:03:13 6c486f4e0951 kytos.napps.kytos/flow_manager:INFO main:107:  Flow forwarded to switch 00:00:00:00:00:00:00:02 to be installed.
Jan 21 22:03:13 6c486f4e0951 kytos.napps.kytos/flow_manager:INFO main:104:  A consistency problem was detected in switch 00:00:00:00:00:00:00:01.
Jan 21 22:03:13 6c486f4e0951 kytos.napps.kytos/flow_manager:INFO main:107:  Flow forwarded to switch 00:00:00:00:00:00:00:01 to be installed.
Jan 21 22:03:13 6c486f4e0951 kytos.napps.kytos/flow_manager:INFO main:104:  A consistency problem was detected in switch 00:00:00:00:00:00:00:01.
Jan 21 22:03:13 6c486f4e0951 kytos.napps.kytos/flow_manager:INFO main:107:  Flow forwarded to switch 00:00:00:00:00:00:00:01 to be installed.
Jan 21 22:03:13 6c486f4e0951 kytos.napps.kytos/flow_manager:INFO main:104:  A consistency problem was detected in switch 00:00:00:00:00:00:00:05.
Jan 21 22:03:13 6c486f4e0951 kytos.napps.kytos/flow_manager:INFO main:107:  Flow forwarded to switch 00:00:00:00:00:00:00:05 to be installed.
Jan 21 22:03:13 6c486f4e0951 kytos.napps.kytos/flow_manager:INFO main:104:  A consistency problem was detected in switch 00:00:00:00:00:00:00:05.
Jan 21 22:03:13 6c486f4e0951 kytos.napps.kytos/flow_manager:INFO main:107:  Flow forwarded to switch 00:00:00:00:00:00:00:05 to be installed.
Jan 21 22:04:13 6c486f4e0951 kytos.napps.kytos/flow_manager:INFO main:154:  Flows loaded.
...

The logging was omitted, but flow_manager keeps removing and inserting the flows.