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-export.h"
13#include "ns3/wifi-information-element.h"
14
15#include <optional>
16#include <vector>
17
18namespace ns3
19{
20
21/// IEEE 802.11be D2.0 Figure 9-1002ai
22constexpr uint8_t WIFI_EHT_MAX_MCS_INDEX = 13;
23/// IEEE 802.11be D2.0 Figure 9-1002b
24constexpr uint16_t WIFI_EHT_OP_PARAMS_SIZE_B = 1;
25/// IEEE 802.11be D2.0 Figure 9-1002c
26constexpr uint16_t WIFI_EHT_OP_INFO_BASIC_SIZE_B = 3;
27/// IEEE 802.11be D2.0 Figure 9-1002c
28constexpr uint16_t WIFI_EHT_DISABLED_SUBCH_BM_SIZE_B = 2;
29/// IEEE 802.11be D2.0 Figure 9-1002ai
30constexpr uint16_t WIFI_EHT_BASIC_MCS_NSS_SET_SIZE_B = 4;
31/// Default max Tx/Rx NSS
32constexpr uint8_t WIFI_DEFAULT_EHT_MAX_NSS = 1;
33/// Max NSS configurable, 802.11be D2.0 Table 9-401m
34constexpr uint8_t WIFI_EHT_MAX_NSS_CONFIGURABLE = 8;
35/// Default EHT Operation Info Present
37/// Default Disabled Subch Bitmap Present
39/// Default PE Duration
40constexpr uint8_t WIFI_DEFAULT_EHT_OP_PE_DUR = 0;
41/// Default Group Addressed BU Indication Limit
42constexpr uint8_t WIFI_DEFAULT_GRP_BU_IND_LIMIT = 0;
43/// Default Group Addressed BU Exponent
44constexpr uint8_t WIFI_DEFAULT_GRP_BU_EXP = 0;
45
46/**
47 * @brief EHT Operation Information Element
48 * @ingroup wifi
49 *
50 * This class serializes and deserializes
51 * the EHT Operation Information Element
52 * IEEE 802.11be D2.0 9.4.2.311
53 *
54 */
55class WIFI_EXPORT EhtOperation : public WifiInformationElement
56{
57 public:
58 /**
59 * EHT Operation Parameters subfield
60 * IEEE 802.11be D2.0 Figure 9-1002b
61 */
62 struct WIFI_EXPORT EhtOpParams
63 {
64 /// EHT Operation Information Present
66 /// Disabled Subchannel Bitmap Present
68 /// EHT Default PE Duration
70 /// Group Addressed BU Indication Limit
72 /// Group Addressed BU Indication Exponent
74
75 /**
76 * Serialize the EHT Operation Parameters subfield
77 *
78 * @param start iterator pointing to where the subfield should be written to
79 */
80 void Serialize(Buffer::Iterator& start) const;
81 /**
82 * Deserialize the EHT Operation Parameters subfield
83 *
84 * @param start iterator pointing to where the subfield should be read from
85 * @return the number of octets read
86 */
87 uint16_t Deserialize(Buffer::Iterator start);
88 };
89
90 /**
91 * EHT Operation Information Control subfield
92 * IEEE 802.11be D2.0 Figure 9-1002D
93 */
94 struct WIFI_EXPORT EhtOpControl
95 {
96 uint8_t channelWidth : 3; ///< EHT BSS bandwidth
97 };
98
99 /**
100 * EHT Operation Information subfield
101 * IEEE 802.11be D2.0 Figure 9-1002c
102 */
103 struct WIFI_EXPORT EhtOpInfo
104 {
105 EhtOpControl control; ///< Control subfield
106 uint8_t ccfs0; ///< Channel center frequency segment 0
107 uint8_t ccfs1; ///< Channel center frequency segment 1
108 std::optional<uint16_t> disabledSubchBm; ///< Disabled subchannel bitmap
109
110 /**
111 * Serialize the EHT Operation Information subfield
112 *
113 * @param start iterator pointing to where the subfield should be written to
114 */
115 void Serialize(Buffer::Iterator& start) const;
116 /**
117 * Deserialize the EHT Operation Information subfield
118 *
119 * @param start iterator pointing to where the subfield should be read from
120 * @param disabledSubchBmPresent EHT Operation Param Disabled Subchannel Bitmap Present
121 * @return the number of octets read
122 */
123 uint16_t Deserialize(Buffer::Iterator start, bool disabledSubchBmPresent);
124 };
125
126 /**
127 * Basic EHT-MCS and NSS Set subfield
128 * IEEE 802.11be D2.0 Figure 9-1002ai
129 */
130 struct WIFI_EXPORT EhtBasicMcsNssSet
131 {
132 std::vector<uint8_t> maxRxNss{}; ///< Max Rx NSS per MCS
133 std::vector<uint8_t> maxTxNss{}; ///< Max Tx NSS per MCS
134
135 /**
136 * Serialize the Basic EHT-MCS and NSS Set subfield
137 *
138 * @param start iterator pointing to where the subfield should be written to
139 */
140 void Serialize(Buffer::Iterator& start) const;
141 /**
142 * Deserialize the Basic EHT-MCS and NSS Set subfield
143 *
144 * @param start iterator pointing to where the subfield should be read from
145 * @return the number of octets read
146 */
147 uint16_t Deserialize(Buffer::Iterator start);
148 };
149
150 EhtOperation();
151 WifiInformationElementId ElementId() const override;
152 WifiInformationElementId ElementIdExt() const override;
153 void Print(std::ostream& os) const override;
154
155 /**
156 * Set the max Rx NSS for input MCS index range
157 * @param maxNss the maximum supported Rx NSS for MCS group
158 * @param mcsStart MCS index start
159 * @param mcsEnd MCS index end
160 */
161 void SetMaxRxNss(uint8_t maxNss, uint8_t mcsStart, uint8_t mcsEnd);
162 /**
163 * Set the max Tx NSS for input MCS index range
164 * @param maxNss the maximum supported Rx NSS for MCS group
165 * @param mcsStart MCS index start
166 * @param mcsEnd MCS index end
167 */
168 void SetMaxTxNss(uint8_t maxNss, uint8_t mcsStart, uint8_t mcsEnd);
169
170 EhtOpParams m_params; ///< EHT Operation Parameters
171 EhtBasicMcsNssSet m_mcsNssSet; ///< Basic EHT-MCS and NSS set
172 std::optional<EhtOpInfo> m_opInfo; ///< EHT Operation Information
173
174 private:
175 uint16_t GetInformationFieldSize() const override;
176 void SerializeInformationField(Buffer::Iterator start) const override;
177 uint16_t DeserializeInformationField(Buffer::Iterator start, uint16_t length) override;
178};
179
180} // namespace ns3
181
182#endif /* EHT_OPERATION_H */
iterator in a Buffer instance
Definition buffer.h:109
EHT Operation Information Element.
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).
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.
Buffer::Iterator Deserialize(Buffer::Iterator i)
Deserialize entire IE (which may possibly be fragmented into multiple elements), which must be presen...
Buffer::Iterator Serialize(Buffer::Iterator i) const
Serialize entire IE including Element ID and length fields.
void Print(ComponentCarrier cc)
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.
std::vector< uint8_t > maxRxNss
Max Rx NSS per MCS.
std::vector< uint8_t > maxTxNss
Max Tx NSS per MCS.
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.
uint8_t grpBuExp
Group Addressed BU Indication Exponent.
uint8_t opInfoPresent
EHT Operation Information Present.
uint8_t disabledSubchBmPresent
Disabled Subchannel Bitmap Present.
uint8_t grpBuIndLimit
Group Addressed BU Indication Limit.