Skip to content

IEEE 802.11: add HT Greenfield mode set, transmission handling, and control-response rate selection - #1146

Open
mgonzalezlopezudc wants to merge 23 commits into
inet-framework:masterfrom
mgonzalezlopezudc:cleanup/feat-ht-greenfield
Open

IEEE 802.11: add HT Greenfield mode set, transmission handling, and control-response rate selection#1146
mgonzalezlopezudc wants to merge 23 commits into
inet-framework:masterfrom
mgonzalezlopezudc:cleanup/feat-ht-greenfield

Conversation

@mgonzalezlopezudc

@mgonzalezlopezudc mgonzalezlopezudc commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Note

This PR depends on #1145 (cleanup/fix-ht-gi) and should be merged after it. The feature series consists of seven commits on top of that branch.

Summary

Add IEEE 802.11n HT Greenfield transmission and reception support, including control responses and interoperability with peers that support only HT-mixed reception. A Greenfield-capable station can transmit Greenfield data to a compatible peer and fall back to the corresponding HT-mixed mode for other HT peers.

PHY modes and capabilities

  • Register n(greenfield-2.4Ghz) with selectable MCS 0–31 modes at 20/40 MHz and both long and short guard intervals.
  • Separate selectable operational modes (containsMode()) from supported PHY capabilities (supportsMode()). Greenfield profiles support legacy and HT-mixed control responses without making those modes selectable as their persistent data mode.
  • Precompute control-response lookups and make the mode-set registry thread-local.
  • Check per-packet transmission and reception against supported PHY modes.
  • Correct HT/VHT preamble, header, and data duration decomposition, including short-GI timing and SIG fields represented within the preamble.

Peer negotiation and control responses

  • Advertise and negotiate Greenfield receiver capability, and select the HT-mixed equivalent when the destination cannot receive Greenfield.
  • Accept supported HT-mixed CTS modes in a Greenfield profile.
  • Select non-HT ACK and Basic BlockAck responses for ordinary HT exchanges, and HT-mixed CTS responses to HT RTS frames.
  • Map configured HT CTS rates to their HT-mixed equivalents while preserving MCS, channel width, spatial streams, and guard interval. Reject configured legacy CTS rates in HT profiles. Explicit HT CTS overrides retain the documented ability to bypass automatic response-rate constraints.
  • Reject missing mode sets during link-layer initialization and integrate response-mode selection with the prerequisite branch's transactional mode-set changes and fixed-rate rebuilding.

Integration and review order

The architectural surface is the IEEE 802.11 PHY mode contract and catalog, radio/transmitter/receiver capability checks, MAC and QoS rate selection, and MIB HT capabilities. The change exposes the Greenfield profile through interface/MAC/radio NED configuration and documents response-rate parameter semantics in NED and WHATSNEW. It includes a ping example in examples/wireless/lan80211/omnetpp-ht-greenfield.ini.

Read the commits in order: PHY mode support; MAC/control-response integration; peer capability negotiation; HT-mixed CTS acceptance; peer-fallback tests; short-GI duration correction; TXOP fingerprint baseline. No sealed source paths or new architecture/naming exception entries are involved.

Validation

Validated the final tree at 469912e263 from the repository root using debug mode. Tests use their embedded configurations and runner defaults, with no run/seed overrides.

make MODE=debug -j$(nproc)

inet_run_unit_tests -m debug -f 'Ieee80211(HtGreenfield|HtGuardInterval|HtModeSet|HtCapabilities|PeerModeSelection)_1\.test'
inet_run_unit_tests -m debug -f 'Ieee80211PeerModeSelection_1\.test'

inet_run_module_tests -m debug -f '(Ieee80211(HtGreenfieldRuntime|HtMixedRuntime|HtHeterogeneousGreenfieldRuntime|ConfiguredResponseRateSelection|LegacyResponseRateSelection|InvalidConfiguredCtsRate|ModeSetTransition_1)|(Qos)?RateSelectionNullModeSetInitialization)\.test'
inet_run_module_tests -m debug -f 'Ieee80211InvalidConfiguredCtsRate\.test'
  • Debug library build passed (exit 0).
  • All five selected unit tests passed: four passed in the initial invocation; the peer-mode test passed its focused rerun after adapting its helper references to the prerequisite API.
  • All nine selected module tests passed: eight passed in the initial invocation; the invalid-CTS test passed its focused rerun after adapting its wrapper to applyModeSet().
  • Both test adaptations are folded into their original commits. Production sources did not change after the successful library build.
  • Focused MAC/PHY architecture checks, source-seal checks, and git diff --check cleanup/fix-ht-gi..HEAD passed. Independent rebase-preservation review found no remaining defects.

Fingerprint baseline

The series includes the existing tests/fingerprint/showcases.csv update for /showcases/wireless/txop/, configuration General, run 0, duration 5 s. It records the timing/control-response trajectory change: tplx changes from d2b6-a5d1 to 1ecd-df80, and ~tNl from 3a6f-4c28 to 86dd-208d; tyf remains c87d-3f3a. This baseline commit was replayed during the rebase; fingerprints were not regenerated or rerun in the validation above.


Devin Review

@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 2 potential issues.

Devin Review

Comment thread src/inet/linklayer/ieee80211/mac/rateselection/Ieee80211PeerModeSelection.cc Outdated
@mgonzalezlopezudc

Copy link
Copy Markdown
Contributor Author

Asked Devin to write a report on the remaining informational items and the two threads above.

Confirmed: ALL OK

Summary

The four informational Bug Catcher items describe correct, intentional behavior. Both unresolved review threads on src/inet/linklayer/ieee80211/mac/rateselection/Ieee80211PeerModeSelection.cc are stale and safe to resolve — the underlying issues were fixed at head. All six items are verified directly against head commit 2b6333151d02c5168c538c35d8a95f8c891477fa. No code changes are required.


Part A — Informational items (correct behavior)

1. Drop callbacks retain valid packets — verified

CompoundPacketQueueBase::pushPacket in src/inet/queueing/queue/CompoundPacketQueueBase.cc:60-69:

if (packetDropperFunction != nullptr) {
    while (isOverloaded()) {
        auto packet = packetDropperFunction->selectPacket(this);
        EV_INFO << "Dropping packet" << EV_FIELD(packet) << EV_ENDL;
        removePacket(packet);
        take(packet);                     // reclaim ownership
        notifyPacketDropped(packet);      // callback sees intact chunks/tags
        dropPacket(packet, QUEUE_OVERFLOW); // deletion happens after
    }
}

Ordering confirmed: takenotifyPacketDroppeddropPacket. The callback runs while the packet is still valid. setPacketDropCallback (src/inet/queueing/queue/CompoundPacketQueueBase.cc:75-83) propagates the callback to child IPacketQueue submodules, so drops inside inner queues carry the same guarantee.

2. Stale association completions ignored — verified

Ieee80211MgmtAp::getAssociationResponseDisposition in src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtAp.cc binds each MAC completion to a 64-bit transaction token:

  • transactionTag == nullptr || transactionTag->getTransactionId() != pendingTransactionId (or zero token) → IGNORE
  • Non-final acknowledged fragment → RETAIN
  • Otherwise → COMPLETE

A late callback for a superseded attempt returns IGNORE, so it cannot commit an AID, install stale HT state, or emit false notifications for a newer request.

3. Unknown elements remain skippable — verified

readHtElements in src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtFrameSerializer.cc:343-375:

while (stream.getRemainingLength() != b(0)) {
    if (stream.getRemainingLength() < B(2))
        throw cRuntimeError("Malformed IEEE 802.11 management element header");
    int elementId = stream.readByte();
    int length = stream.readByte();
    if (stream.getRemainingLength() < B(length))
        throw cRuntimeError("Malformed IEEE 802.11 management element: ...");
    if (elementId == SUPPORTED_RATES_ELEMENT_ID) { throw ...; }
    else if (elementId == EXTENDED_SUPPORTED_RATES_ELEMENT_ID) { ...gated... }
    else if (elementId == HT_CAPABILITIES_ELEMENT_ID) { ...gated... }
    else if (elementId == HT_OPERATION_ELEMENT_ID) { ...gated... }
    else
        for (int i = 0; i < length; i++)   // skip unmodeled IE by length
            stream.readByte();
}

