Skip to content

ieee80211: fix beacon-loss interface scoping and AARF/Onoe rate adaptation - #1176

Open
mgonzalezlopezudc wants to merge 9 commits into
inet-framework:masterfrom
mgonzalezlopezudc:fix/ieee80211-agent-rate-control
Open

ieee80211: fix beacon-loss interface scoping and AARF/Onoe rate adaptation#1176
mgonzalezlopezudc wants to merge 9 commits into
inet-framework:masterfrom
mgonzalezlopezudc:fix/ieee80211-agent-rate-control

Conversation

@mgonzalezlopezudc

@mgonzalezlopezudc mgonzalezlopezudc commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Overview and Motivation

This pull request resolves defects and specification divergences across IEEE 802.11 STA management (Ieee80211AgentSta) and rate control modules (OnoeRateControl and AarfRateControl):

  1. Ieee80211AgentSta beacon-loss interface scoping:
    Beacon loss notifications were received host-wide instead of being scoped to the emitting interface. On multi-interface WLAN hosts, beacon losses on one interface incorrectly triggered disassociation and scan procedures on other interfaces, interrupting active connections or scans. The notification is now filtered against the containing NIC interface ID.

  2. OnoeRateControl failed-only interval adaptation and minimum rate guard:
    OnoeRateControl required a successful transmission before evaluating sample intervals. When all transmissions in an interval failed, Onoe never triggered a rate reduction, leaving the station stuck at a rate that could not deliver packets. The fix evaluates completed failed-only samples, lowers the rate, and clears counters without dividing by zero while preserving idle and unfinished intervals. Furthermore, when already at the minimum rate, the sample and credit are reset without reporting a rate transition, keeping datarateChanged notifications tied to actual decreases.

  3. OnoeRateControl retry feedback accounting:
    A failed attempt and its subsequent successful retry both carry positive recovery counts. Counting both callbacks doubled the retry estimate, causing premature rate reduction when every frame needed only one retry. Unsuccessful feedback is now counted once, and give-up callbacks are excluded from total attempts since their final failure is already counted.

  4. AarfRateControl canonical RR-5208 recovery and packet feedback semantics:
    Elapsed wall-clock timers and retry failure counter handling diverged from the canonical INRIA RR-5208 Appendix A specification:

    • Packet feedback advances the timer instead of wall-clock time, and the MAC retry count spaces ordinary fallback.
    • Recovery mode is preserved across failures until a successful transmission occurs.
    • The packet timeout adapts together with the success threshold, and threshold growth is capped at maxSuccessThreshold.
    • Probing is armed only when an actual rate increase occurs, avoiding premature fallback at the maximum rate.
    • Consecutive failures and success streaks are tracked per receiver, and the success streak resets upon any failure.
    • In AarfRateControl.ned, deprecated interval in favor of packetTimer (default: false), packetTimeoutInterval (default: 60s), and packetTimeoutMaxInterval (default: 60s), documented in doc/src/migration-guide/index.rst.
    • Updates recorded fingerprint expectations for showcases/wireless/ratecontrol/ and showcases/visualizer/canvas/instrumentfigures/.

Series Reading Order

  1. a6b030e3db ieee80211agentsta: scope beacon loss to the emitting interface
    Filters incoming beacon-loss notifications against the containing NIC interface ID.
    Adds two-WLAN regression test tests/module/Ieee80211AgentStaBeaconLoss_1.test.

  2. cf01b231ba onoeratecontrol: lower the rate after failed-only intervals
    Evaluates completed sample intervals even when success count is zero, preventing rate deadlock on failed links. Suppresses false datarateChanged notifications and logging when already at the minimum rate.
    Adds regression test tests/module/OnoeRateControlFailureInterval_1.test.

  3. a3e28558f1 onoeratecontrol: count each failed attempt once
    Fixes duplicate callback accounting by counting unsuccessful feedback once and excluding give-up callbacks from total attempts.
    Adds regression tests tests/module/OnoeRateControlRetryAccounting_1.test and tests/module/OnoeRateControlRetryFeedback_1.test.

  4. 00e2b95b02 aarfratecontrol: follow RR-5208 packet feedback semantics
    Aligns recovery, probe arming, per-receiver tracking, and timer behavior with RR-5208 Appendix A. Deprecates interval in favor of packet timer parameters with migration documentation. Covers DCF/HCF feedback, receiver isolation, recovery, timer boundaries, and rate bounds, and adapts the showcase configuration to the packet timer.
    Adds/updates 14 regression tests:
    tests/module/AarfRateControlFailureStreak_1.test,
    tests/module/AarfRateControlFreshFrameFeedback_1.test,
    tests/module/AarfRateControlGroupAddressed_1.test,
    tests/module/AarfRateControlMaximumRate_1.test,
    tests/module/AarfRateControlPerReceiver_1.test,
    tests/module/AarfRateControlRecovery_1.test,
    tests/module/AarfRateControlRetryFeedback_1.test,
    tests/module/AarfRateControlSuccessStreak_1.test,
    tests/module/AarfRateControlThresholdCap_1.test,
    tests/module/AarfRateControlThresholdOne_1.test,
    tests/module/AarfRateControlTimerFeedback_1.test,
    tests/module/AarfRateControlTimerProbe_1.test,
    tests/module/AarfRateControlTimerSuccessStreak_1.test, and
    tests/module/Ieee80211HtAntennaRateControl_1.test.
    Carries recorded fingerprint expectations for showcases/wireless/ratecontrol/ and showcases/visualizer/canvas/instrumentfigures/.

Architectural Surface

• Modules touched:
src/inet/linklayer/ieee80211/mgmt/Ieee80211AgentSta.cc
src/inet/linklayer/ieee80211/mac/ratecontrol/OnoeRateControl.cc
src/inet/linklayer/ieee80211/mac/ratecontrol/OnoeRateControl.h
src/inet/linklayer/ieee80211/mac/ratecontrol/AarfRateControl.cc
src/inet/linklayer/ieee80211/mac/ratecontrol/AarfRateControl.h
src/inet/linklayer/ieee80211/mac/ratecontrol/AarfRateControl.ned
doc/src/migration-guide/index.rst
showcases/wireless/ratecontrol/omnetpp.ini
tests/fingerprint/showcases.csv
• Contracts and protocols: IEEE 802.11 MAC rate adaptation (IRateControl / RateControlBase) and STA management lifecycle (Ieee80211AgentSta).
• Packet representation: No changes to packet structures, headers, chunks, or tags.
• Configuration surface:
• In AarfRateControl.ned, deprecated interval in favor of packetTimer (default: false), packetTimeoutInterval (default: 60s), and packetTimeoutMaxInterval (default: 60s), documented in doc/src/migration-guide/index.rst.
• Parameters decreaseThreshold, increaseThreshold, and maxSuccessThreshold now operate strictly per specification.
• Feature descriptors: None touched.
• Seals and audit exceptions: All modified source files under src/inet/ are unsealed. No new architectural deviations (AV-*) or naming deviations (NV-*) introduced.

Verification Evidence

  1. Compilation:
    make -j$(nproc) MODE=debug && make -j$(nproc) MODE=release
    Status: Clean build in both debug and release modes (libINET_dbg.so and libINET.so).

  2. Mechanical gates:
    doc/project/enforcement/check-commits.sh upstream/master..HEAD (PASS)
    doc/project/enforcement/check-source-seals.sh --base upstream/master (PASS)
    doc/project/enforcement/check-naming.sh --base upstream/master (PASS)
    doc/project/enforcement/check-architecture.sh src/inet/linklayer/ieee80211 (PASS)

  3. Direct module tests against fresh library:
    tests/module/Ieee80211AgentStaBeaconLoss_1.test: PASS
    tests/module/OnoeRateControlFailureInterval_1.test: PASS
    tests/module/OnoeRateControlRetryAccounting_1.test: PASS
    tests/module/OnoeRateControlRetryFeedback_1.test: PASS
    tests/module/AarfRateControlFailureStreak_1.test: PASS
    tests/module/AarfRateControlFreshFrameFeedback_1.test: PASS
    tests/module/AarfRateControlGroupAddressed_1.test: PASS
    tests/module/AarfRateControlMaximumRate_1.test: PASS
    tests/module/AarfRateControlPerReceiver_1.test: PASS
    tests/module/AarfRateControlRecovery_1.test: PASS
    tests/module/AarfRateControlRetryFeedback_1.test: PASS
    tests/module/AarfRateControlSuccessStreak_1.test: PASS
    tests/module/AarfRateControlThresholdCap_1.test: PASS
    tests/module/AarfRateControlThresholdOne_1.test: PASS
    tests/module/AarfRateControlTimerFeedback_1.test: PASS
    tests/module/AarfRateControlTimerProbe_1.test: PASS
    tests/module/AarfRateControlTimerSuccessStreak_1.test: PASS
    tests/module/Ieee80211HtAntennaRateControl_1.test: PASS

  4. Baselines:
    showcases/wireless/ratecontrol/omnetpp.ini and tests/fingerprint/showcases.csv updated for AarfRateControl showcase changes per RR-5208 packet timer semantics (in commit 00e2b95b02).
    tests/fingerprint/showcases.csv updated for showcases/visualizer/canvas/instrumentfigures/ (InstrumentShowcase uses AarfRateControl with decreaseThreshold = 4) whose trajectory shifted per RR-5208 packet timer semantics (in commit 00e2b95b02).

@mgonzalezlopezudc
mgonzalezlopezudc force-pushed the fix/ieee80211-agent-rate-control branch 4 times, most recently from 00e2b95 to 6d7b49c Compare September 10, 2026 15:30
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.
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