IEEE 802.11: negotiate and maintain STA HT associations - #1172
IEEE 802.11: negotiate and maintain STA HT associations#1172mgonzalezlopezudc wants to merge 8 commits into
Conversation
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.
There was a problem hiding this comment.
Devin Review found 3 potential issues.
3 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
| void Ieee80211MgmtBase::addHtOperation(const Ptr<Ieee80211MgmtFrame>& frame, const physicallayer::IIeee80211Band *band) const | ||
| { | ||
| if (mib->isHtOperationSupported()) | ||
| setHtOperation(frame, band, mib->getHtOperation()); |
There was a problem hiding this comment.
🔴 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
| 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; |
There was a problem hiding this comment.
🔴 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
| 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"); |
There was a problem hiding this comment.
🟡 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
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 localfe876073fc— ieee80211: model detailed association transactions2108cb5ec5— ieee80211: negotiate HT from validated discovery state80d1c66987— ieee80211: preserve peer ownership during STA teardowncfcd73de3b— ieee80211: report reassociation completion from committed state74b40b81b8— ieee80211: select rates from negotiated HT capabilities6627fcf3f1— ieee80211: validate association ID wire encoding1ded7e8cdd— ieee80211: restore simplified associations across lifecycle changesArchitectural 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 usedopp_repl --load @opp -p inet, with exactrun_opp_testscalls in the retained.final.tests.pyexecution artifact. Fingerprints usedfingerprinttest -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.