A Discrete-Event Network Simulator
API
eht-phy.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021 DERONNE SOFTWARE ENGINEERING
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Sébastien Deronne <sebastien.deronne@gmail.com>
18  */
19 
20 #ifndef EHT_PHY_H
21 #define EHT_PHY_H
22 
23 #include "ns3/he-phy.h"
24 
31 namespace ns3
32 {
33 
37 #define EHT_PHY 121 // FIXME: not defined yet as of 802.11be D1.5
38 
47 class EhtPhy : public HePhy
48 {
49  public:
56  EhtPhy(bool buildModeList = true);
60  ~EhtPhy() override;
61 
62  const PpduFormats& GetPpduFormats() const override;
63  Time GetDuration(WifiPpduField field, const WifiTxVector& txVector) const override;
65  const WifiTxVector& txVector,
66  Time ppduDuration) override;
67  WifiMode GetSigBMode(const WifiTxVector& txVector) const override;
68 
72  static void InitializeModes();
73 
81  static WifiMode GetEhtMcs(uint8_t index);
82 
88  static WifiMode GetEhtMcs0();
94  static WifiMode GetEhtMcs1();
167 
176  static WifiCodeRate GetCodeRate(uint8_t mcsValue);
177 
186  static uint16_t GetConstellationSize(uint8_t mcsValue);
187 
201  static uint64_t GetPhyRate(uint8_t mcsValue,
202  uint16_t channelWidth,
203  uint16_t guardInterval,
204  uint8_t nss);
205 
214  static uint64_t GetPhyRateFromTxVector(const WifiTxVector& txVector,
215  uint16_t staId = SU_STA_ID);
216 
225  static uint64_t GetDataRateFromTxVector(const WifiTxVector& txVector,
226  uint16_t staId = SU_STA_ID);
227 
240  static uint64_t GetDataRate(uint8_t mcsValue,
241  uint16_t channelWidth,
242  uint16_t guardInterval,
243  uint8_t nss);
244 
253  static uint64_t GetNonHtReferenceRate(uint8_t mcsValue);
254 
255  protected:
256  void BuildModeList() override;
257  WifiMode GetSigMode(WifiPpduField field, const WifiTxVector& txVector) const override;
260  PhyFieldRxStatus status,
261  WifiPpduField field) override;
263  Time CalculateNonOfdmaDurationForHeTb(const WifiTxVector& txVector) const override;
264  Time CalculateNonOfdmaDurationForHeMu(const WifiTxVector& txVector) const override;
265 
274  static WifiMode CreateEhtMcs(uint8_t index);
275 
289  static uint64_t CalculateNonHtReferenceRate(WifiCodeRate codeRate, uint16_t constellationSize);
290 
292 }; // class EhtPhy
293 
294 } // namespace ns3
295 
296 #endif /* EHT_PHY_H */
PHY entity for EHT (11be)
Definition: eht-phy.h:48
static WifiMode GetEhtMcs6()
Return MCS 6 from EHT MCS values.
static WifiMode GetEhtMcs5()
Return MCS 5 from EHT MCS values.
static const PpduFormats m_ehtPpduFormats
EHT PPDU formats.
Definition: eht-phy.h:291
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:379
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:187
static WifiCodeRate GetCodeRate(uint8_t mcsValue)
Return the coding rate corresponding to the supplied EHT MCS index.
Definition: eht-phy.cc:295
static WifiMode GetEhtMcs3()
Return MCS 3 from EHT MCS values.
Time CalculateNonOfdmaDurationForHeMu(const WifiTxVector &txVector) const override
Definition: eht-phy.cc:142
static WifiMode GetEhtMcs8()
Return MCS 8 from EHT MCS values.
static WifiMode GetEhtMcs1()
Return MCS 1 from EHT MCS values.
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:88
Time CalculateNonOfdmaDurationForHeTb(const WifiTxVector &txVector) const override
Definition: eht-phy.cc:133
static WifiMode GetEhtMcs2()
Return MCS 2 from EHT MCS values.
static WifiMode GetEhtMcs7()
Return MCS 7 from EHT MCS values.
static WifiMode GetEhtMcs0()
Return MCS 0 from EHT MCS values.
static WifiMode GetEhtMcs12()
Return MCS 12 from EHT MCS values.
static uint16_t GetConstellationSize(uint8_t mcsValue)
Return the constellation size corresponding to the supplied EHT MCS index.
Definition: eht-phy.cc:309
WifiPhyRxfailureReason GetFailureReason(WifiPpduField field) const override
Get the failure reason corresponding to the unsuccessful processing of a given PPDU field.
Definition: eht-phy.cc:203
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:331
static WifiMode GetEhtMcs(uint8_t index)
Return the EHT MCS corresponding to the provided index.
Definition: eht-phy.cc:226
void BuildModeList() override
Build mode list.
Definition: eht-phy.cc:75
static void InitializeModes()
Initialize all EHT modes.
Definition: eht-phy.cc:217
static WifiMode CreateEhtMcs(uint8_t index)
Create and return the EHT MCS corresponding to the provided index.
Definition: eht-phy.cc:279
const PpduFormats & GetPpduFormats() const override
Return the PPDU formats of the PHY.
Definition: eht-phy.cc:152
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:345
~EhtPhy() override
Destructor for EHT PHY.
Definition: eht-phy.cc:69
static WifiMode GetEhtMcs11()
Return MCS 11 from EHT MCS values.
EhtPhy(bool buildModeList=true)
Constructor for EHT PHY.
Definition: eht-phy.cc:56
Ptr< WifiPpdu > BuildPpdu(const WifiConstPsduMap &psdus, const WifiTxVector &txVector, Time ppduDuration) override
Build amendment-specific PPDU.
Definition: eht-phy.cc:158
static WifiMode GetEhtMcs10()
Return MCS 10 from EHT MCS values.
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:371
static WifiMode GetEhtMcs13()
Return MCS 13 from EHT MCS values.
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:115
static uint64_t GetDataRate(uint8_t mcsValue, uint16_t channelWidth, uint16_t guardInterval, uint8_t nss)
Return the data rate corresponding to the supplied EHT MCS index, channel width, guard interval,...
Definition: eht-phy.cc:359
static uint64_t GetPhyRate(uint8_t mcsValue, uint16_t channelWidth, uint16_t guardInterval, uint8_t nss)
Return the PHY rate corresponding to the supplied EHT MCS index, channel width, guard interval,...
Definition: eht-phy.cc:323
static WifiMode GetEhtMcs9()
Return MCS 9 from EHT MCS values.
WifiMode GetSigBMode(const WifiTxVector &txVector) const override
Definition: eht-phy.cc:102
static WifiMode GetEhtMcs4()
Return MCS 4 from EHT MCS values.
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:172
PHY entity for HE (11ax)
Definition: he-phy.h:68
std::map< WifiPreamble, std::vector< WifiPpduField > > PpduFormats
A map of PPDU field elements per preamble type.
Definition: phy-entity.h:556
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
represent a single transmission mode
Definition: wifi-mode.h:50
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
WifiPhyRxfailureReason
Enumeration of the possible reception failure reasons.
WifiPpduField
The type of PPDU field (grouped for convenience)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
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...
Status of the reception of the PPDU field.
Definition: phy-entity.h:113
#define SU_STA_ID
Definition: wifi-mode.h:34