kytos / flow_manager

MIT License
1 stars 16 forks source link

Avoid recreating flows for a connected switch when consistency check is enabled #126

Closed italovalcy closed 3 years ago

italovalcy commented 3 years ago

Currently, when a switch connect (or reconnects) to Kytos, flow_manager send a FLOW_MOD to reinstall all the stored flows, no matter how is the switch flow table.

If the switch flow table is empty, forcing the flows to be reinstalled is okay. However, if the switch still has the flows and reconnects, reinstalling them will impact the traffic being forwarded, will clear the statistics, and is waste of resources. Furthermore, with the recent consistency check routine, this should be handed over.

This PR changes the behavior of flow_manager to use the consistency check routine, when enabled, to recreate the flows when the switch reconnects to Kytos.

Fixes #115

cmagnobarbosa commented 3 years ago

For me, this pull request can be accepted. But I think that in the future this resend_stored_flows method should be removed. Because when consistency checking is disabled, the behavior of resending stored flows without checking if they are already installed can interrupt the traffic as described in this pull request. At first, I can't think of a case in which this action to resend flows without checking is necessary. In addition, consistency checking can replace this method.