SW1 is the root bridge, so both of its ports (GE1/0/1 and GE1/0/2) are designated ports; a root bridge has no root port. A port's root path cost is the root path cost advertised in the received BPDU plus the cost of the receiving port. SW2 receives the root bridge's BPDU on GE1/0/1, giving a root path cost of 0 + 50 = 50; any path through SW3 would add GE1/0/3's cost of 60 to SW3's own root path cost and is therefore higher, so SW2 GE1/0/1 is the root port. SW3 compares its direct path through GE1/0/2 (0 + 100 = 100) with the path through SW2 received on GE1/0/3 (50 + 40 = 90); 90 is lower, so SW3 GE1/0/3 is the root port and SW3 GE1/0/2 is an alternate port, blocked as a backup path to the root. On the SW2-SW3 link, SW2 advertises the lower root path cost (50 versus 90), so SW2 GE1/0/3 is the designated port.
Community Discussion