represent a single transmission modeA WifiMode is implemented by a single integer which is used to lookup in a global array the characteristics of the associated transmission mode. More...
#include "wifi-mode.h"
Public Member Functions | |
WifiMode () | |
Create an invalid WifiMode. More... | |
WifiMode (std::string name) | |
Create a WifiMode if the given string represents a valid WifiMode name. More... | |
enum WifiCodeRate | GetCodeRate (uint8_t nss) const |
uint16_t | GetConstellationSize (uint8_t nss) const |
uint64_t | GetDataRate (uint32_t channelWidth, bool isShortGuardInterval, uint8_t nss) const |
uint8_t | GetMcsValue (void) const |
enum WifiModulationClass | GetModulationClass () const |
uint64_t | GetPhyRate (uint32_t channelWidth, bool isShortGuardInterval, uint8_t nss) const |
uint32_t | GetUid (void) const |
std::string | GetUniqueName (void) const |
bool | IsMandatory (void) const |
Private Member Functions | |
WifiMode (uint32_t uid) | |
Create a WifiMode from a given unique ID. More... | |
Private Attributes | |
uint32_t | m_uid |
Friends | |
class | WifiModeFactory |
represent a single transmission mode
A WifiMode is implemented by a single integer which is used to lookup in a global array the characteristics of the associated transmission mode.
It is thus extremely cheap to keep a WifiMode variable around.
Definition at line 97 of file wifi-mode.h.
ns3::WifiMode::WifiMode | ( | ) |
Create an invalid WifiMode.
Calling any method on the instance created will trigger an assert. This is useful to separate the declaration of a WifiMode variable from its initialization.
Definition at line 381 of file wifi-mode.cc.
ns3::WifiMode::WifiMode | ( | std::string | name | ) |
Create a WifiMode if the given string represents a valid WifiMode name.
name | std::string of a valid WifiMode name |
Definition at line 391 of file wifi-mode.cc.
References ns3::WifiModeFactory::GetFactory(), and ns3::WifiModeFactory::Search().
|
private |
Create a WifiMode from a given unique ID.
uid | unique ID |
Definition at line 386 of file wifi-mode.cc.
enum WifiCodeRate ns3::WifiMode::GetCodeRate | ( | uint8_t | nss | ) | const |
nss | the considered number of streams |
Definition at line 227 of file wifi-mode.cc.
References ns3::WifiModeFactory::WifiModeItem::codingRate, ns3::WifiModeFactory::Get(), ns3::WifiModeFactory::GetFactory(), m_uid, ns3::WifiModeFactory::WifiModeItem::mcsValue, ns3::WifiModeFactory::WifiModeItem::modClass, NS_ASSERT, ns3::WIFI_CODE_RATE_1_2, ns3::WIFI_CODE_RATE_2_3, ns3::WIFI_CODE_RATE_3_4, ns3::WIFI_CODE_RATE_5_6, ns3::WIFI_CODE_RATE_UNDEFINED, ns3::WIFI_MOD_CLASS_HT, and ns3::WIFI_MOD_CLASS_VHT.
Referenced by ns3::NistErrorRateModel::GetChunkSuccessRate(), ns3::YansErrorRateModel::GetChunkSuccessRate(), GetDataRate(), and GetPhyRate().
uint16_t ns3::WifiMode::GetConstellationSize | ( | uint8_t | nss | ) | const |
nss | the considered number of streams |
Definition at line 282 of file wifi-mode.cc.
References ns3::WifiModeFactory::WifiModeItem::constellationSize, ns3::WifiModeFactory::Get(), ns3::WifiModeFactory::GetFactory(), m_uid, ns3::WifiModeFactory::WifiModeItem::mcsValue, ns3::WifiModeFactory::WifiModeItem::modClass, NS_ASSERT, ns3::WIFI_MOD_CLASS_HT, and ns3::WIFI_MOD_CLASS_VHT.
Referenced by ns3::NistErrorRateModel::GetChunkSuccessRate(), ns3::YansErrorRateModel::GetChunkSuccessRate(), and GetDataRate().
uint64_t ns3::WifiMode::GetDataRate | ( | uint32_t | channelWidth, |
bool | isShortGuardInterval, | ||
uint8_t | nss | ||
) | const |
channelWidth | the considered channel width in MHz |
isShortGuardInterval | whether short guard interval is considered or not |
nss | the considered number of streams |
Definition at line 100 of file wifi-mode.cc.
References ns3::WifiModeFactory::Get(), GetCodeRate(), GetConstellationSize(), ns3::WifiModeFactory::GetFactory(), m_uid, ns3::WifiModeFactory::WifiModeItem::mcsValue, ns3::WifiModeFactory::WifiModeItem::modClass, NS_ASSERT, NS_FATAL_ERROR, ns3::WIFI_CODE_RATE_1_2, ns3::WIFI_CODE_RATE_2_3, ns3::WIFI_CODE_RATE_3_4, ns3::WIFI_CODE_RATE_5_6, ns3::WIFI_CODE_RATE_UNDEFINED, ns3::WIFI_MOD_CLASS_DSSS, ns3::WIFI_MOD_CLASS_ERP_OFDM, ns3::WIFI_MOD_CLASS_HR_DSSS, ns3::WIFI_MOD_CLASS_HT, ns3::WIFI_MOD_CLASS_OFDM, and ns3::WIFI_MOD_CLASS_VHT.
Referenced by TxDurationTest::CheckPayloadDuration(), ns3::MeshWifiInterfaceMac::CheckSupportedRates(), TxDurationTest::CheckTxDuration(), ns3::NistErrorRateModel::GetChunkSuccessRate(), ns3::YansErrorRateModel::GetChunkSuccessRate(), ns3::WaveMacLow::GetDataTxVector(), ns3::StaWifiMac::GetHtCapabilities(), ns3::ApWifiMac::GetHtCapabilities(), ns3::WifiPhy::GetPayloadDuration(), GetPhyRate(), ns3::MeshWifiInterfaceMac::GetSupportedRates(), ns3::StaWifiMac::GetSupportedRates(), ns3::ApWifiMac::GetSupportedRates(), ns3::StaWifiMac::Receive(), ns3::ApWifiMac::Receive(), ns3::MeshWifiInterfaceMac::Receive(), ns3::YansWifiPhy::SendPacket(), PowerRateAdaptationTest::TestAparf(), and PowerRateAdaptationTest::TestParf().
uint8_t ns3::WifiMode::GetMcsValue | ( | void | ) | const |
Definition at line 353 of file wifi-mode.cc.
References ns3::WifiModeFactory::Get(), ns3::WifiModeFactory::GetFactory(), m_uid, ns3::WifiModeFactory::WifiModeItem::mcsValue, ns3::WifiModeFactory::WifiModeItem::modClass, NS_ASSERT, ns3::WIFI_MOD_CLASS_HT, and ns3::WIFI_MOD_CLASS_VHT.
Referenced by ns3::WifiRemoteStationManager::AddBasicMcs(), ns3::StaWifiMac::GetHtCapabilities(), ns3::ApWifiMac::GetHtCapabilities(), ns3::StaWifiMac::GetVhtCapabilities(), ns3::ApWifiMac::GetVhtCapabilities(), ns3::StaWifiMac::Receive(), ns3::ApWifiMac::Receive(), and ns3::YansWifiPhy::SendPacket().
enum WifiModulationClass ns3::WifiMode::GetModulationClass | ( | ) | const |
Definition at line 375 of file wifi-mode.cc.
References ns3::WifiModeFactory::Get(), ns3::WifiModeFactory::GetFactory(), m_uid, and ns3::WifiModeFactory::WifiModeItem::modClass.
Referenced by ns3::WifiRemoteStationManager::AddBasicMode(), ns3::MacLow::AggregateToAmpdu(), ns3::MacLow::CalculateOverallTxTime(), ns3::MacLow::CalculateTransmissionTime(), TxDurationTest::CheckPayloadDuration(), TxDurationTest::CheckTxDuration(), ns3::MacLow::GetAckDuration(), ns3::MacLow::GetBlockAckDuration(), ns3::NistErrorRateModel::GetChunkSuccessRate(), ns3::YansErrorRateModel::GetChunkSuccessRate(), ns3::WifiRemoteStationManager::GetControlAnswerMode(), ns3::MacLow::GetCtsDuration(), ns3::WifiPhy::GetPayloadDuration(), ns3::WifiPhy::GetPlcpHeaderDuration(), ns3::WifiPhy::GetPlcpHeaderMode(), ns3::WifiPhy::GetPlcpPreambleDuration(), ns3::ApWifiMac::GetSupportedRates(), ns3::StaWifiMac::Receive(), ns3::ApWifiMac::Receive(), ns3::MacLow::SendBlockAckResponse(), ns3::MacLow::SendCtsToSelf(), ns3::MacLow::SendDataAfterCts(), ns3::MacLow::SendDataPacket(), ns3::YansWifiPhy::SendPacket(), ns3::MacLow::StartDataTxTimers(), and ns3::MacLow::StopMpduAggregation().
uint64_t ns3::WifiMode::GetPhyRate | ( | uint32_t | channelWidth, |
bool | isShortGuardInterval, | ||
uint8_t | nss | ||
) | const |
channelWidth | the considered channel width in MHz |
isShortGuardInterval | whether short guard interval is considered or not |
nss | the considered number of streams |
If a transmission mode uses 1/2 FEC, and if its data rate is 3.25Mbps, the phy rate is 6.5Mbps
Definition at line 73 of file wifi-mode.cc.
References GetCodeRate(), GetDataRate(), ns3::WIFI_CODE_RATE_1_2, ns3::WIFI_CODE_RATE_2_3, ns3::WIFI_CODE_RATE_3_4, ns3::WIFI_CODE_RATE_5_6, and ns3::WIFI_CODE_RATE_UNDEFINED.
Referenced by ns3::InterferenceHelper::CalculateChunkSuccessRate(), ns3::YansErrorRateModel::GetChunkSuccessRate(), and ns3::WifiRemoteStationManager::GetControlAnswerMode().
uint32_t ns3::WifiMode::GetUid | ( | void | ) | const |
Each specific wireless mode should have a different uid. For example, the 802.11b 1Mbps and the 802.11b 2Mbps modes should have different uids.
Definition at line 369 of file wifi-mode.cc.
References m_uid.
Referenced by ns3::operator==().
std::string ns3::WifiMode::GetUniqueName | ( | void | ) | const |
Definition at line 338 of file wifi-mode.cc.
References ns3::WifiModeFactory::Get(), ns3::WifiModeFactory::GetFactory(), m_uid, and ns3::WifiModeFactory::WifiModeItem::uniqueUid.
Referenced by ns3::WifiPhy::GetPayloadDuration(), ns3::operator<<(), and ns3::WaveNetDevice::RegisterTxProfile().
bool ns3::WifiMode::IsMandatory | ( | void | ) | const |
Definition at line 346 of file wifi-mode.cc.
References ns3::WifiModeFactory::Get(), ns3::WifiModeFactory::GetFactory(), ns3::WifiModeFactory::WifiModeItem::isMandatory, and m_uid.
Referenced by ns3::WifiRemoteStationManager::GetControlAnswerMode(), ns3::ApWifiMac::GetSupportedRates(), and ns3::WifiRemoteStationManager::Reset().
|
friend |
Definition at line 181 of file wifi-mode.h.
|
private |
Definition at line 188 of file wifi-mode.h.
Referenced by GetCodeRate(), GetConstellationSize(), GetDataRate(), GetMcsValue(), GetModulationClass(), GetUid(), GetUniqueName(), and IsMandatory().