STP01
STP01
STP01
and Implementing
Spanning Tree
Protocol (STP)
1. Overview of Spanning Tree Protocol
(STP)
2. Different STP Variants
3. STP Operation
4. Configuring STP on Cisco Switches
5. Best Practices and Troubleshooting
Overview of Spanning Tree Protocol
Purpose of STP:
STP is a protocol used in network bridges and switches to prevent
loops in Ethernet networks, which can cause broadcast storms and
network congestion.
Loops occur when there are redundant links between switches,
creating multiple paths for data to traverse. Without loop
prevention mechanisms like STP, packets may circulate endlessly,
degrading network performance and reliability.
Concept of Spanning Tree:
A spanning tree is a subset of the network topology that includes
all switches (bridges) in the network with the minimum number of
links necessary to connect them without forming any loops.
STP dynamically selects and maintains the spanning tree topology
by designating certain links as active and others as blocked,
effectively creating a loop-free network.
Overview of Spanning Tree Protocol
STP Operation:
STP operates by electing a root bridge, which serves as the
central point in the spanning tree topology. All other
switches determine their distance (cost) to the root bridge,
and the path with the lowest cost becomes the active path.
Each switch in the network then selects one of its ports as
the root port, which provides the shortest path to the root
bridge. Additionally, designated ports are selected on each
segment to forward traffic toward the root bridge, while
other ports are placed in a blocking state to prevent loops.
Overview of Spanning Tree Protocol
Key Components of STP:
Bridge ID (BID): A unique identifier consisting of a priority
value and a MAC address, used to elect the root bridge and
determine the spanning tree topology.
Root Bridge: The switch with the lowest BID, serving as
the reference point for all other switches in the network.
Port Roles: Each port on a switch assumes a specific role in
the spanning tree, such as root port, designated port,
blocking port, or forwarding port, based on its position
relative to the root bridge.
Overview of Spanning Tree Protocol
Benefits of STP:
Ensures network stability by preventing loops and
broadcast storms.
Facilitates automatic failover in case of link or switch
failures, maintaining continuous connectivity.
Optimizes network performance by selecting the most
efficient paths for data transmission.
STP
RSTP (Rapid Spanning Tree Protocol)
MSTP (Multiple Spanning Tree Protocol)
STP (Spanning Tree Protocol):
• STP is the original spanning tree protocol
standardized by IEEE 802.1D.
• It operates by electing a root bridge and configuring
a loop-free topology within the network.
• STP has a relatively slow convergence time,
typically taking tens of seconds to stabilize the
network after a change in topology.
• While effective in preventing loops, STP's slow
convergence time may not be suitable for modern
networks with stringent latency requirements.
RSTP (Rapid Spanning Tree
Protocol):
• RSTP, defined in IEEE 802.1w, is an evolution of STP
designed to improve convergence time.
• It introduces several enhancements over STP, including:
• Rapid convergence: RSTP significantly reduces the
time required to converge the network topology after
a change, typically within a few seconds.
• Port roles: RSTP introduces additional port roles
such as Alternate and Backup ports, allowing for
faster path selection and failover.
• Link types: RSTP distinguishes between point-to-
point and shared segments, optimizing port states
and reducing unnecessary transitions.
• RSTP is backward compatible with STP, allowing RSTP-
enabled switches to interoperate with STP switches.
MSTP (Multiple Spanning Tree
Protocol):
• MSTP, specified in IEEE 802.1s, extends the capabilities
of STP/RSTP by supporting multiple spanning tree
instances within a single network.
• Unlike traditional STP and RSTP, which create a single
spanning tree for the entire network, MSTP enables the
creation of multiple spanning tree instances, each tailored
to a specific VLAN or group of VLANs.
• MSTP reduces the overhead associated with maintaining
separate spanning trees for each VLAN, improving
scalability and resource utilization.
• It allows network administrators to map VLANs to
specific spanning tree instances, providing greater
flexibility in network design and optimization.
Key Differences and Considerations
• STP is the original spanning tree protocol with
slow convergence time.
• RSTP offers faster convergence and additional
port roles for optimized path selection.
• MSTP provides scalability and flexibility by
supporting multiple spanning tree instances for
VLAN-based segmentation.
Choosing the Right Variant
• Consider the network's requirements for
convergence time, scalability, and VLAN
segmentation.
• Use RSTP or MSTP in modern networks that
require faster convergence and support for
multiple VLANs.
• STP may still be suitable for smaller networks
with less stringent latency requirements.
When to use each variant based on network
requirements
Bridge ID (BID)
determination
Root bridge
election
Designated and
non-designated
ports
Bridge ID (BID) determination
• Bridge Priority:
• Bridge Priority is a configurable value
(ranging from 0 to 65535) that indicates the
priority of a switch in the spanning tree
topology.
• Lower Bridge Priority values take
precedence in the selection process. The
default value is typically 32768 for most
switches.
• Administrators can manually configure the
Bridge Priority to influence the selection of
the root bridge within the network.
Bridge ID (BID) determination
• MAC Address:
• Every switch has a unique Media
Access Control (MAC) address
assigned to its hardware interface.
• MAC addresses are used as tiebreakers
in the Bridge ID determination process.
If two switches have the same Bridge
Priority, the switch with the lower
MAC address becomes the root bridge.
Bridge ID (BID) determination
• BID Determination Process:
• When a switch boots up or joins the network, it
generates its BID by combining its configured
Bridge Priority and MAC Address.
• The resulting BID uniquely identifies the
switch within the network and serves as its
identifier in the spanning tree topology.
• Switches exchange Bridge Protocol Data Units
(BPDUs) containing their BIDs during the STP
election process.
• During the root bridge election process,
switches compare BIDs received from
neighboring switches to determine the root
bridge.
• The switch with the lowest BID (comprising
the lowest Bridge Priority and, if necessary, the
lowest MAC Address) is elected as the root
bridge for the network.
Bridge ID (BID) determination
• Root Bridge Election:
• Once all switches exchange BPDUs
and determine their BIDs, the root
bridge election process begins.
• Switches compare the BIDs received
from neighboring switches to select the
switch with the lowest BID as the root
bridge.
• The root bridge serves as the central
point in the spanning tree topology and
determines the shortest path to reach all
other switches in the network.
Root bridge election