[P4-dev] Why do we need header stacks?
Xiaoban_Wu at student.uml.edu
Thu Dec 27 12:24:42 EST 2018
Thanks very much for your quick reply. With Q-IN-Q VLAN and MPLS(multiple labels), I now see how header stacks are useful.
From: hemant at mnkcg.com <hemant at mnkcg.com>
Sent: Thursday, December 27, 2018 12:07:34 PM
To: Wu, Xiaoban; p4-dev at lists.p4.org
Subject: RE: [P4-dev] Why do we need header stacks?
MPLS and VLAN protocols push/pop labels or add/delete tags respectively. For example with q-in-q VLAN, one VLAN tag is removed or added. An array of headers helps because P4 can uses h.setInvalid() to remove a label and use h.isValid() to check for a valid label. An array is easier than using a linked list. You can look for examples of mpls and vlan in P4-16 switch code with URL below.
From: P4-dev <p4-dev-bounces at lists.p4.org> On Behalf Of Wu, Xiaoban
Sent: Thursday, December 27, 2018 11:45 AM
To: p4-dev at lists.p4.org
Subject: [P4-dev] Why do we need header stacks?
Could anyone please tell me in the real-world application, in which scenario would we consider using an array of header instances with the same header type?
In the P4 spec, it says "MPLS and VLAN tags are examples that might be treated this way", however I still don't quite understand it. Could anyone please elaborate on this? Thanks very much.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the P4-dev