11#include <ns3/assert.h>
26 os << +maxRxNss <<
"|";
31 os << +maxTxNss <<
"|";
36 os <<
"|" << +
m_opInfo->control.channelWidth <<
"|" << +
m_opInfo->ccfs0 <<
"|"
38 if (
m_opInfo->disabledSubchBm.has_value())
40 os <<
"|" <<
m_opInfo->disabledSubchBm.value();
56 auto params = start.ReadU8();
57 opInfoPresent = params & 0x01;
58 disabledSubchBmPresent = (params >> 1) & 0x01;
59 defaultPeDur = (params >> 2) & 0x01;
60 grpBuIndLimit = (params >> 3) & 0x01;
61 grpBuExp = (params >> 4) & 0x03;
73SetMaxNss(std::vector<uint8_t>& vec, uint8_t maxNss, uint8_t mcsStart, uint8_t mcsEnd)
78 for (
auto index = mcsStart; index <= mcsEnd; index++)
92GetMaxNss(
const std::vector<uint8_t>& vec, uint8_t mcsStart, uint8_t mcsEnd)
97 for (
auto index = mcsStart; index <= mcsEnd; index++)
99 if (vec[index] < minMaxNss)
101 minMaxNss = vec[index];
114 start.WriteHtolsbU32(val);
120 auto subfield = start.ReadLsbtohU32();
121 auto rxNssMcs0_7 = subfield & 0xf;
123 auto txNssMcs0_7 = (subfield >> 4) & 0xf;
125 auto rxNssMcs8_9 = (subfield >> 8) & 0xf;
127 auto txNssMcs8_9 = (subfield >> 12) & 0xf;
129 auto rxNssMcs10_11 = (subfield >> 16) & 0xf;
130 SetMaxNss(maxRxNss, rxNssMcs10_11, 10, 11);
131 auto txNssMcs10_11 = (subfield >> 20) & 0xf;
132 SetMaxNss(maxTxNss, txNssMcs10_11, 10, 11);
133 auto rxNssMcs12_13 = (subfield >> 24) & 0xf;
134 SetMaxNss(maxRxNss, rxNssMcs12_13, 12, 13);
135 auto txNssMcs12_13 = (subfield >> 28) & 0xf;
136 SetMaxNss(maxTxNss, txNssMcs12_13, 12, 13);
143 start.WriteU8(control.channelWidth);
144 start.WriteU8(ccfs0);
145 start.WriteU8(ccfs1);
146 if (disabledSubchBm.has_value())
148 start.WriteU16(disabledSubchBm.value());
157 auto controlSubfield = i.ReadU8();
159 control.channelWidth = controlSubfield & 0x7;
165 "Incorrect EHT Operation Info deserialize");
166 if (!disabledSubchBmPresent)
170 disabledSubchBm = i.ReadU16();
173 "Incorrect EHT Operation Info deserialize");
237 "Incorrect setting of EHT Operation Information Present bit");
246 "Incorrect setting of Disabled Subchannel Bitmap Present bit");
256 uint16_t count = i.GetDistanceFrom(start);
260 NS_ASSERT_MSG(count == length,
"Unexpected EHT Operation size");
267 i.Next(
m_opInfo->Deserialize(i, disabledSubchBmPresent));
268 count = i.GetDistanceFrom(start);
272 "EHT Operation Length (" << +length
274 "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.