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

This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters which are to be used for a transmission. More...

#include "wifi-tx-vector.h"

+ Collaboration diagram for ns3::WifiTxVector:

Public Member Functions

 WifiTxVector ()
 
 WifiTxVector (WifiMode mode, uint8_t powerLevel, WifiPreamble preamble, uint16_t guardInterval, uint8_t nTx, uint8_t nss, uint8_t ness, uint16_t channelWidth, bool aggregation, bool stbc, uint8_t bssColor=0)
 Create a TXVECTOR with the given parameters. More...
 
uint8_t GetBssColor (void) const
 Get the BSS color. More...
 
uint16_t GetChannelWidth (void) const
 
uint16_t GetGuardInterval (void) const
 
WifiMode GetMode (void) const
 
bool GetModeInitialized (void) const
 
uint8_t GetNess (void) const
 
uint8_t GetNss (void) const
 
uint8_t GetNTx (void) const
 
WifiPreamble GetPreambleType (void) const
 
uint8_t GetTxPowerLevel (void) const
 
bool IsAggregation (void) const
 Checks whether the PSDU contains A-MPDU. More...
 
bool IsStbc (void) const
 Check if STBC is used or not. More...
 
bool IsValid (void) const
 The standard disallows certain combinations of WifiMode, number of spatial streams, and channel widths. More...
 
void SetAggregation (bool aggregation)
 Sets if PSDU contains A-MPDU. More...
 
void SetBssColor (uint8_t color)
 Set the BSS color. More...
 
void SetChannelWidth (uint16_t channelWidth)
 Sets the selected channelWidth (in MHz) More...
 
void SetGuardInterval (uint16_t guardInterval)
 Sets the guard interval duration (in nanoseconds) More...
 
void SetMode (WifiMode mode)
 Sets the selected payload transmission mode. More...
 
void SetNess (uint8_t ness)
 Sets the Ness number refer to IEEE 802.11n Table 20-6 for explanation. More...
 
void SetNss (uint8_t nss)
 Sets the number of Nss refer to IEEE 802.11n Table 20-28 for explanation and range. More...
 
void SetNTx (uint8_t nTx)
 Sets the number of TX antennas. More...
 
void SetPreambleType (WifiPreamble preamble)
 Sets the preamble type. More...
 
void SetStbc (bool stbc)
 Sets if STBC is being used. More...
 
void SetTxPowerLevel (uint8_t powerlevel)
 Sets the selected transmission power level. More...
 

Private Attributes

bool m_aggregation
 Flag whether the PSDU contains A-MPDU. More...
 
uint8_t m_bssColor
 BSS color. More...
 
uint16_t m_channelWidth
 channel width in MHz More...
 
uint16_t m_guardInterval
 guard interval duration in nanoseconds More...
 
WifiMode m_mode
 The DATARATE parameter in Table 15-4. More...
 
bool m_modeInitialized
 Internal initialization flag. More...
 
uint8_t m_ness
 number of spatial streams in beamforming More...
 
uint8_t m_nss
 number of spatial streams More...
 
uint8_t m_nTx
 number of TX antennas More...
 
WifiPreamble m_preamble
 preamble More...
 
bool m_stbc
 STBC used or not. More...
 
uint8_t m_txPowerLevel
 The TXPWR_LEVEL parameter in Table 15-4. More...
 

Detailed Description

This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters which are to be used for a transmission.

See IEEE 802.11-2016 16.2.5 "Transmit PHY", and also 8.3.4.1 "PHY SAP peer-to-peer service primitive parameters".

If this class is constructed with the constructor that takes no arguments, then the client must explicitly set the mode and transmit power level parameters before using them. Default member initializers are provided for the other parameters, to conform to a non-MIMO/long guard configuration, although these may also be explicitly set after object construction.

When used in a infrastructure context, WifiTxVector values should be drawn from WifiRemoteStationManager parameters since rate adaptation is responsible for picking the mode, number of streams, etc., but in the case in which there is no such manager (e.g. mesh), the client still needs to initialize at least the mode and transmit power level appropriately.

Note
the above reference is valid for the DSSS PHY only (clause 16). TXVECTOR is defined also for the other PHYs, however they don't include the TXPWRLVL explicitly in the TXVECTOR. This is somewhat strange, since all PHYs actually have a PMD_TXPWRLVL.request primitive. We decide to include the power level in WifiTxVector for all PHYs, since it serves better our purposes, and furthermore it seems close to the way real devices work (e.g., madwifi).

Definition at line 61 of file wifi-tx-vector.h.

Constructor & Destructor Documentation

◆ WifiTxVector() [1/2]

ns3::WifiTxVector::WifiTxVector ( )

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

◆ WifiTxVector() [2/2]

ns3::WifiTxVector::WifiTxVector ( WifiMode  mode,
uint8_t  powerLevel,
WifiPreamble  preamble,
uint16_t  guardInterval,
uint8_t  nTx,
uint8_t  nss,
uint8_t  ness,
uint16_t  channelWidth,
bool  aggregation,
bool  stbc,
uint8_t  bssColor = 0 
)

Create a TXVECTOR with the given parameters.

Parameters
modeWifiMode
powerLeveltransmission power level
preamblepreamble type
guardIntervalthe guard interval duration in nanoseconds
nTxthe number of TX antennas
nssthe number of spatial STBC streams (NSS)
nessthe number of extension spatial streams (NESS)
channelWidththe channel width in MHz
aggregationenable or disable MPDU aggregation
stbcenable or disable STBC
bssColorthe BSS color

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

Member Function Documentation

◆ GetBssColor()

uint8_t ns3::WifiTxVector::GetBssColor ( void  ) const

Get the BSS color.

Returns
the BSS color

Definition at line 204 of file wifi-tx-vector.cc.

References m_bssColor.

Referenced by ns3::WifiPpdu::WifiPpdu().

+ Here is the caller graph for this function:

◆ GetChannelWidth()

◆ GetGuardInterval()

uint16_t ns3::WifiTxVector::GetGuardInterval ( void  ) const

◆ GetMode()

WifiMode ns3::WifiTxVector::GetMode ( void  ) const
Returns
the selected payload transmission mode

Definition at line 73 of file wifi-tx-vector.cc.

References m_mode, m_modeInitialized, and NS_FATAL_ERROR.

Referenced by ns3::IdealWifiManager::AddSnrThreshold(), ns3::InterferenceHelper::CalculatePayloadChunkSuccessRate(), ns3::ErrorRateModel::CalculateSnr(), ns3::MinstrelHtWifiManager::DoGetDataTxVector(), ns3::MacLow::ForwardDown(), ns3::MacLow::GetAckDuration(), ns3::NistErrorRateModel::GetChunkSuccessRate(), ns3::YansErrorRateModel::GetChunkSuccessRate(), ns3::MacLow::GetCtsDuration(), ns3::WaveMacLow::GetDataTxVector(), ns3::MpduAggregator::GetNextAmpdu(), ns3::MsduAggregator::GetNextAmsdu(), ns3::WifiPhy::GetPayloadDuration(), ns3::WifiPhy::GetPhyHeaderDuration(), ns3::WifiPhy::GetPhyHeaderMode(), ns3::WifiPhy::GetPhyPreambleDuration(), ns3::WifiPhyHelper::GetRadiotapHeader(), ns3::MacLow::GetResponseDuration(), ns3::IdealWifiManager::GetSnrThreshold(), ns3::MacLow::IsWithinSizeAndTimeLimits(), ns3::WifiRemoteStationManager::NeedCtsToSelf(), ns3::WifiRemoteStationManager::NeedRts(), ns3::operator<<(), ns3::MacLow::ReceiveOk(), ns3::MacLow::SendBlockAckAfterAmpdu(), ns3::MacLow::SendCtsAfterRts(), ns3::MacLow::SendDataPacket(), ns3::MacLow::StartDataTxTimers(), ns3::WifiPhy::StartReceiveHeader(), ns3::MacLow::StartTransmission(), ns3::SpectrumWifiPhy::StartTx(), Bug2843TestCase::StoreDistinctTuple(), ns3::WifiPhyStateHelper::SwitchFromRxEndOk(), ns3::WifiPhyStateHelper::SwitchToTx(), PowerRateAdaptationTest::TestAparf(), PowerRateAdaptationTest::TestParf(), PowerRateAdaptationTest::TestRrpaa(), Issue169TestCase::TxCallback(), and ns3::WifiPpdu::WifiPpdu().

+ Here is the caller graph for this function:

◆ GetModeInitialized()

bool ns3::WifiTxVector::GetModeInitialized ( void  ) const
Returns
whether mode has been initialized

Definition at line 67 of file wifi-tx-vector.cc.