Header/bounds are validated first (src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtFrameSerializer.cc:346-352); modeled-but-disallowed IDs throw via the allowedElements mask; unrecognized IDs are consumed by length. Vendor/future IEs are tolerated without blocking supported exchanges.

4. Mode rebinding commits atomically — verified, unqualified

RateSelection::updateModes (src/inet/linklayer/ieee80211/mac/rateselection/RateSelection.cc:72-100) resolves every configured mode into local variables (lines 76-88) before assigning any member (lines 92-99), then clears lastTransmittedFrameMode.

The guarantee depends on lookups throwing (not returning nullptr) on failure — confirmed at head:

  • Ieee80211ModeSet::getMode(bps, Hz, int, simtime_t) (src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211ModeSet.cc:1000-1008) throws cRuntimeError when no mode matches.
  • Range overload (src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211ModeSet.cc:1010-1018) throws when findMode(...) returns nullptr.
  • resolveConfiguredResponseCtsFrameMode (src/inet/linklayer/ieee80211/mac/rateselection/RateSelection.cc:24-39) throws on a legacy CTS rate in an HT mode set.

The dataFrameMode path (src/inet/linklayer/ieee80211/mac/rateselection/RateSelection.cc:79) uses the throwing GI overload. Any failed resolution unwinds before member mutation, leaving prior cached state intact. Scope: atomicity is internal to the rate-selection module's cached pointers, not a full-stack multi-module rollback.


Part B — Review threads on src/inet/linklayer/ieee80211/mac/rateselection/Ieee80211PeerModeSelection.cc

Thread 1 (lines 93-95): "Greenfield CTS responses abort transmission" — stale, fully addressed

The comment claims selectPeerCompatibleMode uses containsMode(), which would reject a supported-only HT-mixed CTS mode. Current code uses supportsMode() at src/inet/linklayer/ieee80211/mac/rateselection/Ieee80211PeerModeSelection.cc:98-100:

if (!modeSet->supportsMode(mode))
    throw cRuntimeError(...);

Supported-only HT-mixed CTS modes pass. Thread is marked outdated; matches the Bug Catcher's own "resolved bugs" record.

Thread 2 (lines 41-48): "Greenfield capability negotiation ignored" — stale, fully addressed

All three sub-points handled; negotiation path traced end-to-end:

a. isCompatibleHtMode rejects Greenfield to non-GF peerssrc/inet/linklayer/ieee80211/mac/rateselection/Ieee80211PeerModeSelection.cc:52-53:

if (mode->isHtGreenfield() && !receiverCapabilities.receiverGreenfield)
    return false;

b. Local capability advertises Greenfield per mode setsrc/inet/linklayer/ieee80211/mib/Ieee80211Mib.cc:

localHtCapabilities.greenfield = modeSet->isHtGreenfieldSupported();

c. Negotiated state retains peer receiver's GF bitsrc/inet/linklayer/ieee80211/mib/Ieee80211HtCapabilities.h:123-124:

negotiated.localTxPeerRx.receiverGreenfield = peer.greenfield;
negotiated.localRxPeerTx.receiverGreenfield = local.greenfield;

End-to-end flow (verified):

  1. Wire → element: src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtFrameSerializer.cccapabilities.greenfield = information & (1 << 4)
  2. Element → struct: src/inet/linklayer/ieee80211/mgmt/Ieee80211HtMgmtElements.hcapabilities.greenfield = element.greenfield
  3. STA extract + install: src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtSta.ccmakeHtCapabilities(...)mib->setPeerHtCapabilities(...)
  4. Negotiate: src/inet/linklayer/ieee80211/mib/Ieee80211Mib.ccnegotiateHtCapabilities (src/inet/linklayer/ieee80211/mib/Ieee80211HtCapabilities.h:90-142)
  5. Consume: src/inet/linklayer/ieee80211/mac/rateselection/Ieee80211PeerModeSelection.cc:52,106,115

