A Discrete-Event Network Simulator
API
erp-ofdm-phy.h
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  * Mathieu Lacage <mathieu.lacage@sophia.inria.fr> (for logic ported from wifi-phy)
21  */
22 
23 #ifndef ERP_OFDM_PHY_H
24 #define ERP_OFDM_PHY_H
25 
26 #include "ofdm-phy.h"
27 
34 namespace ns3 {
35 
45 class ErpOfdmPhy : public OfdmPhy
46 {
47 public:
51  ErpOfdmPhy ();
55  virtual ~ErpOfdmPhy ();
56 
57  Ptr<WifiPpdu> BuildPpdu (const WifiConstPsduMap & psdus, const WifiTxVector& txVector, Time ppduDuration) override;
58  uint32_t GetMaxPsduSize (void) const override;
59 
63  static void InitializeModes (void);
71  static WifiMode GetErpOfdmRate (uint64_t rate);
72 
121 
130  static WifiCodeRate GetCodeRate (const std::string& name);
139  static uint16_t GetConstellationSize (const std::string& name);
152  static uint64_t GetPhyRate (const std::string& name, uint16_t channelWidth, uint16_t guardInterval, uint8_t nss);
163  static uint64_t GetPhyRateFromTxVector (const WifiTxVector& txVector, uint16_t staId);
174  static uint64_t GetDataRateFromTxVector (const WifiTxVector& txVector, uint16_t staId);
187  static uint64_t GetDataRate (const std::string& name, uint16_t channelWidth, uint16_t guardInterval, uint8_t nss);
197  static bool IsModeAllowed (uint16_t channelWidth, uint8_t nss);
198 
199 private:
200  WifiMode GetHeaderMode (const WifiTxVector& txVector) const override;
201  Time GetPreambleDuration (const WifiTxVector& txVector) const override;
202  Time GetHeaderDuration (const WifiTxVector& txVector) const override;
203 
213  static WifiMode CreateErpOfdmMode (std::string uniqueName, bool isMandatory);
214 
216 }; //class ErpOfdmPhy
217 
218 } //namespace ns3
219 
220 #endif /* ERP_OFDM_PHY_H */
ns3::ErpOfdmPhy
PHY entity for ERP-OFDM (11g)
Definition: erp-ofdm-phy.h:46
ns3::ErpOfdmPhy::GetConstellationSize
static uint16_t GetConstellationSize(const std::string &name)
Return the constellation size from the ERP-OFDM mode's unique name using ModulationLookupTable.
Definition: erp-ofdm-phy.cc:193
ns3::ErpOfdmPhy::GetPreambleDuration
Time GetPreambleDuration(const WifiTxVector &txVector) const override
Definition: erp-ofdm-phy.cc:94
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::ErpOfdmPhy::GetErpOfdmRate36Mbps
static WifiMode GetErpOfdmRate36Mbps(void)
Return a WifiMode for ERP-OFDM at 36 Mbps.
ns3::ErpOfdmPhy::GetHeaderDuration
Time GetHeaderDuration(const WifiTxVector &txVector) const override
Definition: erp-ofdm-phy.cc:100
ns3::ErpOfdmPhy::GetErpOfdmRate48Mbps
static WifiMode GetErpOfdmRate48Mbps(void)
Return a WifiMode for ERP-OFDM at 48 Mbps.
ns3::ErpOfdmPhy::GetErpOfdmRate24Mbps
static WifiMode GetErpOfdmRate24Mbps(void)
Return a WifiMode for ERP-OFDM at 24 Mbps.
ns3::WifiTxVector
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Definition: wifi-tx-vector.h:71
ns3::WifiConstPsduMap
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
Definition: he-frame-exchange-manager.h:43
ns3::ErpOfdmPhy::GetPhyRate
static uint64_t GetPhyRate(const std::string &name, uint16_t channelWidth, uint16_t guardInterval, uint8_t nss)
Return the PHY rate from the ERP-OFDM mode's unique name and the supplied parameters.
Definition: erp-ofdm-phy.cc:199
ns3::ErpOfdmPhy::GetCodeRate
static WifiCodeRate GetCodeRate(const std::string &name)
Return the WifiCodeRate from the ERP-OFDM mode's unique name using ModulationLookupTable.
Definition: erp-ofdm-phy.cc:187
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
ns3::WifiCodeRate
uint16_t WifiCodeRate
These constants define the various convolutional coding rates used for the OFDM transmission modes in...
Definition: wifi-phy-common.h:45
ns3::ErpOfdmPhy::ErpOfdmPhy
ErpOfdmPhy()
Constructor for ERP-OFDM PHY.
Definition: erp-ofdm-phy.cc:69
ns3::WifiMode
represent a single transmission mode
Definition: wifi-mode.h:48
ns3::ErpOfdmPhy::GetErpOfdmRate
static WifiMode GetErpOfdmRate(uint64_t rate)
Return a WifiMode for ERP-OFDM corresponding to the provided rate.
Definition: erp-ofdm-phy.cc:123
ns3::ErpOfdmPhy::~ErpOfdmPhy
virtual ~ErpOfdmPhy()
Destructor for ERP-OFDM PHY.
Definition: erp-ofdm-phy.cc:81
ns3::ErpOfdmPhy::InitializeModes
static void InitializeModes(void)
Initialize all ERP-OFDM modes.
Definition: erp-ofdm-phy.cc:114
ns3::ErpOfdmPhy::GetHeaderMode
WifiMode GetHeaderMode(const WifiTxVector &txVector) const override
Definition: erp-ofdm-phy.cc:87
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
ns3::ErpOfdmPhy::GetErpOfdmRate54Mbps
static WifiMode GetErpOfdmRate54Mbps(void)
Return a WifiMode for ERP-OFDM at 54 Mbps.
ofdm-phy.h
Declaration of ns3::OfdmPhy class and ns3::OfdmPhyVariant enum.
ns3::ErpOfdmPhy::CreateErpOfdmMode
static WifiMode CreateErpOfdmMode(std::string uniqueName, bool isMandatory)
Create an ERP-OFDM mode from a unique name, the unique name must already be contained inside Modulati...
Definition: erp-ofdm-phy.cc:168
ns3::ErpOfdmPhy::GetErpOfdmRate6Mbps
static WifiMode GetErpOfdmRate6Mbps(void)
Return a WifiMode for ERP-OFDM at 6 Mbps.
ns3::ErpOfdmPhy::GetErpOfdmRate9Mbps
static WifiMode GetErpOfdmRate9Mbps(void)
Return a WifiMode for ERP-OFDM at 9 Mbps.
ns3::OfdmPhy
PHY entity for OFDM (11a)
Definition: ofdm-phy.h:61
ns3::ErpOfdmPhy::BuildPpdu
Ptr< WifiPpdu > BuildPpdu(const WifiConstPsduMap &psdus, const WifiTxVector &txVector, Time ppduDuration) override
Build amendment-specific PPDU.
Definition: erp-ofdm-phy.cc:106
ns3::ErpOfdmPhy::GetDataRate
static uint64_t GetDataRate(const std::string &name, uint16_t channelWidth, uint16_t guardInterval, uint8_t nss)
Return the data rate from the ERP-OFDM mode's unique name and the supplied parameters.
Definition: erp-ofdm-phy.cc:226
ns3::ErpOfdmPhy::GetPhyRateFromTxVector
static uint64_t GetPhyRateFromTxVector(const WifiTxVector &txVector, uint16_t staId)
Return the PHY rate corresponding to the supplied TXVECTOR.
Definition: erp-ofdm-phy.cc:208
ns3::ErpOfdmPhy::GetDataRateFromTxVector
static uint64_t GetDataRateFromTxVector(const WifiTxVector &txVector, uint16_t staId)
Return the data rate corresponding to the supplied TXVECTOR.
Definition: erp-ofdm-phy.cc:217
ns3::ErpOfdmPhy::GetMaxPsduSize
uint32_t GetMaxPsduSize(void) const override
Get the maximum PSDU size in bytes.
Definition: erp-ofdm-phy.cc:240
ns3::PhyEntity::ModulationLookupTable
std::map< std::string, CodeRateConstellationSizePair > ModulationLookupTable
A modulation lookup table using unique name of modulation as key.
Definition: phy-entity.h:487
ns3::ErpOfdmPhy::IsModeAllowed
static bool IsModeAllowed(uint16_t channelWidth, uint8_t nss)
Check whether the combination of <WifiMode, channel width, NSS> is allowed.
Definition: erp-ofdm-phy.cc:234
ns3::ErpOfdmPhy::GetErpOfdmRate18Mbps
static WifiMode GetErpOfdmRate18Mbps(void)
Return a WifiMode for ERP-OFDM at 18 Mbps.
ns3::ErpOfdmPhy::GetErpOfdmRate12Mbps
static WifiMode GetErpOfdmRate12Mbps(void)
Return a WifiMode for ERP-OFDM at 12 Mbps.
ns3::ErpOfdmPhy::m_erpOfdmModulationLookupTable
static const ModulationLookupTable m_erpOfdmModulationLookupTable
lookup table to retrieve code rate and constellation size corresponding to a unique name of modulatio...
Definition: erp-ofdm-phy.h:215