Content

| 3.2 |  | STP Processes |
| 3.2.4 |  | Electing root ports |

At the conclusion of the root war, the switches move on to selecting Root Ports. The Root Port of a bridge is the port that is closest to the Root Bridge in terms of Path Cost. Every non-Root Bridge must select one Root Port. Again, bridges use the concept of cost to measure closeness. As with some routing metrics, the measure of closeness using STP is not necessarily reflected by hop count. Specifically, bridges track what is referred to as Root Path Cost. The cumulative cost of all links to the Root Bridge. Figure illustrates how this value is calculated across multiple bridges and the resulting Root Port election process.

When Cat-A (the Root Bridge) sends out BPDUs, they contain a Root Path Cost of 0. When Cat-B receives these BPDUs, it adds the Path Cost of Port 1/1 to the Root Path Cost contained in the received BPDU. Assume that the network is running Fast Ethernet:

- Cat-B receives a Root Path Cost of 0 and adds in the Port 1/1 cost of 19.
- Cat-B then uses the value of 19 internally and sends BPDUs with a Root Path Cost of 19 out Port 1/2.
- When Cat-C receives these BPDUs from Cat-B, it increases the Root Path Cost to 38 (19 + 19).
- However, Cat-C is also receiving BPDUs from the Root Bridge on Port 1/1.
- These enter Port-1/1 on Cat-C with a cost of 0, and Cat-C increases the cost to 19 internally. Cat-C has a decision to make.
- It must select a single Root Port – the port that is closest to the Root Bridge.
- Cat-C sees a Root Path Cost of 19 on Port 1/1 and 38 on Port 1/2. Port-1/1 on Cat-C becomes the Root Port.
- Cat-C then begins advertising this Root Path Cost of 19 to downstream switches.

Cat-B goes through a similar set of calculations. Port-1/1 on Cat-B can reach the Root Bridge at a cost of 19, whereas Port-1/2 on Cat-B calculates a cost of 38. Port-1/1 becomes the Root Port for Cat-B. The costs increment as BPDUs are received on a port, not as they are sent out of the port. For example, BPDUs arrive on Port-1/1 on Cat-B with a cost of 0 and get increased to 19 “inside” Cat-B.