[P4-dev] Send a message to the control plane

Dingyuan Hu h-dy at outlook.com
Mon Oct 23 09:07:23 EDT 2017

Hi Garegin Grigoryan,
I think send_to_cpu is just try encapsulation the origin packet with new packet and forward it to your application. Then you can analysis the packet and add entries.

If you use bmv2 as switch, you can start it using following command.
Your p4 program send packet to 3 and  your control plane application need to listen on port `cpu-port`.
simple_switch -i 1 at s1-eth1 -i 2 at s1-eth2 -i 3 at cpu-port --pcap --thrift-port 9090 --nanolog ipc:///tmp/bm-0-log.ipc --device-id 0 <your-p4-code>.p4.json --log-console

If you want to do something like “Packet-Out” in OpenFlow, just send packet to `cpu-port` and make sure your P4 program can handle packet from port 3.

Best Regards,
Dingyuan Hu

From: P4-dev <p4-dev-bounces at lists.p4.org> on behalf of Garegin Grigoryan <grigorg at clarkson.edu>
Date: Tuesday, 26 September 2017 at 07:34
To: p4-dev <p4-dev at lists.p4.org>
Subject: Re: [P4-dev] Send a message to the control plane

Dear all,

I'm still unclear for me, what is the idea behind send_to_cpu action, as well as how to send messages to the control plane from the p4 switch in bmv2 model and how to receive these messages at the control plane.

Please let me know if my question is unclear.
Thank you very much

On Fri, Sep 8, 2017 at 4:54 PM, Garegin Grigoryan <grigorg at clarkson.edu<mailto:grigorg at clarkson.edu>> wrote:

I am working with the bmv2 model. I want the data plane to send messages to the control plane when a certain event is happening in the data plane, for example, the register reaches a certain value.

1. How can I do that in P4 bmv2 model?
2. Is send_to_cpu action is somehow related to this question?
3. How can I "catch" these messages using a control plane program (right now, I am using the APIs from the simple_switch_CLI code).

Garegin Grigoryan

Garegin Grigoryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20171023/c1797ed8/attachment-0002.html>

More information about the P4-dev mailing list