Skip to content

Fix Basic Block Ack TXOP continuation admission - #1483

Open
mgonzalezlopezudc wants to merge 7 commits into
inet-framework:masterfrom
mgonzalezlopezudc:fix/ieee80211-basic-txop-admission
Open

mgonzalezlopezudc wants to merge 7 commits into
inet-framework:masterfrom
mgonzalezlopezudc:fix/ieee80211-basic-txop-admission

Conversation

@mgonzalezlopezudc

Copy link
Copy Markdown
Contributor

With Basic Block Ack enabled, HCF can start another exchange even when the DATA and its protection or response cannot fit within the transmission opportunity (TXOP). It can also transmit DATA after a Basic Block Ack has used up the reservation (TXNAV).

HCF now checks the complete next exchange against TXNAV and the TXOP deadline before submitting its first frame. For RTS-protected exchanges, HCF keeps the selected DATA rate through CTS and checks the airtime again before submitting DATA. An exchange that needs more airtime waits for another EDCA grant. This implements BD-27, using IEEE Std 802.11-2024, clauses 10.23.2.8 and 10.23.2.9, for the admission rules.

flowchart LR
    A["Previous exchange completes"] --> B{"Exchange shorter than TXNAV and fits TXOP?"}
    B -->|Yes| C["Transmit in the current TXOP"]
    B -->|No| D["End the TXOP and contend again"]
Loading

Dependency

Merge #1481 before BD-27. The branch starts at the exact head of #1481, which already includes #1479 and #1478. GitHub shows the dependency commits in the upstream comparison while those PRs are open. Review the single BD-27 commit.

Commit Purpose
d1df4ce3c3 Preserve missing fragment bits in Basic Block Ack feedback.
eb78d7d26e Report retries discarded by the receive window.
ac23035ea9 Count Normal Ack retries when Basic support is enabled.
1d5c996351 Classify late Compressed retries using prior receipts.
7c18108ad4 Give LAN mobility its own random stream.
8c1945c468 End the advertised reservation at the last group frame.
8f856df884 Budget the selected unicast continuation at the transmit boundary.

Evidence

WifiBasicTxopAdmission uses real Basic Block Ack agreement setup and traffic between non-HT peers at fixed rates. On #1481, three scenarios admit DATA projected to finish 86–150 µs after the TXOP limit. The fourth admits an RTS-protected exchange whose airtime exceeds TXNAV. All four pass in debug and release with the fix. The regression checks positive TXOP limits.

The group Duration/ID, missing Basic DATA and Compressed Block Ack protocol controls pass in both modes. Five focused module tests pass in debug. Test setup, results, and first differing exchanges.

The upstream series audit passes. Repository-wide architecture, naming, and interface checks report identical findings on #1481 and this branch.

Commands
source .envrc
make MODE=debug -j8
make MODE=release -j8

for mode in debug release; do
  opp_run_protocol_tests --load . -p inet -m "$mode" --no-build \
    -w '^tests/protocol/wifi$' \
    -f '(WifiBasicTxopAdmission|WifiSingleProtectionGroupDuration|WifiBasicBlockAckMissingData|N_CompressedBa)\.test$'
done
opp_run_module_tests --load . -p inet -m debug --no-build \
  -f '(Ieee80211HcfSingleProtection_1|Ieee80211HcfMultipleProtection_[12]|Ieee80211CompressedBlockAckAdmission_1|Ieee80211BlockAckAdmission_1)\.test$'
opp_run_fingerprint_tests --load . -p inet -m release --no-build \
  -w '^(showcases/wireless/(fragmentation|blockack|txop)|examples/(wireless|adhoc)/qos)$' \
  -c '^(HCFfragblockack|OnlyPacketSizeHCFfragblockack|PacketSizeHCFfragblockack|ThresholdHCFfragblockack|TxPowerHCFfragblockack|MacQosWithBlockAck|Fragmentation|MacQos|General)$' -r '^0$'

Baseline changes

BD-27 changes five run-0 fingerprint cases (15 stored values) because a DATA continuation after a Basic Block Ack with zero Duration/ID now waits for a fresh grant. Seven selected cases match. The five stored cases pass on #1481 in a matched release replay. The baseline refresh awaits approval.

The upstream comparison also includes these baseline updates from the dependencies.

A Basic Block Ack tells the sender which fragments it can remove from its retry queue. If the first DATA frame is lost, an empty receipt record used to produce a 1 for the missing fragment. WifiBasicBlockAckMissingData checks that the bit stays clear and the sender retries the same sequence and traffic identifier.

The old bitmap could also acknowledge a missing fragment across sequence wrap. If fragment 1 arrived for sequences 4093, 4095, and 0, the receiver mistook 0 for the oldest tracked sequence. The correct bits starting at 4093 are 1, 0, 1, 1.

Start tracking at the sequence negotiated for the agreement and retire old receipts as the window advances, even when it delivers no complete frame. Shared cyclic arithmetic keeps live receipts across wrap and prevents a retired receipt from acknowledging a reused sequence. The reorder test advances through a full cycle to check this. This follows IEEE Std 802.11e-2005 §9.10.3.

Broadcasts use a separate sequence counter. A broadcast far ahead could move the unicast window, and a broadcast with the same sequence could make the first unicast retry look like a duplicate. Keep group QoS frames out of unicast agreement tracking and the ordinary duplicate cache. The over-the-air cases check that the missing unicast stays eligible for retry and that its first received retry is acknowledged.

Remove the two-argument receipt-record constructor without a deprecation period. It cannot recover the negotiated starting sequence, and guessing it could acknowledge missing data.

Baseline changes:
  fingerprint runs changed in tplx,~tND,~tNl (3; showcases/wireless 2, examples/wireless 1) — missing fragments can be retried, changing packet and event timing. The pinned statistical results and charts record the resulting changes in delivery, queueing, and throughput.

Protocol verification: tests/protocol/wifi/basic-blockack-receipts.md

Plan: plan/pending/baseline-catch-up-defects.md
Change: src.ieee80211 | behavior.change.fix | fingerprint statistical chart test whatsnew migration | basic-block-ack-bitmap
…indow

The ordinary duplicate cache remembers only the last frame for each transmitter and traffic identifier. Under a Block Ack agreement, the receive window can also recognize older retries by matching their fragments to its buffer or retained receipts. Use the window for agreement traffic, as described by IEEE Std 802.11-2024 Table 10-6, RC9/RR4, and report a duplicate drop when it confirms a match.

In case 17 of Ieee80211BlockAckReordering_1, the receiver caches unicast sequence 1 before accepting a fresh agreement starting at sequence 1. The first in-window retry must reach reordering and be delivered. With the ordinary cache enabled, that retry would be discarded before it reached the window. The other cases check that a retry of a buffered or previously delivered frame produces one duplicate-drop signal.

The six affected release run-0 comparisons change only in drop metrics. In the 100-byte PacketSizeHCFfragblockack run, the reported duplicate-drop count goes from 1 to 1,358.

Protocol verification: tests/protocol/wifi/basic-blockack-receipts.md

Plan: plan/pending/baseline-catch-up-defects.md
Change: src.ieee80211 | behavior.change.fix | statistical test whatsnew | basic-block-ack-bitmap
A receiver with a Basic Block Ack agreement can deliver a Normal Ack fragment and later discard its retry behind the receive window. The old record held only fragments sent with Block Ack policy, so that retry went uncounted. Keep the exact Normal Ack receipt for duplicate detection while leaving its Basic bitmap bit clear.

Case 18 of Ieee80211BlockAckReordering_1 delivers sequence 100, fragment 0 with Normal Ack. A retry of unseen fragment 1 produces zero duplicate-drop signals. A retry of delivered fragment 0 produces one, and the Basic bitmap bit stays clear.

In MixedTraffic run 0, counting the already-delivered Large-12 retry raises the receiver's duplicate-drop count from 12 to 13. Pin the approved result for that run.

Protocol verification: tests/protocol/wifi/basic-blockack-normal-ack-retries.md

Plan: plan/pending/baseline-catch-up-defects.md
Change: src.ieee80211 | behavior.change.fix | statistical test whatsnew | basic-block-ack-bitmap
Reordering can skip a sequence while the Compressed Block Ack receipt window still covers it. In case 19 of Ieee80211BlockAckReordering_1, reordering skips 101 and advances to 103. The first received retry of 101 used to be counted as a duplicate because recording the arrival created the receipt used to classify it.

Check for a prior receipt before recording the current arrival, and document that order on the reordering overload. The first arrival of 101 sets the bitmap bit and emits zero duplicate-drop signals. A subsequent retry emits one.

Protocol verification: tests/protocol/wifi/compressed-blockack-retry-receipts.md

Plan: plan/pending/baseline-catch-up-defects.md
Change: src.ieee80211 | behavior.change.fix | test whatsnew | basic-block-ack-bitmap
The lan80211 hosts drew their movement and Wi-Fi backoff from the same random stream. Changing traffic could consume a different number of backoff draws and make the same seed send the hosts along different paths. That made it hard to tell whether a throughput change came from the traffic or from different link conditions.

For example, toggling TCP window scaling in the two-host FTP run changed the next waypoint at 68.74 seconds. Give host mobility RNG 1 in the ping, FTP and streaming examples. Wi-Fi backoff continues to draw from RNG 0. With this mapping, the two window-scaling settings produce the same 101 logged waypoints over 100 seconds and the FTP sink receives 3,617,104 bytes with window scaling enabled and 3,618,552 bytes with it disabled.

Lan80211MobilityIndependence_1 runs that pair of simulations in the module suite and compares both hosts' logged waypoint times and coordinates. It also checks that the two runs deliver different amounts of data, so the test exercises a traffic change.

Baseline changes:
  fingerprint runs changed in tplx,~tND,~tNl (3; examples/wireless 3) — The new seeded paths change when stations can exchange frames and move the event and packet fingerprints of TwoHosts, Streaming1 and Ping1. The statistics pin records the resulting radio, MAC and application changes in those same runs.

Plan: plan/pending/baseline-catch-up-defects.md
Change: examples | behavior.change.fix | fingerprint statistical test whatsnew
When a group frame ends a transmission opportunity (TXOP), stations should be able to contend for the channel as soon as the normal waiting period allows. With Block Ack support enabled, the sender can advertise airtime for a second frame that is ready in the queue. That frame needs its own channel access, so the extra reservation can make other stations wait for airtime the sender will leave idle.

The hybrid coordination function now leaves the queued successor out of the single-protection calculation for group Data and Management frames. The final group frame advertises zero Duration/ID, as required by IEEE Std 802.11-2024, 9.2.5.2 a) 9).

WifiSingleProtectionGroupDuration makes two group frames ready by using the model's existing fragmentation behavior. In both Block Ack profiles, the first frame used to advertise 96 µs even though the second frame transmitted in a separate TXOP. The test now observes zero on both frames, as it already does with Block Ack disabled. The fixture exercises the reservation calculation and the TXOP boundary. IEEE 802.11 prohibits fragmenting group traffic.

Reviewer: tests/protocol/wifi/single-protection-group-duration.md
Plan: plan/pending/baseline-catch-up-defects.md
Change: src.ieee80211 | behavior.change.fix | test whatsnew
With Basic Block Ack enabled, HCF can start a later unicast exchange even when its DATA will exceed the remaining TXOP or its reservation. After a Basic Block Ack with zero Duration/ID, it can also send DATA in the same TXOP even though TXNAV has expired.

Before submitting a continuation, HCF now budgets the selected DATA and any RTS, CTS, immediate ACK, and intervening SIFS. The exchange must be shorter than TXNAV and fit the TXOP with its leading SIFS, as required by IEEE Std 802.11-2024, 10.23.2.8 and 10.23.2.9. HCF retains the DATA rate selected before RTS through CTS and checks the remaining airtime again before submitting DATA.

WifiBasicTxopAdmission queues 700-byte datagrams between associated non-HT stations. PR inet-framework#1481 admits three continuations projected to miss the TXOP deadline by 86 to 150 microseconds. It also admits a protected continuation with too little TXNAV in a separate case. All four cases pass in debug and release with the fix. The fixture covers positive TXOP limits and fixed rates.

Five run-0 fingerprint cases change. Their first different DATA submission now waits for a fresh grant after a Basic Block Ack with zero Duration/ID. The stored expectations await approval.

Reviewer: tests/protocol/wifi/basic-txop-admission.md
Plan: plan/pending/baseline-catch-up-defects.md
Change: src.ieee80211 | behavior.change.fix | test whatsnew
@mgonzalezlopezudc
mgonzalezlopezudc marked this pull request as ready for review November 24, 2026 07:50

@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.

4 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)

Devin Review

// IEEE Std 802.11-2024, 11.5.4: valid Block Ack traffic without an agreement requires DELBA.
// Reject malformed DATA and unsupported BAR fields before this recovery path.
if (auto data = dynamicPtrCast<const Ieee80211DataHeader>(header)) {
if (auto data = dynamicPtrCast<const Ieee80211DataHeader>(header); data && !data->getReceiverAddress().isMulticast()) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 Mixed fragments corrupt multicast packets

With a matching Compressed agreement, recipientProcessReceivedFrame now forwards multicast fragments to BasicReassembly. Its key omits the multicast destination, so fragments with the same sequence and TID can assemble into one corrupted packet.

Learn more

The receive-side agreement lookup matches the transmitter and TID, so an earlier HCF check rejected fragmented group QoS traffic from a peer with a matching Compressed agreement. The new group bypass allows those fragments, and dataFrameReceived sends them to ordinary reassembly. The sender still permits group fragmentation because its fragmentation gate checks for an agreement with the frame's actual receiver. QoSSequenceNumberAssignment can reuse the current shared sequence number for a new group address. BasicReassembly uses only the transmitter, TID and sequence to join fragments. When the fragment bitmap is complete, Defragmentation takes the header from fragment zero and concatenates the payloads without checking the destination.

Example: An AP with a Compressed agreement sends two fragmented QoS packets at the same TID to different multicast destinations that share sequence 7. A station hears only fragment 0 of the first packet and fragment 1 of the second. Its MAC emits one reassembled packet containing bytes from both packets under the first destination's header.

Recommended fix: Include the receiver address in the group QoS reassembly key while preserving the existing unicast key and purge behavior. Add a regression that receives complementary fragments for two group addresses from the same transmitter and verifies that neither packet is delivered.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

This branch has not been deployed

No deployments
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