[P4-dev] How to implement tagging concept like VLAN/mTag in P4?

Antonin Bas antonin at barefootnetworks.com
Tue Feb 23 16:12:20 EST 2016

Hi Swaroop,

The mTag example is described in more details in this P4 paper (
although the syntax could be a little out-dated in some places. It is a
fictional example and you are free to tweak it as you want. All the code
samples in the p4lang tutorial repo (https://github.com/p4lang/tutorials),
in particular the source routing and the copy-to-cpu examples should be
very helpful.
If you get stuck on a particular aspect of your program, do not hesitate to
ask a more specific question with what you are trying to do and what you
have come up with so far, and we will be happy to help.



On Tue, Feb 23, 2016 at 11:46 AM, Swaroop Thool <
swaroopthool1991 at outlook.com> wrote:

> Hello All,
> I want to know how can I implement tagging ethernet frame like VLAN/mTag
> in P4.
> I may also require to untag the frame by running another P4 program as
> receiver.
> How tagging( VLAN) is done something like copy_to_cpu example?
> I can see half implemented code of 'mtag' in specs in which I am
> interested. How to go for it?
> Thanks,
> Swaroop
> _______________________________________________
> P4-dev mailing list
> P4-dev at lists.p4.org
> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20160223/6286d6a3/attachment-0002.html>

More information about the P4-dev mailing list