Programmable Internetworking & Communication Operating System Docs ... Click Spaces -> Space Directory to see docs for all releases ...
Page tree
Skip to end of metadata
Go to start of metadata

PicOS support push/swap/pop S-VLAN in Q-in-Q, and the S-VLAN TPID can configure as 0x8100/0x88a8/0x9100 and 0x9200. But in the same port, PicOS only support configure one TPID value, that means the traffic through one port will can push/swap/pop one type of TPID.

a, If one TPID configured in ingress port, switch can recognize it and deal the matched traffic;

b, If one TPID configured in egress port, switch can design it in the traffic which send out from the port.

1, TPID used in Q-in-Q

 If the actions include push-vlan and has no push_l2mpls:

push_vlan action will use out_port's tpid.

For example,

a. untagged packet push one tag, the result will be:  out_port's tpid | payload

b. untagged packet push two tags, the result will be:  out_port's tpid | 0x8100 | payload

 

Once configure TPID in port, need reboot switch.Command:

ovs-vsctl set interface <port> options:tpid=<value>
 
<value> can configure one value as 0x8100/0x88a8/0x9100/0x9200, for example if the S-VLAN TPID is 0x88a8, the value must set 0x88a8.
By default, the value is 0x8100.
 
admin@PicOS-OVS$sudo /etc/init.d/picos restart

In Q-in-Q flow, only support match outer-vlan.

Push-vlan: Design TPID during push S-VLAN, need configure TPID in egress.

Example:

admin@PicOS-OVS$ovs-vsctl set interface te-1/1/1 options:tpid=0x8100
admin@PicOS-OVS$ovs-vsctl set interface te-1/1/2 options:tpid=0x88a8
 
Push one vlan:
admin@PicOS-OVS$ovs-ofctl add-flow br0 in_port=1,actions=push_vlan=0x88a8,set_field:1234-\>vlan_vid,output:2  
 
Push two vlans,
admin@PicOS-OVS$ovs-ofctl add-flow br0 in_port=1,actions=push_vlan=0x8100,set_field:10-\>vlan_vid,push_vlan=0x88a8,set_field:100-\>vlan_vid,output:2

 

Swap-vlan: Match TPID in ingress port and design TPID in egress port, so need configure TPID in ingress and egress.

Example:

admin@PicOS-OVS$ovs-vsctl set interface te-1/1/1 options:tpid=0x88a8
admin@PicOS-OVS$ovs-vsctl set interface te-1/1/2 options:tpid=0x88a8

admin@PicOS-OVS$ovs-ofctl add-flow br0 in_port=1,dl_vlan=10,actions=set_field:100-\>vlan_vid,output:2

 

Pop-vlan: Match TPID in ingress port, need configure TPID in ingress port. 

Example:

admin@PicOS-OVS$ovs-vsctl set interface te-1/1/1 options:tpid=0x88a8

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

 

2, TPID used in push L2MPLS

This feature means push/swap/pop vlan before push L2MPLS. It is simmilar with Q-in-Q, but operation is different from Q-in-Q.

1, This feature only support in platform 3922 and 3924;

2, If user want use TPID before push L2MPLS, must configure TPID on ingress port.

 

3, push_vlan action before push_l2mpls will use in_port's tpid, and push_vlan action in push_l2mpls will use out_port's tpid. One case need to note is that if only one tag exist before l2mpls, its tpid should be 0x8100.

For example,

a. untagged packet push one tag and then push l2mpls, the result will be:  l2mpls | 0x8100 | payload

b. untagged packet push two tags and then push l2mpls, the result will be:  l2mpls | in_port's tpid | 0x8100 | payload

a, No mather push/swap/pop vlan before push L2MPLS, TPID must configure in ingress port.

Once configure TPID in port, need reboot switch.Command:

ovs-vsctl set interface <port> options:tpid=<value>
 
<value> can configure one value as 0x8100/0x88a8/0x9100/0x9200, for example if the S-VLAN TPID is 0x88a8, the value must set 0x88a8.
By default, the value is 0x8100.

 

Push-vlan: Configure TPID in ingress port.

Example: The push_vlan and push_l2mpls are performed in network ingress side. In network egress side, PicOS switch just pop_l2mpls. In this example, we only care the network ingress side.

a, At the Ingress side, matching in_port and untag, actions:  push_svlan (TPID 0x8100/0x88a8/0x9100/0x9200) push_cvlan(TPID 0x8100) then push l2mpls.

