A Discrete-Event Network Simulator
API
ns3::WifiPpdu Class Reference

WifiPpdu stores a preamble, a modulation class, PHY headers and a PSDU. More...

#include "wifi-ppdu.h"

+ Inheritance diagram for ns3::WifiPpdu:
+ Collaboration diagram for ns3::WifiPpdu:

Public Member Functions

 WifiPpdu (Ptr< const WifiPsdu > psdu, WifiTxVector txVector, Time ppduDuration, WifiPhyBand band)
 Create a SU PPDU storing a PSDU. More...
 
 WifiPpdu (const WifiConstPsduMap &psdus, WifiTxVector txVector, Time ppduDuration, WifiPhyBand band)
 Create a MU PPDU storing a vector of PSDUs. More...
 
virtual ~WifiPpdu ()
 
WifiModulationClass GetModulation (void) const
 Get the modulation used for the PPDU. More...
 
Ptr< const WifiPsduGetPsdu (uint8_t bssColor=64, uint16_t staId=SU_STA_ID) const
 Get the payload of the PPDU. More...
 
Time GetTxDuration () const
 Get the total transmission duration of the PPDU. More...
 
WifiTxVector GetTxVector (void) const
 Get the TXVECTOR used to send the PPDU. More...
 
bool IsMu (void) const
 Return true if the PPDU is a MU PPDU. More...
 
bool IsTruncatedTx (void) const
 Return true if the PPDU's transmission was aborted due to transmitter switch off. More...
 
void Print (std::ostream &os) const
 Print the PPDU contents. More...
 
void SetTruncatedTx (void)
 Indicate that the PPDU's transmission was aborted due to transmitter switch off. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< WifiPpdu >
 SimpleRefCount ()
 Default constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator. More...
 
void Ref (void) const
 Increment the reference count. More...
 
void Unref (void) const
 Decrement the reference count. More...
 

Private Member Functions

void SetPhyHeaders (WifiTxVector txVector, Time ppduDuration, WifiPhyBand band)
 Fill in the PHY headers. More...
 

Private Attributes

WifiPhyBand m_band
 the WifiPhyBand used to transmit that PPDU More...
 
uint16_t m_channelWidth
 the channel width used to transmit that PPDU in MHz More...
 
DsssSigHeader m_dsssSig
 the DSSS SIG PHY header More...
 
HeSigHeader m_heSig
 the HE-SIG PHY header More...
 
HtSigHeader m_htSig
 the HT-SIG PHY header More...
 
LSigHeader m_lSig
 the L-SIG PHY header More...
 
WifiModulationClass m_modulation
 the modulation used for the transmission of this PPDU More...
 
WifiTxVector::HeMuUserInfoMap m_muUserInfos
 the HE MU specific per-user information (to be removed once HE-SIG-B headers are implemented) More...
 
WifiPreamble m_preamble
 the PHY preamble More...
 
WifiConstPsduMap m_psdus
 the PSDUs contained in this PPDU More...
 
bool m_truncatedTx
 flag indicating whether the frame's transmission was aborted due to transmitter switch off More...
 
uint8_t m_txPowerLevel
 the transmission power level (used only for TX and initializing the returned WifiTxVector) More...
 
VhtSigHeader m_vhtSig
 the VHT-SIG PHY header More...
 

Detailed Description

WifiPpdu stores a preamble, a modulation class, PHY headers and a PSDU.

This class should be extended later on to handle MU PPDUs.

Definition at line 43 of file wifi-ppdu.h.

Constructor & Destructor Documentation

◆ WifiPpdu() [1/2]

ns3::WifiPpdu::WifiPpdu ( Ptr< const WifiPsdu psdu,
WifiTxVector  txVector,
Time  ppduDuration,
WifiPhyBand  band 
)

Create a SU PPDU storing a PSDU.

Parameters
psduthe PHY payload (PSDU)
txVectorthe TXVECTOR that was used for this PPDU
ppduDurationthe transmission duration of this PPDU
bandthe WifiPhyBand used for the transmission of this PPDU

