[P4-dev] Packet Metadata in P4Runtime PacketIn/PacketOut messages with v1model and P416

Lewis, Ben b.lewis at lancaster.ac.uk
Sat Oct 13 10:26:05 EDT 2018

Hi all,

Does anyone have any insight into getting packet metadata to the controller from bmv2 when sending the packet via the P4Runtime port?

I’m looking to be able to tell the control plane why the packet was forwarded, the ingress port and whether the packet was cloned. I know I can prepend this information to the packet but I was hoping this would be a more elegant approach.

The code below unfortunately doesn’t work
struct packet_in_t {
bit<4> reason;
bit<9> ingress_port
bit<1> isClone;

struct metadata {
	packet_in_t packet_in_meta;

Any insight is appreciated 

More information about the P4-dev mailing list