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

This class stores the subcarrier groups of all the available HE RUs. More...

#include "he-ru.h"

+ Collaboration diagram for ns3::HeRu:

Classes

class  RuSpec
 RU Specification. More...
 
struct  RuSpecCompare
 Struct providing a function call operator to compare two RUs. More...
 

Public Types

typedef std::pair< MHz_u, RuTypeBwTonesPair
 (bandwidth, number of tones) pair
 
using RuAllocationMap = std::map<uint8_t, std::vector<RuSpec>>
 RU allocation map.
 
enum  RuType {
  RU_26_TONE = 0 , RU_52_TONE , RU_106_TONE , RU_242_TONE ,
  RU_484_TONE , RU_996_TONE , RU_2x996_TONE
}
 The different HE Resource Unit (RU) types. More...
 
typedef std::vector< SubcarrierRangeSubcarrierGroup
 a vector of subcarrier ranges defining a subcarrier group
 
typedef std::map< BwTonesPair, std::vector< SubcarrierGroup > > SubcarrierGroups
 map (bandwidth, number of tones) pairs to the group of subcarrier ranges
 
typedef std::pair< int16_t, int16_t > SubcarrierRange
 (lowest index, highest index) pair defining a subcarrier range
 

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 bool DoesOverlap (MHz_u bw, RuSpec ru, const SubcarrierGroup &toneRanges, uint8_t p20Index)
 Check whether the given RU overlaps with the given tone ranges.
 
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< HeRu::RuSpecGetCentral26TonesRus (MHz_u bw, HeRu::RuType ruType)
 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 uint8_t GetEqualizedRuAllocation (RuType ruType, bool isOdd)
 Get the RU_ALLOCATION value for equal size RUs.
 
static RuType GetEqualSizedRusForStations (MHz_u bandwidth, std::size_t &nStations, std::size_t &nCentral26TonesRus)
 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 GetNRus (MHz_u bw, RuType ruType)
 Get the number of distinct RUs of the given type (number of tones) available in a HE PPDU of the given bandwidth.
 
static std::vector< HeRu::RuSpecGetRusOfType (MHz_u bw, HeRu::RuType ruType)
 Get the set of distinct RUs of the given type (number of tones) available in a HE PPDU of the given bandwidth.
 
static std::vector< RuSpecGetRuSpecs (uint8_t ruAllocation)
 Get the RU specs based on RU_ALLOCATION.
 
static RuType GetRuType (MHz_u bandwidth)
 Get the RU corresponding to the approximate bandwidth.
 
static SubcarrierGroup GetSubcarrierGroup (MHz_u bw, RuType ruType, std::size_t phyIndex)
 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 HE PPDU of the given bandwidth.
 

Static Public Attributes

static constexpr uint8_t EMPTY_242_TONE_RU = 113
 Empty 242-tone RU identifier.
 
static const RuAllocationMap m_heRuAllocations
 Table 27-26 of IEEE 802.11ax-2021.
 
static const SubcarrierGroups m_heRuSubcarrierGroups
 Subcarrier groups for all RUs (with indices being applicable to primary 80 MHz channel)
 

Detailed Description

This class stores the subcarrier groups of all the available HE RUs.

Definition at line 25 of file he-ru.h.

Member Typedef Documentation

◆ BwTonesPair

typedef std::pair<MHz_u, RuType> ns3::HeRu::BwTonesPair

(bandwidth, number of tones) pair

Definition at line 276 of file he-ru.h.

◆ RuAllocationMap

using ns3::HeRu::RuAllocationMap = std::map<uint8_t, std::vector<RuSpec>>

RU allocation map.

Definition at line 285 of file he-ru.h.

◆ SubcarrierGroup

a vector of subcarrier ranges defining a subcarrier group

Definition at line 46 of file he-ru.h.

◆ SubcarrierGroups

typedef std::map<BwTonesPair, std::vector<SubcarrierGroup> > ns3::HeRu::SubcarrierGroups

map (bandwidth, number of tones) pairs to the group of subcarrier ranges

Definition at line 279 of file he-ru.h.

◆ SubcarrierRange

typedef std::pair<int16_t, int16_t> ns3::HeRu::SubcarrierRange

(lowest index, highest index) pair defining a subcarrier range

Definition at line 43 of file he-ru.h.

Member Enumeration Documentation

◆ RuType

The different HE Resource Unit (RU) types.

Enumerator
RU_26_TONE 
RU_52_TONE 
RU_106_TONE 
RU_242_TONE 
RU_484_TONE 
RU_996_TONE 
RU_2x996_TONE 

Definition at line 31 of file he-ru.h.

Member Function Documentation

◆ DoesOverlap() [1/2]

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

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

Note that for channel width of 160 MHz the returned range is relative to the 160 MHz channel (i.e. -1012 to 1012).

Parameters
bwthe bandwidth of the HE PPDU (20, 40, 80, 160)
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 619 of file he-ru.cc.

References ns3::HeRu::RuSpec::GetIndex(), ns3::HeRu::RuSpec::GetPrimary80MHz(), ns3::HeRu::RuSpec::GetRuType(), GetSubcarrierGroup(), and RU_2x996_TONE.

Referenced by FindOverlappingRu(), and ns3::CtrlTriggerHeader::IsValid().

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

◆ DoesOverlap() [2/2]

bool ns3::HeRu::DoesOverlap ( MHz_u bw,
RuSpec ru,
const SubcarrierGroup & toneRanges,
uint8_t p20Index )
static

Check whether the given RU overlaps with the given tone ranges.

Note that for channel width of 160 MHz the returned range is relative to the 160 MHz channel (i.e. -1012 to 1012).

Parameters
bwthe bandwidth of the HE PPDU (20, 40, 80, 160)
ruthe given RU allocation
toneRangesthe given set of tone ranges
p20Indexthe index of the primary20 channel
Returns
true if the given RU overlaps with the given set of tone ranges.

Definition at line 655 of file he-ru.cc.

References ns3::HeRu::RuSpec::GetPhyIndex(), ns3::HeRu::RuSpec::GetRuType(), GetSubcarrierGroup(), and RU_2x996_TONE.

+ Here is the call graph for this function:

◆ FindOverlappingRu()

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

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

Note that an assert is generated if the RU allocation is not found.

Parameters
bwthe bandwidth of the HE PPDU (20, 40, 80, 160)
referenceRuthe reference RU allocation
searchedRuTypethe searched RU type
Returns
the searched RU allocation.

Definition at line 678 of file he-ru.cc.

References DoesOverlap(), GetNRus(), ns3::HeRu::RuSpec::GetPrimary80MHz(), NS_ABORT_MSG, and RU_2x996_TONE.

Referenced by ns3::HePhy::GetCenterFrequenciesForNonHePart(), and ns3::HePhy::GetNonOfdmaBand().

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

◆ GetBandwidth()

MHz_u ns3::HeRu::GetBandwidth ( RuType ruType)
static

Get the approximate bandwidth occupied by a RU.

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

Definition at line 756 of file he-ru.cc.

References NS_ABORT_MSG, RU_106_TONE, RU_242_TONE, RU_26_TONE, RU_2x996_TONE, RU_484_TONE, RU_52_TONE, and RU_996_TONE.

Referenced by TxDurationTest::CheckMuTxDuration(), ns3::WifiPhyOperatingChannel::Get20MHzIndicesCoveringRu(), ns3::HePhy::GetChannelWidthAndBand(), ns3::EhtPhy::GetDataRateFromTxVector(), ns3::HePhy::GetDataRateFromTxVector(), ns3::HePhy::GetNonOfdmaWidth(), ns3::EhtPhy::GetPhyRateFromTxVector(), ns3::HePhy::GetPhyRateFromTxVector(), ns3::HePhy::GetTxPowerSpectralDensity(), TestMultipleHeTbPreambles::RxHeTbPpdu(), and ns3::HePpdu::SetHeMuUserInfos().

+ Here is the caller graph for this function:

◆ GetCentral26TonesRus()

std::vector< HeRu::RuSpec > ns3::HeRu::GetCentral26TonesRus ( MHz_u bw,
HeRu::RuType ruType )
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 HE PPDU (20, 40, 80, 160)
ruTypethe RU type (number of tones)
Returns
the set of 26-tone RUs that can be additionally allocated

Definition at line 534 of file he-ru.cc.

References RU_106_TONE, RU_242_TONE, RU_26_TONE, RU_484_TONE, and RU_52_TONE.

◆ GetEqualizedRuAllocation()

uint8_t ns3::HeRu::GetEqualizedRuAllocation ( RuType ruType,
bool isOdd )
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
Returns
RU_ALLOCATION value

Definition at line 414 of file he-ru.cc.

References RU_106_TONE, RU_242_TONE, RU_26_TONE, RU_484_TONE, and RU_52_TONE.

Referenced by WifiPrimaryChannelsTest::SendDlMuPpdu().

+ Here is the caller graph for this function:

◆ GetEqualSizedRusForStations()

HeRu::RuType ns3::HeRu::GetEqualSizedRusForStations ( MHz_u bandwidth,
std::size_t & nStations,
std::size_t & nCentral26TonesRus )
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
[out]nCentral26TonesRusthe number of additional 26-tone RUs that can be allocated if the returned RU size is greater than 26 tones
Returns
the RU type

Definition at line 806 of file he-ru.cc.

References m_heRuSubcarrierGroups, NS_ABORT_IF, RU_106_TONE, RU_242_TONE, RU_2x996_TONE, RU_484_TONE, and RU_52_TONE.

