Currently, cookie is being used to hash a value for match_id. But, this isn't correct since we this to uniquetly identify the uniqueness of a match, and as described in the OpenFlow spec:
If the cookie_mask field is non-zero, it is used with the cookie field to restrict flow matching while modifying or deleting flow entries. This field is ignored by OFPFC_ADD messages.
This can also be verified on both OvS and NoviFlow switches, if you try to add flows with same matches but different cookie, the cookie will be overwritten:
But, currently on our DB they won't be overwritten since they'll have a different match_id, consequently with consistency check it'll detect as a missing flow and it'll keep trying to forward it again which would result in the flow cycling as it was observed on this bug here https://github.com/kytos-ng/telemetry_int/issues/106, here's another simplified example of the issue but without using INT flow instructions:
kytos $> 2024-07-03 11:21:23,418 - INFO [kytos.napps.kytos/flow_manager] (thread_pool_sb_4) Consistency check: missing flow on switch 00:00:00:00:00:00:00:01.
2024-07-03 11:21:23,419 - INFO [kytos.napps.kytos/flow_manager] (thread_pool_sb_4) Flow forwarded to switch 00:00:00:00:00:00:00:01 to be installed. Flow: {'flows': [{'table_id': 0, 't
able_group': 'base', 'priority': 20000, 'cookie': 10, 'idle_timeout': 0, 'hard_timeout': 0, 'match': {'in_port': 18}, 'instructions': []}]}
2024-07-03 11:23:23,440 - INFO [kytos.napps.kytos/flow_manager] (thread_pool_sb_11) Consistency check: missing flow on switch 00:00:00:00:00:00:00:01.
2024-07-03 11:23:23,442 - INFO [kytos.napps.kytos/flow_manager] (thread_pool_sb_11) Flow forwarded to switch 00:00:00:00:00:00:00:01 to be installed. Flow: {'flows': [{'table_id': 0, '
table_group': 'base', 'priority': 20000, 'cookie': 20, 'idle_timeout': 0, 'hard_timeout': 0, 'match': {'in_port': 18}, 'instructions': []}]}
Currently,
cookie
is being used to hash a value for match_id. But, this isn't correct since we this to uniquetly identify the uniqueness of amatch
, and as described in the OpenFlow spec:This can also be verified on both
OvS
andNoviFlow
switches, if you try to add flows with same matches but different cookie, the cookie will be overwritten:But, currently on our DB they won't be overwritten since they'll have a different
match_id
, consequently with consistency check it'll detect as a missing flow and it'll keep trying to forward it again which would result in the flow cycling as it was observed on this bug here https://github.com/kytos-ng/telemetry_int/issues/106, here's another simplified example of the issue but without using INT flow instructions: