STP contents of a BPDU

A Bridge Protocol Data Unit (BPDU) has a number of fields that contain information for STP to operate correctly:

bpdu_fields.excalidraw.png

Field No.BytesField Description
12Protocol ID - set to zero for IEEE 802.1D
21Protocol version ID - set to 0 for a config and TCN BPDU, set to 2 for RST, 3 for MST, and 4 for SPT BPDUs
31BPDU Type - set to 0 for config BPDU, 128 for TCN, 2 for RST/MST Config BPDU
41Flags - indicate various things such as topology changes and acknowledgments among others. The format of the flags depends on the type of STP. (See below)
58Root ID - indicates the root bridge by listing a 2-byte priority, followed by the MAC address ID
64Root path cost - indicates the cost of the path from the bridge sending the BPDU to the root bridge
78Bridge ID - indicates the priority and MAC address ID of the bridge sending the BPDU
82Port ID - indicates the port number from which the BPDU was sent
92Message age - the amount of time in seconds since the root bridge sent the current configuration BPDU
102Max age - indicates the age in seconds at which time the current BPDU should be discarded
112Hello time - the interval between BPDU messages
122Forward delay - the length of time in seconds that a bridge should wait before transitioning to a new state after a topology change

Note that a version ID of 4 corresponds to a Shortest Path Tree (SPT) BPDU which is part of the development and implementation of Shortest Path Bridging (SPB) as specified in the IEEE 802.1aq standard.

Flags format

The format of the flags field depends upon the type of STP being run.

IEEE 802.1D

bpdu_802.1d_flags.png

Where each of the above fields is one bit:

  • TC - Topology Change flag
  • U - Unused flag
  • TCA - Topology Change Acknowledgement flag

IEEE 802.1w

bpdu_802.1w_flags.png

Where each of the above fields is one bit except for Port Role:

  • TC - Topology Change flag
  • Proposal flag
  • Port role (two bits):
    • 00 - Unknown
    • 01 - Alternate port
    • 10 - Root port
    • 11 - Designated port
  • Learning flag
  • Forwarding flag
  • Agreement flag
  • Topology Change Acknowledgement flag

For more information on the topology change process and how BPDUs are involved, take a look at:

https://networklessons.com/cisco/ccie-routing-switching-written/spanning-tree-topology-change-notification-tcn

https://networklessons.com/cisco/ccie-routing-switching-written/spanning-tree-reconvergence