This class handles RU variants. More...
#include "wifi-ru.h"
Classes | |
struct | RuSpecCompare |
Struct providing a function call operator to compare two RUs. More... | |
Public Types | |
using | RuSpec = std::variant<HeRu::RuSpec, EhtRu::RuSpec> |
variant of the RU specification | |
Static Public Member Functions | |
static bool | DoesOverlap (MHz_u bw, RuSpec ru, const std::vector< RuSpec > &v) |
Check whether the given RU overlaps with the given set of RUs. | |
static RuSpec | FindOverlappingRu (MHz_u bw, RuSpec referenceRu, RuType searchedRuType) |
Find the RU allocation of the given RU type overlapping the given reference RU allocation. | |
static MHz_u | GetBandwidth (RuType ruType) |
Get the approximate bandwidth occupied by a RU. | |
static std::vector< RuSpec > | GetCentral26TonesRus (MHz_u bw, RuType ruType, WifiModulationClass mc) |
Get the set of 26-tone RUs that can be additionally allocated if the given bandwidth is split in RUs of the given type. | |
static uint16_t | GetEqualizedRuAllocation (RuType ruType, bool isOdd, bool hasUsers, WifiModulationClass mc) |
Get the RU_ALLOCATION value for equal size RUs. | |
static RuType | GetEqualSizedRusForStations (MHz_u bandwidth, std::size_t &nStations, std::size_t &nCentral26TonesRus, WifiModulationClass mc) |
Given the channel bandwidth and the number of stations candidate for being assigned an RU, maximize the number of candidate stations that can be assigned an RU subject to the constraint that all the stations must be assigned an RU of the same size (in terms of number of tones). | |
static std::size_t | GetIndex (RuSpec ru) |
Get the index of a given RU. | |
static RuType | GetMaxRuType (WifiModulationClass mc) |
Get the maximum RU type supported by a given modulation class. | |
static std::size_t | GetNRus (MHz_u bw, RuType ruType, WifiModulationClass mc) |
Get the number of distinct RUs of the given type (number of tones) available in a PPDU of the given bandwidth. | |
static std::size_t | GetPhyIndex (RuSpec ru, MHz_u bw, uint8_t p20Index) |
Get the RU PHY index. | |
static std::vector< RuSpec > | GetRusOfType (MHz_u bw, RuType ruType, WifiModulationClass mc) |
Get the set of distinct RUs of the given type (number of tones) available in an MU PPDU of the given bandwidth. | |
static std::vector< RuSpec > | GetRuSpecs (uint16_t ruAllocation, WifiModulationClass mc) |
Get the RU specs based on RU_ALLOCATION. | |
static RuType | GetRuType (MHz_u bandwidth) |
Get the RU corresponding to the approximate bandwidth. | |
static RuType | GetRuType (RuSpec ru) |
Get the type of a given RU. | |
static SubcarrierGroup | GetSubcarrierGroup (MHz_u bw, RuType ruType, std::size_t phyIndex, WifiModulationClass mc) |
Get the subcarrier group of the RU having the given PHY index among all the RUs of the given type (number of tones) available in a PPDU of the given bandwidth. | |
static bool | IsEht (RuSpec ru) |
Get whether a given RU variant is a EHT RU. | |
static bool | IsHe (RuSpec ru) |
Get whether a given RU variant is a HE RU. | |
using ns3::WifiRu::RuSpec = std::variant<HeRu::RuSpec, EhtRu::RuSpec> |
Check whether the given RU overlaps with the given set of RUs.
bw | the bandwidth of the PPDU |
ru | the given RU allocation |
v | the given set of RUs |
Definition at line 207 of file wifi-ru.cc.
References ns3::EhtRu::DoesOverlap(), ns3::HeRu::DoesOverlap(), and IsHe().
Referenced by ns3::CtrlTriggerHeader::IsValid(), and WifiRuOverlappingTest::RunOne().
|
static |
Find the RU allocation of the given RU type overlapping the given reference RU allocation.
bw | the bandwidth of the PPDU |
referenceRu | the reference RU allocation |
searchedRuType | the searched RU type |
Definition at line 226 of file wifi-ru.cc.
References ns3::EhtRu::FindOverlappingRu(), ns3::HeRu::FindOverlappingRu(), and IsHe().
Referenced by ns3::HePhy::GetCenterFrequenciesForNonHePart(), and OfdmaTestHePhy::GetNonOfdmaBand().
Get the approximate bandwidth occupied by a RU.
ruType | the RU type |
Definition at line 78 of file wifi-ru.cc.
References NS_ABORT_MSG, ns3::RU_106_TONE, ns3::RU_242_TONE, ns3::RU_26_TONE, ns3::RU_2x996_TONE, ns3::RU_484_TONE, ns3::RU_4x996_TONE, ns3::RU_52_TONE, and ns3::RU_996_TONE.
Referenced by TxDurationTest::CheckMuTxDuration(), ns3::WifiTxVector::DeriveRuAllocation(), ns3::EhtRu::DoesOverlap(), ns3::HePhy::GetChannelWidthAndBand(), ns3::EhtPhy::GetDataRateFromTxVector(), ns3::HePhy::GetDataRateFromTxVector(), ns3::EhtRu::GetEqualSizedRusForStations(), ns3::EhtRu::GetIndexIn80MHzSegment(), ns3::HeRu::GetIndexIn80MHzSegment(), ns3::HePhy::GetNonOfdmaWidth(), ns3::EhtRu::GetNRus(), ns3::EhtPhy::GetPhyRateFromTxVector(), ns3::HePhy::GetPhyRateFromTxVector(), ns3::EhtRu::GetPrimaryFlags(), ns3::EhtRu::GetRusOfType(), ns3::HePpdu::GetRuSpec(), ns3::HePhy::GetTxPowerSpectralDensity(), and TestMultipleHeTbPreambles::RxHeTbPpdu().
|
static |
Get the set of 26-tone RUs that can be additionally allocated if the given bandwidth is split in RUs of the given type.
bw | the bandwidth of the PPDU |
ruType | the RU type (number of tones) |
mc | the modulation class of the PPDU |
Definition at line 190 of file wifi-ru.cc.
References ns3::EhtRu::GetCentral26TonesRus(), ns3::HeRu::GetCentral26TonesRus(), and ns3::WIFI_MOD_CLASS_HE.
Referenced by WifiCentral26TonesRusInChannelTest::RunOne().
|
static |
Get the RU_ALLOCATION value for equal size RUs.
ruType | equal size RU type (generated by GetEqualSizedRusForStations) |
isOdd | if number of stations is an odd number |
hasUsers | whether it contributes to User field(s) in the content channel this RU Allocation belongs to |
mc | the modulation class of the PPDU |
Definition at line 149 of file wifi-ru.cc.
References ns3::EhtRu::GetEqualizedRuAllocation(), ns3::HeRu::GetEqualizedRuAllocation(), and ns3::WIFI_MOD_CLASS_HE.
Referenced by ns3::WifiTxVector::DeriveRuAllocation().
|
static |
Given the channel bandwidth and the number of stations candidate for being assigned an RU, maximize the number of candidate stations that can be assigned an RU subject to the constraint that all the stations must be assigned an RU of the same size (in terms of number of tones).
bandwidth | the channel bandwidth |
nStations | the number of candidate stations. On return, it is set to the number of stations that are assigned an RU |
nCentral26TonesRus | the number of additional 26-tone RUs that can be allocated if the returned RU size is greater than 26 tones |
mc | the modulation class of the PPDU |
Definition at line 237 of file wifi-ru.cc.
References ns3::EhtRu::GetEqualSizedRusForStations(), ns3::HeRu::GetEqualSizedRusForStations(), and ns3::WIFI_MOD_CLASS_HE.
Referenced by ns3::RrMultiUserScheduler::GetTxVectorForUlMu(), WifiEqualSizedRusTest::RunOne(), and ns3::RrMultiUserScheduler::TrySendingDlMuPpdu().
|
static |
Get the index of a given RU.
ru | the RU variant |
Definition at line 51 of file wifi-ru.cc.
Referenced by ns3::WifiTxVector::DeriveCenter26ToneRuIndication(), ns3::HePhy::GetNonOfdmaWidth(), ns3::WifiPhyHelper::GetRadiotapHeader(), ns3::HePpdu::GetRuSpec(), and ns3::CtrlTriggerUserInfoField::SetRuAllocation().
|
static |
Get the maximum RU type supported by a given modulation class.
mc | the modulation class |
Definition at line 63 of file wifi-ru.cc.
References NS_ABORT_MSG, ns3::RU_2x996_TONE, ns3::RU_4x996_TONE, ns3::RU_TYPE_MAX, ns3::WIFI_MOD_CLASS_EHT, and ns3::WIFI_MOD_CLASS_HE.
Referenced by GetNRus(), and ns3::SpectrumWifiPhy::GetRuBands().
|
static |
Get the number of distinct RUs of the given type (number of tones) available in a PPDU of the given bandwidth.
bw | the bandwidth of the PPDU |
ruType | the RU type (number of tones) |
mc | the modulation class of the PPDU |
Definition at line 132 of file wifi-ru.cc.
References GetMaxRuType(), ns3::EhtRu::GetNRus(), ns3::HeRu::GetNRus(), and ns3::WIFI_MOD_CLASS_HE.
Referenced by ns3::SpectrumWifiPhy::GetRuBands(), and WifiNumRusInChannelTest::RunOne().
Get the RU PHY index.
ru | the RU variant |
bw | the width of the channel of which the RU is part |
p20Index | the index of the primary20 channel |
Definition at line 57 of file wifi-ru.cc.
Referenced by ns3::WifiTxVector::DeriveRuAllocation(), ns3::HePhy::GetCenterFrequenciesForNonHePart(), OfdmaTestHePhy::GetNonOfdmaBand(), ns3::HePhy::GetRuBandForRx(), ns3::HePhy::GetRuBandForTx(), ns3::SpectrumWifiPhy::GetRuBands(), and ns3::WifiRu::RuSpecCompare::operator()().
|
static |
Get the set of distinct RUs of the given type (number of tones) available in an MU PPDU of the given bandwidth.
bw | the bandwidth of the PPDU |
ruType | the RU type (number of tones) |
mc | the modulation class of the PPDU |
Definition at line 173 of file wifi-ru.cc.
References ns3::EhtRu::GetRusOfType(), ns3::HeRu::GetRusOfType(), and ns3::WIFI_MOD_CLASS_HE.
Referenced by ns3::WifiTxVector::DeriveRuAllocation(), and WifiRusOfTypeInChannelTest::RunOne().
|
static |
Get the RU specs based on RU_ALLOCATION.
ruAllocation | 9 bit RU_ALLOCATION value |
mc | the modulation class of the PPDU |
Definition at line 156 of file wifi-ru.cc.
References ns3::EhtRu::GetRuSpecs(), ns3::HeRu::GetRuSpecs(), and ns3::WIFI_MOD_CLASS_HE.
Get the RU corresponding to the approximate bandwidth.
bandwidth | the approximate bandwidth occupied by the RU |
Definition at line 105 of file wifi-ru.cc.
References NS_ABORT_MSG, ns3::RU_106_TONE, ns3::RU_242_TONE, ns3::RU_26_TONE, ns3::RU_2x996_TONE, ns3::RU_484_TONE, ns3::RU_4x996_TONE, ns3::RU_52_TONE, ns3::RU_996_TONE, and ns3::RU_TYPE_MAX.
Get the type of a given RU.
ru | the RU variant |
Definition at line 45 of file wifi-ru.cc.
Referenced by TxDurationTest::CheckMuTxDuration(), ns3::WifiTxVector::DeriveCenter26ToneRuIndication(), ns3::WifiTxVector::DeriveRuAllocation(), ns3::HePhy::GetCenterFrequenciesForNonHePart(), ns3::HePhy::GetChannelWidthAndBand(), ns3::EhtPhy::GetDataRateFromTxVector(), ns3::HePhy::GetDataRateFromTxVector(), OfdmaTestHePhy::GetNonOfdmaBand(), ns3::HePhy::GetNonOfdmaWidth(), ns3::EhtPhy::GetPhyRateFromTxVector(), ns3::HePhy::GetPhyRateFromTxVector(), ns3::WifiPhyHelper::GetRadiotapHeader(), ns3::HePhy::GetRuBandForRx(), ns3::HePhy::GetRuBandForTx(), ns3::HePhy::GetTxPowerSpectralDensity(), TestUlMuMimoPhyTransmission::GetTxVectorForHeTbPpdu(), ns3::WifiTxVector::IsSigBCompression(), ns3::WifiRu::RuSpecCompare::operator()(), TestMultipleHeTbPreambles::RxHeTbPpdu(), TestDlMuMimoPhyTransmission::SendMuPpdu(), ns3::CtrlTriggerUserInfoField::SetRuAllocation(), TestUlMuMimoPhyTransmission::SetTrigVector(), and ns3::EhtPpdu::SetTxVectorFromPhyHeaders().
|
static |
Get the subcarrier group of the RU having the given PHY index among all the RUs of the given type (number of tones) available in a PPDU of the given bandwidth.
A subcarrier group is defined as one or more pairs indicating the lowest frequency index and the highest frequency index.
bw | the bandwidth of the PPDU |
ruType | the RU type (number of tones) |
phyIndex | the PHY index (starting at 1) of the RU |
mc | the modulation class of the PPDU |
Definition at line 142 of file wifi-ru.cc.
References ns3::EhtRu::GetSubcarrierGroup(), ns3::HeRu::GetSubcarrierGroup(), and ns3::WIFI_MOD_CLASS_HE.
Referenced by ns3::HePhy::GetRuBandForRx(), ns3::HePhy::GetRuBandForTx(), ns3::SpectrumWifiPhy::GetRuBands(), ns3::WifiRu::RuSpecCompare::operator()(), and WifiSubcarrierGroupsTest::RunOne().
|
static |
Get whether a given RU variant is a EHT RU.
ru | the RU variant |
Definition at line 254 of file wifi-ru.cc.
|
static |
Get whether a given RU variant is a HE RU.
ru | the RU variant |
Definition at line 248 of file wifi-ru.cc.
Referenced by ns3::WifiTxVector::DeriveCenter26ToneRuIndication(), ns3::WifiTxVector::DeriveRuAllocation(), DoesOverlap(), FindOverlappingRu(), ns3::WifiPhyHelper::GetRadiotapHeader(), ns3::WifiRu::RuSpecCompare::operator()(), and ns3::CtrlTriggerUserInfoField::SetRuAllocation().