Skip to content

ieee80211: defer radio commands until Tx becomes idle - #1280

Open
mgonzalezlopezudc wants to merge 1 commit into
inet-framework:masterfrom
mgonzalezlopezudc:fix/ieee80211-radio-command-deferral
Open

mgonzalezlopezudc wants to merge 1 commit into
inet-framework:masterfrom
mgonzalezlopezudc:fix/ieee80211-radio-command-deferral

Conversation

@mgonzalezlopezudc

@mgonzalezlopezudc mgonzalezlopezudc commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

A radio command can reach the radio before an accepted acknowledgment (ACK) frame starts transmission.
This affects simulations that reconfigure an IEEE 802.11 radio during a response.
The MAC previously checked only whether the medium was free, which cannot identify a response that waits to start.
The MAC now keeps the command until the accepted transmission completes.

Medium access control (MAC) controls channel access and exchanges frames.
Tx is the MAC component that transmits frames immediately or after a specified delay.
For example, Tx accepts an ACK and waits through the short interframe space (SIFS) before transmission.
A radio command arrives during SIFS, when the medium can still be free.
The MAC keeps that command until the ACK completes, so radio reconfiguration follows the response.
The focused module test exercises this condition and checks command deferral, ACK completion, and command release.

Custom implementations of ITx, the interface for Tx, need the new hasTransmission() method to compile.
Simulations that reconfigure radios can observe a later command and a different event order.

Commit and contracts

  • 61bbe08306: Fix radio command deferral in the MAC and release pending commands after recipient responses.

The query returns true while Tx retains an accepted transmission, including the wait before transmission starts.
Tx clears that state before it calls ICallback::transmissionComplete(), the callback that reports completion to the coordination function.
The callback must observe the cleared state so it can release a pending command.
The query returns false when Tx holds no accepted transmission.

The hybrid coordination function (HCF) and distributed coordination function (DCF) release pending commands after recipient responses complete.
Hcf::sendUp() becomes virtual so the focused test can consume received frames without an upper protocol stack.
The test exercises HCF; it does not directly exercise DCF.
The release note and migration guide describe the user effect and the new query contract.

Validation

The following results apply to 61bbe08306331e72d9a2235a1f0197082c8c0d2d:

  • Debug and release compilation pass.
  • The focused module test passes in debug mode with seed 0.
  • All 30 configurations in the baseline table pass tplx, ~tNl, and ~tND in debug mode.
  • The fingerprint campaign executes 30 tests in 172.200 seconds.
  • Scoped architecture, commit, classification, source seal, and whitespace checks pass.

The control result below applies to 24e04008315f2d0769a3bf55b91d132c51304726.
The control removes the !tx->hasTransmission() condition from both MAC guards while it keeps the rest of the fix.
That control fails at pendingRadioConfigMsg == command because the MAC sends the radio command before the ACK.
With both guards present, the same test passes.

Run the focused regression from the repository root:

source ./setenv -q
make MODE=debug CXX='ccache clang++' -j6
make MODE=release CXX='ccache clang++' -j4
inet_run_module_tests -m debug --no-concurrent -f 'Ieee80211PreparedCancellation_1\.test'

Run the fingerprint cases from tests/fingerprint after the root environment setup.
Create radio-selection.csv with the corresponding rows from the three tracked CSV files.
Include exactly the 30 rows in the baseline table.

./fingerprinttest -d -t 6 -m . -f tplx -f '~tNl' -f '~tND' radio-selection.csv

Global architecture, naming, and interface checks report existing violations in unchanged files.
The grouped opp_repl fingerprint helper remains unverified for this head.
The 30-case result comes from fingerprinttest.
Statistical impact, graphical fingerprints, other seeds, and release-mode behavior remain unverified.

Baselines

The diff contains 30 approved updates: thirteen example rows, thirteen showcase rows, and four tutorial rows.
Only tplx, the complete event fingerprint, changes from the PR merge base, 03e927c18a2060ae147d2f736f3c03cd623477a3.
The numerical fingerprints ~tNl and ~tND retain their base values.
The command follows the accepted response, which changes event order.

The following table shows the base and final values for four QoS configurations.
QoS means quality of service, the traffic treatment that distinguishes service needs.

Directory Configuration Base tplx Radio tplx
examples/wireless/qos MacQos 3a58-19c0 a686-bbed
examples/wireless/qos MacQosWithoutAggregation 33e5-c380 8ea1-98b9
examples/wireless/qos MacQosWithRtsCts 7f3b-72ca 4686-3691
showcases/wireless/qos Qos 8d7c-5091 b214-9d7e

The next table names every changed configuration.
Each row uses run 0.
The file names refer to CSV files under tests/fingerprint.

File Directory Configuration Run
examples.csv examples/dhcp WirelessDHCP 0
examples.csv examples/dhcp Wireless2DHCP 0
examples.csv examples/ipv6/mipv6 Handover 0
examples.csv examples/ipv6/mipv6 RouteOptimizationTwoCNs 0
examples.csv examples/ipv6/mipv6roaming Roaming 0
examples.csv examples/ipv6/pmipv6 General 0
examples.csv examples/wireless/handover General 0
examples.csv examples/wireless/qos MacNonQos 0
examples.csv examples/wireless/qos MacQos 0
examples.csv examples/wireless/qos MacQosWithoutAggregation 0
examples.csv examples/wireless/qos MacQosWithRtsCts 0
examples.csv examples/wireless/qos MacQosWithBlockAck 0
examples.csv examples/wireless/wiredandwirelesshostswithap General 0
showcases.csv showcases/visualizer/canvas/ieee80211 OneNetwork 0
showcases.csv showcases/visualizer/canvas/ieee80211 MultipleNetworks 0
showcases.csv showcases/visualizer/canvas/ieee80211 VisualizingHandover 0
showcases.csv showcases/visualizer/canvas/ieee80211 SignalLevels 0
showcases.csv showcases/visualizer/canvas/interfacetable AdvancedFeatures 0
showcases.csv showcases/visualizer/canvas/networkpathactivity ChangingPaths 0
showcases.csv showcases/visualizer/canvas/packetdrop QueueOverflow 0
showcases.csv showcases/visualizer/canvas/physicallinkactivity Filtering 0
showcases.csv showcases/visualizer/canvas/styling Annotation 0
showcases.csv showcases/wireless/handover General 0
showcases.csv showcases/wireless/multiradio General 0
showcases.csv showcases/wireless/qos NonQos 0
showcases.csv showcases/wireless/qos Qos 0
tutorials.csv tutorials/configurator Step8A 0
tutorials.csv tutorials/configurator Step8B 0
tutorials.csv tutorials/configurator Step9 0
tutorials.csv tutorials/configurator Step12 0

@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: 2 flags

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

Devin Review

A radio command can reach the radio before an accepted response starts
transmission. This affects simulations that reconfigure IEEE 802.11
radios during a response. Medium access control (MAC) previously checked
only the medium state, which cannot identify a response that waits to
start. The MAC now keeps the command until Tx, its frame transmission
component, releases the accepted transmission.

The hybrid coordination function (HCF) accepts an acknowledgment (ACK)
frame with a short interframe space (SIFS) delay. To reproduce, submit a
radio command during that delay. The old MAC sends the command immediately
when the medium is free. The focused module test requires the command
to remain pending until the ACK completes. It checks ACK completion
and command release through HCF.

Custom implementations of ITx must implement hasTransmission(). The
query returns true during the wait before transmission and during
transmission. Tx clears its state before the completion callback, so
the coordination function can release a pending command. HCF and the
distributed coordination function (DCF) release pending commands after
recipient responses complete. Hcf::sendUp() becomes virtual so the
test can consume received frames without an upper protocol stack.

The 30 approved fingerprint updates record the change in event order.
Only tplx changes; the numerical fingerprints ~tNl and ~tND retain
their base values.

Change: src.ieee80211.mac | behavior.change.fix | test whatsnew migration fingerprint | radio-command-deferral
@mgonzalezlopezudc
mgonzalezlopezudc force-pushed the fix/ieee80211-radio-command-deferral branch from 24e0400 to 61bbe08 Compare October 5, 2026 21:50

This branch has not been deployed

No deployments
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