A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
he-capabilities.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Sébastien Deronne <sebastien.deronne@gmail.com>
7 */
8
9#include "he-capabilities.h"
10
11#include <algorithm>
12
13namespace ns3
14{
15
17 : m_plusHtcHeSupport(0),
18 m_twtRequesterSupport(0),
19 m_twtResponderSupport(0),
20 m_fragmentationSupport(0),
21 m_maximumNumberOfFragmentedMsdus(0),
22 m_minimumFragmentSize(0),
23 m_triggerFrameMacPaddingDuration(0),
24 m_multiTidAggregationRxSupport(0),
25 m_heLinkAdaptation(0),
26 m_allAckSupport(0),
27 m_trsSupport(0),
28 m_bsrSupport(0),
29 m_broadcastTwtSupport(0),
30 m_32bitBaBitmapSupport(0),
31 m_muCascadeSupport(0),
32 m_ackEnabledAggregationSupport(0),
33 m_omControlSupport(0),
34 m_ofdmaRaSupport(0),
35 m_maxAmpduLengthExponent(0),
36 m_amsduFragmentationSupport(0),
37 m_flexibleTwtScheduleSupport(0),
38 m_rxControlFrameToMultiBss(0),
39 m_bsrpBqrpAmpduAggregation(0),
40 m_qtpSupport(0),
41 m_bqrSupport(0),
42 m_psrResponder(0),
43 m_ndpFeedbackReportSupport(0),
44 m_opsSupport(0),
45 m_amsduNotUnderBaInAmpduSupport(0),
46 m_multiTidAggregationTxSupport(0),
47 m_heSubchannelSelectiveTxSupport(0),
48 m_ul2x996ToneRuSupport(0),
49 m_omControlUlMuDataDisableRxSupport(0),
50 m_heDynamicSmPowerSave(0),
51 m_puncturedSoundingSupport(0),
52 m_heVhtTriggerFrameRxSupport(0),
53 m_channelWidthSet(0),
54 m_puncturedPreambleRx(0),
55 m_deviceClass(0),
56 m_ldpcCodingInPayload(0),
57 m_heSuPpdu1xHeLtf800nsGi(0),
58 m_midambleRxMaxNsts(0),
59 m_ndp4xHeLtfAnd32msGi(0),
60 m_stbcTxLeq80MHz(0),
61 m_stbcRxLeq80MHz(0),
62 m_dopplerTx(0),
63 m_dopplerRx(0),
64 m_fullBwUlMuMimo(0),
65 m_partialBwUlMuMimo(0),
66 m_dcmMaxConstellationTx(0),
67 m_dcmMaxNssTx(0),
68 m_dcmMaxConstellationRx(0),
69 m_dcmMaxNssRx(0),
70 m_rxPartialBwSuInHeMu(0),
71 m_suBeamformer(0),
72 m_suBeamformee(0),
73 m_muBeamformer(0),
74 m_beamformeeStsForSmallerOrEqualThan80Mhz(0),
75 m_beamformeeStsForLargerThan80Mhz(0),
76 m_numberOfSoundingDimensionsForSmallerOrEqualThan80Mhz(0),
77 m_numberOfSoundingDimensionsForLargerThan80Mhz(0),
78 m_ngEqual16ForSuFeedbackSupport(0),
79 m_ngEqual16ForMuFeedbackSupport(0),
80 m_codebookSize42SuFeedback(0),
81 m_codebookSize75MuFeedback(0),
82 m_triggeredSuBfFeedback(0),
83 m_triggeredMuBfFeedback(0),
84 m_triggeredCqiFeedback(0),
85 m_erPartialBandwidth(0),
86 m_dlMuMimoOnPartialBandwidth(0),
87 m_ppeThresholdPresent(0),
88 m_psrBasedSrSupport(0),
89 m_powerBoostFactorAlphaSupport(0),
90 m_hePpdu4xHeLtf800nsGi(0),
91 m_maxNc(0),
92 m_stbcTxGt80MHz(0),
93 m_stbcRxGt80MHz(0),
94 m_heErSuPpdu4xHeLtf08sGi(0),
95 m_hePpdu20MHzIn40MHz24GHz(0),
96 m_hePpdu20MHzIn160MHz(0),
97 m_hePpdu80MHzIn160MHz(0),
98 m_heErSuPpdu1xHeLtf08Gi(0),
99 m_midamble2xAnd1xHeLtf(0),
100 m_dcmMaxRu(0),
101 m_longerThan16HeSigbOfdm(0),
102 m_nonTriggeredCqiFeedback(0),
103 m_tx1024QamLt242Ru(0),
104 m_rx1024QamLt242Ru(0),
105 m_rxFullBwSuInHeMuCompressedSigB(0),
106 m_rxFullBwSuInHeMuNonCompressedSigB(0),
107 m_nominalPacketPadding(0),
108 m_maxHeLtfRxInHeMuMoreThanOneRu(0),
109 m_highestNssSupportedM1(0),
110 m_highestMcsSupported(0)
111{
112 m_txBwMap.resize(8, 0);
113 m_rxBwMap.resize(8, 0);
114}
115
118{
119 return IE_EXTENSION;
120}
121
127
128void
129HeCapabilities::Print(std::ostream& os) const
130{
131 os << "HE Capabilities=" << GetHeMacCapabilitiesInfo1() << "|" << +GetHeMacCapabilitiesInfo2()
132 << "|" << GetHePhyCapabilitiesInfo1() << "|" << GetHePhyCapabilitiesInfo2() << "|"
134}
135
136uint16_t
138{
139 // IEEE 802.11ax-2021 9.4.2.248 HE Capabilities element
140 // Element ID Extension (1) + HE MAC Capabilities Information (6)
141 // + HE PHY Capabilities Information (11) + Supported HE-MCS And NSS Set (4)
142 // TODO: Supported HE-MCS And NSS Set field has variable length (4, 8 or 12)
143 // TODO: PPE Thresholds field (optional) is not implemented
144 return 22;
145}
146
147void
149{
150 // write the corresponding value for each bit
151 start.WriteHtolsbU32(GetHeMacCapabilitiesInfo1());
152 start.WriteHtolsbU16(GetHeMacCapabilitiesInfo2());
153 start.WriteHtolsbU64(GetHePhyCapabilitiesInfo1());
154 start.WriteHtolsbU16(GetHePhyCapabilitiesInfo2());
155 start.WriteU8(GetHePhyCapabilitiesInfo3());
156 start.WriteHtolsbU32(GetSupportedMcsAndNss());
157 // TODO: add another 32-bits field if 160 MHz channel is supported (variable length)
158 // TODO: optional PPE Threshold field (variable length)
159}
160
161uint16_t
163{
164 Buffer::Iterator i = start;
165 uint32_t macCapabilities1 = i.ReadLsbtohU32();
166 uint16_t macCapabilities2 = i.ReadLsbtohU16();
167 uint64_t phyCapabilities1 = i.ReadLsbtohU64();
168 uint64_t phyCapabilities2 = i.ReadLsbtohU16();
169 uint8_t phyCapabilities3 = i.ReadU8();
170 uint32_t mcsset = i.ReadU32();
171 SetHeMacCapabilitiesInfo(macCapabilities1, macCapabilities2);
172 SetHePhyCapabilitiesInfo(phyCapabilities1, phyCapabilities2, phyCapabilities3);
173 SetSupportedMcsAndNss(mcsset);
174 // TODO: add another 32-bits field if 160 MHz channel is supported (variable length)
175 // TODO: optional PPE Threshold field (variable length)
176 return length;
177}
178
179void
181{
182 m_plusHtcHeSupport = ctrl1 & 0x01;
183 m_twtRequesterSupport = (ctrl1 >> 1) & 0x01;
184 m_twtResponderSupport = (ctrl1 >> 2) & 0x01;
185 m_fragmentationSupport = (ctrl1 >> 3) & 0x03;
186 m_maximumNumberOfFragmentedMsdus = (ctrl1 >> 5) & 0x07;
187 m_minimumFragmentSize = (ctrl1 >> 8) & 0x03;
188 m_triggerFrameMacPaddingDuration = (ctrl1 >> 10) & 0x03;
189 m_multiTidAggregationRxSupport = (ctrl1 >> 12) & 0x07;
190 m_heLinkAdaptation = (ctrl1 >> 15) & 0x03;
191 m_allAckSupport = (ctrl1 >> 17) & 0x01;
192 m_trsSupport = (ctrl1 >> 18) & 0x01;
193 m_bsrSupport = (ctrl1 >> 19) & 0x01;
194 m_broadcastTwtSupport = (ctrl1 >> 20) & 0x01;
195 m_32bitBaBitmapSupport = (ctrl1 >> 21) & 0x01;
196 m_muCascadeSupport = (ctrl1 >> 22) & 0x01;
197 m_ackEnabledAggregationSupport = (ctrl1 >> 23) & 0x01;
198 // IEEE 802.11ax-2021 9.4.2.248.2 HE MAC Capabilities
199 // Bit 24 is reserved
200 m_omControlSupport = (ctrl1 >> 25) & 0x01;
201 m_ofdmaRaSupport = (ctrl1 >> 26) & 0x01;
202 m_maxAmpduLengthExponent = (ctrl1 >> 27) & 0x03;
203 m_amsduFragmentationSupport = (ctrl1 >> 29) & 0x01;
204 m_flexibleTwtScheduleSupport = (ctrl1 >> 30) & 0x01;
205 m_rxControlFrameToMultiBss = (ctrl1 >> 31) & 0x01;
206 m_bsrpBqrpAmpduAggregation = ctrl2 & 0x01;
207 m_qtpSupport = (ctrl2 >> 1) & 0x01;
208 m_bqrSupport = (ctrl2 >> 2) & 0x01;
209 m_psrResponder = (ctrl2 >> 3) & 0x01;
210 m_ndpFeedbackReportSupport = (ctrl2 >> 4) & 0x01;
211 m_opsSupport = (ctrl2 >> 5) & 0x01;
212 m_amsduNotUnderBaInAmpduSupport = (ctrl2 >> 6) & 0x01;
213 m_multiTidAggregationTxSupport = (ctrl2 >> 7) & 0x07;
214 m_heSubchannelSelectiveTxSupport = (ctrl2 >> 10) & 0x01;
215 m_ul2x996ToneRuSupport = (ctrl2 >> 11) & 0x01;
216 m_omControlUlMuDataDisableRxSupport = (ctrl2 >> 12) & 0x01;
217 m_heDynamicSmPowerSave = (ctrl2 >> 13) & 0x01;
218 m_puncturedSoundingSupport = (ctrl2 >> 14) & 0x01;
219 m_heVhtTriggerFrameRxSupport = (ctrl2 >> 15) & 0x01;
220}
221
224{
225 uint32_t val = 0;
226 val |= m_plusHtcHeSupport & 0x01;
227 val |= (m_twtRequesterSupport & 0x01) << 1;
228 val |= (m_twtResponderSupport & 0x01) << 2;
229 val |= (m_fragmentationSupport & 0x03) << 3;
230 val |= (m_maximumNumberOfFragmentedMsdus & 0x07) << 5;
231 val |= (m_minimumFragmentSize & 0x03) << 8;
232 val |= (m_triggerFrameMacPaddingDuration & 0x03) << 10;
233 val |= (m_multiTidAggregationRxSupport & 0x07) << 12;
234 val |= (m_heLinkAdaptation & 0x03) << 15;
235 val |= (m_allAckSupport & 0x01) << 17;
236 val |= (m_trsSupport & 0x01) << 18;
237 val |= (m_bsrSupport & 0x01) << 19;
238 val |= (m_broadcastTwtSupport & 0x01) << 20;
239 val |= (m_32bitBaBitmapSupport & 0x01) << 21;
240 val |= (m_muCascadeSupport & 0x01) << 22;
241 val |= (m_ackEnabledAggregationSupport & 0x01) << 23;
242 // IEEE 802.11ax-2021 9.4.2.248.2 HE MAC Capabilities
243 // Bit 24 is reserved
244 val |= (m_omControlSupport & 0x01) << 25;
245 val |= (m_ofdmaRaSupport & 0x01) << 26;
246 val |= (m_maxAmpduLengthExponent & 0x03) << 27;
247 val |= (m_amsduFragmentationSupport & 0x01) << 29;
248 val |= (m_flexibleTwtScheduleSupport & 0x01) << 30;
249 val |= (m_rxControlFrameToMultiBss & 0x01) << 31;
250 return val;
251}
252
253uint16_t
255{
256 uint16_t val = 0;
257 val |= m_bsrpBqrpAmpduAggregation & 0x01;
258 val |= (m_qtpSupport & 0x01) << 1;
259 val |= (m_bqrSupport & 0x01) << 2;
260 val |= (m_psrResponder & 0x01) << 3;
261 val |= (m_ndpFeedbackReportSupport & 0x01) << 4;
262 val |= (m_opsSupport & 0x01) << 5;
263 val |= (m_amsduNotUnderBaInAmpduSupport & 0x01) << 6;
264 val |= (m_multiTidAggregationTxSupport & 0x07) << 7;
265 val |= (m_heSubchannelSelectiveTxSupport & 0x01) << 10;
266 val |= (m_ul2x996ToneRuSupport & 0x01) << 11;
267 val |= (m_omControlUlMuDataDisableRxSupport & 0x01) << 12;
268 val |= (m_heDynamicSmPowerSave & 0x01) << 13;
269 val |= (m_puncturedSoundingSupport & 0x01) << 14;
270 val |= (m_heVhtTriggerFrameRxSupport & 0x01) << 15;
271 return val;
272}
273
274void
275HeCapabilities::SetHePhyCapabilitiesInfo(uint64_t ctrl1, uint16_t ctrl2, uint8_t ctrl3)
276{
277 // IEEE 802.11ax-2021 9.4.2.248.2 HE MAC Capabilities
278 // Bit 0 is reserved
279 m_channelWidthSet = (ctrl1 >> 1) & 0x7f;
280 m_puncturedPreambleRx = (ctrl1 >> 8) & 0x0f;
281 m_deviceClass = (ctrl1 >> 12) & 0x01;
282 m_ldpcCodingInPayload = (ctrl1 >> 13) & 0x01;
283 m_heSuPpdu1xHeLtf800nsGi = (ctrl1 >> 14) & 0x01;
284 m_midambleRxMaxNsts = (ctrl1 >> 15) & 0x03;
285 m_ndp4xHeLtfAnd32msGi = (ctrl1 >> 17) & 0x01;
286 m_stbcTxLeq80MHz = (ctrl1 >> 18) & 0x01;
287 m_stbcRxLeq80MHz = (ctrl1 >> 19) & 0x01;
288 m_dopplerTx = (ctrl1 >> 20) & 0x01;
289 m_dopplerRx = (ctrl1 >> 21) & 0x01;
290 m_fullBwUlMuMimo = (ctrl1 >> 22) & 0x01;
291 m_partialBwUlMuMimo = (ctrl1 >> 23) & 0x01;
292 m_dcmMaxConstellationTx = (ctrl1 >> 24) & 0x03;
293 m_dcmMaxNssTx = (ctrl1 >> 26) & 0x01;
294 m_dcmMaxConstellationRx = (ctrl1 >> 27) & 0x03;
295 m_dcmMaxNssRx = (ctrl1 >> 29) & 0x01;
296 m_rxPartialBwSuInHeMu = (ctrl1 >> 30) & 0x01;
297 m_suBeamformer = (ctrl1 >> 31) & 0x01;
298 m_suBeamformee = (ctrl1 >> 32) & 0x01;
299 m_muBeamformer = (ctrl1 >> 33) & 0x01;
300 m_beamformeeStsForSmallerOrEqualThan80Mhz = (ctrl1 >> 34) & 0x07;
301 m_beamformeeStsForLargerThan80Mhz = (ctrl1 >> 37) & 0x07;
304 m_ngEqual16ForSuFeedbackSupport = (ctrl1 >> 46) & 0x01;
305 m_ngEqual16ForMuFeedbackSupport = (ctrl1 >> 47) & 0x01;
306 m_codebookSize42SuFeedback = (ctrl1 >> 48) & 0x01;
307 m_codebookSize75MuFeedback = (ctrl1 >> 49) & 0x01;
308 m_triggeredSuBfFeedback = (ctrl1 >> 50) & 0x01;
309 m_triggeredMuBfFeedback = (ctrl1 >> 51) & 0x01;
310 m_triggeredCqiFeedback = (ctrl1 >> 52) & 0x01;
311 m_erPartialBandwidth = (ctrl1 >> 53) & 0x01;
312 m_dlMuMimoOnPartialBandwidth = (ctrl1 >> 54) & 0x01;
313 m_ppeThresholdPresent = (ctrl1 >> 55) & 0x01;
314 m_psrBasedSrSupport = (ctrl1 >> 56) & 0x01;
315 m_powerBoostFactorAlphaSupport = (ctrl1 >> 57) & 0x01;
316 m_hePpdu4xHeLtf800nsGi = ctrl2 & 0x01;
317 m_maxNc = (ctrl1 >> 59) & 0x07;
318 m_stbcTxGt80MHz = (ctrl1 >> 62) & 0x01;
319 m_stbcRxGt80MHz = (ctrl1 >> 63) & 0x01;
320 m_heErSuPpdu4xHeLtf08sGi = ctrl2 & 0x01;
321 m_hePpdu20MHzIn40MHz24GHz = (ctrl2 >> 1) & 0x01;
322 m_hePpdu20MHzIn160MHz = (ctrl2 >> 2) & 0x01;
323 m_hePpdu80MHzIn160MHz = (ctrl2 >> 3) & 0x01;
324 m_heErSuPpdu1xHeLtf08Gi = (ctrl2 >> 4) & 0x01;
325 m_midamble2xAnd1xHeLtf = (ctrl2 >> 5) & 0x01;
326 m_dcmMaxRu = (ctrl2 >> 6) & 0x03;
327 m_longerThan16HeSigbOfdm = (ctrl2 >> 8) & 0x01;
328 m_nonTriggeredCqiFeedback = (ctrl2 >> 9) & 0x01;
329 m_tx1024QamLt242Ru = (ctrl2 >> 10) & 0x01;
330 m_rx1024QamLt242Ru = (ctrl2 >> 11) & 0x01;
331 m_rxFullBwSuInHeMuCompressedSigB = (ctrl2 >> 12) & 0x01;
332 m_rxFullBwSuInHeMuNonCompressedSigB = (ctrl2 >> 13) & 0x01;
333 m_nominalPacketPadding = (ctrl2 >> 14) & 0x03;
334 m_maxHeLtfRxInHeMuMoreThanOneRu = ctrl3 & 0x01;
335 // IEEE 802.11ax-2021 9.4.2.248.2 HE MAC Capabilities
336 // Bits 81-87 are reserved
337}
338
339uint64_t
341{
342 uint64_t val = 0;
343 // IEEE 802.11ax-2021 9.4.2.248.2 HE MAC Capabilities
344 // Bit 0 is reserved
345 val |= (m_channelWidthSet & 0x7f) << 1;
346 val |= (m_puncturedPreambleRx & 0x0f) << 8;
347 val |= (m_deviceClass & 0x01) << 12;
348 val |= (m_ldpcCodingInPayload & 0x01) << 13;
349 val |= (m_heSuPpdu1xHeLtf800nsGi & 0x01) << 14;
350 val |= (m_midambleRxMaxNsts & 0x03) << 15;
351 val |= (m_ndp4xHeLtfAnd32msGi & 0x01) << 17;
352 val |= (m_stbcTxLeq80MHz & 0x01) << 18;
353 val |= (m_stbcRxLeq80MHz & 0x01) << 19;
354 val |= (m_dopplerTx & 0x01) << 20;
355 val |= (m_dopplerRx & 0x01) << 21;
356 val |= (m_fullBwUlMuMimo & 0x01) << 22;
357 val |= (m_partialBwUlMuMimo & 0x01) << 23;
358 val |= (m_dcmMaxConstellationTx & 0x03) << 24;
359 val |= (m_dcmMaxNssTx & 0x01) << 26;
360 val |= (m_dcmMaxConstellationRx & 0x03) << 27;
361 val |= (m_dcmMaxNssRx & 0x01) << 29;
362 val |= (m_rxPartialBwSuInHeMu & 0x01) << 30;
363 val |= (m_suBeamformer & 0x01) << 31;
364 val |= (static_cast<uint64_t>(m_suBeamformee) & 0x01) << 32;
365 val |= (static_cast<uint64_t>(m_muBeamformer) & 0x01) << 33;
366 val |= (static_cast<uint64_t>(m_beamformeeStsForSmallerOrEqualThan80Mhz) & 0x07) << 34;
367 val |= (static_cast<uint64_t>(m_beamformeeStsForLargerThan80Mhz) & 0x07) << 37;
368 val |= (static_cast<uint64_t>(m_numberOfSoundingDimensionsForSmallerOrEqualThan80Mhz) & 0x07)
369 << 40;
370 val |= (static_cast<uint64_t>(m_numberOfSoundingDimensionsForLargerThan80Mhz) & 0x07) << 43;
371 val |= (static_cast<uint64_t>(m_ngEqual16ForSuFeedbackSupport) & 0x01) << 46;
372 val |= (static_cast<uint64_t>(m_ngEqual16ForMuFeedbackSupport) & 0x01) << 47;
373 val |= (static_cast<uint64_t>(m_codebookSize42SuFeedback) & 0x01) << 48;
374 val |= (static_cast<uint64_t>(m_codebookSize75MuFeedback) & 0x01) << 49;
375 val |= (static_cast<uint64_t>(m_triggeredSuBfFeedback) & 0x01) << 50;
376 val |= (static_cast<uint64_t>(m_triggeredMuBfFeedback) & 0x01) << 51;
377 val |= (static_cast<uint64_t>(m_triggeredCqiFeedback) & 0x01) << 52;
378 val |= (static_cast<uint64_t>(m_erPartialBandwidth) & 0x01) << 53;
379 val |= (static_cast<uint64_t>(m_dlMuMimoOnPartialBandwidth) & 0x01) << 54;
380 val |= (static_cast<uint64_t>(m_ppeThresholdPresent) & 0x01) << 55;
381 val |= (static_cast<uint64_t>(m_psrBasedSrSupport) & 0x01) << 56;
382 val |= (static_cast<uint64_t>(m_powerBoostFactorAlphaSupport) & 0x01) << 57;
383 val |= (static_cast<uint64_t>(m_hePpdu4xHeLtf800nsGi) & 0x01) << 58;
384 val |= (static_cast<uint64_t>(m_maxNc) & 0x07) << 59;
385 val |= (static_cast<uint64_t>(m_stbcTxGt80MHz) & 0x01) << 62;
386 val |= (static_cast<uint64_t>(m_stbcRxGt80MHz) & 0x01) << 63;
387 return val;
388}
389
390uint16_t
392{
393 uint16_t val = 0;
394 val |= m_heErSuPpdu4xHeLtf08sGi & 0x01;
395 val |= (m_hePpdu20MHzIn40MHz24GHz & 0x01) << 1;
396 val |= (m_hePpdu20MHzIn160MHz & 0x01) << 2;
397 val |= (m_hePpdu80MHzIn160MHz & 0x01) << 3;
398 val |= (m_heErSuPpdu1xHeLtf08Gi & 0x01) << 4;
399 val |= (m_midamble2xAnd1xHeLtf & 0x01) << 5;
400 val |= (m_dcmMaxRu & 0x03) << 6;
401 val |= (m_longerThan16HeSigbOfdm & 0x01) << 8;
402 val |= (m_nonTriggeredCqiFeedback & 0x01) << 9;
403 val |= (m_tx1024QamLt242Ru & 0x01) << 10;
404 val |= (m_rx1024QamLt242Ru & 0x01) << 11;
405 val |= (m_rxFullBwSuInHeMuCompressedSigB & 0x01) << 12;
406 val |= (m_rxFullBwSuInHeMuNonCompressedSigB & 0x01) << 13;
407 val |= (m_nominalPacketPadding & 0x03) << 14;
408 return val;
409}
410
411uint8_t
413{
414 uint8_t val = 0;
416 // IEEE 802.11ax-2021 9.4.2.248.2 HE MAC Capabilities
417 // Bits 81-87 are reserved
418 return val;
419}
420
421void
423{
424 m_highestNssSupportedM1 = ctrl & 0x07;
425 m_highestMcsSupported = (ctrl >> 3) & 0x07;
427 uint8_t i;
428 for (i = 0; i < 5; i++)
429 {
430 m_txBwMap[i] = (ctrl >> (6 + i)) & 0x01;
431 }
432 for (i = 0; i < 5; i++)
433 {
434 m_rxBwMap[i] = (ctrl >> (11 + i)) & 0x01;
435 }
436 // TODO: MCS NSS Descriptors
437}
438
439uint16_t
441{
442 uint16_t val = 0;
443 val |= m_highestNssSupportedM1 & 0x07;
444 val |= (m_highestMcsSupported & 0x07) << 3;
445 uint8_t i;
446 for (i = 0; i < 5; i++)
447 {
448 val |= (m_txBwMap[i] & 0x01) << (6 + 1);
449 }
450 for (i = 0; i < 5; i++)
451 {
452 val |= (m_rxBwMap[i] & 0x01) << (11 + 1);
453 }
454 // TODO: MCS NSS Descriptors
455 return val;
456}
457
458// TODO: PPE threshold
459
460bool
462{
463 NS_ASSERT(mcs >= 0 && mcs <= 11);
464 if (mcs <= 7)
465 {
466 return true;
467 }
468 if (mcs == 8 && m_highestMcsSupported >= 1)
469 {
470 return true;
471 }
472 if (mcs == 9 && m_highestMcsSupported >= 2)
473 {
474 return true;
475 }
476 if (mcs == 10 && m_highestMcsSupported >= 3)
477 {
478 return true;
479 }
480 if (mcs == 11 && m_highestMcsSupported == 4)
481 {
482 return true;
483 }
484 return false;
485}
486
487bool
489{
490 NS_ASSERT(mcs >= 0 && mcs <= 11);
491 if (mcs <= 7)
492 {
493 return true;
494 }
495 if (mcs == 8 && m_highestMcsSupported >= 1)
496 {
497 return true;
498 }
499 if (mcs == 9 && m_highestMcsSupported >= 2)
500 {
501 return true;
502 }
503 if (mcs == 10 && m_highestMcsSupported >= 3)
504 {
505 return true;
506 }
507 if (mcs == 11 && m_highestMcsSupported == 4)
508 {
509 return true;
510 }
511 return false;
512}
513
514void
516{
517 NS_ASSERT(channelWidthSet <= 0x2f);
518 m_channelWidthSet = channelWidthSet;
519}
520
521void
522HeCapabilities::SetLdpcCodingInPayload(uint8_t ldpcCodingInPayload)
523{
524 m_ldpcCodingInPayload = ldpcCodingInPayload;
525}
526
527void
529{
530 m_heSuPpdu1xHeLtf800nsGi = (heSuPpdu1xHeLtf800nsGi ? 1 : 0);
531}
532
533void
535{
536 m_hePpdu4xHeLtf800nsGi = (hePpdu4xHeLtf800nsGi ? 1 : 0);
537}
538
539void
541{
542 for (uint8_t i = 0; i <= 3; i++)
543 {
544 if ((1UL << (20 + i)) - 1 == maxAmpduLength)
545 {
547 return;
548 }
549 }
550 NS_ABORT_MSG("Invalid A-MPDU Max Length value");
551}
552
553void
555{
556 NS_ASSERT(mcs >= 7 && mcs <= 11);
557 m_highestMcsSupported = mcs - 7;
558}
559
560void
562{
563 NS_ASSERT(nss >= 1 && nss <= 8);
564 m_highestNssSupportedM1 = nss - 1;
565}
566
567uint8_t
572
573uint8_t
578
579bool
584
585bool
590
591uint8_t
596
597uint8_t
602
605{
606 return std::min<uint32_t>((1UL << (20 + m_maxAmpduLengthExponent)) - 1, 6500631);
607}
608
609} // namespace ns3
iterator in a Buffer instance
Definition buffer.h:89
uint16_t ReadLsbtohU16()
Definition buffer.cc:1053
uint64_t ReadLsbtohU64()
Definition buffer.cc:1083
uint32_t ReadU32()
Definition buffer.cc:955
uint32_t ReadLsbtohU32()
Definition buffer.cc:1065
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.
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 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.
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 GetHighestMcsSupported() const
Get highest MCS supported.
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.
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 GetHighestNssSupported() const
Get highest NSS supported.
uint8_t m_puncturedSoundingSupport
punctured sounding support
bool GetHeSuPpdu1xHeLtf800nsGi() const
Get 1xHE-LTF and 800ns GI in HE SU PPDU reception 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...
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 GetLdpcCodingInPayload() const
Indicates support for the transmission and reception of LDPC encoded packets.
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 m_dcmMaxConstellationRx
DCM Max Constellation Rx.
void Print(std::ostream &os) const override
Generate human-readable form of IE.
uint8_t m_triggeredMuBfFeedback
Triggered MU beamforming feedback.
uint8_t m_dcmMaxNssTx
DCM Max NSS Tx.
void SetChannelWidthSet(uint8_t channelWidthSet)
Set channel width set.
uint8_t m_omControlUlMuDataDisableRxSupport
OM control UL MU data disable RX support.
uint32_t GetMaxAmpduLength() const
Return the maximum A-MPDU length.
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
bool GetHePpdu4xHeLtf800nsGi() const
Get 4xHE-LTF and 800ns GI in HE SU PPDU and HE MU PPDU reception support.
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.
uint8_t GetChannelWidthSet() const
Get channel width set.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition assert.h:55
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
Definition abort.h:38
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.
#define IE_EXT_HE_CAPABILITIES
#define IE_EXTENSION