31 start.WriteHtolsbU16(val);
72 (
static_cast<uint64_t
>(
maxNc) << 36) |
90 start.WriteHtolsbU64(val1);
124 maxNc = (val1 >> 36) & 0x000f;
158 size += ehtMcsAndNssSet.second.size();
169 for (
const auto&
byte : ehtMcsAndNssSet.second)
179 uint8_t heSupportedChannelWidthSet,
180 bool support320MhzIn6Ghz)
185 std::vector<uint8_t> bytes;
188 if ((heSupportedChannelWidthSet & 0x01) == 0)
191 for (std::size_t j = 0; j < 4; ++j)
193 uint8_t
byte = i.
ReadU8();
194 bytes.push_back(
byte);
202 for (std::size_t j = 0; j < 3; ++j)
204 uint8_t
byte = i.
ReadU8();
205 bytes.push_back(
byte);
213 if ((heSupportedChannelWidthSet & 0x0e) == 0)
216 for (std::size_t j = 0; j < 4; ++j)
218 uint8_t
byte = i.
ReadU8();
219 bytes.push_back(
byte);
224 if ((heSupportedChannelWidthSet & 0x02) != 0)
227 for (std::size_t j = 0; j < 3; ++j)
229 uint8_t
byte = i.
ReadU8();
230 bytes.push_back(
byte);
235 if ((heSupportedChannelWidthSet & 0x04) != 0)
238 for (std::size_t j = 0; j < 3; ++j)
240 uint8_t
byte = i.
ReadU8();
241 bytes.push_back(
byte);
246 if (support320MhzIn6Ghz)
249 for (std::size_t j = 0; j < 3; ++j)
251 uint8_t
byte = i.
ReadU8();
252 bytes.push_back(
byte);
265 const uint64_t nBitsNoPadding = 4 + 5 + (6 * numBitsSet * (
nssPe + 1));
266 return std::ceil(
static_cast<double>(nBitsNoPadding) / 8.0);
272 uint64_t nBitsNoPadding = 0;
278 uint8_t bitsPerPpet = 3;
281 uint8_t offset = nBitsNoPadding % 8;
282 uint8_t bitsLeft = (8 - offset);
283 uint8_t bitMask = (0x01 << bitsLeft) - 0x01;
284 val |= (info.ppetMax & bitMask) << offset;
285 nBitsNoPadding += std::min(bitsLeft, bitsPerPpet);
286 if (nBitsNoPadding % 8 == 0)
291 const uint8_t remainingBits = (3 - bitsLeft);
292 bitMask = (0x01 << remainingBits) - 0x01;
293 val = (info.ppetMax >> bitsLeft) & bitMask;
294 nBitsNoPadding += remainingBits;
301 offset = nBitsNoPadding % 8;
302 bitsLeft = (8 - offset);
303 bitMask = (0x01 << bitsLeft) - 0x01;
304 val |= (info.ppet8 & bitMask) << offset;
305 nBitsNoPadding += std::min(bitsLeft, bitsPerPpet);
306 if (nBitsNoPadding % 8 == 0)
311 const uint8_t remainingBits = (3 - bitsLeft);
312 bitMask = (0x01 << remainingBits) - 0x01;
313 val = (info.ppet8 >> bitsLeft) & bitMask;
314 nBitsNoPadding += remainingBits;
322 if (nBitsNoPadding % 8 > 0)
332 uint64_t nBitsNoPadding = 0;
341 const uint64_t bitsToDeserialize = (4 + 5 + (6 * numBitsSet * (
nssPe + 1)));
342 uint8_t bitsPerPpet = 3;
343 while (nBitsNoPadding < bitsToDeserialize)
346 uint8_t offset = nBitsNoPadding % 8;
347 uint8_t bitsLeft = (8 - offset);
348 uint8_t bitMask = (1 << bitsLeft) - 1;
349 info.
ppetMax = ((val >> offset) & bitMask);
350 nBitsNoPadding += std::min(bitsLeft, bitsPerPpet);
351 if (nBitsNoPadding % 8 == 0)
356 const uint8_t remainingBits = (3 - bitsLeft);
357 bitMask = (1 << remainingBits) - 1;
358 info.
ppetMax |= ((val & bitMask) << bitsLeft);
359 nBitsNoPadding += remainingBits;
362 offset = nBitsNoPadding % 8;
363 bitsLeft = (8 - offset);
364 bitMask = (1 << bitsLeft) - 1;
365 info.
ppet8 = ((val >> offset) & bitMask);
366 nBitsNoPadding += std::min(bitsLeft, bitsPerPpet);
367 if (nBitsNoPadding % 8 == 0)
372 const uint8_t remainingBits = (3 - bitsLeft);
373 bitMask = (1 << remainingBits) - 1;
374 info.
ppet8 |= ((val & bitMask) << bitsLeft);
375 nBitsNoPadding += remainingBits;
380 return std::ceil(
static_cast<double>(bitsToDeserialize) / 8.0);
384 : m_macCapabilities{},
386 m_supportedEhtMcsAndNssSet{},
389 m_heCapabilities{
std::nullopt}
394 : m_macCapabilities{},
396 m_supportedEhtMcsAndNssSet{},
398 m_is2_4Ghz{is2_4Ghz},
399 m_heCapabilities{heCapabilities}
418 os <<
"EHT Capabilities=";
473 for (uint8_t i = 0; i <= 1; i++)
475 if ((1UL << (23 + i)) - 1 == maxAmpduLength)
496 NS_ASSERT_MSG(maxNss <= 8,
"Invalid maximum NSS " << maxNss);
497 std::size_t index = 0;
539 it->second[index] |= (maxNss & 0x0f);
548 NS_ASSERT_MSG(maxNss <= 8,
"Invalid maximum NSS " << maxNss);
549 std::size_t index = 0;
587 ((maxNss & 0x0f) << 4);
592 it->second[index] |= ((maxNss & 0x0f) << 4);
607 if ((it->second[i] & 0x0f) > 0)
613 NS_ASSERT_MSG(index >= 0,
"Supported EHT-MCS And NSS Set subfield is incorrect");
642 if ((it->second[i] & 0xf0) > 0)
648 NS_ASSERT_MSG(index >= 0,
"Supported EHT-MCS And NSS Set subfield is incorrect");
668 uint8_t ruIndexBitmask,
669 const std::vector<std::pair<uint8_t, uint8_t>>& ppeThresholds)
671 NS_ASSERT(ppeThresholds.size() == (std::bitset<5>(ruIndexBitmask).count() * (nssPe + 1)));
676 for (
const auto& [ppetMax, ppet8] : ppeThresholds)
iterator in a Buffer instance
void Next()
go forward by one byte
uint16_t DeserializeInformationField(Buffer::Iterator start, uint16_t length) override
Deserialize information (i.e., the body of the IE, not including the Element ID and length octets)
void SetPpeThresholds(uint8_t nssPe, uint8_t ruIndexBitmask, const std::vector< std::pair< uint8_t, uint8_t > > &ppeThresholds)
Set the EHT PPE threshold info subfield.
void SerializeInformationField(Buffer::Iterator start) const override
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
void SetMaxMpduLength(uint16_t length)
Set the maximum MPDU length.
void SetSupportedTxEhtMcsAndNss(EhtMcsAndNssSet::EhtMcsMapType mapType, uint8_t upperMcs, uint8_t maxNss)
Set a subfield of the Supported EHT-MCS And NSS Set.
bool m_is2_4Ghz
flag indicating whether PHY is operating in 2.4 GHz based on other IEs contained in the same manageme...
WifiInformationElementId ElementIdExt() const override
Get the wifi information element ID extension.
EhtCapabilities()
Constructor.
void Print(std::ostream &os) const override
Generate human-readable form of IE.
EhtMcsAndNssSet m_supportedEhtMcsAndNssSet
Supported EHT-MCS And NSS Set subfield.
uint16_t GetInformationFieldSize() const override
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
EhtPpeThresholds m_ppeThresholds
EHT PPE Threshold Info subfield.
EhtPhyCapabilities m_phyCapabilities
EHT PHY Capabilities Info subfield.
uint8_t GetHighestSupportedTxMcs(EhtMcsAndNssSet::EhtMcsMapType mapType)
Get the highest supported TX MCS for a given EHT-MCS map type.
WifiInformationElementId ElementId() const override
Get the wifi information element ID.
uint32_t GetMaxAmpduLength() const
Return the maximum A-MPDU length.
EhtMacCapabilities m_macCapabilities
EHT MAC Capabilities Info subfield.
uint16_t GetMaxMpduLength() const
Get the maximum MPDU length.
void SetMaxAmpduLength(uint32_t maxAmpduLength)
Set the maximum A-MPDU length.
void SetSupportedRxEhtMcsAndNss(EhtMcsAndNssSet::EhtMcsMapType mapType, uint8_t upperMcs, uint8_t maxNss)
Set a subfield of the Supported EHT-MCS And NSS Set.
uint8_t GetHighestSupportedRxMcs(EhtMcsAndNssSet::EhtMcsMapType mapType)
Get the highest supported RX MCS for a given EHT-MCS map type.
std::optional< HeCapabilities > m_heCapabilities
HE capabilities contained in the same management frame if present.
#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_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
uint16_t GetSize() const
Get the size of the serialized EHT MAC capabilities subfield.
uint8_t maxMpduLength
Maximum MPDU Length.
uint8_t epcsPriorityAccessSupported
EPCS Priority Access Supported.
uint8_t triggeredTxopSharingMode1Support
Triggered TXOP Sharing Mode 1 Support.
uint8_t restrictedTwtSupport
Restricted TWT Support.
uint8_t ehtOmControlSupport
EHT OM Control Support.
void Serialize(Buffer::Iterator &start) const
Serialize the EHT MAC capabilities subfield.
uint16_t Deserialize(Buffer::Iterator start)
Deserialize the EHT MAC capabilities subfield.
uint8_t scsTrafficDescriptionSupport
SCS Traffic Description Support.
uint8_t maxAmpduLengthExponentExtension
Maximum A-MPDU length exponent extension.
uint8_t triggeredTxopSharingMode2Support
Triggered TXOP Sharing Mode 2 Support.
uint16_t Deserialize(Buffer::Iterator start, bool is2_4Ghz, uint8_t heSupportedChannelWidthSet, bool support320MhzIn6Ghz)
Deserialize the Supported EHT-MCS And NSS Set subfield.
uint16_t GetSize() const
Get the size of the serialized Supported EHT-MCS And NSS Set subfield.
void Serialize(Buffer::Iterator &start) const
Serialize the Supported EHT-MCS And NSS Set subfield.
std::map< EhtMcsMapType, std::vector< uint8_t > > supportedEhtMcsAndNssSet
Supported EHT-MCS And NSS Set.
EhtMcsMapType
The different EHT-MCS map types as defined in 9.4.2.313.4 Supported EHT-MCS And NSS Set field.
@ EHT_MCS_MAP_TYPE_320_MHZ
@ EHT_MCS_MAP_TYPE_20_MHZ_ONLY
@ EHT_MCS_MAP_TYPE_NOT_LARGER_THAN_80_MHZ
@ EHT_MCS_MAP_TYPE_160_MHZ
uint8_t support242ToneRuInBwLargerThan20Mhz
Support For 242-tone RU In BW Wider Than 20 MHz.
uint8_t triggeredSuBeamformingFeedback
Triggered SU Beamforming Feedback.
uint8_t ndpWith4TimesEhtLtfAnd32usGi
NDP With 4x EHT-LTF And 3.2 μs GI.
uint8_t ppeThresholdsPresent
PPE Thresholds Present.
uint8_t muBeamformer320Mhz
MU Beamformer (BW = 320 MHz)
uint8_t nSoundingDimensions160Mhz
Beamformee SS (= 160 MHz)
uint8_t rx1024QamInWiderBwDlOfdmaSupport
Rx 1024-QAM In Wider Bandwidth DL OFDMA Support.
uint8_t supportMcs15
Support Of MCS 15.
uint8_t beamformeeSsBwNotLargerThan80Mhz
Beamformee SS (≤ 80 MHz)
uint8_t partialBandwidthDlMuMimo
Partial Bandwidth DL MU-MIMO.
uint8_t nonOfdmaUlMuMimo320Mhz
Non-OFDMA UL MU-MIMO (BW = 320 MHz)
uint8_t muBeamformerBwNotLargerThan80Mhz
MU Beamformer (BW ≤ 80 MHz)
uint8_t triggeredCqiFeedback
Triggered CQI Feedback.
uint8_t nonOfdmaUlMuMimoBwNotLargerThan80Mhz
Non-OFDMA UL MU-MIMO (BW ≤ 80 MHz)
uint16_t GetSize() const
Get the size of the serialized EHT PHY capabilities subfield.
uint8_t nSoundingDimensions320Mhz
Beamformee SS (= 320 MHz)
uint8_t beamformeeSs320Mhz
Beamformee SS (= 320 MHz)
uint8_t partialBandwidthUlMuMimo
Partial Bandwidth UL MU-MIMO.
uint8_t psrBasedSpatialReuseSupport
EHT PSR-Based SR Support.
uint8_t nonOfdmaUlMuMimo160Mhz
Non-OFDMA UL MU-MIMO (BW = 160 MHz)
uint8_t suBeamformee
SU Beamformee.
uint8_t rx4096QamInWiderBwDlOfdmaSupport
Rx 4096-QAM In Wider Bandwidth DL OFDMA Support.
uint8_t tbSoundingFeedbackRateLimit
TB Sounding Feedback Rate Limit.
uint8_t muPpdu4xEhtLtfAnd800nsGi
EHT MU PPDU With 4x EHT-LTF And 0.8 μs GI.
uint8_t muBeamformer160Mhz
MU Beamformer (BW = 160 MHz)
uint8_t support320MhzIn6Ghz
Support For 320 MHz In 6 GHz.
uint8_t support20MhzOperatingStaReceivingNdpWithWiderBw
Support For 20 MHz Operating STA Receiving NDP With Wider Bandwidth.
uint8_t beamformeeSs160Mhz
Beamformee SS (= 160 MHz)
uint8_t codebooksizeSuFeedback
Support for a codebook size for SU feedback.
uint8_t triggeredMuBeamformingPartialBwFeedback
Triggered MU Beamforming Partial BW Feedback.
uint8_t nonTriggeredCqiFeedback
Non-Triggered CQI Feedback.
uint8_t powerBoostFactorSupport
Power Boost Factor Support.
uint16_t Deserialize(Buffer::Iterator start)
Deserialize the EHT PHY capabilities subfield.
uint8_t supportEhtDupIn6GHz
Support Of EHT DUP (MCS 14) In 6 GHz.
uint8_t ng16MuFeedback
Support for subcarrier grouping of 16 for MU feedback.
uint8_t ng16SuFeedback
Support for subcarrier grouping of 16 for SU feedback.
uint8_t commonNominalPacketPadding
Common Nominal Packet Padding.
uint8_t codebooksizeMuFeedback
Support for a codebook size for MU feedback.
void Serialize(Buffer::Iterator &start) const
Serialize the EHT PHY capabilities subfield.
uint8_t supportTx1024And4096QamForRuSmallerThan242Tones
Tx 1024-QAM And 4096-QAM < 242-tone RU Support.
uint8_t suBeamformer
SU Beamformer.
uint8_t nSoundingDimensionsBwNotLargerThan80Mhz
Beamformee SS (≤ 80 MHz)
uint8_t supportRx1024And4096QamForRuSmallerThan242Tones
Rx 1024-QAM And 4096-QAM < 242-tone RU Support.
uint8_t maxNumSupportedEhtLtfs
Maximum Number Of Supported EHT-LTFs.
uint16_t Deserialize(Buffer::Iterator start)
Deserialize the EHT PPE Thresholds subfield.
std::vector< EhtPpeThresholdsInfo > ppeThresholdsInfo
PPE Thresholds Info.
void Serialize(Buffer::Iterator &start) const
Serialize the EHT PPE Thresholds subfield.
uint8_t ruIndexBitmask
RU Index Bitmask.
uint16_t GetSize() const
Get the size of the serialized EHT PPE Thresholds subfield.