How to change the flow table when the switch is running

Our team wants to use the withe list and use some switches to store the list, and In order to prevent the interruption of a switch node, we need to dynamically replace the flow table rules. And We Need to dynamically change the flow table rules of the switch without reloading it. Can you provide us with some cases or methods?

I do not know what a “withe list” might be.

P4 tables are intended by design to enable control plane software to make API calls for adding, modify, and/or removing entries from those tables, while the device is processing packets. This is standard common practice in the networking industry, whether the network device can be programmed with P4 or not.

Sorry, we have change the strategy. We hope to replace the flow table according to the data packet. Is there any good case

Welcome to the forum @caiboyu,

If I properly understood your question, I believe you need to support packet in and packet out messages in the switch and the python controller (or the ONOS controller if you prefer it):

Some examples for how packet and packet out work in P4

  • p4-guide example: here.

Examples in the controller to process a packet in and install a rule:

  • General controller example: here or here.
  • Add a table entry as shown in the library: here. And the main code that uses the aforementioned method: here.
  • Replace a table entry as shown in the library: here.

Cheers,

Thank you for your advice. We used the P4-Utils to solve the problems and found some perfect APIs. In the follow-up work, ONOS will be used as the controller to complete this task. Can you give us some suggestions on learning ONOS?

Hi @caiboyu,

I always recommend ONF’s NG-SDN tutorial. If you want to understand how ONOS works (different to a controller like Ryu), do all exercises, 1 to 8 and do not skip steps.

I did respond to a question about ONOS a few days ago in the best way I could … considering that my understanding is not perfect ab out everything of how ONOS and P4 switches are programmed. My response will make sense once you have done most of the exercises.

Cheers,