When the network topology is stable, only the root port and designated ports forward traffic, while other
ports are all in the blocked state – they only receive STP packets but do not forward user traffic.
Once the root bridge, the root port on each non-root bridge and designated ports have been
successfully elected, the entire tree-shaped topology has been constructed.
The following is an example of how the STP algorithm works. The specific network diagram is shown in
Figure
1-2. The priority of Device A is 0, the priority of Device B is 1, the priority of Device C is 2, and the
path costs of these links are 5, 10 and 4 respectively.
Figure 1-2 Network diagram for STP algorithm
Device A
With priority 0
AP 1
5
BP 1
BP 2
Device B
With priority 1
Initial state of each device
The following table shows the initial state of each device.
Table 1-4 Initial state of each device
Device
Device A
Device B
Device C
Comparison process and result on each device
The following table shows the comparison process and result on each device.
AP 2
10
4
CP 1
CP 2
Device C
With priority 2
Port name
AP1
AP2
BP1
BP2
CP1
CP2
1-5
BPDU of port
{0, 0, 0, AP1}
{0, 0, 0, AP2}
{1, 0, 1, BP1}
{1, 0, 1, BP2}
{2, 0, 2, CP1}
{2, 0, 2, CP2}