7-4For simplicity, the descriptions and examples below involve only four fields of configuration BPDUs:z Root bridge ID (represented by bridge priority)z Root path cost (related to the rate of the link connecting the port)z Designated bridge ID (represented by bridge priority)z Designated port ID (represented by port name)Calculation process of the STP algorithm1) Initial stateUpon initialization of a bridge, each port generates a BPDU with itself as the root bridge, in which theroot path cost is 0, designated bridge ID is the bridge ID, and the designated port is the local port.2) Selection of the optimum configuration BPDUEach bridge sends out its configuration BPDU and receives configuration BPDUs from other bridges.The process of selecting the optimum configuration BPDU is as follows:Table 7-2 Selection of the optimum configuration BPDUStep Actions1Upon receiving a configuration BPDU on a port, the bridge performs the following:z If the received configuration BPDU has a lower priority than that of the configuration BPDUgenerated by the port, the bridge discards the received configuration BPDU and does notprocess the configuration BPDU of this port.z If the received configuration BPDU has a higher priority than that of the configuration BPDUgenerated by the port, the bridge replaces the content of the configuration BPDU generatedby the port with the content of the received configuration BPDU.2 The bridge compares the configuration BPDUs of all the ports and chooses the optimumconfiguration 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 portIDs, and the IDs of the receiving ports are compared in sequence. The configuration BPDUcontaining a smaller ID wins out.3) Selection of the root bridgeInitially, each STP-enabled device on the network assumes itself to be the root bridge, with the rootbridge ID being its own device ID. By exchanging configuration BPDUs, the bridges compare their rootbridge IDs to elect the bridge with the smallest root bridge ID as the root bridge.