Rules of Operation
As the BPDU goes out through the network, each switch compares the BPDU that the switch sends to the BPDU that the switch receives from the neighbors. The switches then agree on which switch is the root switch. The switch with the lowest bridge ID in the network wins this election process.
Note: Remember that one root switch is identified per-VLAN. After the root switch identification, the switches adhere to these rules:
-
STP Rule 1—All ports of the root switch must be in
forwarding mode.
Note: In some corner cases, which involve self-looped ports, there is an exception to this rule.
Next, each switch determines the best path to get to the root. The switches determine this path by a comparison of the information in all the BPDUs that the switches receive on all ports. The switch uses the port with the least amount of information in the BPDU in order to get to the root switch; the port with the least amount of information in the BPDU is the root port. After a switch determines the root port, the switch proceeds to rule 2.\
-
STP Rule 2—The root port must be set to forwarding
mode.
In addition, the switches on each LAN segment communicate with each other to determine which switch is best to use in order to move data from that segment to the root bridge. This switch is called the designated switch.
-
STP Rule 3—In a single LAN segment, the port of the
designated switch that connects to that LAN segment must be placed in
forwarding mode.
-
STP Rule 4—All the other ports in all the switches
(VLAN-specific) must be placed in blocking mode. The rule only applies to ports
that connect to other bridges or switches. STP does not affect ports that
connect to workstations or PCs. These ports remain forwarded.
Note: The addition or removal of VLANs when STP runs in per-VLAN spanning tree (PVST / PVST+) mode triggers spanning tree recalculation for that VLAN instance and the traffic is disrupted only for that VLAN. The other VLAN parts of a trunk link can forward traffic normally. The addition or removal of VLANs for a Multiple Spanning Tree (MST) instance that exists triggers spanning tree recalculation for that instance and traffic is disrupted for all the VLAN parts of that MST instance.