A Discrete-Event Network Simulator
API
he-capabilities.cc
Go to the documentation of this file.
1/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2016
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: S├ębastien Deronne <sebastien.deronne@gmail.com>
19 */
20
21#include "he-capabilities.h"
22#include <algorithm>
23
24namespace ns3 {
25
27 : m_plusHtcHeSupport (0),
28 m_twtRequesterSupport (0),
29 m_twtResponderSupport (0),
30 m_fragmentationSupport (0),
31 m_maximumNumberOfFragmentedMsdus (0),
32 m_minimumFragmentSize (0),
33 m_triggerFrameMacPaddingDuration (0),
34 m_multiTidAggregationRxSupport (0),
35 m_heLinkAdaptation (0),
36 m_allAckSupport (0),
37 m_trsSupport (0),
38 m_bsrSupport (0),
39 m_broadcastTwtSupport (0),
40 m_32bitBaBitmapSupport (0),
41 m_muCascadeSupport (0),
42 m_ackEnabledAggregationSupport (0),
43 m_omControlSupport (0),
44 m_ofdmaRaSupport (0),
45 m_maxAmpduLengthExponent (0),
46 m_amsduFragmentationSupport (0),
47 m_flexibleTwtScheduleSupport (0),
48 m_rxControlFrameToMultiBss (0),
49 m_bsrpBqrpAmpduAggregation (0),
50 m_qtpSupport (0),
51 m_bqrSupport (0),
52 m_psrResponder (0),
53 m_ndpFeedbackReportSupport (0),
54 m_opsSupport (0),
55 m_amsduNotUnderBaInAmpduSupport (0),
56 m_multiTidAggregationTxSupport (0),
57 m_heSubchannelSelectiveTxSupport (0),
58 m_ul2x996ToneRuSupport (0),
59 m_omControlUlMuDataDisableRxSupport (0),
60 m_heDynamicSmPowerSave (0),
61 m_puncturedSoundingSupport (0),
62 m_heVhtTriggerFrameRxSupport (0),
63 m_channelWidthSet (0),
64 m_puncturedPreambleRx (0),
65 m_deviceClass (0),
66 m_ldpcCodingInPayload (0),
67 m_heSuPpdu1xHeLtf800nsGi (0),
68 m_midambleRxMaxNsts (0),
69 m_ndp4xHeLtfAnd32msGi (0),
70 m_stbcTxLeq80MHz (0),
71 m_stbcRxLeq80MHz (0),
72 m_dopplerTx (0),
73 m_dopplerRx (0),
74 m_fullBwUlMuMimo (0),
75 m_partialBwUlMuMimo (0),
76 m_dcmMaxConstellationTx (0),
77 m_dcmMaxNssTx (0),
78 m_dcmMaxConstellationRx (0),
79 m_dcmMaxNssRx (0),
80 m_rxPartialBwSuInHeMu (0),
81 m_suBeamformer (0),
82 m_suBeamformee (0),
83 m_muBeamformer (0),
84 m_beamformeeStsForSmallerOrEqualThan80Mhz (0),
85 m_beamformeeStsForLargerThan80Mhz (0),
86 m_numberOfSoundingDimensionsForSmallerOrEqualThan80Mhz (0),
87 m_numberOfSoundingDimensionsForLargerThan80Mhz (0),
88 m_ngEqual16ForSuFeedbackSupport (0),
89 m_ngEqual16ForMuFeedbackSupport (0),
90 m_codebookSize42SuFeedback (0),
91 m_codebookSize75MuFeedback (0),
92 m_triggeredSuBfFeedback (0),
93 m_triggeredMuBfFeedback (0),
94 m_triggeredCqiFeedback (0),
95 m_erPartialBandwidth (0),
96 m_dlMuMimoOnPartialBandwidth (0),
97 m_ppeThresholdPresent (0),
98 m_psrBasedSrSupport (0),
99 m_powerBoostFactorAlphaSupport (0),
100 m_hePpdu4xHeLtf800nsGi (0),
101 m_maxNc (0),
102 m_stbcTxGt80MHz (0),
103 m_stbcRxGt80MHz (0),
104 m_heErSuPpdu4xHeLtf08sGi (0),
105 m_hePpdu20MHzIn40MHz24GHz (0),
106 m_hePpdu20MHzIn160MHz (0),
107 m_hePpdu80MHzIn160MHz (0),
108 m_heErSuPpdu1xHeLtf08Gi (0),
109 m_midamble2xAnd1xHeLtf (0),
110 m_dcmMaxRu (0),
111 m_longerThan16HeSigbOfdm (0),
112 m_nonTriggeredCqiFeedback (0),
113 m_tx1024QamLt242Ru (0),
114 m_rx1024QamLt242Ru (0),
115 m_rxFullBwSuInHeMuCompressedSigB (0),
116 m_rxFullBwSuInHeMuNonCompressedSigB (0),
117 m_nominalPacketPadding (0),
118 m_maxHeLtfRxInHeMuMoreThanOneRu (0),
119 m_highestNssSupportedM1 (0),
120 m_highestMcsSupported (0)
121{
122 m_txBwMap.resize (8,0);
123 m_rxBwMap.resize (8,0);
124}
125
128{
129 return IE_EXTENSION;
130}
131
134{
136}
137
138uint16_t
140{
141 // IEEE 802.11ax-2021 9.4.2.248 HE Capabilities element
142 // Element ID Extension (1) + HE MAC Capabilities Information (6)
143 // + HE PHY Capabilities Information (11) + Supported HE-MCS And NSS Set (4)
144 // TODO: Supported HE-MCS And NSS Set field has variable length (4, 8 or 12)
145 // TODO: PPE Thresholds field (optional) is not implemented
146 return 22;
147}
148
149void
151{
152 //write the corresponding value for each bit
153 start.WriteHtolsbU32 (GetHeMacCapabilitiesInfo1 ());
154 start.WriteU16 (GetHeMacCapabilitiesInfo2 ());
155 start.WriteHtolsbU64 (GetHePhyCapabilitiesInfo1 ());
156 start.WriteHtolsbU16 (GetHePhyCapabilitiesInfo2 ());
157 start.WriteU8 (GetHePhyCapabilitiesInfo3 ());
158 start.WriteHtolsbU32 (GetSupportedMcsAndNss ());
159 // TODO: add another 32-bits field if 160 MHz channel is supported (variable length)
160 // TODO: optional PPE Threshold field (variable length)
161}
162
163uint16_t
165{
167 uint32_t macCapabilities1 = i.ReadLsbtohU32 ();
168 uint16_t macCapabilities2 = i.ReadLsbtohU16 ();
169 uint64_t phyCapabilities1 = i.ReadLsbtohU64 ();
170 uint64_t phyCapabilities2 = i.ReadLsbtohU16 ();
171 uint8_t phyCapabilities3 = i.ReadU8 ();
172 uint32_t mcsset = i.ReadU32 ();
173 SetHeMacCapabilitiesInfo (macCapabilities1, macCapabilities2);
174 SetHePhyCapabilitiesInfo (phyCapabilities1, phyCapabilities2, phyCapabilities3);
175 SetSupportedMcsAndNss (mcsset);
176 // TODO: add another 32-bits field if 160 MHz channel is supported (variable length)
177 // TODO: optional PPE Threshold field (variable length)
178 return length;
179}
180
181void
183{
184 m_plusHtcHeSupport = ctrl1 & 0x01;
185 m_twtRequesterSupport = (ctrl1 >> 1) & 0x01;
186 m_twtResponderSupport = (ctrl1 >> 2) & 0x01;
187 m_fragmentationSupport = (ctrl1 >> 3) & 0x03;
188 m_maximumNumberOfFragmentedMsdus = (ctrl1 >> 5) & 0x07;
189 m_minimumFragmentSize = (ctrl1 >> 8) & 0x03;
190 m_triggerFrameMacPaddingDuration = (ctrl1 >> 10) & 0x03;
191 m_multiTidAggregationRxSupport = (ctrl1 >> 12) & 0x07;
192 m_heLinkAdaptation = (ctrl1 >> 15) & 0x03;
193 m_allAckSupport = (ctrl1 >> 17) & 0x01;
194 m_trsSupport = (ctrl1 >> 18) & 0x01;
195 m_bsrSupport = (ctrl1 >> 19) & 0x01;
196 m_broadcastTwtSupport = (ctrl1 >> 20) & 0x01;
197 m_32bitBaBitmapSupport = (ctrl1 >> 21) & 0x01;
198 m_muCascadeSupport = (ctrl1 >> 22) & 0x01;
199 m_ackEnabledAggregationSupport = (ctrl1 >> 23) & 0x01;
200 // IEEE 802.11ax-2021 9.4.2.248.2 HE MAC Capabilities
201 // Bit 24 is reserved
202 m_omControlSupport = (ctrl1 >> 25) & 0x01;
203 m_ofdmaRaSupport = (ctrl1 >> 26) & 0x01;
204 m_maxAmpduLengthExponent = (ctrl1 >> 27) & 0x03;
205 m_amsduFragmentationSupport = (ctrl1 >> 29) & 0x01;
206 m_flexibleTwtScheduleSupport = (ctrl1 >> 30) & 0x01;
207 m_rxControlFrameToMultiBss = (ctrl1 >> 31) & 0x01;
208 m_bsrpBqrpAmpduAggregation = ctrl2 & 0x01;
209 m_qtpSupport = (ctrl2 >> 1) & 0x01;
210 m_bqrSupport = (ctrl2 >> 2) & 0x01;
211 m_psrResponder = (ctrl2 >> 3) & 0x01;
212 m_ndpFeedbackReportSupport = (ctrl2 >> 4) & 0x01;
213 m_opsSupport = (ctrl2 >> 5) & 0x01;
214 m_amsduNotUnderBaInAmpduSupport = (ctrl2 >> 6) & 0x01;
215 m_multiTidAggregationTxSupport = (ctrl2 >> 7) & 0x07;
216 m_heSubchannelSelectiveTxSupport = (ctrl2 >> 10) & 0x01;
217 m_ul2x996ToneRuSupport = (ctrl2 >> 11) & 0x01;
218 m_omControlUlMuDataDisableRxSupport = (ctrl2 >> 12) & 0x01;
219 m_heDynamicSmPowerSave = (ctrl2 >> 13) & 0x01;
220 m_puncturedSoundingSupport = (ctrl2 >> 14) & 0x01;
221 m_heVhtTriggerFrameRxSupport = (ctrl2 >> 15) & 0x01;
222}
223
226{
227 uint32_t val = 0;
228 val |= m_plusHtcHeSupport & 0x01;
229 val |= (m_twtRequesterSupport & 0x01) << 1;
230 val |= (m_twtResponderSupport & 0x01) << 2;
231 val |= (m_fragmentationSupport & 0x03) << 3;
232 val |= (m_maximumNumberOfFragmentedMsdus & 0x07) << 5;
233 val |= (m_minimumFragmentSize & 0x03) << 8;
234 val |= (m_triggerFrameMacPaddingDuration & 0x03) << 10;
235 val |= (m_multiTidAggregationRxSupport & 0x07) << 12;
236 val |= (m_heLinkAdaptation & 0x03) << 15;
237 val |= (m_allAckSupport & 0x01) << 17;
238 val |= (m_trsSupport & 0x01) << 18;
239 val |= (m_bsrSupport & 0x01) << 19;
240 val |= (m_broadcastTwtSupport & 0x01) << 20;
241 val |= (m_32bitBaBitmapSupport & 0x01) << 21;
242 val |= (m_muCascadeSupport & 0x01) << 22;
243 val |= (m_ackEnabledAggregationSupport & 0x01) << 23;
244 // IEEE 802.11ax-2021 9.4.2.248.2 HE MAC Capabilities
245 // Bit 24 is reserved
246 val |= (m_omControlSupport & 0x01) << 25;
247 val |= (m_ofdmaRaSupport & 0x01) << 26;
248 val |= (m_maxAmpduLengthExponent & 0x03) << 27;
249 val |= (m_amsduFragmentationSupport & 0x01) << 29;
250 val |= (m_flexibleTwtScheduleSupport & 0x01) << 30;
251 val |= (m_rxControlFrameToMultiBss & 0x01) << 31;
252 return val;
253}
254
255uint16_t
257{
258 uint16_t val = 0;
259 val |= m_bsrpBqrpAmpduAggregation & 0x01;
260 val |= (m_qtpSupport & 0x01) << 1;
261 val |= (m_bqrSupport & 0x01) << 2;
262 val |= (m_psrResponder & 0x01) << 3;
263 val |= (m_ndpFeedbackReportSupport & 0x01) << 4;
264 val |= (m_opsSupport & 0x01) << 5;
265 val |= (m_amsduNotUnderBaInAmpduSupport & 0x01) << 6;
266 val |= (m_multiTidAggregationTxSupport & 0x07) << 7;
267 val |= (m_heSubchannelSelectiveTxSupport & 0x01) << 10;
268 val |= (m_ul2x996ToneRuSupport & 0x01) << 11;
269 val |= (m_omControlUlMuDataDisableRxSupport & 0x01) << 12;
270 val |= (m_heDynamicSmPowerSave & 0x01) << 13;
271 val |= (m_puncturedSoundingSupport & 0x01) << 14;
272 val |= (m_heVhtTriggerFrameRxSupport & 0x01) << 15;
273 return val;
274}
275
276void
277HeCapabilities::SetHePhyCapabilitiesInfo (uint64_t ctrl1, uint16_t ctrl2, uint8_t ctrl3)
278{
279 // IEEE 802.11ax-2021 9.4.2.248.2 HE MAC Capabilities
280 // Bit 0 is reserved
281 m_channelWidthSet = (ctrl1 >> 1) & 0x7f;
282 m_puncturedPreambleRx = (ctrl1 >> 8) & 0x0f;
283 m_deviceClass = (ctrl1 >> 12) & 0x01;
284 m_ldpcCodingInPayload = (ctrl1 >> 13) & 0x01;
285 m_heSuPpdu1xHeLtf800nsGi = (ctrl1 >> 14) & 0x01;
286 m_midambleRxMaxNsts = (ctrl1 >> 15) & 0x03;
287 m_ndp4xHeLtfAnd32msGi = (ctrl1 >> 17) & 0x01;
288 m_stbcTxLeq80MHz = (ctrl1 >> 18) & 0x01;
289 m_stbcRxLeq80MHz = (ctrl1 >> 19) & 0x01;
290 m_dopplerTx = (ctrl1 >> 20) & 0x01;
291 m_dopplerRx = (ctrl1 >> 21) & 0x01;
292 m_fullBwUlMuMimo = (ctrl1 >> 22) & 0x01;
293 m_partialBwUlMuMimo = (ctrl1 >> 23) & 0x01;
294 m_dcmMaxConstellationTx = (ctrl1 >> 24) & 0x03;
295 m_dcmMaxNssTx = (ctrl1 >> 26) & 0x01;
296 m_dcmMaxConstellationRx = (ctrl1 >> 27) & 0x03;
297 m_dcmMaxNssRx = (ctrl1 >> 29) & 0x01;
298 m_rxPartialBwSuInHeMu = (ctrl1 >> 30) & 0x01;
299 m_suBeamformer = (ctrl1 >> 31) & 0x01;
300 m_suBeamformee = (ctrl1 >> 32) & 0x01;
301 m_muBeamformer = (ctrl1 >> 33) & 0x01;
302 m_beamformeeStsForSmallerOrEqualThan80Mhz = (ctrl1 >> 34) & 0x07;
303 m_beamformeeStsForLargerThan80Mhz = (ctrl1 >> 37) & 0x07;
306 m_ngEqual16ForSuFeedbackSupport = (ctrl1 >> 46) & 0x01;
307 m_ngEqual16ForMuFeedbackSupport = (ctrl1 >> 47) & 0x01;
308 m_codebookSize42SuFeedback = (ctrl1 >> 48) & 0x01;
309 m_codebookSize75MuFeedback = (ctrl1 >> 49) & 0x01;
310 m_triggeredSuBfFeedback = (ctrl1 >> 50) & 0x01;
311 m_triggeredMuBfFeedback = (ctrl1 >> 51) & 0x01;
312 m_triggeredCqiFeedback = (ctrl1 >> 52) & 0x01;
313 m_erPartialBandwidth = (ctrl1 >> 53) & 0x01;
314 m_dlMuMimoOnPartialBandwidth = (ctrl1 >> 54) & 0x01;
315 m_ppeThresholdPresent = (ctrl1 >> 55) & 0x01;
316 m_psrBasedSrSupport = (ctrl1 >> 56) & 0x01;
317 m_powerBoostFactorAlphaSupport = (ctrl1 >> 57) & 0x01;
318 m_hePpdu4xHeLtf800nsGi = ctrl2 & 0x01;
319 m_maxNc = (ctrl1 >> 59) & 0x07;
320 m_stbcTxGt80MHz = (ctrl1 >> 62) & 0x01;
321 m_stbcRxGt80MHz = (ctrl1 >> 63) & 0x01;
322 m_heErSuPpdu4xHeLtf08sGi = ctrl2 & 0x01;
323 m_hePpdu20MHzIn40MHz24GHz = (ctrl2 >> 1) & 0x01;
324 m_hePpdu20MHzIn160MHz = (ctrl2 >> 2) & 0x01;
325 m_hePpdu80MHzIn160MHz = (ctrl2 >> 3) & 0x01;
326 m_heErSuPpdu1xHeLtf08Gi = (ctrl2 >> 4) & 0x01;
327 m_midamble2xAnd1xHeLtf = (ctrl2 >> 5) & 0x01;
328 m_dcmMaxRu = (ctrl2 >> 6) & 0x03;
329 m_longerThan16HeSigbOfdm = (ctrl2 >> 8) & 0x01;
330 m_nonTriggeredCqiFeedback = (ctrl2 >> 9) & 0x01;
331 m_tx1024QamLt242Ru = (ctrl2 >> 10) & 0x01;
332 m_rx1024QamLt242Ru = (ctrl2 >> 11) & 0x01;
333 m_rxFullBwSuInHeMuCompressedSigB = (ctrl2 >> 12) & 0x01;
334 m_rxFullBwSuInHeMuNonCompressedSigB = (ctrl2 >> 13) & 0x01;
335 m_nominalPacketPadding = (ctrl2 >> 14) & 0x03;
336 m_maxHeLtfRxInHeMuMoreThanOneRu = ctrl3 & 0x01;
337 // IEEE 802.11ax-2021 9.4.2.248.2 HE MAC Capabilities
338 // Bits 81-87 are reserved
339}
340
341uint64_t
343{
344 uint64_t val = 0;
345 // IEEE 802.11ax-2021 9.4.2.248.2 HE MAC Capabilities
346 // Bit 0 is reserved
347 val |= (m_channelWidthSet & 0x7f) << 1;
348 val |= (m_puncturedPreambleRx & 0x0f) << 8;
349 val |= (m_deviceClass & 0x01) << 12;
350 val |= (m_ldpcCodingInPayload & 0x01) << 13;
351 val |= (m_heSuPpdu1xHeLtf800nsGi & 0x01) << 14;
352 val |= (m_midambleRxMaxNsts & 0x03) << 15;
353 val |= (m_ndp4xHeLtfAnd32msGi & 0x01) << 17;
354 val |= (m_stbcTxLeq80MHz & 0x01) << 18;
355 val |= (m_stbcRxLeq80MHz & 0x01) << 19;
356 val |= (m_dopplerTx & 0x01) << 20;
357 val |= (m_dopplerRx & 0x01) << 21;
358 val |= (m_fullBwUlMuMimo & 0x01) << 22;
359 val |= (m_partialBwUlMuMimo & 0x01) << 23;
360 val |= (m_dcmMaxConstellationTx & 0x03) << 24;
361 val |= (m_dcmMaxNssTx & 0x01) << 26;
362 val |= (m_dcmMaxConstellationRx & 0x03) << 27;
363 val |= (m_dcmMaxNssRx & 0x01) << 29;
364 val |= (m_rxPartialBwSuInHeMu & 0x01) << 30;
365 val |= (m_suBeamformer & 0x01) << 31;
366 val |= (static_cast<uint64_t> (m_suBeamformee) & 0x01) << 32;
367 val |= (static_cast<uint64_t> (m_muBeamformer) & 0x01) << 33;
368 val |= (static_cast<uint64_t> (m_beamformeeStsForSmallerOrEqualThan80Mhz) & 0x07) << 34;
369 val |= (static_cast<uint64_t> (m_beamformeeStsForLargerThan80Mhz) & 0x07) << 37;
370 val |= (static_cast<uint64_t> (m_numberOfSoundingDimensionsForSmallerOrEqualThan80Mhz) & 0x07) << 40;
371 val |= (static_cast<uint64_t> (m_numberOfSoundingDimensionsForLargerThan80Mhz) & 0x07) << 43;
372 val |= (static_cast<uint64_t> (m_ngEqual16ForSuFeedbackSupport) & 0x01) << 46;
373 val |= (static_cast<uint64_t> (m_ngEqual16ForMuFeedbackSupport) & 0x01) << 47;
374 val |= (static_cast<uint64_t> (m_codebookSize42SuFeedback) & 0x01) << 48;
375 val |= (static_cast<uint64_t> (m_codebookSize75MuFeedback) & 0x01) << 49;
376 val |= (static_cast<uint64_t> (m_triggeredSuBfFeedback) & 0x01) << 50;
377 val |= (static_cast<uint64_t> (m_triggeredMuBfFeedback) & 0x01) << 51;
378 val |= (static_cast<uint64_t> (m_triggeredCqiFeedback) & 0x01) << 52;
379 val |= (static_cast<uint64_t> (m_erPartialBandwidth) & 0x01) << 53;
380 val |= (static_cast<uint64_t> (m_dlMuMimoOnPartialBandwidth) & 0x01) << 54;
381 val |= (static_cast<uint64_t> (m_ppeThresholdPresent) & 0x01) << 55;
382 val |= (static_cast<uint64_t> (m_psrBasedSrSupport) & 0x01) << 56;
383 val |= (static_cast<uint64_t> (m_powerBoostFactorAlphaSupport) & 0x01) << 57;
384 val |= (static_cast<uint64_t> (m_hePpdu4xHeLtf800nsGi) & 0x01) << 58;
385 val |= (static_cast<uint64_t> (m_maxNc) & 0x07) << 59;
386 val |= (static_cast<uint64_t> (m_stbcTxGt80MHz) & 0x01) << 62;
387 val |= (static_cast<uint64_t> (m_stbcRxGt80MHz) & 0x01) << 63;
388 return val;
389}
390
391uint16_t
393{
394 uint16_t val = 0;
395 val |= m_heErSuPpdu4xHeLtf08sGi & 0x01;
396 val |= (m_hePpdu20MHzIn40MHz24GHz & 0x01) << 1;
397 val |= (m_hePpdu20MHzIn160MHz & 0x01) << 2;
398 val |= (m_hePpdu80MHzIn160MHz & 0x01) << 3;
399 val |= (m_heErSuPpdu1xHeLtf08Gi & 0x01) << 4;
400 val |= (m_midamble2xAnd1xHeLtf & 0x01) << 5;
401 val |= (m_dcmMaxRu & 0x03) << 6;
402 val |= (m_longerThan16HeSigbOfdm & 0x01) << 8;
403 val |= (m_nonTriggeredCqiFeedback & 0x01) << 9;
404 val |= (m_tx1024QamLt242Ru & 0x01) << 10;
405 val |= (m_rx1024QamLt242Ru & 0x01) << 11;
406 val |= (m_rxFullBwSuInHeMuCompressedSigB & 0x01) << 12;
407 val |= (m_rxFullBwSuInHeMuNonCompressedSigB & 0x01) << 13;
408 val |= (m_nominalPacketPadding & 0x03) << 14;
409 return val;
410}
411
412uint8_t
414{
415 uint8_t val = 0;
417 // IEEE 802.11ax-2021 9.4.2.248.2 HE MAC Capabilities
418 // Bits 81-87 are reserved
419 return val;
420}
421
422void
424{
425 m_highestNssSupportedM1 = ctrl & 0x07;
426 m_highestMcsSupported = (ctrl >> 3) & 0x07;
428 uint8_t i;
429 for (i = 0; i < 5; i++)
430 {
431 m_txBwMap[i] = (ctrl >> (6 + i)) & 0x01;
432 }
433 for (i = 0; i < 5; i++)
434 {
435 m_rxBwMap[i] = (ctrl >> (11 + i)) & 0x01;
436 }
437 // TODO: MCS NSS Descriptors
438}
439
440uint16_t
442{
443 uint16_t val = 0;
444 val |= m_highestNssSupportedM1 & 0x07;
445 val |= (m_highestMcsSupported & 0x07) << 3;
446 uint8_t i;
447 for (i = 0; i < 5; i++)
448 {
449 val |= (m_txBwMap[i] & 0x01) << (6 + 1);
450 }
451 for (i = 0; i < 5; i++)
452 {
453 val |= (m_rxBwMap[i] & 0x01) << (11 + 1);
454 }
455 // TODO: MCS NSS Descriptors
456 return val;
457}
458
459// TODO: PPE threshold
460
461bool
463{
464 NS_ASSERT (mcs >= 0 && mcs <= 11);
465 if (mcs <= 7)
466 {
467 return true;
468 }
469 if (mcs == 8 && m_highestMcsSupported >= 1)
470 {
471 return true;
472 }
473 if (mcs == 9 && m_highestMcsSupported >= 2)
474 {
475 return true;
476 }
477 if (mcs == 10 && m_highestMcsSupported >= 3)
478 {
479 return true;
480 }
481 if (mcs == 11 && m_highestMcsSupported == 4)
482 {
483 return true;
484 }
485 return false;
486}
487
488bool
490{
491 NS_ASSERT (mcs >= 0 && mcs <= 11);
492 if (mcs <= 7)
493 {
494 return true;
495 }
496 if (mcs == 8 && m_highestMcsSupported >= 1)
497 {
498 return true;
499 }
500 if (mcs == 9 && m_highestMcsSupported >= 2)
501 {
502 return true;
503 }
504 if (mcs == 10 && m_highestMcsSupported >= 3)
505 {
506 return true;
507 }
508 if (mcs == 11 && m_highestMcsSupported == 4)
509 {
510 return true;
511 }
512 return false;
513}
514
515void
516HeCapabilities::SetChannelWidthSet (uint8_t channelWidthSet)
517{
518 NS_ASSERT (channelWidthSet <= 0x2f);
519 m_channelWidthSet = channelWidthSet;
520}
521
522void
523HeCapabilities::SetLdpcCodingInPayload (uint8_t ldpcCodingInPayload)
524{
525 m_ldpcCodingInPayload = ldpcCodingInPayload;
526}
527
528void
529HeCapabilities::SetHeSuPpdu1xHeLtf800nsGi (bool heSuPpdu1xHeLtf800nsGi)
530{
531 m_heSuPpdu1xHeLtf800nsGi = (heSuPpdu1xHeLtf800nsGi ? 1 : 0);
532}
533
534void
536{
537 m_hePpdu4xHeLtf800nsGi = (hePpdu4xHeLtf800nsGi ? 1 : 0);
538}
539
540void
542{
543 for (uint8_t i = 0; i <= 3; i++)
544 {
545 if ((1ul << (20 + i)) - 1 == maxAmpduLength)
546 {
548 return;
549 }
550 }
551 NS_ABORT_MSG ("Invalid A-MPDU Max Length value");
552}
553
554void
556{
557 NS_ASSERT (mcs >= 7 && mcs <= 11);
558 m_highestMcsSupported = mcs - 7;
559}
560
561void
563{
564 NS_ASSERT (nss >= 1 && nss <= 8);
565 m_highestNssSupportedM1 = nss - 1;
566}
567
568uint8_t
570{
571 return m_channelWidthSet;
572}
573
574uint8_t
576{
578}
579
580bool
582{
583 return (m_heSuPpdu1xHeLtf800nsGi == 1);
584}
585
586bool
588{
589 return (m_hePpdu4xHeLtf800nsGi == 1);
590}
591
592
593uint8_t
595{
596 return m_highestMcsSupported + 7;
597}
598
599uint8_t
601{
602 return m_highestNssSupportedM1 + 1;
603}
604
607{
608 return std::min<uint32_t> ((1ul << (20 + m_maxAmpduLengthExponent)) - 1, 6500631);
609}
610
611std::ostream &
612operator << (std::ostream &os, const HeCapabilities &HeCapabilities)
613{
620 return os;
621}
622
623} //namespace ns3
iterator in a Buffer instance
Definition: buffer.h:99
uint32_t ReadLsbtohU32(void)
Definition: buffer.cc:1077
uint8_t ReadU8(void)
Definition: buffer.h:1021
uint16_t ReadLsbtohU16(void)
Definition: buffer.cc:1066
uint64_t ReadLsbtohU64(void)
Definition: buffer.cc:1094
uint32_t ReadU32(void)
Definition: buffer.cc:973
The IEEE 802.11ax HE Capabilities.
bool IsSupportedTxMcs(uint8_t mcs) const
Is RX MCS supported.
uint8_t m_maximumNumberOfFragmentedMsdus
maximum number of fragmentation MSDUs
uint8_t m_rxControlFrameToMultiBss
receive control frame to multi-BSS
uint8_t m_codebookSize75MuFeedback
Codebook Size = {7, 5} MU feedback.
uint8_t m_beamformeeStsForLargerThan80Mhz
beamformee STS for > 80MHz
bool IsSupportedRxMcs(uint8_t mcs) const
Is RX MCS supported.
uint8_t m_dcmMaxRu
DCM Max RU.
uint8_t m_erPartialBandwidth
Extended range partial bandwidth.
uint8_t m_rxFullBwSuInHeMuCompressedSigB
RX full BW SU using HE MU PPDU with compressed SIGB.
uint8_t m_stbcRxLeq80MHz
STBC RX <= 80Mhz.
uint8_t m_amsduFragmentationSupport
A-MSDU fragmentation support.
uint8_t m_bqrSupport
BQR support.
bool GetHePpdu4xHeLtf800nsGi(void) const
Get 4xHE-LTF and 800ns GI in HE SU PPDU and HE MU PPDU reception support.
uint8_t m_midambleRxMaxNsts
Midamble TX/RX max NSTS.
uint8_t m_heSubchannelSelectiveTxSupport
HE subchannel selective transmission support.
void SetHePhyCapabilitiesInfo(uint64_t ctrl1, uint16_t ctrl2, uint8_t ctrl3)
Set the HE PHY Capabilities Info field in the HE Capabilities information element.
uint8_t m_partialBwUlMuMimo
Partial Bandwidth UL MU-MIMO.
uint8_t m_qtpSupport
QTP support.
uint8_t m_triggerFrameMacPaddingDuration
trigger frame MAC padding duration
void SetHeSuPpdu1xHeLtf800nsGi(bool heSuPpdu1xHeLtf800nsGi)
Set 1xHE-LTF and 800ns GI in HE SU PPDU reception support.
uint8_t GetHighestMcsSupported(void) const
Get highest MCS supported.
uint8_t m_heVhtTriggerFrameRxSupport
HE and VHT trigger frame RX support.
uint8_t m_dopplerRx
Doppler Rx.
uint8_t m_codebookSize42SuFeedback
Codebook Size = {4, 2} SU feedback.
uint8_t m_puncturedPreambleRx
Punctured preamble Rx.
uint8_t m_allAckSupport
all Ack support
void SetLdpcCodingInPayload(uint8_t ldpcCodingInPayload)
Set indication whether the transmission and reception of LDPC encoded packets is supported.
uint8_t m_twtRequesterSupport
TWT requester support.
uint8_t m_ackEnabledAggregationSupport
ack enabled aggregation support
void SetSupportedMcsAndNss(uint16_t ctrl)
Set the MCS and NSS field in the HE Capabilities information element.
uint16_t GetHePhyCapabilitiesInfo2() const
Return the octets 9-10 of the HE PHY Capabilities Info field in the HE Capabilities information eleme...
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)
uint8_t m_bsrSupport
BSR support.
uint8_t m_hePpdu20MHzIn160MHz
20MHz in 160/80+80MHz HE PPDU
uint8_t m_multiTidAggregationRxSupport
multi-TID aggregation Rx support
uint8_t m_heSuPpdu1xHeLtf800nsGi
HE SU PPDU with 1x HE LTF and 0.8us GI.
uint8_t GetLdpcCodingInPayload(void) const
Indicates support for the transmission and reception of LDPC encoded packets.
void SetHePpdu4xHeLtf800nsGi(bool heSuPpdu4xHeLtf800nsGi)
Set 4xHE-LTF and 800ns GI in HE SU PPDU and HE MU PPDU reception support.
uint8_t m_broadcastTwtSupport
broadcast TXT support
uint8_t m_hePpdu20MHzIn40MHz24GHz
20MHz in 40MHz HE PPDU in 2.4GHz band
uint8_t m_nominalPacketPadding
Nominal packet padding.
void SetHeMacCapabilitiesInfo(uint32_t ctrl1, uint16_t ctrl2)
Set the HE MAC Capabilities Info field in the HE Capabilities information element.
uint8_t m_ldpcCodingInPayload
LDPC coding in payload.
uint8_t m_psrBasedSrSupport
PSR based SR support.
std::vector< uint8_t > m_rxBwMap
receive BW map
uint8_t m_muCascadeSupport
MU cascade support.
uint8_t m_ofdmaRaSupport
OFDMA RA support.
uint8_t m_psrResponder
PSR responder.
uint8_t m_nonTriggeredCqiFeedback
Non-Triggered CQI feedback.
uint8_t m_suBeamformee
SU beamformee.
uint8_t m_maxNc
Max Nc for HE compressed beamforming/CQI report.
uint8_t GetHePhyCapabilitiesInfo3() const
Return the last octet of the HE PHY Capabilities Info field in the HE Capabilities information elemen...
uint8_t m_heErSuPpdu1xHeLtf08Gi
HE ER SU PPDU with 1x HE LTF and 0.8us GI.
uint32_t GetHeMacCapabilitiesInfo1() const
Return the 4 first octets of the HE MAC Capabilities Info field in the HE Capabilities information el...
uint8_t m_stbcRxGt80MHz
STBC RX > 80MHz.
uint8_t m_rx1024QamLt242Ru
TX 1024 QAM < 242 =-tone RU support.
uint8_t m_amsduNotUnderBaInAmpduSupport
AMSDU not under BA in Ack enabled A-MPDU support.
uint8_t m_32bitBaBitmapSupport
32-bit BA bitmap support
void SetHighestNssSupported(uint8_t nss)
Set highest NSS supported.
uint8_t m_rxFullBwSuInHeMuNonCompressedSigB
RX full BW SU using HE MU PPDU with non-compressed SIGB.
uint8_t m_opsSupport
OPS support.
uint32_t GetMaxAmpduLength(void) const
Return the maximum A-MPDU length.
uint8_t m_hePpdu4xHeLtf800nsGi
4 times HE-LFT and 800ns GI support for HE-PPDUs
uint8_t m_hePpdu80MHzIn160MHz
80MHz in 160/80+80MHz HE PPDU
uint8_t m_fragmentationSupport
fragmentation support
uint8_t m_highestMcsSupported
highest MCS support
uint8_t m_ngEqual16ForSuFeedbackSupport
equal 16 for SU feedback
uint8_t m_suBeamformer
SU beamformer.
uint8_t m_minimumFragmentSize
minimum fragment size
uint8_t m_twtResponderSupport
TWT responder support.
uint8_t m_flexibleTwtScheduleSupport
flexible TWT schedule support
uint8_t m_bsrpBqrpAmpduAggregation
BSRP BQRP A-MPDU aggregation.
uint8_t m_ngEqual16ForMuFeedbackSupport
equal 16 for MU feedback
uint8_t m_puncturedSoundingSupport
punctured sounding support
uint8_t m_rxPartialBwSuInHeMu
Rx Partial BW SU in 20 MHz HE MU PPDU.
uint8_t m_omControlSupport
operation mode control support
uint8_t m_ndp4xHeLtfAnd32msGi
NDP with 4x HE-LTF and 3.2us GI.
uint8_t m_stbcTxGt80MHz
STBC Tx > 80MHz.
uint16_t GetHeMacCapabilitiesInfo2() const
Return the last 2 octets of the HE MAC Capabilities Info field in the HE Capabilities information ele...
bool GetHeSuPpdu1xHeLtf800nsGi(void) const
Get 1xHE-LTF and 800ns GI in HE SU PPDU reception support.
uint8_t m_midamble2xAnd1xHeLtf
Midamble TX/RX 2x and 1x HE-LTF.
WifiInformationElementId ElementIdExt() const override
Get the wifi information element ID extension.
uint8_t m_beamformeeStsForSmallerOrEqualThan80Mhz
beam formee STS for < 80 MHz
uint8_t m_plusHtcHeSupport
HTC HE support.
void SetMaxAmpduLength(uint32_t maxAmpduLength)
Set the maximum AMPDU length.
uint8_t m_channelWidthSet
channel width set
uint8_t m_fullBwUlMuMimo
Full Bandwidth UL MU-MIMO.
uint8_t m_maxAmpduLengthExponent
maximum A-MPDU length exponent extension
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 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_deviceClass
device class
uint8_t m_dlMuMimoOnPartialBandwidth
DL MU-MIMO on partial bandwidth.
uint64_t GetHePhyCapabilitiesInfo1() const
Return the 8 first octets of the HE PHY Capabilities Info field in the HE Capabilities information el...
uint8_t m_powerBoostFactorAlphaSupport
power boost factor alpha support
WifiInformationElementId ElementId() const override
Get the wifi information element ID.
uint8_t m_ppeThresholdPresent
PPE threshold present.
uint8_t m_muBeamformer
MU beamformer.
uint8_t m_ndpFeedbackReportSupport
NDP feedback report support.
uint8_t m_trsSupport
TRS support.
uint8_t m_longerThan16HeSigbOfdm
Longer than 16 HE SIG-=B OFDM symbols support.
uint16_t GetSupportedMcsAndNss() const
Return the MCS and NSS field in the HE Capabilities information element.
uint8_t GetChannelWidthSet(void) const
Get channel width set.
uint8_t m_dcmMaxConstellationRx
DCM Max Constellation Rx.
uint8_t m_triggeredMuBfFeedback
Triggered MU beamforming feedback.
uint8_t m_dcmMaxNssTx
DCM Max NSS Tx.
uint8_t GetHighestNssSupported(void) const
Get highest NSS supported.
void SetChannelWidthSet(uint8_t channelWidthSet)
Set channel width set.
uint8_t m_omControlUlMuDataDisableRxSupport
OM control UL MU data disable RX support.
uint8_t m_heErSuPpdu4xHeLtf08sGi
HE ER SU PPDU with 4x HE LTF and 0.8us GI.
uint8_t m_triggeredSuBfFeedback
Triggered SU beamforming feedback.
uint8_t m_ul2x996ToneRuSupport
UL 2x996 tone RU support.
uint8_t m_multiTidAggregationTxSupport
Multi-TID aggregation TX support.
std::vector< uint8_t > m_txBwMap
transmit BW map
uint8_t m_tx1024QamLt242Ru
TX 1024 QAM < 242 =-tone RU support.
uint8_t m_dopplerTx
Doppler Tx.
uint8_t m_stbcTxLeq80MHz
STBC TX <= 80MHz.
uint8_t m_maxHeLtfRxInHeMuMoreThanOneRu
max HE-LTF symbols STA can Rx in HE MU PPDU with more than one RU
uint8_t m_numberOfSoundingDimensionsForLargerThan80Mhz
void SetHighestMcsSupported(uint8_t mcs)
Set highest MCS supported.
uint8_t m_heLinkAdaptation
HE link adaptation.
uint8_t m_highestNssSupportedM1
highest NSS support M1
uint8_t m_triggeredCqiFeedback
Triggered CQI feedback.
uint8_t m_numberOfSoundingDimensionsForSmallerOrEqualThan80Mhz
uint8_t m_dcmMaxNssRx
DCM Max NSS Rx.
uint8_t m_dcmMaxConstellationTx
DCM Max Constellation Tx.
uint8_t m_heDynamicSmPowerSave
HE dynamic SM power save.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition: assert.h:67
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
Definition: abort.h:50
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:139
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
def start()
Definition: core.py:1852
#define IE_EXT_HE_CAPABILITIES
#define IE_EXTENSION