STP runs at the data link layer. The devices running STP discover loops on the network by exchanging information with each other and trim the ring topology into a loop-free tree topology by blocking a certain interface. In this manner, replication and circular propagation of packets are prevented on the network. In addition, STP prevents the processing performance of network devices from deteriorating.
The devices running STP usually communicate with each other by exchanging configuration Bridge Protocol Data Units (configuration BPDUs). BPDUs are classified into two types:
Configuration BPDU: used to calculate a spanning tree and maintain the spanning tree topology.
Topology Change Notification BPDU (TCN BPDU): used to inform upstream devices of a topology change by downstream device.
Configuration BPDUs contain sufficient information for devices to calculate the spanning tree. They contain the following information:
Root bridge ID: is composed of a root bridge priority and the root bridge's MAC address. Each STP network has only one root bridge.
Cost of the root path: indicates the cost of the shortest path to the root bridge.
ID of a designated bridge: is composed of a bridge priority and a MAC address.
ID of a designated port: is composed of a port priority and a port name.
Message Age: sets the lifetime of a BPDU on the network.
Max Age: sets the maximum time a BPDU is saved.
Hello Time: sets the interval at which BPDUs are sent.
Forward Delay: indicates the time interface status transition takes.
Related post STP/RSTP



