I was reading about how STP determines which port to block. I was looking at this url https://ciscoiseasy.blogspot.co.uk/2010/10/lesson-20-spanning-tree-protocol.html explicitly this section
The following algorithm is used to determine the root port or designated port (in order):
- Prefer the lowest Root Path Cost.
- In case of the same Root Path Cost, prefer the lowest Bridge ID of the designated switch (the neighbor that sends BPDUs).
- In case of receiving BPDUs on multiple ports from the same designated switch (BPDU sender), prefer the lowest Port ID (known also as port priority) of the sender. That parameter has a default value 128 and is configurable.
- In case of all above are did not resolve the problem, prefer the lowest Port ID of the BPDU sender.
The first 3 parts I understand fine. It's the last one that I wanted some clarification on.
The website goes on to show and example where the BPDU frame is being sent from a switch (SW3) on interfaces Fa0/3 and Fa0/4 to another switch (SW4). SW4 chooses it's port Fa0/1 because that port is connected to Fa0/3 and 3 is lower than 4.
My question is:
Is that really as simple as it sounds? A simple calculation on which port number is lower or is there more to it? What would happen if I had Po1 and Fa0/1 and all other factors were the same?
Best Answer
If you do show spanning-tree, the port ID is the Nbr element in the Prio.Nbr column. For this example Gi0/0 is port 1, Gi0/1 is port 2, Po1 is port 65. You will find that all the interfaces of a type are grouped and the port IDs are ordered within that group.