IEEE 802.11: add HT Greenfield mode set, transmission handling, and control-response rate selection - #1146
Conversation
|
Asked Devin to write a report on the remaining informational items and the two threads above. Confirmed: ALL OK SummaryThe four informational Bug Catcher items describe correct, intentional behavior. Both unresolved review threads on Part A — Informational items (correct behavior)1. Drop callbacks retain valid packets — verified
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: 2. Stale association completions ignored — verified
A late callback for a superseded attempt returns 3. Unknown elements remain skippable — verified
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 ( 4. Mode rebinding commits atomically — verified, unqualified
The guarantee depends on lookups throwing (not returning nullptr) on failure — confirmed at head:
The Part B — Review threads on
|
| 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 1 —
src/inet/queueing/queue/CompoundPacketQueueBase.cc:60-69:take→notifyPacketDropped→dropPacketordering confirmed. - Info 2 —
src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtAp.cc:getAssociationResponseDispositiontoken binding (IGNORE/RETAIN/COMPLETE) confirmed. - Info 3 —
src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtFrameSerializer.cc:343-375: length-based skip of unmodeled element IDs confirmed, with bounds-check and allowed-element gating. - Info 4 —
src/inet/linklayer/ieee80211/mac/rateselection/RateSelection.cc:72-100+ throwinggetModeoverloads at `src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211ModeSet.cc:1000-1
2b63331 to
469912e
Compare
bc8d6e4 to
eb9d3a8
Compare
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.
eb9d3a8 to
2782671
Compare
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
n(greenfield-2.4Ghz)with selectable MCS 0–31 modes at 20/40 MHz and both long and short guard intervals.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.Peer negotiation and control responses
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 inexamples/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
469912e263from the repository root using debug mode. Tests use their embedded configurations and runner defaults, with no run/seed overrides.applyModeSet().git diff --check cleanup/fix-ht-gi..HEADpassed. Independent rebase-preservation review found no remaining defects.Fingerprint baseline
The series includes the existing
tests/fingerprint/showcases.csvupdate for/showcases/wireless/txop/, configurationGeneral, run 0, duration 5 s. It records the timing/control-response trajectory change:tplxchanges fromd2b6-a5d1to1ecd-df80, and~tNlfrom3a6f-4c28to86dd-208d;tyfremainsc87d-3f3a. This baseline commit was replayed during the rebase; fingerprints were not regenerated or rerun in the validation above.