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"
Classes | |
struct | PsduInfo |
information about the frame being prepared for a specific receiver More... | |
Public Types | |
typedef std::map< Mac48Address, PsduInfo > | PsduInfoMap |
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 PsduInfo * | 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. | |
const PsduInfoMap & | GetPsduInfoMap () 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. | |
WifiTxParameters & | operator= (const WifiTxParameters &txParams) |
Copy assignment operator. | |
WifiTxParameters & | operator= (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< WifiAcknowledgment > | m_acknowledgment |
acknowledgment method | |
std::unique_ptr< WifiProtection > | m_protection |
protection method | |
std::optional< Time > | m_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 | |
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.
typedef std::map<Mac48Address, PsduInfo> ns3::WifiTxParameters::PsduInfoMap |
Map containing information about the PSDUs addressed to every receiver.
Definition at line 155 of file wifi-tx-parameters.h.
ns3::WifiTxParameters::WifiTxParameters | ( | ) |
Definition at line 26 of file wifi-tx-parameters.cc.
ns3::WifiTxParameters::WifiTxParameters | ( | const WifiTxParameters & | txParams | ) |
Copy constructor.
txParams | the 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.
|
default |
Move constructor.
Must define it manually because copy constructor is explicit.
txParams | the WifiTxParameters to copy |
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().
mpdu | the 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().
Record that an MSDU is being aggregated to the last MPDU added to the frame that hase the same receiver.
msdu | the 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().
void ns3::WifiTxParameters::Clear | ( | ) |
Reset the TX parameters.
Definition at line 58 of file wifi-tx-parameters.cc.
References m_acknowledgment, m_info, m_protection, m_txDuration, m_txVector, and NS_LOG_FUNCTION.
Referenced by ns3::HeFrameExchangeManager::DoDispose(), ns3::HtFrameExchangeManager::DoDispose(), ns3::RrMultiUserScheduler::DoDispose(), AmpduAggregationTest::DoRun(), TwoLevelAggregationTest::DoRun(), ns3::HeFrameExchangeManager::ReceiveBasicTrigger(), ns3::FrameExchangeManager::Reset(), TestMultiUserScheduler::SelectTxFormat(), ns3::RrMultiUserScheduler::TrySendingBasicTf(), ns3::RrMultiUserScheduler::TrySendingBsrpTf(), and ns3::RrMultiUserScheduler::TrySendingDlMuPpdu().
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.
receiver | the MAC address of the receiver |
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().
const WifiTxParameters::PsduInfoMap & ns3::WifiTxParameters::GetPsduInfoMap | ( | ) | const |
Get 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().
uint32_t ns3::WifiTxParameters::GetSize | ( | Mac48Address | receiver | ) | const |
Get the size in bytes of the (A-)MPDU addressed to the given receiver.
receiver | the MAC address of 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().
Get the size in bytes of the frame in case the given MPDU is added.
mpdu | the given MPDU |
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.
Get the size in bytes of the frame in case the given MSDU is aggregated.
msdu | the given MSDU |
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().
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.
receiver | the MAC address of 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().
WifiTxParameters & ns3::WifiTxParameters::operator= | ( | const WifiTxParameters & | txParams | ) |
Copy assignment operator.
txParams | the TX parameters to assign 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.
|
default |
Move assignment operator.
Must define it manually because copy assignment operator is explicit.
txParams | the TX parameters to assign to this object |
void ns3::WifiTxParameters::Print | ( | std::ostream & | os | ) | const |
Print the object contents.
os | output 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<<().
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().
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().
|
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().
|
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().
std::unique_ptr<WifiProtection> ns3::WifiTxParameters::m_protection |
protection method
Definition at line 69 of file wifi-tx-parameters.h.
Referenced by WifiTxParameters(), Clear(), ns3::WifiDefaultAckManager::IsResponseNeeded(), operator=(), Print(), ns3::FrameExchangeManager::ProtectionCompleted(), ns3::HeFrameExchangeManager::ProtectionCompleted(), ns3::HtFrameExchangeManager::ProtectionCompleted(), TestMultiUserScheduler::SelectTxFormat(), ns3::FrameExchangeManager::SendCtsToSelf(), ns3::FrameExchangeManager::SendMpduWithProtection(), ns3::HeFrameExchangeManager::SendMuRts(), ns3::HtFrameExchangeManager::SendPsduWithProtection(), ns3::HeFrameExchangeManager::SendQosNullFramesInTbPpdu(), ns3::FrameExchangeManager::SendRts(), ns3::QosFrameExchangeManager::StartFrameExchange(), ns3::FrameExchangeManager::StartProtection(), ns3::HeFrameExchangeManager::StartProtection(), ns3::FrameExchangeManager::StartTransmission(), ns3::QosFrameExchangeManager::TryAddMpdu(), ns3::WifiDefaultProtectionManager::TryAddMpdu(), ns3::WifiDefaultProtectionManager::TryAddMpduToMuPpdu(), ns3::HtFrameExchangeManager::TryAggregateMsdu(), ns3::WifiDefaultProtectionManager::TryAggregateMsdu(), ns3::RrMultiUserScheduler::TrySendingBasicTf(), and ns3::RrMultiUserScheduler::TrySendingBsrpTf().
std::optional<Time> ns3::WifiTxParameters::m_txDuration |
TX duration of the frame.
Definition at line 71 of file wifi-tx-parameters.h.
Referenced by WifiTxParameters(), Clear(), ns3::RrMultiUserScheduler::ComputeDlMuInfo(), ns3::HeFrameExchangeManager::GetTxDuration(), ns3::QosFrameExchangeManager::IsWithinSizeAndTimeLimits(), ns3::WifiRemoteStationManager::NeedRts(), operator=(), TestMultiUserScheduler::SelectTxFormat(), ns3::FrameExchangeManager::SendCtsToSelf(), ns3::HeFrameExchangeManager::SendMuRts(), ns3::FrameExchangeManager::SendRts(), ns3::QosFrameExchangeManager::TryAddMpdu(), ns3::HtFrameExchangeManager::TryAggregateMsdu(), ns3::RrMultiUserScheduler::TrySendingBasicTf(), ns3::RrMultiUserScheduler::TrySendingBsrpTf(), and ns3::FrameExchangeManager::UpdateTxDuration().
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().
|
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().