23 #include <ns3/assert.h>
42 opInfoPresent =
params & 0x01;
43 disabledSubchBmPresent = (
params >> 1) & 0x01;
44 defaultPeDur = (
params >> 2) & 0x01;
45 grpBuIndLimit = (
params >> 3) & 0x01;
46 grpBuExp = (
params >> 4) & 0x03;
58 SetMaxNss(std::vector<uint8_t>& vec, uint8_t maxNss, uint8_t mcsStart, uint8_t mcsEnd)
63 for (
auto index = mcsStart; index <= mcsEnd; index++)
77 GetMaxNss(
const std::vector<uint8_t>& vec, uint8_t mcsStart, uint8_t mcsEnd)
82 for (
auto index = mcsStart; index <= mcsEnd; index++)
84 if (vec[index] < minMaxNss)
86 minMaxNss = vec[index];
99 start.WriteHtolsbU32(val);
105 auto subfield =
start.ReadLsbtohU32();
106 auto rxNssMcs0_7 = subfield & 0xf;
108 auto txNssMcs0_7 = (subfield >> 4) & 0xf;
110 auto rxNssMcs8_9 = (subfield >> 8) & 0xf;
112 auto txNssMcs8_9 = (subfield >> 12) & 0xf;
114 auto rxNssMcs10_11 = (subfield >> 16) & 0xf;
115 SetMaxNss(maxRxNss, rxNssMcs10_11, 10, 11);
116 auto txNssMcs10_11 = (subfield >> 20) & 0xf;
117 SetMaxNss(maxTxNss, txNssMcs10_11, 10, 11);
118 auto rxNssMcs12_13 = (subfield >> 24) & 0xf;
119 SetMaxNss(maxRxNss, rxNssMcs12_13, 12, 13);
120 auto txNssMcs12_13 = (subfield >> 28) & 0xf;
121 SetMaxNss(maxTxNss, txNssMcs12_13, 12, 13);
128 start.WriteU8(control.channelWidth);
129 start.WriteU8(ccfs0);
130 start.WriteU8(ccfs1);
131 if (disabledSubchBm.has_value())
133 start.WriteU16(disabledSubchBm.value());
142 auto controlSubfield = i.ReadU8();
144 control.channelWidth = controlSubfield & 0x7;
150 "Incorrect EHT Operation Info deserialize");
151 if (!disabledSubchBmPresent)
155 disabledSubchBm = i.ReadU16();
158 "Incorrect EHT Operation Info deserialize");
222 "Incorrect setting of EHT Operation Information Present bit");
231 "Incorrect setting of Disabled Subchannel Bitmap Present bit");
241 uint16_t count = i.GetDistanceFrom(
start);
245 NS_ASSERT_MSG(count == length,
"Unexpected EHT Operation size");
252 i.Next(
m_opInfo->Deserialize(i, disabledSubchBmPresent));
253 count = i.GetDistanceFrom(
start);
257 "EHT Operation Length (" << +length
259 "from actual number of bytes read ("
273 os << +maxRxNss <<
"|";
278 os << +maxTxNss <<
"|";
281 if (ehtOperation.
m_opInfo.has_value())
283 os <<
"|" << +ehtOperation.
m_opInfo->control.channelWidth <<
"|"
285 if (ehtOperation.
m_opInfo->disabledSubchBm.has_value())
287 os <<
"|" << ehtOperation.
m_opInfo->disabledSubchBm.value();
iterator in a Buffer instance
EHT Operation Information Element.
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.
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.
std::ostream & operator<<(std::ostream &os, const Angles &a)
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.
params
Fit Fluctuating Two Ray model to the 3GPP TR 38.901 using the Anderson-Darling goodness-of-fit ##.
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.