STP - determining the blocked port using port ID

When implementing Spanning Tree Protocol (STP), an STP topology will avoid creating a Layer 2 loop by choosing to block certain ports in the topology. When selecting which port to block on a switch, the following four parameters that are found within received BPDUs. Specifically, one BPDU is considered superior to another if it has:

  1. The lower root bridge ID
  2. The lower path cost to the root
  3. The lower sending Bridge ID
  4. The lower sending port ID

The port receiving the superior BPDU will not be blocked. These parameters are checked in order, and the next is only checked if the previous is a tie.

In the event that the first three are the same, it is the lower sending port ID that is used. This would be needed in the following topology:

stp-two-switches-with-multiple-connections.png

So in this case, SW2 will receive BPDUs from the root bridge on both links. Therefore, on both BPDUs, both root bridge IDs are the same, both path costs are the same, and both sending Bridge IDs are the same. The last thing to check is the sending port ID.

Important note: It is the sending port ID that makes the difference. In this case, the port IDs of the ports on SW1.

Fa0/1 on SW2 receives a BPDU with the port ID of Fa0/1 from SW1. Similarly, Fa0/2 on SW2 receives a BPDU with the port ID of Fa0/2 from SW1. The port that receives a BPDU with the lowest port ID is the one chosen to forward traffic. Therefore, the BPDU received on the Fa0/1 interface of SW2 is the superior BPDU, so Fa0/2 is chosen to be blocked.

Links:

https://forum.networklessons.com/t/introduction-to-spanning-tree/853/187?u=lagapides