Skip to content

ieee80211: correct wire encoding and receive behavior - #1189

Open
mgonzalezlopezudc wants to merge 3 commits into
inet-framework:masterfrom
mgonzalezlopezudc:fix/ieee80211-wire-and-receive-correctness
Open

ieee80211: correct wire encoding and receive behavior#1189
mgonzalezlopezudc wants to merge 3 commits into
inet-framework:masterfrom
mgonzalezlopezudc:fix/ieee80211-wire-and-receive-correctness

Conversation

@mgonzalezlopezudc

Copy link
Copy Markdown
Contributor

What

Correct IEEE 802.11 wire byte encoding, parameter sets, parity generation and validation, PHY protocol identification, AP beacon interval normalization, standard channel advertisement, and receive duplicate handling for QoS Control, OFDM PHY, DSSS Parameter Sets, and Mesh Error codes.

Why

  1. QoS Control bit positions:
    Per IEEE Std 802.11-2024 Table 9-10, the 16-bit QoS Control field encodes TID in bits B0–B3, bit B4 as EOSP / subframe type depending on STA role, Ack Policy in bits B5–B6, and A-MSDU Present in bit B7. The serializer previously misarranged these bits. Both serialization and deserialization now match the standard wire bit mapping.

  2. Non-QoS duplicate removal separation:
    Per IEEE Std 802.11-2024 § 10.3.2.14.3 and Table 10-6, non-QoS Data (ST_DATA) belongs to the shared/legacy duplicate cache (RC1), not the per-TID QoS Data cache (RC2). Previously, non-QoS Data aliased the QoS TID-0 duplicate cache entry, which could cause premature drop of valid non-QoS data frames following QoS data exchanges.

  3. OFDM SIGNAL parity and RATE validation:
    Per IEEE Std 802.11-2024 § 17.3.4.4, bit 17 of the SIGNAL field provides even parity across bits 0–16. In accordance with §§ 17.3.4.2 and 17.3.12, all eight defined RATE codes are odd 4-bit values. The bit-level (Ieee80211OfdmRadio) and packet-level (Ieee80211Radio) models now compute and insert the parity bit on transmission and validate parity and RATE validity on reception, marking frames with invalid parity or rates with bit errors.

  4. PHY protocol identity preservation for HR/DSSS and ERP:
    ERP reuses OFDM's SIGNAL mode objects, whose factory creates a base OFDM header. Ieee80211Radio::encapsulate now ensures ERP transmissions retain Ieee80211ErpOfdmPhyHeader and Protocol::ieee80211ErpOfdmPhy, and orders HR/DSSS ahead of DSSS dispatch so transmissions carry their specific PHY protocol identities.

  5. AP Beacon scheduling and interval normalization:
    Per IEEE Std 802.11-2024 § 9.4.1.3, Beacon Interval is a 16-bit field in Time Units (1 TU = 1024 µs), valid in the range 1 to 65535 TUs. AP beacon intervals are now normalized down to whole 1024-µs TUs during initialization for both target scheduling and frame advertisement (e.g., default 100ms becomes 97 TUs = 99.328 ms).

  6. DSSS Current Channel Parameter Set:
    Per IEEE Std 802.11-2024 § 9.4.2.4 and Tables 9-62 / 9-69, Beacon and Probe Response frames advertise the DSSS Parameter Set Current Channel element for 2.4 GHz operation. Ieee80211BeaconFrame::channelNumber now represents the standard channel number (default -1 when absent) instead of an internal channel index. The serializer reads and writes the 3-byte element. Ieee80211MgmtSta converts standard channel numbers back to band indices during discovery and falls back to receive channel when absent.

  7. Mesh Reason Code correction:
    RC_MESH_PATH_ERROR_NO_FORWARDING_INFORMATION in Ieee80211MgmtFrame.msg is corrected from 60 (which conflicted with invalid security capability) to 62 per IEEE Std 802.11-2024 Table 9-79.

  8. Release notes and migration documentation:
    Documented in WHATSNEW and doc/src/migration-guide/index.rst.

Reading Order

This pull request consists of a single self-contained commit:

  1. 715e140a63ieee80211: correct wire encoding and receive behavior
    • Single decision & rationale: Corrections to IEEE 802.11 QoS Control wire bits, non-QoS duplicate cache isolation, OFDM SIGNAL parity and RATE validation, HR/DSSS and ERP PHY protocol identity preservation, AP beacon interval TU normalization, DSSS Current Channel advertisement and discovery conversion, and mesh reason code 62, accompanied by focused unit tests and migration guidance.
    • Component surface:
      • WHATSNEW
      • doc/src/migration-guide/index.rst
      • src/inet/linklayer/ieee80211/mac/Ieee80211MacHeaderSerializer.cc
      • src/inet/linklayer/ieee80211/mac/duplicateremoval/QosDuplicateRemoval.cc
      • src/inet/linklayer/ieee80211/mgmt/Ieee80211BeaconInterval.h
      • src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtAp.cc
      • src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtAp.ned
      • src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtApBase.cc
      • src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtApBase.h
      • src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtFrame.msg
      • src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtFrameSerializer.cc
      • src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtSta.cc
      • src/inet/physicallayer/wireless/ieee80211/bitlevel/Ieee80211OfdmRadio.cc
      • src/inet/physicallayer/wireless/ieee80211/packetlevel/Ieee80211OfdmSignalField.h
      • src/inet/physicallayer/wireless/ieee80211/packetlevel/Ieee80211Radio.cc
      • tests/unit/Ieee80211BeaconSchedule_1.test
      • tests/unit/Ieee80211BeaconWire_1.test
      • tests/unit/Ieee80211HtMgmtElements_1.test
      • tests/unit/Ieee80211MgmtStaDiscovery_1.test
      • tests/unit/Ieee80211OnWireBitCompliance_1.test
      • tests/unit/Ieee80211QosDuplicateRemoval_1.test
      • tests/unit/Ieee80211RadioWireIdentity_1.test

Architectural Surface

  • Modules touched:
    • src/inet/linklayer/ieee80211/mac/Ieee80211MacHeaderSerializer.cc
    • src/inet/linklayer/ieee80211/mac/duplicateremoval/QosDuplicateRemoval.cc
    • src/inet/linklayer/ieee80211/mgmt/Ieee80211BeaconInterval.h
    • src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtAp.cc
    • src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtAp.ned
    • src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtApBase.cc
    • src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtApBase.h
    • src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtFrameSerializer.cc
    • src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtSta.cc
    • src/inet/physicallayer/wireless/ieee80211/bitlevel/Ieee80211OfdmRadio.cc
    • src/inet/physicallayer/wireless/ieee80211/packetlevel/Ieee80211OfdmSignalField.h
    • src/inet/physicallayer/wireless/ieee80211/packetlevel/Ieee80211Radio.cc
  • Contracts and protocols:
    • IEEE 802.11 MAC header serialization (Ieee80211MacHeaderSerializer).
    • MAC duplicate removal (QoSDuplicateRemoval).
    • AP and STA management contracts (Ieee80211MgmtAp, Ieee80211MgmtApBase, Ieee80211MgmtSta).
    • OFDM physical layer radios (Ieee80211OfdmRadio, Ieee80211Radio).
  • Packet representation:
    • QoS Control chunk byte layout aligned with IEEE Std 802.11-2024 Table 9-10.
    • OFDM PHY headers compute and validate parity bit and RATE code.
    • DSSS Parameter Set (element ID 3, 3 bytes) serialized in Beacon and Probe Response frames for 2.4 GHz operation; channelNumber in Ieee80211BeaconFrame represents standard channel number.
    • Mesh reason code RC_MESH_PATH_ERROR_NO_FORWARDING_INFORMATION value corrected to 62.
  • Configuration surface:
    • Ieee80211MgmtAp.ned: beaconInterval parameter comment updated to clarify 1..65535 TUs range and integer TU normalization.
  • Feature descriptors: None.
  • Seals and audit exceptions:
    • All modified source files under src/inet/ are unsealed (doc/project/enforcement/check-source-seals.sh PASS).
    • No architectural deviations (AV-*) or naming deviations (NV-*) introduced.

Baselines

  • Recorded fingerprint baselines remain unchanged. Legacy fingerprint cases completed with 3 passing and 9 differing only in serialized packet bytes (~tND), with tplx and ~tNl retained.

Verification Evidence

  1. Compilation:
    • make -j$(nproc) MODE=debug: PASS (libINET_dbg.so).
    • make -j$(nproc) MODE=release: PASS (libINET.so).
  2. Mechanical gates:
    • doc/project/enforcement/check-commits.sh upstream/master..HEAD: PASS (1 commit, linear, valid subject/facts format, clean splits).
    • doc/project/enforcement/check-source-seals.sh --base upstream/master: PASS (all touched files unsealed).
    • doc/project/enforcement/check-architecture.sh src/inet/linklayer/ieee80211: PASS.
    • doc/project/enforcement/check-architecture.sh src/inet/physicallayer/wireless/ieee80211: PASS.
    • doc/project/enforcement/check-naming.sh --base upstream/master: PASS for changed files (0 naming candidates in changed files).
    • doc/project/enforcement/check-interfaces.sh: PASS (no changed interfaces touched).
  3. Direct unit tests:
    • . setenv -q && inet_run_unit_tests -m debug -f 'Ieee80211(BeaconSchedule|BeaconWire|HtMgmtElements|MgmtFrameSerializer|MgmtStaDiscovery|OnWireBitCompliance|QosDuplicateRemoval|RadioWireIdentity).*': PASS (8 passed in 1.702s).
      • Ieee80211BeaconSchedule_1.test: PASS (0.943s)
      • Ieee80211BeaconWire_1.test: PASS (0.698s)
      • Ieee80211HtMgmtElements_1.test: PASS (0.672s)
      • Ieee80211MgmtFrameSerializer_1.test: PASS (1.537s)
      • Ieee80211MgmtStaDiscovery_1.test: PASS (0.643s)
      • Ieee80211OnWireBitCompliance_1.test: PASS (0.621s)
      • Ieee80211QosDuplicateRemoval_1.test: PASS (0.652s)
      • Ieee80211RadioWireIdentity_1.test: PASS (0.726s)

Correct QoS Control bit positions and isolate non-QoS Data from the per-TID receive duplicate cache. Generate and validate OFDM SIGNAL parity and RATE, and preserve HR/DSSS and ERP PHY protocol identity.

Normalize AP beacon scheduling to the advertised TU interval. Encode DSSS Current Channel using standard channel numbers and convert through the band API during discovery. Correct the mesh no-forwarding-information reason code to 62. Include focused tests and migration guidance.

Validation: debug build, eight focused tests, and scoped architecture checks passed.

Correct OFDM SIGNAL RATE/parity, QoS Control encoding, PHY identity and management frame bytes. Whole-TU beacon scheduling and the DSSS Current Channel element also change AP discovery and frame timing. The focused wire and beacon tests establish the corrected behavior; the 158 CI-selected configurations were compared with the parent at identical run selectors and time limits.

Include 158 causally changed legacy fingerprint rows in this commit. Preserve graphical tyf expectations. The complete selected before/after results are recorded in ai-logs/executions/2026-09-11_ci-fingerprints.md.
Publish immutable band details with the existing channel index signal during initialization and channel changes. Use those observations for AP HT and DSSS advertisement without accessing the concrete transmitter.

Give the receiver its own channel object to prevent shared ownership from causing a use-after-free on subsequent band changes. Cover initial and runtime notifications, missing details, HT state updates, and unavailable channels; use a valid beacon interval in the missing-channel fixture.

Validation: debug build, two focused unit tests, two focused module tests, scoped architecture and NED naming checks passed.

Publish AP band/channel observations during initialization and channel changes. The boundary comparison isolates the resulting advertised state and discovery behavior from the preceding wire corrections.

The 158 selected legacy fingerprint rows retain the preceding commit's values.
Clear QoS Control bit 4 instead of unconditionally advertising EOSP or an empty queue. Document the modeling simplification and update byte expectations across all DS layouts, retaining decode coverage for both bit values.

Document the valid interval requirement for custom Beacon and Probe Response producers and test serializer rejection of default-zero and out-of-range intervals.

Validation: debug build, three focused unit tests, scoped architecture checks, and diff whitespace checks passed.

Clear the unmodeled QoS Control bit 4. Only serialized packet bytes change at this boundary; the selected tplx and ~tNl trajectories remain identical. The independent QoS octet expectations cover the corrected zero bit.

Include 18 causally changed legacy fingerprint rows in this commit. Preserve graphical tyf expectations. The complete selected before/after results are recorded in ai-logs/executions/2026-09-11_ci-fingerprints.md.
@mgonzalezlopezudc
mgonzalezlopezudc force-pushed the fix/ieee80211-wire-and-receive-correctness branch from af71600 to b0ae379 Compare September 11, 2026 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant