Skip to content

Add HT compressed Block Ack support - #1128

Open
mgonzalezlopezudc wants to merge 8 commits into
inet-framework:masterfrom
mgonzalezlopezudc:feat-ht-compressedblockack
Open

Add HT compressed Block Ack support#1128
mgonzalezlopezudc wants to merge 8 commits into
inet-framework:masterfrom
mgonzalezlopezudc:feat-ht-compressedblockack

Conversation

@mgonzalezlopezudc

Copy link
Copy Markdown
Contributor

Summary

This PR adds one-TID HT Compressed Block Ack support to the IEEE 802.11 QoS MAC while retaining Basic Block Ack as the default behavior.

It implements the complete originator and recipient exchange path, corrects the on-wire BAR/BA representation, adds deterministic unit and runtime coverage, and updates the affected wireless fingerprints after explaining their first trajectory divergence.

Motivation

The existing QoS MAC contained partial Compressed Block Ack scaffolding, but the feature could not be used end to end:

  • the originator's compressed BAR builder was unsupported and compressed selection was hardcoded off;
  • HCF and recipient dispatch handled only Basic Block Ack variants;
  • the recipient could not construct the required one-TID 64-bit compressed bitmap or null response;
  • accepted immediate/delayed ADDBA policy was not retained consistently;
  • BAR/BA Control and Starting Sequence Control serialization did not match the wire layout;
  • the Basic BAR chunk length was 38 bytes before FCS instead of the standard 20-byte MAC header.

The implementation follows IEEE Std 802.11-2024 sections 9.3.1.7.2, 9.3.1.8.2, 10.25.6.1, and 10.25.6.5, together with the HT-immediate constraints in Table 11-8.

Changes

Wire representation

  • Correct the Basic and Compressed BAR chunk length to 20 bytes before FCS.
  • Add the 28-byte pre-FCS Compressed Block Ack representation.
  • Serialize and deserialize BAR/BA Control as little-endian fields.
  • Pack and unpack Starting Sequence Control as a 12-bit sequence number and 4-bit fragment number.
  • Preserve byte-exact Basic Block Ack serialization coverage.

MAC exchange

  • Build and select Ieee80211CompressedBlockAckReq for eligible one-TID immediate agreements.
  • Dispatch compressed BAR and BA frames through HCF, frame sequences, rate selection, protection timing, reordering, and originator acknowledgment processing.
  • Generate the non-HE 64-bit compressed bitmap at the recipient.
  • Return the mandatory all-zero compressed Block Ack when no matching recipient partial state exists.
  • Retain the accepted immediate/delayed ADDBA response policy on both sides.
  • Reject compressed exchanges for delayed agreements, nonzero fragment numbers, fragmented MPDUs, and More Fragments frames.
  • Track the recipient's maintained acknowledgment range so missing leading MPDUs remain unacknowledged, including across the 4095-to-0 sequence wrap.

Capability model

Compressed selection is default-off behind assumePeerSupportsCompressedBlockAck on both endpoint policies. The parameter explicitly represents the peer-capability fact missing from the current baseline agreement/management model and must only be enabled on an HT-or-later local STA after peer support is established.

This is station-wide rather than per-peer capability state, so heterogeneous legacy/HT peer selection is not modeled by this PR. The default configuration and existing Basic Block Ack behavior remain unchanged apart from the corrected Basic BAR wire size.

Tests and fingerprints

  • Add byte-exact compressed BAR and BA serializer round-trip tests.
  • Cover null and empty recipient state, bitmap holes, leading holes, 4095-to-0 wraparound, agreement policy, capability assumptions, and fragmentation gates.
  • Add a deterministic HT module test for ADDBA, compressed BAR transmission, and compressed BA reception.
  • Update seven affected wireless fingerprint rows. The first divergence is the same Basic BAR transmission changing from the previous 42-byte MPDU to the correct 24-byte MPDU, shortening PHY airtime by 4 microseconds and shifting subsequent timing ingredients. Existing graphical tyf ingredients are preserved where the focused campaign excludes them.

