Chapter 7. Spanning Tree Protocol (STP)

What You Will Learn

On completing this chapter, you will be able to:

  • Describe the function of the Spanning Tree Protocol (STP)

  • List the five states of the STP

  • Draw a spanning-tree topology

  • Describe root bridges, root ports, and designated ports

Recall that in the networking world, a protocol is a standard set of rules and formats for data transmission between computers, similar to the rules of grammar in the English language. If two people put commas and periods in different places and use them for different purposes, for example, communication between the two would be difficult, if not impossible. In this same way, communication is impossible if two computers use different protocols when trying to communicate with one another. This chapter explains the protocol, or grammar, of communication between switches?specifically the Spanning Tree Protocol (STP).

The Spanning Tree Protocol, or STP, is a link-management protocol that is part of the Institute of Electrical and Electronics Engineers (IEEE) 802.1 standard for bridges and switches. STP uses the spanning-tree algorithm and provides path redundancy in the network. STP also prevents network loops created by multiple active paths between stations.



A bridge loop occurs when two or more paths exist between network segments.

The spanning-tree algorithm is used in bridge-and switch-based networks and determines the best path for traffic to move across the network from source to destination. The algorithm creates a hierarchical tree spanning the entire network, including all bridges and switches. The spanning-tree algorithm determines all redundant paths and makes only one of them active at any given time, much as you might consider alternative routes from your home to your office before taking one.

Figure 7-1. Multiple Routes Between Home and Work


If you tried one morning using more than one route from your home to work, you could end up going around in circles and never getting to work. In a network, loops create broadcast storms and constant table changes, which cause damage to your network because your data will time out before it ever reaches its intended destination.

Loops occur when more than one route, or path, exists between nodes in a network. Establishing path redundancy, STP creates a tree spanning across all the switches in an extended network and forces redundant paths into a standby, or blocked, state. STP allows only one active path at a time between any two network devices, preventing loops, but establishes redundant links as a backup if the primary link fails. If a network segment becomes unreachable for whatever reason, the spanning-tree algorithm reconfigures the logical topology, reestablishing the link by activating the standby path. Without a spanning tree in place, it is possible that both connections might be considered the primary path, resulting in an endless loop of traffic on the local-area network (LAN).