A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::WifiTxParameters Class Reference

This class stores the TX parameters (TX vector, protection mechanism, acknowledgment mechanism, TX duration, ...) for a frame of different types (MPDU, A-MPDU, multi-TID A-MPDU, MU PPDU, ...). More...

#include "wifi-tx-parameters.h"

+ Collaboration diagram for ns3::WifiTxParameters:

Classes

struct  PsduInfo
 information about the frame being prepared for a specific receiver More...
 

Public Types

typedef std::map< Mac48Address, PsduInfoPsduInfoMap
 Map containing information about the PSDUs addressed to every receiver.
 

Public Member Functions

 WifiTxParameters ()
 
 WifiTxParameters (const WifiTxParameters &txParams)
 Copy constructor.
 
 WifiTxParameters (WifiTxParameters &&txParams)=default
 Move constructor.
 
void AddMpdu (Ptr< const WifiMpdu > mpdu)
 Record that an MPDU is being added to the current frame.
 
void AggregateMsdu (Ptr< const WifiMpdu > msdu)
 Record that an MSDU is being aggregated to the last MPDU added to the frame that hase the same receiver.
 
void Clear ()
 Reset the TX parameters.
 
const PsduInfoGetPsduInfo (Mac48Address receiver) const
 Get a pointer to the information about the PSDU addressed to the given receiver, if present, and a null pointer otherwise.
 
const PsduInfoMapGetPsduInfoMap () const
 Get a const reference to the map containing information about PSDUs.
 
uint32_t GetSize (Mac48Address receiver) const
 Get the size in bytes of the (A-)MPDU addressed to the given receiver.
 
uint32_t GetSizeIfAddMpdu (Ptr< const WifiMpdu > mpdu) const
 Get the size in bytes of the frame in case the given MPDU is added.
 
uint32_t GetSizeIfAggregateMsdu (Ptr< const WifiMpdu > msdu) const
 Get the size in bytes of the frame in case the given MSDU is aggregated.
 
bool LastAddedIsFirstMpdu (Mac48Address receiver) const
 Check if the last added MPDU is the first MPDU for the given receiver.
 
WifiTxParametersoperator= (const WifiTxParameters &txParams)
 Copy assignment operator.
 
WifiTxParametersoperator= (WifiTxParameters &&txParams)=default
 Move assignment operator.
 
void Print (std::ostream &os) const
 Print the object contents.
 
void UndoAddMpdu ()
 Undo the addition of the last MPDU added by calling AddMpdu().
 

Public Attributes

std::unique_ptr< WifiAcknowledgmentm_acknowledgment
 acknowledgment method
 
std::unique_ptr< WifiProtectionm_protection
 protection method
 
std::optional< Timem_txDuration
 TX duration of the frame.
 
WifiTxVector m_txVector
 TXVECTOR of the frame being prepared.
 

Private Attributes

PsduInfoMap m_info
 information about the frame being prepared.
 
std::optional< PsduInfoMap::iterator > m_lastInfoIt
 iterator pointing to the entry in the m_info map that was created/modified by the last added MPDU
 
PsduInfo m_undoInfo {}
 information needed to undo the addition of an MPDU
 

Detailed Description

This class stores the TX parameters (TX vector, protection mechanism, acknowledgment mechanism, TX duration, ...) for a frame of different types (MPDU, A-MPDU, multi-TID A-MPDU, MU PPDU, ...).

Definition at line 36 of file wifi-tx-parameters.h.

Member Typedef Documentation

◆ PsduInfoMap

Map containing information about the PSDUs addressed to every receiver.

Definition at line 155 of file wifi-tx-parameters.h.

Constructor & Destructor Documentation

◆ WifiTxParameters() [1/3]

ns3::WifiTxParameters::WifiTxParameters ( )

Definition at line 26 of file wifi-tx-parameters.cc.

◆ WifiTxParameters() [2/3]

ns3::WifiTxParameters::WifiTxParameters ( const WifiTxParameters & txParams)

Copy constructor.

Parameters
txParamsthe WifiTxParameters to copy

Definition at line 30 of file wifi-tx-parameters.cc.

References m_acknowledgment, m_info, m_protection, m_txDuration, and m_txVector.

◆ WifiTxParameters() [3/3]

ns3::WifiTxParameters::WifiTxParameters ( WifiTxParameters && txParams)
default

Move constructor.

Must define it manually because copy constructor is explicit.

Parameters
txParamsthe WifiTxParameters to copy

Member Function Documentation

◆ AddMpdu()

void ns3::WifiTxParameters::AddMpdu ( Ptr< const WifiMpdu > mpdu)

Record that an MPDU is being added to the current frame.

If an MPDU addressed to the same receiver already exists in the frame, A-MPDU aggregation is considered. Store information needed to "undo" the addition of the MPDU by calling UndoAddMpdu().

Parameters
mpduthe MPDU being added

Definition at line 89 of file wifi-tx-parameters.cc.

References ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::GetQosTid(), ns3::WifiMacHeader::GetSequenceNumber(), ns3::MpduAggregator::GetSizeIfAggregated(), ns3::WifiMacHeader::HasData(), ns3::WifiTxParameters::PsduInfo::header, ns3::WifiMacHeader::IsQosData(), m_info, m_lastInfoIt, m_undoInfo, NS_ASSERT, NS_ASSERT_MSG, NS_LOG_FUNCTION, ns3::WifiTxParameters::PsduInfo::seqNumbers, and ns3::WIFI_MAC_FCS_LENGTH.

Referenced by ns3::HeFrameExchangeManager::SendQosNullFramesInTbPpdu(), ns3::QosFrameExchangeManager::StartFrameExchange(), ns3::FrameExchangeManager::StartTransmission(), and ns3::QosFrameExchangeManager::TryAddMpdu().

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

◆ AggregateMsdu()

void ns3::WifiTxParameters::AggregateMsdu ( Ptr< const WifiMpdu > msdu)

Record that an MSDU is being aggregated to the last MPDU added to the frame that hase the same receiver.

Parameters
msduthe MSDU being aggregated

Definition at line 220 of file wifi-tx-parameters.cc.

References GetSizeIfAggregateMsdu(), ns3::WifiTxParameters::PsduInfo::header, m_info, m_lastInfoIt, m_undoInfo, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

Referenced by ns3::HtFrameExchangeManager::TryAggregateMsdu().

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

◆ Clear()

◆ GetPsduInfo()

const WifiTxParameters::PsduInfo * ns3::WifiTxParameters::GetPsduInfo ( Mac48Address receiver) const

Get a pointer to the information about the PSDU addressed to the given receiver, if present, and a null pointer otherwise.

Parameters
receiverthe MAC address of the receiver
Returns
a pointer to an entry in the PSDU information map or a null pointer

Definition at line 71 of file wifi-tx-parameters.cc.

References m_info.

Referenced by ns3::WifiDefaultAckManager::GetMaxDistFromStartingSeq(), ns3::HeFrameExchangeManager::GetTxDuration(), ns3::WifiDefaultAckManager::IsResponseNeeded(), ns3::HtFrameExchangeManager::IsWithinLimitsIfAddMpdu(), and ns3::HtFrameExchangeManager::IsWithinLimitsIfAggregateMsdu().

+ Here is the caller graph for this function:

◆ GetPsduInfoMap()

const WifiTxParameters::PsduInfoMap & ns3::WifiTxParameters::GetPsduInfoMap ( ) const

Get a const reference to the map containing information about PSDUs.

Returns
a const reference to the map containing information about PSDUs

Definition at line 83 of file wifi-tx-parameters.cc.

References m_info.

Referenced by ns3::FrameExchangeManager::SendRts(), ns3::WifiDefaultProtectionManager::TryAddMpdu(), ns3::WifiDefaultProtectionManager::TryAddMpduToMuPpdu(), and ns3::WifiDefaultProtectionManager::TryAggregateMsdu().

+ Here is the caller graph for this function:

◆ GetSize()

uint32_t ns3::WifiTxParameters::GetSize ( Mac48Address receiver) const

Get the size in bytes of the (A-)MPDU addressed to the given receiver.

Parameters
receiverthe MAC address of the given receiver
Returns
the size in bytes of the (A-)MPDU addressed to the given receiver

Definition at line 271 of file wifi-tx-parameters.cc.

References ns3::WifiTxVector::GetModulationClass(), ns3::MpduAggregator::GetSizeIfAggregated(), m_info, m_txVector, ns3::WIFI_MAC_FCS_LENGTH, and ns3::WIFI_MOD_CLASS_VHT.

Referenced by ns3::MpduAggregator::GetNextAmpdu(), ns3::QosTxop::GetNextMpdu(), ns3::HtFrameExchangeManager::IsWithinLimitsIfAddMpdu(), ns3::HtFrameExchangeManager::IsWithinLimitsIfAggregateMsdu(), ns3::WifiRemoteStationManager::NeedRts(), ns3::HeFrameExchangeManager::SendQosNullFramesInTbPpdu(), and ns3::FrameExchangeManager::UpdateTxDuration().

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

◆ GetSizeIfAddMpdu()

uint32_t ns3::WifiTxParameters::GetSizeIfAddMpdu ( Ptr< const WifiMpdu > mpdu) const

Get the size in bytes of the frame in case the given MPDU is added.

Parameters
mpduthe given MPDU
Returns
the size in bytes of the frame in case the given MPDU is added

Definition at line 194 of file wifi-tx-parameters.cc.

References ns3::WifiTxVector::GetModulationClass(), ns3::MpduAggregator::GetSizeIfAggregated(), m_info, m_txVector, NS_LOG_FUNCTION, ns3::WIFI_MAC_FCS_LENGTH, and ns3::WIFI_MOD_CLASS_VHT.

+ Here is the call graph for this function:

◆ GetSizeIfAggregateMsdu()

uint32_t ns3::WifiTxParameters::GetSizeIfAggregateMsdu ( Ptr< const WifiMpdu > msdu) const

Get the size in bytes of the frame in case the given MSDU is aggregated.

Parameters
msduthe given MSDU
Returns
size in bytes of the frame in case the given MSDU is aggregated

Definition at line 238 of file wifi-tx-parameters.cc.

References ns3::MsduAggregator::GetSizeIfAggregated(), m_info, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

Referenced by AggregateMsdu().

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

◆ LastAddedIsFirstMpdu()

bool ns3::WifiTxParameters::LastAddedIsFirstMpdu ( Mac48Address receiver) const

Check if the last added MPDU is the first MPDU for the given receiver.

Call this method only after adding an MPDU for the given receiver.

Parameters
receiverthe MAC address of the given receiver
Returns
whether the last added MPDU is the first MPDU for the given receiver

Definition at line 185 of file wifi-tx-parameters.cc.

References ns3::WifiTxParameters::PsduInfo::ampduSize, ns3::WifiTxParameters::PsduInfo::amsduSize, m_info, m_lastInfoIt, m_undoInfo, and NS_ASSERT_MSG.

Referenced by ns3::WifiDefaultAckManager::GetAckInfoIfAggregatedMuBar(), ns3::WifiDefaultAckManager::GetAckInfoIfBarBaSequence(), ns3::WifiDefaultAckManager::GetAckInfoIfTfMuBar(), ns3::HtFrameExchangeManager::IsWithinLimitsIfAddMpdu(), ns3::WifiDefaultAckManager::TryAddMpdu(), and ns3::WifiDefaultProtectionManager::TryAddMpduToMuPpdu().

+ Here is the caller graph for this function:

◆ operator=() [1/2]

WifiTxParameters & ns3::WifiTxParameters::operator= ( const WifiTxParameters & txParams)

Copy assignment operator.

Parameters
txParamsthe TX parameters to assign to this object
Returns
the reference to this object

Definition at line 40 of file wifi-tx-parameters.cc.

References m_acknowledgment, m_info, m_protection, m_txDuration, and m_txVector.

◆ operator=() [2/2]

