Four Comparison Principles
STP has four comparison principles that form a BPDU priority vector { root BID, total path costs, sender BID, port ID }.
Table 1 shows the port information that is carried in the configuration BPDUs.
Table 1 Four important fields | |
Field | Brief Description |
Root BID | Each STP-capable network has only one root bridge. |
Root path cost | Cost of the path from the port sending configuration BPDUs to the root bridge. |
Sender BID | BID of the device sending configuration BPDUs. |
Port ID | PID of the port sending configuration BPDUs. |
After a device on the STP-capable network receives configuration BPDUs, it compares the fields shown in Table 1 with that of the configuration BPDUs on itself. The four comparison principles are as follows:
During the STP calculation, the smaller the value, the higher the priority.
Smallest BID: used to select the root bridge. Devices running STP select the smallest BID as the root BID shown in Table 1.
Smallest root path cost: used to select the root port on a non-root bridge. On the root bridge, the path cost of each port is 0.
Smallest sender BID: used to select the root port when a device running STP selects the root port between two ports that have the same path cost. The port with a smaller BID is selected as the root port in STP calculation. Assume that the BID of S2 is smaller than that of S3. If the path costs in the BPDUs received by port A and port B on S4 are the same, port B becomes the root port.
Smallest PID: used to block the port with a greater PID but not the port with a smaller PID when the ports have the same path cost. The PIDs are compared in the scenario shown in Figure 1. The PID of port A on S1 is smaller than that of port B. In the BPDUs that are received on port A and port B, the path costs and BIDs of the sending devices are the same. Therefore, port B with a greater PID is blocked to cut off loops.
Figure 1 Topology to which PID comparison is applied

Previous post STP/RSTP Part III


