A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ht-capabilities.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2013
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Authors: Ghada Badawy <gbadawy@gmail.com>
7 * Sébastien Deronne <sebastien.deronne@gmail.com>
8 */
9
10#ifndef HT_CAPABILITIES_H
11#define HT_CAPABILITIES_H
12
13#include "ns3/wifi-information-element.h"
14
15/**
16 * This defines the maximum number of supported MCSs that a STA is
17 * allowed to have. Currently this number is set for IEEE 802.11n
18 */
19#define MAX_SUPPORTED_MCS (77)
20
21namespace ns3
22{
23
24/**
25 * \brief The HT Capabilities Information Element
26 * \ingroup wifi
27 *
28 * This class knows how to serialise and deserialise the HT Capabilities Information Element
29 */
31{
32 public:
34
35 // Implementations of pure virtual methods of WifiInformationElement
36 WifiInformationElementId ElementId() const override;
37
38 /**
39 * Set the HT Capabilities Info field in the HT Capabilities information element.
40 *
41 * \param ctrl the HT Capabilities Info field in the HT Capabilities information element
42 */
43 void SetHtCapabilitiesInfo(uint16_t ctrl);
44 /**
45 * Set the A-MPDU Parameters field in the HT Capabilities information element.
46 *
47 * \param ctrl the A-MPDU Parameters field in the HT Capabilities information element
48 */
49 void SetAmpduParameters(uint8_t ctrl);
50 /**
51 * Set the Supported MCS Set field in the HT Capabilities information element.
52 *
53 * \param ctrl1 the first 64 bytes of the Supported MCS Set field in the HT Capabilities
54 * information element
55 * \param ctrl2 the last 64 bytes of the Supported MCS Set field in the HT Capabilities
56 * information element
57 */
58 void SetSupportedMcsSet(uint64_t ctrl1, uint64_t ctrl2);
59 /**
60 * Set the Extended HT Capabilities field in the HT Capabilities information element.
61 *
62 * \param ctrl the Extended HT Capabilities field in the HT Capabilities information element
63 */
64 void SetExtendedHtCapabilities(uint16_t ctrl);
65 /**
66 * Set the Transmit Beamforming (TxBF) Capabilities field in the HT Capabilities information
67 * element.
68 *
69 * \param ctrl the Transmit Beamforming (TxBF) Capabilities field in the HT Capabilities
70 * information element
71 */
73 /**
74 * Set the the Antenna Selection (ASEL) Capabilities field in the HT Capabilities information
75 * element.
76 *
77 * \param ctrl the Antenna Selection (ASEL) Capabilities field in the HT Capabilities
78 * information element
79 */
80 void SetAntennaSelectionCapabilities(uint8_t ctrl);
81
82 /**
83 * Set the LDPC field.
84 *
85 * \param ldpc the LDPC field
86 */
87 void SetLdpc(uint8_t ldpc);
88 /**
89 * Set the supported channel width field.
90 *
91 * \param supportedChannelWidth the supported channel width field
92 */
93 void SetSupportedChannelWidth(uint8_t supportedChannelWidth);
94 /**
95 * Set the short guard interval 20 field.
96 *
97 * \param shortGuardInterval the short guard interval
98 */
99 void SetShortGuardInterval20(uint8_t shortGuardInterval);
100 /**
101 * Set the short guard interval 40 field.
102 *
103 * \param shortGuardInterval the short guard interval
104 */
105 void SetShortGuardInterval40(uint8_t shortGuardInterval);
106 /**
107 * Set the maximum AMSDU length.
108 *
109 * \param maxAmsduLength Either 3839 or 7935
110 */
111 void SetMaxAmsduLength(uint16_t maxAmsduLength);
112 /**
113 * Set the LSIG protection support.
114 *
115 * \param lSigProtection the LSIG protection support field
116 */
117 void SetLSigProtectionSupport(uint8_t lSigProtection);
118
119 /**
120 * Set the maximum AMPDU length.
121 *
122 * \param maxAmpduLength 2^(13 + x) - 1, x in the range 0 to 3
123 */
124 void SetMaxAmpduLength(uint32_t maxAmpduLength);
125
126 /**
127 * Set the receive MCS bitmask.
128 *
129 * \param index the index of the receive MCS
130 */
131 void SetRxMcsBitmask(uint8_t index);
132 /**
133 * Set the receive highest supported data rate.
134 *
135 * \param maxSupportedRate the maximum supported data rate
136 */
137 void SetRxHighestSupportedDataRate(uint16_t maxSupportedRate);
138 /**
139 * Set the transmit MCS set defined.
140 *
141 * \param txMcsSetDefined the TX MCS set defined
142 */
143 void SetTxMcsSetDefined(uint8_t txMcsSetDefined);
144 /**
145 * Set the transmit / receive MCS set unequal.
146 *
147 * \param txRxMcsSetUnequal the TX/RX MCS set unequal field
148 */
149 void SetTxRxMcsSetUnequal(uint8_t txRxMcsSetUnequal);
150 /**
151 * Set the transmit maximum N spatial streams.
152 *
153 * \param maxTxSpatialStreams the maximum number of TX SSs
154 */
155 void SetTxMaxNSpatialStreams(uint8_t maxTxSpatialStreams);
156 /**
157 * Set the transmit unequal modulation.
158 *
159 * \param txUnequalModulation the TX unequal modulation field
160 */
161 void SetTxUnequalModulation(uint8_t txUnequalModulation);
162
163 /**
164 * Return the HT Capabilities Info field in the HT Capabilities information element.
165 *
166 * \return the HT Capabilities Info field in the HT Capabilities information element
167 */
168 uint16_t GetHtCapabilitiesInfo() const;
169 /**
170 * Return the A-MPDU Parameters field in the HT Capabilities information element.
171 *
172 * \return the A-MPDU Parameters field in the HT Capabilities information element
173 */
174 uint8_t GetAmpduParameters() const;
175 /**
176 * Return the first 64 bytes of the Supported MCS Set field in the HT Capabilities information
177 * element.
178 *
179 * \return the first 64 bytes of the Supported MCS Set field in the HT Capabilities information
180 * element
181 */
182 uint64_t GetSupportedMcsSet1() const;
183 /**
184 * Return the last 64 bytes of the Supported MCS Set field in the HT Capabilities information
185 * element.
186 *
187 * \return the last 64 bytes of the Supported MCS Set field in the HT Capabilities information
188 * element
189 */
190 uint64_t GetSupportedMcsSet2() const;
191 /**
192 * Return the Extended HT Capabilities field in the HT Capabilities information element.
193 *
194 * \return the Extended HT Capabilities field in the HT Capabilities information element
195 */
196 uint16_t GetExtendedHtCapabilities() const;
197 /**
198 * Return the Transmit Beamforming (TxBF) Capabilities field in the HT Capabilities information
199 * element.
200 *
201 * \return the Transmit Beamforming (TxBF) Capabilities field in the HT Capabilities information
202 * element
203 */
205 /**
206 * Return the Antenna Selection (ASEL) Capabilities field in the HT Capabilities information
207 * element.
208 *
209 * \return the Antenna Selection (ASEL) Capabilities field in the HT Capabilities information
210 * element
211 */
212 uint8_t GetAntennaSelectionCapabilities() const;
213
214 /**
215 * Return LDPC.
216 *
217 * \return the LDPC value
218 */
219 uint8_t GetLdpc() const;
220 /**
221 * Return the supported channel width.
222 *
223 * \return the supported channel width
224 */
225 uint8_t GetSupportedChannelWidth() const;
226 /**
227 * Return the short guard interval 20 value.
228 *
229 * \return the short guard interval 20 value
230 */
231 uint8_t GetShortGuardInterval20() const;
232 /**
233 * Return the maximum A-MSDU length.
234 *
235 * \return the maximum A-MSDU length
236 */
237 uint16_t GetMaxAmsduLength() const;
238 /**
239 * Return the maximum A-MPDU length.
240 *
241 * \return the maximum A-MPDU length
242 */
244 /**
245 * Return the is MCS supported flag.
246 *
247 * \param mcs is MCS supported flag
248 *
249 * \return true if successful
250 */
251 bool IsSupportedMcs(uint8_t mcs) const;
252 /**
253 * Return the receive highest supported antennas.
254 *
255 * \return the receive highest supported antennas
256 */
257 uint8_t GetRxHighestSupportedAntennas() const;
258
259 private:
260 uint16_t GetInformationFieldSize() const override;
261 void SerializeInformationField(Buffer::Iterator start) const override;
262 uint16_t DeserializeInformationField(Buffer::Iterator start, uint16_t length) override;
263 void Print(std::ostream& os) const override;
264
265 // HT Capabilities Info field
266 uint8_t m_ldpc; ///< LDPC
267 uint8_t m_supportedChannelWidth; ///< supported channel width
268 uint8_t m_smPowerSave; ///< SM power save
269 uint8_t m_greenField; ///< Greenfield
270 uint8_t m_shortGuardInterval20; ///< short guard interval 20 MHz
271 uint8_t m_shortGuardInterval40; ///< short guard interval 40 MHz
272 uint8_t m_txStbc; ///< transmit STBC
273 uint8_t m_rxStbc; ///< receive STBC
274 uint8_t m_htDelayedBlockAck; ///< HT delayed block ack
275 uint8_t m_maxAmsduLength; ///< maximum A-MSDU length
276 uint8_t m_dssMode40; ///< DSS mode 40
277 uint8_t m_psmpSupport; ///< PSMP support
278 uint8_t m_fortyMhzIntolerant; ///< 40 MHz intolerant
279 uint8_t m_lsigProtectionSupport; ///< L-SIG protection support
280
281 // A-MPDU Parameters field
282 uint8_t m_maxAmpduLengthExponent; ///< maximum A-MPDU length
283 uint8_t m_minMpduStartSpace; ///< minimum MPDU start space
284 uint8_t m_ampduReserved; ///< A-MPDU reserved
285
286 // Supported MCS Set field
287 uint8_t m_reservedMcsSet1; ///< reserved MCS set 1
288 uint16_t m_rxHighestSupportedDataRate; ///< receive highest supported data rate
289 uint8_t m_reservedMcsSet2; ///< reserved MCS set 2
290 uint8_t m_txMcsSetDefined; ///< transmit MCS set defined
291 uint8_t m_txRxMcsSetUnequal; ///< transmit / receive MCS set unequal
292 uint8_t m_txMaxNSpatialStreams; ///< transmit maximum number spatial streams
293 uint8_t m_txUnequalModulation; ///< transmit unequal modulation
294 uint32_t m_reservedMcsSet3; ///< reserved MCS set 3
295 uint8_t m_rxMcsBitmask[MAX_SUPPORTED_MCS]; ///< receive MCS bitmask
296
297 // HT Extended Capabilities field
298 uint8_t m_pco; ///< PCO
299 uint8_t m_pcoTransitionTime; ///< PCO transition time
300 uint8_t m_reservedExtendedCapabilities; ///< reserved extended capabilities
301 uint8_t m_mcsFeedback; ///< MCS feedback
302 uint8_t m_htcSupport; ///< HTC support
303 uint8_t m_reverseDirectionResponder; ///< reverse direction responder
304 uint8_t m_reservedExtendedCapabilities2; ///< reserver extended capabilities 2
305
306 // Transmit Beamforming Capabilities field
307 uint8_t m_implicitRxBfCapable; ///< implicit receive BF capable
308 uint8_t m_rxStaggeredSoundingCapable; ///< receive staggered sounding capable
309 uint8_t m_txStaggeredSoundingCapable; ///< transmit staggered sounding capable
310 uint8_t m_rxNdpCapable; ///< receive NDP capable
311 uint8_t m_txNdpCapable; ///< transmit NDP capable
312 uint8_t m_implicitTxBfCapable; ///< implicit transmit BF capable
313 uint8_t m_calibration; ///< calibration
314 uint8_t m_explicitCsiTxBfCapable; ///< explicit CSI transmit BF capable
315 uint8_t m_explicitNoncompressedSteeringCapable; ///< explicit non compressed steering capable
316 uint8_t m_explicitCompressedSteeringCapable; ///< explicit compressed steering capable
317 uint8_t m_explicitTxBfCsiFeedback; ///< explicit transmit BF CSI feedback
318 uint8_t
319 m_explicitNoncompressedBfFeedbackCapable; ///< explicit non compressed BF feedback capable
320 uint8_t m_explicitCompressedBfFeedbackCapable; ///< explicit compressed BF feedback capable
321 uint8_t m_minimalGrouping; ///< minimal grouping
322 uint8_t m_csiNBfAntennasSupported; ///< CSI NBF antenna supported
323 uint8_t m_noncompressedSteeringNBfAntennasSupported; ///< non compressed steering NBF antenna
324 ///< supported
325 uint8_t m_compressedSteeringNBfAntennasSupported; ///< compressed steering NBF antenna supported
326 uint8_t m_csiMaxNRowsBfSupported; ///< CSI maximum number rows BF supported
327 uint8_t m_channelEstimationCapability; ///< channel estimation capability
328 uint8_t m_reservedTxBf; ///< reserved transmit BF
329
330 // ASEL Capabilities field
331 uint8_t m_antennaSelectionCapability; ///< antenna selection capability
332 uint8_t m_explicitCsiFeedbackBasedTxASelCapable; ///< explicit CSI feedback based transmit
333 ///< antenna selection capable
334 uint8_t m_antennaIndicesFeedbackBasedTxASelCapable; ///< antenna indices feedback based transmit
335 ///< antenna selection capable
336 uint8_t m_explicitCsiFeedbackCapable; ///< explicit CSI feedback capable
337 uint8_t m_antennaIndicesFeedbackCapable; ///< antenna indices feedback capable
338 uint8_t m_rxASelCapable; ///< receive antenna selection capable
339 uint8_t m_txSoundingPpdusCapable; ///< sounding PPDUS capable
340 uint8_t m_reservedASel; ///< reserved ASEL
341};
342
343} // namespace ns3
344
345#endif /* HT_CAPABILITY_H */
iterator in a Buffer instance
Definition buffer.h:89
The HT Capabilities Information Element.
uint8_t m_calibration
calibration
void SetLdpc(uint8_t ldpc)
Set the LDPC field.
uint8_t m_reservedExtendedCapabilities2
reserver extended capabilities 2
uint8_t m_htcSupport
HTC support.
uint8_t m_shortGuardInterval40
short guard interval 40 MHz
void SetTxRxMcsSetUnequal(uint8_t txRxMcsSetUnequal)
Set the transmit / receive MCS set unequal.
uint8_t m_shortGuardInterval20
short guard interval 20 MHz
uint16_t GetMaxAmsduLength() const
Return the maximum A-MSDU length.
void SetRxHighestSupportedDataRate(uint16_t maxSupportedRate)
Set the receive highest supported data rate.
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 SetLSigProtectionSupport(uint8_t lSigProtection)
Set the LSIG protection support.
uint16_t GetInformationFieldSize() const override
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
void SetMaxAmsduLength(uint16_t maxAmsduLength)
Set the maximum AMSDU length.
void SetExtendedHtCapabilities(uint16_t ctrl)
Set the Extended HT Capabilities field in the HT Capabilities information element.
void SetAmpduParameters(uint8_t ctrl)
Set the A-MPDU Parameters field in the HT Capabilities information element.
uint8_t GetSupportedChannelWidth() const
Return the supported channel width.
uint8_t GetRxHighestSupportedAntennas() const
Return the receive highest supported antennas.
uint8_t m_explicitCompressedBfFeedbackCapable
explicit compressed BF feedback capable
uint8_t m_compressedSteeringNBfAntennasSupported
compressed steering NBF antenna supported
void SetTxMaxNSpatialStreams(uint8_t maxTxSpatialStreams)
Set the transmit maximum N spatial streams.
uint8_t m_rxStaggeredSoundingCapable
receive staggered sounding capable
uint8_t m_reservedTxBf
reserved transmit BF
uint8_t m_txMcsSetDefined
transmit MCS set defined
uint8_t m_maxAmpduLengthExponent
maximum A-MPDU length
void Print(std::ostream &os) const override
Generate human-readable form of IE.
uint64_t GetSupportedMcsSet1() const
Return the first 64 bytes of the Supported MCS Set field in the HT Capabilities information element.
uint8_t m_txSoundingPpdusCapable
sounding PPDUS capable
void SetAntennaSelectionCapabilities(uint8_t ctrl)
Set the the Antenna Selection (ASEL) Capabilities field in the HT Capabilities information element.
void SetSupportedMcsSet(uint64_t ctrl1, uint64_t ctrl2)
Set the Supported MCS Set field in the HT Capabilities information element.
uint8_t m_dssMode40
DSS mode 40.
WifiInformationElementId ElementId() const override
Get the wifi information element ID.
uint8_t m_minimalGrouping
minimal grouping
uint8_t m_minMpduStartSpace
minimum MPDU start space
uint8_t m_txRxMcsSetUnequal
transmit / receive MCS set unequal
void SetTxBfCapabilities(uint32_t ctrl)
Set the Transmit Beamforming (TxBF) Capabilities field in the HT Capabilities information element.
uint8_t m_txStaggeredSoundingCapable
transmit staggered sounding capable
uint8_t m_maxAmsduLength
maximum A-MSDU length
uint8_t m_implicitTxBfCapable
implicit transmit BF capable
uint8_t m_htDelayedBlockAck
HT delayed block ack.
void SetShortGuardInterval20(uint8_t shortGuardInterval)
Set the short guard interval 20 field.
uint8_t m_csiMaxNRowsBfSupported
CSI maximum number rows BF supported.
uint8_t m_explicitTxBfCsiFeedback
explicit transmit BF CSI feedback
uint8_t GetLdpc() const
Return LDPC.
uint8_t m_rxNdpCapable
receive NDP capable
uint8_t m_rxMcsBitmask[MAX_SUPPORTED_MCS]
receive MCS bitmask
void SetHtCapabilitiesInfo(uint16_t ctrl)
Set the HT Capabilities Info field in the HT Capabilities information element.
void SetTxUnequalModulation(uint8_t txUnequalModulation)
Set the transmit unequal modulation.
uint8_t m_reverseDirectionResponder
reverse direction responder
uint8_t m_txNdpCapable
transmit NDP capable
void SetTxMcsSetDefined(uint8_t txMcsSetDefined)
Set the transmit MCS set defined.
uint8_t m_txUnequalModulation
transmit unequal modulation
uint8_t m_reservedExtendedCapabilities
reserved extended capabilities
uint8_t m_lsigProtectionSupport
L-SIG protection support.
uint16_t GetHtCapabilitiesInfo() const
Return the HT Capabilities Info field in the HT Capabilities information element.
uint8_t GetAntennaSelectionCapabilities() const
Return the Antenna Selection (ASEL) Capabilities field in the HT Capabilities information element.
uint8_t m_explicitCsiFeedbackCapable
explicit CSI feedback capable
uint8_t m_txMaxNSpatialStreams
transmit maximum number spatial streams
uint8_t m_explicitNoncompressedBfFeedbackCapable
explicit non compressed BF feedback capable
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_pcoTransitionTime
PCO transition time.
uint64_t GetSupportedMcsSet2() const
Return the last 64 bytes of the Supported MCS Set field in the HT Capabilities information element.
uint8_t m_reservedMcsSet2
reserved MCS set 2
uint32_t GetTxBfCapabilities() const
Return the Transmit Beamforming (TxBF) Capabilities field in the HT Capabilities information element.
uint8_t m_antennaIndicesFeedbackBasedTxASelCapable
antenna indices feedback based transmit antenna selection capable
uint8_t m_explicitNoncompressedSteeringCapable
explicit non compressed steering capable
void SetRxMcsBitmask(uint8_t index)
Set the receive MCS bitmask.
uint8_t m_implicitRxBfCapable
implicit receive BF capable
void SetSupportedChannelWidth(uint8_t supportedChannelWidth)
Set the supported channel width field.
bool IsSupportedMcs(uint8_t mcs) const
Return the is MCS supported flag.
uint8_t GetAmpduParameters() const
Return the A-MPDU Parameters field in the HT Capabilities information element.
uint8_t m_mcsFeedback
MCS feedback.
uint8_t m_fortyMhzIntolerant
40 MHz intolerant
uint8_t m_channelEstimationCapability
channel estimation capability
uint8_t m_rxASelCapable
receive antenna selection capable
uint16_t m_rxHighestSupportedDataRate
receive highest supported data rate
uint8_t m_csiNBfAntennasSupported
CSI NBF antenna supported.
uint8_t m_antennaSelectionCapability
antenna selection capability
uint8_t m_txStbc
transmit STBC
uint16_t GetExtendedHtCapabilities() const
Return the Extended HT Capabilities field in the HT Capabilities information element.
uint8_t m_ampduReserved
A-MPDU reserved.
uint8_t m_antennaIndicesFeedbackCapable
antenna indices feedback capable
uint8_t m_supportedChannelWidth
supported channel width
uint32_t m_reservedMcsSet3
reserved MCS set 3
uint8_t m_greenField
Greenfield.
uint32_t GetMaxAmpduLength() const
Return the maximum A-MPDU length.
uint8_t GetShortGuardInterval20() const
Return the short guard interval 20 value.
uint8_t m_noncompressedSteeringNBfAntennasSupported
non compressed steering NBF antenna supported
void SetMaxAmpduLength(uint32_t maxAmpduLength)
Set the maximum AMPDU length.
uint8_t m_explicitCsiFeedbackBasedTxASelCapable
explicit CSI feedback based transmit antenna selection capable
void SetShortGuardInterval40(uint8_t shortGuardInterval)
Set the short guard interval 40 field.
uint8_t m_psmpSupport
PSMP support.
uint8_t m_reservedMcsSet1
reserved MCS set 1
uint8_t m_explicitCsiTxBfCapable
explicit CSI transmit BF capable
uint8_t m_explicitCompressedSteeringCapable
explicit compressed steering capable
uint8_t m_reservedASel
reserved ASEL
uint8_t m_rxStbc
receive STBC
uint8_t m_smPowerSave
SM power save.
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.
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.