Sub topic 7
Choosing root and designated ports, and breaking ties
This chapter assumes you know how the root bridge is elected from the bridge ID, what a BPDU carries, and how path cost is calculated. Here you apply those pieces to decide which ports forward and which block.
The order of decisions
Spanning tree picks roles in a fixed order:
- Elect one root bridge for the VLAN.
- Each non-root switch picks exactly one root port, the port with the best path toward the root.
- Each network segment picks exactly one designated port, the port that forwards toward the segment on behalf of the segment.
- Any port that is neither root nor designated goes to the alternate (or backup) role and blocks.
The root bridge has no root port, and all of its ports are designated.
Choosing the root port
A switch compares the BPDUs it receives on each port. The best BPDU wins by checking these values in order, and the first difference decides:
| Order | Value compared | Better value |
|---|---|---|
| 1 | Root bridge ID | Lower |
| 2 | Root path cost | Lower |
| 3 | Sender bridge ID | Lower |
| 4 | Sender port ID (priority, then number) | Lower |
The root path cost is the cost advertised in the received BPDU plus the cost of the receiving port. Steps 3 and 4 are the tie-breakers. They matter when two links lead to the same neighbor, or when two neighbors offer the same cost.
Choosing designated ports
On each segment, the switches compare the BPDUs they would send. The port advertising the lowest root path cost becomes designated. If costs tie, the lower sender bridge ID wins, then the lower sender port ID. The loser stops sending its own BPDUs on that segment and blocks if it is not a root port.
Worked example
SW1 is the root. SW2 and SW3 each connect to SW1 and to each other. All links are Gigabit Ethernet with a cost of 4 under the short path cost method.
- SW2 hears SW1 on its uplink at cost 0 + 4 = 4. It hears SW3 on the cross-link at 4 + 4 = 8. The uplink is its root port.
- SW3 reaches the same result, so its uplink to SW1 is its root port.
- On the SW2–SW3 segment, both switches advertise root path cost 4. The tie goes to the lower bridge ID. If SW2 has the lower ID, its port is designated and SW3's cross-link port becomes alternate and blocks.
Same neighbor, two links
If two parallel links join the same pair of switches, the sender bridge ID is identical on both. The sender port ID then decides. You can influence it with port priority, which defaults to 128 and changes in steps of 16.
! Cisco IOS: prefer this uplink when parallel links tie
interface GigabitEthernet0/1
spanning-tree vlan 10 port-priority 64Set the priority on the upstream switch, because the downstream switch compares the port IDs it receives from its neighbor.
Exercise
SW4 receives BPDUs on two ports with the same root bridge ID and the same root path cost. One neighbor has bridge ID 32778:0011.2233.4455 and the other has 32778:0011.2233.4400. Which port becomes the root port, and which tie-breaker decided it?
Show answer
The port facing the neighbor with MAC address 0011.2233.4400 becomes the root port. The root bridge ID and root path cost tied, so the lower sender bridge ID decided it. The priority is equal, so the lower MAC address wins.