You are on page 1of 4

Spanning Tree Protocol (STP)  IEEE 802.

1D

• Spanning Tree protocol is a loop-prevention protocol that prevents loop formation by detecting
redundant links and disabling them until needed.

Redundancy Creates Loops

• Broadcasts and Layer 2 loops can be a dangerous. Loops can occur any time if there is a
redundant path in the bridge network.

• The switches will flip flop the MAC address table entries (creating extremely high CPU
utilization).

STP Prevents Loops

• The purpose of STP is to prevent loops in the network by negotiating a loop-free path through a
root bridge.

• STP determines where there are loops and blocks links that are redundant.

• Ensures that there will be only one active path to every destination.

Spanning Tree Algorithm

• STP executes an algorithm called Spanning Tree Algorithm (STA). STA chooses a root bridge 
then determines the available paths to that root bridge. If more than two paths exists, STA picks
the best path and blocks the rest.

Creating Loop-free Topology

• STP calculations make use of two key concepts in creating a loop-free topology:

• Bridge ID

• Path Cost
Bridge ID (BID)

• Used to elect a root bridge

• Lowest Bridge ID is the root.

• If all devices have the same priority, the bridge with the lowest MAC address becomes the root
bridge.

Bridge ID Consists of two components:

• A 2-byte Bridge Priority: Cisco switch defaults to 32,768 or 0x8000.

• A 6-byte MAC address

Priority = Priority (Default


32,768) + VLAN
STP Operation

• STP uses the concepts of root bridges, root ports, designated, and non-designated ports to
establish a loop-free path through the network.

• STP forces certain ports into a standby state so that they do not listen to, forward, or flood data
frames. The overall effect is that there is only one path to each network segment that is active
at any time.

The STP algorithm uses three simple steps to converge on a loop-free topology:

Step 1: Elect one Root Bridge

• Only one bridge acts as the root bridge in a given network per VLAN.

• Switch with the lowest BID wins!

If the priority for S1 is smaller  S1 becomes the root bridge.

If the priority for all switches is equal, the switch with lower MAC address becomes the root bridge.

Step 2: Elect Root Ports on all non-root bridges

• A Root Port is the port closest to the Root Bridge.


• Bridges use the cost to determine closeness.

• Every non-Root Bridge will select one Root Port!

• Specifically, bridges track the Root Path Cost, the cumulative cost of all links to the Root Bridge.

Step 3 Elect Designated Ports on each segment

• A Designated Port is elected for every segment.


• Segment’s perspective: From a device on this segment, “Which switch should I go through to
reach the Root Bridge?”
• “I’ll decide using the advertised Root Path Cost from each switch!”
• The switch primarily chooses a designated port as the least-cost path to the root bridge. In the
event of a tie, the lower bridge ID acts as the tiebreaker.

• Least-cost wins designated port election


• Here lower BID is used to break a tie
• All other ports, those ports that are not Root Ports or Designated Ports, become Non-
Designated Ports.

• Non-Designated Ports are put in blocking mode. This is the loop prevention part of STP.

STP Port States

Each Layer 2 port on a switch running STP exists in one of these five port states:

• Blocking: The Layer 2 port is a non-designated port and does not participate in frame
forwarding. Receives only BPDU.  Until continuous loop is detected.

• Listening: The port can participate in frame forwarding according to the BPDUs that the
switch has received so far. Builds active topology.  Forward delay 15 sec

• Learning: The Layer 2 port prepares to participate in frame forwarding and begins to
building bridging table.  Forward delay 15 sec

• Forwarding: The Layer 2 port is considered part of the active topology; it forwards
frames and also sends and receives BPDUs.  continuous if up and no loop is detected

• Disabled: The Layer 2 port does not participate in spanning tree and does not forward
frames. Administratively shutdown.  until no shutdown is issued

Rapid Spanning Tree

Rapid Spanning Tree Protocol (RSTP) 802.1w is a standards-based, nonproprietary way of speeding STP
convergence.
• RSTP is based on IEEE 802.1w standard.
• IEEE 802.1w took 802.1D’s principle concepts and made convergence faster.
• RSTP (802.1w) supersedes 802.1D, while still remaining backward compatible.
• RSTP BPDU format is the same as the IEEE 802.1D BPDU format, except that the Version field is
set to 2 to indicate RSTP.
• The RSTP spanning tree algorithm (STA) elects a root bridge in exactly the same way as
802.1D elects a root.
• RSTP defines the additional port roles of Alternate and Backup and defines port states as
discarding, learning, or forwarding.

You might also like