A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ht-operation.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016 Sébastien Deronne
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Sébastien Deronne <sebastien.deronne@gmail.com>
7 */
8
9#ifndef HT_OPERATION_H
10#define HT_OPERATION_H
11
12#include "ns3/wifi-information-element.h"
13
14/**
15 * This defines the maximum number of supported MCSs that a STA is
16 * allowed to have. Currently this number is set for IEEE 802.11n
17 */
18#define MAX_SUPPORTED_MCS (77)
19
20namespace ns3
21{
22
23/// HtProtectionType enumeration
31
32/**
33 * \brief The HT Operation Information Element
34 * \ingroup wifi
35 *
36 * This class knows how to serialise and deserialise
37 * the HT Operation Information Element
38 */
40{
41 public:
43
44 // Implementations of pure virtual methods of WifiInformationElement
45 WifiInformationElementId ElementId() const override;
46 void Print(std::ostream& os) const override;
47
48 /**
49 * Set the Primary Channel field in the HT Operation information element.
50 *
51 * \param ctrl the Primary Channel field in the HT Operation information element
52 */
53 void SetPrimaryChannel(uint8_t ctrl);
54 /**
55 * Set the Information Subset 1 field in the HT Operation information element.
56 *
57 * \param ctrl the Information Subset 1 field in the HT Operation information element
58 */
59 void SetInformationSubset1(uint8_t ctrl);
60 /**
61 * Set the Information Subset 2 field in the HT Operation information element.
62 *
63 * \param ctrl the Information Subset 2 field in the HT Operation information element
64 */
65 void SetInformationSubset2(uint16_t ctrl);
66 /**
67 * Set the Information Subset 3 field in the HT Operation information element.
68 *
69 * \param ctrl the Information Subset 3 field in the HT Operation information element
70 */
71 void SetInformationSubset3(uint16_t ctrl);
72 /**
73 * Set the Basic MCS Set field in the HT Operation information element.
74 *
75 * \param ctrl1 the first 64 bytes of the Basic MCS Set field in the HT Operation
76 * information element
77 * \param ctrl2 the last 64 bytes of the Basic MCS Set field in the HT Operation
78 * information element
79 */
80 void SetBasicMcsSet(uint64_t ctrl1, uint64_t ctrl2);
81
82 /**
83 * Set the secondary channel offset.
84 *
85 * \param secondaryChannelOffset the secondary channel offset
86 */
87 void SetSecondaryChannelOffset(uint8_t secondaryChannelOffset);
88 /**
89 * Set the STA channel width.
90 *
91 * \param staChannelWidth the STA channel width
92 */
93 void SetStaChannelWidth(uint8_t staChannelWidth);
94 /**
95 * Set the RIFS mode.
96 *
97 * \param rifsMode the RIFS mode
98 */
99 void SetRifsMode(uint8_t rifsMode);
100
101 /**
102 * Set the HT protection.
103 *
104 * \param htProtection the HT protection
105 */
106 void SetHtProtection(uint8_t htProtection);
107 /**
108 * Set the non GF HT STAs present.
109 *
110 * \param nonGfHtStasPresent the non GF HT STAs present
111 */
112 void SetNonGfHtStasPresent(uint8_t nonGfHtStasPresent);
113 /**
114 * Set the OBSS non HT STAs present.
115 *
116 * \param obssNonHtStasPresent the OBSS non HTA STAs present
117 */
118 void SetObssNonHtStasPresent(uint8_t obssNonHtStasPresent);
119
120 /**
121 * Set the dual beacon.
122 *
123 * \param dualBeacon the dual beacon
124 */
125 void SetDualBeacon(uint8_t dualBeacon);
126 /**
127 * Set the dual CTS protection.
128 *
129 * \param dualCtsProtection the dual CTS protection
130 */
131 void SetDualCtsProtection(uint8_t dualCtsProtection);
132 /**
133 * Set the STBC beacon.
134 *
135 * \param stbcBeacon the STBC beacon
136 */
137 void SetStbcBeacon(uint8_t stbcBeacon);
138 /**
139 * Set the LSIG TXOP protection full support.
140 *
141 * \param lSigTxopProtectionFullSupport the LSIG TXOP protection full support
142 */
143 void SetLSigTxopProtectionFullSupport(uint8_t lSigTxopProtectionFullSupport);
144 /**
145 * Set the PCO active.
146 *
147 * \param pcoActive the PCO active
148 */
149 void SetPcoActive(uint8_t pcoActive);
150 /**
151 * Set the PCO phase.
152 *
153 * \param pcoPhase the PCO phase
154 */
155 void SetPhase(uint8_t pcoPhase);
156
157 /**
158 * Set the receive MCS bitmask.
159 *
160 * \param index the MCS bitmask
161 */
162 void SetRxMcsBitmask(uint8_t index);
163 /**
164 * Set the receive highest supported data rate.
165 *
166 * \param maxSupportedRate the maximum supported data rate
167 */
168 void SetRxHighestSupportedDataRate(uint16_t maxSupportedRate);
169 /**
170 * Set the transmit MCS set defined.
171 *
172 * \param txMcsSetDefined the transmit MCS set defined
173 */
174 void SetTxMcsSetDefined(uint8_t txMcsSetDefined);
175 /**
176 * Set the transmit / receive MCS set unequal.
177 *
178 * \param txRxMcsSetUnequal the transmit / receive MCS set unequal
179 */
180 void SetTxRxMcsSetUnequal(uint8_t txRxMcsSetUnequal);
181 /**
182 * Set the transmit maximum number spatial streams.
183 *
184 * \param maxTxSpatialStreams the maximum transmit spatial streams
185 */
186 void SetTxMaxNSpatialStreams(uint8_t maxTxSpatialStreams);
187 /**
188 * Set the transmit unequal modulation.
189 *
190 * \param txUnequalModulation the transmit unequal modulation
191 */
192 void SetTxUnequalModulation(uint8_t txUnequalModulation);
193
194 /**
195 * Return the Primary Channel field in the HT Operation information element.
196 *
197 * \return the Primary Channel field in the HT Operation information element
198 */
199 uint8_t GetPrimaryChannel() const;
200 /**
201 * Return the Information Subset 1 field in the HT Operation information element.
202 *
203 * \return the Information Subset 1 field in the HT Operation information element
204 */
205 uint8_t GetInformationSubset1() const;
206 /**
207 * Return the Information Subset 2 field in the HT Operation information element.
208 *
209 * \return the Information Subset 2 field in the HT Operation information element
210 */
211 uint16_t GetInformationSubset2() const;
212 /**
213 * Return the Information Subset 3 field in the HT Operation information element.
214 *
215 * \return the Information Subset 3 field in the HT Operation information element
216 */
217 uint16_t GetInformationSubset3() const;
218 /**
219 * Return the first 64 bytes of the Basic MCS Set field in the HT Operation information element.
220 *
221 * \return the first 64 bytes of the Basic MCS Set field in the HT Operation information element
222 */
223 uint64_t GetBasicMcsSet1() const;
224 /**
225 * Return the last 64 bytes of the Basic MCS Set field in the HT Operation information element.
226 *
227 * \return the last 64 bytes of the Basic MCS Set field in the HT Operation information element
228 */
229 uint64_t GetBasicMcsSet2() const;
230
231 /**
232 * Return the secondary channel offset.
233 *
234 * \return the secondary channel offset
235 */
236 uint8_t GetSecondaryChannelOffset() const;
237 /**
238 * Return the STA channel width.
239 *
240 * \return the STA channel width
241 */
242 uint8_t GetStaChannelWidth() const;
243 /**
244 * Return the RIFS mode.
245 *
246 * \return the RIFS mode
247 */
248 uint8_t GetRifsMode() const;
249
250 /**
251 * Return the HT protection.
252 *
253 * \return the HT protection
254 */
255 uint8_t GetHtProtection() const;
256 /**
257 * Return the non GF HT STAs present.
258 *
259 * \return the non GF HT STAs present
260 */
261 uint8_t GetNonGfHtStasPresent() const;
262 /**
263 * Return the OBSS non HT STAs present.
264 *
265 * \return the OBSS non HT STAs present
266 */
267 uint8_t GetObssNonHtStasPresent() const;
268
269 /**
270 * Return dual beacon.
271 *
272 * \return the dual beacon
273 */
274 uint8_t GetDualBeacon() const;
275 /**
276 * Return dual CTS protection.
277 *
278 * \return the dual CTS protection
279 */
280 uint8_t GetDualCtsProtection() const;
281 /**
282 * Return STBC beacon.
283 *
284 * \return the STBC beacon
285 */
286 uint8_t GetStbcBeacon() const;
287 /**
288 * Return LSIG TXOP protection full support.
289 *
290 * \return the LSIG TXOP protection full support
291 */
292 uint8_t GetLSigTxopProtectionFullSupport() const;
293 /**
294 * Return PCO active.
295 *
296 * \return the PCO active
297 */
298 uint8_t GetPcoActive() const;
299 /**
300 * Return phase.
301 *
302 * \return the phase
303 */
304 uint8_t GetPhase() const;
305
306 /**
307 * Return MCS is supported.
308 *
309 * \param mcs MCS
310 *
311 * \return the MCS is supported
312 */
313 bool IsSupportedMcs(uint8_t mcs) const;
314 /**
315 * Return receive highest supported data rate.
316 *
317 * \return receive highest supported data rate
318 */
319 uint16_t GetRxHighestSupportedDataRate() const;
320 /**
321 * Return transmit MCS set defined.
322 *
323 * \return the transmit MCS set defined
324 */
325 uint8_t GetTxMcsSetDefined() const;
326 /**
327 * Return transmit / receive MCS set unequal.
328 *
329 * \return transmit / receive MCS set unequal
330 */
331 uint8_t GetTxRxMcsSetUnequal() const;
332 /**
333 * Return transmit maximum number spatial streams.
334 *
335 * \return transmit maximum number spatial streams
336 */
337 uint8_t GetTxMaxNSpatialStreams() const;
338 /**
339 * Return transmit unequal modulation.
340 *
341 * \return transmit unequal modulation
342 */
343 uint8_t GetTxUnequalModulation() const;
344
345 private:
346 uint16_t GetInformationFieldSize() const override;
347 void SerializeInformationField(Buffer::Iterator start) const override;
348 uint16_t DeserializeInformationField(Buffer::Iterator start, uint16_t length) override;
349
350 uint8_t m_primaryChannel; ///< primary channel
351
352 // HT Information Subset 1
353 uint8_t m_secondaryChannelOffset; ///< secondary channel offset
354 uint8_t m_staChannelWidth; ///< STA channel width
355 uint8_t m_rifsMode; ///< RIFS mode
356 uint8_t m_reservedInformationSubset1; ///< reserved information subset 1
357
358 // HT Information Subset 2
359 uint8_t m_htProtection; ///< HT protection
360 uint8_t m_nonGfHtStasPresent; ///< non GF HT STAs present
361 uint8_t m_reservedInformationSubset2_1; ///< reserved information subset 2-1
362 uint8_t m_obssNonHtStasPresent; ///< OBSS NON HT STAs present
363 uint8_t m_reservedInformationSubset2_2; ///< reserved information subset 2-2
364
365 // HT Information Subset 3
366 uint8_t m_reservedInformationSubset3_1; ///< reserved information subset 3-1
367 uint8_t m_dualBeacon; ///< dual beacon
368 uint8_t m_dualCtsProtection; ///< dual CTS protection
369 uint8_t m_stbcBeacon; ///< STBC beacon
370 uint8_t m_lSigTxopProtectionFullSupport; ///< L-SIG TXOP protection full support
371 uint8_t m_pcoActive; ///< PCO active
372 uint8_t m_pcoPhase; ///< PCO phase
373 uint8_t m_reservedInformationSubset3_2; ///< reserved information subset 3-2
374
375 // Basic MCS Set field
376 uint8_t m_reservedMcsSet1; ///< reserved MCS set 1
377 uint16_t m_rxHighestSupportedDataRate; ///< receive highest supported data rate
378 uint8_t m_reservedMcsSet2; ///< reserved MCS set2
379 uint8_t m_txMcsSetDefined; ///< transmit MCS set defined
380 uint8_t m_txRxMcsSetUnequal; ///< transmit / receive MCS set unequal
381 uint8_t m_txMaxNSpatialStreams; ///< transmit maximum number spatial streams
382 uint8_t m_txUnequalModulation; ///< transmit unequal modulation
383 uint32_t m_reservedMcsSet3; ///< reserved MCS set 3
384 uint8_t m_rxMcsBitmask[MAX_SUPPORTED_MCS]; ///< receive MCS bitmask
385};
386
387} // namespace ns3
388
389#endif /* HT_OPERATION_H */
iterator in a Buffer instance
Definition buffer.h:89
The HT Operation Information Element.
uint8_t GetTxRxMcsSetUnequal() const
Return transmit / receive MCS set unequal.
void SetObssNonHtStasPresent(uint8_t obssNonHtStasPresent)
Set the OBSS non HT STAs present.
uint8_t m_reservedInformationSubset1
reserved information subset 1
uint8_t GetDualBeacon() const
Return dual beacon.
void SetRifsMode(uint8_t rifsMode)
Set the RIFS mode.
uint8_t GetRifsMode() const
Return the RIFS mode.
uint8_t m_obssNonHtStasPresent
OBSS NON HT STAs present.
void SetBasicMcsSet(uint64_t ctrl1, uint64_t ctrl2)
Set the Basic MCS Set field in the HT Operation information element.
uint8_t GetLSigTxopProtectionFullSupport() const
Return LSIG TXOP protection full support.
void SetSecondaryChannelOffset(uint8_t secondaryChannelOffset)
Set the secondary channel offset.
uint8_t GetInformationSubset1() const
Return the Information Subset 1 field in the HT Operation information element.
uint8_t m_reservedInformationSubset3_1
reserved information subset 3-1
uint8_t m_stbcBeacon
STBC beacon.
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)
void SetInformationSubset2(uint16_t ctrl)
Set the Information Subset 2 field in the HT Operation information element.
uint64_t GetBasicMcsSet1() const
Return the first 64 bytes of the Basic MCS Set field in the HT Operation information element.
uint16_t GetInformationFieldSize() const override
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
uint8_t m_reservedInformationSubset3_2
reserved information subset 3-2
void SetPcoActive(uint8_t pcoActive)
Set the PCO active.
void SetTxUnequalModulation(uint8_t txUnequalModulation)
Set the transmit unequal modulation.
uint8_t m_rifsMode
RIFS mode.
uint8_t m_secondaryChannelOffset
secondary channel offset
uint8_t m_rxMcsBitmask[MAX_SUPPORTED_MCS]
receive MCS bitmask
uint16_t m_rxHighestSupportedDataRate
receive highest supported data rate
void SetInformationSubset3(uint16_t ctrl)
Set the Information Subset 3 field in the HT Operation information element.
void SetHtProtection(uint8_t htProtection)
Set the HT protection.
uint8_t GetTxMcsSetDefined() const
Return transmit MCS set defined.
uint8_t m_staChannelWidth
STA channel width.
uint8_t GetPrimaryChannel() const
Return the Primary Channel field in the HT Operation information element.
void SetTxMaxNSpatialStreams(uint8_t maxTxSpatialStreams)
Set the transmit maximum number spatial streams.
void SerializeInformationField(Buffer::Iterator start) const override
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
uint8_t m_txUnequalModulation
transmit unequal modulation
uint16_t GetRxHighestSupportedDataRate() const
Return receive highest supported data rate.
void SetTxRxMcsSetUnequal(uint8_t txRxMcsSetUnequal)
Set the transmit / receive MCS set unequal.
uint8_t m_reservedMcsSet1
reserved MCS set 1
uint8_t m_txMaxNSpatialStreams
transmit maximum number spatial streams
WifiInformationElementId ElementId() const override
Get the wifi information element ID.
uint8_t GetPcoActive() const
Return PCO active.
uint16_t GetInformationSubset3() const
Return the Information Subset 3 field in the HT Operation information element.
uint8_t GetStbcBeacon() const
Return STBC beacon.
void Print(std::ostream &os) const override
Generate human-readable form of IE.
uint8_t m_reservedInformationSubset2_1
reserved information subset 2-1
void SetDualBeacon(uint8_t dualBeacon)
Set the dual beacon.
uint8_t m_dualBeacon
dual beacon
uint8_t m_txMcsSetDefined
transmit MCS set defined
void SetNonGfHtStasPresent(uint8_t nonGfHtStasPresent)
Set the non GF HT STAs present.
uint64_t GetBasicMcsSet2() const
Return the last 64 bytes of the Basic MCS Set field in the HT Operation information element.
uint8_t m_dualCtsProtection
dual CTS protection
uint8_t m_lSigTxopProtectionFullSupport
L-SIG TXOP protection full support.
void SetTxMcsSetDefined(uint8_t txMcsSetDefined)
Set the transmit MCS set defined.
uint8_t GetHtProtection() const
Return the HT protection.
uint8_t m_reservedInformationSubset2_2
reserved information subset 2-2
uint8_t GetDualCtsProtection() const
Return dual CTS protection.
uint8_t m_reservedMcsSet2
reserved MCS set2
uint8_t GetStaChannelWidth() const
Return the STA channel width.
void SetLSigTxopProtectionFullSupport(uint8_t lSigTxopProtectionFullSupport)
Set the LSIG TXOP protection full support.
void SetStaChannelWidth(uint8_t staChannelWidth)
Set the STA channel width.
uint8_t GetSecondaryChannelOffset() const
Return the secondary channel offset.
void SetInformationSubset1(uint8_t ctrl)
Set the Information Subset 1 field in the HT Operation information element.
uint16_t GetInformationSubset2() const
Return the Information Subset 2 field in the HT Operation information element.
void SetRxHighestSupportedDataRate(uint16_t maxSupportedRate)
Set the receive highest supported data rate.
uint8_t m_pcoActive
PCO active.
uint8_t GetTxUnequalModulation() const
Return transmit unequal modulation.
void SetRxMcsBitmask(uint8_t index)
Set the receive MCS bitmask.
uint32_t m_reservedMcsSet3
reserved MCS set 3
void SetPrimaryChannel(uint8_t ctrl)
Set the Primary Channel field in the HT Operation information element.
uint8_t GetObssNonHtStasPresent() const
Return the OBSS non HT STAs present.
void SetDualCtsProtection(uint8_t dualCtsProtection)
Set the dual CTS protection.
uint8_t m_htProtection
HT protection.
void SetPhase(uint8_t pcoPhase)
Set the PCO phase.
bool IsSupportedMcs(uint8_t mcs) const
Return MCS is supported.
uint8_t m_txRxMcsSetUnequal
transmit / receive MCS set unequal
uint8_t GetTxMaxNSpatialStreams() const
Return transmit maximum number spatial streams.
uint8_t GetPhase() const
Return phase.
uint8_t GetNonGfHtStasPresent() const
Return the non GF HT STAs present.
uint8_t m_pcoPhase
PCO phase.
uint8_t m_primaryChannel
primary channel
void SetStbcBeacon(uint8_t stbcBeacon)
Set the STBC beacon.
uint8_t m_nonGfHtStasPresent
non GF HT STAs present
Information element, as defined in 802.11-2007 standard.
#define MAX_SUPPORTED_MCS
This defines the maximum number of supported MCSs that a STA is allowed to have.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
HtProtectionType
HtProtectionType enumeration.
@ NON_MEMBER_PROTECTION
@ NO_PROTECTION
@ TWENTY_MHZ_PROTECTION
@ MIXED_MODE_PROTECTION
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.