A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
vht-phy.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Orange Labs
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Authors: Rediet <getachew.redieteab@orange.com>
7 * Sébastien Deronne <sebastien.deronne@gmail.com> (for logic ported from wifi-phy)
8 */
9
10#include "vht-phy.h"
11
12#include "vht-configuration.h"
13#include "vht-ppdu.h"
14
15#include "ns3/assert.h"
16#include "ns3/interference-helper.h"
17#include "ns3/log.h"
18#include "ns3/wifi-net-device.h"
19#include "ns3/wifi-phy.h" //only used for static mode constructor
20#include "ns3/wifi-psdu.h"
21#include "ns3/wifi-utils.h"
22
23#undef NS_LOG_APPEND_CONTEXT
24#define NS_LOG_APPEND_CONTEXT WIFI_PHY_NS_LOG_APPEND_CONTEXT(m_wifiPhy)
25
26namespace ns3
27{
28
30
31/*******************************************************
32 * VHT PHY (IEEE 802.11-2016, clause 21)
33 *******************************************************/
34
35// clang-format off
36
40 WIFI_PPDU_FIELD_SIG_A, // VHT-SIG-A
41 WIFI_PPDU_FIELD_TRAINING, // VHT-STF + VHT-LTFs
45 WIFI_PPDU_FIELD_SIG_A, // VHT-SIG-A
46 WIFI_PPDU_FIELD_TRAINING, // VHT-STF + VHT-LTFs
47 WIFI_PPDU_FIELD_SIG_B, // VHT-SIG-B
49};
50
52 /* {BW,Nss,MCS} Nes */
53 { std::make_tuple (MHz_u{80}, 7, 2), 3 }, // instead of 2
54 { std::make_tuple (MHz_u{80}, 7, 7), 6 }, // instead of 4
55 { std::make_tuple (MHz_u{80}, 7, 8), 6 }, // instead of 5
56 { std::make_tuple (MHz_u{80}, 8, 7), 6 }, // instead of 5
57 { std::make_tuple (MHz_u{160}, 4, 7), 6 }, // instead of 5
58 { std::make_tuple (MHz_u{160}, 5, 8), 8 }, // instead of 7
59 { std::make_tuple (MHz_u{160}, 6, 7), 8 }, // instead of 7
60 { std::make_tuple (MHz_u{160}, 7, 3), 4 }, // instead of 3
61 { std::make_tuple (MHz_u{160}, 7, 4), 6 }, // instead of 5
62 { std::make_tuple (MHz_u{160}, 7, 5), 7 }, // instead of 6
63 { std::make_tuple (MHz_u{160}, 7, 7), 9 }, // instead of 8
64 { std::make_tuple (MHz_u{160}, 7, 8), 12 }, // instead of 9
65 { std::make_tuple (MHz_u{160}, 7, 9), 12 }, // instead of 10
66};
67
68// clang-format on
69
70/**
71 * @brief map a given secondary channel width to its channel list type
72 */
73const std::map<MHz_u, WifiChannelListType> vhtSecondaryChannels{
77};
78
79VhtPhy::VhtPhy(bool buildModeList /* = true */)
80 : HtPhy(1, false) // don't add HT modes to list
81{
82 NS_LOG_FUNCTION(this << buildModeList);
86 if (buildModeList)
87 {
89 }
90}
91
93{
94 NS_LOG_FUNCTION(this);
95}
96
97void
99{
100 NS_LOG_FUNCTION(this);
101 NS_ASSERT(m_modeList.empty());
103 for (uint8_t index = 0; index <= m_maxSupportedMcsIndexPerSs; ++index)
104 {
105 NS_LOG_LOGIC("Add VhtMcs" << +index << " to list");
106 m_modeList.emplace_back(CreateVhtMcs(index));
107 }
108}
109
112{
113 return m_vhtPpduFormats;
114}
115
117VhtPhy::GetSigMode(WifiPpduField field, const WifiTxVector& txVector) const
118{
119 switch (field)
120 {
121 case WIFI_PPDU_FIELD_TRAINING: // consider SIG-A mode for training (useful for
122 // InterferenceHelper)
124 return GetSigAMode();
126 return GetSigBMode(txVector);
127 default:
128 return HtPhy::GetSigMode(field, txVector);
129 }
130}
131
134{
136 NS_FATAL_ERROR("No HT-SIG");
137 return WifiMode();
138}
139
142{
143 return GetLSigMode(); // same number of data tones as OFDM (i.e. 48)
144}
145
147VhtPhy::GetSigBMode(const WifiTxVector& txVector) const
148{
150 "VHT-SIG-B only available for VHT MU");
151 return GetVhtMcs0();
152}
153
154Time
155VhtPhy::GetDuration(WifiPpduField field, const WifiTxVector& txVector) const
156{
157 switch (field)
158 {
160 return GetSigADuration(txVector.GetPreambleType());
162 return GetSigBDuration(txVector);
163 default:
164 return HtPhy::GetDuration(field, txVector);
165 }
166}
167
168Time
170{
171 return MicroSeconds(4); // L-SIG
172}
173
174Time
176{
177 return MicroSeconds(0); // no HT-SIG
178}
179
180Time
182 uint8_t nDataLtf,
183 uint8_t nExtensionLtf /* = 0 */) const
184{
185 NS_ABORT_MSG_IF(nDataLtf > 8, "Unsupported number of LTFs " << +nDataLtf << " for VHT");
186 NS_ABORT_MSG_IF(nExtensionLtf > 0, "No extension LTFs expected for VHT");
187 return MicroSeconds(4 + 4 * nDataLtf); // VHT-STF + VHT-LTFs
188}
189
190Time
192{
193 return MicroSeconds(8); // VHT-SIG-A (first and second symbol)
194}
195
196Time
198{
199 return (txVector.GetPreambleType() == WIFI_PREAMBLE_VHT_MU)
200 ? MicroSeconds(4)
201 : MicroSeconds(0); // HE-SIG-B only for MU
202}
203
204uint8_t
206{
207 WifiMode payloadMode = txVector.GetMode();
208 /**
209 * General rule: add an encoder when crossing maxRatePerCoder frontier
210 *
211 * The value of 540 Mbps and 600 Mbps for normal GI and short GI (resp.)
212 * were obtained by observing the rates for which Nes was incremented in tables
213 * 21-30 to 21-61 of IEEE 802.11-2016.
214 * These values are the last values before changing encoders.
215 */
216 double maxRatePerCoder = (txVector.GetGuardInterval().GetNanoSeconds() == 800) ? 540e6 : 600e6;
217 uint8_t nes = ceil(payloadMode.GetDataRate(txVector) / maxRatePerCoder);
218
219 // Handle exceptions to the rule
220 auto iter = m_exceptionsMap.find(
221 std::make_tuple(txVector.GetChannelWidth(), txVector.GetNss(), payloadMode.GetMcsValue()));
222 if (iter != m_exceptionsMap.end())
223 {
224 nes = iter->second;
225 }
226 return nes;
227}
228
230VhtPhy::BuildPpdu(const WifiConstPsduMap& psdus, const WifiTxVector& txVector, Time ppduDuration)
231{
232 NS_LOG_FUNCTION(this << psdus << txVector << ppduDuration);
233 return Create<VhtPpdu>(psdus.begin()->second,
234 txVector,
236 ppduDuration,
237 ObtainNextUid(txVector));
238}
239
242{
243 NS_LOG_FUNCTION(this << field << *event);
244 switch (field)
245 {
247 [[fallthrough]];
249 return EndReceiveSig(event, field);
250 default:
251 return HtPhy::DoEndReceiveField(field, event);
252 }
253}
254
257{
258 NS_LOG_FUNCTION(this << *event << field);
259 SnrPer snrPer = GetPhyHeaderSnrPer(field, event);
260 NS_LOG_DEBUG(field << ": SNR(dB)=" << RatioToDb(snrPer.snr) << ", PER=" << snrPer.per);
261 PhyFieldRxStatus status(GetRandomValue() > snrPer.per);
262 if (status.isSuccess)
263 {
264 NS_LOG_DEBUG("Received " << field);
265 if (!IsAllConfigSupported(WIFI_PPDU_FIELD_SIG_A, event->GetPpdu()))
266 {
268 }
269 status = ProcessSig(event, status, field);
270 }
271 else
272 {
273 NS_LOG_DEBUG("Drop packet because " << field << " reception failed");
274 status.reason = GetFailureReason(field);
275 status.actionIfFailure = DROP;
276 }
277 return status;
278}
279
282{
283 switch (field)
284 {
286 return SIG_A_FAILURE;
288 return SIG_B_FAILURE;
289 default:
290 NS_ASSERT_MSG(false, "Unknown PPDU field");
291 return UNKNOWN;
292 }
293}
294
297{
298 NS_LOG_FUNCTION(this << *event << status << field);
299 NS_ASSERT(event->GetPpdu()->GetTxVector().GetPreambleType() >= WIFI_PREAMBLE_VHT_SU);
300 // TODO see if something should be done here once MU-MIMO is supported
301 return status; // nothing special for VHT
302}
303
304bool
306{
307 if (ppdu->GetType() == WIFI_PPDU_TYPE_DL_MU && field == WIFI_PPDU_FIELD_SIG_A)
308 {
309 return IsChannelWidthSupported(ppdu); // perform the full check after SIG-B
310 }
311 return HtPhy::IsAllConfigSupported(field, ppdu);
312}
313
314void
316{
317 for (uint8_t i = 0; i < 10; ++i)
318 {
319 GetVhtMcs(i);
320 }
321}
322
324VhtPhy::GetVhtMcs(uint8_t index)
325{
326#define CASE(x) \
327 case x: \
328 return GetVhtMcs##x();
329
330 switch (index)
331 {
332 CASE(0)
333 CASE(1)
334 CASE(2)
335 CASE(3)
336 CASE(4)
337 CASE(5)
338 CASE(6)
339 CASE(7)
340 CASE(8)
341 CASE(9)
342 default:
343 NS_ABORT_MSG("Inexistent index (" << +index << ") requested for VHT");
344 return WifiMode();
345 }
346#undef CASE
347}
348
349#define GET_VHT_MCS(x) \
350 WifiMode VhtPhy::GetVhtMcs##x() \
351 { \
352 static WifiMode mcs = CreateVhtMcs(x); \
353 return mcs; \
354 }
355
366#undef GET_VHT_MCS
367
368WifiMode
370{
371 NS_ASSERT_MSG(index <= 9, "VhtMcs index must be <= 9!");
372 return WifiModeFactory::CreateWifiMcs("VhtMcs" + std::to_string(index),
373 index,
375 false,
382}
383
385VhtPhy::GetCodeRate(uint8_t mcsValue)
386{
387 switch (mcsValue)
388 {
389 case 8:
390 return WIFI_CODE_RATE_3_4;
391 case 9:
392 return WIFI_CODE_RATE_5_6;
393 default:
394 return HtPhy::GetCodeRate(mcsValue);
395 }
396}
397
398uint16_t
400{
401 switch (mcsValue)
402 {
403 case 8:
404 case 9:
405 return 256;
406 default:
407 return HtPhy::GetConstellationSize(mcsValue);
408 }
409}
410
411uint64_t
412VhtPhy::GetPhyRate(uint8_t mcsValue, MHz_u channelWidth, Time guardInterval, uint8_t nss)
413{
414 WifiCodeRate codeRate = GetCodeRate(mcsValue);
415 uint64_t dataRate = GetDataRate(mcsValue, channelWidth, guardInterval, nss);
416 return HtPhy::CalculatePhyRate(codeRate, dataRate);
417}
418
419uint64_t
420VhtPhy::GetPhyRateFromTxVector(const WifiTxVector& txVector, uint16_t /* staId */)
421{
422 return GetPhyRate(txVector.GetMode().GetMcsValue(),
423 txVector.GetChannelWidth(),
424 txVector.GetGuardInterval(),
425 txVector.GetNss());
426}
427
428uint64_t
429VhtPhy::GetDataRateFromTxVector(const WifiTxVector& txVector, uint16_t /* staId */)
430{
431 return GetDataRate(txVector.GetMode().GetMcsValue(),
432 txVector.GetChannelWidth(),
433 txVector.GetGuardInterval(),
434 txVector.GetNss());
435}
436
437uint64_t
438VhtPhy::GetDataRate(uint8_t mcsValue, MHz_u channelWidth, Time guardInterval, uint8_t nss)
439{
440 [[maybe_unused]] const auto gi = guardInterval.GetNanoSeconds();
441 NS_ASSERT((gi == 800) || (gi == 400));
442 NS_ASSERT(nss <= 8);
443 NS_ASSERT_MSG(IsCombinationAllowed(mcsValue, channelWidth, nss),
444 "VHT MCS " << +mcsValue << " forbidden at " << channelWidth << " MHz when NSS is "
445 << +nss);
446 return HtPhy::CalculateDataRate(GetSymbolDuration(guardInterval),
447 GetUsableSubcarriers(channelWidth),
448 static_cast<uint16_t>(log2(GetConstellationSize(mcsValue))),
450 nss);
451}
452
453uint16_t
455{
456 switch (static_cast<uint16_t>(channelWidth))
457 {
458 case 80:
459 return 234;
460 case 160:
461 return 468;
462 default:
463 return HtPhy::GetUsableSubcarriers(channelWidth);
464 }
465}
466
467uint64_t
469{
470 const auto codeRate = GetCodeRate(mcsValue);
471 const auto constellationSize = GetConstellationSize(mcsValue);
472 return CalculateNonHtReferenceRate(codeRate, constellationSize);
473}
474
475uint64_t
476VhtPhy::CalculateNonHtReferenceRate(WifiCodeRate codeRate, uint16_t constellationSize)
477{
478 uint64_t dataRate;
479 switch (constellationSize)
480 {
481 case 256:
482 if (codeRate == WIFI_CODE_RATE_3_4 || codeRate == WIFI_CODE_RATE_5_6)
483 {
484 dataRate = 54000000;
485 }
486 else
487 {
488 NS_FATAL_ERROR("Trying to get reference rate for a MCS with wrong combination of "
489 "coding rate and modulation");
490 }
491 break;
492 default:
493 dataRate = HtPhy::CalculateNonHtReferenceRate(codeRate, constellationSize);
494 }
495 return dataRate;
496}
497
498bool
500{
501 return IsCombinationAllowed(txVector.GetMode().GetMcsValue(),
502 txVector.GetChannelWidth(),
503 txVector.GetNss());
504}
505
506bool
507VhtPhy::IsCombinationAllowed(uint8_t mcsValue, MHz_u channelWidth, uint8_t nss)
508{
509 if (mcsValue == 9 && channelWidth == MHz_u{20} && nss != 3)
510 {
511 return false;
512 }
513 if (mcsValue == 6 && channelWidth == MHz_u{80} && nss == 3)
514 {
515 return false;
516 }
517 return true;
518}
519
522{
523 return 4692480;
524}
525
526dBm_u
528{
529 if (ppdu)
530 {
531 const auto ppduBw = ppdu->GetTxVector().GetChannelWidth();
532 switch (channelType)
533 {
535 // Start of a PPDU for which its power measured within the primary 20 MHz channel is at
536 // or above the CCA sensitivity threshold.
538 }
540 NS_ASSERT_MSG(ppduBw == MHz_u{20}, "Invalid channel width " << ppduBw);
541 break;
543 NS_ASSERT_MSG(ppduBw <= MHz_u{40}, "Invalid channel width " << ppduBw);
544 break;
546 NS_ASSERT_MSG(ppduBw <= MHz_u{80}, "Invalid channel width " << ppduBw);
547 break;
548 default:
549 NS_ASSERT_MSG(false, "Invalid channel list type");
550 }
551 auto vhtConfiguration = m_wifiPhy->GetDevice()->GetVhtConfiguration();
552 NS_ASSERT(vhtConfiguration);
553 const auto thresholds = vhtConfiguration->GetSecondaryCcaSensitivityThresholdsPerBw();
554 const auto it = thresholds.find(ppduBw);
555 NS_ASSERT_MSG(it != std::end(thresholds), "Invalid channel width " << ppduBw);
556 return it->second;
557 }
558 else
559 {
560 const auto it = channelTypeToScalingFactor.find(channelType);
561 NS_ASSERT_MSG(it != std::end(channelTypeToScalingFactor), "Invalid channel list type");
562 return m_wifiPhy->GetCcaEdThreshold() + it->second;
563 }
564}
565
566const std::map<MHz_u, WifiChannelListType>&
571
572} // namespace ns3
573
574namespace
575{
576
577/**
578 * Constructor class for VHT modes
579 */
589
590} // namespace
Constructor class for VHT modes.
Definition vht-phy.cc:581
PHY entity for HT (11n)
Definition ht-phy.h:43
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
static uint16_t GetConstellationSize(uint8_t mcsValue)
Return the constellation size corresponding to the supplied HT MCS index between 0 and 7,...
Definition ht-phy.cc:628
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
static WifiMode GetLSigMode()
Definition ht-phy.cc:153
uint8_t m_maxMcsIndexPerSs
the maximum MCS index per spatial stream as defined by the standard
Definition ht-phy.h:568
bool IsAllConfigSupported(WifiPpduField field, Ptr< const WifiPpdu > ppdu) const override
Checks if the signaled configuration (including bandwidth) is supported by the PHY.
Definition ht-phy.cc:432
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 ht-phy.cc:740
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
static WifiCodeRate GetCodeRate(uint8_t mcsValue)
Return the coding rate corresponding to the supplied HT MCS index between 0 and 7,...
Definition ht-phy.cc:600
WifiMode GetSigMode(WifiPpduField field, const WifiTxVector &txVector) const override
Get the WifiMode for the SIG field specified by the PPDU field.
Definition ht-phy.cc:135
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
virtual Time GetSymbolDuration(const WifiTxVector &txVector) const
Definition ht-phy.cc:370
static uint16_t GetUsableSubcarriers()
Definition ofdm-phy.cc:623
virtual bool IsChannelWidthSupported(Ptr< const WifiPpdu > ppdu) const
Checks if the PPDU's bandwidth is supported by the PHY.
Definition ofdm-phy.cc:333
virtual uint64_t ObtainNextUid(const WifiTxVector &txVector)
Obtain the next UID for the PPDU to transmit.
Ptr< WifiPhy > m_wifiPhy
Pointer to the owning WifiPhy.
Definition phy-entity.h:941
std::map< WifiPreamble, std::vector< WifiPpduField > > PpduFormats
A map of PPDU field elements per preamble type.
Definition phy-entity.h:531
std::list< WifiMode > m_modeList
the list of supported modes
Definition phy-entity.h:945
double GetRandomValue() const
Obtain a random value from the WifiPhy's generator.
SnrPer GetPhyHeaderSnrPer(WifiPpduField field, Ptr< Event > event) const
Obtain the SNR and PER of the PPDU field from the WifiPhy's InterferenceHelper class.
@ DROP
drop PPDU and set CCA_BUSY
Definition phy-entity.h:71
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
static bool IsAllowed(const WifiTxVector &txVector)
Check whether the combination in TXVECTOR is allowed.
Definition vht-phy.cc:499
static WifiMode GetVhtMcs0()
Return MCS 0 from VHT MCS values.
static WifiCodeRate GetCodeRate(uint8_t mcsValue)
Return the coding rate corresponding to the supplied VHT MCS index.
Definition vht-phy.cc:385
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 vht-phy.cc:155
static const NesExceptionMap m_exceptionsMap
exception map for number of BCC encoders (extracted from VHT-MCS tables)
Definition vht-phy.h:347
~VhtPhy() override
Destructor for VHT PHY.
Definition vht-phy.cc:92
static const PpduFormats m_vhtPpduFormats
VHT PPDU formats.
Definition vht-phy.h:349
bool IsAllConfigSupported(WifiPpduField field, Ptr< const WifiPpdu > ppdu) const override
Checks if the signaled configuration (including bandwidth) is supported by the PHY.
Definition vht-phy.cc:305
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 vht-phy.cc:567
static uint64_t GetDataRateFromTxVector(const WifiTxVector &txVector, uint16_t staId)
Return the data rate corresponding to the supplied TXVECTOR.
Definition vht-phy.cc:429
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
uint8_t GetNumberBccEncoders(const WifiTxVector &txVector) const override
Definition vht-phy.cc:205
Time GetTrainingDuration(const WifiTxVector &txVector, uint8_t nDataLtf, uint8_t nExtensionLtf=0) const override
Definition vht-phy.cc:181
virtual Time GetSigBDuration(const WifiTxVector &txVector) const
Definition vht-phy.cc:197
static uint64_t GetPhyRateFromTxVector(const WifiTxVector &txVector, uint16_t staId)
Return the PHY rate corresponding to the supplied TXVECTOR.
Definition vht-phy.cc:420
static bool IsCombinationAllowed(uint8_t mcsValue, MHz_u channelWidth, uint8_t nss)
Check whether the combination of <MCS, channel width, NSS> is allowed.
Definition vht-phy.cc:507
static uint64_t GetDataRate(uint8_t mcsValue, MHz_u channelWidth, Time guardInterval, uint8_t nss)
Return the data rate corresponding to the supplied VHT MCS index, channel width, guard interval,...
Definition vht-phy.cc:438
static WifiMode GetVhtMcs(uint8_t index)
Return the VHT MCS corresponding to the provided index.
Definition vht-phy.cc:324
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 vht-phy.cc:476
Ptr< WifiPpdu > BuildPpdu(const WifiConstPsduMap &psdus, const WifiTxVector &txVector, Time ppduDuration) override
Build amendment-specific PPDU.
Definition vht-phy.cc:230
dBm_u GetCcaThreshold(const Ptr< const WifiPpdu > ppdu, WifiChannelListType channelType) const override
Return the CCA threshold for a given channel type.
Definition vht-phy.cc:527
static uint64_t GetPhyRate(uint8_t mcsValue, MHz_u channelWidth, Time guardInterval, uint8_t nss)
Return the PHY rate corresponding to the supplied VHT MCS index, channel width, guard interval,...
Definition vht-phy.cc:412
void BuildModeList() override
Build mode list.
Definition vht-phy.cc:98
virtual WifiMode GetSigAMode() const
Definition vht-phy.cc:141
Time GetLSigDuration(WifiPreamble preamble) const override
Definition vht-phy.cc:169
std::map< std::tuple< MHz_u, uint8_t, uint8_t >, uint8_t > NesExceptionMap
Typedef for storing exceptions in the number of BCC encoders for VHT MCSs.
Definition vht-phy.h:346
virtual PhyFieldRxStatus ProcessSig(Ptr< Event > event, PhyFieldRxStatus status, WifiPpduField field)
Process SIG-A or SIG-B, perform amendment-specific actions, and provide an updated status of the rece...
Definition vht-phy.cc:296
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 vht-phy.cc:241
static void InitializeModes()
Initialize all VHT modes.
Definition vht-phy.cc:315
static WifiMode CreateVhtMcs(uint8_t index)
Return the VHT MCS corresponding to the provided index.
Definition vht-phy.cc:369
static uint16_t GetConstellationSize(uint8_t mcsValue)
Return the constellation size corresponding to the supplied VHT MCS index.
Definition vht-phy.cc:399
uint32_t GetMaxPsduSize() const override
Get the maximum PSDU size in bytes.
Definition vht-phy.cc:521
static uint64_t GetNonHtReferenceRate(uint8_t mcsValue)
Calculate the rate in bps of the non-HT Reference Rate corresponding to the supplied VHT MCS index.
Definition vht-phy.cc:468
virtual Time GetSigADuration(WifiPreamble preamble) const
Definition vht-phy.cc:191
const PpduFormats & GetPpduFormats() const override
Return the PPDU formats of the PHY.
Definition vht-phy.cc:111
WifiMode GetHtSigMode() const override
Definition vht-phy.cc:133
VhtPhy(bool buildModeList=true)
Constructor for VHT PHY.
Definition vht-phy.cc:79
virtual WifiMode GetSigBMode(const WifiTxVector &txVector) const
Definition vht-phy.cc:147
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
Time GetHtSigDuration() const override
Definition vht-phy.cc:175
WifiMode GetSigMode(WifiPpduField field, const WifiTxVector &txVector) const override
Get the WifiMode for the SIG field specified by the PPDU field.
Definition vht-phy.cc:117
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
uint64_t GetDataRate(MHz_u channelWidth, Time guardInterval, uint8_t nss) const
Definition wifi-mode.cc:110
uint8_t GetMcsValue() const
Definition wifi-mode.cc:151
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
Ptr< WifiNetDevice > GetDevice() const
Return the device this PHY is associated with.
Definition wifi-phy.cc:656
const WifiPhyOperatingChannel & GetOperatingChannel() const
Get a const reference to the operating channel.
Definition wifi-phy.cc:1069
dBm_u GetCcaSensitivityThreshold() const
Return the CCA sensitivity threshold.
Definition wifi-phy.cc:555
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
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
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
#define CASE(x)
#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_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Definition abort.h:97
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition log.h:257
#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 MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1369
WifiPhyRxfailureReason
Enumeration of the possible reception failure reasons.
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
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)
@ UNSUPPORTED_SETTINGS
@ SIG_A_FAILURE
@ SIG_B_FAILURE
@ WIFI_PREAMBLE_VHT_MU
@ WIFI_PREAMBLE_VHT_SU
@ WIFI_PPDU_TYPE_DL_MU
@ WIFI_MOD_CLASS_VHT
VHT (Clause 22)
@ 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_PREAMBLE
SYNC + SFD fields for DSSS or ERP, shortSYNC + shortSFD fields for HR/DSSS or ERP,...
@ WIFI_PPDU_FIELD_DATA
data field
@ WIFI_PPDU_FIELD_SIG_A
SIG-A field.
#define HT_PHY
This defines the BSS membership value for HT PHY.
Definition ht-phy.h:27
class anonymous_namespace{vht-phy.cc}::ConstructorVht g_constructor_vht
the constructor for VHT 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
const std::map< WifiChannelListType, dBm_u > channelTypeToScalingFactor
map a given channel list type to the corresponding scaling factor
dB_u RatioToDb(double ratio)
Convert from ratio to dB.
Definition wifi-utils.cc:45
double MHz_u
MHz weak type.
Definition wifi-units.h:31
double dBm_u
dBm weak type
Definition wifi-units.h:27
const std::map< MHz_u, WifiChannelListType > vhtSecondaryChannels
map a given secondary channel width to its channel list type
Definition vht-phy.cc:73
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
Definition wifi-ppdu.h:38
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
WifiPhyRxfailureReason reason
failure reason
Definition phy-entity.h:82
PhyRxFailureAction actionIfFailure
action to perform in case of failure
Definition phy-entity.h:83
bool isSuccess
outcome (true if success) of the reception
Definition phy-entity.h:81
A struct for both SNR and PER.
Definition phy-entity.h:115
double snr
SNR in linear scale.
Definition phy-entity.h:116
#define GET_VHT_MCS(x)
Definition vht-phy.cc:349
Declaration of ns3::VhtPhy class.
#define VHT_PHY
This defines the BSS membership value for VHT PHY.
Definition vht-phy.h:27
Declaration of ns3::VhtPpdu class.