¾  STP Generation 
z  In the beginning 
In the beginning, each switch regards itself as the root, and generates a configuration BPDU for 
each port on it as a root, with the root path cost being 0, the ID of the designated bridge being that 
of the switch, and the designated port being itself.   
z  Comparing BPDUs   
Each switch sends out configuration BPDUs and receives a configuration BPDU on one of its ports 
from another switch. The following table shows the comparing operations.   
Step  Operation 
1  If the priority of the BPDU received on the port is lower than that of the BPDU if of 
the port itself, the switch discards the BPDU and does not change the BPDU of 
the port.   
2  If the priority of the BPDU is higher than that of the BPDU of the port itself, the 
switch replaces the BPDU of the port with the received one and compares it with 
those of other ports on the switch to obtain the one with the highest priority.   
Table 7-1 Comparing BPDUs 
z  Selecting the root bridge 
The root bridge is selected by BPDU comparing. The switch with the smallest root ID is chosen as 
the root bridge.   
z  Selecting the root port and designate port   
The operation is taken in the following way: 
Step  Operation 
1  For each switch (except the one chosen as the root bridge) in a network, the port 
that receives the BPDU with the highest priority is chosen as the root port of the 
switch.  
2  Using the root port BPDU and the root path cost, the switch generates a 
designated port BPDU for each of its ports. 
z  Root ID is replaced with that of the root port; 
z  Root path is replaced with the sum of the root path cost of the root port and 
the path cost between this port and the root port; 
z  The ID of the designated bridge is replaced with that of the switch; 
z  The ID of the designated port is replaced with that of the port.   
3  The switch compares the resulting BPDU with the BPDU of the desired port 
whose role you want to determine.   
z  If the resulting BPDU takes the precedence over the BPDU of the port, the 
port is chosen as the designated port and the BPDU of this port is replaced 
with the resulting BPDU. The port regularly sends out the resulting BPDU; 
z  If the BPDU of this port takes the precedence over the resulting BPDU, the 
BPDU of this port is not replaced and the port is blocked. The port only can 
receive BPDUs.   
Table 7-2 Selecting root port and designated port 
73