A Discrete-Event Network Simulator
API
vht-phy.cc
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2020 Orange Labs
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Authors: Rediet <getachew.redieteab@orange.com>
19 * Sébastien Deronne <sebastien.deronne@gmail.com> (for logic ported from wifi-phy)
20 */
21
22#include "vht-phy.h"
23#include "vht-ppdu.h"
24#include "ns3/wifi-psdu.h"
25#include "ns3/wifi-phy.h" //only used for static mode constructor
26#include "ns3/wifi-utils.h"
27#include "ns3/log.h"
28#include "ns3/assert.h"
29
30namespace ns3 {
31
33
34/*******************************************************
35 * VHT PHY (IEEE 802.11-2016, clause 21)
36 *******************************************************/
37
38/* *NS_CHECK_STYLE_OFF* */
42 WIFI_PPDU_FIELD_SIG_A, //VHT-SIG-A
43 WIFI_PPDU_FIELD_TRAINING, //VHT-STF + VHT-LTFs
47 WIFI_PPDU_FIELD_SIG_A, //VHT-SIG-A
48 WIFI_PPDU_FIELD_TRAINING, //VHT-STF + VHT-LTFs
49 WIFI_PPDU_FIELD_SIG_B, //VHT-SIG-B
51};
52
54 /* {BW,Nss,MCS} Nes */
55 { std::make_tuple ( 80, 7, 2), 3 }, //instead of 2
56 { std::make_tuple ( 80, 7, 7), 6 }, //instead of 4
57 { std::make_tuple ( 80, 7, 8), 6 }, //instead of 5
58 { std::make_tuple ( 80, 8, 7), 6 }, //instead of 5
59 { std::make_tuple (160, 4, 7), 6 }, //instead of 5
60 { std::make_tuple (160, 5, 8), 8 }, //instead of 7
61 { std::make_tuple (160, 6, 7), 8 }, //instead of 7
62 { std::make_tuple (160, 7, 3), 4 }, //instead of 3
63 { std::make_tuple (160, 7, 4), 6 }, //instead of 5
64 { std::make_tuple (160, 7, 5), 7 }, //instead of 6
65 { std::make_tuple (160, 7, 7), 9 }, //instead of 8
66 { std::make_tuple (160, 7, 8), 12 }, //instead of 9
67 { std::make_tuple (160, 7, 9), 12 } //instead of 10
68};
69/* *NS_CHECK_STYLE_ON* */
70
71VhtPhy::VhtPhy (bool buildModeList /* = true */)
72 : HtPhy (1, false) //don't add HT modes to list
73{
74 NS_LOG_FUNCTION (this << buildModeList);
78 if (buildModeList)
79 {
81 }
82}
83
85{
86 NS_LOG_FUNCTION (this);
87}
88
89void
91{
92 NS_LOG_FUNCTION (this);
93 NS_ASSERT (m_modeList.empty ());
95 for (uint8_t index = 0; index <= m_maxSupportedMcsIndexPerSs; ++index)
96 {
97 NS_LOG_LOGIC ("Add VhtMcs" << +index << " to list");
98 m_modeList.emplace_back (CreateVhtMcs (index));
99 }
100}
101
104{
105 return m_vhtPpduFormats;
106}
107
109VhtPhy::GetSigMode (WifiPpduField field, const WifiTxVector& txVector) const
110{
111 switch (field)
112 {
113 case WIFI_PPDU_FIELD_TRAINING: //consider SIG-A mode for training (useful for InterferenceHelper)
115 return GetSigAMode ();
117 return GetSigBMode (txVector);
118 default:
119 return HtPhy::GetSigMode (field, txVector);
120 }
121}
122
125{
127 NS_FATAL_ERROR ("No HT-SIG");
128 return WifiMode ();
129}
130
133{
134 return GetLSigMode (); //same number of data tones as OFDM (i.e. 48)
135}
136
138VhtPhy::GetSigBMode (const WifiTxVector& txVector) const
139{
140 NS_ABORT_MSG_IF (txVector.GetPreambleType () != WIFI_PREAMBLE_VHT_MU, "VHT-SIG-B only available for VHT MU");
141 return GetVhtMcs0 ();
142}
143
144Time
145VhtPhy::GetDuration (WifiPpduField field, const WifiTxVector& txVector) const
146{
147 switch (field)
148 {
150 return GetSigADuration (txVector.GetPreambleType ());
152 return GetSigBDuration (txVector);
153 default:
154 return HtPhy::GetDuration (field, txVector);
155 }
156}
157
158Time
160{
161 return MicroSeconds (4); //L-SIG
162}
163
164Time
166{
167 return MicroSeconds (0); //no HT-SIG
168}
169
170Time
172 uint8_t nDataLtf, uint8_t nExtensionLtf /* = 0 */) const
173{
174 NS_ABORT_MSG_IF (nDataLtf > 8, "Unsupported number of LTFs " << +nDataLtf << " for VHT");
175 NS_ABORT_MSG_IF (nExtensionLtf > 0, "No extension LTFs expected for VHT");
176 return MicroSeconds (4 + 4 * nDataLtf); //VHT-STF + VHT-LTFs
177}
178
179Time
181{
182 return MicroSeconds (8); //VHT-SIG-A (first and second symbol)
183}
184
185Time
187{
188 return (txVector.GetPreambleType () == WIFI_PREAMBLE_VHT_MU) ? MicroSeconds (4) : MicroSeconds (0); //HE-SIG-B only for MU
189}
190
191uint8_t
193{
194 WifiMode payloadMode = txVector.GetMode ();
203 double maxRatePerCoder = (txVector.GetGuardInterval () == 800) ? 540e6 : 600e6;
204 uint8_t nes = ceil (payloadMode.GetDataRate (txVector) / maxRatePerCoder);
205
206 //Handle exceptions to the rule
207 auto iter = m_exceptionsMap.find (std::make_tuple (txVector.GetChannelWidth (),
208 txVector.GetNss (),
209 payloadMode.GetMcsValue ()));
210 if (iter != m_exceptionsMap.end ())
211 {
212 nes = iter->second;
213 }
214 return nes;
215}
216
218VhtPhy::BuildPpdu (const WifiConstPsduMap & psdus, const WifiTxVector& txVector, Time ppduDuration)
219{
220 NS_LOG_FUNCTION (this << psdus << txVector << ppduDuration);
221 return Create<VhtPpdu> (psdus.begin ()->second, txVector, ppduDuration, m_wifiPhy->GetPhyBand (),
222 ObtainNextUid (txVector));
223}
224
227{
228 NS_LOG_FUNCTION (this << field << *event);
229 switch (field)
230 {
232 return EndReceiveSigA (event);
234 return EndReceiveSigB (event);
235 default:
236 return HtPhy::DoEndReceiveField (field, event);
237 }
238}
239
242{
243 NS_LOG_FUNCTION (this << *event);
244 NS_ASSERT (event->GetTxVector ().GetPreambleType () >= WIFI_PREAMBLE_VHT_SU);
246 NS_LOG_DEBUG ("SIG-A: SNR(dB)=" << RatioToDb (snrPer.snr) << ", PER=" << snrPer.per);
247 PhyFieldRxStatus status (GetRandomValue () > snrPer.per);
248 if (status.isSuccess)
249 {
250 NS_LOG_DEBUG ("Received SIG-A");
251 if (!IsAllConfigSupported (WIFI_PPDU_FIELD_SIG_A, event->GetPpdu ()))
252 {
253 status = PhyFieldRxStatus (false, UNSUPPORTED_SETTINGS, DROP);
254 }
255 status = ProcessSigA (event, status);
256 }
257 else
258 {
259 NS_LOG_DEBUG ("Drop packet because SIG-A reception failed");
260 status.reason = SIG_A_FAILURE;
261 status.actionIfFailure = DROP;
262 }
263 return status;
264}
265
268{
269 NS_LOG_FUNCTION (this << *event << status);
270 //TODO see if something should be done here once MU-MIMO is supported
271 return status; //nothing special for VHT
272}
273
276{
277 NS_LOG_FUNCTION (this << *event);
278 NS_ASSERT (event->GetPpdu ()->GetType () == WIFI_PPDU_TYPE_DL_MU);
280 NS_LOG_DEBUG ("SIG-B: SNR(dB)=" << RatioToDb (snrPer.snr) << ", PER=" << snrPer.per);
281 PhyFieldRxStatus status (GetRandomValue () > snrPer.per);
282 if (status.isSuccess)
283 {
284 NS_LOG_DEBUG ("Received SIG-B");
285 if (!IsAllConfigSupported (WIFI_PPDU_FIELD_SIG_A, event->GetPpdu ()))
286 {
287 status = PhyFieldRxStatus (false, UNSUPPORTED_SETTINGS, DROP);
288 }
289 status = ProcessSigB (event, status);
290 }
291 else
292 {
293 NS_LOG_DEBUG ("Drop reception because SIG-B reception failed");
294 status.reason = SIG_B_FAILURE;
295 status.actionIfFailure = DROP;
296 }
297 return status;
298}
299
302{
303 NS_LOG_FUNCTION (this << *event << status);
304 //TODO see if something should be done here once MU-MIMO is supported
305 return status; //nothing special for VHT
306}
307
308bool
310{
311 if (ppdu->GetType () == WIFI_PPDU_TYPE_DL_MU && field == WIFI_PPDU_FIELD_SIG_A)
312 {
313 return IsChannelWidthSupported (ppdu); //perform the full check after SIG-B
314 }
315 return HtPhy::IsAllConfigSupported (field, ppdu);
316}
317
318void
320{
321 for (uint8_t i = 0; i < 10; ++i)
322 {
323 GetVhtMcs (i);
324 }
325}
326
328VhtPhy::GetVhtMcs (uint8_t index)
329{
330#define CASE(x) \
331case x: \
332 return GetVhtMcs ## x (); \
333
334 switch (index)
335 {
336 CASE ( 0)
337 CASE ( 1)
338 CASE ( 2)
339 CASE ( 3)
340 CASE ( 4)
341 CASE ( 5)
342 CASE ( 6)
343 CASE ( 7)
344 CASE ( 8)
345 CASE ( 9)
346 default:
347 NS_ABORT_MSG ("Inexistent index (" << +index << ") requested for VHT");
348 return WifiMode ();
349 }
350#undef CASE
351}
352
353#define GET_VHT_MCS(x) \
354WifiMode \
355VhtPhy::GetVhtMcs ## x (void) \
356{ \
357 static WifiMode mcs = CreateVhtMcs (x); \
358 return mcs; \
359}; \
360
361GET_VHT_MCS (0)
362GET_VHT_MCS (1)
363GET_VHT_MCS (2)
364GET_VHT_MCS (3)
365GET_VHT_MCS (4)
366GET_VHT_MCS (5)
367GET_VHT_MCS (6)
368GET_VHT_MCS (7)
369GET_VHT_MCS (8)
370GET_VHT_MCS (9)
371#undef GET_VHT_MCS
372
373WifiMode
374VhtPhy::CreateVhtMcs (uint8_t index)
375{
376 NS_ASSERT_MSG (index <= 9, "VhtMcs index must be <= 9!");
377 return WifiModeFactory::CreateWifiMcs ("VhtMcs" + std::to_string (index),
378 index,
380 false,
387}
388
390VhtPhy::GetCodeRate (uint8_t mcsValue)
391{
392 switch (mcsValue)
393 {
394 case 8:
395 return WIFI_CODE_RATE_3_4;
396 case 9:
397 return WIFI_CODE_RATE_5_6;
398 default:
399 return HtPhy::GetCodeRate (mcsValue);
400 }
401}
402
403uint16_t
405{
406 switch (mcsValue)
407 {
408 case 8:
409 case 9:
410 return 256;
411 default:
412 return HtPhy::GetConstellationSize (mcsValue);
413 }
414}
415
416uint64_t
417VhtPhy::GetPhyRate (uint8_t mcsValue, uint16_t channelWidth, uint16_t guardInterval, uint8_t nss)
418{
419 WifiCodeRate codeRate = GetCodeRate (mcsValue);
420 uint64_t dataRate = GetDataRate (mcsValue, channelWidth, guardInterval, nss);
421 return HtPhy::CalculatePhyRate (codeRate, dataRate);
422}
423
424uint64_t
425VhtPhy::GetPhyRateFromTxVector (const WifiTxVector& txVector, uint16_t /* staId */)
426{
427 return GetPhyRate (txVector.GetMode ().GetMcsValue (),
428 txVector.GetChannelWidth (),
429 txVector.GetGuardInterval (),
430 txVector.GetNss ());
431}
432
433uint64_t
434VhtPhy::GetDataRateFromTxVector (const WifiTxVector& txVector, uint16_t /* staId */)
435{
436 return GetDataRate (txVector.GetMode ().GetMcsValue (),
437 txVector.GetChannelWidth (),
438 txVector.GetGuardInterval (),
439 txVector.GetNss ());
440}
441
442uint64_t
443VhtPhy::GetDataRate (uint8_t mcsValue, uint16_t channelWidth, uint16_t guardInterval, uint8_t nss)
444{
445 NS_ASSERT (guardInterval == 800 || guardInterval == 400);
446 NS_ASSERT (nss <= 8);
447 NS_ASSERT_MSG (IsCombinationAllowed (mcsValue, channelWidth, nss), "VHT MCS " << +mcsValue << " forbidden at " << channelWidth << " MHz when NSS is " << +nss);
448 return HtPhy::CalculateDataRate (3.2, guardInterval,
449 GetUsableSubcarriers (channelWidth),
450 static_cast<uint16_t> (log2 (GetConstellationSize (mcsValue))),
451 HtPhy::GetCodeRatio (GetCodeRate (mcsValue)), nss);
452}
453
454uint16_t
455VhtPhy::GetUsableSubcarriers (uint16_t channelWidth)
456{
457 switch (channelWidth)
458 {
459 case 80:
460 return 234;
461 case 160:
462 return 468;
463 default:
464 return HtPhy::GetUsableSubcarriers (channelWidth);
465 }
466}
467
468uint64_t
470{
471 WifiCodeRate codeRate = GetCodeRate (mcsValue);
472 uint16_t constellationSize = GetConstellationSize (mcsValue);
473 return CalculateNonHtReferenceRate (codeRate, constellationSize);
474}
475
476uint64_t
477VhtPhy::CalculateNonHtReferenceRate (WifiCodeRate codeRate, uint16_t constellationSize)
478{
479 uint64_t dataRate;
480 switch (constellationSize)
481 {
482 case 256:
483 if (codeRate == WIFI_CODE_RATE_3_4 || codeRate == WIFI_CODE_RATE_5_6)
484 {
485 dataRate = 54000000;
486 }
487 else
488 {
489 NS_FATAL_ERROR ("Trying to get reference rate for a MCS with wrong combination of 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, uint16_t channelWidth, uint8_t nss)
508{
509 if (mcsValue == 9 && channelWidth == 20 && nss != 3)
510 {
511 return false;
512 }
513 if (mcsValue == 6 && channelWidth == 80 && nss == 3)
514 {
515 return false;
516 }
517 return true;
518}
519
522{
523 return 4692480;
524}
525
526} //namespace ns3
527
528namespace {
529
533static class ConstructorVht
534{
535public:
537 {
539 ns3::WifiPhy::AddStaticPhyEntity (ns3::WIFI_MOD_CLASS_VHT, ns3::Create<ns3::VhtPhy> ());
540 }
542
543}
Constructor class for VHT modes.
Definition: vht-phy.cc:534
PHY entity for HT (11n)
Definition: ht-phy.h:51
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:626
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:596
uint8_t m_bssMembershipSelector
the BSS membership selector
Definition: ht-phy.h:527
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:365
uint8_t m_maxMcsIndexPerSs
the maximum MCS index per spatial stream as defined by the standard
Definition: ht-phy.h:525
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:407
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:697
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:199
static WifiMode GetLSigMode(void)
Definition: ht-phy.cc:146
static uint64_t CalculateDataRate(double symbolDuration, uint16_t guardInterval, uint16_t usableSubCarriers, uint16_t numberOfBitsPerSubcarrier, double codingRate, uint8_t nss)
Calculates data rate from the supplied parameters.
Definition: ht-phy.cc:673
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:568
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:130
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:641
static uint16_t GetUsableSubcarriers(uint16_t channelWidth)
Definition: ht-phy.cc:683
uint8_t m_maxSupportedMcsIndexPerSs
the maximum supported MCS index per spatial stream
Definition: ht-phy.h:526
virtual bool IsChannelWidthSupported(Ptr< const WifiPpdu > ppdu) const
Checks if the PPDU's bandwidth is supported by the PHY.
Definition: ofdm-phy.cc:317
virtual uint64_t ObtainNextUid(const WifiTxVector &txVector)
Obtain the next UID for the PPDU to transmit.
Definition: phy-entity.cc:1026
Ptr< WifiPhy > m_wifiPhy
Pointer to the owning WifiPhy.
Definition: phy-entity.h:791
double GetRandomValue(void) const
Obtain a random value from the WifiPhy's generator.
Definition: phy-entity.cc:996
std::map< WifiPreamble, std::vector< WifiPpduField > > PpduFormats
A map of PPDU field elements per preamble type.
Definition: phy-entity.h:477
std::list< WifiMode > m_modeList
the list of supported modes
Definition: phy-entity.h:794
SnrPer GetPhyHeaderSnrPer(WifiPpduField field, Ptr< Event > event) const
Obtain the SNR and PER of the PPDU field from the WifiPhy's InterferenceHelper class.
Definition: phy-entity.cc:250
@ DROP
drop PPDU and set CCA_BUSY
Definition: phy-entity.h:102
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
static bool IsAllowed(const WifiTxVector &txVector)
Check whether the combination in TXVECTOR is allowed.
Definition: vht-phy.cc:499
static WifiCodeRate GetCodeRate(uint8_t mcsValue)
Return the coding rate corresponding to the supplied VHT MCS index.
Definition: vht-phy.cc:390
static bool IsCombinationAllowed(uint8_t mcsValue, uint16_t channelWidth, uint8_t nss)
Check whether the combination of <MCS, channel width, NSS> is allowed.
Definition: vht-phy.cc:507
static uint16_t GetUsableSubcarriers(uint16_t channelWidth)
Definition: vht-phy.cc:455
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:145
static const NesExceptionMap m_exceptionsMap
exception map for number of BCC encoders (extracted from VHT-MCS tables)
Definition: vht-phy.h:355
Time GetHtSigDuration(void) const override
Definition: vht-phy.cc:165
static const PpduFormats m_vhtPpduFormats
VHT PPDU formats.
Definition: vht-phy.h:356
std::map< std::tuple< uint16_t, uint8_t, uint8_t >, uint8_t > NesExceptionMap
Typedef for storing exceptions in the number of BCC encoders for VHT MCSs.
Definition: vht-phy.h:354
void BuildModeList(void) override
Build mode list.
Definition: vht-phy.cc:90
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:309
static uint64_t GetDataRateFromTxVector(const WifiTxVector &txVector, uint16_t staId)
Return the data rate corresponding to the supplied TXVECTOR.
Definition: vht-phy.cc:434
uint8_t GetNumberBccEncoders(const WifiTxVector &txVector) const override
Definition: vht-phy.cc:192
Time GetTrainingDuration(const WifiTxVector &txVector, uint8_t nDataLtf, uint8_t nExtensionLtf=0) const override
Definition: vht-phy.cc:171
virtual WifiMode GetSigAMode(void) const
Definition: vht-phy.cc:132
static WifiMode GetVhtMcs0(void)
Return MCS 0 from VHT MCS values.
virtual Time GetSigBDuration(const WifiTxVector &txVector) const
Definition: vht-phy.cc:186
static uint64_t GetPhyRateFromTxVector(const WifiTxVector &txVector, uint16_t staId)
Return the PHY rate corresponding to the supplied TXVECTOR.
Definition: vht-phy.cc:425
static WifiMode GetVhtMcs(uint8_t index)
Return the VHT MCS corresponding to the provided index.
Definition: vht-phy.cc:328
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:477
virtual PhyFieldRxStatus ProcessSigB(Ptr< Event > event, PhyFieldRxStatus status)
Process SIG-B, perform amendment-specific actions, and provide an updated status of the reception.
Definition: vht-phy.cc:301
Ptr< WifiPpdu > BuildPpdu(const WifiConstPsduMap &psdus, const WifiTxVector &txVector, Time ppduDuration) override
Build amendment-specific PPDU.
Definition: vht-phy.cc:218
static uint64_t GetPhyRate(uint8_t mcsValue, uint16_t channelWidth, uint16_t guardInterval, uint8_t nss)
Return the PHY rate corresponding to the supplied VHT MCS index, channel width, guard interval,...
Definition: vht-phy.cc:417
uint32_t GetMaxPsduSize(void) const override
Get the maximum PSDU size in bytes.
Definition: vht-phy.cc:521
WifiMode GetHtSigMode(void) const override
Definition: vht-phy.cc:124
Time GetLSigDuration(WifiPreamble preamble) const override
Definition: vht-phy.cc:159
PhyFieldRxStatus EndReceiveSigA(Ptr< Event > event)
End receiving the SIG-A, perform VHT-specific actions, and provide the status of the reception.
Definition: vht-phy.cc:241
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:226
static void InitializeModes(void)
Initialize all VHT modes.
Definition: vht-phy.cc:319
virtual PhyFieldRxStatus ProcessSigA(Ptr< Event > event, PhyFieldRxStatus status)
Process SIG-A, perform amendment-specific actions, and provide an updated status of the reception.
Definition: vht-phy.cc:267
static uint64_t GetDataRate(uint8_t mcsValue, uint16_t channelWidth, uint16_t guardInterval, uint8_t nss)
Return the data rate corresponding to the supplied VHT MCS index, channel width, guard interval,...
Definition: vht-phy.cc:443
static WifiMode CreateVhtMcs(uint8_t index)
Return the VHT MCS corresponding to the provided index.
Definition: vht-phy.cc:374
virtual ~VhtPhy()
Destructor for VHT PHY.
Definition: vht-phy.cc:84
static uint16_t GetConstellationSize(uint8_t mcsValue)
Return the constellation size corresponding to the supplied VHT MCS index.
Definition: vht-phy.cc:404
PhyFieldRxStatus EndReceiveSigB(Ptr< Event > event)
End receiving the SIG-B, perform VHT-specific actions, and provide the status of the reception.
Definition: vht-phy.cc:275
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:469
virtual Time GetSigADuration(WifiPreamble preamble) const
Definition: vht-phy.cc:180
VhtPhy(bool buildModeList=true)
Constructor for VHT PHY.
Definition: vht-phy.cc:71
virtual WifiMode GetSigBMode(const WifiTxVector &txVector) const
Definition: vht-phy.cc:138
const PpduFormats & GetPpduFormats(void) const override
Return the PPDU formats of the PHY.
Definition: vht-phy.cc:103
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:109
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:48
uint8_t GetMcsValue(void) const
Definition: wifi-mode.cc:155
uint64_t GetDataRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
Definition: wifi-mode.cc:114
WifiPhyBand GetPhyBand(void) const
Get the configured Wi-Fi band.
Definition: wifi-phy.cc:870
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:635
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(void) 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.
uint16_t GetChannelWidth(void) const
uint16_t GetGuardInterval(void) const
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition: assert.h:67
#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:88
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:165
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
Definition: abort.h:50
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Definition: abort.h:108
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:273
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:289
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Callback< R > MakeBoundCallback(R(*fnPtr)(TX), ARG a1)
Make Callbacks with one bound argument.
Definition: callback.h:1709
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1260
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
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_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:38
static 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.
double RatioToDb(double ratio)
Convert from ratio to dB.
Definition: wifi-utils.cc:49
const uint16_t WIFI_CODE_RATE_3_4
3/4 coding rate
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
uint16_t WifiCodeRate
These constants define the various convolutional coding rates used for the OFDM transmission modes in...
const uint16_t WIFI_CODE_RATE_5_6
5/6 coding rate
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Definition: callback.h:1648
Status of the reception of the PPDU field.
Definition: phy-entity.h:111
WifiPhyRxfailureReason reason
failure reason
Definition: phy-entity.h:114
PhyRxFailureAction actionIfFailure
action to perform in case of failure
Definition: phy-entity.h:115
bool isSuccess
outcome (true if success) of the reception
Definition: phy-entity.h:113
A struct for both SNR and PER.
Definition: phy-entity.h:137
double snr
SNR in linear scale.
Definition: phy-entity.h:138
#define CASE(x)
#define GET_VHT_MCS(x)
Definition: vht-phy.cc:353
Declaration of ns3::VhtPhy class.
#define VHT_PHY
This defines the BSS membership value for VHT PHY.
Definition: vht-phy.h:38
Declaration of ns3::VhtPpdu class.