Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Group Tables

...

Next, there is the SELECT group, which is primarily designed for load balancing. As indicated in the following figure, each bucket in a SELECT group has an assigned weight, and each packet that enters the group is sent to a single bucket. The bucket selection algorithm is undefined and is dependent on the switch’s implementation; however, weighted round robin is perhaps the most obvious and simplest choice of packet distribution to buckets. The weight of a bucket is provided as a special parameter to each bucket. Each bucket in a SELECT group is still a list of actions, so any actions supported by OpenFlow can be used in each bucket, and the buckets need not be uniform.

 

 

Note

PicOS does not support weight. Because OVS forward is based on priority of entries in TCAM, the traditional ECMP in routing table cannot be used. For a typical IP flow, PicOS implements a "dummy ECMP" by splitting the matching fields of a flow. For a group-table with type=select, PicOS support set-select-group-hash-fields and the packets will hash according to the value of set-select-group-hash-fields.

The command added for setting select-group hash fields is:

...

Code Block
1. If the match field does not include dl_type=0x0800.
 
set-select-group-hash-fields: dl_src,dl_dst 
admin@PicOS-OVS$ovs-vsctl set-select-group-hash-fields dl_src,dl_dst
admin@PicOS-OVS$ovs-vsctl show-select-group-hash-fields
select_group_hash_fields: dl_src,dl_dst 
 
1> There is no dl_src or dl_dst in flow match field, use dl_src for hashing,
admin@PicOS-OVS$ovs-ofctl add-group br0 group_id=1,type=select,bucket=output:14,bucket=output:25,bucket=output:38
admin@PicOS-OVS$ovs-ofctl add-flow br0 in_port=1,actions=group:1
admin@PicOS-OVS$
admin@PicOS-OVS$ovs-appctl pica/dump-flows
#4 normal permanent recirc_id=0,in_port=1,dl_src=00:00:00:00:00:01/00:00:00:00:00:03, actions:25
#5 normal permanent recirc_id=0,in_port=1,dl_src=00:00:00:00:00:00/00:00:00:00:00:03, actions:14
#2 normal permanent recirc_id=0,in_port=1,dl_src=00:00:00:00:00:03/00:00:00:00:00:03, actions:14
#3 normal permanent recirc_id=0,in_port=1,dl_src=00:00:00:00:00:02/00:00:00:00:00:03, actions:38
 
2> dl_src has hashable mask in flow match field, use dl_src for hashing,
admin@PicOS-OVS$ovs-ofctl add-group br0 group_id=1,type=select,bucket=output:14,bucket=output:25,bucket=output:38
admin@PicOS-OVS$ovs-ofctl add-flow br0 in_port=1,dl_src=22:11:11:1100:1100:00/ff:ff:ff:00:00:00,actions=group:1
admin@PicOS-OVS$
admin@PicOS-OVS$ovs-appctl pica/dump-flows
#9 normal permanent recirc_id=0,in_port=1,dl_src=22:11:11:00:00:00/ff:ff:ff:00:00:03, actions:14
#8 normal permanent recirc_id=0,in_port=1,dl_src=22:11:11:00:00:01/ff:ff:ff:00:00:03, actions:25
#7 normal permanent recirc_id=0,in_port=1,dl_src=22:11:11:00:00:02/ff:ff:ff:00:00:03, actions:38
#6 normal permanent recirc_id=0,in_port=1,dl_src=22:11:11:00:00:03/ff:ff:ff:00:00:03, actions:14
 
