What is Spanning Tree Protocol

Spanning Tree Protocol (STP) is an OSI model Layer 2 protocol used to prevent broadcast storms. Every switch has STP enabled by default, so in a small network, you won’t have to configure anything—it will just work automatically.

What is a Broadcast Storm

A broadcast is like speaking to a crowd of people using a microphone so everyone can hear you. In a computer network, it works similarly, allowing a frame to be sent to every device on that VLAN.

A broadcast storm occurs when excessive amounts of broadcast traffic loop uncontrollably in a network, overwhelming bandwidth and devices. This often happens due to network loops or misconfigured devices, leading to network congestion and slowdowns. STP prevents this by “cutting” one of the connections, so a loop can’t occur.

loop

If you look at the diagram above, you will see that the wires loop through every switch. What STP does is “cut” the connection between Switch 53 and Switch 54. So, if you want traffic to go to Switch 53, it will have to go through Switch 51, preventing a loop from occurring.

How Does STP Work In Depth

STP sends out what are called BPDUs (Bridge Protocol Data Units). These help determine various aspects of STP, like identifying the root bridge, deciding which connections will be disabled, and other tasks.

Let’s say Switch 51 is the root bridge from the diagram above. This will put all ports on that switch in the forwarding state, allowing them to send and receive data frames. The other switches will become non-root bridges. Their ports will be placed into three possible states:

  1. Root Port: The best path to the root bridge.
  2. Designated Port: A port that forwards traffic.
  3. Blocked Port: A port that will not forward traffic, preventing loops. In this case, the connection between Switch 54 and Switch 53 will be blocked to avoid loops.

In summary, Spanning Tree Protocol (STP) is a vital mechanism in network management, especially for preventing network loops and broadcast storms. By automatically detecting and managing redundant connections, STP ensures that your network runs efficiently and without interruptions. Understanding how STP works, from root bridges to blocked ports, gives you the tools to maintain a stable, loop-free Layer 2 network. Properly configured, STP is essential in ensuring both reliability and performance in modern network infrastructures.