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

From PicOS 2.8.0, Pica8 switch supports the traffic which has processed in TCAM, still can hash as ecmp interface or lag interface.

In prior PicOS version, the traffic in TCAM table only could hash as select group, refer to chapter 'Creating a Group Table,' the hash algorithm is defined by the designer. But from the new version, user can use ecmp or lag to process traffic.

1, ‘dec_ttl’ only can be used in table=252 route table and ecmp-select-group, others will neglect it.

Once configure ecmp-select-group, L2 table (table=251) cannot work.

2, Platforms P-3290/P-3295/P-3297 do not support configure ecmp-group.

3, The max ecmp group buckets number is 32.

4.When ecmp-select-group has been configured,the following functions cannot work.

vxlan,gre,l2gre;

push_pbb,pop_pbb;

push_mpls,pop_mpls

push_l2mpls,pop_l2mpls.


In default, ecmp and lag hash cannot work in TCAM table, user needs to use group table to define them. 'lag-select-groups=0-0' means the group ID range is 0-0, that is disable lag-select-groups. Same as others.

The command to show the ranges of ecmp-select-groups and lag-select-groups.

admin@PicOS-OVS$ovs-vsctl show-group-ranges    
group_ranges: default
  lag-select-groups=0-0
  ecmp-select-groups=0-0
  ingress-mirror-groups=0-0
  egress-mirror-groups=0-0

ECMP Select Group

Select group uses ecmp, create an ecmp interface for each select group, and the ecmp interface contains egress interfaces which correspond to buckets in the group. 

The command to configure ecmp-select-group ID range:

ovs-vsctl set-group-ranges ecmp-select-groups=<min_value>-<max_value>

The group IDs may be divided into different areas: ecmp-select-groups and the original groups. Ecmp-select-groups ranges is <min_value>-<max_valueand the rest of group IDs for original groups. The max range of group is 1-4294967039.

After configuring the command, user needs to reboot switch. 

Use command ovs-vsctl set-group-ranges to back default group ranges.

admin@PicOS-OVS$ovs-vsctl set-group-ranges ecmp-select-groups=1-10000
admin@PicOS-OVS$ovs-vsctl show-group-ranges                          
group_ranges: 
  lag-select-groups=0-0
  ecmp-select-groups=1-10000
  ingress-mirror-groups=0-0
  egress-mirror-groups=0-0

In ecmp select group can modify dl_dst, dl_src, dl_vlan, dec_ttl and set_queue. And the actions must be same in different buckets, the value can be the same or not.

If dec_ttl is set or set_field with vlan_vid,dl_src or dl_dst is set in an ecmp select group flow’s actions, the ecmp will modify packet’s corresponding field. If the fields are not set in an ecmp select group flow, the value also will be modified via L3 ecmp interface, and dl_src and dl_dst will be switch system mac and ttl will decrease.

User can use command 'set-l3-egress-keep-fields' to keep the field as original value.

ovs-vsctl set-l3-egress-keep-fields [FIELDS]

[FIELDS] allows one or more value of {dl_vlan, dl_src, dl_dst, nw_ttl}. If not special configure [FIELDS] , will back default value and the fields will be modified by L3 ecmp interface.

During add flow entry whose actions include ecmp-select-group, other actions fields only support above fields:  dl_src, dl_src, dl_vlan, dec_ttl and set_queue.

ovs-vsctl set-l3-ecmp-hash-fields [FIELDS]

<FIELDS> allowed values in_port, nw_dst, nw_proto, nw_src, port_dst, port_src, vlan, src_vif, dst_vif, gtp_teid. If not special configure <FIELDS], the default value is nw_src. If user want configure multiple values, should use blank.

admin@PicOS-OVS$ovs-vsctl set-l3-ecmp-hash-fields in_port nw_dst 

 

Example 1

Set group 1 as an ecmp select group, modify dl_vlan, dl_src and dl_dst, dec ttl.

admin@PicOS-OVS$ovs-ofctl add-group br0 group_id=1,type=select,bucket=set_field:10-\>vlan_vid,set_field:00:00:00:22:22:22-\>dl_src,set_field:00:00:00:33:33:33-\>dl_dst,dec_ttl,output:33,bucket=set_field:20-\>vlan_vid,set_field:00:00:00:44:44:44-\>dl_src,set_field:00:00:00:55:55:55-\>dl_dst,dec_ttl,output:34 
admin@PicOS-OVS$ovs-ofctl add-flow br0 in_port=31,ip,actions=group:1
 
admin@PicOS-OVS$ovs-appctl pica/dump-flows
#0 normal_d permanent flow_id=2 priority=0, actions:drop
#1 normal permanent flow_id=6 (ecmp select group) in_port=31, actions:egress_dec_ttl,set(eth(src=00:00:00:22:22:22,dst=00:00:00:33:33:33)),set_vlan_id(vid=10),33,egress_dec_ttl,set(eth(src=00:00:00:44:44:44,dst=00:00:00:55:55:55)),set_vlan_id(vid=20),34
Total 2 flows in HW.

Example 2

Set group 1 as an ecmp select group, do not change dl_vlan,dl_src,dl_dst and ttl.

vlan_vid,dl_src and dl_dst are not set in an ecmp select group flow, and packet’s corresponding fields stay unchanged.

admin@PicOS-OVS$ovs-vsctl set-l3-egress-keep-fields dl_vlan,dl_src,dl_dst,nw_ttl
 
admin@PicOS-OVS$ovs-ofctl add-group br0 group_id=1,type=select,bucket=output:33,bucket=output:34
admin@PicOS-OVS$ovs-ofctl add-flow br0 in_port=31,dl_vlan=30,dl_dst=00:00:00:11:11:11,actions=group:1
 
admin@PicOS-OVS$ovs-appctl pica/dump-flows
#0 normal_d permanent flow_id=2 priority=0, actions:drop
#2 normal permanent flow_id=8 (ecmp select group) in_port=31,dl_vlan=30,dl_dst=00:00:00:11:11:11, actions:33,34
Total 2 flows in HW.

Example 3

Set group 1 as an ecmp select group, modify dl_vlan, dl_src only and other packet’s corresponding fields stay unchanged.

admin@PicOS-OVS$ovs-vsctl set-l3-egress-keep-fields dl_dst,nw_ttl
 
admin@PicOS-OVS$ovs-ofctl add-group br0 group_id=1,type=select,bucket=set_field:10-\>vlan_vid,set_field:00:00:00:22:22:22-\>dl_src,output:33,bucket=set_field:20-\>vlan_vid,set_field:00:00:00:44:44:44-\>dl_src,output:34 
admin@PicOS-OVS$ovs-ofctl add-flow br0 in_port=31,actions=group:1
 
admin@PicOS-OVS$ovs-appctl pica/dump-flows
#0 normal_d permanent flow_id=2 priority=0, actions:drop
#3 normal permanent flow_id=9 (ecmp select group) in_port=31, actions:set(eth_src((src=00:00:00:22:22:22))),set_vlan_id(vid=10),33,set(eth_src((src=00:00:00:44:44:44))),set_vlan_id(vid=20),34
Total 2 flows in HW.

 

 

 

 

  • No labels