Directional correctness: the our-Tx/peer-Rx view (localTxPeerRx) keys off peer.greenfield (src/inet/linklayer/ieee80211/mib/Ieee80211HtCapabilities.h:123), so when we send a Greenfield PPDU the gate correctly checks the peer's receiver capability — matching the IEEE 802.11-2024 19.1.1/19.1.4 rule cited at src/inet/linklayer/ieee80211/mac/rateselection/Ieee80211PeerModeSelection.cc:50-51.

HT Capabilities Info bit layout (spec-aligned): in src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtFrameSerializer.cc, write/read use B4=Greenfield, B5=Short GI 20 MHz, B6=Short GI 40 MHz. The adjacent SM-Power-Save comment (B2-B3, Table 9-224) confirms this is the real HT Capabilities Info field, so B4=HT-Greenfield is spec-aligned, not merely round-trip-symmetric.


Disposition

Item Verdict Action
Info 1 — drop callbacks Correct behavior Accept as informational
Info 2 — stale completions Correct behavior Accept as informational
Info 3 — unknown elements Correct behavior Accept as informational
Info 4 — atomic rebinding Correct, unqualified Accept as informational
Thread 1 — GF CTS abort Stale (fixed via supportsMode) Resolve
Thread 2 — GF negotiation Stale (fixed end-to-end) Resolve

Verification status

