How to make one bmv2 switch send a packet_in to multiple controllers at the same time?

25 views
Skip to first unread message

chenyi...@gmail.com

unread,
Apr 12, 2020, 10:37:11 AM4/12/20
to ONOS Developers
Hi all,

I am using ONOS 1.13 with P4Runtime and onos.py to create a cluster. I wonder how can I change ONOS code so that one bmv2 switch sends a packet_in message to two different controllers at the same time? I understand that the standard is a switch can have only one master controller. But, I am studying the case for a switch to have multiple controllers. I have already spent a lot of time tracing the code. I found that the doPacketIn() method inside P4RuntimeClientImpl.java is processed by the controller. However, it seems that at the time doPacketIn() is called, it is too late to make the switch sending the control message to a second (another) controller. So, I am wondering when and where the switch code sends a control message to its controller. I would like to change the code. Which java classes, methods, or maybe bmv2 code should I look into? Can anyone help?

Thanks!

Carmelo Cascone

unread,
Apr 22, 2020, 4:10:03 PM4/22/20
to chenyi...@gmail.com, ONOS Developers, strat...@lists.stratumproject.org
Hi,

Hopefully this is not too late.

From the P4Runtime spec (section 5):

Streaming of notifications (e.g. digests) and packet I/O: The same streaming channel will be used for streaming notifications, as well as for packet-in and packet-out messages. Note that unless specified otherwise by the role definitions, only the master controller can participate in packet I/O. This feature is explained in more details in the Packet I/O section.

In other words, the spec doesn’t limit the possibility of sending packet-ins to multiple controllers, but you would have to define a “role” for that (see section 5.2. Role Config). However, none of the existing P4Runtime implementations that I’m aware of support any role other than the default one.

If you want to prototype this capability, your best option is to look at stratum_bmv2, specifically this part of p4_service.cc:

I might be wrong, but I think the P4Runtime southbound in ONOS doesn't enforce any mastership check on packet-ins, i.e., any switch could be sending paket-in messages to any controller instance, including slaves.

Carmelo

--
You received this message because you are subscribed to the Google Groups "ONOS Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to onos-dev+u...@onosproject.org.
To view this discussion on the web visit https://groups.google.com/a/onosproject.org/d/msgid/onos-dev/81f428f8-9dc0-4ff9-8b16-4517cdc0fb14%40onosproject.org.

陳宜謙

unread,
Apr 26, 2020, 4:27:18 AM4/26/20
to Carmelo Cascone, ONOS Developers, strat...@lists.stratumproject.org
Thank you for your reply. I will look into it!

Carmelo Cascone <car...@opennetworking.org> 於 2020年4月23日 週四 上午4:10寫道:
Reply all
Reply to author
Forward
0 new messages