top of page

Networking - Spanning Tree

Spanning Tree Protocol (STP) was developed by Radia Perlman in the mid-eighties. STP was adopted as standard 802.1D. STP was developed to bring stability to switched networks; also referred to as layer 2 or "Bridged Networks".


Take for example, two switches/bridges interconnected with redundant links. the two switches are connected with redundant links which are common in networking.

The below example walks through a simple example of a loop. Starting from left to right, the blue switch sends out a broadcast (Networks have tons of broadcasts). In the 2nd picture the green switch receives the broadcast. In the 3rd picture, the green switch sends the broadcast out all of its ports. Switches are fairly dumb devices. If they haven't learned a MAC address on a port, they will flood the frame out everywhere. In the final frame the blue switch received its own broadcast and will broadcast it out again out all of its ports.


In addition to broadcast storms other problems with switch loops are:

  • Duplicate Frames

  • Unstable MAC Port associations


  1. In STP the switches exchange Bridge Protocol Data Units (BPDU)s and a single root bridge is elected. There is a single root bridge per network segment; in most modern networks this is per VLAN. The switch that is the root bridge is typically a central switch in the network and is configured to win the root bridge election process by the administrator.

  2. The root bridge then sets all of its ports to forwarding.

  3. The other switches determine their shortest path to the root bridge so as to identify the root port on each switch.

  4. A designated port is identified

  5. All other ports are put into blocking mode. this allows switches to continue to broadcast frames to the root bridge without sending frames to a switch that already received it (i.e., creating a loop)


The diagram below displays example cost calculations that factor the link speed and number of links to reach the root bridge. The cost of the root bridge ports is zero. But the bottom two switches each have a 1G link to the root bridge the cost to reach the root bridge over that link is 0 + 4. If the bottom two switches also have a 100MB link, the cost to the root bridge over that link is 0 + 19. If the two bottom switches are also connected to each other with a 1 GE link, the cost for each of them to reach the root switch across that link is 0 + 4 + 4.



Spanning tree reconvergence happens when a link goes down and/or there is an STP configuration change.



Spanning Tree Port states are:


Disabled - Port is shutdown

Blocking - Port is blocking

Listening - Port is not forwarding traffic and not learning MAC addresses

Learning - Port is not forwarding traffic but is learning MAC addresses

Forwarding - Port is sending and receiving traffic like normal


Because of default STP timers (hello times (2 seconds) and forward delay timers (15 seconds)) reconvergence can cause a delay of network traffic beyond a minute. This was OK in the eighties and nineties but can have a serios impact on network performance today. Certain protocols like Rapid Spanning Tree Protocol (RSTP: IEEE 802.1w) and Portfast were developed to help speed up spanning tree convergence.

6 views0 comments

Recent Posts

See All

留言


Post: Blog2_Post
  • Facebook
  • Twitter
  • LinkedIn

©2021 by croninity. Proudly created with Wix.com

bottom of page