All six items verified directly against head commit 2b6333151d02c5168c538c35d8a95f8c891477fa:

  • Info 1src/inet/queueing/queue/CompoundPacketQueueBase.cc:60-69: takenotifyPacketDroppeddropPacket ordering confirmed.
  • Info 2src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtAp.cc: getAssociationResponseDisposition token binding (IGNORE/RETAIN/COMPLETE) confirmed.
  • Info 3src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtFrameSerializer.cc:343-375: length-based skip of unmodeled element IDs confirmed, with bounds-check and allowed-element gating.
  • Info 4src/inet/linklayer/ieee80211/mac/rateselection/RateSelection.cc:72-100 + throwing getMode overloads at `src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211ModeSet.cc:1000-1

Correct HT MCS 32 (1 stream BPSK), MCS 76 (stream 4 16-QAM), and MCS 73 (stream 3 16-QAM) table definitions per IEEE 802.11-2024.

Implement data guard-interval queries (getGuardInterval()) and symbol intervals (getSymbolInterval()). Fix HT and VHT signal mode symbol timing to use long symbol duration independently of data GI (Table 19-6 and Table 21-5).

Round mixed-format HT and VHT short-GI data airtimes up to 4 us / long-GI symbol boundaries (Eq. 19-90 and Eq. 21-109) while keeping greenfield short-GI data airtimes raw (Eq. 19-92).

Extend mode cache keys in Ieee80211HtCompliantModes and Ieee80211VhtCompliantModes with band mode and preamble format to prevent cache key collisions.
Complete Ieee80211ModeSet entries for "n(mixed-2.4Ghz)" with short and long guard-interval variants via completeHtGuardIntervalVariants.

Add guard-interval qualified lookups in findMode and getMode.

Add findCompatibleMode for exact PHY parameter matching across mode sets (treating negative guard intervals as wildcards for non-OFDM modes).

Ensure strict rate monotonicity in getSlowerMode, getFasterMode, getSlowerMandatoryMode, and getFasterMandatoryMode.

Implement getMandatoryModeAtOrBelow to find the highest-bitrate mandatory mode at or below a target rate.

Add null check in Ieee80211MgmtBase before updating local HT capabilities.

Update Ieee80211HtModeSet_1.test and Ieee80211PeerModeSelection_1.test for short-GI mode set awareness.
Document modeSet precedence over opMode in Ieee80211ConfigureRadioCommand.

Implement setModeSetAndMode in Ieee80211Radio and Ieee80211Transmitter to allow atomic reconfiguration of mode set and mode while validating mode membership.

Update Ieee80211Transmitter::setModeSet to re-select compatible modes via findCompatibleMode (preserving bitrate, bandwidth, NSS, and GI) or throw when an incompatible transition occurs.

In Ieee80211Transmitter::createTransmission, query preamble, header, and data durations directly through IIeee80211Mode methods.
Add dataFrameGuardInterval parameter to RateSelection and QosRateSelection NED and C++ initialization, allowing explicit guard interval qualification when fixed bitrates are configured.

In computeResponseAckFrameMode and computeResponseCtsFrameMode, use modeSet->getMandatoryModeAtOrBelow(mode) for proper mandatory fallback.

Add Ieee80211HtGuardInterval_1.test covering HT/VHT guard-interval catalog verification, timing calculations, lookups, transmitter mode-set switching, and rate selection mandatory fallback.
- Physicallayer / MAC mode-set synchronization:
  - Emit `modesetChangedSignal` from `Ieee80211Radio::setModeSet` and
    `Ieee80211Radio::setModeSetAndMode` to propagate dynamic mode set changes
    across the containing NIC.
  - Subscribe `Ieee80211Mac` to `modesetChangedSignal` at `INITSTAGE_LINK_LAYER`
    and implement `receiveSignal` for `cObject *` to synchronize `modeSet` with
    the physical layer.
  - Ensures MAC rate selection, rate control adaptors, channel access contention
    parameters, and management listeners reflect the current physical mode catalog.

- Management frame serializer SSID bounds enforcement:
  - Enforce IEEE Std 802.11-2024 Clause 9.4.2.2 SSID length bounds (0 to 32 octets)
    during both serialization and deserialization.
  - Encapsulate SSID wire codec logic into `writeSsidElement` and `readSsidElement`
    helpers across Probe Request, Association Request, Reassociation Request,
    Beacon, and Probe Response frames.
  - Reject overlength SSIDs and truncated wire streams with `cRuntimeError`.

- Rate selection documentation:
  - Add IEEE Std 802.11-2024 Clause 10.6.5.8 reference comments in `RateSelection`
    and `QosRateSelection` explaining why `getHtMcsIndex() < 0` gates HT peer
    filtering and non-HT/VHT modes pass through unchanged until VHT MIB state is
    supported.

- Testing:
  - Add test cases in `Ieee80211SupportedRates_1.test` for valid SSID bounds (0, 1,
    32 octets), 33-octet serialization rejection, and truncated stream rejection.
  - Add test cases in `Ieee80211HtGuardInterval_1.test` verifying radio mode-set
    signal publication and subscriber notification.
- Rate selection dynamic mode-set synchronization:
  - Factor out fixed mode lookup and mandatory rate computation into updateModes() in RateSelection and QosRateSelection.
  - Rebuild all configured fixed mode pointers (multicastFrameMode, dataFrameMode, mgmtFrameMode, controlFrameMode, responseAckFrameMode, responseCtsFrameMode, and responseBlockAckFrameMode) from their NED parameters when modesetChangedSignal arrives, preserving data mode bandwidth, spatial-stream, and guard-interval qualifiers.
  - Refresh fastestMandatoryMode from the new mode set and clear lastTransmittedFrameMode peer rate history to prevent stale mode pointer reuse across mode-set transitions.
  - Invoke updateModes() on both INITSTAGE_LINK_LAYER initialization and modesetChangedSignal reception.

- Testing:
  - Add unit test cases in Ieee80211HtGuardInterval_1.test verifying that dynamic switching between mode sets (g(erp) and n(mixed-2.4Ghz)) updates all configured mode pointers and fastest mandatory modes in RateSelection and QosRateSelection to reference the active catalog.
Mixed HT catalogs place mandatory HT MCS entries above legacy rates, so the fastest mandatory mode makes Beacons invisible to legacy stations. Constrain both rate selectors to mandatory legacy operational modes when the advertised basic legacy set is nonempty, preserving eligible configured rates.

Add passive-discovery coverage for legacy stations associating with mixed HT DCF and HCF access points.
A failed mode-set listener could leave the radio and an arbitrary prefix of consumers on a new catalog. Coordinate dependent updates through a typed transaction interface and restore their snapshots if an update or synchronous notification fails.

Reuse the MAC's antenna- and channel-width-limited HT capability derivation during transitions, completing MIB and peer updates before notifying observers. Preserve transmitter-owned compatible-mode mapping and reject reentrant catalog changes.

Cover HT-to-legacy and legacy-to-HT transitions, Beacon advertisements, both selectors, fixed-rate rejection through both radio setters, and observer-failure rollback. Rename existing unit-test helpers to avoid collisions with the transaction API.
Invalid wire AIDs in association and reassociation responses used to throw during deserialization. Mark the frame incorrect and substitute zero so parsing preserves the status, rates, trailing elements, and stream position.

Add raw-byte coverage for missing markers, successful AIDs outside the valid range, and nonzero unsuccessful-response AIDs in both response types. The focused management serializer unit test passes against the rebuilt debug library.
An observer exception could roll back a mode set already cached by an earlier listener. Complete the radio and behavioral participant transaction before publishing its result, and propagate listener exceptions without undoing the announced state. Retain the reentrancy guard during publication.

Extend the transition test with an ordinary caching listener followed by an ordinary throwing listener. Verify observer and radio consistency after publication failure while retaining DCF and HCF rollback coverage for update failures. The focused transition module test passes against the rebuilt debug library.
A throwing mode-set observer prevented RadioMedium from receiving the listening change after radio state had already committed. Attempt both independent notifications before rethrowing the first observer failure, retaining committed state and the reentrancy guard during publication.

Extend the module test to verify RadioMedium processes the listening change and cover listening-only and simultaneous observer failures through both mode-set setters. The regression fails before the fix and passes afterward. Debug build and scoped architecture checks pass.
…on support

Register the n(greenfield-2.4Ghz) mode set and distinguish selectable operational modes (containsMode) from supported PHY capabilities (supportsMode). HT Greenfield profiles now explicitly support non-HT and HT-mixed response modes without making them selectable for data transmissions.

Precompute immutable control-response mappings in Ieee80211ModeSet and make the mode-set registry thread-local to ensure thread safety.

In the physical layer, validate per-packet transmission requests and reception feasibility against supported mode capabilities. Decompose transmission duration into preamble, header, and data intervals, correctly accounting for HT/VHT SIG field integration in the preamble. Publish modesetChangedSignal upon radio mode set transitions.

Add unit test coverage for HT Greenfield compliant modes, duration decomposition, transmitter transition invariants, and ERP mode isolation.
…Greenfield integration

Apply IEEE 802.11-2024 control-response rules in DCF and QoS rate selection: ordinary HT ACK and Basic BlockAck responses use mandatory non-HT rates, and CTS responses to HT-carried RTS frames use the HT-mixed format. Translate configured CTS response rates to their corresponding HT-mixed counterparts while preserving MCS, bandwidth, NSS, and guard interval.

Enforce mode set initialization invariants by failing fast if RateSelection has no mode set at link-layer initialization, and rebuild configured modes atomically on dynamic mode-set changes via modesetChangedSignal.

Add "n(greenfield-2.4Ghz)" to wireless interface and MAC module NEDs, and provide an end-to-end Greenfield ping simulation example in omnetpp-ht-greenfield.ini.

Document backward compatibility notes in WHATSNEW regarding 802.11n control-response rate selection. Add comprehensive unit and module test coverage for rate selection, dynamic mode-set rebinding, and HT Greenfield and Mixed runtime exchanges.
…T-mixed for mixed peers

- Mode & physical layer introspection:
  - Add virtual isHtGreenfield() query to IIeee80211Mode and override it in Ieee80211HtMode to identify Greenfield preamble modes.
  - Track htGreenfieldSupported in Ieee80211ModeSet constructor and expose isHtGreenfieldSupported() accessor.
  - Expose findHtMixedMode() on Ieee80211ModeSet to resolve the HT-mixed equivalent of any HT mode based on precomputed response tables.

- MIB & directional capability negotiation:
  - Populate localHtCapabilities.greenfield from modeSet->isHtGreenfieldSupported() in Ieee80211Mib::updateLocalHtCapabilities.
  - Add receiverGreenfield to Ieee80211HtDirectionalCapabilities and populate directional flags during negotiateHtCapabilities().

- Rate selection peer filtering & HT-mixed fallback:
  - In isCompatibleHtMode(), reject candidate Greenfield modes when the negotiated receiver did not advertise Greenfield support.
  - In selectPeerCompatibleMode(), dynamically map Greenfield candidate modes to their legal HT-mixed equivalents, allowing Greenfield stations to communicate with mixed-format peers at high throughput before falling back to legacy rates.

- Testing:
  - Update tests/unit/Ieee80211HtCapabilities_1.test with directional Greenfield capability assertions.
  - Add tests/module/Ieee80211HtHeterogeneousGreenfieldRuntime.test verifying bidirectional unicast data delivery and dynamic HT-mixed frame format selection in a heterogeneous Greenfield/Mixed BSS.
… peer mode selection

- Rate selection peer filtering:
  - In selectPeerCompatibleMode(), use modeSet->supportsMode(mode) instead of modeSet->containsMode(mode) to validate candidate modes.
  - While containsMode() verifies persistent selectable operating modes (which for Greenfield mode sets only include Greenfield PPDUs), supportsMode() correctly covers supported supplementary modes, such as mandatory HT-mixed CTS responses required by IEEE 802.11-2024 subclauses 10.6.6.1 and 10.6.6.5.7.
  - This prevents runtime simulation aborts when Greenfield stations respond to HT RTS frames in infrastructure networks.

- Testing:
  - Add assertions in tests/unit/Ieee80211PeerModeSelection_1.test verifying that selectPeerCompatibleMode() accepts HT-mixed CTS modes for n(greenfield-2.4Ghz) mode sets while still rejecting unsupported MCS indices.
  - Update tests/module/Ieee80211HtHeterogeneousGreenfieldRuntime.test with RTS/CTS enabled (rtsThreshold = 1B) to verify end-to-end HT-mixed CTS generation and transmission by Greenfield stations.
…d HT-mixed fallback

- Peer mode selection testing:
  - Add optional greenfield receiver capability parameter to makePeerState() helper in Ieee80211PeerModeSelection_1.test.
  - Verify selectPeerCompatibleMode() selects HT-Greenfield modes when communicating with a Greenfield-capable peer.
  - Verify isCompatibleHtMode() rejects HT-Greenfield modes when the destination station did not advertise Greenfield reception, causing selectPeerCompatibleMode() to fall back to the compatible HT-mixed equivalent mode.
  - Verify candidate HT-mixed modes remain unaffected regardless of the destination station's Greenfield reception capability.
… GI HT and VHT modes

- Physical layer transmission duration decomposition:
  - In Ieee80211Transmitter::createTransmission(), compute dataDuration using transmissionMode->getDataDuration(B(phyHeader->getLengthField())) instead of raw transmissionMode->getDataMode()->getDuration(...).
  - For HT mixed format and VHT modes configured with Short Guard Interval (Short GI / 400 ns), standard IEEE 802.11 symbol-boundary rounding (IEEE Std 802.11-2024, Eq. 19-90 and Eq. 21-109) rounds data airtime up to the 4 us symbol boundary.
  - Comparing duration == preambleDuration + dataDuration now correctly evaluates to true for HT/VHT Short GI transmissions, setting headerDuration to zero (since SIG fields are included in the preamble) and preventing negative dataDuration calculation and runtime simulation errors.
  - For legacy PHY modes with standalone PLCP headers (OFDM, ERP, DSSS, HR-DSSS), duration == preambleDuration + dataDuration remains false, preserving the header duration allocation.

- Testing:
  - Update assertTransmitterDurationDecomposition() helper in tests/unit/Ieee80211HtGreenfield_1.test to verify duration decomposition with getDataDuration() and accept zero-header HT/VHT modes.
  - Add test assertions covering VHT Short GI, HT Mixed Short GI, and HT Greenfield Short GI modes with both 0-byte and 64-byte payloads.
Update the fingerprint baseline for /showcases/wireless/txop/ (General config, run 0) from d2b6-a5d1/tplx;3a6f-4c28/~tNl to 1ecd-df80/tplx;86dd-208d/~tNl.

The simulation trajectory changed due to corrections in IEEE 802.11 High Throughput (HT) physical layer airtime calculations and transmission duration decomposition:

1. Transmission Duration Decomposition (Ieee80211Transmitter):
   HT/VHT modes integrate their SIG fields into the PHY preamble duration (preambleMode->getDuration()). Previously, an 8 us header duration was queried from getHeaderMode()->getDuration() and subtracted a second time from data airtime. Ieee80211Transmitter now recognizes that HT header duration is contained in the preamble (headerDuration = 0), preserving the full modeled data duration.

2. HT Mixed Short-GI Airtime Rounding (Ieee80211HtMode):
   Data airtime for mixed-format HT short-GI transmissions is now rounded up to a 4 us symbol boundary per IEEE Std 802.11-2024 Eq. (19-90), while symbol interval lookups and guard intervals reflect normative timing.

3. Control-Response Rate Selection (RateSelection / QosRateSelection):
   Mandatory mode lookups and response rate fallback for RTS/CTS and Block Ack exchanges now use compliant mandatory modes at or below the target rate.

Because txop is the showcase exercising 802.11n HT data (A-MSDU) and control frames (RTS/CTS, AddbaReq, WlanAck), these physical layer airtime corrections modify the transmission boundaries and subsequent contention scheduling into the intended, standard-compliant trajectory.
Scalar signal models forwarded header and data durations to their base
constructor in reverse order. Preserve chronological phase boundaries
for both transmission and reception analog models.

Add direct TX/RX coverage with distinct preamble, header and data durations.
Using the full PHY prefix as the preamble left HT and VHT transmissions
with no timed header phase. Use the mode's chronological duration
accessors while retaining the exact total-duration check.

Check positive HT header durations in mixed and Greenfield runtime cases,
and verify packet and analog phase boundaries across HT, VHT and legacy
catalog variants.
Optional multicast requests such as 9 and 18 Mb/s could select the fastest
mandatory legacy rate and exceed the requested bitrate. Select the
highest mandatory legacy rate within the ceiling, preserving exact
mandatory requests.

Report an error when mandatory legacy modes exist but none meets the
bound. Preserve the request when the mandatory legacy set is empty.
Cover optional rates, exact requests and both fallback boundaries.
A response bitrate can identify multiple HT MCS, bandwidth, stream-count
and guard-interval combinations. Expose matching qualifiers for DCF/QoS
ACK and CTS, plus QoS BlockAck, and reject ambiguous configured matches
instead of silently depending on catalog order.

Mode-set lookup enforces uniqueness only when requested. Automatic
responses and other lookup callers retain their existing behavior.
Verify qualified CTS conversion, invalid and automatic configurations,
and configured multicast ceilings through both production selectors.
The HT catalog can represent 40 MHz modes, but the packet-level
transmitter and receiver advertise only 20 MHz operation. Clarify that
nonzero secondary-channel offsets require PHY width support and are
rejected by these providers.
@mgonzalezlopezudc
mgonzalezlopezudc force-pushed the cleanup/feat-ht-greenfield branch from eb9d3a8 to 2782671 Compare September 10, 2026 09:33
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