Skip to content

STP/RSTP BPDU decoding (IEEE 802.1D/802.1w) #189

Description

@EONRaider

Target: 2.5.0 (Tier 3 — L2 discovery & tunneling) — depends on
the 802.3 length-field/LLC-detection issue in this same tier.

Context

STP (IEEE 802.1D) BPDUs ride classic 802.3 + LLC framing — DSAP/SSAP
0x42, no SNAP — with no EtherType at all. This issue is undecodable
until the LLC-detection issue in this tier lands; it's filed now so
the tier's full shape is visible, not as work to start early.

Deliverable

Add netprotocols.STP (layer 2, dispatched from the new llc.dsap
table at DSAP 0x42):

  • Decode the Configuration BPDU (IEEE 802.1D §9.3.1, 35 bytes):
    Protocol ID, Protocol Version ID, BPDU Type, Flags, Root ID (Bridge
    ID: 2-byte priority + 6-byte MAC), Root Path Cost, Bridge ID, Port
    ID, Message Age, Max Age, Hello Time, Forward Delay — all in the
    fixed-width, no-TLV shape this library already handles well.
  • RSTP (802.1w) reuses the same BPDU shape with BPDU Type 0x02 and
    one additional Version 1 Length byte (always 0 in practice) — decode
    both Configuration and RSTP BPDUs as one class, branching on BPDU Type the way ICMPv4/ICMPv6 branch on message type.
  • Topology Change Notification BPDUs (Type 0x80) are 4 bytes total
    (Protocol ID, Version, Type) — trivial, decode as the same class's
    short-form case.

Acceptance criteria

  • STP decodes Configuration, RSTP, and Topology Change
    Notification BPDUs; bytes(STP.decode(x)) == x.
  • LLC DSAP 0x42 dispatches to STP via the table added by the
    LLC-detection issue.
  • Fixture with a real captured BPDU (from a switch or a bridged
    lab topology) and truncation.
  • CHANGELOG entry; full ladder green.

References

IEEE 802.1D §9.3, IEEE 802.1w (RSTP) · blocked by: the LLC-detection
issue, this tier (#173)

Part of #173

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions