A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
radiotap-header.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 CTTC
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Authors: Nicola Baldo <nbaldo@cttc.es>
7 * Sébastien Deronne <sebastien.deronne@gmail.com>
8 */
9
10#ifndef RADIOTAP_HEADER_H
11#define RADIOTAP_HEADER_H
12
13#include "ns3/header.h"
14
15#include <array>
16#include <optional>
17#include <vector>
18
19namespace ns3
20{
21
22/**
23 * @brief Radiotap header implementation
24 *
25 * Radiotap is a de facto standard for 802.11 frame injection and reception.
26 * The radiotap header format is a mechanism to supply additional information
27 * about frames, from the driver to userspace applications such as libpcap, and
28 * from a userspace application to the driver for transmission.
29 */
30class RadiotapHeader : public Header
31{
32 public:
33 /**
34 * @brief Get the type ID.
35 * @returns the object TypeId
36 */
37 static TypeId GetTypeId();
38 TypeId GetInstanceTypeId() const override;
39
40 /**
41 * This method is used by Packet::AddHeader to store the header into the byte
42 * buffer of a packet. This method returns the number of bytes which are
43 * needed to store the header data during a Serialize.
44 *
45 * @returns The expected size of the header.
46 */
47 uint32_t GetSerializedSize() const override;
48
49 /**
50 * This method is used by Packet::AddHeader to store the header into the byte
51 * buffer of a packet. The data written is expected to match bit-for-bit the
52 * representation of this header in a real network.
53 *
54 * @param start An iterator which points to where the header should
55 * be written.
56 */
57 void Serialize(Buffer::Iterator start) const override;
58
59 /**
60 * This method is used by Packet::RemoveHeader to re-create a header from the
61 * byte buffer of a packet. The data read is expected to match bit-for-bit
62 * the representation of this header in real networks.
63 *
64 * @param start An iterator which points to where the header should be read.
65 * @returns The number of bytes read.
66 */
68
69 /**
70 * This method is used by Packet::Print to print the content of the header as
71 * ascii data to a C++ output stream. Although the header is free to format
72 * its output as it wishes, it is recommended to follow a few rules to integrate
73 * with the packet pretty printer: start with flags, small field
74 * values located between a pair of parens. Values should be separated
75 * by whitespace. Follow the parens with the important fields,
76 * separated by whitespace.
77 *
78 * eg: (field1 val1 field2 val2 field3 val3) field4 val4 field5 val5
79 *
80 * @param os The output stream
81 */
82 void Print(std::ostream& os) const override;
83
84 /**
85 * @brief Set the ieee80211_radiotap_header. This method must be called
86 * before any other Set* method.
87 *
88 * @param numPresentWords Number of it_present words in the radiotap header.
89 */
90 void SetWifiHeader(std::size_t numPresentWords);
91
92 /**
93 * @brief Set the Time Synchronization Function Timer (TSFT) value. Valid for
94 * received frames only.
95 *
96 * @param tsft Value in microseconds of the MAC's 64-bit 802.11 Time
97 * Synchronization Function timer when the first bit of the MPDU
98 * arrived at the MAC.
99 */
100 void SetTsft(uint64_t tsft);
101
102 /**
103 * @brief Frame flags.
104 */
105 enum FrameFlag : uint8_t
106 {
107 FRAME_FLAG_NONE = 0x00, /**< No flags set */
108 FRAME_FLAG_CFP = 0x01, /**< Frame sent/received during CFP */
109 FRAME_FLAG_SHORT_PREAMBLE = 0x02, /**< Frame sent/received with short preamble */
110 FRAME_FLAG_WEP = 0x04, /**< Frame sent/received with WEP encryption */
111 FRAME_FLAG_FRAGMENTED = 0x08, /**< Frame sent/received with fragmentation */
112 FRAME_FLAG_FCS_INCLUDED = 0x10, /**< Frame includes FCS */
114 0x20, /**< Frame has padding between 802.11 header and payload (to 32-bit boundary) */
115 FRAME_FLAG_BAD_FCS = 0x40, /**< Frame failed FCS check */
116 FRAME_FLAG_SHORT_GUARD = 0x80 /**< Frame used short guard interval (HT) */
117 };
118
119 /**
120 * @brief Set the frame flags of the transmitted or received frame.
121 * @param flags flags to set.
122 */
123 void SetFrameFlags(uint8_t flags);
124
125 /**
126 * @brief Set the transmit/receive channel frequency in units of megahertz
127 * @param rate the transmit/receive channel frequency in units of megahertz.
128 */
129 void SetRate(uint8_t rate);
130
131 /**
132 * @brief Channel flags.
133 */
134 enum ChannelFlags : uint16_t
135 {
136 CHANNEL_FLAG_NONE = 0x0000, /**< No flags set */
137 CHANNEL_FLAG_TURBO = 0x0010, /**< Turbo Channel */
138 CHANNEL_FLAG_CCK = 0x0020, /**< CCK channel */
139 CHANNEL_FLAG_OFDM = 0x0040, /**< OFDM channel */
140 CHANNEL_FLAG_SPECTRUM_2GHZ = 0x0080, /**< 2 GHz spectrum channel */
141 CHANNEL_FLAG_SPECTRUM_5GHZ = 0x0100, /**< 5 GHz spectrum channel */
142 CHANNEL_FLAG_PASSIVE = 0x0200, /**< Only passive scan allowed */
143 CHANNEL_FLAG_DYNAMIC = 0x0400, /**< Dynamic CCK-OFDM channel */
144 CHANNEL_FLAG_GFSK = 0x0800 /**< GFSK channel (FHSS PHY) */
145 };
146
147 /**
148 * structure that contains the subfields of the Channel field.
149 */
151 {
152 uint16_t frequency{0}; //!< Tx/Rx frequency in MHz
153 uint16_t flags{CHANNEL_FLAG_NONE}; //!< flags field (@see ChannelFlags)
154 };
155
156 /**
157 * @brief Set the subfields of the Channel field
158 *
159 * @param channelFields The subfields of the Channel field.
160 */
161 void SetChannelFields(const ChannelFields& channelFields);
162
163 /**
164 * @brief Set the RF signal power at the antenna as a decibel difference
165 * from an arbitrary, fixed reference.
166 *
167 * @param signal The RF signal power at the antenna as a decibel difference
168 * from an arbitrary, fixed reference;
169 */
170 void SetAntennaSignalPower(double signal);
171
172 /**
173 * @brief Set the RF noise power at the antenna as a decibel difference
174 * from an arbitrary, fixed reference.
175 *
176 * @param noise The RF noise power at the antenna as a decibel difference
177 * from an arbitrary, fixed reference.
178 */
179 void SetAntennaNoisePower(double noise);
180
181 /**
182 * @brief MCS known bits.
183 */
184 enum McsKnown : uint8_t
185 {
186 MCS_KNOWN_NONE = 0x00, /**< No flags set */
187 MCS_KNOWN_BANDWIDTH = 0x01, /**< Bandwidth */
188 MCS_KNOWN_INDEX = 0x02, /**< MCS index known */
189 MCS_KNOWN_GUARD_INTERVAL = 0x04, /**< Guard interval */
190 MCS_KNOWN_HT_FORMAT = 0x08, /**< HT format */
191 MCS_KNOWN_FEC_TYPE = 0x10, /**< FEC type */
192 MCS_KNOWN_STBC = 0x20, /**< STBC known */
193 MCS_KNOWN_NESS = 0x40, /**< Ness known (Number of extension spatial streams) */
195 0x80, /**< Ness data - bit 1 (MSB) of Number of extension spatial streams */
196 };
197
198 /**
199 * @brief MCS flags.
200 */
201 enum McsFlags : uint8_t
202 {
204 0x00, /**< Default: 20 MHz, long guard interval, mixed HT format and BCC FEC type */
205 MCS_FLAGS_BANDWIDTH_40 = 0x01, /**< 40 MHz */
206 MCS_FLAGS_BANDWIDTH_20L = 0x02, /**< 20L (20 MHz in lower half of 40 MHz channel) */
207 MCS_FLAGS_BANDWIDTH_20U = 0x03, /**< 20U (20 MHz in upper half of 40 MHz channel) */
208 MCS_FLAGS_GUARD_INTERVAL = 0x04, /**< Short guard interval */
209 MCS_FLAGS_HT_GREENFIELD = 0x08, /**< Greenfield HT format */
210 MCS_FLAGS_FEC_TYPE = 0x10, /**< LDPC FEC type */
211 MCS_FLAGS_STBC_STREAMS = 0x60, /**< STBC enabled */
213 0x80, /**< Ness - bit 0 (LSB) of Number of extension spatial streams */
214 };
215
216 /**
217 * structure that contains the subfields of the MCS field.
218 */
220 {
221 uint8_t known{MCS_KNOWN_NONE}; //!< known flags
222 uint8_t flags{MCS_FLAGS_NONE}; //!< flags field
223 uint8_t mcs{0}; //!< MCS index value
224 };
225
226 /**
227 * @brief Set the subfields of the MCS field
228 *
229 * @param mcsFields The subfields of the MCS field.
230 */
231 void SetMcsFields(const McsFields& mcsFields);
232
233 /**
234 * @brief A-MPDU status flags.
235 */
236 enum AmpduFlags : uint8_t
237 {
238 A_MPDU_STATUS_NONE = 0x00, /**< No flags set */
239 A_MPDU_STATUS_REPORT_ZERO_LENGTH = 0x01, /**< Driver reports 0-length subframes */
241 0x02, /**< Frame is 0-length subframe (valid only if 0x0001 is set) */
243 0x04, /**< Last subframe is known (should be set for all subframes in an A-MPDU) */
244 A_MPDU_STATUS_LAST = 0x08, /**< This frame is the last subframe */
245 A_MPDU_STATUS_DELIMITER_CRC_ERROR = 0x10, /**< Delimiter CRC error */
247 0x20 /**< Delimiter CRC value known: the delimiter CRC value field is valid */
248 };
249
250 /**
251 * structure that contains the subfields of the A-MPDU status field.
252 */
254 {
256 0}; //!< A-MPDU reference number to identify all subframes belonging to the same A-MPDU
257 uint16_t flags{A_MPDU_STATUS_NONE}; //!< flags field
258 uint8_t crc{1}; //!< CRC field
259 uint8_t reserved{0}; //!< Reserved field
260 };
261
262 /**
263 * @brief Set the subfields of the A-MPDU status field
264 *
265 * @param ampduStatusFields The subfields of the A-MPDU status field.
266 */
267 void SetAmpduStatus(const AmpduStatusFields& ampduStatusFields);
268
269 /**
270 * @brief VHT known bits.
271 */
272 enum VhtKnown : uint16_t
273 {
274 VHT_KNOWN_NONE = 0x0000, /**< No flags set */
275 VHT_KNOWN_STBC = 0x0001, /**< Space-time block coding (1 if all spatial streams of all users
276 have STBC, 0 otherwise). */
277 VHT_KNOWN_TXOP_PS_NOT_ALLOWED = 0x0002, /**< TXOP_PS_NOT_ALLOWED known */
278 VHT_KNOWN_GUARD_INTERVAL = 0x0004, /**< Guard interval */
279 VHT_KNOWN_SHORT_GI_NSYM_DISAMBIGUATION = 0x0008, /**< Short GI NSYM disambiguation known */
280 VHT_KNOWN_LDPC_EXTRA_OFDM_SYMBOL = 0x0010, /**< LDPC extra OFDM symbol known */
281 VHT_KNOWN_BEAMFORMED = 0x0020, /**< Beamformed known/applicable (this flag should be set to
282 zero for MU PPDUs). */
283 VHT_KNOWN_BANDWIDTH = 0x0040, /**< Bandwidth known */
284 VHT_KNOWN_GROUP_ID = 0x0080, /**< Group ID known */
285 VHT_KNOWN_PARTIAL_AID = 0x0100, /**< Partial AID known/applicable */
286 };
287
288 /**
289 * @brief VHT flags.
290 */
291 enum VhtFlags : uint8_t
292 {
293 VHT_FLAGS_NONE = 0x00, /**< No flags set */
295 0x01, /**< Set if all spatial streams of all users have space-time block coding */
297 0x02, /**< Set if STAs may not doze during TXOP (valid only for AP transmitters). */
298 VHT_FLAGS_GUARD_INTERVAL = 0x04, /**< Short guard interval */
300 0x08, /**< Set if NSYM mod 10 = 9 (valid only if short GI is used).*/
302 0x10, /**< Set if one or more users are using LDPC and the encoding process resulted in
303 extra OFDM symbol(s) */
304 VHT_FLAGS_BEAMFORMED = 0x20, /**< Set if beamforming is used (valid for SU PPDUs only). */
305 };
306
307 /**
308 * structure that contains the subfields of the VHT field.
309 */
311 {
312 uint16_t known{VHT_KNOWN_NONE}; //!< known flags field
313 uint8_t flags{VHT_FLAGS_NONE}; //!< flags field
314 uint8_t bandwidth{0}; //!< bandwidth field
315 std::array<uint8_t, 4> mcsNss{}; //!< mcs_nss field
316 uint8_t coding{0}; //!< coding field
317 uint8_t groupId{0}; //!< group_id field
318 uint16_t partialAid{0}; //!< partial_aid field
319 };
320
321 /**
322 * @brief Set the subfields of the VHT field
323 *
324 * @param vhtFields The subfields of the VHT field.
325 */
326 void SetVhtFields(const VhtFields& vhtFields);
327
328 /**
329 * @brief bits of the HE data fields.
330 */
331 enum HeData : uint16_t
332 {
333 /* Data 1 */
334 HE_DATA1_FORMAT_EXT_SU = 0x0001, /**< HE EXT SU PPDU format */
335 HE_DATA1_FORMAT_MU = 0x0002, /**< HE MU PPDU format */
336 HE_DATA1_FORMAT_TRIG = 0x0003, /**< HE TRIG PPDU format */
337 HE_DATA1_BSS_COLOR_KNOWN = 0x0004, /**< BSS Color known */
338 HE_DATA1_BEAM_CHANGE_KNOWN = 0x0008, /**< Beam Change known */
339 HE_DATA1_UL_DL_KNOWN = 0x0010, /**< UL/DL known */
340 HE_DATA1_DATA_MCS_KNOWN = 0x0020, /**< data MCS known */
341 HE_DATA1_DATA_DCM_KNOWN = 0x0040, /**< data DCM known */
342 HE_DATA1_CODING_KNOWN = 0x0080, /**< Coding known */
343 HE_DATA1_LDPC_XSYMSEG_KNOWN = 0x0100, /**< LDPC extra symbol segment known */
344 HE_DATA1_STBC_KNOWN = 0x0200, /**< STBC known */
346 0x0400, /**< Spatial Reuse known (Spatial Reuse 1 for HE TRIG PPDU format) */
347 HE_DATA1_SPTL_REUSE2_KNOWN = 0x0800, /**< Spatial Reuse 2 known (HE TRIG PPDU format),
348 STA-ID known (HE MU PPDU format) */
349 HE_DATA1_SPTL_REUSE3_KNOWN = 0x1000, /**< Spatial Reuse 3 known (HE TRIG PPDU format) */
350 HE_DATA1_SPTL_REUSE4_KNOWN = 0x2000, /**< Spatial Reuse 4 known (HE TRIG PPDU format) */
351 HE_DATA1_BW_RU_ALLOC_KNOWN = 0x4000, /**< data BW/RU allocation known */
352 HE_DATA1_DOPPLER_KNOWN = 0x8000, /**< Doppler known */
353 /* Data 2 */
354 HE_DATA2_PRISEC_80_KNOWN = 0x0001, /**< pri/sec 80 MHz known */
355 HE_DATA2_GI_KNOWN = 0x0002, /**< GI known */
356 HE_DATA2_NUM_LTF_SYMS_KNOWN = 0x0004, /**< number of LTF symbols known */
357 HE_DATA2_PRE_FEC_PAD_KNOWN = 0x0008, /**< Pre-FEC Padding Factor known */
358 HE_DATA2_TXBF_KNOWN = 0x0010, /**< TxBF known */
359 HE_DATA2_PE_DISAMBIG_KNOWN = 0x0020, /**< PE Disambiguity known */
360 HE_DATA2_TXOP_KNOWN = 0x0040, /**< TXOP known */
361 HE_DATA2_MIDAMBLE_KNOWN = 0x0080, /**< midamble periodicity known */
362 HE_DATA2_RU_OFFSET = 0x3f00, /**< RU allocation offset */
363 HE_DATA2_RU_OFFSET_KNOWN = 0x4000, /**< RU allocation offset known */
364 HE_DATA2_PRISEC_80_SEC = 0x8000, /**< pri/sec 80 MHz */
365 /* Data 3 */
374 /* Data 4 */
381 /* Data 5 */
382 HE_DATA5_DATA_BW_RU_ALLOC_40MHZ = 0x0001, /**< 40 MHz data Bandwidth */
383 HE_DATA5_DATA_BW_RU_ALLOC_80MHZ = 0x0002, /**< 80 MHz data Bandwidth */
384 HE_DATA5_DATA_BW_RU_ALLOC_160MHZ = 0x0003, /**< 160 MHz data Bandwidth */
385 HE_DATA5_DATA_BW_RU_ALLOC_26T = 0x0004, /**< 26-tone RU allocation */
386 HE_DATA5_DATA_BW_RU_ALLOC_52T = 0x0005, /**< 52-tone RU allocation */
387 HE_DATA5_DATA_BW_RU_ALLOC_106T = 0x0006, /**< 106-tone RU allocation */
388 HE_DATA5_DATA_BW_RU_ALLOC_242T = 0x0007, /**< 242-tone RU allocation */
389 HE_DATA5_DATA_BW_RU_ALLOC_484T = 0x0008, /**< 484-tone RU allocation */
390 HE_DATA5_DATA_BW_RU_ALLOC_996T = 0x0009, /**< 996-tone RU allocation */
391 HE_DATA5_DATA_BW_RU_ALLOC_2x996T = 0x000a, /**< 2x996-tone RU allocation */
392 HE_DATA5_GI_1_6 = 0x0010, /**< 1.6us GI */
393 HE_DATA5_GI_3_2 = 0x0020, /**< 3.2us GI */
394 HE_DATA5_LTF_SYM_SIZE = 0x00c0, /**< LTF symbol size */
395 HE_DATA5_NUM_LTF_SYMS = 0x0700, /**< number of LTF symbols */
396 HE_DATA5_PRE_FEC_PAD = 0x3000, /**< Pre-FEC Padding Factor */
397 HE_DATA5_TXBF = 0x4000, /**< TxBF */
398 HE_DATA5_PE_DISAMBIG = 0x8000, /**< PE Disambiguity */
399 };
400
401 /**
402 * structure that contains the subfields of the HE field.
403 */
404 struct HeFields
405 {
406 uint16_t data1{0}; //!< data1 field
407 uint16_t data2{0}; //!< data2 field
408 uint16_t data3{0}; //!< data3 field
409 uint16_t data4{0}; //!< data4 field
410 uint16_t data5{0}; //!< data5 field
411 uint16_t data6{0}; //!< data6 field
412 };
413
414 /**
415 * @brief Set the subfields of the HE field
416 *
417 * @param heFields The subfields of the HE field.
418 */
419 void SetHeFields(const HeFields& heFields);
420
421 /**
422 * @brief HE MU flags1.
423 */
424 enum HeMuFlags1 : uint16_t
425 {
426 HE_MU_FLAGS1_SIGB_MCS = 0x000f, //!< SIG-B MCS (from SIG-A)
427 HE_MU_FLAGS1_SIGB_MCS_KNOWN = 0x0010, //!< SIG-B MCS known
428 HE_MU_FLAGS1_SIGB_DCM = 0x0020, //!< SIG-B DCM (from SIG-A)
429 HE_MU_FLAGS1_SIGB_DCM_KNOWN = 0x0040, //!< SIG-B DCM known
430 HE_MU_FLAGS1_CH2_CENTER_26T_RU_KNOWN = 0x0080, //!< (Channel 2) Center 26-tone RU bit known
431 HE_MU_FLAGS1_CH1_RUS_KNOWN = 0x0100, //!< Channel 1 RUs known (which depends on BW)
432 HE_MU_FLAGS1_CH2_RUS_KNOWN = 0x0200, //!< Channel 2 RUs known (which depends on BW)
433 HE_MU_FLAGS1_CH1_CENTER_26T_RU_KNOWN = 0x1000, //!< (Channel 1) Center 26-tone RU bit known
434 HE_MU_FLAGS1_CH1_CENTER_26T_RU = 0x2000, //!< (Channel 1) Center 26-tone RU value
435 HE_MU_FLAGS1_SIGB_COMPRESSION_KNOWN = 0x4000, //!< SIG-B Compression known
436 HE_MU_FLAGS1_NUM_SIGB_SYMBOLS_KNOWN = 0x8000, //!< # of HE-SIG-B Symbols/MU-MIMO Users known
437 };
438
439 /**
440 * @brief HE MU flags2.
441 */
442 enum HeMuFlags2 : uint16_t
443 {
444 HE_MU_FLAGS2_BW_FROM_SIGA = 0x0003, /**< Bandwidth from Bandwidth field in HE-SIG-A */
446 0x0004, /**< Bandwidth from Bandwidth field in HE-SIG-A known */
447 HE_MU_FLAGS2_SIGB_COMPRESSION_FROM_SIGA = 0x0008, /**< SIG-B compression from SIG-A */
449 0x00f0, /**< # of HE-SIG-B Symbols - 1 or # of MU-MIMO Users - 1 from SIG-A */
451 0x0300, /**< Preamble puncturing from Bandwidth field in HE-SIG-A */
453 0x0400, /**< Preamble puncturing from Bandwidth field in HE-SIG-A known */
454 HE_MU_FLAGS2_CH2_CENTER_26T_RU = 0x0800, /**< (Channel 2) Center 26-tone RU value */
455 };
456
457 /**
458 * structure that contains the subfields of the HE-MU field.
459 */
461 {
462 uint16_t flags1{0}; //!< flags1 field
463 uint16_t flags2{0}; //!< flags2 field
464 std::array<uint8_t, 4> ruChannel1{}; //!< RU_channel1 field
465 std::array<uint8_t, 4> ruChannel2{}; //!< RU_channel2 field
466 };
467
468 /**
469 * @brief Set the subfields of the HE-MU field
470 *
471 * @param heMuFields The subfields of the HE-MU field.
472 */
473 void SetHeMuFields(const HeMuFields& heMuFields);
474
475 /**
476 * @brief HE MU per_user_known.
477 */
478 enum HeMuPerUserKnown : uint8_t
479 {
480 HE_MU_PER_USER_POSITION_KNOWN = 0x01, //!< User field position known
481 HE_MU_PER_USER_STA_ID_KNOWN = 0x02, //!< STA-ID known
482 HE_MU_PER_USER_NSTS_KNOWN = 0x04, //!< NSTS known
483 HE_MU_PER_USER_TX_BF_KNOWN = 0x08, //!< Tx Beamforming known
484 HE_MU_PER_USER_SPATIAL_CONFIGURATION_KNOWN = 0x10, //!< Spatial Configuration known
485 HE_MU_PER_USER_MCS_KNOWN = 0x20, //!< MCS known
486 HE_MU_PER_USER_DCM_KNOWN = 0x40, //!< DCM known
487 HE_MU_PER_USER_CODING_KNOWN = 0x80, //!< Coding known
488 };
489
490 /**
491 * structure that contains the subfields of the HE-MU-other-user field.
492 */
494 {
495 uint16_t perUser1{0}; //!< per_user_1 field
496 uint16_t perUser2{0}; //!< per_user_2 field
497 uint8_t perUserPosition{0}; //!< per_user_position field
498 uint8_t perUserKnown{0}; //!< per_user_known field
499 };
500
501 /**
502 * @brief Set the subfields of the HE-MU-other-user field
503 *
504 * @param heMuOtherUserFields The subfields of the HE-MU-other-user field.
505 */
506 void SetHeMuOtherUserFields(const HeMuOtherUserFields& heMuOtherUserFields);
507
508 /**
509 * structure that contains the subfields of the TLV fields.
510 */
512 {
513 uint16_t type{0}; //!< type field.
514 uint16_t length{0}; //!< length field.
515 };
516
517 /**
518 * structure that contains the subfields of the U-SIG field.
519 */
521 {
522 uint32_t common{0}; //!< common field.
523 uint32_t value{0}; //!< value field.
524 uint32_t mask{0}; //!< mask field.
525 };
526
527 /**
528 * @brief U-SIG common subfield.
529 */
546
547 /**
548 * @brief Possible BW values in U-SIG common subfield.
549 */
559
560 /**
561 * @brief EHT MU PPDU U-SIG contents.
562 */
564 {
565 /* MU-USIG-1 */
568 /* MU-USIG-2 */
577 };
578
579 /**
580 * @brief EHT TB PPDU U-SIG contents.
581 */
583 {
584 /* TB-USIG-1 */
586 /* TB-USIG-2 */
594 };
595
596 /**
597 * @brief Set the subfields of the U-SIG field
598 *
599 * @param usigFields The subfields of the U-SIG field.
600 */
601 void SetUsigFields(const UsigFields& usigFields);
602
603 /**
604 * structure that contains the subfields of the EHT field.
605 */
607 {
608 uint32_t known{0}; //!< known field.
609 std::array<uint32_t, 9> data{}; //!< data fields.
610 std::vector<uint32_t> userInfo{}; //!< user info fields.
611 };
612
613 /**
614 * @brief EHT known subfield.
615 */
640
641 /**
642 * @brief EHT data subfield.
643 */
645 {
646 /* Data 0 */
648 EHT_DATA0_GI = 0x00000180,
649 EHT_DATA0_LTF = 0x00000600,
650 EHT_DATA0_EHT_LTF = 0x00003800,
656 EHT_DATA0_CRC1_O = 0x03c00000,
657 EHT_DATA0_TAIL1_O = 0xfc000000,
658 /* Data 1 */
664 /* Data 2 */
671 /* Data 3 */
678 /* Data 4 */
685 /* Data 5 */
692 /* Data 6 */
699 /* Data 7 */
700 EHT_DATA7_CRC2_O = 0x0000000f,
701 EHT_DATA7_TAIL_2_O = 0x000003f0,
702 EHT_DATA7_NSS_S = 0x0000f000,
707 /* Data 8 */
711 };
712
713 /**
714 * @brief Possible GI values in EHT data subfield.
715 */
722
723 /**
724 * @brief Possible Primary 80 MHz Channel Position values in EHT data subfield.
725 */
731
732 /**
733 * @brief Possible RU/MRU Size values in EHT data subfield.
734 */
754
755 /**
756 * @brief EHT user_info subfield.
757 */
774
775 /**
776 * @brief Set the subfields of the EHT-SIG field
777 *
778 * @param ehtFields The subfields of the EHT-SIG field.
779 */
780 void SetEhtFields(const EhtFields& ehtFields);
781
782 private:
783 static constexpr int MIN_HEADER_SIZE{8}; //!< the minimum size of the radiotap header
784
785 /**
786 * Update a present field.
787 *
788 * @param field The field to set in a present bitmask.
789 */
790 void UpdatePresentField(uint32_t field);
791
792 /**
793 * Serialize the TSFT radiotap header.
794 *
795 * @param start An iterator which points to where the header should be written.
796 */
797 void SerializeTsft(Buffer::Iterator& start) const;
798
799 /**
800 * Deserialize the TSFT radiotap header.
801 *
802 * @param start An iterator which points to where the header should be read.
803 * @param bytesRead the number of bytes already read.
804
805 * @returns The number of bytes read.
806 */
808
809 /**
810 * Serialize the Channel radiotap header.
811 *
812 * @param start An iterator which points to where the header should be written.
813 */
814 void SerializeChannel(Buffer::Iterator& start) const;
815
816 /**
817 * Deserialize the Channel radiotap header.
818 *
819 * @param start An iterator which points to where the header should be read.
820 * @param bytesRead the number of bytes already read.
821
822 * @returns The number of bytes read.
823 */
825
826 /**
827 * Add Channel subfield/value pairs to the output stream.
828 *
829 * @param os The output stream
830 */
831 void PrintChannel(std::ostream& os) const;
832
833 /**
834 * Serialize the MCS radiotap header.
835 *
836 * @param start An iterator which points to where the header should be written.
837 */
838 void SerializeMcs(Buffer::Iterator& start) const;
839
840 /**
841 * Deserialize the MCS radiotap header.
842 *
843 * @param start An iterator which points to where the header should be read.
844 * @param bytesRead the number of bytes already read.
845
846 * @returns The number of bytes read.
847 */
849
850 /**
851 * Add MCS subfield/value pairs to the output stream.
852 *
853 * @param os The output stream
854 */
855 void PrintMcs(std::ostream& os) const;
856
857 /**
858 * Serialize the A-MPDU Status radiotap header.
859 *
860 * @param start An iterator which points to where the header should be written.
861 */
862 void SerializeAmpduStatus(Buffer::Iterator& start) const;
863
864 /**
865 * Deserialize the A-MPDU Status radiotap header.
866 *
867 * @param start An iterator which points to where the header should be read.
868 * @param bytesRead the number of bytes already read.
869
870 * @returns The number of bytes read.
871 */
873
874 /**
875 * Add A-MPDU Status subfield/value pairs to the output stream.
876 *
877 * @param os The output stream
878 */
879 void PrintAmpduStatus(std::ostream& os) const;
880
881 /**
882 * Serialize the VHT radiotap header.
883 *
884 * @param start An iterator which points to where the header should be written.
885 */
886 void SerializeVht(Buffer::Iterator& start) const;
887
888 /**
889 * Deserialize the VHT radiotap header.
890 *
891 * @param start An iterator which points to where the header should be read.
892 * @param bytesRead the number of bytes already read.
893
894 * @returns The number of bytes read.
895 */
897
898 /**
899 * Add VHT subfield/value pairs to the output stream.
900 *
901 * @param os The output stream
902 */
903 void PrintVht(std::ostream& os) const;
904
905 /**
906 * Serialize the HE radiotap header.
907 *
908 * @param start An iterator which points to where the header should be written.
909 */
910 void SerializeHe(Buffer::Iterator& start) const;
911
912 /**
913 * Deserialize the HE radiotap header.
914 *
915 * @param start An iterator which points to where the header should be read.
916 * @param bytesRead the number of bytes already read.
917
918 * @returns The number of bytes read.
919 */
921
922 /**
923 * Add HE subfield/value pairs to the output stream.
924 *
925 * @param os The output stream
926 */
927 void PrintHe(std::ostream& os) const;
928
929 /**
930 * Serialize the HE-MU radiotap header.
931 *
932 * @param start An iterator which points to where the header should be written.
933 */
934 void SerializeHeMu(Buffer::Iterator& start) const;
935
936 /**
937 * Deserialize the HE-MU radiotap header.
938 *
939 * @param start An iterator which points to where the header should be read.
940 * @param bytesRead the number of bytes already read.
941
942 * @returns The number of bytes read.
943 */
945
946 /**
947 * Add HE-MU subfield/value pairs to the output stream.
948 *
949 * @param os The output stream
950 */
951 void PrintHeMu(std::ostream& os) const;
952
953 /**
954 * Serialize the HE-MU-other-user radiotap header.
955 *
956 * @param start An iterator which points to where the header should be written.
957 */
958 void SerializeHeMuOtherUser(Buffer::Iterator& start) const;
959
960 /**
961 * Deserialize the HE-MU-other-user radiotap header.
962 *
963 * @param start An iterator which points to where the header should be read.
964 * @param bytesRead the number of bytes already read.
965
966 * @returns The number of bytes read.
967 */
969
970 /**
971 * Add HE-MU-other-user subfield/value pairs to the output stream.
972 *
973 * @param os The output stream
974 */
975 void PrintHeMuOtherUser(std::ostream& os) const;
976
977 /**
978 * Serialize the U-SIG radiotap header.
979 *
980 * @param start An iterator which points to where the header should be written.
981 */
982 void SerializeUsig(Buffer::Iterator& start) const;
983
984 /**
985 * Deserialize the U-SIG radiotap header.
986 *
987 * @param start An iterator which points to where the header should be read.
988 * @param bytesRead the number of bytes already read.
989
990 * @returns The number of bytes read.
991 */
993
994 /**
995 * Add U-SIG subfield/value pairs to the output stream.
996 *
997 * @param os The output stream
998 */
999 void PrintUsig(std::ostream& os) const;
1000
1001 /**
1002 * Serialize the EHT radiotap header.
1003 *
1004 * @param start An iterator which points to where the header should be written.
1005 */
1006 void SerializeEht(Buffer::Iterator& start) const;
1007
1008 /**
1009 * Deserialize the EHT radiotap header.
1010 *
1011 * @param start An iterator which points to where the header should be read.
1012 * @param bytesRead the number of bytes already read.
1013
1014 * @returns The number of bytes read.
1015 */
1017
1018 /**
1019 * Add EHT subfield/value pairs to the output stream.
1020 *
1021 * @param os The output stream
1022 */
1023 void PrintEht(std::ostream& os) const;
1024
1025 /**
1026 * @brief Radiotap fields.
1027 */
1047
1048 uint16_t m_length{MIN_HEADER_SIZE}; //!< entire length of radiotap data + header
1049 std::vector<uint32_t> m_present{0}; //!< bits describing which fields follow header
1050
1051 uint8_t m_tsftPad{0}; //!< TSFT padding.
1052 uint64_t m_tsft{0}; //!< Time Synchronization Function Timer (when the first bit of the MPDU
1053 //!< arrived at the MAC)
1054
1055 uint8_t m_flags{FRAME_FLAG_NONE}; //!< Properties of transmitted and received frames.
1056
1057 uint8_t m_rate{0}; //!< TX/RX data rate in units of 500 kbps
1058
1059 uint8_t m_channelPad{0}; //!< Channel padding.
1060 ChannelFields m_channelFields{}; //!< Channel fields.
1061
1063 0}; //!< RF signal power at the antenna, dB difference from an arbitrary, fixed reference.
1065 0}; //!< RF noise power at the antenna, dB difference from an arbitrary, fixed reference.
1066
1067 uint8_t m_mcsPad{0}; //!< MCS padding.
1068 McsFields m_mcsFields{}; //!< MCS fields.
1069
1070 uint8_t m_ampduStatusPad{0}; //!< A-MPDU Status Flags, padding before A-MPDU Status Field.
1071 AmpduStatusFields m_ampduStatusFields{}; //!< A-MPDU Status fields.
1072
1073 uint8_t m_vhtPad{0}; //!< VHT padding.
1074 VhtFields m_vhtFields{}; //!< VHT fields.
1075
1076 uint8_t m_hePad{0}; //!< HE padding.
1077 HeFields m_heFields{}; //!< HE fields.
1078
1079 uint8_t m_heMuPad{0}; //!< HE MU padding.
1080 HeMuFields m_heMuFields{}; //!< HE MU fields.
1081
1082 uint8_t m_heMuOtherUserPad{0}; //!< HE MU other user padding.
1083 HeMuOtherUserFields m_heMuOtherUserFields{}; //!< HE MU other user fields.
1084
1085 uint8_t m_usigTlvPad{0}; //!< U-SIG TLV padding.
1086 TlvFields m_usigTlv{}; //!< U-SIG TLV fields.
1087 uint8_t m_usigPad{0}; //!< U-SIG padding.
1088 UsigFields m_usigFields{}; //!< U-SIG fields.
1089
1090 uint8_t m_ehtTlvPad{0}; //!< EHT TLV padding.
1091 TlvFields m_ehtTlv{}; //!< EHT TLV fields.
1092 uint8_t m_ehtPad{0}; //!< EHT padding.
1093 EhtFields m_ehtFields{}; //!< EHT fields.
1094};
1095
1096} // namespace ns3
1097
1098#endif /* RADIOTAP_HEADER_H */
iterator in a Buffer instance
Definition buffer.h:89
Protocol header serialization and deserialization.
Definition header.h:36
Radiotap header implementation.
void SerializeMcs(Buffer::Iterator &start) const
Serialize the MCS radiotap header.
HeMuFields m_heMuFields
HE MU fields.
uint32_t DeserializeHe(Buffer::Iterator start, uint32_t bytesRead)
Deserialize the HE radiotap header.
void PrintHeMu(std::ostream &os) const
Add HE-MU subfield/value pairs to the output stream.
void SerializeHe(Buffer::Iterator &start) const
Serialize the HE radiotap header.
uint8_t m_rate
TX/RX data rate in units of 500 kbps.
void PrintMcs(std::ostream &os) const
Add MCS subfield/value pairs to the output stream.
void SetAmpduStatus(const AmpduStatusFields &ampduStatusFields)
Set the subfields of the A-MPDU status field.
uint32_t DeserializeUsig(Buffer::Iterator start, uint32_t bytesRead)
Deserialize the U-SIG radiotap header.
void PrintEht(std::ostream &os) const
Add EHT subfield/value pairs to the output stream.
static TypeId GetTypeId()
Get the type ID.
ChannelFlags
Channel flags.
@ CHANNEL_FLAG_GFSK
GFSK channel (FHSS PHY).
@ CHANNEL_FLAG_TURBO
Turbo Channel.
@ CHANNEL_FLAG_DYNAMIC
Dynamic CCK-OFDM channel.
@ CHANNEL_FLAG_PASSIVE
Only passive scan allowed.
@ CHANNEL_FLAG_OFDM
OFDM channel.
@ CHANNEL_FLAG_CCK
CCK channel.
@ CHANNEL_FLAG_NONE
No flags set.
@ CHANNEL_FLAG_SPECTRUM_5GHZ
5 GHz spectrum channel
@ CHANNEL_FLAG_SPECTRUM_2GHZ
2 GHz spectrum channel
uint8_t m_ampduStatusPad
A-MPDU Status Flags, padding before A-MPDU Status Field.
void PrintHeMuOtherUser(std::ostream &os) const
Add HE-MU-other-user subfield/value pairs to the output stream.
RadiotapFields
Radiotap fields.
void SetHeMuOtherUserFields(const HeMuOtherUserFields &heMuOtherUserFields)
Set the subfields of the HE-MU-other-user field.
UsigTb
EHT TB PPDU U-SIG contents.
@ HE_MU_FLAGS1_SIGB_DCM_KNOWN
SIG-B DCM known.
@ HE_MU_FLAGS1_SIGB_MCS_KNOWN
SIG-B MCS known.
@ HE_MU_FLAGS1_CH1_RUS_KNOWN
Channel 1 RUs known (which depends on BW).
@ HE_MU_FLAGS1_SIGB_DCM
SIG-B DCM (from SIG-A).
@ HE_MU_FLAGS1_CH2_RUS_KNOWN
Channel 2 RUs known (which depends on BW).
@ HE_MU_FLAGS1_CH1_CENTER_26T_RU_KNOWN
(Channel 1) Center 26-tone RU bit known
@ HE_MU_FLAGS1_CH2_CENTER_26T_RU_KNOWN
(Channel 2) Center 26-tone RU bit known
@ HE_MU_FLAGS1_CH1_CENTER_26T_RU
(Channel 1) Center 26-tone RU value
@ HE_MU_FLAGS1_SIGB_COMPRESSION_KNOWN
SIG-B Compression known.
@ HE_MU_FLAGS1_SIGB_MCS
SIG-B MCS (from SIG-A).
uint8_t m_ehtPad
EHT padding.
HeFields m_heFields
HE fields.
uint8_t m_heMuPad
HE MU padding.
void Print(std::ostream &os) const override
This method is used by Packet::Print to print the content of the header as ascii data to a C++ output...
uint8_t m_usigPad
U-SIG padding.
uint8_t m_heMuOtherUserPad
HE MU other user padding.
void SetHeFields(const HeFields &heFields)
Set the subfields of the HE field.
uint8_t m_hePad
HE padding.
void SerializeHeMuOtherUser(Buffer::Iterator &start) const
Serialize the HE-MU-other-user radiotap header.
EhtFields m_ehtFields
EHT fields.
HeMuPerUserKnown
HE MU per_user_known.
@ HE_MU_PER_USER_CODING_KNOWN
Coding known.
@ HE_MU_PER_USER_POSITION_KNOWN
User field position known.
@ HE_MU_PER_USER_SPATIAL_CONFIGURATION_KNOWN
Spatial Configuration known.
@ HE_MU_PER_USER_MCS_KNOWN
MCS known.
@ HE_MU_PER_USER_TX_BF_KNOWN
Tx Beamforming known.
@ HE_MU_PER_USER_NSTS_KNOWN
NSTS known.
@ HE_MU_PER_USER_STA_ID_KNOWN
STA-ID known.
@ HE_MU_PER_USER_DCM_KNOWN
DCM known.
void SetMcsFields(const McsFields &mcsFields)
Set the subfields of the MCS field.
uint8_t m_tsftPad
TSFT padding.
void SetRate(uint8_t rate)
Set the transmit/receive channel frequency in units of megahertz.
uint8_t m_ehtTlvPad
EHT TLV padding.
int8_t m_antennaSignal
RF signal power at the antenna, dB difference from an arbitrary, fixed reference.
void SetAntennaSignalPower(double signal)
Set the RF signal power at the antenna as a decibel difference from an arbitrary, fixed reference.
@ VHT_FLAGS_LDPC_EXTRA_OFDM_SYMBOL
Set if one or more users are using LDPC and the encoding process resulted in extra OFDM symbol(s).
@ VHT_FLAGS_TXOP_PS_NOT_ALLOWED
Set if STAs may not doze during TXOP (valid only for AP transmitters).
@ VHT_FLAGS_NONE
No flags set.
@ VHT_FLAGS_STBC
Set if all spatial streams of all users have space-time block coding.
@ VHT_FLAGS_BEAMFORMED
Set if beamforming is used (valid for SU PPDUs only).
@ VHT_FLAGS_GUARD_INTERVAL
Short guard interval.
@ VHT_FLAGS_SHORT_GI_NSYM_DISAMBIGUATION
Set if NSYM mod 10 = 9 (valid only if short GI is used).
EhtData1RuSize
Possible RU/MRU Size values in EHT data subfield.
uint32_t DeserializeAmpduStatus(Buffer::Iterator start, uint32_t bytesRead)
Deserialize the A-MPDU Status radiotap header.
uint32_t DeserializeVht(Buffer::Iterator start, uint32_t bytesRead)
Deserialize the VHT radiotap header.
uint32_t DeserializeHeMuOtherUser(Buffer::Iterator start, uint32_t bytesRead)
Deserialize the HE-MU-other-user radiotap header.
void SetTsft(uint64_t tsft)
Set the Time Synchronization Function Timer (TSFT) value.
void PrintHe(std::ostream &os) const
Add HE subfield/value pairs to the output stream.
TlvFields m_usigTlv
U-SIG TLV fields.
uint16_t m_length
entire length of radiotap data + header
void Serialize(Buffer::Iterator start) const override
This method is used by Packet::AddHeader to store the header into the byte buffer of a packet.
uint8_t m_mcsPad
MCS padding.
EhtUserInfo
EHT user_info subfield.
UsigCommonBw
Possible BW values in U-SIG common subfield.
void SerializeTsft(Buffer::Iterator &start) const
Serialize the TSFT radiotap header.
void SetUsigFields(const UsigFields &usigFields)
Set the subfields of the U-SIG field.
HeData
bits of the HE data fields.
@ HE_DATA5_PE_DISAMBIG
PE Disambiguity.
@ HE_DATA2_PRISEC_80_SEC
pri/sec 80 MHz
@ HE_DATA1_SPTL_REUSE_KNOWN
Spatial Reuse known (Spatial Reuse 1 for HE TRIG PPDU format).
@ HE_DATA1_DATA_DCM_KNOWN
data DCM known
@ HE_DATA1_CODING_KNOWN
Coding known.
@ HE_DATA2_PRE_FEC_PAD_KNOWN
Pre-FEC Padding Factor known.
@ HE_DATA5_DATA_BW_RU_ALLOC_26T
26-tone RU allocation
@ HE_DATA1_FORMAT_TRIG
HE TRIG PPDU format.
@ HE_DATA5_DATA_BW_RU_ALLOC_484T
484-tone RU allocation
@ HE_DATA1_STBC_KNOWN
STBC known.
@ HE_DATA2_TXOP_KNOWN
TXOP known.
@ HE_DATA1_SPTL_REUSE4_KNOWN
Spatial Reuse 4 known (HE TRIG PPDU format).
@ HE_DATA1_FORMAT_MU
HE MU PPDU format.
@ HE_DATA1_BSS_COLOR_KNOWN
BSS Color known.
@ HE_DATA5_DATA_BW_RU_ALLOC_40MHZ
40 MHz data Bandwidth
@ HE_DATA2_PE_DISAMBIG_KNOWN
PE Disambiguity known.
@ HE_DATA5_DATA_BW_RU_ALLOC_2x996T
2x996-tone RU allocation
@ HE_DATA5_DATA_BW_RU_ALLOC_242T
242-tone RU allocation
@ HE_DATA1_LDPC_XSYMSEG_KNOWN
LDPC extra symbol segment known.
@ HE_DATA5_NUM_LTF_SYMS
number of LTF symbols
@ HE_DATA5_DATA_BW_RU_ALLOC_52T
52-tone RU allocation
@ HE_DATA5_PRE_FEC_PAD
Pre-FEC Padding Factor.
@ HE_DATA2_RU_OFFSET
RU allocation offset.
@ HE_DATA1_FORMAT_EXT_SU
HE EXT SU PPDU format.
@ HE_DATA2_NUM_LTF_SYMS_KNOWN
number of LTF symbols known
@ HE_DATA2_TXBF_KNOWN
TxBF known.
@ HE_DATA1_SPTL_REUSE3_KNOWN
Spatial Reuse 3 known (HE TRIG PPDU format).
@ HE_DATA5_LTF_SYM_SIZE
LTF symbol size.
@ HE_DATA1_BEAM_CHANGE_KNOWN
Beam Change known.
@ HE_DATA1_DATA_MCS_KNOWN
data MCS known
@ HE_DATA5_DATA_BW_RU_ALLOC_160MHZ
160 MHz data Bandwidth
@ HE_DATA5_DATA_BW_RU_ALLOC_106T
106-tone RU allocation
@ HE_DATA2_RU_OFFSET_KNOWN
RU allocation offset known.
@ HE_DATA1_SPTL_REUSE2_KNOWN
Spatial Reuse 2 known (HE TRIG PPDU format), STA-ID known (HE MU PPDU format).
@ HE_DATA2_MIDAMBLE_KNOWN
midamble periodicity known
@ HE_DATA5_DATA_BW_RU_ALLOC_996T
996-tone RU allocation
@ HE_DATA1_BW_RU_ALLOC_KNOWN
data BW/RU allocation known
@ HE_DATA1_UL_DL_KNOWN
UL/DL known.
@ HE_DATA5_DATA_BW_RU_ALLOC_80MHZ
80 MHz data Bandwidth
@ HE_DATA2_PRISEC_80_KNOWN
pri/sec 80 MHz known
@ HE_DATA1_DOPPLER_KNOWN
Doppler known.
static constexpr int MIN_HEADER_SIZE
the minimum size of the radiotap header
void SerializeUsig(Buffer::Iterator &start) const
Serialize the U-SIG radiotap header.
uint32_t Deserialize(Buffer::Iterator start) override
This method is used by Packet::RemoveHeader to re-create a header from the byte buffer of a packet.
void PrintUsig(std::ostream &os) const
Add U-SIG subfield/value pairs to the output stream.
void PrintChannel(std::ostream &os) const
Add Channel subfield/value pairs to the output stream.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
McsKnown
MCS known bits.
@ MCS_KNOWN_FEC_TYPE
FEC type.
@ MCS_KNOWN_GUARD_INTERVAL
Guard interval.
@ MCS_KNOWN_NONE
No flags set.
@ MCS_KNOWN_BANDWIDTH
Bandwidth.
@ MCS_KNOWN_NESS_BIT_1
Ness data - bit 1 (MSB) of Number of extension spatial streams.
@ MCS_KNOWN_HT_FORMAT
HT format.
@ MCS_KNOWN_NESS
Ness known (Number of extension spatial streams).
@ MCS_KNOWN_INDEX
MCS index known.
@ MCS_KNOWN_STBC
STBC known.
uint32_t DeserializeMcs(Buffer::Iterator start, uint32_t bytesRead)
Deserialize the MCS radiotap header.
@ FRAME_FLAG_FRAGMENTED
Frame sent/received with fragmentation.
@ FRAME_FLAG_BAD_FCS
Frame failed FCS check.
@ FRAME_FLAG_SHORT_PREAMBLE
Frame sent/received with short preamble.
@ FRAME_FLAG_SHORT_GUARD
Frame used short guard interval (HT).
@ FRAME_FLAG_CFP
Frame sent/received during CFP.
@ FRAME_FLAG_WEP
Frame sent/received with WEP encryption.
@ FRAME_FLAG_DATA_PADDING
Frame has padding between 802.11 header and payload (to 32-bit boundary).
@ FRAME_FLAG_FCS_INCLUDED
Frame includes FCS.
@ FRAME_FLAG_NONE
No flags set.
@ HE_MU_FLAGS2_BW_FROM_SIGA_KNOWN
Bandwidth from Bandwidth field in HE-SIG-A known.
@ HE_MU_FLAGS2_CH2_CENTER_26T_RU
(Channel 2) Center 26-tone RU value
@ HE_MU_FLAGS2_BW_FROM_SIGA
Bandwidth from Bandwidth field in HE-SIG-A.
@ HE_MU_FLAGS2_PREAMBLE_PUNCTURING_FROM_SIGA_BW_FIELD_KNOWN
Preamble puncturing from Bandwidth field in HE-SIG-A known.
@ HE_MU_FLAGS2_PREAMBLE_PUNCTURING_FROM_SIGA_BW_FIELD
Preamble puncturing from Bandwidth field in HE-SIG-A.
@ HE_MU_FLAGS2_SIGB_COMPRESSION_FROM_SIGA
SIG-B compression from SIG-A.
void SerializeHeMu(Buffer::Iterator &start) const
Serialize the HE-MU radiotap header.
McsFields m_mcsFields
MCS fields.
void SerializeAmpduStatus(Buffer::Iterator &start) const
Serialize the A-MPDU Status radiotap header.
void SetVhtFields(const VhtFields &vhtFields)
Set the subfields of the VHT field.
void SerializeEht(Buffer::Iterator &start) const
Serialize the EHT radiotap header.
uint32_t DeserializeChannel(Buffer::Iterator start, uint32_t bytesRead)
Deserialize the Channel radiotap header.
UsigFields m_usigFields
U-SIG fields.
UsigCommon
U-SIG common subfield.
@ MCS_FLAGS_BANDWIDTH_20L
20L (20 MHz in lower half of 40 MHz channel)
@ MCS_FLAGS_NESS_BIT_0
Ness - bit 0 (LSB) of Number of extension spatial streams.
@ MCS_FLAGS_NONE
Default: 20 MHz, long guard interval, mixed HT format and BCC FEC type.
@ MCS_FLAGS_STBC_STREAMS
STBC enabled.
@ MCS_FLAGS_FEC_TYPE
LDPC FEC type.
@ MCS_FLAGS_HT_GREENFIELD
Greenfield HT format.
@ MCS_FLAGS_GUARD_INTERVAL
Short guard interval.
@ MCS_FLAGS_BANDWIDTH_20U
20U (20 MHz in upper half of 40 MHz channel)
void SerializeChannel(Buffer::Iterator &start) const
Serialize the Channel radiotap header.
void SetAntennaNoisePower(double noise)
Set the RF noise power at the antenna as a decibel difference from an arbitrary, fixed reference.
AmpduFlags
A-MPDU status flags.
@ A_MPDU_STATUS_IS_ZERO_LENGTH
Frame is 0-length subframe (valid only if 0x0001 is set).
@ A_MPDU_STATUS_NONE
No flags set.
@ A_MPDU_STATUS_REPORT_ZERO_LENGTH
Driver reports 0-length subframes.
@ A_MPDU_STATUS_DELIMITER_CRC_KNOWN
Delimiter CRC value known: the delimiter CRC value field is valid.
@ A_MPDU_STATUS_DELIMITER_CRC_ERROR
Delimiter CRC error.
@ A_MPDU_STATUS_LAST_KNOWN
Last subframe is known (should be set for all subframes in an A-MPDU).
@ A_MPDU_STATUS_LAST
This frame is the last subframe.
void UpdatePresentField(uint32_t field)
Update a present field.
std::vector< uint32_t > m_present
bits describing which fields follow header
void PrintVht(std::ostream &os) const
Add VHT subfield/value pairs to the output stream.
UsigMu
EHT MU PPDU U-SIG contents.
uint32_t GetSerializedSize() const override
This method is used by Packet::AddHeader to store the header into the byte buffer of a packet.
TlvFields m_ehtTlv
EHT TLV fields.
void SetEhtFields(const EhtFields &ehtFields)
Set the subfields of the EHT-SIG field.
ChannelFields m_channelFields
Channel fields.
uint8_t m_usigTlvPad
U-SIG TLV padding.
EhtData0Gi
Possible GI values in EHT data subfield.
EhtKnown
EHT known subfield.
uint8_t m_channelPad
Channel padding.
VhtKnown
VHT known bits.
@ VHT_KNOWN_GROUP_ID
Group ID known.
@ VHT_KNOWN_NONE
No flags set.
@ VHT_KNOWN_BANDWIDTH
Bandwidth known.
@ VHT_KNOWN_STBC
Space-time block coding (1 if all spatial streams of all users have STBC, 0 otherwise).
@ VHT_KNOWN_GUARD_INTERVAL
Guard interval.
@ VHT_KNOWN_LDPC_EXTRA_OFDM_SYMBOL
LDPC extra OFDM symbol known.
@ VHT_KNOWN_PARTIAL_AID
Partial AID known/applicable.
@ VHT_KNOWN_BEAMFORMED
Beamformed known/applicable (this flag should be set to zero for MU PPDUs).
@ VHT_KNOWN_SHORT_GI_NSYM_DISAMBIGUATION
Short GI NSYM disambiguation known.
@ VHT_KNOWN_TXOP_PS_NOT_ALLOWED
TXOP_PS_NOT_ALLOWED known.
uint32_t DeserializeHeMu(Buffer::Iterator start, uint32_t bytesRead)
Deserialize the HE-MU radiotap header.
uint8_t m_vhtPad
VHT padding.
AmpduStatusFields m_ampduStatusFields
A-MPDU Status fields.
void SerializeVht(Buffer::Iterator &start) const
Serialize the VHT radiotap header.
void PrintAmpduStatus(std::ostream &os) const
Add A-MPDU Status subfield/value pairs to the output stream.
void SetWifiHeader(std::size_t numPresentWords)
Set the ieee80211_radiotap_header.
uint32_t DeserializeTsft(Buffer::Iterator start, uint32_t bytesRead)
Deserialize the TSFT radiotap header.
uint8_t m_flags
Properties of transmitted and received frames.
EhtData
EHT data subfield.
void SetHeMuFields(const HeMuFields &heMuFields)
Set the subfields of the HE-MU field.
void SetChannelFields(const ChannelFields &channelFields)
Set the subfields of the Channel field.
HeMuOtherUserFields m_heMuOtherUserFields
HE MU other user fields.
void SetFrameFlags(uint8_t flags)
Set the frame flags of the transmitted or received frame.
EhtData1Primary80
Possible Primary 80 MHz Channel Position values in EHT data subfield.
VhtFields m_vhtFields
VHT fields.
uint64_t m_tsft
Time Synchronization Function Timer (when the first bit of the MPDU arrived at the MAC).
uint32_t DeserializeEht(Buffer::Iterator start, uint32_t bytesRead)
Deserialize the EHT radiotap header.
int8_t m_antennaNoise
RF noise power at the antenna, dB difference from an arbitrary, fixed reference.
a unique identifier for an interface.
Definition type-id.h:50
Every class exported by the ns3 library is enclosed in the ns3 namespace.
structure that contains the subfields of the A-MPDU status field.
uint32_t referenceNumber
A-MPDU reference number to identify all subframes belonging to the same A-MPDU.
structure that contains the subfields of the Channel field.
uint16_t frequency
Tx/Rx frequency in MHz.
structure that contains the subfields of the EHT field.
std::vector< uint32_t > userInfo
user info fields.
std::array< uint32_t, 9 > data
data fields.
structure that contains the subfields of the HE field.
structure that contains the subfields of the HE-MU field.
std::array< uint8_t, 4 > ruChannel2
RU_channel2 field.
std::array< uint8_t, 4 > ruChannel1
RU_channel1 field.
structure that contains the subfields of the HE-MU-other-user field.
uint8_t perUserKnown
per_user_known field
uint8_t perUserPosition
per_user_position field
structure that contains the subfields of the MCS field.
uint8_t mcs
MCS index value.
structure that contains the subfields of the TLV fields.
structure that contains the subfields of the U-SIG field.
structure that contains the subfields of the VHT field.
uint8_t groupId
group_id field
uint8_t bandwidth
bandwidth field
std::array< uint8_t, 4 > mcsNss
mcs_nss field
uint16_t partialAid
partial_aid field
uint16_t known
known flags field