A Discrete-Event Network Simulator
API
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 
28 namespace ns3
29 {
30 
32 constexpr uint8_t WIFI_EHT_MAX_MCS_INDEX = 13;
34 constexpr uint16_t WIFI_EHT_OP_PARAMS_SIZE_B = 1;
36 constexpr uint16_t WIFI_EHT_OP_INFO_BASIC_SIZE_B = 3;
38 constexpr uint16_t WIFI_EHT_DISABLED_SUBCH_BM_SIZE_B = 2;
40 constexpr uint16_t WIFI_EHT_BASIC_MCS_NSS_SET_SIZE_B = 4;
42 constexpr uint8_t WIFI_DEFAULT_EHT_MAX_NSS = 1;
44 constexpr uint8_t WIFI_EHT_MAX_NSS_CONFIGURABLE = 8;
46 constexpr uint8_t WIFI_DEFAULT_EHT_OP_INFO_PRESENT = 0;
50 constexpr uint8_t WIFI_DEFAULT_EHT_OP_PE_DUR = 0;
52 constexpr uint8_t WIFI_DEFAULT_GRP_BU_IND_LIMIT = 0;
54 constexpr uint8_t WIFI_DEFAULT_GRP_BU_EXP = 0;
55 
66 {
67  public:
72  struct EhtOpParams
73  {
84 
90  void Serialize(Buffer::Iterator& start) const;
98  };
99 
105  {
106  uint8_t channelWidth : 3;
107  };
108 
113  struct EhtOpInfo
114  {
116  uint8_t ccfs0;
117  uint8_t ccfs1;
118  std::optional<uint16_t> disabledSubchBm;
119 
125  void Serialize(Buffer::Iterator& start) const;
133  uint16_t Deserialize(Buffer::Iterator start, bool disabledSubchBmPresent);
134  };
135 
141  {
142  std::vector<uint8_t> maxRxNss{};
143  std::vector<uint8_t> maxTxNss{};
144 
150  void Serialize(Buffer::Iterator& start) const;
158  };
159 
160  EhtOperation();
161  WifiInformationElementId ElementId() const override;
162  WifiInformationElementId ElementIdExt() const override;
163  void Print(std::ostream& os) const override;
164 
171  void SetMaxRxNss(uint8_t maxNss, uint8_t mcsStart, uint8_t mcsEnd);
178  void SetMaxTxNss(uint8_t maxNss, uint8_t mcsStart, uint8_t mcsEnd);
179 
182  std::optional<EhtOpInfo> m_opInfo;
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