In this course on Spanning Tree Port Roles, we continue building our Spanning Tree topology by assigning roles to each switch port.
In the previous lesson on configuring STP, we set up our topology so that SW1 was elected as the Root Bridge, based on its lowest Bridge ID (32769:AABB.CCDD.EE01). With the Root Bridge now established, the next step is to assign roles to each port in the switches to ensure the topology remains loop-free.
Figure 1 – SW1 is Root; SW2 is second-best; SW3 is non-root
Answer the question below
The second step in the process is to elect the Root Ports. Each non-root switch selects its Root Port, the single port that provides the most efficient path to the Root Bridge.
But you might ask, how does a switch decide which port is the best path to the Root Bridge?
It’s the Root Path Cost metric that provides this critical information.What is the Root Path Cost?
The Root Path Cost is the metric used to determine the shortest and most efficient path to the Root Bridge. It is calculated by summing the individual port costs of all the links along the path to the Root Bridge.
Default Port Cost Values
The cost of a port depends on the speed of the link it connects to. The IEEE 802.1D standard defines the following default values:
Link Speed
Port Cost
10 Gbps
2
1 Gbps
4
100 Mbps
19
10 Mbps
100
Table 1 – Default STP port costs based on link speed (IEEE 802.1D)
These values are cumulative, meaning the total cost of a path is the sum of the costs for all links in the path. Lower Path Costs are always preferred, ensuring that STP selects the most efficient route.
Topology Overview with Path Costs
The following diagram illustrates the Path Costs associated with each interface in the topology:

Figure 2 – Each 1 Gbps link has a default STP path cost of 4 in this topology
Electing the Root Port
The Root Port is the port on each non-root switch that offers the shortest path to the Root Bridge.
The election process follows these steps:
Lowest Path Cost: The port with the lowest cumulative Path Cost to the Root Bridge becomes the Root Port.
Tiebreaker - Lowest Sender Bridge ID: If two ports have the same Path Cost, the port connected to the switch with the lowest Bridge ID is selected.
Tiebreaker - Lowest Port ID: If the Bridge IDs are identical, the port with the lowest Port ID is chosen.
Root Port Election in Our Topology
SW2
G0/0 connects directly to SW1 (the Root Bridge) with a Path Cost of 4.

Figure 3 – STP Path Cost Calculation for SW2
G0/1 connects to SW3 → SW1. This indirect path has a total Path Cost of 8 (4 for SW2 → SW3 and 4 for SW3 → SW1).

Figure 4 – Indirect STP Path Cost Evaluation for SW2
G0/0 is selected as the Root Port because it provides the shortest Path Cost to the Root Bridge.
SW3
G0/0 connects directly to SW1 (the Root Bridge) with a Path Cost of 4.

Figure 5– STP Path Cost Calculation for SW3
G0/1 connects to SW2, which is already connected to the Root Bridge via its Root Port (G0/0). This indirect path has a total Path Cost of 8 (4 for SW3 → SW2 and 4 for SW2 → SW1).

Figure 6– Indirect STP Path Cost Evaluation for SW3
40 % Complete: you’re making great progress
Unlock the rest of this lesson
If you’d like to continue your CCNA journey, simply create your free account.
Access all CCNA lessons
Practice with hands-on labs
Train with Practice exams and Quizzes
Progress tracking in your dashboard
Made by network engineers - CCNP certified
learners globally
Spanning Tree Port Roles
Spanning Tree Port Roles determine how each switch port functions in a loop-free topology once the Root Bridge is elected. This lesson explains how root, designated, and blocked ports are chosen to maintain stability and redundancy across the network.