78
Table 5 STP port states
State
Receives/sends BPDUs
Learns MAC addresses
Forwards use data
Disabled No
No
No
Listening Yes
No
No
Learning Yes
Yes
No
Forwarding Yes
Yes
Yes
Blocking Receive
No
No
Path cost
Path cost is a reference value used for link selection in STP. To prune the network into a loop-free
tree, STP calculates path costs to select the most robust links and block redundant links that are less
robust.
Calculation process of the STP algorithm
The spanning tree calculation process described in the following sections is an example of a
simplified process.
Calculation process
The STP algorithm uses the following calculation process:
1.
Network initialization.
Upon initialization of a device, each port generates a BPDU with the following contents:
{
The port as the designated port.
{
The device as the root bridge.
{
0 as the root path cost.
{
The device ID as the designated bridge ID.
2.
Root bridge selection.
Initially, each STP-enabled device on the network assumes itself to be the root bridge, with its
own device ID as the root bridge 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.
Root port and designated ports selection on the non-root bridges.
Step Description
1
A non-root-bridge device regards the port on which it received the optimum configuration
BPDU as the root port.
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 other 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 will be determined. Then, the device acts depending on the result
of the comparison:
•
If the calculated configuration BPDU is superior, the device performs the following
operations: