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