11#include "ns3/assert.h" 
   21    os << 
"EHT Operation=[";
 
   24        os << 
"Channel Width: " << +
m_opInfo->control.channelWidth;
 
 
   40    auto params = start.ReadU8();
 
   41    opInfoPresent = params & 0x01;
 
   42    disabledSubchBmPresent = (params >> 1) & 0x01;
 
   43    defaultPeDur = (params >> 2) & 0x01;
 
   44    grpBuIndLimit = (params >> 3) & 0x01;
 
   45    grpBuExp = (params >> 4) & 0x03;
 
 
   57SetMaxNss(std::vector<uint8_t>& vec, uint8_t maxNss, uint8_t mcsStart, uint8_t mcsEnd)
 
   62    for (
auto index = mcsStart; index <= mcsEnd; index++)
 
 
   76GetMaxNss(
const std::vector<uint8_t>& vec, uint8_t mcsStart, uint8_t mcsEnd)
 
   81    for (
auto index = mcsStart; index <= mcsEnd; index++)
 
   83        if (vec[index] < minMaxNss)
 
   85            minMaxNss = vec[index];
 
 
   98    start.WriteHtolsbU32(val);
 
 
  104    auto subfield = start.ReadLsbtohU32();
 
  105    auto rxNssMcs0_7 = subfield & 0xf; 
 
  107    auto txNssMcs0_7 = (subfield >> 4) & 0xf; 
 
  109    auto rxNssMcs8_9 = (subfield >> 8) & 0xf; 
 
  111    auto txNssMcs8_9 = (subfield >> 12) & 0xf; 
 
  113    auto rxNssMcs10_11 = (subfield >> 16) & 0xf; 
 
  114    SetMaxNss(maxRxNss, rxNssMcs10_11, 10, 11);
 
  115    auto txNssMcs10_11 = (subfield >> 20) & 0xf; 
 
  116    SetMaxNss(maxTxNss, txNssMcs10_11, 10, 11);
 
  117    auto rxNssMcs12_13 = (subfield >> 24) & 0xf; 
 
  118    SetMaxNss(maxRxNss, rxNssMcs12_13, 12, 13);
 
  119    auto txNssMcs12_13 = (subfield >> 28) & 0xf; 
 
  120    SetMaxNss(maxTxNss, txNssMcs12_13, 12, 13);
 
 
  127    start.WriteU8(control.channelWidth); 
 
  128    start.WriteU8(ccfs0);                
 
  129    start.WriteU8(ccfs1);                
 
  130    if (disabledSubchBm.has_value())
 
  132        start.WriteU16(disabledSubchBm.value());
 
 
  141    auto controlSubfield = i.ReadU8();
 
  143    control.channelWidth = controlSubfield & 0x7;
 
  149                  "Incorrect EHT Operation Info deserialize");
 
  150    if (!disabledSubchBmPresent)
 
  154    disabledSubchBm = i.ReadU16();
 
  157                  "Incorrect EHT Operation Info deserialize");
 
 
  221                  "Incorrect setting of EHT Operation Information Present bit");
 
  230                  "Incorrect setting of Disabled Subchannel Bitmap Present bit");
 
 
  240    uint16_t count = i.GetDistanceFrom(start);
 
  244        NS_ASSERT_MSG(count == length, 
"Unexpected EHT Operation size");
 
  251        i.Next(
m_opInfo->Deserialize(i, disabledSubchBmPresent));
 
  252        count = i.GetDistanceFrom(start);
 
  256                    "EHT Operation Length (" << +length
 
  258                                                "from actual number of bytes read (" 
 
iterator in a Buffer instance
void SetMaxTxNss(uint8_t maxNss, uint8_t mcsStart, uint8_t mcsEnd)
Set the max Tx NSS for input MCS index range.
void SetMaxRxNss(uint8_t maxNss, uint8_t mcsStart, uint8_t mcsEnd)
Set the max Rx NSS for input MCS index range.
EhtOpParams m_params
EHT Operation Parameters.
EhtBasicMcsNssSet m_mcsNssSet
Basic EHT-MCS and NSS set.
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)
WifiInformationElementId ElementIdExt() const override
Get the wifi information element ID extension.
void Print(std::ostream &os) const override
Generate human-readable form of IE.
WifiInformationElementId ElementId() const override
Get the wifi information element ID.
uint16_t GetInformationFieldSize() const override
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
std::optional< EhtOpInfo > m_opInfo
EHT Operation Information.
void SerializeInformationField(Buffer::Iterator start) const override
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
#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_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
constexpr uint16_t WIFI_EHT_OP_INFO_BASIC_SIZE_B
IEEE 802.11be D2.0 Figure 9-1002c.
constexpr uint16_t WIFI_EHT_DISABLED_SUBCH_BM_SIZE_B
IEEE 802.11be D2.0 Figure 9-1002c.
constexpr uint8_t WIFI_DEFAULT_EHT_MAX_NSS
Default max Tx/Rx NSS.
constexpr uint8_t WIFI_EHT_MAX_MCS_INDEX
IEEE 802.11be D2.0 Figure 9-1002ai.
constexpr uint8_t WIFI_IE_ELEMENT_ID_EXT_SIZE
Size in bytes of the Element ID Extension field (IEEE 802.11-2020 9.4.2.1 General)
constexpr uint16_t WIFI_EHT_BASIC_MCS_NSS_SET_SIZE_B
IEEE 802.11be D2.0 Figure 9-1002ai.
void SetMaxNss(std::vector< uint8_t > &vec, uint8_t maxNss, uint8_t mcsStart, uint8_t mcsEnd)
set the max Tx/Rx NSS for input MCS index range
constexpr uint8_t WIFI_EHT_MAX_NSS_CONFIGURABLE
Max NSS configurable, 802.11be D2.0 Table 9-401m.
constexpr uint16_t WIFI_EHT_OP_PARAMS_SIZE_B
IEEE 802.11be D2.0 Figure 9-1002b.
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
uint32_t GetMaxNss(const std::vector< uint8_t > &vec, uint8_t mcsStart, uint8_t mcsEnd)
Get the max Tx/Rx NSS for input MCS index range.
void Serialize(Buffer::Iterator &start) const
Serialize the Basic EHT-MCS and NSS Set subfield.
std::vector< uint8_t > maxRxNss
Max Rx NSS per MCS.
std::vector< uint8_t > maxTxNss
Max Tx NSS per MCS.
uint16_t Deserialize(Buffer::Iterator start)
Deserialize the Basic EHT-MCS and NSS Set subfield.
EHT Operation Information subfield IEEE 802.11be D2.0 Figure 9-1002c.
void Serialize(Buffer::Iterator &start) const
Serialize the EHT Operation Information subfield.
uint16_t Deserialize(Buffer::Iterator start, bool disabledSubchBmPresent)
Deserialize the EHT Operation Information subfield.
uint8_t defaultPeDur
EHT Default PE Duration.
void Serialize(Buffer::Iterator &start) const
Serialize the EHT Operation Parameters subfield.
uint8_t grpBuExp
Group Addressed BU Indication Exponent.
uint16_t Deserialize(Buffer::Iterator start)
Deserialize the EHT Operation Parameters subfield.
uint8_t opInfoPresent
EHT Operation Information Present.
uint8_t disabledSubchBmPresent
Disabled Subchannel Bitmap Present.
uint8_t grpBuIndLimit
Group Addressed BU Indication Limit.