Skip to content

VLAN support tracking issue #121

Description

@MDr164

This issue will serve as an umbrella issue for tracking the current gaps in the code for full VLAN and adjacent technologies. As there is quite a lot of implications and code sections that are affected I'll gradually fill the issue with bullet points.

  • Fix VLAN TCI bit handling in ethernet.VLANTag
    • Correct PCP, DEI, and VID extraction to match 802.1Q layout.
    • Add constructor/validation for VID 1–4094, PCP 0–7, DEI.
  • Add VLAN tag mutation helpers
    • Add zero/allocation-conscious helpers to insert and remove 802.1Q tags in raw Ethernet frame buffers.
    • Cover length checks, short buffers, existing tags, and preservation of inner EtherType.
  • Expand VLAN EtherType support
    • Treat both customer VLAN 0x8100 and service VLAN 0x88a8 consistently where appropriate.
    • Decide whether service VLAN/QinQ is supported, rejected, or parsed as a known-but-unsupported case.
  • Improve Ethernet frame VLAN parsing
    • Make header length, payload slicing, validation, and inner EtherType handling robust for tagged frames.
    • Avoid dispatching VLAN frames by outer EtherType when the inner EtherType is what protocol handlers need.
  • Add VLAN-aware Ethernet stack support
    • Add a StackEthernetVLAN or equivalent API for a local stack participating in a configured VID.
    • Ingress should filter by MAC and VID, then demux by inner EtherType.
    • Egress should emit Ethernet + VLAN headers and preserve MTU/CRC/min-frame behavior.
  • Add multi-VLAN / trunk local stack design
    • Decide whether the local CPU stack supports one VID per stack, multiple VIDs, or a trunk-style abstraction.
    • Needed for managed-switch CPU-port use cases.
  • Add VLAN-aware forwarding database
    • Add MAC learning keyed by (MAC, VID).
    • Support dynamic entries, static entries, lookup, aging, flush-by-port, flush-by-VLAN or equivalent management operations.
    • Keep forwarding hot paths allocation-free.
  • Add egress tag policy support
    • Track whether each VLAN exits each port tagged, untagged, or dropped.
    • Provide clear caller contract for whether the switch mutates frames itself or returns egress actions for the caller to apply.
  • Improve PCAP/debug capture VLAN decoding
    • Decode VLAN tag fields explicitly.
    • Continue parsing the inner EtherType instead of treating the remainder as opaque VLAN payload.
    • Consider nested-tag behavior: unsupported, single-level only, or recursive.
  • Add VLAN-focused tests
    • Unit tests for tag construction/extraction.
    • Frame insert/remove tests.
    • Tagged ingress/egress stack tests.
    • FDB learning/aging/static-entry tests.
    • Switch access/trunk/PVID/membership/flooding tests.
    • PCAP inner-EtherType decode tests.
    • Negative tests for invalid VID, malformed/truncated frames, and unsupported service/QinQ cases.
  • Add VLAN docs/examples
    • Document supported VLAN scope and explicitly unsupported items.
    • Add examples for a tagged local stack and a small access/trunk switch setup.
  • Decide scope for "advanced" VLAN features
    • QinQ / stacked VLANs.
    • STP/RSTP.
    • LACP.
    • GVRP/MVRP.
    • 802.1X integration.
    • PCP/DEI QoS/drop behavior.
    • Multicast group management beyond flooding/static FDB entries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions