Install Rules For P4 Switch

Hi,

I am working on a P4 project. Currently, I add rules using p4Runtime Simple_Swich_CLI. This way is a bit difficult for a huge program. I need to know if there is any controller which could be used in my case. I found Onos but the Onos system is a bit confusing. can anyone suggest other controllers??

Hi!

You can check the python code in the P4 tutorial. It currently reads some JSON files that translate the rules to actual rules sent to the switch using P4Runtime. That might be your first step. You can check program_switch_p4runtime at run_exercise.py (to see how JSON rules are installed) and particularly how p4runtime_lib.simple_controller works (which is what you are likely looking for.

Additionally, you can search for the ONOS controller. The tutorial in this link is the best option to start with it.

Hope it helps :slight_smile: