R&S Blog

Just another WordPress.com site

Spanning Tree Election

How does STP works?

Spanning Tree Protocol – A network protocol that ensures loop free topology. Switches send BPDUs to discover loops. BPDUs helps elect the core of the network switch which is root bridge.

1st step – Selects a root bridge –


  1. By selecting the Bridge ID (lowest is better)

Each bridge has a unique ID & configurable priority #

Value between 0 & 61440 (default is 32768)

Tie Breaker?

2.By selecting the MAC address (lowest is better)

The older the switch is, the lower its MAC address

2nd step

Selects Root port – Each bridge determines primary port facing root. This is per the lowest path cost to the root bridge.

Root port: used to reach the root bridge

3rd step

Selects Designated port – used to send and received packets on a specific segment

How? Port elects per lower path cost to the root bridge per segment.

Designated port: forwarding port, one per link


Block ports with loops – all non-root and non-designated ports are blocked. The switch with the highest MAC address will block its link.

able 3-2. Three Major 802.1d STP Process Steps

Major Step Description
Elect the root switch The switch with the lowest bridge ID wins; the standard bridge ID is 2-byte priority followed by a MAC address unique to that switch.
Determine each switch’s Root Port The one port on each switch with the least cost path back to the root.
Determine the Designated Port for each segment When multiple switches connect to the same segment, this is the switch that forwards the least cost Hello onto a segment.

How STP finds the Best Path

1st step: Elect the Root Bridge

2nd step: Switches find lowest cost path to root

Bandwidth STP Cost Value
4 Mbps 250
10 Mbps 100
16 Mbps 62
45 Mbps 39
100 Mbps 19
155 Mbps 14
622 Mbps 6
1 Gbps 4
10 Gbps 2


3rd step: What if the cost is tie? Bridge ID (priority + MAC address)

4th step: What if Bridge ID is tie? It will look for the lower port. Example: fa0/0 rather than fa0/1


We determined the root bridge and compute the port roles. (root, designated or blocked). The bridge sends BPDU to exchange information about the Bridge ID and root path costs.

A bridge sends a BPDU frame using the unique MAC address of the port itself as a source address, and a destination address of the STP multicast address 01:80:C2:00:00:00.

There are three types of BPDUs:

  • Configuration BPDU (CBPDU), used for Spanning Tree computation
  • Topology Change Notification (TCN) BPDU, used to announce changes in the network topology

Informs switches of any (up/down) port changes.

  • Topology Change Notification Acknowledgment (TCA)

BPDU’s are being sent every 2 seconds so that the switches can keep track of the network changes and to start and stop forwarding at ports.

STP switch port states

  • Blocking – A port that blocks a switching loop.
  • Listening – The switch processes BPDUs and awaits possible new information that would cause it to return to the blocking state.
  • Learning – While the port does not yet forward frames (packets)  it does learn source addresses from frames received and adds them to the filtering database (switching database)
  • Forwarding – A port receiving and sending data, normal operation. This happens when you connect a host or a server to a switch.

Types of STP

PVST (Per VLAN Spanning Tree) – A Network switches where multiple VLANs coexist. Run 1 instance per VLAN.

Adds VLAN inside the BPDU header (priority + MAC address). PVST (Priority + VLAN + MAC Address).

Pros: 1 Root Bridge per VLAN & Load balancing

Cons: Cisco proprietary – only works in ISL


Single Post Navigation

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: