[ovs-discuss] Rate limiting

Marian Mihailescu mihailescu2m at gmail.com
Mon Sep 22 06:27:20 UTC 2014


Hi, I am trying to limit the bandwidth for a host.
My setup is the following:

host (eth0 192.168.2.2) gateway is 192.168.0.1 and route to that is via eth0
host is connected to an openwrt switch on interface "eth0.2"
"eth0.2" is a port in "of-switch" bridge, "of-switch" has ip 192.168.0.1
"eth0.5" is connected to the internet (not part of of-switch) and is
doing NAT for "of-switch"

I am using iperf with a server outside of this network.

If I use:
$ ovs-vsctl set Interface eth0.2 ingress_policing_rate=1000

then iperf reports ~1M
so this works.

However, I want to use the qos tables:

$ ovs-vsctl -- set Port eth0.2 qos=@newqos \
-- --id=@newqos create QoS type=linux-htb
other-config:max-rate=1000000 queues=0=@q2,1=@q1 \
-- --id=@q0 create Queue other-config:min-rate=1000000
other-config:max-rate=1000000 \
-- --id=@q1 create Queue other-config:min-rate=500000
other-config:max-rate=500000

this works, I can see the QoS and Queue tables (with ovsdbmonitor), also:

$ tc class show dev eth0.2
class htb 1:1 parent 1:fffe prio 0 rate 1Mbit ceil 1Mbit burst 1564b
cburst 1564b
class htb 1:fffe root rate 1Mbit ceil 1Mbit burst 1500b cburst 1500b
class htb 1:2 parent 1:fffe prio 0 rate 500Kbit ceil 500Kbit burst
1564b cburst 1564b

Then I set the flows:

$ ovs-ofctl del-flows of-switch
$ ovs-ofctl add-flow of-switch dl_src=HOST_MAC,actions=output:LOCAL
$ ovs-ofctl add-flow of-switch dl_dst=HOST_MAC,actions=enqueue:2:0

I was expecting this to lead also to 1M rate (or 500K for
enqueue:2:1); however this is not working, and my rate is not being
limited.

Any advice on what I am doing wrong?
Thanks!

--
Either I've been missing something or nothing has been going on. (K. E. Gordon)



More information about the discuss mailing list