Spanning Tree Protocol

The basic function of STP is to prevent bridge loops and the broadcast radiation that results from them.

As the name suggests, STP creates a spanning tree that characterizes the relationship of nodes within a network of connected layer-2 bridges, and disables those links that are not part of the spanning tree, leaving a single active path between any two network nodes.

STP is based on an algorithm that was invented by Radia Perlman while she was working for Digital Equipment Corporation.

RSTP provides significantly faster recovery in response to network changes or failures, introducing new convergence behaviors and bridge port roles to do this.

The need for the Spanning Tree Protocol (STP) arose because switches in local area networks (LANs) are often interconnected using redundant links to improve resilience should one connection fail.

[4]: 386  However, this connection configuration creates a switching loop resulting in broadcast radiations and MAC table instability.

All switches then select their best connection towards the root bridge for forwarding and block other redundant links.

All switches constantly communicate with their neighbors in the LAN using § Bridge protocol data units (BPDUs).

[4]: 388 Provided there is more than one link between two switches, the STP root bridge calculates the cost of each path based on bandwidth.

STP will select the path with the lowest cost, that is the highest bandwidth, as the preferred link.

Because not all switches are directly connected to the root bridge they communicate amongst each other using STP BPDUs.

The time spent in the listening and learning states is determined by a value known as the forward delay (default 15 seconds and set by the root bridge).

If another switch is connected, the port may remain in blocking mode if it is determined that it would cause a loop in the network.

Upon receipt of the TCN, the root switch will set the topology change flag in its normal BPDUs.

This flag is propagated to all other switches and instructs them to rapidly age out their forwarding table entries.

BPDUs are exchanged regularly (every 2 seconds by default) and enable switches to keep track of network changes and to start and stop forwarding at ports as required.

Configuration BPDU (CBPDU), used for spanning tree computation and sent by root bridges to provide information to all switches.

The first spanning tree protocol was invented in 1985 at the Digital Equipment Corporation by Radia Perlman.

The original Perlman-inspired Spanning Tree Protocol, called DEC STP, is not a standard and differs from the IEEE version in message format as well as timer settings.

Some bridges implement both the IEEE and the DEC versions of the Spanning Tree Protocol, but their interworking can create issues for the network administrator.

Cisco developed, implemented and published the Per-VLAN Spanning Tree (PVST) proprietary protocol using its own proprietary Inter-Switch Link (ISL) for VLAN encapsulation, and PVST+ which uses 802.1Q VLAN encapsulation.

[26] More information about configuring VSTP on Juniper Networks switches was published in the official documentation.

Not only does this reduce the number of BPDUs required to communicate spanning tree information for each VLAN, but it also ensures backward compatibility with RSTP and, in effect, classic STP too.

MSTP does this by encoding an additional region of information after the standard RSTP BPDU as well as a number of MSTI messages (from 0 to 64 instances, although in practice many bridges support fewer).

In order to further facilitate this view of an MSTP region as a single RSTP bridge, the MSTP protocol uses a variable known as remaining hops as a time to live counter instead of the message age timer used by RSTP.

In the case of MST, the bridge system ID extension carries the MSTP instance number.

Such a multi-chassis link aggregation group works like a normal port trunk, only distributed through multiple switches.

Conversely, partitioning technologies compartmentalize a single physical chassis into multiple logical entities.

An example network. The numbered boxes represent bridges, that is switches in a LAN. The number is the bridge ID. The lettered clouds represent network segments . The smallest bridge ID is 3. Therefore, bridge 3 is the root bridge.
Path tie: The least-cost path to the root from network segment e goes through bridge 92. Therefore, the designated port for network segment e is the port that connects bridge 92 to network segment e .