ieee80211: add Minstrel rate control for HT and VHT - #1186
Open
mgonzalezlopezudc wants to merge 12 commits into
Open
ieee80211: add Minstrel rate control for HT and VHT#1186mgonzalezlopezudc wants to merge 12 commits into
mgonzalezlopezudc wants to merge 12 commits into
Conversation
Keep incidental end-of-file changes separate from the rate-control fixes so their functional diffs contain only the behavior being reviewed. Remove surplus final blank lines from the affected MAC files and terminate the migration guide with a newline.
Host-level beacon-loss subscriptions receive notifications from other WLANs. Scanning in response disassociates healthy interfaces and can interrupt an existing scan. Match the notification payload to the containing NIC. Cover independent beacon timeouts and overlapping scans on two WLANs.
Elapsed-time probing and failure handling diverged from INRIA RR-5208, Appendix A. Failed attempts preserved success streaks, triggered fallback too early or ended recovery before a successful transmission. Advance the timer from packet feedback and space ordinary fallback using the MAC retry count. Keep recovery until success, adapt the packet timeout with the success threshold, and cap threshold growth. Only an actual rate increase starts a probe; idle queries cannot change adaptation state. Replace interval with packet-timer parameters and document migration. Cover DCF/HCF feedback, receiver isolation, recovery, timer boundaries and rate bounds, and adapt the showcase configuration to the packet timer. AarfRateControl and InstrumentShowcase both use the corrected controller. Their existing tplx, ~tNl and ~tND expectations in showcases.csv and store.json belong with this correction: the packet-feedback transitions change adaptation and delivery trajectories. Module assertions cover the intended state transitions. Graphical expectations remain unchanged.
Counting individual retries mixed unfinished packets into samples and could count a failure again at success. Small samples earned credit too quickly, and failed-only intervals could leave the controller at an unusable rate. Follow MadWifi ath_rate/onoe/onoe.c at revision a7531fd223a1f454d3fd74a975b4581cde5411bb for completed normal-ACK feedback. Consume terminal recovery counts once before evaluating a due sample. Require ten completions for ordinary decisions, compare retries directly with successes, prohibit upward credit after errors, and retain small samples unless the rate changes. Failed-only samples can lower the rate. Preserve integer truncation and bounded credit, suppress false rate-change signals, and keep queries from consuming deadlines. Cover arithmetic and sample boundaries, receiver isolation, mode resets and real DCF/HCF completion counts, including interleaved HCF retries.
Lost CTS responses were absent from Onoe retry samples, and RTS exhaustion did not report a completed error. Supply the protected packet's short-plus- long retry total through DCF and HCF before recovery cleanup so each terminal outcome is counted once. Retire both recovery counters at completion to avoid stale totals when identities are reused. RateControlBase adapters preserve legacy data-attempt feedback, including AARF behavior. Document the new hooks, overload visibility and migration requirements for direct IRateControl implementations. Cover mixed RTS/data failures, both exhaustion paths, recovery cleanup and protected management frames.
QoS sequence numbers are allocated per receiver and TID, so different peers can have identical sequence and fragment numbers. Include the receiver in the shared retry key to prevent interleaved feedback and completion cleanup from reading or erasing another peer's counters. Cover clean reads, short and long counters, retry limits and terminal cleanup with interleaved peers in the recovery module test.
Use the MadWifi startup ceiling for automatic local OFDM/ERP selection, so the built-in 11a/11g sets start at 36 Mbps. HR-DSSS starts at its fastest rate. Explicit initialRate values retain precedence, and HT/VHT retain the fastest-mandatory default. The contract supplies local modes without negotiated legacy peer rates; document that limit while preserving shared RateControlBase behavior. Cover defaults, overrides, invalid rates, peer initialization, signals and mode-set resets.
HCF discarded packets at the internal-collision retry limit without reporting a completed sample to Onoe. Notify rate control before recovery clears the short and long counters so Onoe records the give-up and its full retry total. Use a distinct terminal-drop hook with a no-op RateControlBase default to preserve legacy AARF attempt feedback. Document internal-collision accounting as an INET modeling choice and cover QoS data and management drops with pure and mixed recovery histories.
Record the Onoe alignment plan and its multirate retry design so attempt ownership, retry-limit precedence and PHY-rate verification requirements are reviewable before implementation.
Rate controllers that retain a retry plan need the packet identity when selecting a mode, including repeated queries used to calculate protection durations. Pass the borrowed packet through both DCF and HCF selectors. RateControlBase forwards the new query to the receiver-address query so existing AARF and Onoe controllers retain their selection behavior. Direct IRateControl implementations must implement getRateForFrame; selector subclasses must accept the leading Packet argument in their override.
HT/VHT adaptation must compare expected delivery per airtime across MCS, channel width, guard interval and spatial-stream groups. Use the Linux v4.19 Minstrel-HT policy for per-peer Q12 EWMA estimates, throughput ranking, probing and multirate retry plans. Keep each packet's plan stable across duration queries and independent QoS queues. Credit feedback to the transmitted mode and invalidate stale plans when the mode set or negotiated HT capabilities change. Count additional retry attempts only while total airtime stays strictly below the segment budget, retaining the two-attempt minimum and configured retry cap. Reuse the PHY catalog and HT peer eligibility. Individual normal-ACK feedback is required; VHT width and stream limits remain configured because VHT capabilities are not negotiated by this model. Reference tests cover arithmetic and retry boundaries; eligibility tests cover negotiated constraints and invalidation. HT/VHT exchange tests exercise probes, fallbacks, delivery and adaptation through DCF and HCF.
Provide associated HT and configured-capability VHT traffic examples so users can select the controller and observe preferred and transmitted rates. Dimensional radios represent spectral overlap during width changes. Document the pinned Linux v4.19 rules, INET airtime adaptations, normal-ACK feedback limits, extension API migration and focused validation commands. The examples establish functional delivery rather than a statistical throughput advantage.
mgonzalezlopezudc
force-pushed
the
feat/ieee80211-minstrel
branch
from
September 11, 2026 03:03
ee2093d to
15c5984
Compare
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.
What
Add
MinstrelHtRateControl, implementing the Linux v4.19 Minstrel-HT rate adaptation algorithm for IEEE 802.11 HT and VHT. This includes per-peer Q12 EWMA probability tracking, throughput ranking across modulation, channel width, guard interval, and spatial-stream groups, deterministic sampling permutations, and multi-rate retry plans.Also introduces packet-aware rate control queries in
IRateControl/RateControlBaseand wires them throughRateSelectionandQosRateSelection, ensuring retry plans remain stable across repeated duration queries and independent QoS queues while preserving legacy AARF and Onoe behavior.Why
Existing INET rate adaptation algorithms (AARF and Onoe) are designed for single-stream legacy rates and single scalar retry feedback. IEEE 802.11n (HT) and 802.11ac (VHT) introduce multi-dimensional operational spaces (MCS, 20/40/80/160 MHz bandwidths, short/long GI, and multiple spatial streams) where rates cannot simply be ordered by nominal bitrate:
Stack and reading order
Built on top of PR #1176 (
fix/ieee80211-agent-rate-control, head9dcd62d999a0b9e03655fbe33ece71f5e36e0b57).Target:
master. Range:9dcd62d999..15c5984876.The topic branch has been cleaned up into a 3-commit reviewable series:
dba8b5d5e4—ieee80211: pass packets to rate-control queriesIRateControlwithgetRateForFrame(Packet *frame)and threads borrowed frame access throughRateSelectionandQosRateSelection. Multirate retry controllers need packet identity to preserve retry plans across duration queries and independent QoS queues.9dcd62d999.src/inet/linklayer/ieee80211/mac/contract/IRateControl.hsrc/inet/linklayer/ieee80211/mac/ratecontrol/RateControlBase.hsrc/inet/linklayer/ieee80211/mac/ratecontrol/RateControlBase.ccsrc/inet/linklayer/ieee80211/mac/rateselection/RateSelection.hsrc/inet/linklayer/ieee80211/mac/rateselection/RateSelection.ccsrc/inet/linklayer/ieee80211/mac/rateselection/QosRateSelection.hsrc/inet/linklayer/ieee80211/mac/rateselection/QosRateSelection.ccRateControlBasedelegatesgetRateForFrametogetRate(dest)to preserve legacy controller compatibility. Clean build; AARF and Onoe regression tests pass.dafe31ba2b—ieee80211: add Minstrel rate control for HT and VHTMinstrelHtRateControl) and its internal packet metadata tag (MinstrelRateControlTag). Implements Q12 EWMA estimates, airtime-throughput ranking across HT/VHT groups, deterministic sampling, and 4-stage multirate retry plans sized strictly below the segment airtime budget.dba8b5d5e4).src/inet/linklayer/ieee80211/mac/ratecontrol/MinstrelHtRateControl.hsrc/inet/linklayer/ieee80211/mac/ratecontrol/MinstrelHtRateControl.ccsrc/inet/linklayer/ieee80211/mac/ratecontrol/MinstrelHtRateControl.nedsrc/inet/linklayer/ieee80211/mac/ratecontrol/MinstrelRateControlTag.msgtests/module/MinstrelHtRateControlEligibility_1.testtests/module/MinstrelHtRateControlHtExchange_1.testtests/module/MinstrelHtRateControlReference_1.testtests/module/MinstrelHtRateControlVhtExchange_1.test15c5984876—examples: demonstrate Minstrel HT and VHT rate adaptationdafe31ba2b).examples/wireless/minstrel/MinstrelRateControlNetwork.nedexamples/wireless/minstrel/omnetpp.iniexamples/wireless/minstrel/README.mdHtandVhtsimulation configs delivering 2900 UDP packets with observable rate adaptation up to 130 Mbit/s (HT) and 173.33 Mbit/s (VHT).Architectural Surface
• Modules touched / added:
•
src/inet/linklayer/ieee80211/mac/contract/IRateControl.h•
src/inet/linklayer/ieee80211/mac/ratecontrol/RateControlBase.h•
src/inet/linklayer/ieee80211/mac/ratecontrol/RateControlBase.cc•
src/inet/linklayer/ieee80211/mac/ratecontrol/MinstrelHtRateControl.h•
src/inet/linklayer/ieee80211/mac/ratecontrol/MinstrelHtRateControl.cc•
src/inet/linklayer/ieee80211/mac/ratecontrol/MinstrelHtRateControl.ned•
src/inet/linklayer/ieee80211/mac/ratecontrol/MinstrelRateControlTag.msg•
src/inet/linklayer/ieee80211/mac/rateselection/RateSelection.h•
src/inet/linklayer/ieee80211/mac/rateselection/RateSelection.cc•
src/inet/linklayer/ieee80211/mac/rateselection/QosRateSelection.h•
src/inet/linklayer/ieee80211/mac/rateselection/QosRateSelection.cc•
examples/wireless/minstrel/MinstrelRateControlNetwork.ned•
examples/wireless/minstrel/omnetpp.ini•
examples/wireless/minstrel/README.md•
tests/module/MinstrelHtRateControlEligibility_1.test•
tests/module/MinstrelHtRateControlHtExchange_1.test•
tests/module/MinstrelHtRateControlReference_1.test•
tests/module/MinstrelHtRateControlVhtExchange_1.test• Contracts and protocols:
•
IRateControlgains packet-aware selectorconst physicallayer::IIeee80211Mode *getRateForFrame(Packet *frame).RateControlBaseroutes this togetRate(dest)by default to preserve legacy controller compatibility.•
RateSelectionandQosRateSelectionpassPacket *into protectedcomputeDataOrMgmtFrameMode.• Packet representation:
• Transient
MinstrelRateControlTag(extendsTagBase) attaches rate and retry plan state to packets within the node. No packet wire formats, headers, or serialized chunks are modified.• Configuration surface:
• New NED module
MinstrelHtRateControl(inet.linklayer.ieee80211.mac.ratecontrol.MinstrelHtRateControl) with shipped parameters:•
interval(double,@unit(s), default:50ms): positive statistics update interval.•
packetLength(int,@unit(B), default:1200B): positive reference MPDU length for airtime ranking.•
retrySegmentDuration(double,@unit(s), default:6ms): positive per-stage airtime budget for retry count sizing.•
maxRetryCount(int, default:7): cap for sizing retry stages in [2, 64] (MAC recovery owns termination).•
maxChannelWidth(double,@unit(Hz), default:20MHz): positive common operational channel width ceiling.•
maxNumSpatialStreams(int, default:-1):-1uses local antenna count; otherwise positive peer ceiling.•
probeEnabled(bool, default:true): enables sampling probes (disable only for controlled fixed-candidate experiments).• Module references:
mibModule(default:"^.^.^.mib"),radioModule(default:"^.^.^.radio").• Feature descriptors: None modified.
• Seals and audit exceptions: All modified source paths under
src/inet/are unsealed. No new architectural deviations (AV-*) or naming deviations (NV-*) introduced.Baselines
No fingerprint or statistical baseline updates required. Existing rate-control fingerprints remain unchanged.
Verification Evidence
(Recorded from commit validation and
examples/wireless/minstrel/README.md):Compilation:
make MODE=debug -j$(nproc)Status: Clean build in debug mode (
libINET_dbg.so).Mechanical gates:
•
doc/project/enforcement/check-commits.sh 9dcd62d999..HEAD(PASS, 3 commits)•
doc/project/enforcement/check-source-seals.sh --base 9dcd62d999(PASS)• Scoped naming and architecture checks on
src/inet/linklayer/ieee80211/mac(PASS)Direct module tests:
•
tests/module/MinstrelHtRateControlReference_1.test(PASS): verifies EWMA Q12 math, throughput calculation, retry plans, and sample selection boundaries.•
tests/module/MinstrelHtRateControlEligibility_1.test(PASS): verifies peer capabilities, antenna limits, MCS masks, and channel widths.•
tests/module/MinstrelHtRateControlHtExchange_1.test(PASS): verifies DCF and HCF HT 20 MHz exchanges, probe and fallback transmissions, and upward rate adaptation.•
tests/module/MinstrelHtRateControlVhtExchange_1.test(PASS): verifies DCF and HCF VHT 80 MHz exchanges, probes, fallbacks, and adaptation.Existing regressions and baselines:
•
tests/module/AarfRateControlRetryFeedback_1.test(PASS)•
tests/module/OnoeRateControlRetryFeedback_1.test(PASS)•
tests/module/OnoeRateControlInterleavedFeedback_1.test(PASS)•
tests/module/Ieee80211HtAntennaRateControl_1.test(PASS)•
./fingerprinttest -d -m 'wireless/ratecontrol' -f 'tplx' -f '~tNl' -f '~tND'(PASS: all 3 rate-control fingerprints unchanged)Example network execution:
•
inet --debug -u Cmdenv -f omnetpp.ini -c Ht -r 0(delivers 2900 UDP packets; preferred PHY rate adapts up to 130 Mbit/s)•
inet --debug -u Cmdenv -f omnetpp.ini -c Vht -r 0(delivers 2900 UDP packets; preferred PHY rate adapts up to 173.33 Mbit/s)