Configuring rate limit

From 2.11.16, Pica8 support configuring rate limit for port. Interface-based rate limiting controls the total rate of all packets passing through an interface to ensure that the bandwidth usage is within the allowed range. For the same interface, you can configure interface-based rate limiting in both ingress and egress directions or in only one direction.

1, Configuring ingress interface-based rate limt

If you do not limit the traffic sent by users, the continuous burst of data of a large number of users will make the network more crowded. By configuring the ingress interface-based rate limiting on the interface, you can limit the traffic entering the interface to a reasonable range. 

Command:

ovs-vsctl set interface <ingress-port> ingress_policing_rate=<value1>
ovs-vsctl set interface <ingress-port> ingress_policing_burst=<value2>

 Note:

(1) The unit is kbps.

(2) These commands can only apply on physical ports.

(3) When there is none burst configure,ingress_policing_burst is equal to ingress_policing_rate.  

Configuration example:

Set the rate limit 300000 on ingress port for the ingress traffic. 

1)create bridge and add ports to bridge.

ovs-vsctl add-br br0
ovs-vsctl add-port br0 te-1/1/1 vlan_mode=trunk tag=1
ovs-vsctl add-port br0 te-1/1/2 vlan_mode=trunk tag=1

2)add flow.

ovs-ofctl add-flow br0 in_port=1,actions=2

3)configure ingress rate limit on te-1/1/1.

ovs-vsctl set interface te-1/1/1 ingress_rate_limit=300000

 And after above configuration, you can limit the traffic entering to te-1/1/1 as 300M.

2, Configuring egress interface-based rate limt

To control the rate of all outgoing traffic on an interface, configure egress interface-based rate limiting. When the transmit rate of packets exceeds the configured rate limit, the excess packets will be discarded.

Command:

ovs-vsctl set interface <egress-port> egress_policing_rate=<value1>
ovs-vsctl set interface <egress-port> egress_policing_burst=<value2>

 Note:

(1) The unit is kbps.

(2) These commands can only apply on physical ports.

(3) When there is none burst configure,egress_policing_burst is equal to egress_policing_rate.  

Configuration example:

Set the rate limit 300000 on egress port for the egress traffic. 

1)create bridge and add ports to bridge.

ovs-vsctl add-br br0
ovs-vsctl add-port br0 te-1/1/1 vlan_mode=trunk tag=1
ovs-vsctl add-port br0 te-1/1/2 vlan_mode=trunk tag=1

2)add flow.

ovs-ofctl add-flow br0 in_port=1,actions=2

3)configure egress rate limit on te-1/1/1.

ovs-vsctl set interface te-1/1/2 egress_rate_limit=300000

 And after above configuration,when the transmit rate of packets exceeds 300M, the excess packets will be discarded

Copyright © 2024 Pica8 Inc. All Rights Reserved.