Validation

  • make MODE=release -j$(nproc)
  • inet_run_unit_tests -m release -f '(Ieee80211CompressedBlockAck_1|Ieee80211OnWireBitCompliance_1)\.test' — 2/2 passed
  • inet_run_module_tests -m release -f 'Ieee80211CompressedBlockAckRuntime\.test' — passed
  • Focused debug fingerprint campaign with -F tyf — all seven affected rows passed
  • Direct HT runtime, run 0/seed 0 — 36 compressed BAR/BA exchanges; the first response starts after the modeled SIFS interval
  • git diff --check — passed

Scope

This PR intentionally excludes TXOP behavior changes, HT Greenfield support, HE/EHT or multi-user Block Ack variants, and broader peer-capability management.

Commits

  • 4b34eeec14feat(ieee80211): add HT compressed Block Ack
  • 84916eb164test(fingerprint): update Block Ack trajectories

Implement one-TID compressed BlockAckReq and 64-bit compressed BlockAck exchanges across the QoS MAC path.

Correct BAR and BA Control and Starting Sequence Control serialization, including the Basic BAR wire length, little-endian fields, fragment-number packing, and compressed frame lengths.

Extend originator and recipient agreement handling, HCF dispatch, frame sequences, rate selection, protection timing, reordering, and acknowledgment processing. Preserve immediate versus delayed ADDBA policy and return the required all-zero compressed Block Ack when no matching recipient state exists.

Keep selection default-off behind the documented assumePeerSupportsCompressedBlockAck model assumption. Reject fragmented and delayed-policy exchanges, maintain the recipient acknowledgment-window boundary, and preserve leading holes including sequence-number wraparound.

Add byte-exact unit coverage for Basic and compressed variants, bitmap and wraparound behavior, capability and agreement gates, plus a deterministic HT runtime exchange test.
Update the affected QoS, Block Ack, fragmentation, and TXOP fingerprints after correcting the Basic BlockAckReq wire size from 42 bytes to 24 bytes.

The first changed event is the same BAR transmission with the corrected frame length. Its shorter airtime shifts subsequent packet and timing ingredients while preserving the Block Ack exchange and SIFS response.

Cover the QoS Block Ack example, all three Block Ack showcase configurations, HCF fragmentation with Block Ack, the TXOP showcase, and the Block Ack-enabled ad hoc QoS run. Preserve existing graphical tyf ingredients, which are excluded from the focused campaign.

The focused debug fingerprint campaign passes all six newly identified rows with tyf excluded; the previously updated QoS Block Ack row also passes its focused release check.
@mgonzalezlopezudc
mgonzalezlopezudc marked this pull request as ready for review August 15, 2026 19:19

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 1 additional finding in Devin Review.

Open in Devin Review

Comment thread src/inet/linklayer/ieee80211/mac/rateselection/QosRateSelection.cc
Classify BlockAck and BlockAckReq frames through their base classes in QosRateSelection so compressed requests follow the same control-rate policy as Basic requests.

This prevents an originated Compressed BlockAckReq from falling through to the ordinary control-frame path and reusing the last transmitted data mode when the mandatory Block Ack fallback should be selected.

Add focused coverage with distinct mandatory and last-transmitted modes, verifying Basic and Compressed BAR symmetry while preserving RTS behavior.
Remove the recipient-side peer capability assumption from compressed Block Ack response selection. An addressed, syntactically valid one-TID compressed BlockAckReq must receive a compressed BlockAck after SIFS, including the all-zero response when no matching partial state exists, as required by IEEE 802.11-2024 sections 9.3.1.7.2 and 10.25.6.5.

Keep the originator-side capability assumption as the explicit opt-in for selecting compressed BlockAckReq frames until per-peer HT capability management is modeled. Continue rejecting nonzero fragment numbers and suppressing immediate responses for unaccepted or delayed agreements.

Update the focused unit and runtime coverage to verify null-state responses, malformed fragment rejection, agreement-policy gates, and asymmetric endpoint configuration.
Make BlockAckRecord the authoritative owner of WinStartR and update the scoreboard for every successfully received related Data MPDU. Advance it from newer Data frames and BlockAckReq starting sequence numbers instead of coupling acknowledgment state to upward packet delivery.

Fix empty Basic Block Ack records so current-window sequence and fragment entries are reported as unacknowledged while entries older than WinStartR remain acknowledged.