3> dl_src has no hashable mask and there is no dl_dst in flow match field, use dl_dst for hashing,
admin@PicOS-OVS$ovs-ofctl add-group br0 group_id=1,type=select,bucket=output:14,bucket=output:25,bucket=output:38
admin@PicOS-OVS$ovs-ofctl add-flow br0 in_port=1,dl_src=22:11:11:11:11:11,actions=group:1
admin@PicOS-OVS$
admin@PicOS-OVS$ovs-appctl pica/dump-flows
#13 normal permanent recirc_id=0,in_port=1,dl_src=22:11:11:11:11:11,dl_dst=00:00:00:00:00:00/00:00:00:00:00:03, actions:14
#12 normal permanent recirc_id=0,in_port=1,dl_src=22:11:11:11:11:11,dl_dst=00:00:00:00:00:01/00:00:00:00:00:03, actions:25
#11 normal permanent recirc_id=0,in_port=1,dl_src=22:11:11:11:11:11,dl_dst=00:00:00:00:00:02/00:00:00:00:00:03, actions:38
#10 normal permanent recirc_id=0,in_port=1,dl_src=22:11:11:11:11:11,dl_dst=00:00:00:00:00:03/00:00:00:00:00:03, actions:14
 
4> There is no dl_src, and dl_dst has hashable mask in flow match field, use dl_src for hashing,
admin@PicOS-OVS$ovs-ofctl add-group br0 group_id=1,type=select,bucket=output:14,bucket=output:25,bucket=output:38
admin@PicOS-OVS$ovs-ofctl add-flow br0 in_port=1,dl_dst=22:22:22:00:00:00/ff:ff:ff:00:00:00,actions=group:1
admin@PicOS-OVS$
admin@PicOS-OVS$ovs-appctl pica/dump-flows                                     
#83 normal permanent recirc_id=0,in_port=1,dl_src=00:00:00:00:00:01/00:00:00:00:00:03,dl_dst=22:22:22:00:00:00/ff:ff:ff:00:00:00, actions:25
#81 normal permanent recirc_id=0,in_port=1,dl_src=00:00:00:00:00:03/00:00:00:00:00:03,dl_dst=22:22:22:00:00:00/ff:ff:ff:00:00:00, actions:14
#84 normal permanent recirc_id=0,in_port=1,dl_src=00:00:00:00:00:00/00:00:00:00:00:03,dl_dst=22:22:22:00:00:00/ff:ff:ff:00:00:00, actions:14
#82 normal permanent recirc_id=0,in_port=1,dl_src=00:00:00:00:00:02/00:00:00:00:00:03,dl_dst=22:22:22:00:00:00/ff:ff:ff:00:00:00, actions:38
 
5> dl_src and dl_dst have no hashable mask in flow match field, won't hash,
admin@PicOS-OVS$ovs-ofctl add-group br0 group_id=1,type=select,bucket=output:14,bucket=output:25,bucket=output:38
admin@PicOS-OVS$ovs-ofctl add-flow br0 in_port=1,dl_src=22:11:11:11:11:11,dl_dst=22:22:22:22:22:22,actions=group:1
admin@PicOS-OVS$
admin@PicOS-OVS$ovs-appctl pica/dump-flows
#18 normal permanent recirc_id=0,in_port=1,dl_src=22:11:11:11:11:11,dl_dst=22:22:22:22:22:22, actions:14
 
 
2. If the match field include dl_type=0x0800.

set-select-group-hash-fields: nw_dst,nw_src, 
admin@PicOS-OVS$ovs-vsctl set-select-group-hash-fields nw_dst,nw_src
admin@PicOS-OVS$ovs-vsctl show-select-group-hash-fields
select_group_hash_fields: nw_dst,nw_src

