Port Role Election Process
- As we have seen that Switch1 has won the Root Bridge election and has become the Root Bridge. Therefore, all its ports become the Designated Ports (DP). Thus, Switch1 starts sending C-BPDUs (Configuration BPDU – generated by Root Bridge) through its DP ports with a cost to reach the root bridge as 0.
- Switch2 receives the C-BPDU on its e0/0 port (Ethernet port) and this ingress port updates the cost to reach the root bridge from 0 to 100 (The ethernet port’s speed is 10 Mbps). And it will forward this C-BPDU through its e0/1 port with a cost of 100.
- Similarly, Switch3 also receives the C-BPDU on its e0/0 port and updates the cost from 0 to 100. And it also forwards this C-BPDU through its e0/1 port with a cost of 100.
- Now, Switch2 receives the C-BPDU on its e0/1 port and this port updates the cost from 100 to 200. And Switch3 also receives the C-BPDU on its e0/1 port and this port updates the cost from 100 to 200.
- Here, the election will take place and since the cost is different, therefore the least cost will be preferred.
- In this case, on Switch2 e0/0 port wins the election (the least cost to reach the root bridge) and it becomes the Root Port (RP). Similarly, on Switch3 e0/0 port wins the election (the least cost to reach the root bridge) and becomes Root Port (RP).
- Now, the election will take place on the link between Switch2 and Switch3 for the role of DP, i.e., who will forward the C-BPDU?
- Since, both the switches have sent and received each other’s forwarded C-BPDU, they can decide who is superior among them.
- Firstly, they check the cost of the C-BPDU after receiving, both the switches have the cost of 200 to reach the root bridge. Therefore, the cost is tied.
- Secondly, they check the Sender’s Bridge Id (combination of Bridge priority and Base MAC address). Since, both the switches have equal priorities, whoever has the Lower Base MAC address will win the election.
- Switch2 has a lower Base MAC address than Switch3, therefore Switch2 wins the Election for the role of DP, and its e0/1 port becomes DP.
- Now looking at Switch3, it has one Root Port (RP) already available and there can be only one RP on a Non-Designated Bridge. Therefore, Switch3’s e0/1 port becomes Alternate (Alt).
Spanning Tree Protocol in CCNA
Spanning Tree Protocol (STP) is a protocol that prevents Layer 2 loops or Bridging loops by computing a tree structure of nodes in a network. It also prevents MAC Flapping (an event that occurs when a switch receives packets on different interfaces with the same source MAC address)