Spanning Tree Protocol
Spanning Tree Protocol
There are three problems that STP can try to solve for the network:
STEP 2 - All Root Bridge interfaces are placed into a Forwarding State
No ports are blocked or disabled on the Root Bridge. All ports are assigned the
Designated Port role.
You can identify the Root Bridge in an STP doma in by inspecting the state of the
ports - if all ports are forwarding, this is the Root Bridge.
STEP 3 - All non-root switches select a best path to the Root Bridge
The best path to the Root Bridge is defined as the port with the lowest Cost. Costs
have been updated over the years to accommodate faster interfaces:
Port Costs - The STP Cost for a Port, based on the Port Speed:
• 10MBps - 100 or 2000000
• 100MBps - 19 or 200000
• 1Gbps - 4 or 20000
• 10Gbps - 2 or 2000
• 100Gbps - n/a or 200
• 1 Tbps - n/a or 20
The STP Cost is calculated as the cumulative cost of each outgoing port from a
given bridge to the Root Bridge. Let's detail a brief example:
• A Root Bridge has a Cost of 0
• A Non-Root Bridge attached to a Root Bridge with a 1Gbps interface would
be calculated as 0 + interface cost of 4 - meaning Cost to the Root is 4.
• Another Non-Root Bridge attached to the same Root Bridge with a 1Gbps
interface would be calculated as 0 + interface cost of 4 - meaning Cost to the
Root is also 4.
• Both Non-Root Bridges (attached to each other and the Root Bridge in a
triangle topology) send their Cost to each other. Both calculate 4 + 4 = 8 to
reach the Root Bridge through each other instead of directly.
• Both Non-Root Bridges then select the Port with the LOWEST COST as
their Root Port.
But wait, the costs are the same? Well, in scenarios where th e Root Cost is the
same on multiple ports (i.e. duplicate links between two switches or manually
costs assigned), STP uses tie-breakers to decide which port should be used, in this
order:
• Lowest Neighbour BID - The advertised BID from the neighbour, then;
• Lowest Neighbour Port Priority - The Priority of the neighbour interface
itself, then;
• Lowest Neighbour Port Number - Port Number of the neighbour interface
itself
The winner of these tiebreakers, if needed, are assigned the Root Port role.