References m_modeInitialized.

Referenced by IsValid(), and ns3::WifiPhy::StartReceivePreamble().

+ Here is the caller graph for this function:

◆ GetNess()

uint8_t ns3::WifiTxVector::GetNess ( void  ) const
Returns
the number of extended spatial streams

Definition at line 119 of file wifi-tx-vector.cc.

References m_ness.

Referenced by ns3::WifiPhy::GetPhyTrainingSymbolDuration(), ns3::WifiPhyHelper::GetRadiotapHeader(), and ns3::operator<<().

+ Here is the caller graph for this function:

◆ GetNss()

◆ GetNTx()

uint8_t ns3::WifiTxVector::GetNTx ( void  ) const
Returns
the number of TX antennas

Definition at line 107 of file wifi-tx-vector.cc.

References m_nTx.

Referenced by ns3::InterferenceHelper::CalculatePayloadChunkSuccessRate(), and ns3::operator<<().

+ Here is the caller graph for this function:

◆ GetPreambleType()

◆ GetTxPowerLevel()

uint8_t ns3::WifiTxVector::GetTxPowerLevel ( void  ) const

◆ IsAggregation()

bool ns3::WifiTxVector::IsAggregation ( void  ) const

Checks whether the PSDU contains A-MPDU.

Returns
true if this PSDU has A-MPDU aggregation, false otherwise.

Definition at line 125 of file wifi-tx-vector.cc.

References m_aggregation.

Referenced by ns3::MacLow::DeaggregateAmpduAndReceive(), ns3::WifiPhyHelper::GetRadiotapHeader(), ns3::WifiPhy::NotifyMonitorSniffRx(), ns3::WifiPhy::NotifyMonitorSniffTx(), ns3::operator<<(), and ns3::WifiPpdu::WifiPpdu().

+ Here is the caller graph for this function:

◆ IsStbc()

bool ns3::WifiTxVector::IsStbc ( void  ) const

Check if STBC is used or not.

Returns
true if STBC is used, false otherwise

Definition at line 131 of file wifi-tx-vector.cc.

References m_stbc.

Referenced by ns3::WifiPhy::GetPayloadDuration(), ns3::WifiPhyHelper::GetRadiotapHeader(), and ns3::operator<<().

+ Here is the caller graph for this function:

◆ IsValid()

bool ns3::WifiTxVector::IsValid ( void  ) const

The standard disallows certain combinations of WifiMode, number of spatial streams, and channel widths.

This method can be used to check whether this WifiTxVector contains an invalid combination.

Returns
true if the WifiTxVector parameters are allowed by the standard

Definition at line 210 of file wifi-tx-vector.cc.

References GetModeInitialized(), ns3::WifiMode::GetUniqueName(), m_channelWidth, m_mode, and m_nss.

Referenced by ns3::IdealWifiManager::DoGetDataTxVector(), ns3::MinstrelHtWifiManager::IsValidMcs(), and ns3::WifiPpdu::WifiPpdu().

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

◆ SetAggregation()

void ns3::WifiTxVector::SetAggregation ( bool  aggregation)

Sets if PSDU contains A-MPDU.

Parameters
aggregationwhether the PSDU contains A-MPDU or not.

Definition at line 186 of file wifi-tx-vector.cc.

References m_aggregation.

Referenced by ns3::MacLow::ForwardDown(), and ns3::WifiPpdu::GetTxVector().

+ Here is the caller graph for this function:

◆ SetBssColor()

void ns3::WifiTxVector::SetBssColor ( uint8_t  color)

Set the BSS color.

Parameters
colorthe BSS color

Definition at line 198 of file wifi-tx-vector.cc.

References m_bssColor.

Referenced by ns3::WifiRemoteStationManager::GetDataTxVector(), and ns3::WifiPpdu::GetTxVector().

+ Here is the caller graph for this function:

◆ SetChannelWidth()

◆ SetGuardInterval()

void ns3::WifiTxVector::SetGuardInterval ( uint16_t  guardInterval)

◆ SetMode()

◆ SetNess()

void ns3::WifiTxVector::SetNess ( uint8_t  ness)

Sets the Ness number refer to IEEE 802.11n Table 20-6 for explanation.

Parameters
nessthe number of extended spatial streams

Definition at line 180 of file wifi-tx-vector.cc.

References m_ness.

