kytos-ng / maintenance

Kytos Maintenance Window NApp
https://kytos-ng.github.io/api/maintenance.html
0 stars 8 forks source link

Maintenance of a switch or interface does not migrate the flows to other path #5

Closed ajoaoff closed 8 months ago

ajoaoff commented 3 years ago

Original issue opened by @italovalcy at https://github.com/kytos/maintenance/issues/23.

Hi,

The maintenance in a switch or backbone interface (NNI) should move the dynamic EVCs to other path, however the EVCs remain in the same path as before the MW.

Steps to reproduce:

  1. Using a simple Ring topology in Mininet with 3 switches (sw1--sw2--sw3--sw1)
  2. Create an EVC between h1 (connected at sw1) and h2 (connected at sw2), using dynamic path
    curl -s -X POST -H 'Content-type: application/json' http://localhost:8181/api/kytos/mef_eline/v2/evc -d '{"uni_z": {"tag": {"value": 300, "tag_type": 1}, "interface_id": "00:00:00:00:00:00:00:02:1"}, "uni_a": {"tag": {"value": 300, "tag_type": 1}, "interface_id": "00:00:00:00:00:00:00:01:1"}, "enabled": true, "name": "Vlan300_Test_evc1", "dynamic_backup_path": true}'
  3. Check the path of the EVC created, to make sure it is using the interface that will be under MW:
    curl -s http://localhost:8181/api/kytos/mef_eline/v2/evc | jq -r '.[].current_path' | grep 00:00:00:00:00:00:00:02:2
  4. Create a MW to be started in a couple of minutes later
    curl -s -X POST -H 'Content-type: application/json' http://localhost:8181/api/kytos/maintenance -d '{"description": "my MW on switch 2", "start": "2021-03-05T22:19:00+0000", "end": "2021-03-05T22:20:00+0000", "items": ["00:00:00:00:00:00:00:02:2"]}'
  5. Wait until the MW begins and check the flows. When the MW begins, Kytos generate a log message:
    Mar  5 22:19:00 10ae9a814839 apscheduler.executors.default:INFO base:123:  Running job "MaintenanceWindow.start_mw (trigger: date[2021-03-05 22:19:00 UTC], next run at: 2021-03-05 22:19:00 UTC)" (scheduled at 2021-03-05 22:19:00+00:00)
    Mar  5 22:19:00 10ae9a814839 apscheduler.executors.default:INFO base:144:  Job "MaintenanceWindow.start_mw (trigger: date[2021-03-05 22:19:00 UTC], next run at: 2021-03-05 22:19:00 UTC)" executed successfully
    Mar  5 22:19:00 10ae9a814839 apscheduler.scheduler:INFO base:632:  Removed job 74c17ba02eaf4742ba898769f89e04a1-start

Expected result: the EVC should be moved from the path sw1--sw2 to sw1--sw3--sw2

Actual behavior: the EVC remains in the path sw1--sw2:

$ curl -s http://localhost:8181/api/kytos/mef_eline/v2/evc | jq -r '.[].current_path' | grep 00:00:00:00:00:00:00:02:2
      "id": "00:00:00:00:00:00:00:02:2",

mininet> sh for s in s1 s2 s3; do echo ====== $s; ovs-ofctl dump-flows $s; done
====== s1
 cookie=0xf9a50b5e84724c53, duration=2210.578s, table=0, n_packets=6627, n_bytes=675182, in_port="s1-eth1",dl_vlan=300 actions=mod_vlan_vid:300,mod_vlan_vid:1082,output:"s1-eth3"
 cookie=0xf9a50b5e84724c53, duration=2210.550s, table=0, n_packets=6627, n_bytes=701690, in_port="s1-eth3",dl_vlan=1082 actions=strip_vlan,output:"s1-eth1"
 cookie=0x0, duration=2213.127s, table=0, n_packets=1448, n_bytes=60816, priority=1000,dl_vlan=3799,dl_type=0x88cc actions=CONTROLLER:65535
====== s2
 cookie=0xf9a50b5e84724c53, duration=2210.561s, table=0, n_packets=6627, n_bytes=675182, in_port="s2-eth1",dl_vlan=300 actions=mod_vlan_vid:300,mod_vlan_vid:1082,output:"s2-eth2"
 cookie=0xf9a50b5e84724c53, duration=2210.559s, table=0, n_packets=6627, n_bytes=701690, in_port="s2-eth2",dl_vlan=1082 actions=strip_vlan,output:"s2-eth1"
 cookie=0x0, duration=2213.146s, table=0, n_packets=1448, n_bytes=60816, priority=1000,dl_vlan=3799,dl_type=0x88cc actions=CONTROLLER:65535
====== s3
 cookie=0x0, duration=2213.165s, table=0, n_packets=1448, n_bytes=60816, priority=1000,dl_vlan=3799,dl_type=0x88cc actions=CONTROLLER:65535
viniarck commented 8 months ago

This issue has been fixed, we also have e2e covering it