background image
Spanning Tree Protocol (STP)
87
STP's main task is to stop network loops from occurring on your layer-2
network (bridges or switches). It vigilantly monitors the network to find all
links, making sure that no loops occur by shutting down any redundant
ones. STP uses the spanning-tree algorithm (STA) to first create a topology
database, then search out and destroy redundant links. With STP running,
frames will only be forwarded on the premium, STP-picked links.
Spanning-Tree Terms
Before I get into describing the details of how STP works in the network, you
need to understand some basic ideas and terms and how they relate within
the layer-2 switched network:
STP
Spanning Tree Protocol (STP) is a bridge protocol that uses the STA
to find redundant links dynamically and create a spanning-tree topology
database. Bridges exchange BPDU messages with other bridges to detect
loops, and then remove them by shutting down selected bridge interfaces.
Root bridge
The
root bridge
is the bridge with the best bridge ID. With
STP, the key is for all the switches in the network to elect a root bridge
that becomes the focal point in the network. All other decisions in the
network--like which port is to be blocked and which port is to be put in
forwarding mode--are made from the perspective of this root bridge.
BPDU
All the switches exchange information to use in the selection of
the root switch, as well as for subsequent configuration of the network.
Each switch compares the parameters in the
Bridge Protocol Data Unit
(BPDU)
that they send to one neighbor with the one that they receive
from another neighbor.
Bridge ID
This is how STP keeps track of all the switches in the net-
work. The bridge ID is determined by a combination of the bridge priority
(32,768 by default on all Cisco switches) and the base MAC address. The
lowest bridge ID becomes the root bridge in the network.
Nonroot bridge
All bridges that are not the root bridge. These exchange
BPDUs with all bridges and update the STP topology database on all
switches, preventing loops and providing a measure of defense against
link failures.
Root port
Always the link directly connected to the root bridge, or the
shortest path to the root bridge. If more than one link connects to the root
Copyright ©2002 SYBEX, Inc., Alameda, CA
www.sybex.com