Re: behaviour of tc for bridged ports

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It can be stupid answer but try limiting traffic on br0.
Also try using htb with tc filter.


W dniu 9.07.2023 o 14:24, Nayan Gadre pisze:
Hi Experts,

I have a wireless router having the client facing interface wlan0 and
the wired gateway facing interface eth0 under a bridge br0.

/ # brctl show
bridge name     bridge id               STP enabled     interfaces
br0             8000.bce67c4d8fb0       no              eth0
                                                                            wlan0

client get IP 192.168.0.105, and server (connected via eth0) has IP
192.168.0.10.
On server I run "iperf3 -s -p 5678 -V"
On client I run "iperf3 -c 192.168.0.10 -p5678 -i1 -tinf"
All works fine.

Now I want to rate limit the traffic going from wlan0 to eth0 to 5000kbits/sec.

I tried to apply a classless qdisc to eth0 port as well as wlan0 port.
# tc qdisc add dev eth0 root tbf rate 5000kbit latency 50ms burst 15k
# tc qdisc add dev wlan0 root tbf rate 5000kbit latency 50ms burst 15k

However, the qdisc does not take effect.

iperf3 -c 192.168.0.10 -p5678 -i1 -tinf
Connecting to host 192.168.0.10, port 5678
[  5] local 192.168.0.105 port 43384 connected to 192.168.0.10 port 5678
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  10.7 MBytes  89.6 Mbits/sec    0    526 KBytes
[  5]   1.00-2.00   sec  8.95 MBytes  75.1 Mbits/sec    0    560 KBytes
[  5]   2.00-3.00   sec  9.13 MBytes  76.6 Mbits/sec    0    619 KBytes

/ # tc -s qdisc
qdisc tbf 8005: dev eth0 root refcnt 5 rate 5Mbit burst 15Kb lat 50ms
  Sent 221305 bytes 469 pkt (dropped 157, overlimits 288 requeues 0)
  backlog 0b 0p requeues 0
qdisc tbf 8006: dev wlan16 root refcnt 5 rate 5Mbit burst 15Kb lat 50ms
  Sent 7095 bytes 109 pkt (dropped 0, overlimits 0 requeues 0)
  backlog 0b 0p requeues 0

My kernel is 4.4.60, and I checked that qdisc gets activated in the
egress path after dev_queue_xmit() is called. And for a bridged port,
the path taken by the packet coming to wlan0 is
__br_deliver -> br_forward_finish -> br_dev_queue_push_xmit -> dev_queue_xmit.

So the qdisc should have taken effect even in the bridged case. I see
statistics for eth0 qdisc.
What am I missing in the tc rule ?

If I apply the same rule on the server and client interfaces then I
can see rate limiting taking effect. But on the wireless router linux
bridge it's not working.

Thanks
N Gadre

--
---
Pozdrawiam
Adam Nieścierowicz
begin:vcard
fn;quoted-printable:Adam Nie=C5=9Bcierowicz
n;quoted-printable:Nie=C5=9Bcierowicz;Adam
email;internet:adam.niescierowicz@xxxxxxxxxx
x-mozilla-html:TRUE
version:2.1
end:vcard


[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux