Skip to content

ieee80211: correct ordinary Duration encoding and Block Ack reservations - #1204

Draft
mgonzalezlopezudc wants to merge 3 commits into
inet-framework:masterfrom
mgonzalezlopezudc:fix/ieee80211-audit-duration-encoding
Draft

mgonzalezlopezudc wants to merge 3 commits into
inet-framework:masterfrom
mgonzalezlopezudc:fix/ieee80211-audit-duration-encoding

Conversation

@mgonzalezlopezudc

Copy link
Copy Markdown
Contributor

Summary

Fractional ordinary Duration was truncated on wire and could disagree with typed NAV. Normalize typed producers and serializers, enforce the ordinary range, and exclude special IDs from NAV and response arithmetic. A Basic BAR with insufficient reservation now yields zero response Duration rather than a negative value that can wrap on wire.

Scope

WLAN Duration helper, DCF/HCF producers, serializers, recipient policies and Rx; BA clamp prerequisite first.

Standards references: IEEE 802.11-2024 §§9.2.4.2 and 9.2.5.1.

Dependencies and merge order

No prerequisite within this audit series; this topic was built and tested independently on the pinned base.

The Basic BA clamp is included here; do not open or merge a duplicate PR from fix/ieee80211-audit-blockack-duration. Reconcile policy overlap with #1128 before merge.

Validation

Pinned test base: 7287f347aaca36e557c708d6930a6f5a450b2833.

The isolated topic head passed an assertions-enabled debug build (-O0 -Wall -g0; debug symbols omitted for storage) and the focused checks below. The larger integration source tree also passed debug and release compilation; no separate release build is claimed for this topic.

Executed focused test commands, from the repository root after source setenv -q:

inet_run_unit_tests -m debug -f 'Ieee80211(DurationRounding|ResponseDuration|BlockAckDuration|MsduAggregation|OnWireBitCompliance)_1\.test'

Results: 5 unit cases passed.

Limits and review status

Fractional production trigger is latent on this base. Synthetic boundary tests establish the field contract, not short-GI operation.

Draft pending final independent review and reconciliation with current upstream. Live PR overlap has not been reverified against the pinned test base.

An undersized BAR reservation must yield zero response Duration rather than a negative model value or unsigned wire wrap. Test insufficient, exact, and positive reservations through the production policy.

Change: src.ieee80211.duration | behavior.change.fix | test | wifi-audit
Fractional Duration calculations must reserve the next whole microsecond in typed transmitted headers as well as serialized bytes. Normalize at DCF, HCF and response construction boundaries, reject out-of-range ordinary durations, and keep special Duration/ID encodings out of received NAV calculations.

Tests cover all seven serialized header families, fractional and range boundaries, and received special-ID filtering. Fixtures that serialize a pre-transmission header now explicitly assign zero Duration. PHY airtime remains unchanged.

Change: src.ieee80211.duration | behavior.change.fix | test | wifi-audit
Reserved or special incoming Duration/ID encodings are not airtime. Exclude them before ACK, CTS and Block Ack subtraction so malformed peer input cannot become a large reservation or trigger the ordinary-duration serializer range check. Preserve residual airtime for valid values.

Focused tests cover both DCF and QoS ACK/CTS policies, Basic Block Ack, negative input and special encodings. Debug and release builds pass.

Change: src.ieee80211.duration | behavior.change.fix | test | wifi-audit
@mgonzalezlopezudc
mgonzalezlopezudc force-pushed the fix/ieee80211-audit-duration-encoding branch from 40157af to 2cd66c3 Compare September 16, 2026 20:56
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