45 m_modeInitialized(false),
46 m_inactiveSubchannels(),
54 uint16_t guardInterval,
58 uint16_t channelWidth,
65 m_txPowerLevel(powerLevel),
67 m_channelWidth(channelWidth),
68 m_guardInterval(guardInterval),
72 m_aggregation(aggregation),
77 m_modeInitialized(true),
78 m_inactiveSubchannels(),
84 : m_mode(txVector.m_mode),
85 m_txPowerLevel(txVector.m_txPowerLevel),
86 m_preamble(txVector.m_preamble),
87 m_channelWidth(txVector.m_channelWidth),
88 m_guardInterval(txVector.m_guardInterval),
89 m_nTx(txVector.m_nTx),
90 m_nss(txVector.m_nss),
91 m_ness(txVector.m_ness),
92 m_aggregation(txVector.m_aggregation),
93 m_stbc(txVector.m_stbc),
94 m_ldpc(txVector.m_ldpc),
95 m_bssColor(txVector.m_bssColor),
96 m_length(txVector.m_length),
97 m_modeInitialized(txVector.m_modeInitialized),
98 m_inactiveSubchannels(txVector.m_inactiveSubchannels),
99 m_sigBMcs(txVector.m_sigBMcs),
100 m_ruAllocation(txVector.m_ruAllocation)
107 m_muUserInfos.insert(std::make_pair(info.first, info.second));
132 NS_ABORT_MSG_IF(staId > 2048,
"STA-ID should be correctly set for MU (" << staId <<
")");
148 return m_muUserInfos.begin()->second.mcs.GetModulationClass();
188 NS_ABORT_MSG_IF(staId > 2048,
"STA-ID should be correctly set for MU (" << staId <<
")");
203 nss = (nss < info.second.nss) ? info.second.nss : nss;
248 NS_ABORT_MSG_IF(staId > 2048,
"STA-ID should be correctly set for MU");
293 NS_ABORT_MSG_IF(staId > 2048,
"STA-ID should be correctly set for MU");
389 return (modeName !=
"VhtMcs9");
396 return (modeName !=
"VhtMcs6");
400 return (modeName !=
"VhtMcs9");
407 return (modeName !=
"VhtMcs9");
435 NS_ABORT_MSG_IF(staId > 2048,
"STA-ID should be correctly set for MU");
443 NS_ABORT_MSG_IF(staId > 2048,
"STA-ID should be correctly set for MU");
458 NS_ABORT_MSG_IF(staId > 2048,
"STA-ID should be correctly set for MU");
460 "Only HE (or newer) modes authorized for MU");
481std::pair<std::size_t, std::size_t>
486 NS_ASSERT_MSG(!ruAllocation.empty(),
"RU allocation is not set");
492 "RU allocation is not consistent with packet bandwidth");
494 std::pair<std::size_t ,
511 if (ruAllocation[n] >= 208)
528 "Only HE (or later) authorized for preamble puncturing");
531 "Preamble puncturing only possible for transmission bandwidth of 80 MHz or larger");
534 "The size of the inactive subchannnels bitmap should be equal to the number of "
535 "20 MHz subchannels");
539const std::vector<bool>&
550 os <<
"TXVECTOR not valid";
557 <<
" FEC coding: " << (v.
IsLdpc() ?
"LDPC" :
"BCC");
569 os <<
" num User Infos: " << userInfoMap.size();
570 for (
auto& ui : userInfoMap)
572 os <<
", {STA-ID: " << ui.first <<
", " << ui.second.ru <<
", MCS: " << ui.second.mcs
573 <<
", Nss: " << +ui.second.nss <<
"}";
581 if (!puncturedSubchannels.empty())
583 os <<
" Punctured subchannels: ";
584 std::copy(puncturedSubchannels.cbegin(),
585 puncturedSubchannels.cend(),
586 std::ostream_iterator<bool>(os,
", "));
600 return !(*
this == other);
610 channelAlloc.emplace_back();
615 auto ruType = userInfo.ru.GetRuType();
616 auto ruIdx = userInfo.ru.GetIndex();
620 channelAlloc[0].push_back(staId);
621 channelAlloc[1].push_back(staId);
631 if (((ruIdx - 1) / numRus) % 2 == 0)
633 channelAlloc[0].push_back(staId);
637 channelAlloc[1].push_back(staId);
648 return userInfo.second.ru.GetRuType() == m_muUserInfos.cbegin()->second.ru.GetRuType();
651 std::vector<HeRu::RuType> ruTypes{};
652 ruTypes.resize(ruAllocations.size());
655 const auto ruType = it->second.ru.GetRuType();
657 const auto isPrimary80MHz = it->second.ru.GetPrimary80MHz();
659 auto ruIndex = it->second.ru.GetIndex();
665 if ((!isPrimary80MHz) && (ruIndex > 19))
679 (ruBw < 20) ? ((ruIndex - 1) / rusPerSubchannel.size()) : ((ruIndex - 1) * (ruBw / 20));
680 const auto numSubchannelsForRu = (ruBw < 20) ? 1 : (ruBw / 20);
685 if (ruType == ruTypes.at(index))
702 for (
auto i = 0; i < numSubchannelsForRu; ++i)
704 ruTypes.at(index + i) = ruType;
705 ruAllocations.at(index + i) = ruAlloc;
708 return ruAllocations;
static std::vector< RuSpec > GetRuSpecs(uint8_t ruAllocation)
Get the RU specs based on RU_ALLOCATION.
static uint16_t GetBandwidth(RuType ruType)
Get the approximate bandwidth occupied by a RU.
static constexpr uint8_t EMPTY_242_TONE_RU
Empty 242-tone RU identifier.
static std::vector< HeRu::RuSpec > GetRusOfType(uint16_t 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 b...
static const SubcarrierGroups m_heRuSubcarrierGroups
Subcarrier groups for all RUs (with indices being applicable to primary 80 MHz channel)
static uint8_t GetEqualizedRuAllocation(RuType ruType, bool isOdd)
Get the RU_ALLOCATION value for equal size RUs.
represent a single transmission mode
std::string GetUniqueName() const
WifiModulationClass GetModulationClass() const
uint8_t GetMcsValue() const
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
uint16_t m_channelWidth
channel width in MHz
void SetStbc(bool stbc)
Sets if STBC is being used.
void SetNess(uint8_t ness)
Sets the Ness number.
bool m_aggregation
Flag whether the PSDU contains A-MPDU.
const RuAllocation & GetRuAllocation() const
Get RU Allocation of SIG-B.
uint16_t GetGuardInterval() const
void SetTxPowerLevel(uint8_t powerlevel)
Sets the selected transmission power level.
bool IsValid() const
The standard disallows certain combinations of WifiMode, number of spatial streams,...
void SetLdpc(bool ldpc)
Sets if LDPC FEC coding is being used.
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
uint8_t GetBssColor() const
Get the BSS color.
bool GetModeInitialized() const
std::vector< bool > m_inactiveSubchannels
Bitmap of inactive subchannels used for preamble puncturing.
WifiMode m_mode
The DATARATE parameter in Table 15-4.
std::map< uint16_t, HeMuUserInfo > HeMuUserInfoMap
map of HE MU specific user info paramters indexed by STA-ID
void SetGuardInterval(uint16_t guardInterval)
Sets the guard interval duration (in nanoseconds)
WifiMode GetMode(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the selected payload transmission mode.
RuAllocation m_ruAllocation
RU allocations that are going to be carried in SIG-B common field per Table 27-1 IEEE.
void SetInactiveSubchannels(const std::vector< bool > &inactiveSubchannels)
Set the 20 MHz subchannels that are punctured.
bool IsStbc() const
Check if STBC is used or not.
void SetHeMuUserInfo(uint16_t staId, HeMuUserInfo userInfo)
Set the HE MU user-specific transmission information for the given STA-ID.
WifiPreamble GetPreambleType() const
HeMuUserInfo GetHeMuUserInfo(uint16_t staId) const
Get the HE MU user-specific transmission information for the given STA-ID.
uint8_t m_nTx
number of TX antennas
void SetAggregation(bool aggregation)
Sets if PSDU contains A-MPDU.
HeRu::RuSpec GetRu(uint16_t staId) const
Get the RU specification for the STA-ID.
HeMuUserInfoMap m_muUserInfos
HE MU specific per-user information indexed by station ID (STA-ID) corresponding to the 11 LSBs of th...
uint8_t m_txPowerLevel
The TXPWR_LEVEL parameter in Table 15-4.
bool m_ldpc
LDPC FEC coding if true, BCC otherwise.
uint16_t GetLength() const
Get the LENGTH field of the L-SIG.
uint16_t m_guardInterval
guard interval duration in nanoseconds
bool IsDlMu() const
Return true if this TX vector is used for a downlink multi-user transmission.
bool m_stbc
STBC used or not.
uint8_t m_nss
number of spatial streams
void SetRuAllocation(const RuAllocation &ruAlloc)
Set RU Allocation of SIG-B common field.
const HeMuUserInfoMap & GetHeMuUserInfoMap() const
Get a const reference to the map HE MU user-specific transmission information indexed by STA-ID.
void SetRu(HeRu::RuSpec ru, uint16_t staId)
Set the RU specification for the STA-ID.
RuAllocation DeriveRuAllocation() const
Derive the RU allocation from the TXVECTOR for which its RU allocation has not been set yet.
ContentChannelAllocation GetContentChannelAllocation() const
Get the HE SIG-B content channel STA ID allocation IEEE 802.11ax-2021 27.3.11.8.2 HE-SIG-B content ch...
WifiModulationClass GetModulationClass() const
Get the modulation class specified by this TXVECTOR.
uint8_t GetNss(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the number of spatial streams.
void SetLength(uint16_t length)
Set the LENGTH field of the L-SIG.
uint8_t GetNssMax() const
bool IsUlMu() const
Return true if this TX vector is used for an uplink multi-user transmission.
void SetSigBMode(const WifiMode &mode)
Set the MCS used for SIG-B.
bool IsMu() const
Return true if this TX vector is used for a multi-user transmission.
uint16_t m_length
LENGTH field of the L-SIG.
uint8_t m_bssColor
BSS color.
std::pair< std::size_t, std::size_t > GetNumRusPerHeSigBContentChannel() const
Get the number of RUs per HE-SIG-B content channel.
WifiMode m_sigBMcs
MCS_SIG_B per Table 27-1 IEEE 802.11ax-2021.
void SetBssColor(uint8_t color)
Set the BSS color.
bool IsLdpc() const
Check if LDPC FEC coding is used or not.
void SetNTx(uint8_t nTx)
Sets the number of TX antennas.
uint8_t GetTxPowerLevel() const
bool IsAggregation() const
Checks whether the PSDU contains A-MPDU.
uint16_t GetChannelWidth() const
WifiPreamble m_preamble
preamble
bool m_modeInitialized
Internal initialization flag.
uint8_t m_ness
number of spatial streams in beamforming
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
WifiMode GetSigBMode() const
Get MCS used for SIG-B.
void SetNss(uint8_t nss)
Sets the number of Nss.
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
const std::vector< bool > & GetInactiveSubchannels() const
Get the 20 MHz subchannels that are punctured.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
#define NS_ABORT_IF(cond)
Abnormal program termination if a condition is true.
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
WifiModulationClass
This enumeration defines the modulation classes per (Table 10-6 "Modulation classes"; IEEE 802....
@ WIFI_MOD_CLASS_HE
HE (Clause 27)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)
std::vector< std::vector< uint16_t > > ContentChannelAllocation
HE SIG-B Content Channels STA ID Allocation.
bool IsMu(WifiPreamble preamble)
Return true if a preamble corresponds to a multi-user transmission.
std::vector< uint8_t > RuAllocation
8 bit RU_ALLOCATION per 20 MHz
bool IsDlMu(WifiPreamble preamble)
Return true if a preamble corresponds to a downlink multi-user transmission.
bool IsUlMu(WifiPreamble preamble)
Return true if a preamble corresponds to a uplink multi-user transmission.
HE MU specific user transmission parameters.
HeRu::RuSpec ru
RU specification.
uint8_t nss
number of spatial streams
bool operator!=(const HeMuUserInfo &other) const
Compare this user info to the given user info.
bool operator==(const HeMuUserInfo &other) const
Compare this user info to the given user info.
Declaration of the following enums: