A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::WifiRu Class Reference

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< RuSpecGetCentral26TonesRus (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< RuSpecGetRusOfType (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< RuSpecGetRuSpecs (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.
 

Detailed Description

This class handles RU variants.

Definition at line 23 of file wifi-ru.h.

Member Typedef Documentation

◆ RuSpec

variant of the RU specification

Definition at line 27 of file wifi-ru.h.

Member Function Documentation

◆ DoesOverlap()

bool ns3::WifiRu::DoesOverlap ( MHz_u bw,
RuSpec ru,
const std::vector< RuSpec > & v )
static

Check whether the given RU overlaps with the given set of RUs.

Parameters
bwthe bandwidth of the PPDU
ruthe given RU allocation
vthe given set of RUs
Returns
true if the given RU overlaps with 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().

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

◆ FindOverlappingRu()

WifiRu::RuSpec ns3::WifiRu::FindOverlappingRu ( MHz_u bw,
RuSpec referenceRu,
RuType searchedRuType )
static

Find the RU allocation of the given RU type overlapping the given reference RU allocation.

Parameters
bwthe bandwidth of the PPDU
referenceRuthe reference RU allocation
searchedRuTypethe searched RU type
Returns
the searched RU allocation.

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().

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

◆ GetBandwidth()

◆ GetCentral26TonesRus()

std::vector< WifiRu::RuSpec > ns3::WifiRu::GetCentral26TonesRus ( MHz_u bw,
RuType ruType,
WifiModulationClass mc )
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.

Parameters
bwthe bandwidth of the PPDU
ruTypethe RU type (number of tones)
mcthe modulation class of the PPDU
Returns
the set of 26-tone RUs that can be additionally allocated

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().

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

◆ GetEqualizedRuAllocation()

uint16_t ns3::WifiRu::GetEqualizedRuAllocation ( RuType ruType,
bool isOdd,
bool hasUsers,
WifiModulationClass mc )
static

Get the RU_ALLOCATION value for equal size RUs.

Parameters
ruTypeequal size RU type (generated by GetEqualSizedRusForStations)
isOddif number of stations is an odd number
hasUserswhether it contributes to User field(s) in the content channel this RU Allocation belongs to
mcthe modulation class of the PPDU
Returns
RU_ALLOCATION value

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().

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

◆ GetEqualSizedRusForStations()

RuType ns3::WifiRu::GetEqualSizedRusForStations ( MHz_u bandwidth,
std::size_t & nStations,
std::size_t & nCentral26TonesRus,
WifiModulationClass mc )
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).

Parameters
bandwidththe channel bandwidth
nStationsthe number of candidate stations. On return, it is set to the number of stations that are assigned an RU
nCentral26TonesRusthe number of additional 26-tone RUs that can be allocated if the returned RU size is greater than 26 tones
mcthe modulation class of the PPDU
Returns
the RU type

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().

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

◆ GetIndex()

std::size_t ns3::WifiRu::GetIndex ( RuSpec ru)
static

Get the index of a given RU.

Parameters
ruthe RU variant
Returns
the RU index

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().

+ Here is the caller graph for this function:

◆ GetMaxRuType()

RuType ns3::WifiRu::GetMaxRuType ( WifiModulationClass mc)
static

Get the maximum RU type supported by a given modulation class.

Parameters
mcthe modulation class
Returns
the RU type

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().

+ Here is the caller graph for this function:

◆ GetNRus()

std::size_t ns3::WifiRu::GetNRus ( MHz_u bw,
RuType ruType,
WifiModulationClass mc )
static

Get the number of distinct RUs of the given type (number of tones) available in a PPDU of the given bandwidth.

Parameters
bwthe bandwidth of the PPDU
ruTypethe RU type (number of tones)
mcthe modulation class of the PPDU
Returns
the number of distinct RUs available

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().

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

◆ GetPhyIndex()

std::size_t ns3::WifiRu::GetPhyIndex ( RuSpec ru,
MHz_u bw,
uint8_t p20Index )
static

Get the RU PHY index.

Parameters
ruthe RU variant
bwthe width of the channel of which the RU is part
p20Indexthe index of the primary20 channel
Returns
the RU PHY index

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()().

+ Here is the caller graph for this function:

◆ GetRusOfType()

std::vector< WifiRu::RuSpec > ns3::WifiRu::GetRusOfType ( MHz_u bw,
RuType ruType,
WifiModulationClass mc )
static

Get the set of distinct RUs of the given type (number of tones) available in an MU PPDU of the given bandwidth.

Parameters
bwthe bandwidth of the PPDU
ruTypethe RU type (number of tones)
mcthe modulation class of the PPDU
Returns
the set of distinct RUs available

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().

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

◆ GetRuSpecs()

std::vector< WifiRu::RuSpec > ns3::WifiRu::GetRuSpecs ( uint16_t ruAllocation,
WifiModulationClass mc )
static

Get the RU specs based on RU_ALLOCATION.

Parameters
ruAllocation9 bit RU_ALLOCATION value
mcthe modulation class of the PPDU
Returns
RU spec associated with the RU_ALLOCATION

Definition at line 156 of file wifi-ru.cc.

References ns3::EhtRu::GetRuSpecs(), ns3::HeRu::GetRuSpecs(), and ns3::WIFI_MOD_CLASS_HE.

+ Here is the call graph for this function:

◆ GetRuType() [1/2]

RuType ns3::WifiRu::GetRuType ( MHz_u bandwidth)
static

Get the RU corresponding to the approximate bandwidth.

Parameters
bandwidththe approximate bandwidth occupied by the RU
Returns
the RU type

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.

◆ GetRuType() [2/2]

◆ GetSubcarrierGroup()

SubcarrierGroup ns3::WifiRu::GetSubcarrierGroup ( MHz_u bw,
RuType ruType,
std::size_t phyIndex,
WifiModulationClass mc )
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.

Parameters
bwthe bandwidth of the PPDU
ruTypethe RU type (number of tones)
phyIndexthe PHY index (starting at 1) of the RU
mcthe modulation class of the PPDU
Returns
the subcarrier range of the specified RU

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().

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

◆ IsEht()

bool ns3::WifiRu::IsEht ( RuSpec ru)
static

Get whether a given RU variant is a EHT RU.

Parameters
ruthe RU variant
Returns
true if the RU is a EHT RU, false otherwise

Definition at line 254 of file wifi-ru.cc.

◆ IsHe()

bool ns3::WifiRu::IsHe ( RuSpec ru)
static

Get whether a given RU variant is a HE RU.

Parameters
ruthe RU variant
Returns
true if the RU is a HE RU, false otherwise

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().

+ Here is the caller graph for this function:

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