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 {
57};
58
59// clang-format on
60
61EhtPhy::EhtPhy(bool buildModeList /* = true */)
62 : HePhy(false) // don't add HE modes to list
63{
64 NS_LOG_FUNCTION(this << buildModeList);
68 if (buildModeList)
69 {
71 }
72}
73
75{
76 NS_LOG_FUNCTION(this);
77}
78
79void
81{
82 NS_LOG_FUNCTION(this);
83 NS_ASSERT(m_modeList.empty());
85 for (uint8_t index = 0; index <= m_maxSupportedMcsIndexPerSs; ++index)
86 {
87 NS_LOG_LOGIC("Add EhtMcs" << +index << " to list");
88 m_modeList.emplace_back(CreateEhtMcs(index));
89 }
90}
91
92uint16_t
94{
95 if (channelWidth == MHz_u{320})
96 {
97 return 3920;
98 }
99 return HePhy::GetUsableSubcarriers(channelWidth);
100}
101
103EhtPhy::GetSigMode(WifiPpduField field, const WifiTxVector& txVector) const
104{
105 switch (field)
106 {
108 return GetSigAMode(); // U-SIG is similar to SIG-A
110 return GetSigBMode(txVector); // EHT-SIG is similar to SIG-B
111 default:
112 return HePhy::GetSigMode(field, txVector);
113 }
114}
115
117EhtPhy::GetSigBMode(const WifiTxVector& txVector) const
118{
119 if (txVector.IsDlMu())
120 {
121 return HePhy::GetSigBMode(txVector);
122 }
123 // we get here in case of EHT SU transmission
124 // TODO fix the MCS used for EHT-SIG
125 auto smallestMcs = std::min<uint8_t>(5, txVector.GetMode().GetMcsValue());
126 return VhtPhy::GetVhtMcs(smallestMcs);
127}
128
129Time
130EhtPhy::GetDuration(WifiPpduField field, const WifiTxVector& txVector) const
131{
132 switch (field)
133 {
135 return GetSigADuration(txVector.GetPreambleType()); // U-SIG is similar to SIG-A
137 return GetSigBDuration(txVector); // EHT-SIG is similar to SIG-B
139 [[fallthrough]];
141 return NanoSeconds(0);
142 default:
143 return HePhy::GetDuration(field, txVector);
144 }
145}
146
148EhtPhy::GetSigBSize(const WifiTxVector& txVector) const
149{
150 if (ns3::IsDlMu(txVector.GetPreambleType()) && ns3::IsEht(txVector.GetPreambleType()))
151 {
153 txVector.GetChannelWidth(),
154 txVector.GetRuAllocation(
156 txVector.GetEhtPpduType(),
157 txVector.IsSigBCompression(),
158 txVector.IsSigBCompression() ? txVector.GetHeMuUserInfoMap().size() : 0);
159 }
160 return HePhy::GetSigBSize(txVector);
161}
162
163Time
165{
166 Time duration = GetDuration(WIFI_PPDU_FIELD_PREAMBLE, txVector) +
169 return duration;
170}
171
172Time
174{
175 Time duration = GetDuration(WIFI_PPDU_FIELD_PREAMBLE, txVector) +
179 return duration;
180}
181
184{
185 return m_ehtPpduFormats;
186}
187
189EhtPhy::BuildPpdu(const WifiConstPsduMap& psdus, const WifiTxVector& txVector, Time ppduDuration)
190{
191 NS_LOG_FUNCTION(this << psdus << txVector << ppduDuration);
192 return Create<EhtPpdu>(psdus,
193 txVector,
195 ppduDuration,
196 ObtainNextUid(txVector),
198}
199
202{
203 NS_LOG_FUNCTION(this << field << *event);
204 switch (field)
205 {
207 [[fallthrough]];
209 return EndReceiveSig(event, field);
210 default:
211 return HePhy::DoEndReceiveField(field, event);
212 }
213}
214
217{
218 NS_LOG_FUNCTION(this << *event << status << field);
219 switch (field)
220 {
222 return ProcessSigA(event, status); // U-SIG is similar to SIG-A
224 return ProcessSigB(event, status); // EHT-SIG is similar to SIG-B
225 default:
226 return HePhy::ProcessSig(event, status, field);
227 }
228 return status;
229}
230
233{
234 switch (field)
235 {
237 return U_SIG_FAILURE;
239 return EHT_SIG_FAILURE;
240 default:
241 return HePhy::GetFailureReason(field);
242 }
243}
244
245void
247{
248 for (uint8_t i = 0; i <= 13; ++i)
249 {
250 GetEhtMcs(i);
251 }
252}
253
255EhtPhy::GetEhtMcs(uint8_t index)
256{
257#define CASE(x) \
258 case x: \
259 return GetEhtMcs##x();
260
261 switch (index)
262 {
263 CASE(0)
264 CASE(1)
265 CASE(2)
266 CASE(3)
267 CASE(4)
268 CASE(5)
269 CASE(6)
270 CASE(7)
271 CASE(8)
272 CASE(9)
273 CASE(10)
274 CASE(11)
275 CASE(12)
276 CASE(13)
277 default:
278 NS_ABORT_MSG("Inexistent index (" << +index << ") requested for EHT");
279 return WifiMode();
280 }
281#undef CASE
282}
283
284#define GET_EHT_MCS(x) \
285 WifiMode EhtPhy::GetEhtMcs##x() \
286 { \
287 static WifiMode mcs = CreateEhtMcs(x); \
288 return mcs; \
289 }
290
301GET_EHT_MCS(10)
302GET_EHT_MCS(11)
303GET_EHT_MCS(12)
304GET_EHT_MCS(13)
305#undef GET_EHT_MCS
306
307WifiMode
309{
310 NS_ASSERT_MSG(index <= 13, "EhtMcs index must be <= 13!");
311 return WifiModeFactory::CreateWifiMcs("EhtMcs" + std::to_string(index),
312 index,
314 false,
321}
322
324EhtPhy::GetCodeRate(uint8_t mcsValue)
325{
326 switch (mcsValue)
327 {
328 case 12:
329 return WIFI_CODE_RATE_3_4;
330 case 13:
331 return WIFI_CODE_RATE_5_6;
332 default:
333 return HePhy::GetCodeRate(mcsValue);
334 }
335}
336
337uint16_t
339{
340 switch (mcsValue)
341 {
342 case 12:
343 [[fallthrough]];
344 case 13:
345 return 4096;
346 default:
347 return HePhy::GetConstellationSize(mcsValue);
348 }
349}
350
351uint64_t
352EhtPhy::GetPhyRate(uint8_t mcsValue, MHz_u channelWidth, Time guardInterval, uint8_t nss)
353{
354 const auto codeRate = GetCodeRate(mcsValue);
355 const auto dataRate = GetDataRate(mcsValue, channelWidth, guardInterval, nss);
356 return HtPhy::CalculatePhyRate(codeRate, dataRate);
357}
358
359uint64_t
360EhtPhy::GetPhyRateFromTxVector(const WifiTxVector& txVector, uint16_t staId /* = SU_STA_ID */)
361{
362 auto bw = txVector.GetChannelWidth();
363 if (txVector.IsMu())
364 {
365 bw = WifiRu::GetBandwidth(WifiRu::GetRuType(txVector.GetRu(staId)));
366 }
367 return EhtPhy::GetPhyRate(txVector.GetMode(staId).GetMcsValue(),
368 bw,
369 txVector.GetGuardInterval(),
370 txVector.GetNss(staId));
371}
372
373uint64_t
374EhtPhy::GetDataRateFromTxVector(const WifiTxVector& txVector, uint16_t staId /* = SU_STA_ID */)
375{
376 auto bw = txVector.GetChannelWidth();
377 if (txVector.IsMu())
378 {
379 bw = WifiRu::GetBandwidth(WifiRu::GetRuType(txVector.GetRu(staId)));
380 }
381 return EhtPhy::GetDataRate(txVector.GetMode(staId).GetMcsValue(),
382 bw,
383 txVector.GetGuardInterval(),
384 txVector.GetNss(staId));
385}
386
387uint64_t
388EhtPhy::GetDataRate(uint8_t mcsValue, MHz_u channelWidth, Time guardInterval, uint8_t nss)
389{
390 [[maybe_unused]] const auto gi = guardInterval.GetNanoSeconds();
391 NS_ASSERT((gi == 800) || (gi == 1600) || (gi == 3200));
392 NS_ASSERT(nss <= 8);
393 return HtPhy::CalculateDataRate(GetSymbolDuration(guardInterval),
394 GetUsableSubcarriers(channelWidth),
395 static_cast<uint16_t>(log2(GetConstellationSize(mcsValue))),
397 nss);
398}
399
400uint64_t
402{
403 WifiCodeRate codeRate = GetCodeRate(mcsValue);
404 uint16_t constellationSize = GetConstellationSize(mcsValue);
405 return CalculateNonHtReferenceRate(codeRate, constellationSize);
406}
407
408uint64_t
409EhtPhy::CalculateNonHtReferenceRate(WifiCodeRate codeRate, uint16_t constellationSize)
410{
411 uint64_t dataRate;
412 switch (constellationSize)
413 {
414 case 4096:
415 if (codeRate == WIFI_CODE_RATE_3_4 || codeRate == WIFI_CODE_RATE_5_6)
416 {
417 dataRate = 54000000;
418 }
419 else
420 {
421 NS_FATAL_ERROR("Trying to get reference rate for a MCS with wrong combination of "
422 "coding rate and modulation");
423 }
424 break;
425 default:
426 dataRate = HePhy::CalculateNonHtReferenceRate(codeRate, constellationSize);
427 }
428 return dataRate;
429}
430
431dBm_u
433{
434 if (!ppdu)
435 {
436 /**
437 * A signal is present on the 20 MHz subchannel at or above a threshold of –62 dBm at the
438 * receiver's antenna(s). The PHY shall indicate that the 20 MHz subchannel is busy a period
439 * aCCATime after the signal starts and shall continue to indicate the 20 MHz subchannel is
440 * busy while the threshold continues to be exceeded (Sec. 36.3.21.6.4 - Per 20 MHz CCA
441 * sensitivity - of 802.11be D7.0).
442 */
444 }
445
446 /**
447 * A non-HT, HT_MF, HT_GF, VHT, HE, or EHT PPDU for which the power measured within
448 * this 20 MHz subchannel is at or above max(–72 dBm, OBSS_PD level) at the
449 * receiver’s antenna(s). The PHY shall indicate that the 20 MHz subchannel is busy
450 * with greater than 90% probability within a period aCCAMidTime (Sec. 36.3.21.6.4 - Per 20 MHz
451 * CCA sensitivity - of 802.11be D7.0).
452 */
453 auto ehtConfiguration = m_wifiPhy->GetDevice()->GetEhtConfiguration();
454 NS_ASSERT(ehtConfiguration);
455 const auto ccaThresholdNonObss = ehtConfiguration->m_per20CcaSensitivityThreshold;
456 return GetObssPdAlgorithm()
457 ? std::max(ccaThresholdNonObss, GetObssPdAlgorithm()->GetObssPdLevel())
458 : ccaThresholdNonObss;
459}
460
461dBm_u
463{
464 if (channelType != WIFI_CHANLIST_PRIMARY)
465 {
466 return Per20MHzCcaThreshold(ppdu);
467 }
468 return HePhy::GetCcaThreshold(ppdu, channelType);
469}
470
471const std::map<MHz_u, WifiChannelListType>&
476
479{
480 const auto secondaryWidthsToCheck = GetCcaSecondaryWidths(ppdu);
481
482 for (auto secondaryWidth : secondaryWidthsToCheck)
483 {
484 const auto channelType = ehtSecondaryChannels.at(secondaryWidth);
485 const auto ccaThreshold = GetCcaThreshold(ppdu, channelType);
486 const auto indices =
488 for (auto index : indices)
489 {
490 const auto band = m_wifiPhy->GetBand(20, index);
491 if (const auto delayUntilCcaEnd = GetDelayUntilCcaEnd(ccaThreshold, band);
492 delayUntilCcaEnd.IsStrictlyPositive())
493 {
494 return std::make_pair(delayUntilCcaEnd, channelType);
495 }
496 }
497 }
498
499 return std::nullopt;
500}
501
502std::vector<Time>
504{
505 NS_LOG_FUNCTION(this);
506
507 /**
508 * 36.3.21.6.4 Per 20 MHz CCA sensitivity:
509 * If the operating channel width is greater than 20 MHz and the PHY issues a PHY-CCA.indication
510 * primitive, the PHY shall set the per20bitmap to indicate the busy/idle status of each 20 MHz
511 * subchannel.
512 */
513 if (m_wifiPhy->GetChannelWidth() < 40)
514 {
515 return {};
516 }
517
518 std::vector<Time> per20MhzDurations{};
521 for (auto index : indices)
522 {
523 auto band = m_wifiPhy->GetBand(20, index);
524 /**
525 * A signal is present on the 20 MHz subchannel at or above a threshold of –62 dBm at the
526 * receiver's antenna(s). The PHY shall indicate that the 20 MHz subchannel is busy a period
527 * aCCATime after the signal starts and shall continue to indicate the 20 MHz subchannel is
528 * busy while the threshold continues to be exceeded.
529 */
530 dBm_u ccaThreshold = -62;
531 auto delayUntilCcaEnd = GetDelayUntilCcaEnd(ccaThreshold, band);
532
533 if (ppdu)
534 {
535 const MHz_u subchannelMinFreq =
536 m_wifiPhy->GetFrequency() - (m_wifiPhy->GetChannelWidth() / 2) + (index * 20);
537 const MHz_u subchannelMaxFreq = subchannelMinFreq + 20;
538 const auto ppduBw = ppdu->GetTxVector().GetChannelWidth();
539
540 if ((ppduBw <= m_wifiPhy->GetChannelWidth()) &&
541 ppdu->DoesOverlapChannel(subchannelMinFreq, subchannelMaxFreq))
542 {
543 ccaThreshold = Per20MHzCcaThreshold(ppdu);
544 const auto ppduCcaDuration = GetDelayUntilCcaEnd(ccaThreshold, band);
545 delayUntilCcaEnd = std::max(delayUntilCcaEnd, ppduCcaDuration);
546 }
547 }
548 per20MhzDurations.push_back(delayUntilCcaEnd);
549 }
550
551 return per20MhzDurations;
552}
553
554} // namespace ns3
555
556namespace
557{
558
559/**
560 * Constructor class for EHT modes
561 */
571
572} // namespace
Constructor class for EHT modes.
Definition eht-phy.cc:563
static const PpduFormats m_ehtPpduFormats
EHT PPDU formats.
Definition eht-phy.h:302
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:409
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:216
static WifiCodeRate GetCodeRate(uint8_t mcsValue)
Return the coding rate corresponding to the supplied EHT MCS index.
Definition eht-phy.cc:324
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:503
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:103
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:462
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:478
static uint16_t GetConstellationSize(uint8_t mcsValue)
Return the constellation size corresponding to the supplied EHT MCS index.
Definition eht-phy.cc:338
WifiPhyRxfailureReason GetFailureReason(WifiPpduField field) const override
Get the failure reason corresponding to the unsuccessful processing of a given PPDU field.
Definition eht-phy.cc:232
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:360
static WifiMode GetEhtMcs(uint8_t index)
Return the EHT MCS corresponding to the provided index.
Definition eht-phy.cc:255
void BuildModeList() override
Build mode list.
Definition eht-phy.cc:80
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:472
static void InitializeModes()
Initialize all EHT modes.
Definition eht-phy.cc:246
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:388
static WifiMode CreateEhtMcs(uint8_t index)
Create and return the EHT MCS corresponding to the provided index.
Definition eht-phy.cc:308
const PpduFormats & GetPpduFormats() const override
Return the PPDU formats of the PHY.
Definition eht-phy.cc:183
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:374
~EhtPhy() override
Destructor for EHT PHY.
Definition eht-phy.cc:74
uint32_t GetSigBSize(const WifiTxVector &txVector) const override
Definition eht-phy.cc:148
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:352
dBm_u Per20MHzCcaThreshold(const Ptr< const WifiPpdu > ppdu) const
Compute the CCA threshold for Per 20MHz check.
Definition eht-phy.cc:432
Time CalculateNonHeDurationForHeTb(const WifiTxVector &txVector) const override
Definition eht-phy.cc:164
EhtPhy(bool buildModeList=true)
Constructor for EHT PHY.
Definition eht-phy.cc:61
Ptr< WifiPpdu > BuildPpdu(const WifiConstPsduMap &psdus, const WifiTxVector &txVector, Time ppduDuration) override
Build amendment-specific PPDU.
Definition eht-phy.cc:189
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:401
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:130
Time CalculateNonHeDurationForHeMu(const WifiTxVector &txVector) const override
Definition eht-phy.cc:173
WifiMode GetSigBMode(const WifiTxVector &txVector) const override
Definition eht-phy.cc:117
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:201
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:258
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:723
Time GetSigBDuration(const WifiTxVector &txVector) const override
Definition he-phy.cc:230
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:1735
static WifiCodeRate GetCodeRate(uint8_t mcsValue)
Return the coding rate corresponding to the supplied HE MCS index.
Definition he-phy.cc:1620
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:585
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:1268
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:1089
Ptr< ObssPdAlgorithm > GetObssPdAlgorithm() const
Gets the OBSS-PD algorithm.
Definition he-phy.cc:702
static bool IsAllowed(const WifiTxVector &txVector)
Check whether the combination in TXVECTOR is allowed.
Definition he-phy.cc:1758
static Time GetSymbolDuration(Time guardInterval)
Definition he-phy.cc:1721
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:602
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:1634
@ 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:623
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:256
static WifiMode GetVhtMcs(uint8_t index)
Return the VHT MCS corresponding to the provided index.
Definition vht-phy.cc:324
virtual WifiPhyRxfailureReason GetFailureReason(WifiPpduField field) const
Get the failure reason corresponding to the unsuccessful processing of a given PPDU field.
Definition vht-phy.cc:281
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:38
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:542
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:810
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:656
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:284
#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_SECONDARY160
@ 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