ovs-vsctl set interface te-1/1/11 options:tpid=0x88a8
ovs-ofctl add-flow br-iris "in_port=11,vlan_vid=0x0000/0x1fff,actions=push_vlan:0x88a8,set_field:100->vlan_vid,push_vlan:0x8100,set_field:10->inner_vlan_vid,push_l2mpls:0x8847,set_field:22:11:11:11:11:10->dl_dst,set_field:22:00:00:00:00:01->dl_src,set_field:16->mpls_label,push_vlan:0x88a8,set_field:1000->vlan_vid,output:12"

b, At the Ingress side, cvlan (TPID=0x8100) then push_l2mpls. 

ovs-vsctl set interface te-1/1/11 options:tpid=0x88a8
ovs-ofctl add-flow br-iris "in_port=11,vlan_vid=0x0000/0x1fff,actions=push_vlan:0x8100,set_field:10->vlan_vid,push_l2mpls:0x8847,set_field:22:11:11:11:11:10->dl_dst,set_field:22:00:00:00:00:01->dl_src,set_field:16->mpls_label,push_vlan:0x88a8,set_field:1000->vlan_vid,output:12"

If want match untag packets, the flow entry should include match vlan_vid=0x0000/0x1fff, and must set option-match-vlan-type is true.

admin@PicOS-OVS$ovs-vsctl set-option-match-vlan-type true

 

Swap-vlan: Configure TPID in ingress port.

Example:  Swap and push_l2mpls are performed in network ingress side. In egress side, PicOS switch just pop_l2mpls. In this example, we only care the network ingress side.

a, At the Ingress side, matching in_port and S-VLAN/C-VLAN (C-VLAN TPID support 0x8100, S-VLAN TPID support 0x8100/0x88a8/0x9100/0x9200), actions:  swap S-VLAN and C-VLAN;

ovs-vsctl set interface te-1/1/11 options:tpid=0x88a8
ovs-ofctl add-flow br-iris "in_port=11,vlan_tci=0x1032,inner_vlan_tci=0x100a,actions=set_field:100->vlan_vid,set_field:40->inner_vlan_vid,push_l2mpls:0x8847,set_field:22:11:11:11:11:10->dl_dst,set_field:22:00:00:00:00:01->dl_src,set_field:16->mpls_label,push_vlan:0x8100,set_field:1000->vlan_vid,output:12"

b, swap S-VLAN only or swap C-VLAN , then push_l2mpls.  

ovs-vsctl set interface te-1/1/11 options:tpid=0x88a8
ovs-ofctl add-flow br-iris "in_port=11,vlan_tci=0x1032,inner_vlan_tci=0x1000/0x1000,actions=set_field:100->vlan_vid,push_l2mpls:0x8847,set_field:22:11:11:11:11:10->dl_dst,set_field:22:00:00:00:00:01->dl_src,set_field:16->mpls_label,push_vlan:0x8100,set_field:1000->vlan_vid,output:12"
 
ovs-ofctl add-flow br-iris "in_port=11,vlan_tci=0x1000/0x1000,inner_vlan_tci=0x1000/0x1000,actions=set_field:100->inner_vlan_vid,push_l2mpls:0x8847,set_field:22:11:11:11:11:10->dl_dst,set_field:22:00:00:00:00:01->dl_src,set_field:16->mpls_label, push_vlan:0x8100,set_field:1000->vlan_vid,output:12"

 

Pop_vlan: Configure TPID in ingress port.

Example: The pop_vlan and push_l2mpls are performed in network ingress side. In egress side, PicOS switch just pop_l2mpls. In this example, we only care the network ingress side.

At the Ingress side, matching in_port and S-VLAN/C-VLAN, actions:  pop S-VLAN or pop S-VLAN and C-VLAN, then push_l2mpls. 

ovs-vsctl set interface te-1/1/11 options:tpid=0x88a8
ovs-ofctl add-flow br-iris "in_port=11,vlan_tci=0x1032,inner_vlan_tci=0x100a,actions=pop_vlan,pop_vlan,push_l2mpls:0x8847,set_field:22:11:11:11:11:10->dl_dst,set_field:22:00:00:00:00:01->dl_src,set_field:16->mpls_label,push_vlan:0x8100,set_field:1000->vlan_vid,output:12"
  • No labels