Referenced by ns3::MinstrelHtWifiManager::CalculateMpduTxDuration(), TxDurationTest::CheckPayloadDuration(), TxDurationTest::CheckTxDuration(), ns3::WifiRemoteStationManager::GetDataTxVector(), and ns3::WifiRemoteStationManager::GetRtsTxVector().

+ Here is the caller graph for this function:

◆ SetNss()

◆ SetNTx()

void ns3::WifiTxVector::SetNTx ( uint8_t  nTx)

Sets the number of TX antennas.

Parameters
nTxthe number of TX antennas

Definition at line 168 of file wifi-tx-vector.cc.

References m_nTx.

Referenced by ns3::WifiRemoteStationManager::GetDataTxVector(), and ns3::WifiRemoteStationManager::GetRtsTxVector().

+ Here is the caller graph for this function:

◆ SetPreambleType()

◆ SetStbc()

void ns3::WifiTxVector::SetStbc ( bool  stbc)

Sets if STBC is being used.

Parameters
stbcenable or disable STBC

Definition at line 192 of file wifi-tx-vector.cc.

References m_stbc.

Referenced by ns3::MinstrelHtWifiManager::CalculateMpduTxDuration(), TxDurationTest::CheckPayloadDuration(), TxDurationTest::CheckTxDuration(), ns3::WifiRemoteStationManager::GetDataTxVector(), and ns3::WifiRemoteStationManager::GetRtsTxVector().

+ Here is the caller graph for this function:

◆ SetTxPowerLevel()

Member Data Documentation

◆ m_aggregation

bool ns3::WifiTxVector::m_aggregation
private

Flag whether the PSDU contains A-MPDU.

Definition at line 233 of file wifi-tx-vector.h.

Referenced by IsAggregation(), and SetAggregation().

◆ m_bssColor

uint8_t ns3::WifiTxVector::m_bssColor
private

BSS color.

Definition at line 235 of file wifi-tx-vector.h.

Referenced by GetBssColor(), and SetBssColor().

◆ m_channelWidth

uint16_t ns3::WifiTxVector::m_channelWidth
private

channel width in MHz

Definition at line 228 of file wifi-tx-vector.h.

Referenced by GetChannelWidth(), IsValid(), and SetChannelWidth().

◆ m_guardInterval

uint16_t ns3::WifiTxVector::m_guardInterval
private

guard interval duration in nanoseconds

Definition at line 229 of file wifi-tx-vector.h.

Referenced by GetGuardInterval(), and SetGuardInterval().

◆ m_mode

WifiMode ns3::WifiTxVector::m_mode
private

The DATARATE parameter in Table 15-4.

It is the value that will be passed to PMD_RATE.request

Definition at line 221 of file wifi-tx-vector.h.

Referenced by GetMode(), IsValid(), and SetMode().

◆ m_modeInitialized

bool ns3::WifiTxVector::m_modeInitialized
private

Internal initialization flag.

Definition at line 237 of file wifi-tx-vector.h.

Referenced by GetMode(), GetModeInitialized(), and SetMode().

◆ m_ness

uint8_t ns3::WifiTxVector::m_ness
private

number of spatial streams in beamforming

Definition at line 232 of file wifi-tx-vector.h.

Referenced by GetNess(), and SetNess().

◆ m_nss

uint8_t ns3::WifiTxVector::m_nss
private

number of spatial streams

Definition at line 231 of file wifi-tx-vector.h.

Referenced by GetNss(), IsValid(), and SetNss().

◆ m_nTx

uint8_t ns3::WifiTxVector::m_nTx
private

number of TX antennas

Definition at line 230 of file wifi-tx-vector.h.

Referenced by GetNTx(), and SetNTx().

◆ m_preamble

WifiPreamble ns3::WifiTxVector::m_preamble
private

preamble

Definition at line 227 of file wifi-tx-vector.h.

Referenced by GetPreambleType(), and SetPreambleType().

◆ m_stbc

bool ns3::WifiTxVector::m_stbc
private

STBC used or not.

Definition at line 234 of file wifi-tx-vector.h.

Referenced by IsStbc(), and SetStbc().

◆ m_txPowerLevel

uint8_t ns3::WifiTxVector::m_txPowerLevel
private

The TXPWR_LEVEL parameter in Table 15-4.

It is the value that will be passed to PMD_TXPWRLVL.request

Definition at line 224 of file wifi-tx-vector.h.

Referenced by GetTxPowerLevel(), and SetTxPowerLevel().


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