A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
eht-operation.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Sharan Naribole <sharan.naribole@gmail.com>
7 */
8
9#ifndef EHT_OPERATION_H
10#define EHT_OPERATION_H
11
12#include <ns3/wifi-information-element.h>
13
14#include <optional>
15#include <vector>
16
17namespace ns3
18{
19
20/// IEEE 802.11be D2.0 Figure 9-1002ai
21constexpr uint8_t WIFI_EHT_MAX_MCS_INDEX = 13;
22/// IEEE 802.11be D2.0 Figure 9-1002b
23constexpr uint16_t WIFI_EHT_OP_PARAMS_SIZE_B = 1;
24/// IEEE 802.11be D2.0 Figure 9-1002c
25constexpr uint16_t WIFI_EHT_OP_INFO_BASIC_SIZE_B = 3;
26/// IEEE 802.11be D2.0 Figure 9-1002c
27constexpr uint16_t WIFI_EHT_DISABLED_SUBCH_BM_SIZE_B = 2;
28/// IEEE 802.11be D2.0 Figure 9-1002ai
29constexpr uint16_t WIFI_EHT_BASIC_MCS_NSS_SET_SIZE_B = 4;
30/// Default max Tx/Rx NSS
31constexpr uint8_t WIFI_DEFAULT_EHT_MAX_NSS = 1;
32/// Max NSS configurable, 802.11be D2.0 Table 9-401m
33constexpr uint8_t WIFI_EHT_MAX_NSS_CONFIGURABLE = 8;
34/// Default EHT Operation Info Present
36/// Default Disabled Subch Bitmap Present
38/// Default PE Duration
39constexpr uint8_t WIFI_DEFAULT_EHT_OP_PE_DUR = 0;
40/// Default Group Addressed BU Indication Limit
41constexpr uint8_t WIFI_DEFAULT_GRP_BU_IND_LIMIT = 0;
42/// Default Group Addressed BU Exponent
43constexpr uint8_t WIFI_DEFAULT_GRP_BU_EXP = 0;
44
45/**
46 * \brief EHT Operation Information Element
47 * \ingroup wifi
48 *
49 * This class serializes and deserializes
50 * the EHT Operation Information Element
51 * IEEE 802.11be D2.0 9.4.2.311
52 *
53 */
55{
56 public:
57 /**
58 * EHT Operation Parameters subfield
59 * IEEE 802.11be D2.0 Figure 9-1002b
60 */
62 {
63 /// EHT Operation Information Present
65 /// Disabled Subchannel Bitmap Present
67 /// EHT Default PE Duration
69 /// Group Addressed BU Indication Limit
71 /// Group Addressed BU Indication Exponent
73
74 /**
75 * Serialize the EHT Operation Parameters subfield
76 *
77 * \param start iterator pointing to where the subfield should be written to
78 */
79 void Serialize(Buffer::Iterator& start) const;
80 /**
81 * Deserialize the EHT Operation Parameters subfield
82 *
83 * \param start iterator pointing to where the subfield should be read from
84 * \return the number of octets read
85 */
86 uint16_t Deserialize(Buffer::Iterator start);
87 };
88
89 /**
90 * EHT Operation Information Control subfield
91 * IEEE 802.11be D2.0 Figure 9-1002D
92 */
94 {
95 uint8_t channelWidth : 3; ///< EHT BSS bandwidth
96 };
97
98 /**
99 * EHT Operation Information subfield
100 * IEEE 802.11be D2.0 Figure 9-1002c
101 */
103 {
104 EhtOpControl control; ///< Control subfield
105 uint8_t ccfs0; ///< Channel center frequency segment 0
106 uint8_t ccfs1; ///< Channel center frequency segment 1
107 std::optional<uint16_t> disabledSubchBm; ///< Disabled subchannel bitmap
108
109 /**
110 * Serialize the EHT Operation Information subfield
111 *
112 * \param start iterator pointing to where the subfield should be written to
113 */
114 void Serialize(Buffer::Iterator& start) const;
115 /**
116 * Deserialize the EHT Operation Information subfield
117 *
118 * \param start iterator pointing to where the subfield should be read from
119 * \param disabledSubchBmPresent EHT Operation Param Disabled Subchannel Bitmap Present
120 * \return the number of octets read
121 */
122 uint16_t Deserialize(Buffer::Iterator start, bool disabledSubchBmPresent);
123 };
124
125 /**
126 * Basic EHT-MCS and NSS Set subfield
127 * IEEE 802.11be D2.0 Figure 9-1002ai
128 */
130 {
131 std::vector<uint8_t> maxRxNss{}; ///< Max Rx NSS per MCS
132 std::vector<uint8_t> maxTxNss{}; ///< Max Tx NSS per MCS
133
134 /**
135 * Serialize the Basic EHT-MCS and NSS Set subfield
136 *
137 * \param start iterator pointing to where the subfield should be written to
138 */
139 void Serialize(Buffer::Iterator& start) const;
140 /**
141 * Deserialize the Basic EHT-MCS and NSS Set subfield
142 *
143 * \param start iterator pointing to where the subfield should be read from
144 * \return the number of octets read
145 */
146 uint16_t Deserialize(Buffer::Iterator start);
147 };
148
149 EhtOperation();
150 WifiInformationElementId ElementId() const override;
151 WifiInformationElementId ElementIdExt() const override;
152 void Print(std::ostream& os) const override;
153
154 /**
155 * Set the max Rx NSS for input MCS index range
156 * \param maxNss the maximum supported Rx NSS for MCS group
157 * \param mcsStart MCS index start
158 * \param mcsEnd MCS index end
159 */
160 void SetMaxRxNss(uint8_t maxNss, uint8_t mcsStart, uint8_t mcsEnd);
161 /**
162 * Set the max Tx NSS for input MCS index range
163 * \param maxNss the maximum supported Rx NSS for MCS group
164 * \param mcsStart MCS index start
165 * \param mcsEnd MCS index end
166 */
167 void SetMaxTxNss(uint8_t maxNss, uint8_t mcsStart, uint8_t mcsEnd);
168
169 EhtOpParams m_params; ///< EHT Operation Parameters
170 EhtBasicMcsNssSet m_mcsNssSet; ///< Basic EHT-MCS and NSS set
171 std::optional<EhtOpInfo> m_opInfo; ///< EHT Operation Information
172
173 private:
174 uint16_t GetInformationFieldSize() const override;
175 void SerializeInformationField(Buffer::Iterator start) const override;
176 uint16_t DeserializeInformationField(Buffer::Iterator start, uint16_t length) override;
177};
178
179} // namespace ns3
180
181#endif /* EHT_OPERATION_H */
iterator in a Buffer instance
Definition buffer.h:89
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.
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)
Information element, as defined in 802.11-2007 standard.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
constexpr uint8_t WIFI_DEFAULT_EHT_OP_DIS_SUBCH_BM_PRESENT
Default Disabled Subch Bitmap Present.
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_DEFAULT_EHT_OP_PE_DUR
Default PE Duration.
constexpr uint8_t WIFI_DEFAULT_GRP_BU_IND_LIMIT
Default Group Addressed BU Indication Limit.
constexpr uint16_t WIFI_EHT_BASIC_MCS_NSS_SET_SIZE_B
IEEE 802.11be D2.0 Figure 9-1002ai.
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.
constexpr uint8_t WIFI_DEFAULT_EHT_OP_INFO_PRESENT
Default EHT Operation Info Present.
constexpr uint8_t WIFI_DEFAULT_GRP_BU_EXP
Default Group Addressed BU Exponent.
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
Basic EHT-MCS and NSS Set subfield IEEE 802.11be D2.0 Figure 9-1002ai.
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 Control subfield IEEE 802.11be D2.0 Figure 9-1002D.
uint8_t channelWidth
EHT BSS bandwidth.
EHT Operation Information subfield IEEE 802.11be D2.0 Figure 9-1002c.
EhtOpControl control
Control subfield.
void Serialize(Buffer::Iterator &start) const
Serialize the EHT Operation Information subfield.
uint8_t ccfs1
Channel center frequency segment 1.
std::optional< uint16_t > disabledSubchBm
Disabled subchannel bitmap.
uint16_t Deserialize(Buffer::Iterator start, bool disabledSubchBmPresent)
Deserialize the EHT Operation Information subfield.
uint8_t ccfs0
Channel center frequency segment 0.
EHT Operation Parameters subfield IEEE 802.11be D2.0 Figure 9-1002b.
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.