|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
26 #include "ns3/wifi-psdu.h"
27 #include "ns3/wifi-phy.h"
29 #include "ns3/assert.h"
54 { 6000000, 9000000, 12000000, 18000000,
55 24000000, 36000000, 48000000, 54000000};
144 NS_ABORT_MSG (
"Inexistent rate (" << rate <<
" bps) requested for ERP-OFDM");
149 #define GET_ERP_OFDM_MODE(x, f) \
151 ErpOfdmPhy::Get ## x (void) \
153 static WifiMode mode = CreateErpOfdmMode (#x, f); \
165 #undef GET_ERP_OFDM_MODE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Declaration of ns3::ErpOfdmPpdu class.
@ WIFI_MOD_CLASS_ERP_OFDM
ERP-OFDM (18.4)
static uint16_t GetConstellationSize(const std::string &name)
Return the constellation size from the ERP-OFDM mode's unique name using ModulationLookupTable.
Time GetPreambleDuration(const WifiTxVector &txVector) const override
std::list< WifiMode > m_modeList
the list of supported modes
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static uint64_t CalculatePhyRate(WifiCodeRate codeRate, uint64_t dataRate)
Calculate the PHY rate in bps from code rate and data rate.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
static WifiMode GetErpOfdmRate36Mbps(void)
Return a WifiMode for ERP-OFDM at 36 Mbps.
Time GetHeaderDuration(const WifiTxVector &txVector) const override
WifiModulationClass GetModulationClass() const
Constructor class for ERP-OFDM modes.
static WifiMode GetErpOfdmRate48Mbps(void)
Return a WifiMode for ERP-OFDM at 48 Mbps.
static WifiMode GetErpOfdmRate24Mbps(void)
Return a WifiMode for ERP-OFDM at 24 Mbps.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
static void AddStaticPhyEntity(WifiModulationClass modulation, Ptr< PhyEntity > phyEntity)
Add the PHY entity to the map of implemented PHY entities for the given modulation class.
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.
static const std::array< uint64_t, 8 > s_erpOfdmRatesBpsList
ERP OFDM rates in bits per second.
static WifiCodeRate GetCodeRate(const std::string &name)
Return the WifiCodeRate from the ERP-OFDM mode's unique name using ModulationLookupTable.
Smart pointer class similar to boost::intrusive_ptr.
uint16_t WifiCodeRate
These constants define the various convolutional coding rates used for the OFDM transmission modes in...
ErpOfdmPhy()
Constructor for ERP-OFDM PHY.
represent a single transmission mode
static WifiMode GetErpOfdmRate(uint64_t rate)
Return a WifiMode for ERP-OFDM corresponding to the provided rate.
static WifiMode CreateWifiMode(std::string uniqueName, WifiModulationClass modClass, bool isMandatory, CodeRateCallback codeRateCallback, ConstellationSizeCallback constellationSizeCallback, PhyRateCallback phyRateCallback, PhyRateFromTxVectorCallback phyRateFromTxVectorCallback, DataRateCallback dataRateCallback, DataRateFromTxVectorCallback dataRateFromTxVectorCallback, ModeAllowedCallback isModeAllowedCallback)
virtual ~ErpOfdmPhy()
Destructor for ERP-OFDM PHY.
static void InitializeModes(void)
Initialize all ERP-OFDM modes.
Ptr< WifiPhy > m_wifiPhy
Pointer to the owning WifiPhy.
const uint16_t WIFI_CODE_RATE_2_3
2/3 coding rate
WifiMode GetHeaderMode(const WifiTxVector &txVector) const override
std::string GetUniqueName(void) const
WifiPhyBand GetPhyBand(void) const
Get the configured Wi-Fi band.
Simulation virtual time values and global simulation resolution.
static WifiMode GetErpOfdmRate54Mbps(void)
Return a WifiMode for ERP-OFDM at 54 Mbps.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
uint16_t GetChannelWidth(void) const
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...
static WifiMode GetErpOfdmRate6Mbps(void)
Return a WifiMode for ERP-OFDM at 6 Mbps.
static WifiMode GetErpOfdmRate9Mbps(void)
Return a WifiMode for ERP-OFDM at 9 Mbps.
PHY entity for OFDM (11a)
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...
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
const uint16_t WIFI_CODE_RATE_1_2
1/2 coding rate
Ptr< WifiPpdu > BuildPpdu(const WifiConstPsduMap &psdus, const WifiTxVector &txVector, Time ppduDuration) override
Build amendment-specific PPDU.
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.
static uint64_t GetPhyRateFromTxVector(const WifiTxVector &txVector, uint16_t staId)
Return the PHY rate corresponding to the supplied TXVECTOR.
uint16_t GetGuardInterval(void) const
static uint64_t CalculateDataRate(WifiCodeRate codeRate, uint16_t constellationSize, uint16_t channelWidth, uint16_t guardInterval, uint8_t nss)
Calculates data rate from the supplied parameters.
static uint64_t GetDataRateFromTxVector(const WifiTxVector &txVector, uint16_t staId)
Return the data rate corresponding to the supplied TXVECTOR.
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.
uint32_t GetMaxPsduSize(void) const override
Get the maximum PSDU size in bytes.
#define GET_ERP_OFDM_MODE(x, f)
Callback< R > MakeBoundCallback(R(*fnPtr)(TX), ARG a1)
Make Callbacks with one bound argument.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
std::map< std::string, CodeRateConstellationSizePair > ModulationLookupTable
A modulation lookup table using unique name of modulation as key.
static bool IsModeAllowed(uint16_t channelWidth, uint8_t nss)
Check whether the combination of <WifiMode, channel width, NSS> is allowed.
static class anonymous_namespace{erp-ofdm-phy.cc}::ConstructorErpOfdm g_constructor_erp_ofdm
the constructor for ERP-OFDM modes
const uint16_t WIFI_CODE_RATE_3_4
3/4 coding rate
const std::array< uint64_t, 8 > & GetErpOfdmRatesBpsList(void)
Get the array of possible ERP OFDM rates.
static WifiMode GetErpOfdmRate18Mbps(void)
Return a WifiMode for ERP-OFDM at 18 Mbps.
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.
static WifiMode GetErpOfdmRate12Mbps(void)
Return a WifiMode for ERP-OFDM at 12 Mbps.
virtual uint64_t ObtainNextUid(const WifiTxVector &txVector)
Obtain the next UID for the PPDU to transmit.
Declaration of ns3::ErpOfdmPhy class.
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
static const ModulationLookupTable m_erpOfdmModulationLookupTable
lookup table to retrieve code rate and constellation size corresponding to a unique name of modulatio...