IEEE 802.11: support HT and VHT guard intervals, atomic mode-set switching, and rate selection - #1145
mgonzalezlopezudc wants to merge 21 commits into
Conversation
There was a problem hiding this comment.
Devin Review found 2 potential issues.
3 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
4adaa3b to
5016a7f
Compare
9d1202e to
ef97937
Compare
|
@levy the bug Devin is signaling is a false positive. I confirmed it with Devin itself. Here's Devin response: You're correct, and I withdraw my earlier claim. The trace confirms it:
So the stale tag is unconditionally recomputed and overwritten before each (re)transmission. My asserted failure chain — The one caveat you raised stands: a mode switch after a frame is already handed to |
ef97937 to
e4e39e2
Compare
PASS with 4 findings and 3 notes. 13 commits, 56 files, +3260/-309 on
current master. The most ambitious change of this workstream: IEEE-cited
corrections to the HT and VHT timing tables, guard interval as a
first-class parameter, and a transactional mode-set change whose listener
contract carries a rollback closure. 2352 of the 3260 added lines are
tests, and the last four commits each say the regression fails before the
fix.
F-1 blocks the merge. Commit 3 corrects HT MCS 32, 73 and 76 and the
HT/VHT symbol timing, and rounds short-GI airtimes to the 4 us boundary.
That moves the trajectory of any n or ac simulation. Two fingerprint rows
run those modes, the branch touches no baseline, and no message mentions
a fingerprint. A small exposure is exactly the case where the run gets
skipped.
F-2 is new: master is at 15 interface violations, this head at 16.
IIeee80211DataMode gains getGuardInterval() { return -1; }, a default
body in a flat interface that seven data modes inherit directly and only
three override. The value is right for the other four; the place is not.
Four one-line overrides make each mode state its own answer.
F-4: this branch and #1175 carry two versions of one commit, differing by
three lines. This one is 14 hours newer and drops
getConfiguredSecondaryChannelOffset() -- the member #1175's own note
questioned as called only from tests. The question looks answered; both
versions being open is what remains.
Recorded against the tool rather than the branch: the summary reports
four getMode and findMode removals where the truth is four signatures
extended by one defaulted parameter. The pairing that would catch it is
skipped when two overloads of a name change at once.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
64bb389 to
78a4025
Compare
| argument and supply it when invoking through a pointer. Rebuild external code | ||
| against the changed interface. | ||
|
|
||
| ``Ieee80211Interface`` now implements ``IIeee80211ModeSetCoordinator``. |
There was a problem hiding this comment.
This patch is very large and it's very difficult to see what's going on here.
Why do we drop the signal based notification about changing the mode set?
Why do we need to have an Ieee80211Interface C++ class?
I need to understand these questions and better understand this commit before I can say it's ok.
04d8ab4 to
dffd668
Compare
Keep the implementation contracts available before the first commit that references them. These drafts state planned work; the owning implementation and closure commits record their completed plans and verification evidence. Change: plan | behavior.add | -
Link-layer initialization may resolve peer interfaces by their configured addresses. Declare network-interface configuration as a prerequisite so these queries see initialized identities regardless of module declaration order. The physical-layer prerequisite remains in place. This ordering supplies the shared readiness contract used by simplified wireless association before network configuration. No fingerprint or statistical baseline is changed. The selected regression contract covers MacNonQos and MacQos, run 0, in examples/adhoc/qos, plus simplified association and AP lifecycle module tests in debug mode. Plan: plan/done/80211htcapop-refactor-v3.md Change: src.common.InitStages | behavior.change | test | ieee80211-htcapop-v3
Capability preparation previously depended on initialization broadcasts and mixed local PHY support with active BSS operation. Make the MAC prepare an idempotent profile through typed PHY contributors, and let management own accepted BSS transitions and simplified peer installation. Keep directional peer capabilities immutable and evaluate operation and HT eligibility separately. Publish committed MIB changes after management bookkeeping, guard state mutation, and replace modesetChanged listeners with explicit configuration providers. Prepare simplified associations before network configuration, independently of node declaration order. Keep simplified legacy STAs associated without accepting HT operation from an HT AP. Cover both declaration orders and shutdown/crash restart, while retaining BSS identity and channel and removing AP-side peer resources on stop. Migrate dependent consumers and regression fixtures together with the contracts. Document public API migration and the notification lifetime. Validation scope: debug build; 3 focused unit and 9 module cases covering capability preparation, provider wiring, association, lifecycle, beacon and channel updates; MacNonQos and MacQos run 0 fingerprints at 10s with unchanged tplx expectations. No fingerprint or statistical baseline changes. Plan: plan/done/80211htcapop-refactor-v3.md Change: src.ieee80211 | behavior.change | test expected whatsnew migration | ieee80211-htcapop-v3
Catalog-only consumers should not require capability preparation. Introduce a paired C++/NED IIeee80211ModeSetProvider contract and make MAC configuration extend it with the preparation operation used by management. ModeSetModuleBase now depends only on the read-only provider. Migrate the replacement-provider fixture to the narrow contract, removing its throwing preparation stub. Update architecture, migration guidance and release notes to identify the contract custom catalog providers implement. Validation of the integrated changes: debug build, 5 focused module tests, 3 unit tests and 18 unchanged Wi-Fi/Ethernet/VLAN/configurator fingerprint cases pass. Scoped architecture checks pass; interface checking reports only the existing AV-CONTRACT-02 bodies. No recorded baseline changes. Plan: plan/done/80211htcapop-refactor-v3.md Change: src.ieee80211 | refactor | whatsnew migration | ieee80211-htcapop-v3
Remove redundant blank lines from the affected IEEE 802.11 sources so subsequent functional changes contain no incidental whitespace cleanup. Change: src.ieee80211 | format | -
Rate selection needs to distinguish equal-bitrate modes with different guard intervals. Require an explicit data-mode query, retaining a negative sentinel for PHYs without one. Reject unknown VHT guard-interval types instead of interpreting them as short GI. Document the external API. Change: src.ieee80211 | behavior.add | test whatsnew migration
The optional HT entries encode the wrong stream count or modulation. Use one BPSK stream for MCS 32, 16-QAM on stream 4 for MCS 76 at 20 MHz, and 16-QAM on stream 3 for MCS 73 at 40 MHz. Direct optional-MCS assertions cover stream count, per-stream modulation, bitrate for both guard intervals and long-GI symbol duration; these entries are not exercised by the selectable MCS 0-31 catalog. Change: src.ieee80211.Ieee80211HtmcsTable | behavior.change.fix | test whatsnew
Band and preamble affect mode behavior but were absent from cache identity. Include them in HT/VHT cache keys and reject unsupported VHT greenfield requests before cache lookup, including after mixed-format cache use. Change: src.ieee80211 | behavior.change.fix | test whatsnew
Short GI applies to data symbols while signal fields retain long-GI timing. Round mixed HT and VHT data airtime to long-symbol boundaries; retain raw short-GI timing for HT greenfield. Expose consistent PPDU phase durations and use them in both transmitter paths. Duration-component operations remain pure virtual on IIeee80211Mode; Ieee80211ModeBase supplies the shared defaults, with HT/VHT overrides retaining their format-specific calculations. Document the implementation contract for external modes. Plan: plan/done/ht-gi-devin-comment-closure.md Change: src.ieee80211 | behavior.change.fix | test whatsnew migration
Equal-rate catalog entries can differ in GI and are not distinct adaptation steps. Qualify bitrate lookups by GI and traverse adjacent rates by bitrate. Compatibility remapping preserves exact bitrate, bandwidth, NSS and GI; GI absence is an exact tuple property, not the public lookup wildcard. Cover exact versus tolerant matching and GI presence in both directions. Change: src.ieee80211.Ieee80211ModeSet | behavior.add+change | test whatsnew migration
A fixed bitrate alone can select the wrong guard interval. Apply the configured dataFrameGuardInterval to interface-wide and per-receiver data-mode lookup in both selectors. Negative values leave GI unspecified; explicit values must match the modeled interval. Change: src.ieee80211 | behavior.add | test whatsnew
A mandatory response can use the same bitrate as a nonmandatory request. Select the highest mandatory bitrate at or below the request instead of stepping strictly to a lower rate. Change: src.ieee80211.RateSelection | behavior.change.fix | test whatsnew
Mixed HT catalogs place mandatory HT entries above legacy rates, so the fastest mandatory mode makes Beacons invisible to legacy stations. Both selectors must use a mandatory legacy operational mode when the basic legacy set is nonempty (IEEE 802.11-2024, 10.6.5.4). Preserve eligible configured basic rates, including equivalent external mode tuples. Otherwise select the fastest basic legacy rate. Unit checks cover membership, equivalent tuples and fallback; mixed-HT discovery checks legacy association through both DCF and HCF access points. The group-rate restriction changes broadcast airtime in these run-0 configurations, whose CSV and matching JSON expectations travel here: - examples/wireless/lan80211ac: Ping1; - examples/manetrouting/multiradio: SingleRadio and MultiRadio; - showcases/general/pcaprecording: PcapRecording; - showcases/visualizer/canvas/statistic: PacketErrorRate; - showcases/visualizer/canvas/submoduleinfo: MACStates and PacketCounts; - showcases/wireless/analogmodel: Distance; - showcases/wireless/power: General; - showcases/wireless/qos: NonQos and Qos; - tutorials/configurator: Step9 and Step10C. For example, a configured 54 Mbps group rate falls back to 24 Mbps, changing airtime and the subsequent event trajectory. The expectations are measured on parent cbbba4d, which includes corrected wire encoding and beacon scheduling. Bypassing only selectGroupAddressedMode restores that parent's fingerprints for the ten showcase/tutorial configurations, while ordinary production execution matches the corrected values. Retain existing limits, run numbers and fingerprint ingredients. PingRtt, analogmodel/Routing and Noise, and configurator/Step8A and Step8B retain the parent values: no group-rate baseline movement is observed in those five controls. The Ping1 expectations here describe group-rate selection before the subsequent VHT peer-negotiation change. The STA discovery regression checks this same rule: an HT association still uses a legacy basic mode for multicast, while unicast remains HT-eligible. Plan: plan/done/ht-gi-devin-comment-closure.md Change: src.ieee80211 | behavior.change.fix | test whatsnew migration fingerprint
Runtime catalog changes must complete before observers see the new state. Coordinate them through the MAC simple module and declared provider paths; the containing interface supplies wiring without owning protocol state. Apply local capabilities, management operation and dependent algorithms in that order. Reject missing membership before PHY mutation; failures after mutation remain fatal without rollback. Keep ordinary preparation idempotent and reuse HT compatibility caches when their capability inputs are unchanged. Explicit profile replacement refreshes those results while retaining relationship-scoped peer advertisements; selection still checks current eligibility and BSS operation. Reapplying the same catalog neither resets algorithms nor publishes a catalog change. Initialization uses typed queries rather than a mode-set broadcast. Refresh fixed rates, advertisements and active contention on changed catalogs. Retain whole remaining backoff slots and bounded retry windows without a new random draw. Resolve default TXOP limits at each start while preserving active TXOPs and configured overrides. Cover replacement providers, registration, retained frames, AP edge channels, both radio setters and fatal failure paths. Preflight catalog-only transmitter compatibility before setting either transition guard. Rejecting a 40 MHz HT-to-legacy request leaves state and notifications unchanged, allowing an explicit compatible-mode retry. Reuse the read-only resolver in the transmitter setter and preserve virtual setter dispatch; failures after PHY mutation remain fatal. Plan: plan/done/ht-gi-devin-comment-closure.md Change: src.ieee80211 | behavior.add+change | test whatsnew migration
Reapplying an unchanged channel or changing only the transmit mode must not interrupt a compatible incoming frame. Evaluate the actual incoming mode against listening created from the new receiver configuration; preserve compatible reception without drawing another error decision. Abort incompatible reception through the normal cleanup path before configuration notifications. Clearing only the reception pointer left the radio reporting RECEIVING until a later signal boundary. Retain arrival timers for cleanup and give receiver and transmitter separate channel objects. Cover whole and separate reception parts, unchanged settings, transmit-only changes, incompatible configurations, cleanup and subsequent reception. Plan: plan/done/ht-gi-devin-comment-closure.md Change: src.ieee80211 | behavior.change.fix | test whatsnew migration
SSID elements contain at most 32 octets. Use shared wire helpers to reject overlength values and truncated input consistently across management frames. Cover zero, one, 32 and 33 octets and truncated payloads. Change: src.ieee80211.Ieee80211MgmtFrameSerializer | behavior.change.fix | test whatsnew
Invalid wire AIDs in association and reassociation responses should mark the frame incorrect while allowing parsing to finish. Substitute zero and preserve status, rates, trailing elements and stream position. Cover missing markers, out-of-range success AIDs and nonzero failure AIDs. Change: src.ieee80211.Ieee80211MgmtFrameSerializer | behavior.change.fix | test whatsnew
Consumers need a typed VHT MCS identity independent of the HT bitmap and concrete PHY classes. Add getVhtMcsIndex() to the mode contract, return the VHT index from VHT modes and provide a non-VHT default in the common base. Document the requirement for external mode implementations. Change: src.ieee80211 | behavior.add | test whatsnew migration
Provide both guard intervals for all 310 legal supported VHT tuples. Prefer historical entries for unqualified lookups so floating-point rate ties preserve previous choices. Retain mandatory/basic flags and reference choices. Cover tuple exclusions, qualified lookup, timing and historical selection in the catalog test. Change: src.ieee80211.Ieee80211ModeSet | behavior.add | test whatsnew
VHT requests previously bypassed negotiated receive limits. Exchange typed VHT capability and operation elements through detailed AP/STA management, commit peer state at association completion, and invalidate it on loss or mode-set application. Constrain DCF/HCF choices by local Tx and peer Rx maps, operating width, GI eligibility and long-GI rate limits. Missing negotiation falls back to legacy rates. Detailed operation remains primary-20 with long GI; document the retained VHT-only profile limitations. Update only lan80211ac/Ping1, run 0, 100s in examples.csv and the matching JSON entries: 8180-0d11/tplx becomes e382-0a32/tplx and a5d5-2820/~tNl becomes 45db-b12b/~tNl. Without negotiated VHT state, the first unicast now uses 24 Mbps OFDM, reducing airtime from 72 us to 44 us. The isolated catalog-only run preserves the old fingerprints, identifying peer filtering as the cause. The new values were explicitly approved. The migration guide references the MIB parameter definitions and retains a directional MCS-map example instead of duplicating defaults. Expose virtual VHT advertisement helpers so inherited AP/STA builders honor management subclass overrides. Apply subtype permissions independently to HT and VHT presence bits in both serializer directions; association requests must not carry a VHT operation element. Cover both contracts in focused fixtures and document the normative limits used by the peer selector. Plan: plan/done/ht-gi-devin-comment-closure.md Change: src.ieee80211 | behavior.add+change | test whatsnew migration fingerprint
Tie the focused build, unit, module, protocol and fingerprint evidence to the pinned base and exact source/test patch. Preserve the initial fixture failures and their corrected reruns, and record the existing full-interface gate findings separately. Mark the earlier V3 report as historical. Debug/release builds, nine unit cases, 28 module cases, four protocol cases and two legacy fingerprints pass in the final source tree. Both scoped architecture checks and the mode-interface check pass. Change: plan | behavior.add+change | -
603c5e1 to
6c1176a
Compare
Summary
This PR brings the IEEE 802.11 HT/VHT implementation and its runtime reconfiguration paths into a consistent, testable state. The changes cover guard-interval-aware mode selection and timing, coordinated mode-set transitions, management-frame validation, reception preservation, and negotiated VHT rate selection.
Dependency and reading order
This PR depends on PR #1216 for the IEEE 802.11 capability/BSS-state ownership and configuration-provider contracts that this branch extends. The first three source commits in this branch carry that prerequisite foundation; the remaining commits build the HT/GI and VHT behavior on top of it.
The current branch is a 21-commit linear reconstruction of the reviewed series. Corrections are folded into their causal commits, referenced plans exist before their first
Plan:trailer, and the final source/test tree is preserved exactly.Mode and timing correctness
IIeee80211Mode, with shared defaults inIeee80211ModeBaseand format-specific HT/VHT overrides. Document the migration for direct external implementations.Rate selection and transitions
Management and wire robustness
Verification
Verified head:
6c1176abee6fb05e741b0697fafb921a78729363; base:98117c3257b2e11661d2baf685c18911c8639b24; final tree:4ded822327ae1e844b1bc8f8e7226ea145ca2ad3.The local campaign used OMNeT++ 6.4.0aipre2 / clang. Behavioral tests loaded debug libraries. Simulations used run 0/default seed and the committed CSV limits below; fixtures retained their embedded deterministic variants.
opp_replchecks.3651b1674b(transition/rejection/retry) andae9b366e4a(reception preservation).Exact recorded commands and portable reproduction of the final selection
Build commands, run from the checkout root (both exited 0):
The exact recorded final
opp_replinvocation below exited 0. Its wrapper is a local diagnostic artifact, not a tracked repository script. It selects the unit/module fixtures shown in its arguments and the 14 fingerprint configurations listed below. It compares the committed CSV values throughopp_repl; its generated temporary expectation store does not update tracked baselines.For reproduction from a checkout with INET/OMNeT++ and its Python test tools activated, the same final fixture and fingerprint selection can be invoked with the repository launchers below. These are portable reproduction commands; the result counts above come from the recorded wrapper invocation, not a separate execution of this block.
History/static commands run from the checkout root (all exited 0 except the explicitly disclosed full interface gate):
doc/project/enforcement/check-commits.sh 98117c3257b2e11661d2baf685c18911c8639b24..6c1176abee6fb05e741b0697fafb921a78729363 doc/project/enforcement/check-classification.sh 98117c3257b2e11661d2baf685c18911c8639b24..6c1176abee6fb05e741b0697fafb921a78729363 doc/project/enforcement/check-architecture.sh src/inet/linklayer/ieee80211 doc/project/enforcement/check-architecture.sh src/inet/physicallayer/wireless/ieee80211 doc/project/enforcement/check-source-seals.sh --base 98117c3257 git diff --check 98117c3257b2e11661d2baf685c18911c8639b24 6c1176abee6fb05e741b0697fafb921a78729363 doc/project/enforcement/check-interfaces.sh # exit 1: existing violations described aboveAll eight
Plan:references were checked withgit cat-file -e <commit>:<path>at their referring commits. The original and reconstructed trees compare equal withgit diff --exit-code 603c5e1c90009947a19238a57853202d4aecd312 6c1176abee6fb05e741b0697fafb921a78729363 --(exit 0).Baseline updates and final fingerprint inventory
The branch changes 36 recorded ingredients in 13 configurations. The updates are in
tests/fingerprint/examples.csv,showcases.csv,tutorials.csv, and matching entries intests/fingerprint/store.json.b42a3e101cowns the changes across all 13 configurations: group-addressed frames use an eligible legacy basic rate, changing broadcast airtime and subsequent event timing. For example, an ineligible configured 54 Mbps group rate falls back to the 24 Mbps basic rate.e4f236f954additionally changes onlyexamples/wireless/lan80211ac,Ping1, run 0, 100s:8180-0d11/tplx→e382-0a32/tplx, anda5d5-2820/~tNl→45db-b12b/~tNl. Before negotiation, the first unicast falls back to 24 Mbps OFDM, reducing its airtime from 72 µs to 44 µs. The isolated catalog-only control retains the preceding expectations.All rows below use
omnetpp.ini, run 0/default seed. Values are the verified final expectations, including both causal changes forlan80211ac. CSV and JSON values agree; cleanup regenerated no baseline value.examples/manetrouting/multiradioMultiRadioa83a-1ece/tplx;f1d9-19c4/~tNlexamples/manetrouting/multiradioSingleRadioc2bd-7372/tplx;fc98-08d6/~tNlexamples/wireless/lan80211acPing1e382-0a32/tplx;45db-b12b/~tNlshowcases/general/pcaprecordingPcapRecordinga1b9-ff80/tplx;cb8f-443a/~tNl;cb45-7a00/~tNDshowcases/visualizer/canvas/submoduleinfoPacketCountse700-27fb/tplx;f16c-28a3/~tNl;57f0-e9ab/~tNDshowcases/visualizer/canvas/submoduleinfoMACStatese700-27fb/tplx;f16c-28a3/~tNl;57f0-e9ab/~tNDshowcases/visualizer/canvas/statisticPacketErrorRate78cf-be58/tplx;a1d6-4bb6/~tNl;d600-2b73/~tNDshowcases/wireless/analogmodelDistance98d8-d5d1/tplx;ebe5-7cf5/~tNl;9e70-fbb5/~tNDshowcases/wireless/powerGeneral21cb-ec85/tplx;30b0-ee3e/~tNl;ae94-6216/~tNDshowcases/wireless/qosNonQos7a6b-0096/tplx;cd89-6ad5/~tNl;3d32-d9e4/~tNDshowcases/wireless/qosQos904d-389e/tplx;21aa-5c22/~tNl;6b58-22a3/~tNDtutorials/configuratorStep93e25-000b/tplx;ca9f-eb38/~tNl;82f2-2fe2/~tNDtutorials/configuratorStep10Ce443-0781/tplx;cc4d-d519/~tNl;02d8-d7df/~tNDThe 14th final configuration is the unchanged legacy control
examples/wireless/lan80211,Ping1, run 0, 25s:3785-bc39/tplx,18be-f36c/~tNl,c76d-5483/~tND. Those three checks plus the 36 above make the 39-check campaign.Earlier evidence and limits
The earlier HT/GI closure record documents a separate 9-unit / 28-module campaign, four protocol cases, and two legacy ad hoc fingerprint cases, including its initial fixture failures and corrected reruns. It is historical evidence; the current 12-unit / 18-module / 39-fingerprint campaign is specified above.
Detailed operational VHT management remains primary-20/long-GI. MU, beamforming, 80+80, extended-NSS bandwidth, and operating-mode notification support are outside this change. No full feature-off matrix or full repository suite was run. The local results above do not claim that every remote CI workflow has completed successfully.