When the switch has two interfaces connecting to the same switch, and the cost to reach the root bridge is the same it will use the interface with the lowest number as the root port..
For an example, let's say SW-A has the lowest MAC address hence SW-A will be the Root..
What will be the Alternate Port here?
Is it the e0/1 of SW-B?
Yes
By just looking at the port numbers, we can say that..
Is it the e0/3 of SW-B?
No
E0/1 of SW-B will be the Alternate Port..
This is where most people will answer incorrectly.. The port priority which is considered is not the port priority of the of the SW-B. It is the port priority of the BPDU sender. Which in this case is the Root Bridge (SW-A).. Sender's port priority is what matters..
If we look at the output of show spanning-tree; (I use actual hardware from here)
Because the priority is 128 default which is equal in all ports it has boiled down to the port number.. Lower port number will be the root port..
Let's change the port priority manually on SW-A..
SW-A(config-if)#int fa0/2
SW-A(config-if)#spanning-tree port-priority 16
Now you can see the Alternate Port is changed to Fa0/3 of SW-B..
Additional Note:-
Decision making process of STP is like the following..
(1) Lowest bridge ID: the switch with the lowest bridge ID becomes the root bridge.
(2) Lowest path cost to Root Bridge: when the switch receives multiple BPDUs it will select the interface that has the lowest cost to reach the root bridge as the root port.
(3) Lowest sender bridge ID: when a switch is connected to two switches that it can use to reach the root bridge and the cost to reach the root bridge is the same, it will select the interface connecting to the switch with the lowest bridge ID as the root port.
(4) Lowest sender port ID: when the switch has two interfaces connecting to the same switch, and the cost to reach the root bridge is the same it will use the interface with the lowest number as the root port.
No comments:
Post a Comment