< Home

STP Topology and BPDUs

STP Topology

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.

  • S1 sends configuration BPDUs to S2 through AP1. Therefore, S1 is the designated bridge for S2, and AP1 is the designated port on S1.
  • S2 and S3 are connected to the LAN. If S2 forwards configuration BPDUs to the LAN, S2 is the designated bridge for the LAN, and BP2 is the designated port on S2.
Figure 1 Designated bridge and designated port

BPDUs

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 BPDU: used to calculate and maintain the tree topology.
  • Topology Change Notification BPDU (TCN BPDU): used to notify corresponding devices when the network topology changes.

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:

  • After STP is enabled on a device's ports, the device's designated port sends configuration BPDUs at Hello timer intervals.
  • Upon receipt of a superior configuration BPDU, the root port updates its own configuration BPDU according to the information carried in the received configuration BPDU. The root port then sends the received configuration BPDU to the downstream device. Upon receipt of an inferior configuration BPDU, the root port discards the configuration BPDU.
  • Upon receipt of an inferior configuration BPDU, a designated port sends its own configuration BPDU to the downstream device.

Figure 2 shows the format of a configuration BPDU.

Figure 2 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:

  • Root Identifier: indicates the BID of the root bridge.
  • Root Path Cost: indicates the accumulated path cost from a port to the root bridge. The path cost is a port variable used for link selection. STP calculates path costs to select effective links, block redundant links, and trim the network into a loop-free tree topology.
  • Bridge Identifier: indicates the BID of the bridge that sends BPDUs.
  • Port Identifier: indicates the ID of the port that sends BPDUs. A PID is composed of a port priority (leftmost 4 bits) and a port number (rightmost 12 bits).

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:

  • A port transitions to the Forwarding state.
  • A designated port receives a TCN BPDU and sends a copy to the root bridge.
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >