[P4-dev] where to add_header?

Antonin Bas antonin at barefootnetworks.com
Sat Sep 24 19:38:04 EDT 2016


Hi Yuliang,

Your header has to be part of the parse graph. From the parse graph, we
compute a topological sorting which determines in which order the headers
are emitted when the packet is deparsed.
There is one example on p4lang of a P4 program which adds a CPU header to
packets:
https://github.com/p4lang/tutorials/tree/master/examples/copy_to_cpu
There are a few threads on this mailing list which talk about this in more
details. I would recommend looking at this one:
http://lists.p4.org/pipermail/p4-dev_lists.p4.org/2016-May/000319.html

Thanks,

Antonin

On Sat, Sep 24, 2016 at 4:22 PM, Yuliang Li <yuliangl at usc.edu> wrote:

> Hi all,
>
> I want to add a header to each packet. I see there is a add_header API.
> But how do I indicate where to add the header (e.g. after TCP header).
>
> Thanks,
> Yuliang
>
> _______________________________________________
> P4-dev mailing list
> P4-dev at lists.p4.org
> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
>



-- 
Antonin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20160924/1702f436/attachment-0002.html>


More information about the P4-dev mailing list