Configuring QinQ

PicOS OVS supports QinQ. (3290,3295,3296 do not support set inner pcp) 

Push tag, Push <tag:2000>

root@PicOS-OVS$ovs-ofctl add-flow br0 in_port=1,actions=push_vlan:0x8100,set_field:2000-\>vlan_vid,output:2

Push <tag:2000 pcp:3>

root@PicOS-OVS$ovs-ofctl add-flow br0 in_port=1,actions=push_vlan:0x8100,set_field:2000-\>vlan_vid,set_field:3-\>vlan_pcp,output:2

Push <tag:3000 tag:4094>

root@PicOS-OVS$ovs-ofctl add-flow br0 in_port=1,actions=push_vlan:0x8100,set_field:3000-\>vlan_vid,push_vlan:0x8100,set_field:4094-\>vlan_vid,output:2

Push <tag:3000 tag:4094 pcp:3>

root@PicOS-OVS$ovs-ofctl add-flow br0 in_port=1,actions=push_vlan:0x8100,set_field:3000-\>vlan_vid,push_vlan:0x8100,set_field:4094-\>vlan_vid,set_field:3-\>vlan_pcp,output:2

Push <tag:3000 pcp:3 tag:4094 pcp:7>

root@PicOS-OVS$ovs-ofctl add-flow br0 in_port=1,actions=push_vlan:0x8100,set_field:3000-\>vlan_vid,set_field:3-\>vlan_pcp,push_vlan:0x8100,set_field:4094-\>vlan_vid,set_field:7-\>vlan_pcp,output:2

Pop tag, Pop one header

root@PicOS-OVS$ovs-ofctl add-flow br0 in_port=1,actions=pop_vlan,output:2

Pop two header

root@PicOS-OVS$ovs-ofctl add-flow br0 in_port=1,actions=pop_vlan,pop_vlan,output:2 

User can also use the strip_vlan to achieve pop VLAN tagged, for example:

root@PicOS-OVS$ovs-ofctl add-flow br0 in_port=1,priority=100,actions=strip_vlan,output:2 

In hardware ASIC, implementation of "strip_vlan" is: change the packet's tag to "4095" and strip the vlan tag of 4095 in the egress. Thus, the above flow will be split into two flows in ingress and egress respectively, as follows:


Ingress "in_pot=1, priority=100, action=set_field:2000-\>vlan_vid"
Egress "in_pot=1, priority=100,action=strip_vlan,output:2"


In this case, maybe other traffic which matches the egress flow will be stripped vlan and forwarded to port-3. Users can install the other flow with higher priority to avoid this problem.

 

Hardware limitation of Pushing Two Tags

There is a limitation in pushing two tags; hardware ASIC can only identify two tags.

a. If primary packet is untagged,  do two push_vlan (add tagA, tagB), output packets is tagged with two vlans. (tagA, tagB)

b. If primary packet is tagged with one vlan (tag0), do two push_vlan (add tagA, tagB), output packets is tagged with two vlans. (tag0, tagB),

c. If primary packet is tagged with more than one vlan (outer vlan is tag0), do two push_vlan (add tagA, tagB), output packets is tagged with vlans. (tag0 and other tag of primary packets, tagB),

d. For Platform 3290, 3295, 3296, 3297, 4804, these don't support modifying inner vlan pcp.

 

 

 

Copyright © 2024 Pica8 Inc. All Rights Reserved.