Calculation process of the stp algorithm – H3C Technologies H3C S5120 Series Switches User Manual

Page 169

Advertising
background image

1-4

Calculation process of the STP algorithm

z

Initial state

Upon initialization of a device, each port generates a BPDU with itself 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.

z

Selection of the optimum configuration BPDU

Each device sends out its configuration BPDU and receives configuration BPDUs from other devices.

Table 1-2

describes the process of selecting the optimum configuration BPDU.

Table 1-2

Selection of the optimum configuration BPDU

Step

Actions

1

Upon receiving a configuration BPDU on a port, the device performs the following:

z

If the received configuration BPDU has a lower priority than that of the configuration
BPDU generated by the port, the device discards the received configuration BPDU
and does not process the configuration BPDU of this port.

z

If the received configuration BPDU has a higher priority than that of the configuration
BPDU generated by the port, the device replaces the content of the configuration
BPDU generated by the port with the content of the received configuration BPDU.

2

The device compares the configuration BPDUs of all the ports and chooses the optimum
configuration BPDU.

The following are the principles of configuration BPDU comparison:

z

The configuration BPDU that has the lowest root bridge ID has the highest priority.

z

If all the configuration BPDUs have the same root bridge ID, their root path costs are compared.
Assume that the root path cost in a configuration BPDU plus the path cost of a receiving port is S.
The configuration BPDU with the smallest S value has the highest priority.

z

If all configuration BPDUs have the same ports value, their designated bridge IDs, designated port
IDs, and the IDs of the receiving ports are compared in sequence. The configuration BPDU
containing a smaller ID wins out.

z

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.

z

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

Table 1-3

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

Table 1-3

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.

Advertising