26 #include "ns3/phy-entity.h" 80 bool incFlag, uint32_t &totalAmpduSize,
double &totalAmpduNumSymbols,
81 uint16_t staId)
const override;
273 static uint64_t
GetPhyRate (
const std::string& name, uint16_t channelWidth, uint16_t guardInterval, uint8_t nss);
309 static uint64_t
GetDataRate (
const std::string& name, uint16_t channelWidth, uint16_t guardInterval, uint8_t nss);
319 static bool IsModeAllowed (uint16_t channelWidth, uint8_t nss);
408 uint16_t guardInterval, uint8_t nss);
420 static uint64_t
CalculateDataRate (
double symbolDuration, uint16_t guardInterval,
421 uint16_t usableSubCarriers, uint16_t numberOfBitsPerSubcarrier,
Simulation virtual time values and global simulation resolution.
static WifiMode GetOfdmRate24MbpsBW10MHz(void)
Return a WifiMode for OFDM at 24 Mbps with 10 MHz channel spacing.
Smart pointer class similar to boost::intrusive_ptr.
static double GetCodeRatio(WifiCodeRate codeRate)
Convert WifiCodeRate to a ratio, e.g., code ratio of WIFI_CODE_RATE_1_2 is 0.5.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
PhyFieldRxStatus EndReceiveHeader(Ptr< Event > event)
End receiving the header, perform OFDM-specific actions, and provide the status of the reception...
static bool IsModeAllowed(uint16_t channelWidth, uint8_t nss)
Check whether the combination of <WifiMode, channel width, NSS> is allowed.
static const PpduFormats m_ofdmPpduFormats
OFDM PPDU formats.
static WifiMode GetOfdmRate1_5MbpsBW5MHz(void)
Return a WifiMode for OFDM at 1.5 Mbps with 5 MHz channel spacing.
uint8_t GetNumberServiceBits(void) const
static WifiMode CreateOfdmMode(std::string uniqueName, bool isMandatory)
Create an OFDM mode from a unique name, the unique name must already be contained inside ModulationLo...
static WifiMode GetOfdmRate36Mbps(void)
Return a WifiMode for OFDM at 36 Mbps.
static WifiMode GetOfdmRate18MbpsBW10MHz(void)
Return a WifiMode for OFDM at 18 Mbps with 10 MHz channel spacing.
static WifiMode GetOfdmRate48Mbps(void)
Return a WifiMode for OFDM at 48 Mbps.
static WifiMode GetOfdmRate3MbpsBW10MHz(void)
Return a WifiMode for OFDM at 3 Mbps with 10 MHz channel spacing.
static WifiMode GetOfdmRate(uint64_t rate, uint16_t bw=20)
Return a WifiMode for OFDM corresponding to the provided rate and the channel bandwidth (20...
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
virtual Time GetHeaderDuration(const WifiTxVector &txVector) const
std::map< std::string, CodeRateConstellationSizePair > ModulationLookupTable
A modulation lookup table using unique name of modulation as key.
static uint64_t CalculatePhyRate(WifiCodeRate codeRate, uint64_t dataRate)
Calculate the PHY rate in bps from code rate and data rate.
static WifiMode GetOfdmRate6MbpsBW5MHz(void)
Return a WifiMode for OFDM at 6 Mbps with 5 MHz channel spacing.
static WifiMode GetOfdmRate9MbpsBW5MHz(void)
Return a WifiMode for OFDM at 9 Mbps with 5 MHz channel spacing.
MpduType
The type of an MPDU.
static WifiMode GetOfdmRate3MbpsBW5MHz(void)
Return a WifiMode for OFDM at 3 Mbps with 5 MHz channel spacing.
virtual bool IsChannelWidthSupported(Ptr< const WifiPpdu > ppdu) const
Checks if the PPDU's bandwidth is supported by the PHY.
static uint64_t GetPhyRateFromTxVector(const WifiTxVector &txVector, uint16_t staId)
Return the PHY rate corresponding to the supplied TXVECTOR.
WifiMode GetSigMode(WifiPpduField field, const WifiTxVector &txVector) const override
Get the WifiMode for the SIG field specified by the PPDU field.
Status of the reception of the PPDU field.
static WifiMode GetOfdmRate4_5MbpsBW10MHz(void)
Return a WifiMode for OFDM at 4.5 Mbps with 10 MHz channel spacing.
static WifiCodeRate GetCodeRate(const std::string &name)
Return the WifiCodeRate from the OFDM mode's unique name using ModulationLookupTable.
static void InitializeModes(void)
Initialize all OFDM modes (for all variants).
Time GetPayloadDuration(uint32_t size, const WifiTxVector &txVector, WifiPhyBand band, MpduType mpdutype, bool incFlag, uint32_t &totalAmpduSize, double &totalAmpduNumSymbols, uint16_t staId) const override
virtual bool IsAllConfigSupported(WifiPpduField field, Ptr< const WifiPpdu > ppdu) const
Checks if the signaled configuration (including bandwidth) is supported by the PHY.
PhyFieldRxStatus DoEndReceiveField(WifiPpduField field, Ptr< Event > event) override
End receiving a given field, perform amendment-specific actions, and provide the status of the recept...
OfdmPhyVariant
The OFDM (11a) PHY variants.
WifiPpduField
The type of PPDU field (grouped for convenience)
OfdmPhy(OfdmPhyVariant variant=OFDM_PHY_DEFAULT, bool buildModeList=true)
Constructor for OFDM PHY.
Time GetSignalExtension(WifiPhyBand band) const
Ptr< SpectrumValue > GetTxPowerSpectralDensity(double txPowerW, Ptr< const WifiPpdu > ppdu) const override
static WifiMode GetOfdmRate54Mbps(void)
Return a WifiMode for OFDM at 54 Mbps.
Abstract class for PHY entitiesThis class enables to have a unique set of APIs to be used by each PHY...
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.
uint16_t WifiCodeRate
These constants define the various convolutional coding rates used for the OFDM transmission modes in...
static WifiMode GetOfdmRate9Mbps(void)
Return a WifiMode for OFDM at 9 Mbps.
uint32_t GetMaxPsduSize(void) const override
Get the maximum PSDU size in bytes.
static const ModulationLookupTable m_ofdmModulationLookupTable
lookup table to retrieve code rate and constellation size corresponding to a unique name of modulatio...
static WifiMode GetOfdmRate9MbpsBW10MHz(void)
Return a WifiMode for OFDM at 9 Mbps with 10 MHz channel spacing.
static WifiMode GetOfdmRate12MbpsBW10MHz(void)
Return a WifiMode for OFDM at 12 Mbps with 10 MHz channel spacing.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
const PpduFormats & GetPpduFormats(void) const override
Return the PPDU formats of the PHY.
static WifiMode GetOfdmRate2_25MbpsBW5MHz(void)
Return a WifiMode for OFDM at 2.25 Mbps with 5 MHz channel spacing.
static uint64_t GetPhyRate(const std::string &name, uint16_t channelWidth, uint16_t guardInterval, uint8_t nss)
Return the PHY rate from the OFDM mode's unique name and the supplied parameters. ...
static uint64_t GetDataRateFromTxVector(const WifiTxVector &txVector, uint16_t staId)
Return the data rate corresponding to the supplied TXVECTOR.
PHY entity for OFDM (11a)This class is also used for the 10 MHz and 5 MHz bandwidth variants addressi...
static uint16_t GetConstellationSize(const std::string &name)
Return the constellation size from the OFDM mode's unique name using ModulationLookupTable.
static WifiMode GetOfdmRate6MbpsBW10MHz(void)
Return a WifiMode for OFDM at 6 Mbps with 10 MHz channel spacing.
WifiPhyBand
Identifies the PHY band.
Ptr< WifiPpdu > BuildPpdu(const WifiConstPsduMap &psdus, const WifiTxVector &txVector, Time ppduDuration) override
Build amendment-specific PPDU.
static WifiMode GetOfdmRate4_5MbpsBW5MHz(void)
Return a WifiMode for OFDM at 4.5 Mbps with 5 MHz channel spacing.
static WifiMode GetOfdmRate27MbpsBW10MHz(void)
Return a WifiMode for OFDM at 27 Mbps with 10 MHz channel spacing.
static uint64_t GetDataRate(const std::string &name, uint16_t channelWidth, uint16_t guardInterval, uint8_t nss)
Return the data rate from the OFDM mode's unique name and the supplied parameters.
static WifiMode GetOfdmRate6Mbps(void)
Return a WifiMode for OFDM at 6 Mbps.
std::map< WifiPreamble, std::vector< WifiPpduField > > PpduFormats
A map of PPDU field elements per preamble type.
static WifiMode GetOfdmRate13_5MbpsBW5MHz(void)
Return a WifiMode for OFDM at 13.5 Mbps with 5 MHz channel spacing.
static WifiMode GetOfdmRate24Mbps(void)
Return a WifiMode for OFDM at 24 Mbps.
virtual WifiMode GetHeaderMode(const WifiTxVector &txVector) const
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...
virtual ~OfdmPhy()
Destructor for OFDM PHY.
static WifiMode GetOfdmRate12MbpsBW5MHz(void)
Return a WifiMode for OFDM at 12 Mbps with 5 MHz channel spacing.
static WifiMode GetOfdmRate12Mbps(void)
Return a WifiMode for OFDM at 12Mbps.
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
virtual Time GetPreambleDuration(const WifiTxVector &txVector) const
static WifiMode GetOfdmRate18Mbps(void)
Return a WifiMode for OFDM at 18 Mbps.