WDS network - setting STP right

Hello guys :wave:

							Internet over DHCP (WAN)
									|

WDS Client 2 ~~~ WDS Client 1 ~~~ main Router (WDS AP) ~~~ WDS Client 3
192.168.1.4______192.168.1.3________192.168.1.1___________192.168.1.5

This is my home setup.
I am trying for the last 2 weeks to make it work because from time to time it was going down. Sometimes minutes, sometimes it worked an hour oder two.
Then I could't ping some/all of the 4 Routers. Sometimes I counldn't ping client 1 and 2. Sometimes it was Client 3 or even the main router.

I tried to figure out what's wrong and I think I found out what's the problem. At least the network is working flawlessly since yesterday.
The spanning tree protocoll was set wrong.

In the wiki there is the suggestion to enable it on the WDS Client.
So I did enabled STP on all clients. But that don't work.

Then I tried to enable it on the main router + Client1+2+3. This also did not worked.

STP off on all -> also not working.

I searched for an solution and I found this:

Linksys did just enable STP on the WDS AP.
So i gave it a try - and it works!

So STP is only active on the main router now. client1+2+3 have it disabled.

Can somebody explain me why I have to set it up like that?

The wiki describes clearly it has to be activated on the WDS client's lan bridge?
I also read that STP only works on the wired side of the network? But this can't be true, right? (here: https://support.huawei.com/enterprise/en/doc/EDOC1100096325/3b5acc84/stp-scenarios-supported-by-a-wds-network)

And my last question: Where the hell did it create that loop?
I can't see the a loop. The clients are locked to the BSSID so they connect everytime like shown above.

Without any logs it can be hard to understand how it happened, but in principal the main router saw its own mac coming back form a client. So chances are one of the clients connected somewhere it wasn't supposed to.

1 Like

hello trendy

I can provide you the logs if you tell me which one do you need.
I'm interested what / if something is wrong.

But before you have to tell me on which bridge I have to enable (or completly disable?) the STP.

I guess the logs will be visible in logread, otherwise check dmesg. Try to grep -i stp to narrow it down.
You can have STP running on all nodes. However you need to configure it, and if I am not mistaken, you only enabled it, so it was running on all 4 nodes with the defaults, so the root bridge was random all the time. Is my understanding correct?

1 Like

Enable STP everywhere and set the priority on the main router to 4096 and to i.e. 8192 everywhere else. Do not fiddle with the default timers for now. Give the network 20 sec up to 60 sec to "stabilize"...

If you have not yet done so, read https://en.m.wikipedia.org/wiki/Spanning_Tree_Protocol to get the basics...

2 Likes

Yes that's right.
I just ticked the STP Box and hit save & apply.

Is there more to configure than these 3 settings?

Well, yes. We explained earlier that the STP in defaults will elect the root bridge randomly.

1 Like

Not random. Iirc the lowest mac address wins. But yeah quiet often it just don't feel predictable.
Anyhow it's better to just set the priorities based on the actual design and hierarchy of the network.

2 Likes

I've running STP on all bridges right now - looks good. No issues so far.

Log on the root bridge:

Wed Jan 31 10:19:57 2024 kern.info kernel: [258150.147203] br-lan: port 9(wlan1.sta3) received tcn bpdu
Wed Jan 31 10:19:57 2024 kern.info kernel: [258150.152608] br-lan: topology change detected, propagating
Wed Jan 31 10:20:48 2024 kern.info kernel: [258201.113908] br-lan: port 9(wlan1.sta3) received tcn bpdu
Wed Jan 31 10:20:48 2024 kern.info kernel: [258201.119318] br-lan: topology change detected, propagating
Wed Jan 31 10:20:55 2024 kern.info kernel: [258208.065670] br-lan: port 9(wlan1.sta3) received tcn bpdu
Wed Jan 31 10:20:55 2024 kern.info kernel: [258208.071076] br-lan: topology change detected, propagating
Wed Jan 31 10:22:09 2024 kern.info kernel: [258282.184658] br-lan: port 8(wlan1.sta1) received tcn bpdu
Wed Jan 31 10:22:09 2024 kern.info kernel: [258282.190061] br-lan: topology change detected, propagating

I still have one question. Does it make sense to set the bridge priority as follows?

main router - 0
WDS client 1 - 4096
WDS client 2 - 8192
WDS client 3 - 4096

Thank you bernd and trendy for your great support!

I would only assign the lowest value once, i.e. to the "core switch". Every switch behind that should get a higher value. You want to have the root bridge as close the the edge of the network as possible.

I did it as you describe. I've set the bridge priority of the main router to "0"
From what I have read this should be the lowest possible value.

Topology now:

WDS2 (8192) --- WDS1 (4096) --- main router (0) --- WDS3 (4096)

number in brackets: bridge priority

--- = WDS link

2 Likes

I hope nobody minds, If I use this topic do seek for opinion.
I have the following WDS bridge:
x86->ethernet->RT3200-1->WDS->another RT3200-2 ( works as client and master on 5Ghz)
Everything works ok for nearly 2 months, but I am looking around the forum to make my config better or to learn something.
So, as I have similar setup, however with STP enabled only on RT3200-2 with default values, I have experimented by enabling STP on RT3200-1 too and changed the priorities on RT3200-1 to 4096 and on RT3200-2 to 8192.
This action however triggered the RX transmission ( can not remember on which RT) to drop from around 1200 Mbit/s to 24 and the other RT was not accesable.
Am I doing something wrong - for example leaving STP off on the x86 ( I intentialy left if off as the connection is via cable)?
I am aware that I should not touch a config which is working, but something inside of me always triggers me to a decisions which I later regred:)
Thanks
Kr
K
PS: x86 is without Wifi and both Rt3200 are setup as dumb AP.

if everything is connected in a star-topology or even "extended" star (like with additional leafs) then there is not even the/a need to enable stp at all. stp comes into play when multiple layer-2 connections between switches are setup[1]. or you want to avoid that some smarthead in your household connects an ethernet cable in two ports of the same switch...

[1] like, router --> ap1/ap2/ap3 and between ap1 and ap2 there is a cable, and between ap2 and ap3; and from ap3 to ap4; something like this. but if you just have a bunch of ap connected anyhow to a router/core-switch but between the ap are no interconnects, then stp is technically not needed :man_shrugging:

3 Likes

In case the x86 machine is used for routing, I would set it up like this:

x86 - STP on - bridge priority: 0

RT3200-1 - STP on - bridge priority: 4096

RT3200-2 - STP on - bridge priority: 8192

I had similar issues before I set up STP right.

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.