Path cost, Calculation process of the stp algorithm – H3C Technologies H3C WX3000E Series Wireless Switches User Manual

Page 61

Advertising
background image

51

Path cost

Path cost is a reference value used for link selection in STP. By calculating path costs, STP selects relatively

robust links and blocks redundant links, and finally prunes the network into a loop-free tree.

Calculation process of the STP algorithm

The STP algorithm uses the following calculation process:

1.

Initial state
Upon initialization of a device, each port generates a BPDU with the device as the root bridge, in
which the root path cost is 0, designated bridge ID is the device ID, and the designated port is the
port itself.

2.

Selection of the root bridge
Initially, each STP-enabled device on the network assumes itself to be the root bridge, with the root
bridge ID being its own device ID. By exchanging configuration BPDUs, the devices compare their

root bridge IDs to elect the device with the smallest root bridge ID as the root bridge.

3.

Selection of the root port and designated ports on a non-root device

Table 9

describes the process of selecting the root port and designated ports.

Table 9 Selection of the root port and designated ports

Step

Description

1

A non-root-bridge device regards the port on which it received the optimum configuration BPDU
as the root port.

Table 10

describes how the optimum configuration BPDU is selected.

2

Based on the configuration BPDU and the path cost of the root port, the device calculates a
designated port configuration BPDU for each of the rest ports.

The root bridge ID is replaced with that of the configuration BPDU of the root port.

The root path cost is replaced with that of the configuration BPDU of the root port plus the path

cost of the root port.

The designated bridge ID is replaced with the ID of this device.

The designated port ID is replaced with the ID of this port.

3

The device compares the calculated configuration BPDU with the configuration BPDU on the port
whose port role is to be determined:

If the calculated configuration BPDU is superior, the device considers this port as the

designated port, replaces the configuration BPDU on the port with the calculated configuration
BPDU, and periodically sends out the calculated configuration BPDU.

If the configuration BPDU on the port is superior, the device blocks this port without updating its

configuration BPDU. The blocked port can receive BPDUs, but cannot send BPDUs or forward
data traffic.

NOTE:

When the network topology is stable, only the root port and designated ports forward user traffic, and
other ports are all in blocked state to receive BPDUs but not forward BPDUs or user traffic.

Advertising