152 CHAPTER 14: MSTP CONFIGURATIONCalculate an MSTIIn an MST region, different MSTIs are generated for different VLANs based on theVLAN-to-MSTI mappings. Each spanning tree is calculated independently, in thesame way as how STP/RSTP is calculated.Implement STP algorithmIn the beginning, each switch regards itself as the root, and generates aconfiguration 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 portbeing itself.1 Each switch sends out its configuration BPDUs and operates in the following waywhen receiving a configuration BPDU on one of its ports from another switch:■ If the priority of the configuration BPDU is lower than that of the configurationBPDU of the port itself, the switch discards the BPDU and does not change theconfiguration BPDU of the port.■ If the priority of the configuration BPDU is higher than that of theconfiguration BPDU of the port itself, the switch replaces the configurationBPDU of the port with the received one and compares it with those of otherports on the switch to obtain the one with the highest priority.2 Configuration BPDUs are compared as follows:■ For MSTP, CIST configuration information is generally expressed as follows:(Root bridge ID, External path cost, Master bridge ID, Internal path cost,Designated bridge ID, ID of sending port, ID of receiving port)■ The smaller the Root bridge ID of the configuration BPDU is, the higher thepriority of the configuration BPDU is.■ For configuration BPDUs with the same Root bridge IDs, the External pathcosts are compared.■ For configuration BPDUs with both the same Root bridge ID and the sameExternal path costs, Master bridge ID, Internal path cost, Designated bridgeID, ID of sending port, ID of receiving port are compared in turn.■ For MSTP, MSTI configuration information is generally expressed as follows:(Instance bridge ID, Internal path costs, Designated bridge ID, ID of sendingport, ID of receiving port)■ The smaller the Instance bridge ID of the configuration BPDU is, the higherthe priority of the configuration BPDU is.■ For configuration BPDUs with the same Instance bridge IDs, Internal pathcosts are compared.■ For configuration BPDUs with both the same Instance bridge ID and thesame Internal path costs, Designated bridge ID, ID of sending port, ID ofreceiving port are compared in turn.3 A spanning tree is calculated as follows:■ Determining the root bridgeRoot bridges are selected by configuration BPDU comparing. The switch with thesmallest root ID is chosen as the root bridge.