WifiTxParameters & ns3::WifiTxParameters::operator= ( WifiTxParameters && txParams)
default

Move assignment operator.

Must define it manually because copy assignment operator is explicit.

Parameters
txParamsthe TX parameters to assign to this object
Returns
the reference to this object

◆ Print()

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

Print the object contents.

Parameters
osoutput stream in which the data should be printed.

Definition at line 292 of file wifi-tx-parameters.cc.

References m_acknowledgment, m_info, m_protection, and m_txVector.

Referenced by ns3::operator<<().

+ Here is the caller graph for this function:

◆ UndoAddMpdu()

void ns3::WifiTxParameters::UndoAddMpdu ( )

Undo the addition of the last MPDU added by calling AddMpdu().

Definition at line 153 of file wifi-tx-parameters.cc.

References ns3::WifiTxParameters::PsduInfo::ampduSize, ns3::WifiTxParameters::PsduInfo::amsduSize, ns3::WifiTxParameters::PsduInfo::header, m_info, m_lastInfoIt, m_undoInfo, NS_ASSERT, NS_LOG_FUNCTION, and ns3::WifiTxParameters::PsduInfo::seqNumbers.

Referenced by ns3::HeFrameExchangeManager::SendQosNullFramesInTbPpdu(), ns3::QosFrameExchangeManager::TryAddMpdu(), and ns3::HtFrameExchangeManager::TryAggregateMsdu().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_acknowledgment

std::unique_ptr<WifiAcknowledgment> ns3::WifiTxParameters::m_acknowledgment

acknowledgment method

Definition at line 70 of file wifi-tx-parameters.h.

Referenced by WifiTxParameters(), Clear(), ns3::WifiDefaultAckManager::GetAckInfoIfAggregatedMuBar(), ns3::WifiDefaultAckManager::GetAckInfoIfBarBaSequence(), ns3::WifiDefaultAckManager::GetAckInfoIfTfMuBar(), ns3::FrameExchangeManager::GetFrameDurationId(), ns3::QosFrameExchangeManager::GetFrameDurationId(), ns3::HtFrameExchangeManager::GetPsduDurationId(), ns3::HeFrameExchangeManager::GetTxDuration(), operator=(), Print(), ns3::MultiUserScheduler::RemoveRecipientsFromDlMu(), ns3::MultiUserScheduler::RemoveRecipientsFromTf(), TestMultiUserScheduler::SelectTxFormat(), ns3::FrameExchangeManager::SendCtsToSelf(), ns3::HtFrameExchangeManager::SendDataFrame(), ns3::FrameExchangeManager::SendMpdu(), ns3::HtFrameExchangeManager::SendMpduFromBaManager(), ns3::FrameExchangeManager::SendMpduWithProtection(), ns3::HeFrameExchangeManager::SendMultiStaBlockAck(), ns3::HeFrameExchangeManager::SendMuRts(), ns3::HtFrameExchangeManager::SendPsdu(), ns3::HeFrameExchangeManager::SendPsduMapWithProtection(), ns3::HtFrameExchangeManager::SendPsduWithProtection(), ns3::HeFrameExchangeManager::SendQosNullFramesInTbPpdu(), ns3::FrameExchangeManager::SendRts(), ns3::FrameExchangeManager::StartTransmission(), ns3::QosFrameExchangeManager::TryAddMpdu(), ns3::WifiDefaultAckManager::TryAddMpdu(), ns3::HtFrameExchangeManager::TryAggregateMsdu(), ns3::RrMultiUserScheduler::TrySendingBasicTf(), and ns3::RrMultiUserScheduler::TrySendingBsrpTf().

◆ m_info

PsduInfoMap ns3::WifiTxParameters::m_info
private

information about the frame being prepared.

Handles multi-TID A-MPDUs, MU PPDUs, etc.

Definition at line 171 of file wifi-tx-parameters.h.

Referenced by WifiTxParameters(), AddMpdu(), AggregateMsdu(), Clear(), GetPsduInfo(), GetPsduInfoMap(), GetSize(), GetSizeIfAddMpdu(), GetSizeIfAggregateMsdu(), LastAddedIsFirstMpdu(), operator=(), Print(), and UndoAddMpdu().

◆ m_lastInfoIt

std::optional<PsduInfoMap::iterator> ns3::WifiTxParameters::m_lastInfoIt
private

iterator pointing to the entry in the m_info map that was created/modified by the last added MPDU

Definition at line 175 of file wifi-tx-parameters.h.

Referenced by AddMpdu(), AggregateMsdu(), LastAddedIsFirstMpdu(), and UndoAddMpdu().

◆ m_protection

◆ m_txDuration

◆ m_txVector

WifiTxVector ns3::WifiTxParameters::m_txVector

TXVECTOR of the frame being prepared.

Definition at line 68 of file wifi-tx-parameters.h.

Referenced by WifiTxParameters(), Clear(), ns3::RrMultiUserScheduler::ComputeDlMuInfo(), AmpduAggregationTest::DoRun(), EhtAggregationTest::DoRun(), HeAggregationTest::DoRun(), TwoLevelAggregationTest::DoRun(), ns3::WifiDefaultAckManager::GetAckInfoIfAggregatedMuBar(), ns3::WifiDefaultAckManager::GetAckInfoIfBarBaSequence(), ns3::WifiDefaultAckManager::GetAckInfoIfTfMuBar(), ns3::FrameExchangeManager::GetFrameDurationId(), ns3::QosFrameExchangeManager::GetFrameDurationId(), ns3::MpduAggregator::GetNextAmpdu(), ns3::MsduAggregator::GetNextAmsdu(), ns3::WifiDefaultProtectionManager::GetPsduProtection(), GetSize(), GetSizeIfAddMpdu(), ns3::FrameExchangeManager::GetTxDuration(), ns3::HeFrameExchangeManager::GetTxDuration(), ns3::HtFrameExchangeManager::IsWithinLimitsIfAddMpdu(), ns3::HtFrameExchangeManager::IsWithinLimitsIfAggregateMsdu(), ns3::QosFrameExchangeManager::IsWithinSizeAndTimeLimits(), ns3::WifiRemoteStationManager::NeedRts(), ns3::MultiUserScheduler::NotifyProtectionCompleted(), operator=(), Print(), ns3::HeFrameExchangeManager::ReceiveBasicTrigger(), ns3::FrameExchangeManager::ReceiveMpdu(), ns3::HtFrameExchangeManager::ReceiveMpdu(), ns3::MultiUserScheduler::RemoveRecipientsFromDlMu(), TestMultiUserScheduler::SelectTxFormat(), ns3::HtFrameExchangeManager::SendAddBaRequest(), ns3::HtFrameExchangeManager::SendDataFrame(), ns3::FrameExchangeManager::SendMpdu(), ns3::HtFrameExchangeManager::SendMpduFromBaManager(), ns3::HtFrameExchangeManager::SendPsdu(), ns3::HeFrameExchangeManager::SendPsduMapWithProtection(), ns3::HeFrameExchangeManager::SendQosNullFramesInTbPpdu(), ns3::QosFrameExchangeManager::StartFrameExchange(), ns3::FrameExchangeManager::StartTransmission(), ns3::WifiDefaultAckManager::TryAddMpdu(), ns3::WifiDefaultProtectionManager::TryAddMpdu(), ns3::WifiDefaultProtectionManager::TryAddMpduToMuPpdu(), ns3::WifiDefaultProtectionManager::TryAggregateMsdu(), ns3::RrMultiUserScheduler::TrySendingBasicTf(), ns3::RrMultiUserScheduler::TrySendingBsrpTf(), and ns3::RrMultiUserScheduler::TrySendingDlMuPpdu().

◆ m_undoInfo

PsduInfo ns3::WifiTxParameters::m_undoInfo {}
private

information needed to undo the addition of an MPDU

Definition at line 173 of file wifi-tx-parameters.h.

Referenced by AddMpdu(), AggregateMsdu(), LastAddedIsFirstMpdu(), and UndoAddMpdu().


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