Keep the reordering window independent from the acknowledgment window. When a future MPDU or BAR advances the window, deliver complete displaced MSDUs, discard incomplete stale entries, retain packets beyond gaps, and preserve cyclic delivery order across the 4095-to-0 boundary. Detach returned packets before deleting stale receive-buffer state.

Replace the station-wide compressed Block Ack assumption with capability state stored per agreement. Derive it from explicit local support and a configured peer-address list until HT Capabilities elements are modeled. Use compressed BAR only for established immediate agreements that support it, and suppress compressed Block Ack responses when no agreement exists.

Add focused unit and runtime coverage for Basic and Compressed bitmaps, Data- and BAR-driven window movement, wraparound, gaps, fragments, duplicates, ownership, Normal Ack reception, capability gating, null responses, serialization, and the BAR-to-BA exchange.

Multi-TID Block Ack remains unsupported. BA Control bit 0 remains clear because it is reserved by IEEE 802.11-2024, rather than a BA Ack Policy bit.

Fingerprint validation found five expected maintained-ingredient changes in QoS and Block Ack scenarios. The three previously retained tyf values were also rechecked and found stale. Fingerprint CSV updates are intentionally not included pending separate approval.
@mgonzalezlopezudc
mgonzalezlopezudc force-pushed the feat-ht-compressedblockack branch from bd343f0 to 89030d8 Compare August 16, 2026 10:59
Update the Block Ack scoreboard for every related received QoS Data MPDU, including frames using Normal Ack, independently of reorder-buffer admission.

Handle the receive-window cases explicitly: ignore old sequence numbers, record in-window MPDUs, and advance WinStartR before recording MPDUs beyond WinEndR. This behavior deliberately applies to both Basic and Compressed Block Ack agreements, as required by IEEE 802.11-2024 sections 10.25.6.3 and 10.25.6.4.

Make far-ahead reorder-window movement transactional. Validate and insert the incoming MPDU against the proposed WinStartB before releasing displaced MSDUs or changing NextExpectedSequenceNumber. If admission fails, discard only the incoming packet and preserve the reorder window and its buffered frames, while retaining the independently required scoreboard update.

Calculate receive-buffer capacity after accounting for entries displaced by the proposed window. Count each fragment as one buffer slot, allow an advancing MPDU to reuse slots that will be reclaimed, and remove incomplete stale entries only after successful admission. Preserve delivery of complete displaced and consecutive MSDUs, including across the 4095-to-0 sequence number boundary.

Centralize supported one-TID BlockAckReq classification and extraction of the variant, TID, and starting sequence number. Use the shared classifier in HCF, RecipientQosMacDataService, and BlockAckReordering so only Basic and Compressed requests reach the implemented paths. Multi-TID requests remain unsupported and follow the existing rejection behavior.

Extend the focused Block Ack tests to cover old scoreboard inputs, Normal-Ack behavior with Basic Block Ack, fragment-full admission failure, successful slot reclamation across sequence wrap, real HCF dispatch through a procedure spy, and consistent Basic, Compressed, and Multi-TID request classification.
Accept WinStartR in the receiver Block Ack bookkeeping and add focused Basic and Compressed Block Ack coverage for the boundary.
Refresh five maintained non-tyf fingerprint expectations for the Block Ack and QoS scenarios affected by the current IEEE 802.11 MAC behavior changes.

Updated cases include BlockAck showcase NoFragmentation and MixedTraffic, fragmentation HCFfragblockack, adhoc QoS MacQos run 1, and wireless QoS MacQosWithBlockAck.

Focused debug validation passed all 17 selected tests with tplx, ~tNl, and ~tND. The full suite was intentionally skipped after the focused validation.
@mgonzalezlopezudc

Copy link
Copy Markdown
Contributor Author

@levy I've addressed all Devin's comments throughout the commits. There are only two for which I didn't perform any changes:

  • Runtime configuration: Devin missed the included setting at examples/wireless/qos/omnetpp.ini (line 24), which pins the AP to 10:00:00:00:00:00. The client peer lists are therefore correct.

  • Map → vector: uniqueness and cyclic order remain guaranteed by construction. ReceiveBuffer is still map-backed; the collectors probe each cyclic sequence number once; preceding excludes the SSN while following starts at it. Existing tests cover 4095 → 0 ordering and duplicate input.

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