SQM not working on bridged interface 21.02.0-rc4

Hi all,

In my Linksys EA4500 setup I have bridged one lan port with the wan port, and I want to use Cake SQM on the wan interface. This was working with 19.07 using VLAN setup. With 21.02 and DSA, bridging is done without VLANs, but the SQM does not seem to be connected with the data flow. The interfaces tab in Luci shows that just a few packets go through this interface. How can I get all the data through this interface?

20.02 setup:

config device
	option name 'ethernet4'
	list ports 'ethernet4'

config interface 'lan'
	option device 'ethernet4'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'
	
config device
	option name 'br-internet'
	option type 'bridge'
	list ports 'ethernet1'
	list ports 'internet'
	
config interface 'wan'
	option proto 'none'
	option device 'br-internet'

19.07 setup - SQM working:

config interface 'lan'
	option type 'bridge'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option ports 'eth0.1 eth0.3'

config interface 'wan'
	option proto 'dhcp'
	option type 'bridge'
	option ports 'eth0.1 eth1.2'

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option vid '1'
	option ports '0 5t'

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '4 6t'
	option vid '2'

config switch_vlan
	option device 'switch0'
	option vlan '3'
	option vid '3'
	option ports '3 5t'

really don't know that device... and am not an expert in this area... but just from a quick glance...

that (working) 19.x config looks whacky to me... why would you have the same dot1q interface (eth0.1) in both a lan and wan bridge at the same time? (actually I would not expect that to even be possible)

1 Like

You are right. The 19.x setup I posted was not correct. I have reinstalled the 19.07.8 version, tested and corrected the setup. This is a working setup:

config interface 'lan'
	option type 'bridge'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option ifname 'eth0.3'

config interface 'wan'
	option proto 'none'
	option type 'bridge'
	option ifname 'eth0.1 eth1.2'

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option vid '1'
	option ports '0 5t'

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '4 6t'
	option vid '2'

config switch_vlan
	option device 'switch0'
	option vlan '3'
	option vid '3'
	option ports '3 5t'

yeah that looks more sensible... not sure where you got the 'internet' port name (or 'ethernet1' maybe that is normal on that device)

should look more like

config device
	option name 'br-internet'
	option type 'bridge'
	list ports 'lan1'
	list ports 'ethx.x'
	
config interface 'wan'
	option proto 'none' #you probably want proto here
	option device 'br-internet'

see here for more info

Properly configured, Ethernet to Ethernet in the same VLAN will be hardware switched. The CPU doesn't see the packets. On the other hand it happens at line speed, so SQM may not be necessary.

In order to do SQM you need to have the ports in different VLANs then software bridge the two VLANs, to force packets to go through the kernel instead of the hardware switch.

Thanks. The names ethernet1 and internet are port names for this device, so the setup is working for the bridging part.

1 Like

Thank you. This was clarifying. I was trying to do this with VLANs, but could not figure out how to do VLANS with DSA. Any suggestions about that would very helpful.

you dont need vlans... the vlans on 19 were to get packets through the switch out of a port untagged...

dsa handles this transparently...

what do you think you need vlans for?
did you read the linked guide?

I think this is explained in the reply from mk24. I need it to force the packets to be handled by the CPU.

right... i see now you also changed the proto in your updated 19 post...

did you read the linked guide?

Yes, thank you. I have read the guide, and tested the VLAN setup there. The examples are about bridge-vlan. I need to assign a single port to a VLAN and I am unsure if "config bridge-vlan" is the right way to do it.

Maybe this will do to define VLAN 1 and VLAN 2?

config device
	option name 'br-internet'
	option type 'bridge'
	list ports 'ethernet1.1'
	list ports 'internet.2'
1 Like

you want to bridge two vlan or a port to vlan, like legacy switch configuration, but with DSA.
Right?

so i know this is a bridge layer 3.

a solution with relayd.
I don't know if you can bridge vlans with DSA. if you can, I would like to know

config device
	option name 'ethernet4'
	list ports 'ethernet4'

config interface 'lan'
	option device 'ethernet4'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'
	
config device
	option name 'br-internet'
	option type 'bridge'
	list ports 'ethernet1'
	list ports 'internet'
	
config interface 'wan'
	option proto 'none'
	option device 'br-internet'

config interface 'bridgeWan' #bridge layer 3
	option proto 'relay'
	option ipaddr '192.168.x.x'  #ip wan
	list network 'wan'
	list network 'lan'

SQM

config queue
	option interface 'br-internet'
	...

Yes, I want to bridge two VLANs such that the CPU will forward the packets to Cake SQM.

Some background:

This device is used in a public ski arena in a rural area where internet access is via 4G broadband modems. We experience quite a bit of bufferbloat delays. The internal network have some complexity with several switches, high speed connections between buldings and several WiFi access points. This device is used internally in the network for traffic shaping. The initial setup (19.x) is based on the "bump in the wire" concept as described here: A little bump in the wire that makes your Internet faster (see BYOB (Build Your Own Bump) for the implementation).

So, I just want this bump in the wire concept to work with the 21.02 version, and my understanding is that I need to use DSA. The 19.x configuration files does not work.

I will try your suggested solution, and let you know.

I have tried the relayd setup, unfortunately without success.

With this setup, I get VLANs ready, but there are no connection between them:

config device
        option name 'ethernet4'
        list ports 'ethernet4'

config interface 'lan'
        option device 'ethernet4'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config device
        option name 'br-internet'
        option type 'bridge'
        option macaddr '20:aa:4b:74:a4:6b'
        list ports 'ethernet1.1'
        list ports 'internet.2'

config interface 'wan'
        option device 'br-internet'
        option proto 'dhcp'

From system log:

Tue Aug  3 11:11:16 2021 daemon.notice netifd: VLAN 'internet.2' link is up
Tue Aug  3 11:11:34 2021 daemon.notice netifd: VLAN 'ethernet1.1' link is up

However, from ethernet1-port, the DHCP request is not forwarded:

Tue Aug  3 11:11:39 2021 daemon.warn dnsmasq-dhcp[2714]: DHCP packet received on ethernet1 which has no address

If I change the setup to not use VLANs, the bridging is working:

config device
        option name 'br-internet'
        option type 'bridge'
        option macaddr '20:aa:4b:74:a4:6b'
        list ports 'ethernet1'
        list ports 'internet'

So , I still don't know how to bridge VLANs with DSA or if it is possible at all.

Try this:

config device
   option name 'br-eth'
   list ports 'ethernet1'
   list ports 'internet'

config bridge-vlan
   option device 'br-eth'
   option vlan 1
   list ports 'ethernet1'

config bridge-vlan
    option device 'br-eth'
    option vlan 2
    list ports 'internet'

config interface 'wanbr'
    option type 'bridge'
    option proto 'none'
    list device 'br-eth.1'
    list device 'br-eth.2'

Behind the scenes, this should have the switch send each port independently on a VLAN to the CPU port. Then join the two CPU VLANs are joined in a software bridge. Which is also what the previous swconfig did.

Apply SQM on br-eth.1 or br-eth.2, not wanbr.

Thank you. I have tried this, but unfortunately, ethernet1 port is not coming up, and no VLANs:

root@OpenWrt:~# logread -e VLAN
Tue Aug  3 20:26:30 2021 kern.info kernel: [    1.155615] 8021q: 802.1Q VLAN Support v1.8
Tue Aug  3 20:26:30 2021 kern.info kernel: [    4.232089] 8021q: adding VLAN 0 to HW filter on device ethernet1
Tue Aug  3 20:26:36 2021 kern.info kernel: [   19.419942] 8021q: adding VLAN 0 to HW filter on device ethernet4
root@OpenWrt:~# ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1508 qdisc mq state UP qlen 1000
    link/ether 20:aa:4b:74:a4:6a brd ff:ff:ff:ff:ff:ff
3: ethernet1@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noqueue state DOWN qlen 1000
    link/ether 20:aa:4b:74:a4:6a brd ff:ff:ff:ff:ff:ff
4: ethernet2@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 20:aa:4b:74:a4:6a brd ff:ff:ff:ff:ff:ff
5: ethernet3@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 20:aa:4b:74:a4:6a brd ff:ff:ff:ff:ff:ff
6: ethernet4@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether 20:aa:4b:74:a4:6a brd ff:ff:ff:ff:ff:ff
7: internet@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 20:aa:4b:74:a4:6a brd ff:ff:ff:ff:ff:ff
8: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 20:aa:4b:74:a4:6c brd ff:ff:ff:ff:ff:ff
9: wlan1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 20:aa:4b:74:a4:6e brd ff:ff:ff:ff:ff:ff

The interface section in Luci say for WANBR, Error: Network device is not present.

In first stanza

	option type 'bridge'

required?

brctl show
bridge vlan

do not see the expected bridge above.

maybe

config device
	option name 'ethernet4'
	list ports 'ethernet4'

config interface 'lan'
	option device 'ethernet4'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'
	
config device
	option name 'br-internet'
	option type 'bridge'
	list ports 'ethernet1'
	list ports 'internet'
	
config interface 'wan'
	option proto 'none'
	option device 'br-internet'

config device
	option type 'bridge'
	list ports 'ethernet4'
	list ports 'ethernet1'

SQM

config queue
	option interface 'br-internet'