Definition at line 32 of file wifi-ppdu.cc.

References m_psdus, NS_LOG_FUNCTION, SetPhyHeaders(), and SU_STA_ID.

+ Here is the call graph for this function:

◆ WifiPpdu() [2/2]

ns3::WifiPpdu::WifiPpdu ( const WifiConstPsduMap psdus,
WifiTxVector  txVector,
Time  ppduDuration,
WifiPhyBand  band 
)

Create a MU PPDU storing a vector of PSDUs.

Parameters
psdusthe PHY payloads (PSDUs)
txVectorthe TXVECTOR that was used for this PPDU
ppduDurationthe transmission duration of this PPDU
bandthe WifiPhyBand used for the transmission of this PPDU

Definition at line 45 of file wifi-ppdu.cc.

References ns3::WifiTxVector::GetHeMuUserInfoMap(), m_muUserInfos, m_preamble, NS_LOG_FUNCTION, SetPhyHeaders(), and ns3::WIFI_PREAMBLE_HE_MU.

+ Here is the call graph for this function:

◆ ~WifiPpdu()

ns3::WifiPpdu::~WifiPpdu ( )
virtual

Definition at line 62 of file wifi-ppdu.cc.

Member Function Documentation

◆ GetModulation()

WifiModulationClass ns3::WifiPpdu::GetModulation ( void  ) const

Get the modulation used for the PPDU.

Returns
the modulation used for the PPDU

Definition at line 476 of file wifi-ppdu.cc.

References m_modulation.

◆ GetPsdu()

Ptr< const WifiPsdu > ns3::WifiPpdu::GetPsdu ( uint8_t  bssColor = 64,
uint16_t  staId = SU_STA_ID 
) const

Get the payload of the PPDU.

Parameters
bssColorthe BSS color of the PHY calling this function.
staIdthe staId of the PHY calling this function.
Returns
the PSDU

Definition at line 373 of file wifi-ppdu.cc.

References ns3::HeSigHeader::GetBssColor(), IsMu(), m_heSig, m_psdus, NS_ASSERT, and SU_STA_ID.

+ Here is the call graph for this function:

◆ GetTxDuration()

◆ GetTxVector()

WifiTxVector ns3::WifiPpdu::GetTxVector ( void  ) const

Get the TXVECTOR used to send the PPDU.

Returns
the TXVECTOR of the PPDU.

Definition at line 172 of file wifi-ppdu.cc.

