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 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Sharan Naribole <sharan.naribole@gmail.com>
18 */
19
20#ifndef EHT_OPERATION_H
21#define EHT_OPERATION_H
22
23#include <ns3/wifi-information-element.h>
24
25#include <optional>
26#include <vector>
27
28namespace ns3
29{
30
31/// IEEE 802.11be D2.0 Figure 9-1002ai
32constexpr uint8_t WIFI_EHT_MAX_MCS_INDEX = 13;
33/// IEEE 802.11be D2.0 Figure 9-1002b
34constexpr uint16_t WIFI_EHT_OP_PARAMS_SIZE_B = 1;
35/// IEEE 802.11be D2.0 Figure 9-1002c
36constexpr uint16_t WIFI_EHT_OP_INFO_BASIC_SIZE_B = 3;
37/// IEEE 802.11be D2.0 Figure 9-1002c
38constexpr uint16_t WIFI_EHT_DISABLED_SUBCH_BM_SIZE_B = 2;
39/// IEEE 802.11be D2.0 Figure 9-1002ai
40constexpr uint16_t WIFI_EHT_BASIC_MCS_NSS_SET_SIZE_B = 4;
41/// Default max Tx/Rx NSS
42constexpr uint8_t WIFI_DEFAULT_EHT_MAX_NSS = 1;
43/// Max NSS configurable, 802.11be D2.0 Table 9-401m
44constexpr uint8_t WIFI_EHT_MAX_NSS_CONFIGURABLE = 8;
45/// Default EHT Operation Info Present
47/// Default Disabled Subch Bitmap Present
49/// Default PE Duration
50constexpr uint8_t WIFI_DEFAULT_EHT_OP_PE_DUR = 0;
51/// Default Group Addressed BU Indication Limit
52constexpr uint8_t WIFI_DEFAULT_GRP_BU_IND_LIMIT = 0;
53/// Default Group Addressed BU Exponent
54constexpr uint8_t WIFI_DEFAULT_GRP_BU_EXP = 0;
55
56/**
57 * \brief EHT Operation Information Element
58 * \ingroup wifi
59 *
60 * This class serializes and deserializes
61 * the EHT Operation Information Element
62 * IEEE 802.11be D2.0 9.4.2.311
63 *
64 */
66{
67 public:
68 /**
69 * EHT Operation Parameters subfield
70 * IEEE 802.11be D2.0 Figure 9-1002b
71 */
73 {
74 /// EHT Operation Information Present
76 /// Disabled Subchannel Bitmap Present
78 /// EHT Default PE Duration
80 /// Group Addressed BU Indication Limit
82 /// Group Addressed BU Indication Exponent
84
85 /**
86 * Serialize the EHT Operation Parameters subfield
87 *
88 * \param start iterator pointing to where the subfield should be written to
89 */
90 void Serialize(Buffer::Iterator& start) const;
91 /**
92 * Deserialize the EHT Operation Parameters subfield
93 *
94 * \param start iterator pointing to where the subfield should be read from
95 * \return the number of octets read
96 */
97 uint16_t Deserialize(Buffer::Iterator start);
98 };
99
100 /**
101 * EHT Operation Information Control subfield
102 * IEEE 802.11be D2.0 Figure 9-1002D
103 */
105 {
106 uint8_t channelWidth : 3; ///< EHT BSS bandwidth
107 };
108
109 /**
110 * EHT Operation Information subfield
111 * IEEE 802.11be D2.0 Figure 9-1002c
112 */
114 {
115 EhtOpControl control; ///< Control subfield
116 uint8_t ccfs0; ///< Channel center frequency segment 0
117 uint8_t ccfs1; ///< Channel center frequency segment 1
118 std::optional<uint16_t> disabledSubchBm; ///< Disabled subchannel bitmap
119
120 /**
121 * Serialize the EHT Operation Information subfield
122 *
123 * \param start iterator pointing to where the subfield should be written to
124 */
125 void Serialize(Buffer::Iterator& start) const;
126 /**
127 * Deserialize the EHT Operation Information subfield
128 *
129 * \param start iterator pointing to where the subfield should be read from
130 * \param disabledSubchBmPresent EHT Operation Param Disabled Subchannel Bitmap Present
131 * \return the number of octets read
132 */
133 uint16_t Deserialize(Buffer::Iterator start, bool disabledSubchBmPresent);
134 };
135
136 /**
137 * Basic EHT-MCS and NSS Set subfield
138 * IEEE 802.11be D2.0 Figure 9-1002ai
139 */
141 {
142 std::vector<uint8_t> maxRxNss{}; ///< Max Rx NSS per MCS
143 std::vector<uint8_t> maxTxNss{}; ///< Max Tx NSS per MCS
144
145 /**
146 * Serialize the Basic EHT-MCS and NSS Set subfield
147 *
148 * \param start iterator pointing to where the subfield should be written to
149 */
150 void Serialize(Buffer::Iterator& start) const;
151 /**
152 * Deserialize the Basic EHT-MCS and NSS Set subfield
153 *
154 * \param start iterator pointing to where the subfield should be read from
155 * \return the number of octets read
156 */
157 uint16_t Deserialize(Buffer::Iterator start);
158 };
159
160 EhtOperation();
161 WifiInformationElementId ElementId() const override;
162 WifiInformationElementId ElementIdExt() const override;
163 void Print(std::ostream& os) const override;
164
165 /**
166 * Set the max Rx NSS for input MCS index range
167 * \param maxNss the maximum supported Rx NSS for MCS group
168 * \param mcsStart MCS index start
169 * \param mcsEnd MCS index end
170 */
171 void SetMaxRxNss(uint8_t maxNss, uint8_t mcsStart, uint8_t mcsEnd);
172 /**
173 * Set the max Tx NSS for input MCS index range
174 * \param maxNss the maximum supported Rx NSS for MCS group
175 * \param mcsStart MCS index start
176 * \param mcsEnd MCS index end
177 */
178 void SetMaxTxNss(uint8_t maxNss, uint8_t mcsStart, uint8_t mcsEnd);
179
180 EhtOpParams m_params; ///< EHT Operation Parameters
181 EhtBasicMcsNssSet m_mcsNssSet; ///< Basic EHT-MCS and NSS set
182 std::optional<EhtOpInfo> m_opInfo; ///< EHT Operation Information
183
184 private:
185 uint16_t GetInformationFieldSize() const override;
186 void SerializeInformationField(Buffer::Iterator start) const override;
187 uint16_t DeserializeInformationField(Buffer::Iterator start, uint16_t length) override;
188};
189
190} // namespace ns3
191
192#endif /* EHT_OPERATION_H */
iterator in a Buffer instance
Definition: buffer.h:100
EHT Operation Information Element.
Definition: eht-operation.h:66
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.
Definition: eht-operation.h:48
constexpr uint16_t WIFI_EHT_OP_INFO_BASIC_SIZE_B
IEEE 802.11be D2.0 Figure 9-1002c.
Definition: eht-operation.h:36
constexpr uint16_t WIFI_EHT_DISABLED_SUBCH_BM_SIZE_B
IEEE 802.11be D2.0 Figure 9-1002c.
Definition: eht-operation.h:38
constexpr uint8_t WIFI_DEFAULT_EHT_MAX_NSS
Default max Tx/Rx NSS.
Definition: eht-operation.h:42
constexpr uint8_t WIFI_EHT_MAX_MCS_INDEX
IEEE 802.11be D2.0 Figure 9-1002ai.
Definition: eht-operation.h:32
constexpr uint8_t WIFI_DEFAULT_EHT_OP_PE_DUR
Default PE Duration.
Definition: eht-operation.h:50
constexpr uint8_t WIFI_DEFAULT_GRP_BU_IND_LIMIT
Default Group Addressed BU Indication Limit.
Definition: eht-operation.h:52
constexpr uint16_t WIFI_EHT_BASIC_MCS_NSS_SET_SIZE_B
IEEE 802.11be D2.0 Figure 9-1002ai.
Definition: eht-operation.h:40
constexpr uint8_t WIFI_EHT_MAX_NSS_CONFIGURABLE
Max NSS configurable, 802.11be D2.0 Table 9-401m.
Definition: eht-operation.h:44
constexpr uint16_t WIFI_EHT_OP_PARAMS_SIZE_B
IEEE 802.11be D2.0 Figure 9-1002b.
Definition: eht-operation.h:34
constexpr uint8_t WIFI_DEFAULT_EHT_OP_INFO_PRESENT
Default EHT Operation Info Present.
Definition: eht-operation.h:46
constexpr uint8_t WIFI_DEFAULT_GRP_BU_EXP
Default Group Addressed BU Exponent.
Definition: eht-operation.h:54
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.
Definition: eht-operation.h:73
uint8_t defaultPeDur
EHT Default PE Duration.
Definition: eht-operation.h:79
void Serialize(Buffer::Iterator &start) const
Serialize the EHT Operation Parameters subfield.
uint8_t grpBuExp
Group Addressed BU Indication Exponent.
Definition: eht-operation.h:83
uint16_t Deserialize(Buffer::Iterator start)
Deserialize the EHT Operation Parameters subfield.
uint8_t opInfoPresent
EHT Operation Information Present.
Definition: eht-operation.h:75
uint8_t disabledSubchBmPresent
Disabled Subchannel Bitmap Present.
Definition: eht-operation.h:77
uint8_t grpBuIndLimit
Group Addressed BU Indication Limit.
Definition: eht-operation.h:81