Referenced by ns3::RrMultiUserScheduler::GetTxVectorForUlMu(), and ns3::RrMultiUserScheduler::TrySendingDlMuPpdu().

+ Here is the caller graph for this function:

◆ GetNRus()

std::size_t ns3::HeRu::GetNRus ( MHz_u bw,
RuType ruType )
static

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

Parameters
bwthe bandwidth of the HE PPDU (20, 40, 80, 160)
ruTypethe RU type (number of tones)
Returns
the number of distinct RUs available

Definition at line 484 of file he-ru.cc.

References m_heRuSubcarrierGroups, and RU_2x996_TONE.

Referenced by WifiPrimaryChannelsTest::DoRun(), FindOverlappingRu(), ns3::WifiPhyOperatingChannel::Get20MHzIndicesCoveringRu(), ns3::SpectrumWifiPhy::GetHeRuBands(), ns3::HeRu::RuSpec::GetPhyIndex(), and GetSubcarrierGroup().

+ Here is the caller graph for this function:

◆ GetRusOfType()

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

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

Parameters
bwthe bandwidth of the HE PPDU (20, 40, 80, 160)
ruTypethe RU type (number of tones)
Returns
the set of distinct RUs available

Definition at line 504 of file he-ru.cc.

References m_heRuSubcarrierGroups, NS_ASSERT, and RU_2x996_TONE.

Referenced by ns3::HePpdu::SetHeMuUserInfos().

+ Here is the caller graph for this function:

◆ GetRuSpecs()

std::vector< HeRu::RuSpec > ns3::HeRu::GetRuSpecs ( uint8_t ruAllocation)
static

Get the RU specs based on RU_ALLOCATION.

Parameters
ruAllocation8 bit RU_ALLOCATION value
Returns
RU spec associated with the RU_ALLOCATION

Definition at line 382 of file he-ru.cc.

References m_heRuAllocations, and NS_FATAL_ERROR.

Referenced by ns3::HePpdu::SetHeMuUserInfos().

+ Here is the caller graph for this function:

◆ GetRuType()

HeRu::RuType ns3::HeRu::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 781 of file he-ru.cc.

References NS_ABORT_MSG, RU_106_TONE, RU_242_TONE, RU_26_TONE, RU_2x996_TONE, RU_484_TONE, RU_52_TONE, and RU_996_TONE.

Referenced by ns3::HePhy::GetCenterFrequenciesForNonHePart(), ns3::HePhy::GetNonOfdmaBand(), ns3::WifiPhyHelper::GetRadiotapHeader(), TestUlMuMimoPhyTransmission::GetTxVectorForHeTbPpdu(), TestDlMuMimoPhyTransmission::SendMuPpdu(), and TestUlMuMimoPhyTransmission::SetTrigVector().

+ Here is the caller graph for this function:

◆ GetSubcarrierGroup()

HeRu::SubcarrierGroup ns3::HeRu::GetSubcarrierGroup ( MHz_u bw,
RuType ruType,
std::size_t phyIndex )
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 HE 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. Note that for channel width of 160 MHz the returned range is relative to the 160 MHz channel (i.e. -1012 to 1012). The PHY index parameter is used to distinguish between lower and higher 80 MHz subchannels.

Parameters
bwthe bandwidth of the HE PPDU (20, 40, 80, 160)
ruTypethe RU type (number of tones)
phyIndexthe PHY index (starting at 1) of the RU
Returns
the subcarrier range of the specified RU

Definition at line 580 of file he-ru.cc.

References GetNRus(), m_heRuSubcarrierGroups, NS_ABORT_MSG_IF, and RU_2x996_TONE.

Referenced by DoesOverlap(), DoesOverlap(), ns3::SpectrumWifiPhy::GetHeRuBands(), ns3::HePhy::GetNonOfdmaBand(), ns3::HePhy::GetRuBandForRx(), ns3::HePhy::GetRuBandForTx(), and ns3::HeRu::RuSpecCompare::operator()().

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

Member Data Documentation

◆ EMPTY_242_TONE_RU

uint8_t ns3::HeRu::EMPTY_242_TONE_RU = 113
staticconstexpr

Empty 242-tone RU identifier.

Definition at line 302 of file he-ru.h.

◆ m_heRuAllocations

const HeRu::RuAllocationMap ns3::HeRu::m_heRuAllocations
static

Table 27-26 of IEEE 802.11ax-2021.

Definition at line 288 of file he-ru.h.

Referenced by GetRuSpecs().

◆ m_heRuSubcarrierGroups

const HeRu::SubcarrierGroups ns3::HeRu::m_heRuSubcarrierGroups
static

Subcarrier groups for all RUs (with indices being applicable to primary 80 MHz channel)

Definition at line 282 of file he-ru.h.

Referenced by GetEqualSizedRusForStations(), GetNRus(), GetRusOfType(), and GetSubcarrierGroup().


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