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