VN-tag


From version 2.11,pica8 switch support vn-tag.This is a standard reported by VMware and Cisco,is a private technology of Cisco.Vn-tag is a tag before vlan in packets.Pica8 switch only support matching vn-tag and hashing by vn-tag.

1.packets format

 

 16bits          1   1      14bits           1   1    2        12bits

----------------------------------------------------------------------------------------------------

 Ethertype  | D | P |    Dst_VIF     | L VER |    Src_VIF     |

----------------------------------------------------------------------------------------------------

2. detail description

Ethertype:pica8 switch can recognize two kinds of vn-tag packets with ethertype 0x8926 and 0x893f.0x893f is the default ethertype of vn-tag packets switch can recognize.You can use command "ovs-vsctl set-vntag-ethertype 0x8926" to set recognize another type of vn-tag packets.And use "ovs-vsctl show-vntag-ethertype" to show the current ethertype.

D|P ,L|R  :can be 0 or 1,do not do any limitations.

Dst_vif:destination virtual interface.Can be any values.

Src_vif:source virtual interface.Can be any values.

3.matching vn-tag

Now support matching vn-tag in icap and udf table.Not support matching vn-tag in egress table.Examples as below.

admin@PICOS-OVS:~$ovs-vsctl set-vntag-ethertype 0x8926
admin@PICOS-OVS:~$ovs-ofctl del-flows br0
admin@PICOS-OVS:~$ovs-ofctl add-flow br0 vn_tag=0x33330000/0x3FFF0000,dl_dst=00:11:11:11:11:11,actions=2
Send packets with vntag 0x8926,dst mac is 00:11:11:11:11:11,vntag is 0x33330000 to te-1/1/1.te-1/1/2 will transmit the vn-tag packets.

4.hashing according to dst_vif and src_vif

For pica8 switch,support dst_vif and src_vif hash fields in ecmp/lag advance hash mapping fields,For a lag port,only support dst_vif|src_vif hash fields in advance mode.Also support these two fields in l3-ecmp-select-group and lag-advance-hash-mapping-fields.By default,src_vif and dst_vif is disabled in the hash fields.Examples as below:

example1:

step1. set ethertype for VN-tag

admin@PICOS-OVS:~$ovs-vsctl set-vntag-ethertype 0x8926
admin@PICOS-OVS:~$ovs-vsctl show-vntag-ethertype

step2.add a ecmp select group

admin@PICOS-OVS:~$ovs-vsctl set-group-ranges ecmp-select-groups=1-200
admin@PICOS-OVS:~$sudo systemctl restart picos
admin@PICOS-OVS:~$ovs-ofctl add-group br0 group_id=20,type=select,bucket=set_field:44:44:44:11:11:11-\>dl_src,output:2,bucket=set_field:66:66:66:11:11:11-\>dl_src,output:3

step3. add a flow only matching dvif

admin@PICOS-OVS:~$ovs-ofctl add-flow br0 vn_tag=0x01110000/0x3FFF0000,dl_dst=00:11:11:11:11:11,actions=group:20
admin@PICOS-OVS:~$ovs-ofctl dump-flows br0
admin@PICOS-OVS:~$ovs-appctl pica/dump-flows

step4.set ecmp hash field to svif

admin@PICOS-OVS:~$ovs-vsctl set-l3-ecmp-hash-fields src_vif

step5.send packets with vn-tag

Send  10000 vntag packets dst mac is 00:11:11:11:11:11,dvif is 0x0111,vntag ethertype is 8926,svif is changing,initial value is 001,changing 100

result:the packets will hash to the te-1/1/2 and te-1/1/3.te-1/1/2 will transmit the vntag packets with dst mac is switch mac,src mac is 44:44:44:11:11:11,te-1/1/3 will transmit the vntag packets with dst mac is switch mac,src mac is 66:66:66:11:11:11.

example2:

step1. set ethertype for VN-tag

admin@PICOS-OVS:~$ovs-vsctl set-vntag-ethertype 0x8926
admin@PICOS-OVS:~$ovs-vsctl show-vntag-ethertype

step2.add a lag select group

admin@PICOS-OVS:~$ovs-vsctl set-group-ranges lag-select-groups=201-300
admin@PICOS-OVS:~$sudo systemctl restart picos
admin@PICOS-OVS:~$ovs-ofctl add-group br0 group_id=220,type=select,bucket=set_field:44:44:44:11:11:11-\>dl_src,output:2,bucket=output:3

step3. add a flow only matching dvif

admin@PICOS-OVS:~$ovs-ofctl del-flows br0
admin@PICOS-OVS:~$ovs-ofctl add-flow br0 vn_tag=0x01110000/0x3FFF0000,dl_dst=22:11:11:11:11:11,actions=group:220
admin@PICOS-OVS:~$ovs-ofctl dump-flows br0
admin@PICOS-OVS:~$ovs-appctl pica/dump-flows

step4.set ecmp hash field to svif

admin@PICOS-OVS:~$ovs-vsctl set-lag-advance-hash-mapping-fields src_vif

step5.send packets with vn-tag

Send  10000 vntag packets dst mac is 22:11:11:11:11:11,dvif is 0x0111,vntag ethertype is 8926,svif is changing,initial value is 001,changing 10

result:the packets will hash to the te-1/1/2 and te-1/1/3.te-1/1/2 and te-1/1/3 will transmit the vntag packets with dst mac is 22:11:11:11:11:11,src  mac is 44:44:44:11:11:11.

 

 

 

 

 

Copyright © 2024 Pica8 Inc. All Rights Reserved.