kytos-ng / flow_manager

Kytos NApp that manages OpenFlow 1.3 entries
https://kytos-ng.github.io/api/flow_manager.html
MIT License
0 stars 7 forks source link

Non set `table_id` default to 0 or all tables for deletion? #195

Open viniarck opened 2 months ago

viniarck commented 2 months ago

Related to https://github.com/kytos-ng/mef_eline/pull/497#discussion_r1725045550

Quoting the OF1.3 spec:

The table_id chooses the table to which the configuration change should be applied. If the table_id is OFPTT_ALL, the configuration is applied to all tables in the switch.

On pyof a FlowMod table_id defaults to 0, which for installing flows makes a lot of sense. For deletion it makes sense too, but the code we use to perform a non stric deletino is considering a non set table_id same as OFPTT_ALL so it'll delete form the DB, but it'll set on wire the flowmod only deleting from table 0, and then consistency check will eventually delete. So, it's not a great behavior.

Considering other default values, I think it makes sense for deletion to assume table 0 only to also simplify logic in the code, and if users want all tables, they need to set table_id: OFPTT_ALL. I think this would result in the least surprising behavior. This discussion will continue when this gets prioritized eventually

Thanks for confirming @Alopalao https://github.com/kytos-ng/mef_eline/pull/497#discussion_r1725290226