Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add listening to of_core flow_stats.received to run consistency check #125

Merged
merged 6 commits into from
May 26, 2021
Merged

Add listening to of_core flow_stats.received to run consistency check #125

merged 6 commits into from
May 26, 2021

Conversation

italovalcy
Copy link
Contributor

@italovalcy italovalcy commented Apr 25, 2021

Currently, the consistency check routine is run every settings.CONSISTENCY_INTERVAL seconds. The consistency check depends on the switch's flow list to compare with the stored flows. However, since the switch's flow list is updated by of_core flow_stats routine, those intervals may not match and this can leads to an inconsistent switch flow table view, such as the issue #124.

This PR adds the capability of running the consistency check based on the of_core flow_stats received event, which will improve the reliability of the consistency check routine, once it will with the most updated switch flow table.

The way it was developed enables the consistency check to run in three different ways:

  • Disabled: when CONSISTENCY_INTERVAL is lower than zero (e.g., -1), it will not be run
  • Event based: when CONSISTENCY_INTERVAL is equal zero, it will be run upon receiving the kytos/of_core.flow_stats.received event
  • Periodically: when CONSISTENCY_INTERVAL is greater zero, it will run as currently deployed - with its own interval

The PR also changes the default value of CONSISTENCY_INTERVAL to zero, since it seems to be the more secure and efficient approach.

Fixes #124

UPDATE:

  • According to our discussion, this PR now changes the behavior of the consistency check to run upon receiving the flow_stats.received event from of_core. The flow_manager settings allow to enable or disable consistency check (it is enabled by default)

@hdiogenes
Copy link
Member

Making the consistency interval have 3 different "modes" may be a little counter-intuitive. A suggestion would be to have a separate option, something like CONSISTENCY_MODE = "disabled|interval|stats", and then the CONSISTENCY would only be used if the MODE was set to interval.

@italovalcy
Copy link
Contributor Author

Making the consistency interval have 3 different "modes" may be a little counter-intuitive. A suggestion would be to have a separate option, something like CONSISTENCY_MODE = "disabled|interval|stats", and then the CONSISTENCY would only be used if the MODE was set to interval.

Hi @hdiogenes I've changed the PR to use the ENABLE_CONSISTENCY_CHECK config option that will enable or disable the consistency check. As we discussed in the last Kytos meeting (2021-05-20), the consistency check will run upon receiving the flow_stats.received event from of_core (when enabled).

@hdiogenes hdiogenes changed the title Adding listening to of_core flow_stats.received to run consistency check Add listening to of_core flow_stats.received to run consistency check May 26, 2021
@hdiogenes hdiogenes merged commit 53db41b into kytos:master May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consistency check keeps removing and inserting flows on a switch during the first N runs
3 participants