Versions Compared

Key

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

Summary

If we don't limit the user ability to send data, then a large amount of traffic from different users could continuously make the network congested. In order to allocate the network resources to each user fairly and efficiently, the traffic should be limited. For instance, for the flow of a stream at each time interval, we only assign it a portion of the network resources to prevent network congestion caused by excessive burst.


In the ovs mode, user can configure meter to achieve interface and set the speed-limit including ingress and egress.The meter uses the token bucket to evaluate the specifications of the traffic, then makes a policy for the traffic, such as through, remark or drop.

Now we support 1R2C and 2R3C for the token bucket in the ingress meter and egress meter.

Configuration

In different hardware models, the maximum count of meters that PicOS OVS supports is different. User can use the command to check the maximum count.

...

Code Block
root@LNOS-OVS$ovs-vsctl set-meter-ranges egress-meter=3-4 
  Please reboot for the change to take effect!
root@LNOS-OVS$/etc/init.d/picosOVS$systemctl restart picos

Check egress meter configuration

...

Code Block
root@LNOS-OVS$ovs-vsctl set-meter-ranges egress-meter=3-4  
  Please reboot for the change to take effect!
root@LNOS-OVS$/etc/init.d/picosOVS$systemctl restart picos
 
Ingress meter:
root@LNOS-OVS$ovs-ofctl add-meter br0 meter=1,kbps,bands=type=dscp_remark,rate=
100000,prec_level=1,type=drop,rate=300000
root@LNOS-OVS$ovs-ofctl add-meter br0 meter=2,kbps,bands=type=dscp_remark,rate=
100000,prec_level=14,type=drop,rate=300000
 
Egress meter:
ovs-ofctl
add-meter br0 meter=3,kbps,bands=type=drop,rate=200000 
 
Add flow:
root@LNOS-OVS$ovs-ofctl add-flow br0 in_port=33,ip,dl_src=22:11:11:11:11:11,act
ions=meter:1,egress_meter:3,output:35 
root@LNOS-OVS$ovs-ofctl add-flow br0 in_port=34,ip,dl_src=22:11:11:11:11:12,act
ions=meter:2,egress_meter:3,output:35 
root@LNOS-OVS$
root@LNOS-OVS$ovs-appctl pica/dump-flows
#0 normal_d permanent flow_id=2 priority=0, actions:drop
#2 normal permanent flow_id=6 ip,in_port=33,dl_src=22:11:11:11:11:11, actions:meter(id=1,band(dscp_remark=1),band(drop)),egress_meter(id=3,band(drop)),35
#3 normal permanent flow_id=7 ip,in_port=34,dl_src=22:11:11:11:11:12, actions:meter(id=2,band(dscp_remark=14),band(drop)),egress_meter(id=3,band(drop)),35
Total 3 flows in HW.
root@LNOS-OVS$

...