• The Spanning Tree Protocol detects and prevents loops in bridged or switched internetworks by preventing some links from being used
• Each Bridge has a unique bridge ID formed from concatenating a defined priority with one of the
Bridge’s MAC addresses
• The Spanning Tree Protocol starts by all bridges broadcasting Bridge Protocol Data Units (BPDUs) which informs all the other bridges of the transmitting bridge’s identity
• The bridge with the lowest Bridge ID is elected as the root bridge
Spanning Tree Protocol
• Each network has a default cost, based on speed
• The Root Bridge broadcasts another BPDU and all the other bridges forward the broadcast but add their own cost into a field within the BPDU
• A bridge will receive copies of the broadcasts forwarded from all the other bridges
• It is therefore easy for a bridge to find which of its ports has the lowest cost path to the root. This is known as the root port and it will be used for forwarding • All the ports of the root bridge are root ports
Spanning Tree Protocol
• In the event of a tie, the lowest port number is selected • From each LAN, the bridge port that has the lowest cost path to the root is called the designated port.
In the event of a tie the lowest bridge ID will be selected • Once the root ports and designated ports have been discovered they will be used for forwarding and all other ports are blocked
• A spanning tree (fully connected with no loops) rooted at the root bridge is therefore created
Spanning Tree Protocol
• The root bridge broadcasts BPDUs every two seconds and the spanning tree gets recalculated if a bridge stops receiving
BPDUs
• If a bridge stops receiving BPDUs on its bridge port it will restart the protocol and attempt to become the root bridge by broadcasting BPDUs to other bridges which will do the same and elect a new root bridge
Spanning Tree Protocol - Example 1
Bridge 1
P=2, A=1
R
Bridge 2
P=1, A=2
1
R
R
1
0
R
Bridge 3
P=1, A=3
0
R