The BID, path cost, and PID that are described in the previous sections are all carried in Bridge Protocol Data Units (BPDUs).
A BPDU is encapsulated into an Ethernet frame. In an Ethernet frame, the destination MAC address is the multicast MAC address 01-80-C2-00-00-00; the value of the Length/Type field is the length of MAC data; in the LLC header, as defined in the IEEE standard, the values of DSAP and SSAP are 0x42 and the value of UI is 0x03; the BPDU header follows the LLC header. Figure 1 shows the format of an Ethernet frame.
Configuration BPDUs are most commonly used.
During initialization, each bridge actively sends configuration BPDUs. After the network topology becomes stable, only the root bridge actively sends configuration BPDUs. Other bridges send configuration BPDUs only after receiving configuration BPDUs from upstream devices. A configuration BPDU is at least 35 bytes long, including the parameters such as the BID, path cost, and PID. A BPDU is discarded if both the sender BID and Port ID field values are the same as those of the local port. Otherwise, the BPDU is processed. In this manner, BPDUs containing the same information as that of the local port are not processed.
Table 1 shows the format of a BPDU.
Field |
Byte |
Description |
---|---|---|
Protocol Identifier |
2 |
Always 0 |
Protocol Version Identifier |
1 |
Always 0 |
BPDU Type |
1 |
Indicates the type of a BPDU. The value can be:
|
Flags |
1 |
Indicates whether the network topology is changed.
|
Root Identifier |
8 |
Indicates the BID of the current root bridge. |
Root Path Cost |
4 |
Indicates the cumulative cost of all links to the root bridge. |
Bridge Identifier |
8 |
Indicates the BID of the bridge sending a BPDU. |
Port Identifier |
2 |
Indicates the ID of the port sending a BPDU. |
Message Age |
2 |
Records the time since the root bridge originally generated the information that a BPDU is derived from. If the configuration BPDU is sent from the root bridge, the value of Message Age is 0. Otherwise, the value of Message Age indicates the total time during which a BPDU is sent from the root bridge to the local bridge, including the delay in transmission. In real world situations, each time a configuration BPDU passes through a bridge, the value of Message Age increases by 1. |
Max Age |
2 |
Indicates the maximum time that a BPDU is saved. |
Hello Time |
2 |
Indicates the interval at which BPDUs are sent. |
Forward Delay |
2 |
Indicates the time spent in the Listening and Learning states. |
Figure 2 shows the Flags field. Only the left most and right most bits are used in STP.
The contents of TCN BPDUs are simple, including only three fields: Protocol ID, Version, and Type, as shown in Table 1. The value of the Type field is 0x80, four bytes in length.