A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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 (const WifiConstPsduMap &psdus, const WifiTxVector &txVector, const WifiPhyOperatingChannel &channel, uint64_t uid)
 Create a PPDU storing a map of PSDUs.
 
 WifiPpdu (Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector, const WifiPhyOperatingChannel &channel, uint64_t uid=UINT64_MAX)
 Create a PPDU storing a PSDU.
 
virtual ~WifiPpdu ()=default
 Destructor for WifiPpdu.
 
virtual Ptr< WifiPpduCopy () const
 Copy this instance.
 
bool DoesOverlapChannel (MHz_u minFreq, MHz_u maxFreq) const
 Check whether the given PPDU overlaps a given channel.
 
WifiModulationClass GetModulation () const
 Get the modulation used for the PPDU.
 
WifiPreamble GetPreamble () const
 Get the preamble of the PPDU.
 
Ptr< const WifiPsduGetPsdu () const
 Get the payload of the PPDU.
 
virtual uint16_t GetStaId () const
 Get the ID of the STA that transmitted the PPDU for UL MU, SU_STA_ID otherwise.
 
std::vector< MHz_uGetTxCenterFreqs () const
 
virtual MHz_u GetTxChannelWidth () const
 Get the channel width over which the PPDU will effectively be transmitted.
 
virtual Time GetTxDuration () const
 Get the total transmission duration of the PPDU.
 
const WifiTxVectorGetTxVector () const
 Get the TXVECTOR used to send the PPDU.
 
virtual WifiPpduType GetType () const
 Return the PPDU type (.
 
uint64_t GetUid () const
 Get the UID of the PPDU.
 
bool IsTruncatedTx () const
 
void Print (std::ostream &os) const
 Print the PPDU contents.
 
void ResetTxVector () const
 Reset the TXVECTOR.
 
void SetTruncatedTx ()
 Indicate that the PPDU's transmission was aborted due to transmitter switch off.
 
void UpdateTxVector (const WifiTxVector &updatedTxVector) const
 Update the TXVECTOR based on some information known at the receiver.
 
- Public Member Functions inherited from ns3::SimpleRefCount< WifiPpdu >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 

Protected Member Functions

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

Protected Attributes

WifiModulationClass m_modulation
 the modulation used for the transmission of this PPDU
 
const WifiPhyOperatingChannelm_operatingChannel
 the operating channel of the PHY
 
WifiPreamble m_preamble
 the PHY preamble
 
WifiConstPsduMap m_psdus
 the PSDUs contained in this PPDU
 
std::vector< MHz_um_txCenterFreqs
 the center frequency per segment used for the transmission of this PPDU
 
std::optional< WifiTxVectorm_txVector
 the TXVECTOR at TX PHY or the reconstructed TXVECTOR at RX PHY (or std::nullopt if TXVECTOR has not been reconstructed yet)
 
uint64_t m_uid
 the unique ID of this PPDU
 

Private Member Functions

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

Private Attributes

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

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

Constructor & Destructor Documentation

◆ WifiPpdu() [1/2]

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

Create a PPDU storing a PSDU.

Parameters
psduthe PHY payload (PSDU)
txVectorthe TXVECTOR that was used for this PPDU
channelthe operating channel of the PHY used to transmit this PPDU
uidthe unique ID of this PPDU

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

References m_psdus, NS_LOG_FUNCTION, and ns3::SU_STA_ID.

Referenced by Copy().

+ Here is the caller graph for this function:

◆ WifiPpdu() [2/2]

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

Create a PPDU storing a map of PSDUs.

Parameters
psdusthe PHY payloads (PSDUs)
txVectorthe TXVECTOR that was used for this PPDU
channelthe operating channel of the PHY used to transmit this PPDU
uidthe unique ID of this PPDU

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

References m_psdus, and NS_LOG_FUNCTION.

◆ ~WifiPpdu()

virtual ns3::WifiPpdu::~WifiPpdu ( )
virtualdefault

Destructor for WifiPpdu.

Member Function Documentation

◆ Copy()

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

Copy this instance.

Returns
a Ptr to a copy of this instance.

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

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

References WifiPpdu(), and NS_FATAL_ERROR.

+ Here is the call graph for this function:

◆ DoesOverlapChannel()

bool ns3::WifiPpdu::DoesOverlapChannel ( MHz_u minFreq,
MHz_u maxFreq ) const

Check whether the given PPDU overlaps a given channel.

Parameters
minFreqthe minimum frequency of the channel
maxFreqthe maximum frequency of the channel
Returns
true if this PPDU overlaps the channel, false otherwise

The PPDU does not overlap the channel in two cases.

First non-overlapping case:

                                   ┌─────────┐
                           PPDU    │ Nominal │
                                   │  Band   │
                                   └─────────┘
                              minTxFreq   maxTxFreq

  minFreq                       maxFreq
    ┌──────────────────────────────┐
    │           Channel            │
    └──────────────────────────────┘

Second non-overlapping case:

    ┌─────────┐

PPDU │ Nominal │ │ Band │ └─────────┘ minTxFreq maxTxFreq

         minFreq                       maxFreq
           ┌──────────────────────────────┐
           │           Channel            │
           └──────────────────────────────┘

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

References m_txCenterFreqs, m_txChannelWidth, and NS_LOG_FUNCTION.

◆ DoGetTxVector()

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

Get the TXVECTOR used to send the PPDU.

Returns
the TXVECTOR of the PPDU.

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

Definition at line 117 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 ( ) const

Get the modulation used for the PPDU.

Returns
the modulation used for the PPDU

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

References m_modulation.

◆ GetPreamble()

WifiPreamble ns3::WifiPpdu::GetPreamble ( ) const

Get the preamble of the PPDU.

Returns
the preamble of the PPDU

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

References m_preamble.

◆ GetPsdu()

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

Get the payload of the PPDU.

Returns
the PSDU

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

References m_psdus.

Referenced by PrintPayload(), and ns3::VhtPpdu::SetTxVectorFromPhyHeaders().

+ Here is the caller graph for this function:

◆ GetStaId()

uint16_t ns3::WifiPpdu::GetStaId ( ) 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 242 of file wifi-ppdu.cc.

References ns3::SU_STA_ID.

◆ GetTxCenterFreqs()

std::vector< MHz_u > ns3::WifiPpdu::GetTxCenterFreqs ( ) const
Returns
the center frequency per segment used for the transmission of this PPDU

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

References m_txCenterFreqs.

◆ GetTxChannelWidth()

MHz_u ns3::WifiPpdu::GetTxChannelWidth ( ) const
virtual

Get the channel width over which the PPDU will effectively be transmitted.

Returns
the effective channel width used for the tranmsission

Reimplemented in ns3::HePpdu.

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

References m_txChannelWidth.

◆ GetTxDuration()

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

Get the total transmission duration of the PPDU.

Returns
the transmission duration of the PPDU

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

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

References ns3::MicroSeconds(), and NS_FATAL_ERROR.

+ Here is the call graph for this function:

◆ GetTxVector()

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

Get the TXVECTOR used to send the PPDU.

Returns
the TXVECTOR of the PPDU.

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

References DoGetTxVector(), m_txAntennas, m_txChannelWidth, m_txPowerLevel, and m_txVector.

Referenced by ns3::DsssPpdu::GetTxDuration(), ns3::HtPpdu::GetTxDuration(), ns3::OfdmPpdu::GetTxDuration(), and ns3::VhtPpdu::GetTxDuration().

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

◆ GetType()

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

Return the PPDU type (.

See also
WifiPpduType)
Returns
the PPDU type

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

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

References ns3::WIFI_PPDU_TYPE_SU.

◆ GetUid()

uint64_t ns3::WifiPpdu::GetUid ( ) const

Get the UID of the PPDU.

Returns
the UID of the PPDU

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

References m_uid.

◆ IsTruncatedTx()

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

Definition at line 146 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 256 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 ( ) const
protectedvirtual

Print the payload of the PPDU.

Returns
information on the payload part of the PPDU

Reimplemented in ns3::HePpdu.

Definition at line 264 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:

◆ ResetTxVector()

void ns3::WifiPpdu::ResetTxVector ( ) const

Reset the TXVECTOR.

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

References m_txVector, and NS_LOG_FUNCTION.

Referenced by UpdateTxVector().

+ Here is the caller graph for this function:

◆ SetTruncatedTx()

void ns3::WifiPpdu::SetTruncatedTx ( )

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

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

References m_truncatedTx, and NS_LOG_FUNCTION.

◆ UpdateTxVector()

void ns3::WifiPpdu::UpdateTxVector ( const WifiTxVector & updatedTxVector) const

Update the TXVECTOR based on some information known at the receiver.

Parameters
updatedTxVectorthe updated TXVECTOR.

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

References m_txVector, NS_LOG_FUNCTION, and ResetTxVector().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_modulation

WifiModulationClass ns3::WifiPpdu::m_modulation
protected

the modulation used for the transmission of this PPDU

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

Referenced by GetModulation(), and Print().

◆ m_operatingChannel

◆ m_preamble

◆ m_psdus

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

Referenced by GetTxVector().

◆ m_txCenterFreqs

std::vector<MHz_u> ns3::WifiPpdu::m_txCenterFreqs
protected

the center frequency per segment used for the transmission of this PPDU

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

Referenced by DoesOverlapChannel(), and GetTxCenterFreqs().

◆ m_txChannelWidth

MHz_u ns3::WifiPpdu::m_txChannelWidth
private

The channel width used for the transmission of this PPDU.

This has to be stored since channel width can not always be obtained from the PHY headers, especially for non-HT PPDU, since we do not sense the spectrum to determine the occupied channel width for simplicity.

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

Referenced by DoesOverlapChannel(), GetTxChannelWidth(), and 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 213 of file wifi-ppdu.h.

Referenced by GetTxVector().

◆ m_txVector

std::optional<WifiTxVector> ns3::WifiPpdu::m_txVector
mutableprotected

the TXVECTOR at TX PHY or the reconstructed TXVECTOR at RX PHY (or std::nullopt if TXVECTOR has not been reconstructed yet)

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

Referenced by GetTxVector(), ResetTxVector(), and UpdateTxVector().

◆ m_uid

uint64_t ns3::WifiPpdu::m_uid
protected

the unique ID of this PPDU

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

Referenced by GetUid(), and Print().


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