Root port selection is the STP procedure in which every non-root switch chooses one port as its best path toward the root bridge. The selected port normally forwards traffic and provides the switch’s only active path to the root, while redundant paths remain available for loop prevention. section 14.3.2 section 15.2.3
Evaluate candidate ports using these tie-breakers, in order:
- Choose the port with the lowest root cost. Root cost represents the total cost of the path toward the root, not merely the local port’s cost; lower is better. section 14.3.2
- If costs tie, choose the port connected to the neighbor with the lowest bridge ID (BID). section 14.3.2
- If both cost and neighbor BID tie, choose the port connected to the neighbor’s lowest port ID. section 14.3.2
- Use BPDU information for every comparison. The root bridge advertises root cost 0, and downstream switches add the cost of the receiving port before forwarding the BPDU. section 14.3.2
Worked selection
SW4 selects G0/0 because it has the lowest root cost. SW2’s G0/0 and G0/1 tie on cost, so SW2 chooses G0/1 because its neighbor, SW4, has the lower BID. SW1’s candidates still tie on cost and neighbor BID because both connect to SW3; SW1 then chooses G0/1 because it reaches SW3’s lower port ID, 128.1.
The root port is one stage of the STP algorithm: elect the root bridge, select one root port on each non-root switch, then select designated ports. Ports that do not win a role can be blocked to remove redundant Layer 2 paths. section 14.3 section 14.3.3
Figure 14.4 A LAN after STP has created a loop-free topology. SW3 is the root bridge, and each other switch has one root port leading to SW3. The remaining ports are either designated or non-designated ports; non-designated ports are blocked, disabling their connections.
Use the topology figure to trace each non-root switch’s single root-port path toward SW3 and distinguish forwarding ports from blocked redundant connections. section 14.3
