So I've always had a tough time grasping exactly how STP decides which ports to make root/designated/block. I was recently challenged by someone to come up with a solution to why a specific link is blocked in a topology. It forced me to do the research required to gain an understanding of how it works. Im going to list the steps here, and correct me if I'm wrong.
Root Bridge is decided by the bridge with the lowest BID. The BID is the bridge priority + the MAC address.
Root ports are determined using the following process:
1. Lowest cost
2. Lowest received BID
3. Lowest received port-priority
4. Lowest local interface ID
Now if thats correct, then how does STP decide which switches have blocked ports and which do not?
For example:
Root Bridge is SW1 due to having the lower BID. Now here is where I am confused. Why is it that SW2 has the 2 blocked links rather than SW3 having the blocked links? Is it due to Gi0/1 winning the root port election? Someone described designated ports as being the ports connected to root ports. How come fa0/2 is a Designated port and its connected to a blocked port?