background image
162 Chapter 4: Bridges/Switches and LAN Design
Building an Initial Spanning Tree
Each bridge begins by claiming to be the root bridge. The Spanning-Tree Protocol defines
messages used to exchange information with other bridges. These messages are called
Configuration Bridge Protocol Data Units (CBPDUs). Each bridge begins by sending a
CBPDU stating the following:
·
The root bridge's bridge ID. This is typically a MAC address on one of the bridge's
interfaces. Each bridge sets this value to its own bridge ID.
·
An administratively set priority.
·
The cost between the bridge sending this CBPDU and the root. At the beginning of the
process, each bridge claims to be root, so the value is set to 0.
·
The bridge ID of the sender of this CBDPU. At the beginning of the process, each bridge
claims to be root, so this ID is the same as the root bridge's ID.
The root bridge will be the bridge with the lowest priority value. If a tie occurs based on priority,
the root bridge with the lowest ID will be the root. The bridge IDs should be unique because
MAC addresses are supposed to be unique.
The process of choosing the root begins with all bridges claiming to be the root by sending
CBPDUs with their bridge IDs and priorities. If a bridge hears of a better candidate, it stops
advertising itself as root and starts forwarding the CBPDUs sent by the better candidate. Before
forwarding that CBPDU, the bridge increments the cost by a value based on a cost setting of
the interface on which the better candidate's CBPDU was received. It's almost like a political
race, with candidates dropping out once they cannot win and throwing their support behind the
best candidate. At the end of the election, the best candidate wins. Figure 4-17 outlines what the
bridges do after the process has settled. Table 4-10 lists the different costs used on each
interface.
Given the scenario in Figure 4-17, Bridge 2 adds its E0 cost (100) to the cost of the CBPDU
from Bridge 1 (root = Bridge 1, cost = 0), so Bridge 2 considers its cost to the root to be 100.
However, Bridge 2 does not send a CBPDU out its E0 port because that is the port in which the
CBPDU about the best root candidate entered. Instead, Bridge 2 advertises a CBPDU only out
its other ports. Bridge 3 receives the CBPDU from Bridge 2 and adds the port cost of the
incoming port, its E0 port, to the cost. Bridge 3 considers its cost to the root to be 200, as
reflected in its CBPDU.
Consider the steady-state CBPDU messages from Bridge 4's perspective. This bridge receives
a CBPDU about Bridge 1 as root from both Bridge 3 and Bridge 5. The cost in the CBPDU from
Bridge 5 is lower; therefore, that is the message to which Bridge 4 reacts. Following the same
logic, Bridge 4 adds its E1 port cost to the cost learned from Bridge 5, leaving a total of 110.
Bridge 4 sends a CBPDU out all other ports besides its E1 port.
ch04.fm Page 162 Monday, March 20, 2000 5:02 PM