ONOS and P4 with a second controller (like P4runtime-sh)

37 views
Skip to first unread message

MADHU RAGHUPATRUNI

unread,
Sep 15, 2020, 3:36:47 AM9/15/20
to P4 brigade
Hello all,

We have ONOS and a P4 application integrated and running well.

We need several tables that are already in P4 but are not yet integrated into ONOS (java application).  We know that they can be populated using flow rule API.

However we prefer to use something like P4runtime-sh docker to populate, examine and look at the P4 switch.   

How can we run P4runtime-sh docker as well as ONOS as two master controllers ?  We also want to write these several tables using P4runtime-sh and still be visible in ONOS GUI
once they are populated ?   Please share your configurations if you have tried this setup.

Appreciate your responses.

Regards,
Madhu

Carmelo Cascone

unread,
Sep 16, 2020, 2:00:32 AM9/16/20
to MADHU RAGHUPATRUNI, P4 brigade
Hi,

Unfortunately there are a few problems that make it hard to realize the scenario you describe.

The P4Runtime API defines a mechanism for role config, where multiple masters can connect to the same switch as long as they use different roles.

ONOS currently supports establishing sessions with the “default role” only. If your P4Runtime switch implementation supports role config, then you should be able to establish a new session as master via a different P4Runtime client as long as you don’t use the default role. If you are using Stratum, unfortunately that doesn’t support role config, yet. I’m not sure if p4runtime-sh supports setting a role config.

If you use a separate P4Runtime client to become master for the default role, that will interfere with ONOS operations, as the switch is expected to notify to ONOS that it is no longer the master, which immediately triggers a mechanism in ONOS to regain mastership, thus removing it from the other client.

If all you want to do with the other client is reading state, then there should be no need to gain mastership or deal with role config, simply issue a Read RPC for the tables you’re interested in.

However, it sounds like you are interested in using the other client to write state… so, if you manage to to bring up a separate client with role config and make it master, unfortunately state that you write might get removed by the ONOS data plane state reconciliation mechanism. For example, the FlowRuleManager periodically asks the P4Runtime driver to report all table entries for a given device, during this process all table entries that are known (i.e., not stored in the ONOS  core) are removed.

Ideally, ONOS should not remove entries written by other controllers with different roles, but this functionality is currently not implemented

Carmelo

--
You received this message because you are subscribed to the Google Groups "P4 brigade" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brigade-p4+...@onosproject.org.
To view this discussion on the web visit https://groups.google.com/a/onosproject.org/d/msgid/brigade-p4/ce1ffb5a-f6c9-47ef-8626-5d260a57ef88n%40onosproject.org.
Reply all
Reply to author
Forward
0 new messages