Community discussions

MikroTik App
 
ashpri
Member Candidate
Member Candidate
Topic Author
Posts: 154
Joined: Sun Oct 14, 2018 3:11 am

(R)STP Aha! moment

Fri Jul 29, 2022 3:10 am

I've just had an aha! moment with STP that might help other beginners understand the concept. I've just made my core router a root bridge. I was concerned that CPU cycles would increase but it didn't, so I became curious what is exactly the purpose of a root bridge in a redundant network.

Experts correct me if I am wrong:

1. (R/M) STP is not needed unless you have more than one path from one end of your network to the other.
2. A root bridge has nothing to do with packetflow (packets do not flow back to the root bridge and back out).
3. The aha! moment: A root bridge is like GMT for timezone. For timezones to exist, you need a source timezone (zero-point) or GMT. This is all that a root bridge is. It is coordinate zero used to calculate path-cost along the network. Every switch in the network uses this info to determine shortest (smallest) path-cost from itself to the root-bridge. When a switch has more than 1 path to the upstream switch, STP allows the switch to select one path (port) for upstream traffic and block the other one to prevent packet loops. This redundant link will automatically activate when the primary link is interrupted.

----

For example. I have one switch connected to the root bridge in 2 ways:
(1) 4 switches in between it and the router (root bridge), thus path-cost is 50 (every segment between switches is 10).
(2) I then installed a pair of sxt5ac from it direct to router. By default, the path cost of the wireless link is smaller (less segments in between) so the switch would always choose the wireless link as primary, which is not intended. Once I increased the path cost of the wlan port on the sxt5ac to 100 (I did it on both sxt5ac, not sure if I need to do it on both or only one), then automatically the lan link becomes primary.

I hope that helps and I am not missing anything crucial. Now onwards to researching the more complex MSTP.
 
ashpri
Member Candidate
Member Candidate
Topic Author
Posts: 154
Joined: Sun Oct 14, 2018 3:11 am

Re: (R)STP Aha! moment

Fri Jul 29, 2022 3:31 am

The question I have is this:

If your server rack and internet router is in the same room, then selecting the router or any of the switches in the main server room as the root bridge is easy.

What if the server room and the internet router are in opposite locations in the site. Where should the root bridge be located. Does it matter?
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11452
Joined: Thu Mar 03, 2016 10:23 pm

Re: (R)STP Aha! moment  [SOLVED]

Fri Jul 29, 2022 11:52 pm

Consider this scenario: main router is at far location, hooked to one of 3 core switches at same location. The other two core switches are in server room. All 3 core switches are in a ring and you're using RSTP to automatically handle loops.

Which link would you rather see disabled during normal operation? If switch on the far location is made root bridge, then link between server room switches will be disabled and all traffic between those two switches will pass far site switch.
OTOH it doesn't matter ... if all links are truly same (same throughput, same low delay). If links are not the same (e.g. some are lower throughput or some introduce much longer delay), then it's preferable to configure things in a way which makes those slower links disabled during normal operation.

Who is online

Users browsing this forum: Amazon [Bot], Bing [Bot], joshuapl and 16 guests