This short article describes why the Spanning-Tree Protocol is used.
It’s easy to connect a bunch of computers to a switch, and connect the switch to its gateway, and you get a full simple network. But then you add another switch and run dual cables between the old switch and the new one. You think you’re adding redundancy, right?
It’s true that, in a switched network, we add links between switches for redundancy, so when a switch link fails, there is still another one that can bear network traffic.
But adding redundant physical links between switches creates potential switching loops. This is true especially when switches are in flooding mode, such as in Multicast transmission.
That’s where Spanning Tree Protocol comes in.
Spanning Tree Protocol creates a loop-free switching path between all switches in an Ethernet network. The way it does it is by “deactivating” certain ports on the path. So if we take the previous network diagram, the new network topology becomes something like this:
The spanning tree is rooted in one switch called the Root Bridge. It means that one switch will be the source from which branches originate.
One Root Bridge -aka Root Switch- is elected. All the remaining switches are called Non-Root Bridges.
You can read more on Spanning Tree Protocol on this link.