Spanning Tree Protocols – Cisco CCNP and CCIE

Spanning Tree Protocol (STP) operation prevents Layer 2 loops. It allows only one active path to exist between any Layer 2 devices. This operation is transparent to end devices (servers or hosts), and the end device cannot detect whether it is connected to a single Layer 2 switch or a group of multiple switches.

To create a Layer 2 network with redundancy, you must have a loop-free path between all nodes in a network. An STP algorithm calculates the best loop-free path throughout a switched network. When a local-area network (LAN) port becomes active, first it starts to send and receive STP frames, which are called bridge protocol data units (BPDUs) at regular intervals. Switches do not forward these frames but use the frames to construct a loop-free path.

Multiple active paths between switches cause loops in the network. If a loop exists in a Layer 2 network, end devices might receive duplicate messages, and switches might learn end-station MAC addresses on multiple ports. These conditions result in a broadcast storm, which creates an unstable network.

STP defines a tree with a root bridge and a loop-free path from the root to all switches in the network. It forces redundant data paths into a blocked state. If a network segment in the spanning tree fails and a redundant path exists, the STP algorithm recalculates the spanning tree topology and activates the blocked path.

When two ports on a switch are part of a loop, the STP port priority and path cost determine which port on the switch is put in a forwarding state and which port is put in a blocking state.

STP Topology

All switches in an extended local-area network that participate in a spanning tree gather information about other switches in the network by exchanging BPDUs. This exchange of BPDUs results in the following actions:

Images The system elects a unique root switch for the spanning tree network topology.

Images The system elects a designated switch for each LAN segment.

Images The system eliminates any loops in the switched network by placing redundant interfaces in a backup state; all paths that are not needed to reach the root switch from anywhere in the switched network are placed in an STP blocked state.

The topology on an active switched network is determined by the following:

Images The unique switch identifier Media Access Control (MAC) address of the switch that is associated with each switch

Images The path cost to the root that is associated with each interface

Images The port identifier that is associated with each interface In a switched network, the root switch is the logical center of the spanning tree topology. STP uses BPDUs to elect the root switch and root port for the switched network, as well as the root port and designated port for each switched segment.