ieee80211: correct Block Ack and aggregation frame representations - #1188
Open
mgonzalezlopezudc wants to merge 4 commits into
Open
ieee80211: correct Block Ack and aggregation frame representations#1188mgonzalezlopezudc wants to merge 4 commits into
mgonzalezlopezudc wants to merge 4 commits into
Conversation
mgonzalezlopezudc
force-pushed
the
fix-ieee80211-wire-and-amsdu
branch
from
September 11, 2026 05:33
ac44838 to
33e402e
Compare
ADDBA and DELBA parameter sets used MSB-first bit packing and big-endian numeric fields, so symmetric round trips concealed incorrect wire bytes. Use the little-endian layouts in IEEE Std 802.11-2024 9.4.1.13-16 and 9.6.4.2-4, including the zero fragment number in ADDBA requests. Retain DELBA's common Action fields when decoding and exclude the FCS, which is carried separately, from its declared header length. Independent golden-octet tests cover both directions and parameter boundaries. The corrected Action bytes change MacQosWithBlockAck run 0's serialized data fingerprint from 7147-4f5b to ade8-e6a9 (~tND). Event and length fingerprints remain unchanged; carry that expectation with this fix. Also carry the five data-fingerprint expectations affected by this encoding correction: blockack NoFragmentation, Fragmentation and MixedTraffic run 0, fragmentation HCFfragblockack run 0, and adhoc qos MacQos run 1. Reversing only the serializer correction recovers all five prior values; event and length fingerprints are unchanged.
HT delimiters placed the MPDU length in the wrong bit positions and lost its high bits during decoding. Encode all 12 length bits in B4-B15 as specified by IEEE Std 802.11-2024 9.7.1, and reject lengths that cannot be represented in that field. The delimiter previously carried a zero CRC and accepted any CRC or signature. Compute the CRC defined by 9.7.2 and mark corrupt delimiters incorrect. Independent golden bytes exercise boundary lengths and each corrupt delimiter octet, avoiding symmetric round-trip false positives.
Beacon and Probe Response decoding fed the TSF field into a SimTime raw tick value even though the model does not retain that timestamp. TSF is an unsigned microsecond counter under IEEE Std 802.11-2024 9.4.1.10 and 11.1.3.1, not a simulation-resolution tick count. Consume the eight wire octets without constructing an unused SimTime. Exercise both management frames with ordinary and full-range uint64 TSF bytes, checking that the following fields remain intact.
A-MSDU construction omitted the transmitter address used for the ACK recipient and left the outer BSSID fields zero. Populate the common TA and the Basic A-MSDU BSSID fields according to IEEE Std 802.11-2024 9.3.2.1.2, Table 9-60. The modeled AP-to-AP case uses the transmitting AP address for the BSSID. Account for Address4 in aggregation and deaggregation header lengths. Exercise all four DS combinations with independent outer-address bytes, ACK-target checks, header serialization and payload/address restoration. Corrected serialized headers change the following examples/wireless/qos run 0 ~tND expectations; event and length fingerprints remain unchanged: MacQos: 540d-c0a4 -> 9839-8fb0 MacQosWithRtsCts: 8fe3-d7a6 -> 4757-c17b MacQosWithBlockAck: ade8-e6a9 -> 6541-bd60 Also carry wireless qos showcase Qos run 0's data fingerprint, changing 10fc-7bb0 to 1f84-a860 (~tND). Reversing only this A-MSDU correction recovers the prior value; event and length fingerprints are unchanged.
mgonzalezlopezudc
force-pushed
the
fix-ieee80211-wire-and-amsdu
branch
from
September 11, 2026 09:31
a5ffcd5 to
24e213e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
IEEE 802.11 Block Ack Action Wire Formatting, Delimiter CRC, Management Timestamps & A-MSDU Address Fixes
Topic and Rationale
This pull request corrects multiple standards-compliance defects in IEEE 802.11 frame wire serialization, aggregation, and management timestamp processing across a four-commit series:
ADDBA and DELBA parameter sets used MSB-first bit packing and big-endian numeric fields in
Ieee80211MacHeaderSerializer.cc, causing symmetric round-trips to conceal incorrect on-wire byte layouts. This fix aligns bit and byte fields with little-endian wire layouts, ensures a zero fragment number in ADDBA requests, preserves common Action fields when decoding DELBA frames, and adjustsIeee80211Delbachunk length to exclude the FCS (LENGTH_DELBA - B(4)), which is carried separately byIeee80211MacTrailer.PR-SPLIT-BASELINE): The corrected wire bytes shift serialized data (~tND) fingerprints across 6 simulations inexamples/andshowcases/. PerPR-SPLIT-BASELINE, all 6 updated expectations travel directly within this commit alongside independent golden-octet unit tests. Event (tplx) and length (~tNl) fingerprints remain strictly unchanged.HT MPDU delimiters previously placed the MPDU length in the wrong bit positions and lost high bits during decoding. Length is now correctly packed in bits B4–B15 of the 16-bit delimiter prefix, with out-of-range lengths (
!= 0x4E) are marked incorrect (markIncorrect()).Beacon and Probe Response deserialization passed raw wire bytes into
SimTime::setRaw(), which converts from simulation-resolution ticks and could overflowSimTimerange on large counter values. Because the model does not retain the TSF timestamp, the 8 wire octets are consumed directly without constructing an unusedSimTime.Basic A-MSDU aggregate frame construction omitted the Transmitter Address (TA) and left BSSID fields zero, preventing recipients from correctly deriving the ACK target address. This fix populates TA and BSSID per Table 9-60 (using transmitting AP address for AP-to-AP) and accounts for the optional 6-byte Address4 field in both aggregation and deaggregation header length accounting (26-byte vs 32-byte QoS data header).
PR-SPLIT-BASELINE): Outer QoS data headers encapsulating A-MSDUs now carry valid TA and BSSID fields rather than zero-filled addresses, altering the serialized bytes inexamples/wireless/qos(MacQos,MacQosWithRtsCts, andMacQosWithBlockAckrun 0) andshowcases/wireless/qos(Qosrun 0). PerPR-SPLIT-BASELINE, these 4 updated~tNDexpectations travel directly within this commit. Event (tplx) and length (~tNl) fingerprints remain strictly identical, and non-aggregated QoS transmissions (MacQosWithoutAggregation) remain unchanged.Reading Order
This series is ordered with prerequisites first so each commit compiles and passes all applicable tests independently (
PR-SERIES-BUILDS,PR-SERIES-ORDER,PR-SPLIT-BASELINE):ba81fd177b—ieee80211: correct Block Ack action wire encoding~tND) baseline updates.src/inet/linklayer/ieee80211/mac/Ieee80211Frame.msgsrc/inet/linklayer/ieee80211/mac/Ieee80211MacHeaderSerializer.cctests/fingerprint/examples.csvtests/fingerprint/showcases.csvtests/unit/Ieee80211BlockAckActionWire_1.testIeee80211BlockAckActionWire_1.testPASS; carries the 6 serialized-data (~tND) baseline updates shifted by Block Ack action wire layout changes (MacQosWithBlockAckrun 0,MacQosrun 1,NoFragmentation,Fragmentation,MixedTrafficrun 0, andHCFfragblockackrun 0). Event and length fingerprints remain unchanged.f4e70386a3—ieee80211: correct HT MPDU delimiter wire encoding0x4E), and marks corrupted delimiters incorrect.src/inet/linklayer/ieee80211/mac/Ieee80211MacHeaderSerializer.cctests/unit/Ieee80211MpduDelimiterWire_1.testIeee80211MpduDelimiterWire_1.testPASS; no baseline change.62f78e31eb—ieee80211: consume management timestamps as unsigned valuesSimTime, avoiding simulation-resolution integer overflow on large counter values.src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtFrameSerializer.cctests/unit/Ieee80211MgmtFrameSerializer_1.testIeee80211MgmtFrameSerializer_1.testPASS; no baseline change.24e213e473—ieee80211: preserve A-MSDU header addresses and lengths~tND) baseline updates.src/inet/linklayer/ieee80211/mac/aggregation/MsduAggregation.ccsrc/inet/linklayer/ieee80211/mac/aggregation/MsduDeaggregation.cctests/fingerprint/examples.csvtests/fingerprint/showcases.csvtests/unit/Ieee80211MsduAggregation_1.testIeee80211MsduAggregation_1.testPASS; updates~tNDexpectations forMacQos,MacQosWithRtsCts, andMacQosWithBlockAckrun 0 inexamples/wireless/qos, as well asQosrun 0 inshowcases/wireless/qos. Event and length fingerprints remain unchanged.Architectural Surface
src/inet/linklayer/ieee80211/mac/Ieee80211MacHeaderSerializer.ccsrc/inet/linklayer/ieee80211/mac/aggregation/MsduAggregation.ccsrc/inet/linklayer/ieee80211/mac/aggregation/MsduDeaggregation.ccsrc/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtFrameSerializer.ccsrc/inet/linklayer/ieee80211/mac/Ieee80211Frame.msgIeee80211MacHeaderSerializer,Ieee80211MpduSubframeHeaderSerializer,Ieee80211MgmtFrameSerializer), MSDU aggregation/deaggregation (MsduAggregation,MsduDeaggregation).Ieee80211Delbachunk length adjusted toLENGTH_DELBA - B(4)(FCS is represented separately byIeee80211MacTrailer).Ieee80211AddbaRequest,Ieee80211AddbaResponse,Ieee80211Delba, andIeee80211MpduSubframeHeader.src/inet/are unsealed (doc/project/enforcement/check-source-seals.shPASS). No architectural deviations (AV-*) or naming deviations (NV-*) introduced.Baselines
The baseline movements are documented per
TR-BASELINE-PROVENANCE/PR-REQ-STORYand travel directly within the commit causing them perPR-SPLIT-BASELINE:1. In Commit
ba81fd177b(tests/fingerprint/examples.csv:R10,R661,tests/fingerprint/showcases.csv:R202-204,R270)examples/wireless/qosMacQosWithBlockAckrun 0 (line 661):~tND):7147-4f5b->ade8-e6a9.tplx:d094-b008) and length (~tNl:173a-e3fb) fingerprints remain identical.examples/adhoc/qosMacQosrun 1 (line 10):~tND):5aaf-cc7c->a50d-9ad8.tplx:783f-d09a) and length (~tNl:13d1-ec15) fingerprints remain identical.showcases/wireless/blockackNoFragmentationrun 0 (line 202):~tND):1470-1e1b->8b71-c964.tplx:aa2d-5d35) and length (~tNl:2094-1f2a) fingerprints remain identical.showcases/wireless/blockackFragmentationrun 0 (line 203):~tND):9c41-dc97->9b1c-22eb.tplx:7ae9-e07d) and length (~tNl:db8b-3b81) fingerprints remain identical.showcases/wireless/blockackMixedTrafficrun 0 (line 204):~tND):62c4-cbc2->153d-3bdf.tplx:462d-10c7) and length (~tNl:727b-d26a) fingerprints remain identical.showcases/wireless/fragmentationHCFfragblockackrun 0 (line 270):~tND):9a04-4420->f819-daf7.tplx:0702-c692) and length (~tNl:1bf9-b035) fingerprints remain identical.Reversing only the serializer correction recovers all six prior values; event and length fingerprints are unchanged.
2. In Commit
24e213e473(tests/fingerprint/examples.csv:R658,R660,R661,tests/fingerprint/showcases.csv:R317)examples/wireless/qosMacQosrun 0 (line 658):~tND):540d-c0a4->9839-8fb0.MacQosconfiguresBasicMsduAggregationPolicy. Outer QoS data frame headers encapsulating A-MSDUs now carry the transmitter address (TA) and BSSID rather than zero-filled addresses, altering the serialized bytes in the data stream.tplx:31b0-6212) and length (~tNl:82ec-9fde) fingerprints are unchanged.examples/wireless/qosMacQosWithRtsCtsrun 0 (line 660):~tND):8fe3-d7a6->4757-c17b.MacQoswithrtsThreshold = 100B. A-MSDU frames transmitted under RTS/CTS now carry valid TA and BSSID header fields.tplx:9ece-fbfb) and length (~tNl:c1af-29ff) fingerprints are unchanged.examples/wireless/qosMacQosWithBlockAckrun 0 (line 661):~tND):ade8-e6a9->6541-bd60.MacQoswith Block Ack enabled. Demonstrates sequential evolution across the series: master (7147-4f5b) -> commit 1ba81fd177b(ade8-e6a9, due to Block Ack action frame layout) -> commit 424e213e473(6541-bd60, due to A-MSDU outer header address population). Both intermediate and final trees pass their tests independently (PR-SERIES-BUILDS).tplx:d094-b008) and length (~tNl:173a-e3fb) fingerprints are unchanged.examples/wireless/qosMacQosWithoutAggregationrun 0 (line 659) — Negative control:~tND): Unchanged at75d4-11f9. Confirms that non-aggregated QoS transmissions are unaffected.showcases/wireless/qosQosrun 0 (line 317):~tND):10fc-7bb0->1f84-a860.tplx:1a49-72b3) and length (~tNl:e605-d79d) fingerprints are unchanged.Reversing only this A-MSDU correction recovers the prior values; event and length fingerprints are unchanged.
Verification Evidence
make -j$(nproc) MODE=debug: PASS (libINET_dbg.so).make -j$(nproc) MODE=release: PASS (libINET.so).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 (clean architecture).doc/project/enforcement/check-naming.sh --base upstream/master: PASS for changed declarations in branch (0 naming candidates in changed files).doc/project/enforcement/check-commits.sh upstream/master..HEAD: 4 linear commits onupstream/master.inet_run_unit_tests -m debug -f 'Ieee80211(BlockAckActionWire|MgmtFrameSerializer|MpduDelimiterWire|MsduAggregation|OnWireBitCompliance).*': PASS (5 passed in 14.842s).Ieee80211BlockAckActionWire_1.test: PASSIeee80211MpduDelimiterWire_1.test: PASSIeee80211MgmtFrameSerializer_1.test: PASSIeee80211MsduAggregation_1.test: PASSIeee80211OnWireBitCompliance_1.test: PASStests/fingerprint/examples.csv&tests/fingerprint/showcases.csv):tests/fingerprint/fingerprinttest -d -F tyf tests/fingerprint/examples.csv -m '^/examples/wireless/qos/.*-c MacQos ': PASS (9839-8fb0/~tND).tests/fingerprint/fingerprinttest -d -F tyf tests/fingerprint/examples.csv -m '^/examples/wireless/qos/.*-c MacQosWithRtsCts ': PASS (4757-c17b/~tND).tests/fingerprint/fingerprinttest -d -F tyf tests/fingerprint/examples.csv -m '^/examples/wireless/qos/.*-c MacQosWithBlockAck ': PASS (6541-bd60/~tND).tests/fingerprint/fingerprinttest -d -F tyf tests/fingerprint/examples.csv -m '^/examples/wireless/qos/.*-c MacQosWithoutAggregation ': PASS (75d4-11f9/~tND, unchanged control).tests/fingerprint/fingerprinttest -d -F tyf tests/fingerprint/examples.csv -m '^/examples/adhoc/qos/.*-c MacQos -r 1': PASS (a50d-9ad8/~tND).tests/fingerprint/fingerprinttest -d -F tyf tests/fingerprint/showcases.csv -m '^/showcases/wireless/blockack/.*': PASS (NoFragmentation:8b71-c964/~tND,Fragmentation:9b1c-22eb/~tND,MixedTraffic:153d-3bdf/~tND).tests/fingerprint/fingerprinttest -d -F tyf tests/fingerprint/showcases.csv -m '^/showcases/wireless/fragmentation/.*-c HCFfragblockack': PASS (f819-daf7/~tND).tests/fingerprint/fingerprinttest -d -F tyf tests/fingerprint/showcases.csv -m '^/showcases/wireless/qos/.*-c Qos': PASS (1f84-a860/~tND).