1> There is no nw_dst or nw_src in flow match field, use nw_dst for hashing,
admin@PicOS-OVS$ovs-ofctl add-group br0 group_id=1,type=select,bucket=output:14,bucket=output:25,bucket=output:38
admin@PicOS-OVS$ovs-ofctl add-flow br0 in_port=1,dl_type=0x0800,actions=group:1
admin@PicOS-OVS$
admin@PicOS-OVS$ovs-appctl pica/dump-flows                          
#28 normal permanent recirc_id=0,ip,in_port=1,nw_dst=0.0.0.2/0.0.0.3, actions:38
#30 normal permanent recirc_id=0,ip,in_port=1,nw_dst=0.0.0.0/0.0.0.3, actions:14
#29 normal permanent recirc_id=0,ip,in_port=1,nw_dst=0.0.0.1/0.0.0.3, actions:25
#27 normal permanent recirc_id=0,ip,in_port=1,nw_dst=0.0.0.3/0.0.0.3, actions:14
2> nw_dst has hashable mask, use nw_dst for hashing,
admin@PicOS-OVS$ovs-ofctl add-group br0 group_id=1,type=select,bucket=output:14,bucket=output:25,bucket=output:38
admin@PicOS-OVS$ovs-ofctl add-flow br0 in_port=1,dl_type=0x0800,nw_dst=192.168.2.0/24,actions=group:1
admin@PicOS-OVS$
admin@PicOS-OVS$ovs-appctl pica/dump-flows
#35 normal permanent recirc_id=0,ip,in_port=1,nw_dst=192.168.2.3/255.255.255.3, actions:14
#37 normal permanent recirc_id=0,ip,in_port=1,nw_dst=192.168.2.1/255.255.255.3, actions:25
#38 normal permanent recirc_id=0,ip,in_port=1,nw_dst=192.168.2.0/255.255.255.3, actions:14
#36 normal permanent recirc_id=0,ip,in_port=1,nw_dst=192.168.2.2/255.255.255.3, actions:38

3> nw_dst has no hashable mask and there is no nw_src in match field, use nw_src for hashing,
admin@PicOS-OVS$ovs-ofctl add-group br0 group_id=1,type=select,bucket=output:14,bucket=output:25,bucket=output:38
admin@PicOS-OVS$ovs-ofctl add-flow br0 in_port=1,dl_type=0x0800,nw_dst=192.168.2.100,actions=group:1
admin@PicOS-OVS$
admin@PicOS-OVS$ovs-appctl pica/dump-flows
#40 normal permanent recirc_id=0,ip,in_port=1,nw_src=0.0.0.2/0.0.0.3,nw_dst=192.168.2.100, actions:38
#42 normal permanent recirc_id=0,ip,in_port=1,nw_src=0.0.0.0/0.0.0.3,nw_dst=192.168.2.100, actions:14
#41 normal permanent recirc_id=0,ip,in_port=1,nw_src=0.0.0.1/0.0.0.3,nw_dst=192.168.2.100, actions:25
#39 normal permanent recirc_id=0,ip,in_port=1,nw_src=0.0.0.3/0.0.0.3,nw_dst=192.168.2.100, actions:14

4> There is no nw_dst, and nw_src has hashable mask, use nw_dst for hashing,
admin@PicOS-OVS$ovs-ofctl add-group br0 group_id=1,type=select,bucket=output:14,bucket=output:25,bucket=output:38
admin@PicOS-OVS$ovs-ofctl add-flow br0 in_port=1,dl_type=0x0800,nw_src=192.168.1.0/24,actions=group:1
admin@PicOS-OVS$
admin@PicOS-OVS$ovs-appctl pica/dump-flows
#46 normal permanent recirc_id=0,ip,in_port=1,nw_src=192.168.1.0/24,nw_dst=0.0.0.1/0.0.0.3, actions:25
#44 normal permanent recirc_id=0,ip,in_port=1,nw_src=192.168.1.0/24,nw_dst=0.0.0.3/0.0.0.3, actions:14
#47 normal permanent recirc_id=0,ip,in_port=1,nw_src=192.168.1.0/24,nw_dst=0.0.0.0/0.0.0.3, actions:14
#45 normal permanent recirc_id=0,ip,in_port=1,nw_src=192.168.1.0/24,nw_dst=0.0.0.2/0.0.0.3, actions:38

5> nw_src and nw_dst have no hashable mask in match field, won't hash,
admin@PicOS-OVS$ovs-ofctl add-group br0 group_id=1,type=select,bucket=output:14,bucket=output:25,bucket=output:38
admin@PicOS-OVS$ovs-ofctl add-flow br0 in_port=1,dl_type=0x0800,nw_src=192.168.1.100,nw_dst=192.168.2.100,actions=group:1
admin@PicOS-OVS$
admin@PicOS-OVS$ovs-appctl pica/dump-flows              
#48 normal permanent recirc_id=0,ip,in_port=1,nw_src=192.168.1.100,nw_dst=192.168.2.100, actions:14
 

3. set-select-group-hash-fields: nw_src,dl_src
 
admin@PicOS-OVS$ovs-vsctl set-select-group-hash-fields nw_src,dl_src
admin@PicOS-OVS$ovs-vsctl show-select-group-hash-fields
select_group_hash_fields: nw_src,dl_src 

admin@PicOS-OVS$ovs-ofctl add-group br0 group_id=1,type=select,bucket=output:12,bucket=output:13,bucket=output:14
admin@PicOS-OVS$ovs-ofctl add-flow br0 in_port=11,ip,nw_src=10.10.10.10,nw_dst=10.10.20.0/24,dl_src=00:00:00:11:11:00/ff:ff:ff:ff:ff:00,dl_dst=00:00:00:22:22:22,actions=group:1
 
The order is "nw_src, dl_src", so will check the first filed "nw_src" and find all mask bits of nw_src in flow entry are "1", in order will check the second filed "dl_src" find the some mask bits are not "1", then the hardware flow entry will hash by "dl_src".
admin@PicOS-OVS$
admin@PicOS-OVS$ovs-appctl pica/dump-flows                          
#29 normal permanent recirc_id=0,ip,in_port=11,dl_src=00:00:00:11:11:00/ff:ff:ff:ff:ff:03,dl_dst=00:00:00:22:22:22,nw_src=10.10.10.10,nw_dst=10.10.20.0/24, actions:12
#27 normal permanent recirc_id=0,ip,in_port=11,dl_src=00:00:00:11:11:02/ff:ff:ff:ff:ff:03,dl_dst=00:00:00:22:22:22,nw_src=10.10.10.10,nw_dst=10.10.20.0/24, actions:14
#28 normal permanent recirc_id=0,ip,in_port=11,dl_src=00:00:00:11:11:01/ff:ff:ff:ff:ff:03,dl_dst=00:00:00:22:22:22,nw_src=10.10.10.10,nw_dst=10.10.20.0/24, actions:13
#26 normal permanent recirc_id=0,ip,in_port=11,dl_src=00:00:00:11:11:03/ff:ff:ff:ff:ff:03,dl_dst=00:00:00:22:22:22,nw_src=10.10.10.10,nw_dst=10.10.20.0/24, actions:12


4. set-select-group-hash-fields: nw_src,dl_dst
admin@PicOS-OVS$ovs-vsctl set-select-group-hash-fields nw_src,dl_dst
admin@PicOS-OVS$ovs-vsctl show-select-group-hash-fields
select_group_hash_fields: nw_src,dl_dst

admin@PicOS-OVS$ovs-ofctl add-group br0 group_id=1,type=select,bucket=output:12,bucket=output:13,bucket=output:14
admin@PicOS-OVS$ovs-ofctl add-flow br0 in_port=11,ip,nw_src=10.10.10.10,nw_dst=10.10.20.0/24,dl_src=00:00:00:11:11:00/ff:ff:ff:ff:ff:00,dl_dst=00:00:00:22:22:22,actions=group:1
 
The order is "nw_src, dl_dst", so will check the first filed "nw_src" and find all mask bits of nw_src in flow entry are "1", in order will check the second filed "dl_dst" find all the mask bits are "1", selected field in this time then only one bucket can be used.
 
admin@PicOS-OVS$ovs-appctl pica/dump-flows             
#30 normal permanent recirc_id=0,ip,in_port=11,dl_src=00:00:00:11:11:00/ff:ff:ff:ff:ff:00,dl_dst=00:00:00:22:22:22,nw_src=10.10.10.10,nw_dst=10.10.20.0/24, actions:14

...