ieee80211: correct Block Ack and aggregation frame representations - #1188
Open
mgonzalezlopezudc wants to merge 5 commits into
Open
ieee80211: correct Block Ack and aggregation frame representations#1188mgonzalezlopezudc wants to merge 5 commits into
mgonzalezlopezudc wants to merge 5 commits into
Conversation
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.
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
mgonzalezlopezudc
force-pushed
the
fix-ieee80211-wire-and-amsdu
branch
from
September 11, 2026 05:33
ac44838 to
33e402e
Compare
Six data fingerprints still expected bytes from before two IEEE 802.11 corrections, causing CI failures despite unchanged event and length hashes. The Block Ack action encoding fix in 2dab9fc changes ADDBA and DELBA parameter packing and byte order. It accounts for blockack showcase NoFragmentation, Fragmentation and MixedTraffic run 0, fragmentation HCFfragblockack run 0, and adhoc qos MacQos run 1. The A-MSDU header fix in 33e402e preserves transmitter and BSSID addresses. It accounts for wireless qos showcase Qos run 0. Reversing each correction in isolation recovers the corresponding old fingerprints. The Block Ack golden-octet and A-MSDU aggregation unit tests pass with the corrected source. Record only the six approved ~tND values; all other CSV fields remain unchanged. Validation: all six affected fingerprint cases pass in debug mode with tplx, ~tNl and ~tND. git diff --check passes.
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 five-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.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).
examples/wireless/qos/omnetpp.ini,MacQosenables MSDU aggregation (BasicMsduAggregationPolicy). BecauseMacQosWithRtsCtsandMacQosWithBlockAckinherit fromMacQos, all three configurations transmit aggregated QoS data frames whose serialized headers now carry the populated transmitter and BSSID addresses rather than all zeros. Consequently, the serialized-data (~tND) fingerprints of all three configurations move, while event (tplx) and length (~tNl) fingerprints remain identical. The negative-control configurationMacQosWithoutAggregationexplicitly disables aggregation (msduAggregationPolicy.typename = "") and is unaffected.tests/fingerprint/):Records the six data fingerprints (
~tND) shifted by the Block Ack action encoding (commit2dab9fc11f) and A-MSDU header population (commit33e402e68e) acrosstests/fingerprint/examples.csvandtests/fingerprint/showcases.csv. Reversing each fix in isolation confirms exact recovery of previous fingerprints. All event (tplx) and length (~tNl) hashes remain strictly identical.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):2dab9fc11f—ieee80211: correct Block Ack action wire encodingMacQosWithBlockAckrun 0 serialized-data baseline update.src/inet/linklayer/ieee80211/mac/Ieee80211Frame.msgsrc/inet/linklayer/ieee80211/mac/Ieee80211MacHeaderSerializer.cctests/fingerprint/examples.csvtests/unit/Ieee80211BlockAckActionWire_1.testIeee80211BlockAckActionWire_1.testPASS;MacQosWithBlockAckrun 0~tNDupdated (7147-4f5b->ade8-e6a9).fe1f8dca4a—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.1601c2b2c4—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.33e402e68e—ieee80211: preserve A-MSDU header addresses and lengthssrc/inet/linklayer/ieee80211/mac/aggregation/MsduAggregation.ccsrc/inet/linklayer/ieee80211/mac/aggregation/MsduDeaggregation.cctests/fingerprint/examples.csvtests/unit/Ieee80211MsduAggregation_1.testIeee80211MsduAggregation_1.testPASS;examples/wireless/qosrun 0~tNDexpectations updated for all three configurations using A-MSDU (MacQos:540d-c0a4->9839-8fb0,MacQosWithRtsCts:8fe3-d7a6->4757-c17b,MacQosWithBlockAck:ade8-e6a9->6541-bd60). Event and length fingerprints remain unchanged.a5ffcd51ae—tests: record missing fingerprints for IEEE 802.11 wire fixes~tND) expectations across showcase and ad-hoc wireless examples shifted by earlier wire fixes in commits2dab9fc11fand33e402e68e.tests/fingerprint/examples.csvtests/fingerprint/showcases.csv~tNDexpectations across 5 simulation suites:examples/adhoc/qos(MacQosrun 1),showcases/wireless/blockack(NoFragmentation,Fragmentation,MixedTrafficrun 0),showcases/wireless/fragmentation(HCFfragblockackrun 0), andshowcases/wireless/qos(Qosrun 0). All event (tplx) and length (~tNl) hashes remain identical.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-STORY:1. In Commit
2dab9fc11f(tests/fingerprint/examples.csv:R661)MacQosWithBlockAckrun 0 (line 661):~tND):7147-4f5b->ade8-e6a9.tplx:d094-b008) and length (~tNl:173a-e3fb) fingerprints remain identical.2. In Commit
33e402e68e(tests/fingerprint/examples.csv:R658-661)MacQosrun 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.MacQosWithRtsCtsrun 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.MacQosWithBlockAckrun 0 (line 661):~tND):ade8-e6a9->6541-bd60.MacQoswith Block Ack enabled. A-MSDU frames transmitted under Block Ack agreements now carry valid TA and BSSID header fields.tplx:d094-b008) and length (~tNl:173a-e3fb) fingerprints are unchanged.MacQosWithoutAggregationrun 0 (line 659):~tND): Unchanged at75d4-11f9. Confirms that non-aggregated QoS transmissions are unaffected.3. In Commit
a5ffcd51ae(tests/fingerprint/examples.csv:R10,tests/fingerprint/showcases.csv:R202-204,R270,R317)2dab9fc11f):examples/adhoc/qosMacQosrun 1 (line 10):~tND5aaf-cc7c->a50d-9ad8(tplx:783f-d09a,~tNl:13d1-ec15unchanged).showcases/wireless/blockackNoFragmentationrun 0 (line 202):~tND1470-1e1b->8b71-c964(tplx:aa2d-5d35,~tNl:2094-1f2aunchanged).showcases/wireless/blockackFragmentationrun 0 (line 203):~tND9c41-dc97->9b1c-22eb(tplx:7ae9-e07d,~tNl:db8b-3b81unchanged).showcases/wireless/blockackMixedTrafficrun 0 (line 204):~tND62c4-cbc2->153d-3bdf(tplx:462d-10c7,~tNl:727b-d26aunchanged).showcases/wireless/fragmentationHCFfragblockackrun 0 (line 270):~tND9a04-4420->f819-daf7(tplx:0702-c692,~tNl:1bf9-b035unchanged).33e402e68e):showcases/wireless/qosQosrun 0 (line 317):~tND10fc-7bb0->1f84-a860(tplx:1a49-72b3,~tNl:e605-d79dunchanged).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: 5 linear commits onupstream/master.inet_run_unit_tests -m debug -f 'Ieee80211(BlockAckActionWire|MgmtFrameSerializer|MpduDelimiterWire|MsduAggregation|OnWireBitCompliance).*': PASS (5 passed in 2.755s).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).