References ns3::HeSigHeader::GetBssColor(), ns3::HtSigHeader::GetChannelWidth(), ns3::VhtSigHeader::GetChannelWidth(), ns3::HeSigHeader::GetChannelWidth(), ns3::WifiPhy::GetDsssRate11Mbps(), ns3::WifiPhy::GetDsssRate1Mbps(), ns3::WifiPhy::GetDsssRate2Mbps(), ns3::WifiPhy::GetDsssRate5_5Mbps(), ns3::WifiPhy::GetErpOfdmRate12Mbps(), ns3::WifiPhy::GetErpOfdmRate18Mbps(), ns3::WifiPhy::GetErpOfdmRate24Mbps(), ns3::WifiPhy::GetErpOfdmRate36Mbps(), ns3::WifiPhy::GetErpOfdmRate48Mbps(), ns3::WifiPhy::GetErpOfdmRate54Mbps(), ns3::WifiPhy::GetErpOfdmRate6Mbps(), ns3::WifiPhy::GetErpOfdmRate9Mbps(), ns3::HeSigHeader::GetGuardInterval(), ns3::WifiPhy::GetHeMcs(), ns3::WifiPhy::GetHtMcs(), ns3::HtSigHeader::GetMcs(), ns3::HeSigHeader::GetMcs(), ns3::VhtSigHeader::GetNStreams(), ns3::HeSigHeader::GetNStreams(), ns3::WifiPhy::GetOfdmRate12Mbps(), ns3::WifiPhy::GetOfdmRate12MbpsBW10MHz(), ns3::WifiPhy::GetOfdmRate12MbpsBW5MHz(), ns3::WifiPhy::GetOfdmRate13_5MbpsBW5MHz(), ns3::WifiPhy::GetOfdmRate18Mbps(), ns3::WifiPhy::GetOfdmRate18MbpsBW10MHz(), ns3::WifiPhy::GetOfdmRate1_5MbpsBW5MHz(), ns3::WifiPhy::GetOfdmRate24Mbps(), ns3::WifiPhy::GetOfdmRate24MbpsBW10MHz(), ns3::WifiPhy::GetOfdmRate27MbpsBW10MHz(), ns3::WifiPhy::GetOfdmRate2_25MbpsBW5MHz(), ns3::WifiPhy::GetOfdmRate36Mbps(), ns3::WifiPhy::GetOfdmRate3MbpsBW10MHz(), ns3::WifiPhy::GetOfdmRate3MbpsBW5MHz(), ns3::WifiPhy::GetOfdmRate48Mbps(), ns3::WifiPhy::GetOfdmRate4_5MbpsBW10MHz(), ns3::WifiPhy::GetOfdmRate4_5MbpsBW5MHz(), ns3::WifiPhy::GetOfdmRate54Mbps(), ns3::WifiPhy::GetOfdmRate6Mbps(), ns3::WifiPhy::GetOfdmRate6MbpsBW10MHz(), ns3::WifiPhy::GetOfdmRate6MbpsBW5MHz(), ns3::WifiPhy::GetOfdmRate9Mbps(), ns3::WifiPhy::GetOfdmRate9MbpsBW10MHz(), ns3::WifiPhy::GetOfdmRate9MbpsBW5MHz(), ns3::DsssSigHeader::GetRate(), ns3::LSigHeader::GetRate(), ns3::HtSigHeader::GetShortGuardInterval(), ns3::VhtSigHeader::GetShortGuardInterval(), ns3::VhtSigHeader::GetSuMcs(), ns3::WifiPhy::GetVhtMcs(), ns3::VhtSigHeader::IsLdpcCoding(), ns3::HeSigHeader::IsLdpcCoding(), ns3::HtSigHeader::IsLdpcFecCoding(), m_channelWidth, m_dsssSig, m_heSig, m_htSig, m_lSig, m_modulation, m_muUserInfos, m_preamble, m_psdus, m_txPowerLevel, m_vhtSig, NS_ASSERT_MSG, NS_FATAL_ERROR, ns3::WifiTxVector::SetAggregation(), ns3::WifiTxVector::SetBssColor(), ns3::WifiTxVector::SetChannelWidth(), ns3::WifiTxVector::SetGuardInterval(), ns3::WifiTxVector::SetHeMuUserInfo(), ns3::WifiTxVector::SetLdpc(), ns3::WifiTxVector::SetMode(), ns3::WifiTxVector::SetNss(), ns3::WifiTxVector::SetPreambleType(), ns3::WifiTxVector::SetTxPowerLevel(), ns3::WIFI_MOD_CLASS_DSSS, ns3::WIFI_MOD_CLASS_ERP_OFDM, ns3::WIFI_MOD_CLASS_HE, ns3::WIFI_MOD_CLASS_HR_DSSS, ns3::WIFI_MOD_CLASS_HT, ns3::WIFI_MOD_CLASS_OFDM, and ns3::WIFI_MOD_CLASS_VHT.

Referenced by GetTxDuration().

+ Here is the caller graph for this function:

◆ IsMu()

bool ns3::WifiPpdu::IsMu ( void  ) const

Return true if the PPDU is a MU PPDU.

Returns
true if the PPDU is a MU PPDU

Definition at line 470 of file wifi-ppdu.cc.

References m_preamble, ns3::WIFI_PREAMBLE_HE_MU, ns3::WIFI_PREAMBLE_HE_TB, and ns3::WIFI_PREAMBLE_VHT_MU.

Referenced by GetPsdu(), and Print().

+ Here is the caller graph for this function:

◆ IsTruncatedTx()

bool ns3::WifiPpdu::IsTruncatedTx ( void  ) const

Return true if the PPDU's transmission was aborted due to transmitter switch off.

Returns
true if the PPDU's transmission was aborted due to transmitter switch off

Definition at line 395 of file wifi-ppdu.cc.

References m_truncatedTx.

◆ Print()

void ns3::WifiPpdu::Print ( std::ostream &  os) const

Print the PPDU contents.

Parameters
osoutput stream in which the data should be printed.

Definition at line 482 of file wifi-ppdu.cc.

References IsMu(), m_modulation, m_preamble, m_psdus, m_truncatedTx, and SU_STA_ID.

Referenced by ns3::operator<<().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetPhyHeaders()

void ns3::WifiPpdu::SetPhyHeaders ( WifiTxVector  txVector,
Time  ppduDuration,
WifiPhyBand  band 
)
private

Fill in the PHY headers.

Parameters
txVectorthe TXVECTOR that was used for this PPDU
ppduDurationthe transmission duration of this PPDU
bandthe WifiPhyBand used for the transmission of this PPDU

Definition at line 67 of file wifi-ppdu.cc.

References ns3::WifiPhy::CalculatePhyPreambleAndHeaderDuration(), ns3::WifiTxVector::GetBssColor(), ns3::WifiMode::GetDataRate(), ns3::WifiTxVector::GetGuardInterval(), ns3::WifiMode::GetMcsValue(), ns3::Time::GetMicroSeconds(), ns3::WifiTxVector::GetMode(), ns3::Time::GetNanoSeconds(), ns3::WifiTxVector::GetNss(), ns3::WifiTxVector::IsAggregation(), ns3::WifiTxVector::IsLdpc(), ns3::WifiTxVector::IsValid(), m_band, m_channelWidth, m_dsssSig, m_heSig, m_htSig, m_lSig, m_modulation, m_preamble, m_psdus, m_vhtSig, NS_ASSERT, NS_ASSERT_MSG, NS_FATAL_ERROR, NS_LOG_FUNCTION, ns3::HtSigHeader::SetAggregation(), ns3::HeSigHeader::SetBssColor(), ns3::HtSigHeader::SetChannelWidth(), ns3::VhtSigHeader::SetChannelWidth(), ns3::HeSigHeader::SetChannelWidth(), ns3::VhtSigHeader::SetCoding(), ns3::HeSigHeader::SetCoding(), ns3::HtSigHeader::SetFecCoding(), ns3::HeSigHeader::SetGuardIntervalAndLtfSize(), ns3::HtSigHeader::SetHtLength(), ns3::DsssSigHeader::SetLength(), ns3::LSigHeader::SetLength(), ns3::HtSigHeader::SetMcs(), ns3::HeSigHeader::SetMcs(), ns3::VhtSigHeader::SetMuFlag(), ns3::HeSigHeader::SetMuFlag(), ns3::VhtSigHeader::SetNStreams(), ns3::HeSigHeader::SetNStreams(), ns3::DsssSigHeader::SetRate(), ns3::LSigHeader::SetRate(), ns3::HtSigHeader::SetShortGuardInterval(), ns3::VhtSigHeader::SetShortGuardInterval(), ns3::VhtSigHeader::SetShortGuardIntervalDisambiguation(), ns3::VhtSigHeader::SetSuMcs(), SU_STA_ID, ns3::WIFI_MOD_CLASS_DSSS, ns3::WIFI_MOD_CLASS_ERP_OFDM, ns3::WIFI_MOD_CLASS_HE, ns3::WIFI_MOD_CLASS_HR_DSSS, ns3::WIFI_MOD_CLASS_HT, ns3::WIFI_MOD_CLASS_OFDM, ns3::WIFI_MOD_CLASS_VHT, ns3::WIFI_PHY_BAND_2_4GHZ, ns3::WIFI_PREAMBLE_HE_MU, ns3::WIFI_PREAMBLE_HE_SU, ns3::WIFI_PREAMBLE_HE_TB, and ns3::WIFI_PREAMBLE_VHT_MU.

