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)

Similar Reads

Spanning Tree Communication:

STP exchanges its data messages in the form BPDU’s (Bridge Protocol Data Units). Since the switch is unaware of the other switches around it, so it sends BPDU frames with the source MAC address of its port, and the destination MAC address is the STP Multicast address, i.e., 0180.C200.0000....

Root Bridge Election:

The switch with the lowest Bridge ID (the least Priority or Lowest MAC address) wins the election and becomes the Root Bridge for the STP topology. Initially, each switch begins its STP logic by creating and sending a Hello BPDU message, in which it claims to be the Root Bridge (because priority is by default the same for every switch, and it is unaware of the other switch’s Base MAC). If a switch receives a superior Hello BPDU message on any of its ports, it stops claiming to be the Root Bridge and stops sending Hello BPDUs. Ultimately, the switch with the lowest Bridge ID stops sending Hello BPDUs and wins the election process....

Type of Ports in STP:

Root Port (RP): These are the ports that are closest to the Root Bridge in terms of Cost and are responsible for receiving the STP’s control-plane Traffic. Every Non-Root Bridge has only one Root Port and other ports can be either Designated Ports or Alternate Ports (based on the election). Designated Port (DP): It is responsible for forwarding traffic.  Every port of the Root Bridge is a Designated Port. Alternate Port (Alt)/Blocked Port: It is a backup port that is in a Blocking State. It comes up only if the current Root Port goes down....

Port Role Election:

After the Root Bridge is elected, the Port Role election takes place on every switch (non-root bridge), based on the following criteria in order: –...

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....