[stratum-dev] [onos-dev] How to make one bmv2 switch send a packet_in to multiple controllers at the same time?

陳宜謙 chenyichientw at gmail.com
Sun Apr 26 08:26:14 UTC 2020

Thank you for your reply. I will look into it!

Carmelo Cascone <carmelo at opennetworking.org> 於 2020年4月23日 週四 上午4:10寫道:

> Hi,
> Hopefully this is not too late.
> From the P4Runtime spec (section 5):
> 5. Master-Slave Arbitration and Controller Replication
> <https://p4.org/p4runtime/spec/master/P4Runtime-Spec.html#sec-master-slave-arbitration-and-controller-replication>
> *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:
> https://github.com/stratum/stratum/blob/e0f8b1fcc5d226cd7aef1837e673276721e9d6ba/stratum/hal/lib/common/p4_service.cc#L821
> 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
> On Apr 12, 2020, at 7:37 AM, chenyichientw at gmail.com wrote:
> 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!
> --
> 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+unsubscribe at 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
> <https://groups.google.com/a/onosproject.org/d/msgid/onos-dev/81f428f8-9dc0-4ff9-8b16-4517cdc0fb14%40onosproject.org?utm_medium=email&utm_source=footer>
> .
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.stratumproject.org/archives/stratum-dev/attachments/20200426/d99c5a2f/attachment.html>

More information about the stratum-dev mailing list