Everyone should turn on Spanning Tree

Written by 
Everyone should turn on Spanning Tree

One of the benefits of an L2 or L3 switch is that you can be a bit clever about their connections. How?

 

It’s often a good idea to build some redundancy into your network, i.e. have more than one path between switches. That way if a cable is damaged or someone unplugs the wrong thing you don’t break your network.

However, if you connect two switches together with more than one cable, or plug both ends of a cable into one switch by accident, you can end up with a loop where a broadcast packet will enter the switch and then be sent out into the network. But the other switch will get two copies of this packet and send them both out, then the first switch will get four copies and send those out, and so on. You end up with a positive feedback loop that causes a broadcast storm which overloads the whole network. Eeek!

There is a technology called spanning tree that fixes this problem. Each switch builds a map of what it is connected to and blocks any duplicate links. They know about the extra links but won’t use them unless the primary one goes down. Every time something changes on a switch (i.e. something is plugged in or unplugged) it checks to see if it affects the map and enables or disables links as required.

STP (Spanning Tree Protocol) was superseded in 2004 by RSTP (Rapid Spanning Tree Protocol). As you would expect, it works exactly the same but is faster to detect topology changes. There is also MSTP (Multiple Spanning Tree Protocol) but they all work pretty much the same.

The best part of STP is that it is really really easy to turn on and then you can forget about it. It just sits there doing its job. Connect to your switch and type config to enter configuration mode, then spanning-tree to activate spanning tree. Or you can do it from the web interface from the ‘Spanning Tree’ menu. Once enabled the switch will scan the network (which will disrupt connections for a few seconds) and then you’re all set!

If you want to learn more about the benefits of Spanning Tree Protocol for your business, feel free to get in touch.

T:+44(0)20 7734 8809

E: This email address is being protected from spambots. You need JavaScript enabled to view it.