Repository navigation
ieee80211: enforce complete TXOP exchange duration - #1273
Open
mgonzalezlopezudc wants to merge 8 commits into
Open
mgonzalezlopezudc wants to merge 8 commits into
mgonzalezlopezudc wants to merge 8 commits into
Conversation
mgonzalezlopezudc
force-pushed
the
feat/ieee80211-txop-duration
branch
4 times, most recently
from
October 4, 2026 20:37
56829e1 to
eea6e43
Compare
mgonzalezlopezudc
force-pushed
the
feat/ieee80211-txop-duration
branch
6 times, most recently
from
October 5, 2026 16:52
e8907fa to
23ed984
Compare
mgonzalezlopezudc
force-pushed
the
feat/ieee80211-txop-duration
branch
3 times, most recently
from
October 5, 2026 22:56
1ef1f17 to
c8ea3b7
Compare
The transmission opportunity (TXOP) change needs one durable description of its scope and contracts. A TXOP gives a quality of service (QoS) station time to start frame exchange sequences. Record the supported hybrid coordination function (HCF) path in the implementation plan. Explain complete duration checks, cancellation, frame ownership, and direct verification there. Plan: plan/pending/ieee80211-txop-duration.md Change: plan | behavior.add | - | ieee80211-txop-duration
Extra blank lines follow the final declarations in these MAC files. Remove those lines separately so that the functional diffs show only their source changes. The compiler sees the same source tokens. Plan: plan/pending/ieee80211-txop-duration.md Change: src.ieee80211.mac | format | - | ieee80211-txop-duration
A synchronous callback can cancel a delayed frame or start another sequence. An old callback must not advance the replacement sequence. Give each request to the transmission module (Tx) an identity before submission. Check that identity after each permission callback. The check also applies when the interframe space (IFS) is zero. Protect borrowed sequence objects until all nested callbacks return. Detach the contention callback before the channel grant notification. This lets synchronous cancellation request channel access again. Preserve response timeout order relative to equal-time network allocation vector (NAV) events. The NAV records the medium reservation from protocol duration information. External Tx modules and handlers require the new request callbacks. The request identity contract changes Tx and each callback consumer together. A partial migration cannot compile against the new callbacks or preserve cancellation across synchronous calls. The callback guards belong to that contract, so this commit cannot divide safely. Hypothetical: request A waits for IFS. Its permission callback replaces A with B. Tx detects the changed identity and cannot transmit A. The check leaves B under its own request identity. Plan: plan/pending/ieee80211-txop-duration.md Change: src.ieee80211.mac | behavior.add+change | test whatsnew migration | ieee80211-txop-duration
Stop and crash can leave a delayed or on-air request alive in the medium access control (MAC) transmission module (Tx). The hybrid coordination function (HCF) can also retain Block Ack agreements without an inactivity timer after resume. Block Ack reports reception status for multiple frames. An expired recipient agreement can leave an old reorder buffer or admit late Block Ack data. MAC resets Tx before the coordination functions retire their exchanges. A new lifecycle epoch rejects old requests. Group, Block Ack, and No Ack transmissions do not enter Normal Ack failure processing. Normal Ack uses an acknowledgment (ACK) frame for each required response. HCF retains each agreement's absolute deadline across downtime. Resume retires overdue agreements before channel access. Each handler detaches expired state before deletion callbacks. Recipient retirement clears only the corresponding peer and traffic identifier (TID)'s buffer. HCF discards late Block Ack data and queues a delete block acknowledgment (DELBA) frame. Delayed timeout or UNKNOWN_BA completion preserves a replacement agreement. For example, an agreement starts at sequence 19 and buffers sequence 20. After expiry, replacement add block acknowledgment (ADDBA) starts at sequence 100. The cleared buffer lets HCF deliver sequence 100. Late Block Ack data without an agreement instead causes discard and UNKNOWN_BA DELBA. The reset, deadline, buffer, and deletion contracts form one lifecycle change. Their callers require the same interfaces before stop or resume can use them. External Tx modules, handlers, ACK owners, agreement handlers, callbacks, and recipient data services require source changes. The module tests cover both expiry event orders, stop/crash restart, zero timeout, buffer isolation, and replacement preservation. IEEE Std 802.11-2024, 11.5.4 defines expiry and late-data discard. Table 9-79 defines the DELBA reason codes. Plan: plan/pending/ieee80211-txop-duration.md Change: src.ieee80211.mac | behavior.add+change.fix | test whatsnew migration | ieee80211-txop-duration
Exchange preparation needs frame identity and acknowledgment (ACK) state without protocol progress. Expose read-only ACK snapshots and staged views. Keep extraction and fragment transmission history in the frame store. Retain original frames while a context borrows them. Notify the typed removal callback before a referenced frame leaves the store. The distributed coordination function (DCF) and hybrid coordination function (HCF) release contexts in preDelete(), before child stores die. The teardown regression checks this order for DCF and legacy HCF. Custom ACK owners require snapshotFrameState(), the read-only state query. For example, preparation reads a staged frame that has not transmitted. The snapshot reports FRAME_NOT_YET_TRANSMITTED. The real ACK state remains unchanged after that query. Plan: plan/pending/ieee80211-txop-duration.md Change: src.ieee80211.mac | behavior.add | test whatsnew migration | ieee80211-txop-duration
Admission must use the duration of the exchange that execution selects. Let the current constructor tree record each selected branch, frame, mode, protection choice, and response before execution. A private context projects completion without an acknowledgment (ACK) state change. Timeout queries use the supplied response mode and keep overrides. Unsupported primitives report unsupported preparation explicitly. The hybrid coordination function (HCF) still uses the legacy production path in this commit. External sequence, step, and timeout policy implementations require the new methods and a rebuild. The preparation contract changes the constructor tree, primitive steps, context, and timeout queries together. Each constructor must forward the same prepared records that each primitive produces. A partial migration cannot compile or retain those choices, so this commit cannot divide safely. Production admission remains a later commit. For example, the unit test's mode provider returns 24 Mbps first and 6 Mbps on another query. Preparation records 24 Mbps. Prepared execution uses 24 Mbps without another selector call. Plan: plan/pending/ieee80211-txop-duration.md Change: src.ieee80211.mac | behavior.add+change | test whatsnew migration | ieee80211-txop-duration
A data frame can fit a transmission opportunity (TXOP) while its required response does not. Add admission for the complete prepared exchange, with interframe space (IFS) and response airtime. Use actual transmission history for permitted overruns and zero-limit fragment units under IEEE Std 802.11-2024, 10.23.2.9. Check the transmitted reservation separately under 10.23.2.8. Derive the Duration/ID header field from accepted plans under 9.2.5.2. Hybrid coordination function (HCF) preparation remains disabled in the production context. Short interframe space (SIFS) separates specified immediate responses and frames within an exchange. TXNAV is this station's transmitted medium reservation. Hypothetical: a continuation costs 100 microseconds and exactly fits the available TXOP time. Its cost without SIFS before its first transmission is 84 microseconds. An available transmitted reservation of 84 microseconds refuses it because TXNAV requires a strictly shorter cost. The TXOP budget check accepts equality; the TXNAV check rejects equality. Plan: plan/pending/ieee80211-txop-duration.md Change: src.ieee80211.mac | behavior.add+change | test whatsnew migration | ieee80211-txop-duration
The hybrid coordination function (HCF) previously admitted a continuation whenever positive transmission opportunity (TXOP) time remains. That check can accept a data frame whose required response exceeds the limit. Enable complete exchange preparation when isBlockAckSupported is false. HCF executes the exchange that passed complete duration admission. Transmission uses the accepted frames, modes, acknowledgment (ACK) policy, and protection values. Mode-set changes and retained frame removal invalidate stale plans. Commit actual transmission history before completion selects another exchange. Keep cancellation in the HCF module context. For example, the exchange test's 350-microsecond limit admits two data/ACK exchanges. HCF refuses the third complete exchange and ends the TXOP. The third frame waits for a new channel grant without retry progress. The distributed coordination function (DCF) and HCF with Block Ack support retain their legacy paths. Block Ack reports reception status for multiple frames. The duration guarantee assumes zero propagation delay and nominal short interframe space (SIFS). An oversized initial exchange without a supported exception reports a model-limit error. Automatic fragmentation to an airtime budget is unsupported. The accepted exchange now controls frame choices and transmission time. This changes eleven fingerprint rows for tplx, ~tNl, and ~tND. Plan: plan/pending/ieee80211-txop-duration.md Change: src.ieee80211.mac | behavior.add+change.fix | test whatsnew migration fingerprint | ieee80211-txop-duration
mgonzalezlopezudc
force-pushed
the
feat/ieee80211-txop-duration
branch
4 times, most recently
from
October 6, 2026 11:52
9b26e7c to
d9af805
Compare
This branch has not been deployed
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.
A data frame can fit a transmission opportunity (TXOP) while its required response exceeds the TXOP limit. The hybrid coordination function (HCF) now checks complete exchanges when
isBlockAckSupported=false. The check includes protection, response airtime, and each required short interframe space (SIFS). HCF executes the same frames, physical layer (PHY) modes, acknowledgment (ACK) policy, and protection choices that passed the check.An acknowledgment (ACK) frame confirms reception when the selected policy requires it. The exchange regression supplies three data frames under a 350 µs limit. HCF admits two data/ACK exchanges and ends the TXOP before the third exchange. The third frame waits for another channel grant without retry progress.
The medium access control (MAC) module also resets active requests and exchanges on stop or crash. HCF restores Block Ack inactivity deadlines after restart and discards Block Ack data without an active agreement. Block Ack reports reception status for multiple frames under an agreement. External implementations of the changed MAC contracts require source changes and a rebuild.
Commit order
The PR uses radio command deferral from its base,
93210f4955, supplied by PR #1280. The eight commits contain these changes, in this order:Preparation and admission precede activation. Request identity, lifecycle reset, and frame retention also change behavior before activation.
Scope and contracts
Preparation records one exchange through the current sequence tree. Private completion predicts a next exchange without changes to real ACK state, retries, sequence numbers, or queue order. The frame store owns staged frames that the data service already extracted and registered. Contexts retain those originals until their borrowed references end.
For example, the mode provider in the unit test returns 24 Mbps first and 6 Mbps on another query. Preparation records 24 Mbps for the first frame. Prepared execution uses that recorded mode without another selector call.
Tx is the component that transmits MAC frames. Its request identity combines a lifecycle epoch and a serial; restart changes the epoch. Interframe space (IFS) is a required interval between specified frame transmissions. Tx rechecks identity after callbacks, even when IFS is zero. Hypothetical: a permission callback replaces request A with B. Tx detects the changed identity and cannot transmit A.
Cancellation removes only the matching delayed copy. An on-air request keeps its completion path unless lifecycle cleanup aborts it. Callback guards keep borrowed contexts, steps, and metadata alive until nested callbacks return. Coordination functions release contexts before child frame stores cease to exist.
Admission includes SIFS before each continuation. Actual transmission history and retained frame facts determine zero-limit allowances and supported overrun exceptions. A separate check enforces TXNAV, the medium reservation that this station transmits during its TXOP. HCF rechecks complete cost and state before transmission. Frame removal or an incompatible mode set invalidates the prepared exchange.
Hypothetical: a continuation costs 100 µs and exactly fits the available TXOP time. Its cost without SIFS before the first transmission is 84 µs. An available TXNAV interval of 84 µs refuses it because that check requires a strictly shorter cost. The TXOP budget check accepts equality; the TXNAV check rejects equality.
Downtime counts toward finite Block Ack deadlines; timeout zero disables inactivity expiry. Restart retires overdue agreements in both roles before traffic requests channel access. Hypothetical: an agreement expires at 5 s, and the node restarts at 6 s. HCF retires that agreement before channel access. Late Block Ack activity cannot renew it.
Recipient retirement clears only the retired peer and traffic identifier (TID)'s reorder buffer. Each actual retirement emits one deletion notification; duplicate DELBA frames emit none. DELBA is the Action frame that ends a Block Ack agreement. Delayed TIMEOUT or UNKNOWN_BA DELBA completion preserves a replacement agreement for the same peer and TID.
Agreement handlers supply absolute deadlines and return timeout DELBA frames after retirement. Deletion callbacks borrow an agreement only until the callback returns.
qosFrameReceived()adds anIProcedureCallback *argument and returns false for Block Ack data when the agreement is absent or overdue. For overdue state, the handler requests expiry before that return. For absent state, the procedure callback takes ownership of a new UNKNOWN_BA DELBA management frame. HCF discards the data frame on a false result.The changed contracts cover Tx, sequence handlers, prepared records, ACK snapshots, timeout policies, frame stores, agreement handlers, and recipient data services. The migration guide explains the required interface changes with examples.
The duration guarantee requires zero propagation delay, nominal SIFS, and actual response modes and complete lengths that match the predictions. An oversized initial exchange without a supported exception raises a model-limit error before transmission. Automatic fragmentation to an airtime budget remains unsupported.
The distributed coordination function (DCF) and HCF with Block Ack support retain their legacy paths without the new duration guarantee. An aggregate MAC protocol data unit (A-MPDU) combines MAC frames within one PHY service data unit. The prepared path supports no A-MPDU exchange. TXOP statistics report actual elapsed time. Duration/ID content changes; frame formats, module definitions, and configuration parameters remain unchanged.
Duration checks cite IEEE Std 802.11-2024, clauses 10.23.2.8, 10.23.2.9, and 9.2.5.2. Agreement inactivity behavior cites clause 11.5.4.
Verification
Debug and release builds pass. Five unit targets, eight module targets, and five Wi-Fi protocol targets pass in debug mode. The focused tests cover preparation, admission, fixed choices, frame retention, cancellation, retry modes, teardown, and Block Ack lifecycle behavior.
The commands run from the repository root:
Commit, classification, source seal, scoped architecture, and whitespace checks pass. Per-commit runtime verification, statistical impact, additional seeds, and release-mode unit/module/protocol tests remain unverified by this focused campaign.
Fingerprint scope
The HCF activation commit changes eleven rows against
93210f4955. Prepared admission controls frame choices, transmission time, and Duration/ID content. Each row changestplx,~tNl, and~tND. The storedtyfvalues remain unchanged.examples/adhoc/qosMacQos -r 0;MsduAggregationexamples/wireless/mactestMacEdca -r 0examples/wireless/nicIeee80211MacV2Xexamples/wireless/qosMacQos -r 0;MacQosWithoutAggregation -r 0;MacQosWithRtsCts -r 0showcases/wireless/aggregationAggregation -r 0;VoicePriorityAggregation -r 0showcases/wireless/fragmentationHCFfrag -r 0showcases/wireless/qosQos -r 0The activation commit contains all eleven baseline changes. The focused unit, module, and protocol tests do not constitute a fresh fingerprint or statistical campaign.