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