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

Swaroop Thool swaroopthool1991 at outlook.com
Thu Feb 25 15:19:24 EST 2016

Hi Antonin and all,Thank you for directing.I already looked at this paper and really interested in implementing tagging part. I don't require all its complex checks and want only simple process of tagging frames. In copy to cup example where custom header is attached at start of original packet frame, now I want to give it some tag with ether type (example: VLAN) or further tagging VLAN tag. If I know how to give tag like VLAN in between fields of Ethernet frame (not at start) it will be really helpful.Moreover, I want to use mininet which has command for adding VLAN tags to hosts but this only for each host. I am not sure how to give to group of hosts. I tried to tweak 1sw_demo.py & p4mininet.py files of mininet folder to add grouping mechanism like group two hosts in 1 VLAN  tag but it threw lot of errors. I was trying to add VLAN tags or any other tags by this two approaches which I later needs to removes by other program. How to approach for it will be appreciated Thanks,SwaroopDate: Tue, 23 Feb 2016 13:12:20 -0800
Subject: Re: [P4-dev] How to implement tagging concept like VLAN/mTag in P4?
From: antonin at barefootnetworks.com
To: swaroopthool1991 at outlook.com
CC: p4-dev at lists.p4.org

Hi Swaroop,

The mTag example is described in more details in this P4 paper (http://www.sigcomm.org/sites/default/files/ccr/papers/2014/July/0000000-0000004.pdf), 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?



P4-dev mailing list

P4-dev at lists.p4.org



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

More information about the P4-dev mailing list