Skip to main content

2.7: The Spanning Tree Protocol (STP)

The Spanning Tree Protocol also known as IEEE 802.1d is used to allow transparent bridges to automatically discover a loop-free topology whilst still allowing any device to talk to any other device in the LAN.

Using STP the bridges identify that the network has a loop topology and contend to shutdown, in software, one interface in the loop. This prevents the loop topology, but maintains the resilience of the network design by activating the shutdown interface in the case of network failure.

All switches in an extended LAN participating in Spanning-Tree Protocol gather information on other switches in the network through an exchange of data messages. These messages are bridge protocol data units (BPDUs). This exchange of messages results in the following:

  • The election of a unique root switch for the stable spanning-tree network topology.

  • The election of a designated switch for every switched LAN segment.

  • The removal of loops in the switched network by placing redundant switch ports in a backup state.

2.7.1: STP Root Bridge Selection

The first step in forming a Spanning Tree is electing a bridge to be the root bridge. The choice of Root Bridge is fairly arbitrary. Each bridge begins by assuming it is the root bridge for the LAN by sending Bridge Protocol Data Unit (BPDU) packets (every 2 seconds by default) onto each of its ports. The BPDU packets have the following information in them:

  • Bridge ID: The ID of the bridge that is transmitting this BPDU message. The Bridge ID is a special ID that is separate from the addresses of the bridge's ports and includes the MAC address and Priority.

  • Root ID: The Root ID is the ID of the bridge that is assumed to be root by this bridge. In the beginning, this ID is the same as the transmitting Bridge ID because each bridge begins by assuming that it is the root. As the bridge learns of "better" roots it changes this value to be the ID of the "best" root that it knows about.

  • Cost: The cost of the shortest path to the root from the transmitting bridge. In the beginning this is set to zero because the bridge assumes that it is the root, and it is zero hops away from itself. The lower the cost the better the path, costs range from 0 to 65535

THE IEEE has defined the default port costs as shown in the following table:

Speed

Revised IEEE Cost

10 Mbps

100

100 Mbps

19

1 Gps

4

10 Gps

2