IEEE 802.11: support HT and VHT guard intervals, atomic mode-set switching, and rate selection - #1145
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
00e1c36 to
7862ed5
Compare
Remove redundant blank lines from the affected IEEE 802.11 sources so subsequent functional changes contain no incidental whitespace cleanup.
Rate selection needs to distinguish modes with the same bitrate and different guard intervals. Require every data mode to state its modeled interval, preserving the negative sentinel for PHYs without one. Document the new requirement for external data-mode implementations.
The optional HT table 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.
Band and preamble format affect mode behavior but were absent from cache identity, allowing a request to reuse a mode with different properties. Include both in the HT and VHT keys and reject unsupported VHT greenfield requests before cache lookup. Cover rejection before and after a mixed format request.
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 so the phases sum to the modeled frame duration. Add the independent VHT timing assertions; catalog-based HT assertions follow with lookup.
Equal-rate catalog entries can differ in GI and do not form distinct steps for rate adaptation. Qualify bitrate lookups by GI, retain stable equal-rate ordering, and find adjacent rates by bitrate. Provide complete PHY-tuple compatibility lookup and mandatory-at-or-below selection for consumers. Cover catalog traversal, peer fallback, compatible lookup and timing across the HT/VHT catalogs; document lookup 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 rate selectors. Negative values retain unspecified-GI selection; explicit values must match the modeled PHY interval.
A response may use a mandatory mode at the same bitrate even when the request mode itself is not mandatory. Select the highest mandatory bitrate at or below the request instead of stepping strictly to a lower rate.
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 |
Mixed HT catalogs place mandatory HT MCS entries above legacy rates, so the fastest mandatory mode makes Beacons invisible to legacy stations. Constrain both rate selectors to mandatory legacy operational modes when the advertised basic legacy set is nonempty, preserving eligible configured rates. Add passive-discovery coverage for legacy stations associating with mixed HT DCF and HCF access points. Update the lan80211ac Ping1/run 0/100s fingerprints in examples.csv from bb14-f903/tplx;538b-6566/~tNl to 8180-0d11/tplx;a5d5-2820/~tNl, and synchronize the matching JSON store entries. The JSON ~tNl entry was already stale (1108-9845); it now matches the same verified run. This change makes the AP forward the broadcast ARP request at the mandatory legacy rate of 24 Mbps instead of the configured VHT rate. At event 41, t=0.006500862657, its airtime changes from 72 us to 44 us; the transmission-end event moves 28 us earlier. IEEE 802.11-2024, 10.6.5.4 requires a non-HT basic rate for this group-addressed frame when the basic legacy rate set is nonempty. Causal verification: restoring only the previous group-rate decision with an interposed selectGroupAddressedMode that returns requestedMode reproduces both original fingerprints over the full 100s run, while keeping the GI and duration fixes active. Thus this rate-selection correction, rather than the GI timing changes, accounts for the new fingerprints. The normal debug run passes the updated CSV expectations. The same basic-rate restriction changes group-addressed traffic in legacy networks configured for 54 Mbps. Update run 0 fingerprints for: - 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. These 12 CSV rows and their 34 matching JSON fingerprints retain their existing simulation limits and non-graphical ingredients. The configured 54 Mbps rate previously bypassed the basic-rate restriction; selecting 24 Mbps instead changes airtime and the subsequent event trajectory. In PacketCounts, the first changed group-rate decision is event 11 at 0.01 s, where the requested 54 Mbps mode becomes 24 Mbps. Causal verification at the final series tip reproduces all 12 changed fingerprints. Bypassing only selectGroupAddressedMode's restriction restores all 12 original baselines while retaining the other changes. The ordinary debug runs pass all 12 updated CSV expectations. This extends the same group-addressed basic-rate correction documented above for Ping1 to the affected legacy configurations.
Runtime catalog changes must refresh the transmitter, receiver, MAC HT capabilities, advertised rates, channel access and rate-selection state before observers see the new mode set. Apply typed consumers once before publishing notification and rebuild configured modes from their qualifiers. Validate compatible or explicitly selected transmitter modes and reject reentrant transitions. Consumer and observer failures are fatal simulation errors; these setters do not offer rollback or continuation after failure. Cover successful transitions, peer state, advertisements, fixed-rate failures and notification failures through both setters. Document the listener interface inherited by external subclasses.
SSID elements contain at most 32 octets. Use shared wire helpers to reject overlength values and truncated input consistently across management frame types. Cover zero, one, 32 and 33 octets and truncated payloads.
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 successful AIDs and nonzero AIDs in unsuccessful responses for both frame types.
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>
Overview and Motivation
Correct IEEE 802.11 HT and VHT guard-interval timing and mode selection, keep configured fixed and mandatory modes synchronized across runtime physical-layer mode-set transitions with fail-fast consumer updates, constrain group-addressed transmissions to mandatory legacy rates in mixed HT mode, and harden management frame serialization/deserialization against oversized SSIDs and malformed response AIDs.
Summary of Changes
Whitespace Isolation (
PR-SPLIT-WHITESPACE):PHY Timing, MCS Definitions, and Mode Cache Keys:
getDataGuardInterval()), preserving-1sfor PHYs without one (IIeee80211Mode).Ieee80211HtModeandIeee80211VhtModewith band mode and preamble format, preventing cache aliasing across frequency bands and rejecting unsupported VHT greenfield requests before lookup.Mode Lookup, Catalog Completion, and Rate Stepping:
Ieee80211ModeSetfor"n(mixed-2.4Ghz)"with short and long guard-interval variants.findModeandgetMode.findCompatibleModefor exact PHY parameter matching across mode sets (treating negative guard intervals as wildcards for non-OFDM modes).getSlowerMode,getFasterMode,getSlowerMandatoryMode, andgetFasterMandatoryMode.getMandatoryModeAtOrBelowto locate the highest-bitrate mandatory mode at or below a requested transmission rate.MAC Rate Selection Configuration and Group-Addressed Fallback:
dataFrameGuardIntervalparameter toRateSelectionandQosRateSelection("long","short", or"unspecified"), enabling explicit short-GI qualification for fixed data rates.getMandatoryModeAtOrBelowincomputeResponseAckFrameModeandcomputeResponseCtsFrameModeso mandatory response modes can match the triggering frame's bitrate without stepping down unnecessarily.Dynamic Mode-Set Synchronization and Fail-Fast Consumer Updates:
modesetChangedSignalon runtime mode-set transitions (setModeSetandsetModeSetAndMode).Ieee80211MactomodesetChangedSignalatINITSTAGE_LINK_LAYERand rebuild configured fixed mode pointers and mandatory mode references inRateSelectionandQosRateSelection, invalidating receiver caches and clearing stale rate history.cRuntimeError).Management Wire Codec Hardening:
cRuntimeError, preserving parsing of status codes and trailing elements.Series Reading Order
The 12 commits are linear on top of upstream
master:db566892b7—ieee80211: remove redundant blank linesRemoves redundant blank lines across affected IEEE 802.11 source files to isolate whitespace cleanup from subsequent functional edits (
PR-SPLIT-WHITESPACE).7df7971e85—ieee80211: require explicit data-mode guard interval queriesExposes
getDataGuardInterval()inIIeee80211Modeacross PHY mode classes, preserving-1ssentinel for PHYs without guard intervals; documents migration guide.abc2e3e9a8—ieee80211: correct HT MCS 32, 73 and 76 definitionsCorrects spatial stream count and modulation for optional HT MCS entries 32 (1 stream BPSK), 73 (stream 3 16-QAM at 40 MHz), and 76 (stream 4 16-QAM at 20 MHz).
6b9cf9177c—ieee80211: distinguish band and preamble in mode cachesQualifies HT and VHT mode cache keys by band mode and preamble format to prevent cache aliasing, and rejects unsupported VHT greenfield requests before lookup.
bc01713da4—ieee80211: correct HT/VHT PPDU timingKeeps SIGNAL field symbol duration at 4 µs independent of data GI, rounds mixed HT/VHT data airtime to 4 µs symbol boundaries, and aligns transmitter PPDU phase calculations.
04a96e2057—ieee80211: complete guard-interval mode lookupCompletes mixed 2.4 GHz HT mode set with short-GI variants, adds GI-qualified lookups, enforces strict rate stepping monotonicity, adds
findCompatibleModeandgetMandatoryModeAtOrBelow, and addsIeee80211HtGuardInterval_1.test.b98f44e130—ieee80211: qualify fixed data rates by guard intervalAdds
dataFrameGuardIntervalparameter toRateSelectionandQosRateSelection("long","short", or"unspecified") to qualify fixed bitrate lookups.036a54bfa7—ieee80211: select mandatory response rates by bitrateUses
getMandatoryModeAtOrBelowinRateSelectionACK/CTS response mode selection so mandatory response rates match the triggering frame's bitrate when possible.9039d75807—ieee80211: use legacy basic rates for group-addressed framesConstrains group-addressed frames to mandatory legacy operational rates when basic rates are present, adds
Ieee80211MixedHtDiscovery_1.test, and updateslan80211acPing1plus 12 legacy configuration fingerprints with causal provenance.385e01373a—ieee80211: apply mode-set consumers before notificationSynchronously updates transmitter, receiver, MAC HT capabilities, rates, channel access, and rate selectors before publishing
modesetChangedSignal; enforces fail-fast error handling; addsIeee80211ModeSetTransition_1.testandIeee80211ModeSetFailure_1.test.d400a5a2f5—ieee80211: enforce SSID element length boundsEnforces 0..32 octet bounds on SSID serialization and deserialization across management frames; adds tests in
Ieee80211SupportedRates_1.test.e4e39e24c4—ieee80211: mark malformed response AIDs incorrectHandles malformed wire AIDs in (re)association responses by marking the frame incorrect and substituting zero instead of throwing
cRuntimeError; adds tests inIeee80211MgmtFrameSerializer_1.test.Architectural Surface
• Contracts and Interfaces:
IIeee80211Mode: AddedgetDataGuardInterval()requirement.IIeee80211ModeSetListener: Synchronous participant callback interface for coordinated mode-set switching.Ieee80211Radio/Ieee80211Transmitter: AddedsetModeSetAndMode(const Ieee80211ModeSet *, const IIeee80211Mode *)with membership verification and typed consumer pre-notification phase.• Configuration Surface:
RateSelection.ned&QosRateSelection.ned: Addedstring dataFrameGuardInterval = default("unspecified");("long","short", or"unspecified").• Signals and Observability:
modesetChangedSignalonIeee80211Radio, emitted on mode-set changes and subscribed byIeee80211Mac.• Wire Representation and Parsing:
• Documentation and Migration Guide:
WHATSNEWanddoc/src/migration-guide/index.rstcoveringgetDataGuardInterval(), mode-set lookup changes, and listener interface migration.• Sealing and Audit Exceptions:
src/inet/linklayer/ieee80211andsrc/inet/physicallayer/wireless/ieee80211. All touched paths are unsealed.AV-*) or naming deviations (NV-*) introduced.Baselines
Updated 13 test configurations across
tests/fingerprint/examples.csv,tests/fingerprint/showcases.csv,tests/fingerprint/tutorials.csv, andtests/fingerprint/store.json(carried in commit 99039d75807perPR-SPLIT-BASELINE):/examples/wireless/lan80211ac/Ping1run 0 (100s):tests/fingerprint/examples.csv: updated frombb14-f903/tplx;538b-6566/~tNlto8180-0d11/tplx;a5d5-2820/~tNl.tests/fingerprint/store.json: synchronized matching entries; the stale~tNlentry (1108-9845) now matches the verified run.12 Legacy Configurations Configured for 54 Mbps:
examples/manetrouting/multiradio:SingleRadioandMultiRadioshowcases/general/pcaprecording:PcapRecordingshowcases/visualizer/canvas/statistic:PacketErrorRateshowcases/visualizer/canvas/submoduleinfo:MACStatesandPacketCountsshowcases/wireless/analogmodel:Distanceshowcases/wireless/power:Generalshowcases/wireless/qos:NonQosandQostutorials/configurator:Step9andStep10CPacketCounts, event 11 at 0.01 s switches from 54 Mbps to 24 Mbps).selectGroupAddressedMode's restriction restores all 12 original baselines while retaining the other changes. These 12 CSV rows and their 34 matching JSON fingerprints retain their existing simulation limits and non-graphical ingredients.Verification Evidence
Compilation:
make -j$(nproc) MODE=debug && make -j$(nproc) MODE=releaseBoth debug (
libINET_dbg.so) and release (libINET.so) build cleanly without errors.Mechanical Project Gates:
doc/project/enforcement/check-commits.sh upstream/master..HEAD(PASS, 12/12 clean commits)doc/project/enforcement/check-source-seals.sh --base upstream/master(PASS, all touched files unsealed)doc/project/enforcement/check-architecture.sh src/inet/linklayer/ieee80211(PASS)doc/project/enforcement/check-architecture.sh src/inet/physicallayer/wireless/ieee80211(PASS)doc/project/enforcement/check-naming.sh --base upstream/master(PASS, 0 new declarations in changed NED/MSG files)git diff --check upstream/master..HEAD(PASS, clean formatting)Direct Unit Tests (4/4 PASS):
Ieee80211HtGuardInterval_1.test: PASSIeee80211PeerModeSelection_1.test: PASSIeee80211SupportedRates_1.test: PASSIeee80211MgmtFrameSerializer_1.test: PASSDirect Module Tests (3/3 PASS):
Ieee80211MixedHtDiscovery_1.test: PASSIeee80211ModeSetFailure_1.test: PASSIeee80211ModeSetTransition_1.test: PASSFingerprint Regression Tests (PASS):
lan80211ac.*Ping1):Ran 1 test in 47.694s OKtyffingerprints per INET testing policy):Ran 56 tests in 35.822s OK