On a network running STP, a device is called a bridge. Each bridge has a bridge ID (BID). According to IEEE 802.1d, a BID is composed of a bridge priority (leftmost 16 bits) and a bridge MAC address (rightmost 48 bits).
Root Bridge
The root bridge is a device that functions as the root of a tree network. It is the logical center, but not necessarily the physical center, of the network. Only one root bridge can exist on the network. The root bridge has the smallest BID on the entire STP network and changes dynamically as the network topology changes.
Root Port
The root port on an STP device is the port with the smallest path cost to the root bridge. It is responsible for forwarding data to the root bridge. An STP device has only one root port. The root bridge does not have a root port.
Designated Bridge and Designated Port
Reference Object |
Designated Bridge |
Designated Port |
---|---|---|
Device |
A directly connected device that forwards configuration BPDUs to a downstream device |
The designated bridge's port that forwards configuration BPDUs to a downstream device |
LAN |
A device that forwards configuration BPDUs to the LAN |
The designated bridge's port that forwards configuration BPDUs to the LAN |
In Figure 1, AP1 and AP2 are ports of S1, BP1 and BP2 are ports of S2, and CP1 and CP2 are ports of S3.
STP determines the network topology and calculates the spanning tree by transmitting BPDUs between devices. A BPDU is encapsulated in an Ethernet frame. Its destination MAC address is a multicast MAC address, 01-80-C2-00-00-00.
STP BPDUs are classified into the following types:
Configuration BPDUs are the most common type of BPDUs and are sent to exchange topology information among STP devices.
Configuration BPDU
Bridges exchange configuration BPDUs to elect the root bridge and determine the port role. These BPDUs are generated in the following situations:
Figure 2 shows the format of a configuration BPDU.
You can use the Packet Format Query Tool to learn the format of configuration BPDUs and the purpose of each field.
The Root Identifier, RootPath Cost, Bridge Identifier, and Port Identifier fields are the main fields of a configuration BPDU:
The preceding four fields form a BPDU priority vector {root ID, root path cost, sender BID, PID}. A bridge processes a received configuration BPDU only if the sender BID or PID is different from that on the receive port of the local bridge. If both fields are the same as those on the receive port, the bridge discards the configuration BPDU. Therefore, the bridge does not need to process BPDUs with the same information as the local port.
TCN BPDU
The format of a TCN BPDU is similar to that of a configuration BPDU. However, the payload contains only three fields: Protocol Identifier (protocol number), Protocol Version Identifier (protocol version), and BPDU Type. The BPDU Type field is four bytes long and has a fixed value of 0x80.
When the network topology changes, TCN BPDUs are transmitted to the upstream device until they reach the root bridge. A TCN BPDU is sent in either of the following scenarios: