Skip to content

IEEE 802.11: negotiate and maintain STA HT associations - #1172

Open
mgonzalezlopezudc wants to merge 8 commits into
inet-framework:masterfrom
mgonzalezlopezudc:pr/ht-02-sta-association
Open

IEEE 802.11: negotiate and maintain STA HT associations#1172
mgonzalezlopezudc wants to merge 8 commits into
inet-framework:masterfrom
mgonzalezlopezudc:pr/ht-02-sta-association

Conversation

@mgonzalezlopezudc

@mgonzalezlopezudc mgonzalezlopezudc commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Association responses must match the pending procedure and peer, and HT negotiation must reject malformed advertisements without corrupting discovery or retained associations. Add correlated STA transactions, validated discovery, lifecycle cleanup, committed-state reassociation handling, peer-aware rates, AID wire validation, and simplified association restoration.

Stack and reading order

PR 2/4. Head: pr/ht-02-sta-association. Target: master (PR 1/4 #1167 merged). Range: b61cd671d429..1ded7e8cdd1b. Read the following commits in order:

  • 441ff2701b — ieee80211: keep management transaction metadata local
  • fe876073fc — ieee80211: model detailed association transactions
  • 2108cb5ec5 — ieee80211: negotiate HT from validated discovery state
  • 80d1c66987 — ieee80211: preserve peer ownership during STA teardown
  • cfcd73de3b — ieee80211: report reassociation completion from committed state
  • 74b40b81b8 — ieee80211: select rates from negotiated HT capabilities
  • 6627fcf3f1 — ieee80211: validate association ID wire encoding
  • 1ded7e8cdd — ieee80211: restore simplified associations across lifecycle changes

Architectural surface

Local transaction tags and fragmentation/receive boundaries, STA management primitives and lifecycle, peer HT state, DCF/HCF rate selection, and Association ID serialization.

Baselines

C16 (74b40b81b8) carries the TXOP fingerprint transition caused by peer-aware rate selection. C17 (6627fcf3f1) carries thirty data-byte transitions for corrected Association ID encoding. No other baseline changes are included.

Verification

C11–C12 have passing per-commit debug builds and scoped opp_repl tests. C13–C18 and this PR tip were not tested separately, per the requested final-only verification. The complete stack passed the final build and test union.

The full-stack recorded build command was make MODE=debug -j$(nproc). The scoped unit/module/queueing runs used opp_repl --load @opp -p inet, with exact run_opp_tests calls in the retained .final.tests.py execution artifact. Fingerprints used fingerprinttest -d -q -f tplx -f "~tNl" -f "~tND" with the retained explicit 37-row CSV. Exact commands, selectors, statuses, and source-tree mappings are in the accompanying execution report.


Devin Review

Management transaction identity belongs to the originating packet domain. Preserve it when fragmenting a local packet, including correctly clipped region tags, but remove sender-local tags at the receiving PHY boundary so the receiver cannot interpret a remote identity as its own transaction.
Association and reassociation confirmations must identify the pending procedure and expected peer. Correlate response subtypes with explicit transaction state, clear timed-out work, and restore the retained AP channel after a failed reassociation so a late or mismatched response cannot complete the wrong operation.
HT discovery must not cache malformed capability or channel tuples, and an unusable HT exchange must not turn an otherwise successful association into a failure. Validate advertisements before updating discovery state, retain discovery Basic HT-MCS requirements for association, and install peer HT state only when negotiation is usable.

Track the AP primary channel through the common radio-facing management path so operation elements use the correct standards channel identity.
STA shutdown and peer teardown must release the timers and transactions they own. Cancel scan, authentication, association, and beacon work consistently, while preserving a pending transaction for another peer when the current association is terminated.
A failed reassociation may leave the original association intact, so scan-retry policy must consult committed MIB state. Update the previous-AP identity before emitting handover notifications so listeners observe the completed transition.
A locally supported HT rate may exceed a peer's advertised receive capabilities. Filter DCF/HCF candidates using the exact negotiated MCS, width, guard-interval, and stream constraints, including sparse MCS sets, and use a deterministic legacy fallback when no HT candidate remains.

The accompanying TXOP fingerprint transition records the frame-exchange trajectory produced by the corrected rate choices.
The Association ID wire marker is separate from the logical association identifier. Validate the logical value and response status, add the marker while encoding, and remove and check it while decoding. Existing little-endian encoding remains unchanged.

The thirty data-byte fingerprint transitions account for the corrected Association ID bytes in management responses.
Simplified association needs peer identity during staged initialization and must survive stop/start without stale bilateral state. Establish identity at the required stages, remove peer state on stop, and restore both sides when the interface starts again.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 3 potential issues.

3 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)

Devin Review

Comment on lines +83 to +86
void Ieee80211MgmtBase::addHtOperation(const Ptr<Ieee80211MgmtFrame>& frame, const physicallayer::IIeee80211Band *band) const
{
if (mib->isHtOperationSupported())
setHtOperation(frame, band, mib->getHtOperation());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Detailed associations remain legacy

HT-capable detailed access points never call addHtOperation or addHtCapabilities for advertisements and successful responses. Stations classify these responses as legacy, so ordinary detailed associations cannot use HT rates.

Prompt for agents
Complete detailed AP HT negotiation. In src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtAp.cc, add HT Capabilities and HT Operation to HT-capable Beacon, Probe Response, Association Response, and Reassociation Response bodies, using the AP radio band and updating chunk lengths. Parse and validate the station HT Capabilities from association and reassociation requests. Commit the AP-side peer HT state only when the successful response exchange completes, and clear it on all existing teardown paths. Add an end-to-end test using the production detailed AP and STA rather than synthetic response bodies, proving both sides install peer state and select HT rates.
Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +1229 to +1239
ap->htCapabilitiesPresent = candidate.htCapabilitiesPresent;
ap->htCapabilities = candidate.htCapabilities;
ap->htOperationPresent = candidate.htOperationPresent;
ap->htOperation = candidate.htOperation;
ap->beaconInterval = candidate.beaconInterval;
ap->rxPower = candidate.rxPower;
ap->isAuthenticated = candidate.isAuthenticated;
ap->authSeqExpected = candidate.authSeqExpected;
ap->authTimeoutMsg = candidate.authTimeoutMsg;
if (signalPowerInd != nullptr && currentAp)
assocAP.rxPower = candidate.rxPower;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Beacon changes leave rates stale

When an associated AP changes its HT advertisement, storeAPInfo refreshes discovery data but not negotiated peer state. Rate selection can keep using an obsolete channel width or unsupported MCS.

Prompt for agents
Maintain the current association when an accepted Beacon refreshes the associated AP in src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtSta.cc. Revalidate the refreshed HT Capabilities and HT Operation, update the associated snapshot, and recompute the MIB peer HT state before subsequent rate selection. Define and test the transition when HT elements disappear or become unusable. Add focused tests where an associated AP changes from 40 MHz to 20 MHz and changes its usable MCS set, then verify both DCF and HCF immediately stop selecting the old modes.
Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +68 to +73
const auto *radioContract = dynamic_cast<const physicallayer::IRadio *>(radio);
if (radioContract == nullptr)
throw cRuntimeError("HT Operation channel conversion requires radioModule to reference a radio, got %s", radio->getClassName());
const auto *transmitter = dynamic_cast<const physicallayer::Ieee80211Transmitter *>(radioContract->getTransmitter());
if (transmitter == nullptr)
throw cRuntimeError("HT Operation channel conversion requires radioModule's transmitter to provide an IEEE 802.11 channel");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Alternative radios fail initialization

An HT access point requires Ieee80211Transmitter despite accepting any configured IRadio. A valid alternative radio implementation therefore aborts initialization instead of supplying its channel through a contract.

Prompt for agents
Remove the management-to-concrete-PHY dependency in src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtApBase.cc. Expose the IEEE 802.11 channel or band through an existing mode/radio contract, a typed notification, or a dedicated interface that all compatible radio variants can implement. Keep HT operation validation against that abstract source. Add a test with a substitutable IRadio implementation whose transmitter is not Ieee80211Transmitter.
Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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