A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
eht-phy.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 DERONNE SOFTWARE ENGINEERING
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Sébastien Deronne <sebastien.deronne@gmail.com>
7 */
8
9#include "eht-phy.h"
10
11#include "eht-configuration.h"
12#include "eht-ppdu.h"
13
14#include "ns3/interference-helper.h"
15#include "ns3/obss-pd-algorithm.h"
16#include "ns3/wifi-net-device.h"
17#include "ns3/wifi-phy.h"
18#include "ns3/wifi-psdu.h"
19#include "ns3/wifi-utils.h"
20
21#undef NS_LOG_APPEND_CONTEXT
22#define NS_LOG_APPEND_CONTEXT WIFI_PHY_NS_LOG_APPEND_CONTEXT(m_wifiPhy)
23
24namespace ns3
25{
26
28
29/*******************************************************
30 * EHT PHY (P802.11be/D1.5)
31 *******************************************************/
32
33// clang-format off
34
37 WIFI_PPDU_FIELD_NON_HT_HEADER, // L-SIG + RL-SIG
38 WIFI_PPDU_FIELD_U_SIG, // U-SIG
39 WIFI_PPDU_FIELD_EHT_SIG, // EHT-SIG
40 WIFI_PPDU_FIELD_TRAINING, // EHT-STF + EHT-LTFs
43 WIFI_PPDU_FIELD_NON_HT_HEADER, // L-SIG + RL-SIG
44 WIFI_PPDU_FIELD_U_SIG, // U-SIG
45 WIFI_PPDU_FIELD_TRAINING, // EHT-STF + EHT-LTFs
47};
48
49/**
50 * \brief map a given secondary channel width to its channel list type
51 */
52const std::map<MHz_u, WifiChannelListType> ehtSecondaryChannels {
56};
57
58// clang-format on
59
60EhtPhy::EhtPhy(bool buildModeList /* = true */)
61 : HePhy(false) // don't add HE modes to list
62{
63 NS_LOG_FUNCTION(this << buildModeList);
67 if (buildModeList)
68 {
70 }
71}
72
74{
75 NS_LOG_FUNCTION(this);
76}
77
78void
80{
81 NS_LOG_FUNCTION(this);
82 NS_ASSERT(m_modeList.empty());
84 for (uint8_t index = 0; index <= m_maxSupportedMcsIndexPerSs; ++index)
85 {
86 NS_LOG_LOGIC("Add EhtMcs" << +index << " to list");
87 m_modeList.emplace_back(CreateEhtMcs(index));
88 }
89}
90
92EhtPhy::GetSigMode(WifiPpduField field, const WifiTxVector& txVector) const
93{
94 switch (field)
95 {
97 return GetSigAMode(); // U-SIG is similar to SIG-A
99 return GetSigBMode(txVector); // EHT-SIG is similar to SIG-B
100 default:
101 return HePhy::GetSigMode(field, txVector);
102 }
103}
104
106EhtPhy::GetSigBMode(const WifiTxVector& txVector) const
107{
108 if (txVector.IsDlMu())
109 {
110 return HePhy::GetSigBMode(txVector);
111 }
112 // we get here in case of EHT SU transmission
113 // TODO fix the MCS used for EHT-SIG
114 auto smallestMcs = std::min<uint8_t>(5, txVector.GetMode().GetMcsValue());
115 return VhtPhy::GetVhtMcs(smallestMcs);
116}
117
118Time
119EhtPhy::GetDuration(WifiPpduField field, const WifiTxVector& txVector) const
120{
121 switch (field)
122 {
124 return GetSigADuration(txVector.GetPreambleType()); // U-SIG is similar to SIG-A
126 return GetSigBDuration(txVector); // EHT-SIG is similar to SIG-B
128 [[fallthrough]];
130 return NanoSeconds(0);
131 default:
132 return HePhy::GetDuration(field, txVector);
133 }
134}
135
137EhtPhy::GetSigBSize(const WifiTxVector& txVector) const
138{
139 if (ns3::IsDlMu(txVector.GetPreambleType()) && ns3::IsEht(txVector.GetPreambleType()))
140 {
142 txVector.GetChannelWidth(),
143 txVector.GetRuAllocation(
145 txVector.GetEhtPpduType(),
146 txVector.IsSigBCompression(),
147 txVector.IsSigBCompression() ? txVector.GetHeMuUserInfoMap().size() : 0);
148 }
149 return HePhy::GetSigBSize(txVector);
150}
151
152Time
154{
155 Time duration = GetDuration(WIFI_PPDU_FIELD_PREAMBLE, txVector) +
158 return duration;
159}
160
161Time
163{
164 Time duration = GetDuration(WIFI_PPDU_FIELD_PREAMBLE, txVector) +
168 return duration;
169}
170
173{
174 return m_ehtPpduFormats;
175}
176
178EhtPhy::BuildPpdu(const WifiConstPsduMap& psdus, const WifiTxVector& txVector, Time ppduDuration)
179{
180 NS_LOG_FUNCTION(this << psdus << txVector << ppduDuration);
181 return Create<EhtPpdu>(psdus,
182 txVector,
184 ppduDuration,
185 ObtainNextUid(txVector),
187}
188
191{
192 NS_LOG_FUNCTION(this << field << *event);
193 switch (field)
194 {
196 [[fallthrough]];
198 return EndReceiveSig(event, field);
199 default:
200 return HePhy::DoEndReceiveField(field, event);
201 }
202}
203
206{
207 NS_LOG_FUNCTION(this << *event << status << field);
208 switch (field)
209 {
211 return ProcessSigA(event, status); // U-SIG is similar to SIG-A
213 return ProcessSigB(event, status); // EHT-SIG is similar to SIG-B
214 default:
215 return HePhy::ProcessSig(event, status, field);
216 }
217 return status;
218}
219
222{
223 switch (field)
224 {
226 return U_SIG_FAILURE;
228 return EHT_SIG_FAILURE;
229 default:
230 return HePhy::GetFailureReason(field);
231 }
232}
233
234void
236{
237 for (uint8_t i = 0; i <= 13; ++i)
238 {
239 GetEhtMcs(i);
240 }
241}
242
244EhtPhy::GetEhtMcs(uint8_t index)
245{
246#define CASE(x) \
247 case x: \
248 return GetEhtMcs##x();
249
250 switch (index)
251 {
252 CASE(0)
253 CASE(1)
254 CASE(2)
255 CASE(3)
256 CASE(4)
257 CASE(5)
258 CASE(6)
259 CASE(7)
260 CASE(8)
261 CASE(9)
262 CASE(10)
263 CASE(11)
264 CASE(12)
265 CASE(13)
266 default:
267 NS_ABORT_MSG("Inexistent index (" << +index << ") requested for EHT");
268 return WifiMode();
269 }
270#undef CASE
271}
272
273#define GET_EHT_MCS(x) \
274 WifiMode EhtPhy::GetEhtMcs##x() \
275 { \
276 static WifiMode mcs = CreateEhtMcs(x); \
277 return mcs; \
278 }
279
290GET_EHT_MCS(10)
291GET_EHT_MCS(11)
292GET_EHT_MCS(12)
293GET_EHT_MCS(13)
294#undef GET_EHT_MCS
295
296WifiMode
298{
299 NS_ASSERT_MSG(index <= 13, "EhtMcs index must be <= 13!");
300 return WifiModeFactory::CreateWifiMcs("EhtMcs" + std::to_string(index),
301 index,
303 false,
310}
311
313EhtPhy::GetCodeRate(uint8_t mcsValue)
314{
315 switch (mcsValue)
316 {
317 case 12:
318 return WIFI_CODE_RATE_3_4;
319 case 13:
320 return WIFI_CODE_RATE_5_6;
321 default:
322 return HePhy::GetCodeRate(mcsValue);
323 }
324}
325
326uint16_t
328{
329 switch (mcsValue)
330 {
331 case 12:
332 [[fallthrough]];
333 case 13:
334 return 4096;
335 default:
336 return HePhy::GetConstellationSize(mcsValue);
337 }
338}
339
340uint64_t
341EhtPhy::GetPhyRate(uint8_t mcsValue, MHz_u channelWidth, Time guardInterval, uint8_t nss)
342{
343 const auto codeRate = GetCodeRate(mcsValue);
344 const auto dataRate = GetDataRate(mcsValue, channelWidth, guardInterval, nss);
345 return HtPhy::CalculatePhyRate(codeRate, dataRate);
346}
347
348uint64_t
349EhtPhy::GetPhyRateFromTxVector(const WifiTxVector& txVector, uint16_t staId /* = SU_STA_ID */)
350{
351 auto bw = txVector.GetChannelWidth();
352 if (txVector.IsMu())
353 {
354 bw = WifiRu::GetBandwidth(WifiRu::GetRuType(txVector.GetRu(staId)));
355 }
356 return EhtPhy::GetPhyRate(txVector.GetMode(staId).GetMcsValue(),
357 bw,
358 txVector.GetGuardInterval(),
359 txVector.GetNss(staId));
360}
361
362uint64_t
363EhtPhy::GetDataRateFromTxVector(const WifiTxVector& txVector, uint16_t staId /* = SU_STA_ID */)
364{
365 auto bw = txVector.GetChannelWidth();
366 if (txVector.IsMu())
367 {
368 bw = WifiRu::GetBandwidth(WifiRu::GetRuType(txVector.GetRu(staId)));
369 }
370 return EhtPhy::GetDataRate(txVector.GetMode(staId).GetMcsValue(),
371 bw,
372 txVector.GetGuardInterval(),
373 txVector.GetNss(staId));
374}
375
376uint64_t
377EhtPhy::GetDataRate(uint8_t mcsValue, MHz_u channelWidth, Time guardInterval, uint8_t nss)
378{
379 [[maybe_unused]] const auto gi = guardInterval.GetNanoSeconds();
380 NS_ASSERT((gi == 800) || (gi == 1600) || (gi == 3200));
381 NS_ASSERT(nss <= 8);
382 return HtPhy::CalculateDataRate(GetSymbolDuration(guardInterval),
383 GetUsableSubcarriers(channelWidth),
384 static_cast<uint16_t>(log2(GetConstellationSize(mcsValue))),
386 nss);
387}
388
389uint64_t
391{
392 WifiCodeRate codeRate = GetCodeRate(mcsValue);
393 uint16_t constellationSize = GetConstellationSize(mcsValue);
394 return CalculateNonHtReferenceRate(codeRate, constellationSize);
395}
396
397uint64_t
398EhtPhy::CalculateNonHtReferenceRate(WifiCodeRate codeRate, uint16_t constellationSize)
399{
400 uint64_t dataRate;
401 switch (constellationSize)
402 {
403 case 4096:
404 if (codeRate == WIFI_CODE_RATE_3_4 || codeRate == WIFI_CODE_RATE_5_6)
405 {
406 dataRate = 54000000;
407 }
408 else
409 {
410 NS_FATAL_ERROR("Trying to get reference rate for a MCS with wrong combination of "
411 "coding rate and modulation");
412 }
413 break;
414 default:
415 dataRate = HePhy::CalculateNonHtReferenceRate(codeRate, constellationSize);
416 }
417 return dataRate;
418}
419
420dBm_u
422{
423 if (!ppdu)
424 {
425 /**
426 * A signal is present on the 20 MHz subchannel at or above a threshold of –62 dBm at the
427 * receiver's antenna(s). The PHY shall indicate that the 20 MHz subchannel is busy a period
428 * aCCATime after the signal starts and shall continue to indicate the 20 MHz subchannel is
429 * busy while the threshold continues to be exceeded (Sec. 36.3.21.6.4 - Per 20 MHz CCA
430 * sensitivity - of 802.11be D7.0).
431 */
433 }
434
435 /**
436 * A non-HT, HT_MF, HT_GF, VHT, HE, or EHT PPDU for which the power measured within
437 * this 20 MHz subchannel is at or above max(–72 dBm, OBSS_PD level) at the
438 * receiver’s antenna(s). The PHY shall indicate that the 20 MHz subchannel is busy
439 * with greater than 90% probability within a period aCCAMidTime (Sec. 36.3.21.6.4 - Per 20 MHz
440 * CCA sensitivity - of 802.11be D7.0).
441 */
442 auto ehtConfiguration = m_wifiPhy->GetDevice()->GetEhtConfiguration();
443 NS_ASSERT(ehtConfiguration);
444 const auto ccaThresholdNonObss = ehtConfiguration->m_per20CcaSensitivityThreshold;
445 return GetObssPdAlgorithm()
446 ? std::max(ccaThresholdNonObss, GetObssPdAlgorithm()->GetObssPdLevel())
447 : ccaThresholdNonObss;
448}
449
450dBm_u
452{
453 if (channelType != WIFI_CHANLIST_PRIMARY)
454 {
455 return Per20MHzCcaThreshold(ppdu);
456 }
457 return HePhy::GetCcaThreshold(ppdu, channelType);
458}
459
460const std::map<MHz_u, WifiChannelListType>&
465
468{
469 const auto secondaryWidthsToCheck = GetCcaSecondaryWidths(ppdu);
470
471 for (auto secondaryWidth : secondaryWidthsToCheck)
472 {
473 const auto channelType = ehtSecondaryChannels.at(secondaryWidth);
474 const auto ccaThreshold = GetCcaThreshold(ppdu, channelType);
475 const auto indices =
477 for (auto index : indices)
478 {
479 const auto band = m_wifiPhy->GetBand(20, index);
480 if (const auto delayUntilCcaEnd = GetDelayUntilCcaEnd(ccaThreshold, band);
481 delayUntilCcaEnd.IsStrictlyPositive())
482 {
483 return std::make_pair(delayUntilCcaEnd, channelType);
484 }
485 }
486 }
487
488 return std::nullopt;
489}
490
491std::vector<Time>
493{
494 NS_LOG_FUNCTION(this);
495
496 /**
497 * 36.3.21.6.4 Per 20 MHz CCA sensitivity:
498 * If the operating channel width is greater than 20 MHz and the PHY issues a PHY-CCA.indication
499 * primitive, the PHY shall set the per20bitmap to indicate the busy/idle status of each 20 MHz
500 * subchannel.
501 */
502 if (m_wifiPhy->GetChannelWidth() < 40)
503 {
504 return {};
505 }
506
507 std::vector<Time> per20MhzDurations{};
510 for (auto index : indices)
511 {
512 auto band = m_wifiPhy->GetBand(20, index);
513 /**
514 * A signal is present on the 20 MHz subchannel at or above a threshold of –62 dBm at the
515 * receiver's antenna(s). The PHY shall indicate that the 20 MHz subchannel is busy a period
516 * aCCATime after the signal starts and shall continue to indicate the 20 MHz subchannel is
517 * busy while the threshold continues to be exceeded.
518 */
519 dBm_u ccaThreshold = -62;
520 auto delayUntilCcaEnd = GetDelayUntilCcaEnd(ccaThreshold, band);
521
522 if (ppdu)
523 {
524 const MHz_u subchannelMinFreq =
525 m_wifiPhy->GetFrequency() - (m_wifiPhy->GetChannelWidth() / 2) + (index * 20);
526 const MHz_u subchannelMaxFreq = subchannelMinFreq + 20;
527 const auto ppduBw = ppdu->GetTxVector().GetChannelWidth();
528
529 if ((ppduBw <= m_wifiPhy->GetChannelWidth()) &&
530 ppdu->DoesOverlapChannel(subchannelMinFreq, subchannelMaxFreq))
531 {
532 ccaThreshold = Per20MHzCcaThreshold(ppdu);
533 const auto ppduCcaDuration = GetDelayUntilCcaEnd(ccaThreshold, band);
534 delayUntilCcaEnd = std::max(delayUntilCcaEnd, ppduCcaDuration);
535 }
536 }
537 per20MhzDurations.push_back(delayUntilCcaEnd);
538 }
539
540 return per20MhzDurations;
541}
542
543} // namespace ns3
544
545namespace
546{
547
548/**
549 * Constructor class for EHT modes
550 */
560
561} // namespace
Constructor class for EHT modes.
Definition eht-phy.cc:552
static const PpduFormats m_ehtPpduFormats
EHT PPDU formats.
Definition eht-phy.h:296
static uint64_t CalculateNonHtReferenceRate(WifiCodeRate codeRate, uint16_t constellationSize)
Return the rate (in bps) of the non-HT Reference Rate which corresponds to the supplied code rate and...
Definition eht-phy.cc:398
PhyFieldRxStatus ProcessSig(Ptr< Event > event, PhyFieldRxStatus status, WifiPpduField field) override
Process SIG-A or SIG-B, perform amendment-specific actions, and provide an updated status of the rece...
Definition eht-phy.cc:205
static WifiCodeRate GetCodeRate(uint8_t mcsValue)
Return the coding rate corresponding to the supplied EHT MCS index.
Definition eht-phy.cc:313
std::vector< Time > GetPer20MHzDurations(const Ptr< const WifiPpdu > ppdu) override
Compute the per-20 MHz CCA durations vector that indicates for how long each 20 MHz subchannel (corre...
Definition eht-phy.cc:492
WifiMode GetSigMode(WifiPpduField field, const WifiTxVector &txVector) const override
Get the WifiMode for the SIG field specified by the PPDU field.
Definition eht-phy.cc:92
dBm_u GetCcaThreshold(const Ptr< const WifiPpdu > ppdu, WifiChannelListType channelType) const override
Return the CCA threshold for a given channel type.
Definition eht-phy.cc:451
PhyEntity::CcaIndication GetCcaIndicationOnSecondary(const Ptr< const WifiPpdu > ppdu) override
Get CCA end time and its corresponding channel list type when a new signal not occupying the primary ...
Definition eht-phy.cc:467
static uint16_t GetConstellationSize(uint8_t mcsValue)
Return the constellation size corresponding to the supplied EHT MCS index.
Definition eht-phy.cc:327
WifiPhyRxfailureReason GetFailureReason(WifiPpduField field) const override
Get the failure reason corresponding to the unsuccessful processing of a given PPDU field.
Definition eht-phy.cc:221
static uint64_t GetPhyRateFromTxVector(const WifiTxVector &txVector, uint16_t staId=SU_STA_ID)
Return the PHY rate corresponding to the supplied TXVECTOR for the STA-ID.
Definition eht-phy.cc:349
static WifiMode GetEhtMcs(uint8_t index)
Return the EHT MCS corresponding to the provided index.
Definition eht-phy.cc:244
void BuildModeList() override
Build mode list.
Definition eht-phy.cc:79
const std::map< MHz_u, WifiChannelListType > & GetCcaSecondaryChannels() const override
Get the secondary channel widths and their corresponding channel list types that are supported by the...
Definition eht-phy.cc:461
static void InitializeModes()
Initialize all EHT modes.
Definition eht-phy.cc:235
static uint64_t GetDataRate(uint8_t mcsValue, MHz_u channelWidth, Time guardInterval, uint8_t nss)
Return the data rate corresponding to the supplied EHT MCS index, channel width, guard interval,...
Definition eht-phy.cc:377
static WifiMode CreateEhtMcs(uint8_t index)
Create and return the EHT MCS corresponding to the provided index.
Definition eht-phy.cc:297
const PpduFormats & GetPpduFormats() const override
Return the PPDU formats of the PHY.
Definition eht-phy.cc:172
static uint64_t GetDataRateFromTxVector(const WifiTxVector &txVector, uint16_t staId=SU_STA_ID)
Return the data rate corresponding to the supplied TXVECTOR for the STA-ID.
Definition eht-phy.cc:363
~EhtPhy() override
Destructor for EHT PHY.
Definition eht-phy.cc:73
uint32_t GetSigBSize(const WifiTxVector &txVector) const override
Definition eht-phy.cc:137
static uint64_t GetPhyRate(uint8_t mcsValue, MHz_u channelWidth, Time guardInterval, uint8_t nss)
Return the PHY rate corresponding to the supplied EHT MCS index, channel width, guard interval,...
Definition eht-phy.cc:341
dBm_u Per20MHzCcaThreshold(const Ptr< const WifiPpdu > ppdu) const
Compute the CCA threshold for Per 20MHz check.
Definition eht-phy.cc:421
Time CalculateNonHeDurationForHeTb(const WifiTxVector &txVector) const override
Definition eht-phy.cc:153
EhtPhy(bool buildModeList=true)
Constructor for EHT PHY.
Definition eht-phy.cc:60
Ptr< WifiPpdu > BuildPpdu(const WifiConstPsduMap &psdus, const WifiTxVector &txVector, Time ppduDuration) override
Build amendment-specific PPDU.
Definition eht-phy.cc:178
static uint64_t GetNonHtReferenceRate(uint8_t mcsValue)
Calculate the rate in bps of the non-HT Reference Rate corresponding to the supplied HE MCS index.
Definition eht-phy.cc:390
Time GetDuration(WifiPpduField field, const WifiTxVector &txVector) const override
Get the duration of the PPDU field (or group of fields) used by this entity for the given transmissio...
Definition eht-phy.cc:119
Time CalculateNonHeDurationForHeMu(const WifiTxVector &txVector) const override
Definition eht-phy.cc:162
WifiMode GetSigBMode(const WifiTxVector &txVector) const override
Definition eht-phy.cc:106
PhyFieldRxStatus DoEndReceiveField(WifiPpduField field, Ptr< Event > event) override
End receiving a given field, perform amendment-specific actions, and provide the status of the recept...
Definition eht-phy.cc:190
static uint32_t GetEhtSigFieldSize(MHz_u channelWidth, const RuAllocation &ruAllocation, uint8_t ehtPpduType, bool compression, std::size_t numMuMimoUsers)
Get variable length EHT-SIG field size.
Definition eht-ppdu.cc:218
PHY entity for HE (11ax)
Definition he-phy.h:58
virtual PhyFieldRxStatus ProcessSigB(Ptr< Event > event, PhyFieldRxStatus status)
Process SIG-B, perform amendment-specific actions, and provide an updated status of the reception.
Definition he-phy.cc:722
Time GetSigBDuration(const WifiTxVector &txVector) const override
Definition he-phy.cc:229
virtual uint32_t GetSigBSize(const WifiTxVector &txVector) const
Definition he-phy.cc:212
static uint64_t CalculateNonHtReferenceRate(WifiCodeRate codeRate, uint16_t constellationSize)
Return the rate (in bps) of the non-HT Reference Rate which corresponds to the supplied code rate and...
Definition he-phy.cc:1728
static WifiCodeRate GetCodeRate(uint8_t mcsValue)
Return the coding rate corresponding to the supplied HE MCS index.
Definition he-phy.cc:1615
PhyFieldRxStatus ProcessSig(Ptr< Event > event, PhyFieldRxStatus status, WifiPpduField field) override
Process SIG-A or SIG-B, perform amendment-specific actions, and provide an updated status of the rece...
Definition he-phy.cc:584
WifiMode GetSigMode(WifiPpduField field, const WifiTxVector &txVector) const override
Get the WifiMode for the SIG field specified by the PPDU field.
Definition he-phy.cc:109
uint64_t ObtainNextUid(const WifiTxVector &txVector) override
Obtain the next UID for the PPDU to transmit.
Definition he-phy.cc:1263
dBm_u GetCcaThreshold(const Ptr< const WifiPpdu > ppdu, WifiChannelListType channelType) const override
Return the CCA threshold for a given channel type.
Definition he-phy.cc:1084
Ptr< ObssPdAlgorithm > GetObssPdAlgorithm() const
Gets the OBSS-PD algorithm.
Definition he-phy.cc:701
static bool IsAllowed(const WifiTxVector &txVector)
Check whether the combination in TXVECTOR is allowed.
Definition he-phy.cc:1751
static Time GetSymbolDuration(Time guardInterval)
Definition he-phy.cc:1714
WifiMode GetSigBMode(const WifiTxVector &txVector) const override
Definition he-phy.cc:138
virtual PhyFieldRxStatus ProcessSigA(Ptr< Event > event, PhyFieldRxStatus status)
Process SIG-A, perform amendment-specific actions, and provide an updated status of the reception.
Definition he-phy.cc:601
WifiMode GetSigAMode() const override
Definition he-phy.cc:132
Time GetSigADuration(WifiPreamble preamble) const override
Definition he-phy.cc:204
static uint16_t GetConstellationSize(uint8_t mcsValue)
Return the constellation size corresponding to the supplied HE MCS index.
Definition he-phy.cc:1629
@ PSD_NON_HE_PORTION
Non-HE portion of an HE PPDU.
Definition he-ppdu.h:105
static uint64_t CalculatePhyRate(WifiCodeRate codeRate, uint64_t dataRate)
Return the PHY rate corresponding to the supplied code rate and data rate.
Definition ht-phy.cc:658
uint8_t m_bssMembershipSelector
the BSS membership selector
Definition ht-phy.h:570
PhyFieldRxStatus DoEndReceiveField(WifiPpduField field, Ptr< Event > event) override
End receiving a given field, perform amendment-specific actions, and provide the status of the recept...
Definition ht-phy.cc:390
uint8_t m_maxMcsIndexPerSs
the maximum MCS index per spatial stream as defined by the standard
Definition ht-phy.h:568
Time GetDuration(WifiPpduField field, const WifiTxVector &txVector) const override
Get the duration of the PPDU field (or group of fields) used by this entity for the given transmissio...
Definition ht-phy.cc:209
std::vector< MHz_u > GetCcaSecondaryWidths(const Ptr< const WifiPpdu > ppdu) const
Get the widths of the secondary channels to inspect for CCA indication.
Definition ht-phy.cc:830
static uint64_t CalculateDataRate(Time symbolDuration, uint16_t usableSubCarriers, uint16_t numberOfBitsPerSubcarrier, double codingRate, uint8_t nss)
Calculates data rate from the supplied parameters.
Definition ht-phy.cc:707
static double GetCodeRatio(WifiCodeRate codeRate)
Convert WifiCodeRate to a ratio, e.g., code ratio of WIFI_CODE_RATE_1_2 is 0.5.
Definition ht-phy.cc:673
uint8_t m_maxSupportedMcsIndexPerSs
the maximum supported MCS index per spatial stream
Definition ht-phy.h:569
static uint16_t GetUsableSubcarriers()
Definition ofdm-phy.cc:624
Ptr< WifiPhy > m_wifiPhy
Pointer to the owning WifiPhy.
Definition phy-entity.h:941
std::optional< std::pair< Time, WifiChannelListType > > CcaIndication
CCA end time and its corresponding channel list type (can be std::nullopt if IDLE)
Definition phy-entity.h:926
std::map< WifiPreamble, std::vector< WifiPpduField > > PpduFormats
A map of PPDU field elements per preamble type.
Definition phy-entity.h:531
Time GetDelayUntilCcaEnd(dBm_u threshold, const WifiSpectrumBandInfo &band)
Return the delay until CCA busy is ended for a given sensitivity threshold and a given band.
std::list< WifiMode > m_modeList
the list of supported modes
Definition phy-entity.h:945
Smart pointer class similar to boost::intrusive_ptr.
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
int64_t GetNanoSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
Definition nstime.h:407
bool IsStrictlyPositive() const
Exactly equivalent to t > 0.
Definition nstime.h:340
PhyFieldRxStatus EndReceiveSig(Ptr< Event > event, WifiPpduField field)
End receiving the SIG-A or SIG-B, perform VHT-specific actions, and provide the status of the recepti...
Definition vht-phy.cc:266
static WifiMode GetVhtMcs(uint8_t index)
Return the VHT MCS corresponding to the provided index.
Definition vht-phy.cc:334
virtual WifiPhyRxfailureReason GetFailureReason(WifiPpduField field) const
Get the failure reason corresponding to the unsuccessful processing of a given PPDU field.
Definition vht-phy.cc:291
static WifiMode CreateWifiMcs(std::string uniqueName, uint8_t mcsValue, WifiModulationClass modClass, bool isMandatory, CodeRateCallback codeRateCallback, ConstellationSizeCallback constellationSizeCallback, PhyRateCallback phyRateCallback, DataRateCallback dataRateCallback, NonHtReferenceRateCallback nonHtReferenceRateCallback, AllowedCallback isAllowedCallback)
Definition wifi-mode.cc:305
represent a single transmission mode
Definition wifi-mode.h:40
uint8_t GetMcsValue() const
Definition wifi-mode.cc:151
MHz_u GetFrequency() const
Definition wifi-phy.cc:1075
dBm_u GetCcaEdThreshold() const
Return the CCA energy detection threshold.
Definition wifi-phy.cc:541
static void AddStaticPhyEntity(WifiModulationClass modulation, Ptr< PhyEntity > phyEntity)
Add the PHY entity to the map of implemented PHY entities for the given modulation class.
Definition wifi-phy.cc:809
MHz_u GetChannelWidth() const
Definition wifi-phy.cc:1087
Ptr< WifiNetDevice > GetDevice() const
Return the device this PHY is associated with.
Definition wifi-phy.cc:655
virtual WifiSpectrumBandInfo GetBand(MHz_u bandWidth, uint8_t bandIndex=0)=0
Get the info of a given band.
const WifiPhyOperatingChannel & GetOperatingChannel() const
Get a const reference to the operating channel.
Definition wifi-phy.cc:1069
std::set< uint8_t > GetAll20MHzChannelIndicesInSecondary(MHz_u width) const
Get the channel indices of all the 20 MHz channels included in the secondary channel of the given wid...
std::set< uint8_t > GetAll20MHzChannelIndicesInPrimary(MHz_u width) const
Get the channel indices of all the 20 MHz channels included in the primary channel of the given width...
uint8_t GetPrimaryChannelIndex(MHz_u primaryChannelWidth) const
If the operating channel width is a multiple of 20 MHz, return the index of the primary channel of th...
static MHz_u GetBandwidth(RuType ruType)
Get the approximate bandwidth occupied by a RU.
Definition wifi-ru.cc:78
static RuType GetRuType(RuSpec ru)
Get the type of a given RU.
Definition wifi-ru.cc:45
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
bool IsSigBCompression() const
Indicate whether the Common field is present in the HE-SIG-B field.
const RuAllocation & GetRuAllocation(uint8_t p20Index) const
Get RU_ALLOCATION field.
WifiMode GetMode(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the selected payload transmission mode.
WifiPreamble GetPreambleType() const
const HeMuUserInfoMap & GetHeMuUserInfoMap() const
Get a const reference to the map HE MU user-specific transmission information indexed by STA-ID.
uint8_t GetEhtPpduType() const
Get the EHT_PPDU_TYPE parameter.
uint8_t GetNss(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the number of spatial streams.
MHz_u GetChannelWidth() const
Time GetGuardInterval() const
WifiRu::RuSpec GetRu(uint16_t staId) const
Get the RU specification for the STA-ID.
#define GET_EHT_MCS(x)
Definition eht-phy.cc:273
#define CASE(x)
Declaration of ns3::EhtPhy class.
#define EHT_PHY
This defines the BSS membership value for EHT PHY.
Definition eht-phy.h:26
Declaration of ns3::EhtPpdu class.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition assert.h:55
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition assert.h:75
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
Definition abort.h:38
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition log.h:271
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
auto MakeBoundCallback(R(*fnPtr)(Args...), BArgs &&... bargs)
Make Callbacks with varying number of bound arguments.
Definition callback.h:745
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition ptr.h:436
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1381
WifiPhyRxfailureReason
Enumeration of the possible reception failure reasons.
WifiChannelListType
Enumeration of the possible channel-list parameter elements defined in Table 8-5 of IEEE 802....
WifiPpduField
The type of PPDU field (grouped for convenience)
@ U_SIG_FAILURE
@ EHT_SIG_FAILURE
@ WIFI_PREAMBLE_EHT_TB
@ WIFI_PREAMBLE_EHT_MU
@ WIFI_MOD_CLASS_EHT
EHT (Clause 36)
@ WIFI_CHANLIST_PRIMARY
@ WIFI_CHANLIST_SECONDARY40
@ WIFI_CHANLIST_SECONDARY
@ WIFI_CHANLIST_SECONDARY80
@ WIFI_PPDU_FIELD_SIG_B
SIG-B field.
@ WIFI_PPDU_FIELD_TRAINING
STF + LTF fields (excluding those in preamble for HT-GF)
@ WIFI_PPDU_FIELD_NON_HT_HEADER
PHY header field for DSSS or ERP, short PHY header field for HR/DSSS or ERP, field not present for HT...
@ WIFI_PPDU_FIELD_EHT_SIG
EHT-SIG field.
@ WIFI_PPDU_FIELD_PREAMBLE
SYNC + SFD fields for DSSS or ERP, shortSYNC + shortSFD fields for HR/DSSS or ERP,...
@ WIFI_PPDU_FIELD_U_SIG
U-SIG field.
@ WIFI_PPDU_FIELD_DATA
data field
@ WIFI_PPDU_FIELD_SIG_A
SIG-A field.
class anonymous_namespace{eht-phy.cc}::ConstructorEht g_constructor_eht
the constructor for EHT modes
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Definition callback.h:684
bool IsEht(WifiPreamble preamble)
Return true if a preamble corresponds to an EHT transmission.
double dBm_u
dBm weak type
Definition wifi-units.h:27
bool IsDlMu(WifiPreamble preamble)
Return true if a preamble corresponds to a downlink multi-user transmission.
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
Definition wifi-ppdu.h:38
const std::map< MHz_u, WifiChannelListType > ehtSecondaryChannels
map a given secondary channel width to its channel list type
Definition eht-phy.cc:52
WifiCodeRate
These constants define the various convolutional coding rates used for the OFDM transmission modes in...
@ WIFI_CODE_RATE_3_4
3/4 coding rate
@ WIFI_CODE_RATE_5_6
5/6 coding rate
Status of the reception of the PPDU field.
Definition phy-entity.h:80