Referenced by WifiPpdu().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetTruncatedTx()

void ns3::WifiPpdu::SetTruncatedTx ( void  )

Indicate that the PPDU's transmission was aborted due to transmitter switch off.

Definition at line 401 of file wifi-ppdu.cc.

References m_truncatedTx, and NS_LOG_FUNCTION.

Member Data Documentation

◆ m_band

WifiPhyBand ns3::WifiPpdu::m_band
private

the WifiPhyBand used to transmit that PPDU

Definition at line 137 of file wifi-ppdu.h.

Referenced by GetTxDuration(), and SetPhyHeaders().

◆ m_channelWidth

uint16_t ns3::WifiPpdu::m_channelWidth
private

the channel width used to transmit that PPDU in MHz

Definition at line 138 of file wifi-ppdu.h.

Referenced by GetTxVector(), and SetPhyHeaders().

◆ m_dsssSig

DsssSigHeader ns3::WifiPpdu::m_dsssSig
private

the DSSS SIG PHY header

Definition at line 128 of file wifi-ppdu.h.

Referenced by GetTxDuration(), GetTxVector(), and SetPhyHeaders().

◆ m_heSig

HeSigHeader ns3::WifiPpdu::m_heSig
private

the HE-SIG PHY header

Definition at line 132 of file wifi-ppdu.h.

Referenced by GetPsdu(), GetTxVector(), and SetPhyHeaders().

◆ m_htSig

HtSigHeader ns3::WifiPpdu::m_htSig
private

the HT-SIG PHY header

Definition at line 130 of file wifi-ppdu.h.

Referenced by GetTxDuration(), GetTxVector(), and SetPhyHeaders().

◆ m_lSig

LSigHeader ns3::WifiPpdu::m_lSig
private

the L-SIG PHY header

Definition at line 129 of file wifi-ppdu.h.

Referenced by GetTxDuration(), GetTxVector(), and SetPhyHeaders().

◆ m_modulation

WifiModulationClass ns3::WifiPpdu::m_modulation
private

the modulation used for the transmission of this PPDU

Definition at line 134 of file wifi-ppdu.h.

Referenced by GetModulation(), GetTxDuration(), GetTxVector(), Print(), and SetPhyHeaders().

◆ m_muUserInfos

WifiTxVector::HeMuUserInfoMap ns3::WifiPpdu::m_muUserInfos
private

the HE MU specific per-user information (to be removed once HE-SIG-B headers are implemented)

Definition at line 140 of file wifi-ppdu.h.

Referenced by GetTxVector(), and WifiPpdu().

◆ m_preamble

WifiPreamble ns3::WifiPpdu::m_preamble
private

the PHY preamble

Definition at line 133 of file wifi-ppdu.h.

Referenced by GetTxDuration(), GetTxVector(), IsMu(), Print(), SetPhyHeaders(), and WifiPpdu().

◆ m_psdus

WifiConstPsduMap ns3::WifiPpdu::m_psdus
private

the PSDUs contained in this PPDU

Definition at line 135 of file wifi-ppdu.h.

Referenced by GetPsdu(), GetTxVector(), Print(), SetPhyHeaders(), and WifiPpdu().

◆ m_truncatedTx

bool ns3::WifiPpdu::m_truncatedTx
private

flag indicating whether the frame's transmission was aborted due to transmitter switch off

Definition at line 136 of file wifi-ppdu.h.

Referenced by IsTruncatedTx(), Print(), and SetTruncatedTx().

◆ m_txPowerLevel

uint8_t ns3::WifiPpdu::m_txPowerLevel
private

the transmission power level (used only for TX and initializing the returned WifiTxVector)

Definition at line 139 of file wifi-ppdu.h.

Referenced by GetTxVector().

◆ m_vhtSig

VhtSigHeader ns3::WifiPpdu::m_vhtSig
private

the VHT-SIG PHY header

Definition at line 131 of file wifi-ppdu.h.

Referenced by GetTxDuration(), GetTxVector(), and SetPhyHeaders().


The documentation for this class was generated from the following files: