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, uint8_t retries, bool shortGuardInterval, uint8_t nss, uint8_t ness, uint32_t channelWidth, bool aggregation, bool stbc)
 Create a TXVECTOR with the given parameters. More...
 
uint32_t GetChannelWidth (void) const
 
WifiMode GetMode (void) const
 
uint8_t GetNess (void) const
 
uint8_t GetNss (void) const
 
uint8_t GetRetries (void) const
 
uint8_t GetTxPowerLevel (void) const
 
bool IsAggregation (void) const
 Checks whether the PSDU contains A-MPDU. More...
 
bool IsShortGuardInterval (void) const
 
bool IsStbc (void) const
 Check if STBC is used or not. More...
 
void SetAggregation (bool aggregation)
 Sets if PSDU contains A-MPDU. More...
 
void SetChannelWidth (uint32_t channelWidth)
 Sets the selected channelWidth (in MHz) 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 SetRetries (uint8_t retries)
 Sets the number of retries. More...
 
void SetShortGuardInterval (bool guardinterval)
 Sets if short gurad interval is being used. 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
 
uint32_t m_channelWidth
 channel width in MHz More...
 
WifiMode m_mode
 The DATARATE parameter in Table 15-4. More...
 
bool m_modeInitialized
 
uint8_t m_ness
 number of streams in beamforming More...
 
uint8_t m_nss
 number of streams More...
 
uint8_t m_retries
 The DATA_RETRIES/RTS_RETRIES parameter for Click radiotap information. More...
 
bool m_shortGuardInterval
 true if short GI is going to be used More...
 
bool m_stbc
 Flag whether the PSDU contains A-MPDU. More...
 
uint8_t m_txPowerLevel
 The TXPWR_LEVEL parameter in Table 15-4. More...
 
bool m_txPowerLevelInitialized
 

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-2007 15.2.6 "Transmit PLCP", and also 15.4.4.2 "PMD_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 15). 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

ns3::WifiTxVector::WifiTxVector ( )

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

ns3::WifiTxVector::WifiTxVector ( WifiMode  mode,
uint8_t  powerLevel,
uint8_t  retries,
bool  shortGuardInterval,
uint8_t  nss,
uint8_t  ness,
uint32_t  channelWidth,
bool  aggregation,
bool  stbc 
)

Create a TXVECTOR with the given parameters.

Parameters
modeWifiMode
powerLeveltransmission power level
retriesretries
shortGuardIntervalenable or disable short guard interval
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

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

Member Function Documentation

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

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

References m_mode, m_modeInitialized, and NS_FATAL_ERROR.

Referenced by ns3::IdealWifiManager::AddSnrThreshold(), ns3::MacLow::AggregateToAmpdu(), ns3::MacLow::CalculateOverallTxTime(), ns3::ErrorRateModel::CalculateSnr(), ns3::MacLow::CalculateTransmissionTime(), ns3::MinstrelHtWifiManager::DoGetDataTxVector(), ns3::MacLow::ForwardDown(), ns3::MacLow::GetAckDuration(), ns3::MacLow::GetBlockAckDuration(), ns3::NistErrorRateModel::GetChunkSuccessRate(), ns3::YansErrorRateModel::GetChunkSuccessRate(), ns3::MacLow::GetCtsDuration(), ns3::WaveMacLow::GetDataTxVector(), ns3::WifiPhy::GetPayloadDuration(), ns3::WifiPhy::GetPlcpHeaderDuration(), ns3::WifiPhy::GetPlcpPreambleDuration(), ns3::IdealWifiManager::GetSnrThreshold(), ns3::WifiPhy::IsValidTxVector(), ns3::WifiRemoteStationManager::NeedCtsToSelf(), ns3::WifiRemoteStationManager::NeedRts(), ns3::operator<<(), ns3::MacLow::ReceiveOk(), ns3::MacLow::SendBlockAckAfterAmpdu(), ns3::MacLow::SendBlockAckResponse(), ns3::MacLow::SendCtsAfterRts(), ns3::MacLow::SendCtsToSelf(), ns3::MacLow::SendDataAfterCts(), ns3::MacLow::SendDataPacket(), ns3::YansWifiPhy::SendPacket(), ns3::SpectrumWifiPhy::SendPacket(), ns3::MacLow::SendRtsForPacket(), ns3::WifiPhyTag::Serialize(), ns3::MacLow::StartDataTxTimers(), ns3::YansWifiPhy::StartReceivePacket(), ns3::SpectrumWifiPhy::StartReceivePacket(), ns3::YansWifiPhy::StartReceivePreambleAndHeader(), ns3::MacLow::StopMpduAggregation(), ns3::WifiPhyStateHelper::SwitchFromRxEndOk(), ns3::WifiPhyStateHelper::SwitchToTx(), PowerRateAdaptationTest::TestAparf(), and PowerRateAdaptationTest::TestParf().

+ Here is the caller graph for this function:

uint8_t ns3::WifiTxVector::GetNess ( void  ) const
Returns
the number of Ness

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

References m_ness.

Referenced by ns3::WifiPhy::GetPlcpHtTrainingSymbolDuration(), ns3::operator<<(), ns3::WifiPhyHelper::PcapSniffRxEvent(), ns3::WifiPhyHelper::PcapSniffTxEvent(), and ns3::WifiPhyTag::Serialize().

+ Here is the caller graph for this function:

uint8_t ns3::WifiTxVector::GetRetries ( void  ) const
Returns
the number of retries

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

References m_retries.

Referenced by ns3::operator<<(), and ns3::WifiPhyTag::Serialize().

+ Here is the caller graph for this function:

uint8_t ns3::WifiTxVector::GetTxPowerLevel ( void  ) const
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 108 of file wifi-tx-vector.cc.

References m_aggregation.

Referenced by ns3::operator<<(), ns3::WifiPhyHelper::PcapSniffRxEvent(), and ns3::WifiPhyHelper::PcapSniffTxEvent().

+ Here is the caller graph for this function:

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

Check if STBC is used or not.

Returns
true if STBC is used, false otherwise

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

References m_stbc.

Referenced by ns3::WifiPhy::GetPayloadDuration(), ns3::operator<<(), ns3::WifiPhyHelper::PcapSniffRxEvent(), ns3::WifiPhyHelper::PcapSniffTxEvent(), and ns3::WifiPhyTag::Serialize().

+ Here is the caller graph for this function:

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

Sets if PSDU contains A-MPDU.

Parameters
aggregatedwhether the PSDU contains A-MPDU or not.

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

References m_aggregation.

Referenced by ns3::MacLow::ForwardDown().

+ Here is the caller graph for this function:

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

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

Parameters
ness

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

References m_ness.

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

+ Here is the caller graph for this function:

void ns3::WifiTxVector::SetRetries ( uint8_t  retries)

Sets the number of retries.

Parameters
retries

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

References m_retries.

Referenced by ns3::WifiPhyTag::Deserialize().

+ Here is the caller graph for this function:

void ns3::WifiTxVector::SetShortGuardInterval ( bool  guardinterval)
void ns3::WifiTxVector::SetStbc ( bool  stbc)
void ns3::WifiTxVector::SetTxPowerLevel ( uint8_t  powerlevel)

Member Data Documentation

bool ns3::WifiTxVector::m_aggregation
private

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

Referenced by IsAggregation(), and SetAggregation().

uint32_t ns3::WifiTxVector::m_channelWidth
private

channel width in MHz

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

Referenced by GetChannelWidth(), and SetChannelWidth().

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 185 of file wifi-tx-vector.h.

Referenced by GetMode(), and SetMode().

bool ns3::WifiTxVector::m_modeInitialized
private

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

Referenced by GetMode(), and SetMode().

uint8_t ns3::WifiTxVector::m_ness
private

number of streams in beamforming

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

Referenced by GetNess(), and SetNess().

uint8_t ns3::WifiTxVector::m_nss
private

number of streams

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

Referenced by GetNss(), and SetNss().

uint8_t ns3::WifiTxVector::m_retries
private

The DATA_RETRIES/RTS_RETRIES parameter for Click radiotap information.

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

Referenced by GetRetries(), and SetRetries().

bool ns3::WifiTxVector::m_shortGuardInterval
private

true if short GI is going to be used

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

Referenced by IsShortGuardInterval(), and SetShortGuardInterval().

bool ns3::WifiTxVector::m_stbc
private

Flag whether the PSDU contains A-MPDU.

STBC used or not

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

Referenced by IsStbc(), and SetStbc().

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 188 of file wifi-tx-vector.h.

Referenced by GetTxPowerLevel(), and SetTxPowerLevel().

bool ns3::WifiTxVector::m_txPowerLevelInitialized
private

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

Referenced by GetTxPowerLevel(), and SetTxPowerLevel().


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