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, const WifiTxVector &txVector, uint64_t uid=UINT64_MAX)
 Create a PPDU storing a PSDU. More...
 
 WifiPpdu (const WifiConstPsduMap &psdus, const WifiTxVector &txVector, uint64_t uid)
 Create a PPDU storing a map of PSDUs. More...
 
virtual ~WifiPpdu ()
 Destructor for WifiPpdu. More...
 
virtual Ptr< WifiPpduCopy (void) const
 Copy this instance. More...
 
WifiModulationClass GetModulation (void) const
 Get the modulation used for the PPDU. More...
 
WifiPreamble GetPreamble (void) const
 Get the preamble of the PPDU. More...
 
Ptr< const WifiPsduGetPsdu (void) const
 Get the payload of the PPDU. More...
 
virtual uint16_t GetStaId (void) const
 Get the ID of the STA that transmitted the PPDU for UL MU, SU_STA_ID otherwise. More...
 
virtual Time GetTxDuration (void) const
 Get the total transmission duration of the PPDU. More...
 
WifiTxVector GetTxVector (void) const
 Get the TXVECTOR used to send the PPDU. More...
 
virtual WifiPpduType GetType (void) const
 Return the PPDU type (. More...
 
uint64_t GetUid (void) const
 Get the UID of the PPDU. More...
 
bool IsTruncatedTx (void) const
 
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...
 

Protected Member Functions

virtual std::string PrintPayload (void) const
 Print the payload of the PPDU. More...
 

Protected Attributes

WifiModulationClass m_modulation
 the modulation used for the transmission of this PPDU More...
 
WifiPreamble m_preamble
 the PHY preamble More...
 
WifiConstPsduMap m_psdus
 the PSDUs contained in this PPDU More...
 
uint64_t m_uid
 the unique ID of this PPDU More...
 

Private Member Functions

virtual WifiTxVector DoGetTxVector (void) const
 Get the TXVECTOR used to send the PPDU. More...
 

Private Attributes

bool m_truncatedTx
 flag indicating whether the frame's transmission was aborted due to transmitter switch off More...
 
uint8_t m_txAntennas
 the number of antennas used to transmit this PPDU More...
 
uint8_t m_txPowerLevel
 the transmission power level (used only for TX and initializing the returned WifiTxVector) More...
 

Detailed Description

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

This class should be subclassed for each amendment.

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

Constructor & Destructor Documentation

◆ WifiPpdu() [1/2]

ns3::WifiPpdu::WifiPpdu ( Ptr< const WifiPsdu psdu,
const WifiTxVector txVector,
uint64_t  uid = UINT64_MAX 
)

Create a PPDU storing a PSDU.

Parameters
psduthe PHY payload (PSDU)
txVectorthe TXVECTOR that was used for this PPDU
uidthe unique ID of this PPDU

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

References m_psdus, NS_LOG_FUNCTION, and SU_STA_ID.

◆ WifiPpdu() [2/2]

ns3::WifiPpdu::WifiPpdu ( const WifiConstPsduMap psdus,
const WifiTxVector txVector,
uint64_t  uid 
)

Create a PPDU storing a map of PSDUs.

Parameters
psdusthe PHY payloads (PSDUs)
txVectorthe TXVECTOR that was used for this PPDU
uidthe unique ID of this PPDU

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

References m_psdus, and NS_LOG_FUNCTION.

◆ ~WifiPpdu()

ns3::WifiPpdu::~WifiPpdu ( )
virtual

Destructor for WifiPpdu.

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

References m_psdus.

Member Function Documentation

◆ Copy()

Ptr< WifiPpdu > ns3::WifiPpdu::Copy ( void  ) const
virtual

Copy this instance.

Returns
a Ptr to a copy of this instance.

Reimplemented in ns3::HePpdu, ns3::VhtPpdu, ns3::HtPpdu, ns3::OfdmPpdu, ns3::DsssPpdu, and ns3::ErpOfdmPpdu.

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

References GetPsdu(), GetTxVector(), and NS_FATAL_ERROR.

+ Here is the call graph for this function:

◆ DoGetTxVector()

WifiTxVector ns3::WifiPpdu::DoGetTxVector ( void  ) const
privatevirtual

Get the TXVECTOR used to send the PPDU.

This method should be overridden by child classes.

Returns
the TXVECTOR of the PPDU.

Reimplemented in ns3::HePpdu, ns3::VhtPpdu, ns3::HtPpdu, ns3::OfdmPpdu, ns3::DsssPpdu, and ns3::ErpOfdmPpdu.

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

References NS_FATAL_ERROR.

Referenced by GetTxVector().

+ Here is the caller graph for this function:

◆ GetModulation()

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

Get the modulation used for the PPDU.

Returns
the modulation used for the PPDU

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

References m_modulation.

◆ GetPreamble()

WifiPreamble ns3::WifiPpdu::GetPreamble ( void  ) const

Get the preamble of the PPDU.

Returns
the preamble of the PPDU

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

References m_preamble.

◆ GetPsdu()

Ptr< const WifiPsdu > ns3::WifiPpdu::GetPsdu ( void  ) const

Get the payload of the PPDU.

Returns
the PSDU

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

References m_psdus.

Referenced by ns3::ErpOfdmPpdu::Copy(), ns3::DsssPpdu::Copy(), ns3::OfdmPpdu::Copy(), Copy(), ns3::HtPpdu::Copy(), ns3::VhtPpdu::Copy(), ns3::VhtPpdu::DoGetTxVector(), and PrintPayload().

+ Here is the caller graph for this function:

◆ GetStaId()

uint16_t ns3::WifiPpdu::GetStaId ( void  ) const
virtual

Get the ID of the STA that transmitted the PPDU for UL MU, SU_STA_ID otherwise.

Returns
the ID of the STA that transmitted the PPDU for UL MU, SU_STA_ID otherwise

Reimplemented in ns3::HePpdu.

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

References SU_STA_ID.

◆ GetTxDuration()

Time ns3::WifiPpdu::GetTxDuration ( void  ) const
virtual

Get the total transmission duration of the PPDU.

This method is overridden by child classes.

Returns
the transmission duration of the PPDU

Reimplemented in ns3::HePpdu, ns3::VhtPpdu, ns3::HtPpdu, ns3::OfdmPpdu, and ns3::DsssPpdu.

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

References ns3::MicroSeconds(), and NS_FATAL_ERROR.

+ Here is the call graph for this function:

◆ GetTxVector()

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

◆ GetType()

WifiPpduType ns3::WifiPpdu::GetType ( void  ) const
virtual

Return the PPDU type (.

See also
WifiPpduType)
Returns
the PPDU type

Reimplemented in ns3::HePpdu, and ns3::VhtPpdu.

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

References ns3::WIFI_PPDU_TYPE_SU.

Referenced by OfdmaTestHePhy::GetStaId().

+ Here is the caller graph for this function:

◆ GetUid()

uint64_t ns3::WifiPpdu::GetUid ( void  ) const

Get the UID of the PPDU.

Returns
the UID of the PPDU

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

References m_uid.

Referenced by OfdmaSpectrumWifiPhy::StartTx().

+ Here is the caller graph for this function:

◆ IsTruncatedTx()

bool ns3::WifiPpdu::IsTruncatedTx ( void  ) const
Returns
c\ true if the PPDU's transmission was aborted due to transmitter switch off

Definition at line 85 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 135 of file wifi-ppdu.cc.

References m_modulation, m_preamble, m_truncatedTx, m_uid, and PrintPayload().

+ Here is the call graph for this function:

◆ PrintPayload()

std::string ns3::WifiPpdu::PrintPayload ( void  ) const
protectedvirtual

Print the payload of the PPDU.

Returns
information on the payload part of the PPDU

Reimplemented in ns3::HePpdu.

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

References GetPsdu().

Referenced by Print().

+ 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 91 of file wifi-ppdu.cc.

References m_truncatedTx, and NS_LOG_FUNCTION.

Member Data Documentation

◆ m_modulation

WifiModulationClass ns3::WifiPpdu::m_modulation
protected

the modulation used for the transmission of this PPDU

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

Referenced by GetModulation(), and Print().

◆ m_preamble

◆ m_psdus

WifiConstPsduMap ns3::WifiPpdu::m_psdus
protected

◆ 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 172 of file wifi-ppdu.h.

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

◆ m_txAntennas

uint8_t ns3::WifiPpdu::m_txAntennas
private

the number of antennas used to transmit this PPDU

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

Referenced by GetTxVector().

◆ 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 173 of file wifi-ppdu.h.

Referenced by GetTxVector().

◆ m_uid

uint64_t ns3::WifiPpdu::m_uid
protected

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