[P4-dev] Sending metadata to the controller

hemant at mnkcg.com hemant at mnkcg.com
Mon Feb 11 22:01:52 EST 2019


See if you can use the PSA Digest message:  https://p4.org/p4-spec/docs/PSA-v1.1.0.html#sec-packet-digest

 

It will help distinguish different messages.  I am not sure if the controller always replies on receiving a Digest message because then this solution won’t work for you.  Also, the PSA document says Digest is used to send messages from the data plane to the control plane.  I am not sure if the control plane can be a P4Runtime controller.

 

If you have p4c downloaded, see this Digest related P4 test program.  

 

p4c/testdata/p4_16_samles/p4rt_digest_complex.p4

 

Hemant

 

From: P4-dev <p4-dev-bounces at lists.p4.org> On Behalf Of fhgdsfkjgirgtegosfgsjfhsgbvnsyfgasg at web.de
Sent: Monday, February 11, 2019 9:42 PM
To: p4-dev at lists.p4.org
Subject: [P4-dev] Sending metadata to the controller

 

Hi,

 

I am using the code of the P4_16 runtime tutorial 2018-06-01 and now I want to send metadata of all processed packets from the P4 switch to the controller. It seems that I cannot create new packets at the switch, so I was thinking to clone existing packets and send the cloned packets to the controller. I have cloned the packets using clone3() but now I am stuck. Also I do not want the controller to reply with any additional packets when receiving metadata. If possible, I would put ethernet, ipv4 & udp header on the cloned packets while keeping the original header structure (ethernet, ipv4, tcp/udp, tunneling) for the original packets, but how can I distinguish cloned packets from original packets at the deparser stage? As far as I know, the metadata contains an instance_type to determine it, but metadata is not accessible anymore after the egress pipeline.
If this was too fancy, what would be the best way to do it in P4 & P4 runtime?

 

Kind regards

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20190211/7e4b0639/attachment.html>


More information about the P4-dev mailing list