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
31namespace ns3
32{
33
37#define EHT_PHY 121 // FIXME: not defined yet as of 802.11be D1.5
38
47class 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
71 static void InitializeModes();
72
80 static WifiMode GetEhtMcs(uint8_t index);
81
166
175 static WifiCodeRate GetCodeRate(uint8_t mcsValue);
176
185 static uint16_t GetConstellationSize(uint8_t mcsValue);
186
200 static uint64_t GetPhyRate(uint8_t mcsValue,
201 uint16_t channelWidth,
202 uint16_t guardInterval,
203 uint8_t nss);
204
213 static uint64_t GetPhyRateFromTxVector(const WifiTxVector& txVector,
214 uint16_t staId = SU_STA_ID);
215
224 static uint64_t GetDataRateFromTxVector(const WifiTxVector& txVector,
225 uint16_t staId = SU_STA_ID);
226
239 static uint64_t GetDataRate(uint8_t mcsValue,
240 uint16_t channelWidth,
241 uint16_t guardInterval,
242 uint8_t nss);
243
252 static uint64_t GetNonHtReferenceRate(uint8_t mcsValue);
253
254 protected:
255 void BuildModeList() override;
256 WifiMode GetSigMode(WifiPpduField field, const WifiTxVector& txVector) const override;
259 PhyFieldRxStatus status,
260 WifiPpduField field) override;
270 static WifiMode CreateEhtMcs(uint8_t index);
271
285 static uint64_t CalculateNonHtReferenceRate(WifiCodeRate codeRate, uint16_t constellationSize);
286
288}; // class EhtPhy
289
290} // namespace ns3
291
292#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:287
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:348
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:156
static WifiCodeRate GetCodeRate(uint8_t mcsValue)
Return the coding rate corresponding to the supplied EHT MCS index.
Definition: eht-phy.cc:264
static WifiMode GetEhtMcs3()
Return MCS 3 from EHT MCS values.
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
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:278
WifiPhyRxfailureReason GetFailureReason(WifiPpduField field) const override
Get the failure reason corresponding to the unsuccessful processing of a given PPDU field.
Definition: eht-phy.cc:172
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:300
static WifiMode GetEhtMcs(uint8_t index)
Return the EHT MCS corresponding to the provided index.
Definition: eht-phy.cc:195
void BuildModeList() override
Build mode list.
Definition: eht-phy.cc:75
static void InitializeModes()
Initialize all EHT modes.
Definition: eht-phy.cc:186
static WifiMode CreateEhtMcs(uint8_t index)
Create and return the EHT MCS corresponding to the provided index.
Definition: eht-phy.cc:248
const PpduFormats & GetPpduFormats() const override
Return the PPDU formats of the PHY.
Definition: eht-phy.cc:120
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:314
~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:126
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:340
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:102
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:328
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:292
static WifiMode GetEhtMcs9()
Return MCS 9 from EHT MCS values.
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:141
PHY entity for HE (11ax)
Definition: he-phy.h:64
std::map< WifiPreamble, std::vector< WifiPpduField > > PpduFormats
A map of PPDU field elements per preamble type.
Definition: phy-entity.h:524
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