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
15namespace ns3
16{
17
18/**
19 * @brief Radiotap header implementation
20 *
21 * Radiotap is a de facto standard for 802.11 frame injection and reception.
22 * The radiotap header format is a mechanism to supply additional information
23 * about frames, from the driver to userspace applications such as libpcap, and
24 * from a userspace application to the driver for transmission.
25 */
26class RadiotapHeader : public Header
27{
28 public:
30 /**
31 * @brief Get the type ID.
32 * @returns the object TypeId
33 */
34 static TypeId GetTypeId();
35 TypeId GetInstanceTypeId() const override;
36
37 /**
38 * This method is used by Packet::AddHeader to store the header into the byte
39 * buffer of a packet. This method returns the number of bytes which are
40 * needed to store the header data during a Serialize.
41 *
42 * @returns The expected size of the header.
43 */
44 uint32_t GetSerializedSize() const override;
45
46 /**
47 * This method is used by Packet::AddHeader to store the header into the byte
48 * buffer of a packet. The data written is expected to match bit-for-bit the
49 * representation of this header in a real network.
50 *
51 * @param start An iterator which points to where the header should
52 * be written.
53 */
54 void Serialize(Buffer::Iterator start) const override;
55
56 /**
57 * This method is used by Packet::RemoveHeader to re-create a header from the
58 * byte buffer of a packet. The data read is expected to match bit-for-bit
59 * the representation of this header in real networks.
60 *
61 * @param start An iterator which points to where the header should
62 * written.
63 * @returns The number of bytes read.
64 */
66
67 /**
68 * This method is used by Packet::Print to print the content of the header as
69 * ascii data to a C++ output stream. Although the header is free to format
70 * its output as it wishes, it is recommended to follow a few rules to integrate
71 * with the packet pretty printer: start with flags, small field
72 * values located between a pair of parens. Values should be separated
73 * by whitespace. Follow the parens with the important fields,
74 * separated by whitespace.
75 *
76 * eg: (field1 val1 field2 val2 field3 val3) field4 val4 field5 val5
77 *
78 * @param os The output stream
79 */
80 void Print(std::ostream& os) const override;
81
82 /**
83 * @brief Set the Time Synchronization Function Timer (TSFT) value. Valid for
84 * received frames only.
85 *
86 * @param tsft Value in microseconds of the MAC's 64-bit 802.11 Time
87 * Synchronization Function timer when the first bit of the MPDU
88 * arrived at the MAC.
89 */
90 void SetTsft(uint64_t tsft);
91
92 /**
93 * @brief Frame flags.
94 */
96 {
97 FRAME_FLAG_NONE = 0x00, /**< No flags set */
98 FRAME_FLAG_CFP = 0x01, /**< Frame sent/received during CFP */
99 FRAME_FLAG_SHORT_PREAMBLE = 0x02, /**< Frame sent/received with short preamble */
100 FRAME_FLAG_WEP = 0x04, /**< Frame sent/received with WEP encryption */
101 FRAME_FLAG_FRAGMENTED = 0x08, /**< Frame sent/received with fragmentation */
102 FRAME_FLAG_FCS_INCLUDED = 0x10, /**< Frame includes FCS */
104 0x20, /**< Frame has padding between 802.11 header and payload (to 32-bit boundary) */
105 FRAME_FLAG_BAD_FCS = 0x40, /**< Frame failed FCS check */
106 FRAME_FLAG_SHORT_GUARD = 0x80 /**< Frame used short guard interval (HT) */
107 };
108
109 /**
110 * @brief Set the frame flags of the transmitted or received frame.
111 * @param flags flags to set.
112 */
113 void SetFrameFlags(uint8_t flags);
114
115 /**
116 * @brief Set the transmit/receive channel frequency in units of megahertz
117 * @param rate the transmit/receive channel frequency in units of megahertz.
118 */
119 void SetRate(uint8_t rate);
120
121 /**
122 * @brief Channel flags.
123 */
125 {
126 CHANNEL_FLAG_NONE = 0x0000, /**< No flags set */
127 CHANNEL_FLAG_TURBO = 0x0010, /**< Turbo Channel */
128 CHANNEL_FLAG_CCK = 0x0020, /**< CCK channel */
129 CHANNEL_FLAG_OFDM = 0x0040, /**< OFDM channel */
130 CHANNEL_FLAG_SPECTRUM_2GHZ = 0x0080, /**< 2 GHz spectrum channel */
131 CHANNEL_FLAG_SPECTRUM_5GHZ = 0x0100, /**< 5 GHz spectrum channel */
132 CHANNEL_FLAG_PASSIVE = 0x0200, /**< Only passive scan allowed */
133 CHANNEL_FLAG_DYNAMIC = 0x0400, /**< Dynamic CCK-OFDM channel */
134 CHANNEL_FLAG_GFSK = 0x0800 /**< GFSK channel (FHSS PHY) */
135 };
136
137 /**
138 * @brief Set the transmit/receive channel frequency and flags
139 * @param frequency The transmit/receive data rate in units of 500 kbps.
140 * @param flags The flags to set.
141 * @see ChannelFlags
142 */
143 void SetChannelFrequencyAndFlags(uint16_t frequency, uint16_t flags);
144
145 /**
146 * @brief Set the RF signal power at the antenna as a decibel difference
147 * from an arbitrary, fixed reference.
148 *
149 * @param signal The RF signal power at the antenna as a decibel difference
150 * from an arbitrary, fixed reference;
151 */
152 void SetAntennaSignalPower(double signal);
153
154 /**
155 * @brief Set the RF noise power at the antenna as a decibel difference
156 * from an arbitrary, fixed reference.
157 *
158 * @param noise The RF noise power at the antenna as a decibel difference
159 * from an arbitrary, fixed reference.
160 */
161 void SetAntennaNoisePower(double noise);
162
163 /**
164 * @brief MCS known bits.
165 */
167 {
168 MCS_KNOWN_NONE = 0x00, /**< No flags set */
169 MCS_KNOWN_BANDWIDTH = 0x01, /**< Bandwidth */
170 MCS_KNOWN_INDEX = 0x02, /**< MCS index known */
171 MCS_KNOWN_GUARD_INTERVAL = 0x04, /**< Guard interval */
172 MCS_KNOWN_HT_FORMAT = 0x08, /**< HT format */
173 MCS_KNOWN_FEC_TYPE = 0x10, /**< FEC type */
174 MCS_KNOWN_STBC = 0x20, /**< STBC known */
175 MCS_KNOWN_NESS = 0x40, /**< Ness known (Number of extension spatial streams) */
177 0x80, /**< Ness data - bit 1 (MSB) of Number of extension spatial streams */
178 };
179
180 /**
181 * @brief MCS flags.
182 */
184 {
186 0x00, /**< Default: 20 MHz, long guard interval, mixed HT format and BCC FEC type */
187 MCS_FLAGS_BANDWIDTH_40 = 0x01, /**< 40 MHz */
188 MCS_FLAGS_BANDWIDTH_20L = 0x02, /**< 20L (20 MHz in lower half of 40 MHz channel) */
189 MCS_FLAGS_BANDWIDTH_20U = 0x03, /**< 20U (20 MHz in upper half of 40 MHz channel) */
190 MCS_FLAGS_GUARD_INTERVAL = 0x04, /**< Short guard interval */
191 MCS_FLAGS_HT_GREENFIELD = 0x08, /**< Greenfield HT format */
192 MCS_FLAGS_FEC_TYPE = 0x10, /**< LDPC FEC type */
193 MCS_FLAGS_STBC_STREAMS = 0x60, /**< STBC enabled */
195 0x80, /**< Ness - bit 0 (LSB) of Number of extension spatial streams */
196 };
197
198 /**
199 * @brief Set the MCS fields
200 *
201 * @param known The kwown flags.
202 * @param flags The flags to set.
203 * @param mcs The MCS index value.
204 */
205 void SetMcsFields(uint8_t known, uint8_t flags, uint8_t mcs);
206
207 /**
208 * @brief A-MPDU status flags.
209 */
211 {
212 A_MPDU_STATUS_NONE = 0x00, /**< No flags set */
213 A_MPDU_STATUS_REPORT_ZERO_LENGTH = 0x01, /**< Driver reports 0-length subframes */
215 0x02, /**< Frame is 0-length subframe (valid only if 0x0001 is set) */
217 0x04, /**< Last subframe is known (should be set for all subframes in an A-MPDU) */
218 A_MPDU_STATUS_LAST = 0x08, /**< This frame is the last subframe */
219 A_MPDU_STATUS_DELIMITER_CRC_ERROR = 0x10, /**< Delimiter CRC error */
221 0x20 /**< Delimiter CRC value known: the delimiter CRC value field is valid */
222 };
223
224 /**
225 * @brief Set the A-MPDU status fields
226 *
227 * @param referenceNumber The A-MPDU reference number to identify all subframes belonging to the
228 * same A-MPDU.
229 * @param flags The flags to set.
230 * @param crc The CRC value value.
231 */
232 void SetAmpduStatus(uint32_t referenceNumber, uint16_t flags, uint8_t crc);
233
234 /**
235 * @brief VHT known bits.
236 */
238 {
239 VHT_KNOWN_NONE = 0x0000, /**< No flags set */
240 VHT_KNOWN_STBC = 0x0001, /**< Space-time block coding (1 if all spatial streams of all users
241 have STBC, 0 otherwise). */
242 VHT_KNOWN_TXOP_PS_NOT_ALLOWED = 0x0002, /**< TXOP_PS_NOT_ALLOWED known */
243 VHT_KNOWN_GUARD_INTERVAL = 0x0004, /**< Guard interval */
244 VHT_KNOWN_SHORT_GI_NSYM_DISAMBIGUATION = 0x0008, /**< Short GI NSYM disambiguation known */
245 VHT_KNOWN_LDPC_EXTRA_OFDM_SYMBOL = 0x0010, /**< LDPC extra OFDM symbol known */
246 VHT_KNOWN_BEAMFORMED = 0x0020, /**< Beamformed known/applicable (this flag should be set to
247 zero for MU PPDUs). */
248 VHT_KNOWN_BANDWIDTH = 0x0040, /**< Bandwidth known */
249 VHT_KNOWN_GROUP_ID = 0x0080, /**< Group ID known */
250 VHT_KNOWN_PARTIAL_AID = 0x0100, /**< Partial AID known/applicable */
251 };
252
253 /**
254 * @brief VHT flags.
255 */
257 {
258 VHT_FLAGS_NONE = 0x00, /**< No flags set */
260 0x01, /**< Set if all spatial streams of all users have space-time block coding */
262 0x02, /**< Set if STAs may not doze during TXOP (valid only for AP transmitters). */
263 VHT_FLAGS_GUARD_INTERVAL = 0x04, /**< Short guard interval */
265 0x08, /**< Set if NSYM mod 10 = 9 (valid only if short GI is used).*/
267 0x10, /**< Set if one or more users are using LDPC and the encoding process resulted in
268 extra OFDM symbol(s) */
269 VHT_FLAGS_BEAMFORMED = 0x20, /**< Set if beamforming is used (valid for SU PPDUs only). */
270 };
271
272 /**
273 * @brief Set the VHT fields
274 *
275 * @param known The kwown flags.
276 * @param flags The flags to set.
277 * @param bandwidth The bandwidth value.
278 * @param mcs_nss The mcs_nss value.
279 * @param coding The coding value.
280 * @param group_id The group_id value.
281 * @param partial_aid The partial_aid value.
282 */
283 void SetVhtFields(uint16_t known,
284 uint8_t flags,
285 uint8_t bandwidth,
286 uint8_t mcs_nss[4],
287 uint8_t coding,
288 uint8_t group_id,
289 uint16_t partial_aid);
290
291 /**
292 * @brief HE data1.
293 */
295 {
296 HE_DATA1_FORMAT_EXT_SU = 0x0001, /**< HE EXT SU PPDU format */
297 HE_DATA1_FORMAT_MU = 0x0002, /**< HE MU PPDU format */
298 HE_DATA1_FORMAT_TRIG = 0x0003, /**< HE TRIG PPDU format */
299 HE_DATA1_BSS_COLOR_KNOWN = 0x0004, /**< BSS Color known */
300 HE_DATA1_BEAM_CHANGE_KNOWN = 0x0008, /**< Beam Change known */
301 HE_DATA1_UL_DL_KNOWN = 0x0010, /**< UL/DL known */
302 HE_DATA1_DATA_MCS_KNOWN = 0x0020, /**< data MCS known */
303 HE_DATA1_DATA_DCM_KNOWN = 0x0040, /**< data DCM known */
304 HE_DATA1_CODING_KNOWN = 0x0080, /**< Coding known */
305 HE_DATA1_LDPC_XSYMSEG_KNOWN = 0x0100, /**< LDPC extra symbol segment known */
306 HE_DATA1_STBC_KNOWN = 0x0200, /**< STBC known */
308 0x0400, /**< Spatial Reuse known (Spatial Reuse 1 for HE TRIG PPDU format) */
309 HE_DATA1_SPTL_REUSE2_KNOWN = 0x0800, /**< Spatial Reuse 2 known (HE TRIG PPDU format),
310 STA-ID known (HE MU PPDU format) */
311 HE_DATA1_SPTL_REUSE3_KNOWN = 0x1000, /**< Spatial Reuse 3 known (HE TRIG PPDU format) */
312 HE_DATA1_SPTL_REUSE4_KNOWN = 0x2000, /**< Spatial Reuse 4 known (HE TRIG PPDU format) */
313 HE_DATA1_BW_RU_ALLOC_KNOWN = 0x4000, /**< data BW/RU allocation known */
314 HE_DATA1_DOPPLER_KNOWN = 0x8000, /**< Doppler known */
315 };
316
317 /**
318 * @brief HE data2.
319 */
321 {
322 HE_DATA2_PRISEC_80_KNOWN = 0x0001, /**< pri/sec 80 MHz known */
323 HE_DATA2_GI_KNOWN = 0x0002, /**< GI known */
324 HE_DATA2_NUM_LTF_SYMS_KNOWN = 0x0004, /**< number of LTF symbols known */
325 HE_DATA2_PRE_FEC_PAD_KNOWN = 0x0008, /**< Pre-FEC Padding Factor known */
326 HE_DATA2_TXBF_KNOWN = 0x0010, /**< TxBF known */
327 HE_DATA2_PE_DISAMBIG_KNOWN = 0x0020, /**< PE Disambiguity known */
328 HE_DATA2_TXOP_KNOWN = 0x0040, /**< TXOP known */
329 HE_DATA2_MIDAMBLE_KNOWN = 0x0080, /**< midamble periodicity known */
330 HE_DATA2_RU_OFFSET = 0x3f00, /**< RU allocation offset */
331 HE_DATA2_RU_OFFSET_KNOWN = 0x4000, /**< RU allocation offset known */
332 HE_DATA2_PRISEC_80_SEC = 0x8000, /**< pri/sec 80 MHz */
333 };
334
335 /**
336 * @brief HE data5.
337 */
339 {
340 HE_DATA5_DATA_BW_RU_ALLOC_40MHZ = 0x0001, /**< 40 MHz data Bandwidth */
341 HE_DATA5_DATA_BW_RU_ALLOC_80MHZ = 0x0002, /**< 80 MHz data Bandwidth */
342 HE_DATA5_DATA_BW_RU_ALLOC_160MHZ = 0x0003, /**< 160 MHz data Bandwidth */
343 HE_DATA5_DATA_BW_RU_ALLOC_26T = 0x0004, /**< 26-tone RU allocation */
344 HE_DATA5_DATA_BW_RU_ALLOC_52T = 0x0005, /**< 52-tone RU allocation */
345 HE_DATA5_DATA_BW_RU_ALLOC_106T = 0x0006, /**< 106-tone RU allocation */
346 HE_DATA5_DATA_BW_RU_ALLOC_242T = 0x0007, /**< 242-tone RU allocation */
347 HE_DATA5_DATA_BW_RU_ALLOC_484T = 0x0008, /**< 484-tone RU allocation */
348 HE_DATA5_DATA_BW_RU_ALLOC_996T = 0x0009, /**< 996-tone RU allocation */
349 HE_DATA5_DATA_BW_RU_ALLOC_2x996T = 0x000a, /**< 2x996-tone RU allocation */
350 HE_DATA5_GI_1_6 = 0x0010, /**< 1.6us GI */
351 HE_DATA5_GI_3_2 = 0x0020, /**< 3.2us GI */
352 HE_DATA5_LTF_SYM_SIZE = 0x00c0, /**< LTF symbol size */
353 HE_DATA5_NUM_LTF_SYMS = 0x0700, /**< number of LTF symbols */
354 HE_DATA5_PRE_FEC_PAD = 0x3000, /**< Pre-FEC Padding Factor */
355 HE_DATA5_TXBF = 0x4000, /**< TxBF */
356 HE_DATA5_PE_DISAMBIG = 0x8000, /**< PE Disambiguity */
357 };
358
359 /**
360 * @brief Set the HE fields
361 *
362 * @param data1 The data1 field.
363 * @param data2 The data2 field.
364 * @param data3 The data3 field.
365 * @param data4 The data4 field.
366 * @param data5 The data5 field.
367 * @param data6 The data6 field.
368 */
369 void SetHeFields(uint16_t data1,
370 uint16_t data2,
371 uint16_t data3,
372 uint16_t data4,
373 uint16_t data5,
374 uint16_t data6);
375
376 /**
377 * @brief HE MU flags1.
378 */
380 {
381 HE_MU_FLAGS1_SIGB_MCS = 0x000f, //!< SIG-B MCS (from SIG-A)
382 HE_MU_FLAGS1_SIGB_MCS_KNOWN = 0x0010, //!< SIG-B MCS known
383 HE_MU_FLAGS1_SIGB_DCM = 0x0020, //!< SIG-B DCM (from SIG-A)
384 HE_MU_FLAGS1_SIGB_DCM_KNOWN = 0x0040, //!< SIG-B DCM known
385 HE_MU_FLAGS1_CH2_CENTER_26T_RU_KNOWN = 0x0080, //!< (Channel 2) Center 26-tone RU bit known
386 HE_MU_FLAGS1_CH1_RUS_KNOWN = 0x0100, //!< Channel 1 RUs known (which depends on BW)
387 HE_MU_FLAGS1_CH2_RUS_KNOWN = 0x0200, //!< Channel 2 RUs known (which depends on BW)
388 HE_MU_FLAGS1_CH1_CENTER_26T_RU_KNOWN = 0x1000, //!< (Channel 1) Center 26-tone RU bit known
389 HE_MU_FLAGS1_CH1_CENTER_26T_RU = 0x2000, //!< (Channel 1) Center 26-tone RU value
390 HE_MU_FLAGS1_SIGB_COMPRESSION_KNOWN = 0x4000, //!< SIG-B Compression known
391 HE_MU_FLAGS1_NUM_SIGB_SYMBOLS_KNOWN = 0x8000, //!< # of HE-SIG-B Symbols/MU-MIMO Users known
392 };
393
394 /**
395 * @brief HE MU flags2.
396 */
398 {
399 HE_MU_FLAGS2_BW_FROM_SIGA = 0x0003, /**< Bandwidth from Bandwidth field in HE-SIG-A */
401 0x0004, /**< Bandwidth from Bandwidth field in HE-SIG-A known */
402 HE_MU_FLAGS2_SIGB_COMPRESSION_FROM_SIGA = 0x0008, /**< SIG-B compression from SIG-A */
404 0x00f0, /**< # of HE-SIG-B Symbols - 1 or # of MU-MIMO Users - 1 from SIG-A */
406 0x0300, /**< Preamble puncturing from Bandwidth field in HE-SIG-A */
408 0x0400, /**< Preamble puncturing from Bandwidth field in HE-SIG-A known */
409 HE_MU_FLAGS2_CH2_CENTER_26T_RU = 0x0800, /**< (Channel 2) Center 26-tone RU value */
410 };
411
412 /**
413 * @brief Set the HE MU fields
414 *
415 * @param flags1 The flags1 field.
416 * @param flags2 The flags2 field.
417 * @param ruChannel1 The RU_channel1 field.
418 * @param ruChannel2 The RU_channel2 field.
419 */
420 void SetHeMuFields(uint16_t flags1,
421 uint16_t flags2,
422 const std::array<uint8_t, 4>& ruChannel1,
423 const std::array<uint8_t, 4>& ruChannel2);
424
425 /**
426 * @brief HE MU per_user_known.
427 */
429 {
430 HE_MU_PER_USER_POSITION_KNOWN = 0x01, //!< User field position known
431 HE_MU_PER_USER_STA_ID_KNOWN = 0x02, //!< STA-ID known
432 HE_MU_PER_USER_NSTS_KNOWN = 0x04, //!< NSTS known
433 HE_MU_PER_USER_TX_BF_KNOWN = 0x08, //!< Tx Beamforming known
434 HE_MU_PER_USER_SPATIAL_CONFIGURATION_KNOWN = 0x10, //!< Spatial Configuration known
435 HE_MU_PER_USER_MCS_KNOWN = 0x20, //!< MCS known
436 HE_MU_PER_USER_DCM_KNOWN = 0x40, //!< DCM known
437 HE_MU_PER_USER_CODING_KNOWN = 0x80, //!< Coding known
438 };
439
440 /**
441 * @brief Set the HE MU per user fields
442 *
443 * @param perUser1 The per_user_1 field.
444 * @param perUser2 The per_user_2 field.
445 * @param perUserPosition The per_user_position field.
446 * @param perUserKnown The per_user_known field.
447 */
448 void SetHeMuPerUserFields(uint16_t perUser1,
449 uint16_t perUser2,
450 uint8_t perUserPosition,
451 uint8_t perUserKnown);
452
453 private:
454 /**
455 * @brief Radiotap flags.
456 */
458 {
459 RADIOTAP_TSFT = 0x00000001,
460 RADIOTAP_FLAGS = 0x00000002,
461 RADIOTAP_RATE = 0x00000004,
462 RADIOTAP_CHANNEL = 0x00000008,
463 RADIOTAP_FHSS = 0x00000010,
470 RADIOTAP_ANTENNA = 0x00000800,
473 RADIOTAP_RX_FLAGS = 0x00004000,
474 RADIOTAP_MCS = 0x00080000,
476 RADIOTAP_VHT = 0x00200000,
477 RADIOTAP_HE = 0x00800000,
478 RADIOTAP_HE_MU = 0x01000000,
481 RADIOTAP_LSIG = 0x08000000,
482 RADIOTAP_EXT = 0x80000000
483 };
484
485 uint16_t m_length; //!< entire length of radiotap data + header
486 uint32_t m_present; //!< bits describing which fields follow header
487
488 uint64_t m_tsft; //!< Time Synchronization Function Timer (when the first bit of the MPDU
489 //!< arrived at the MAC)
490 uint8_t m_flags; //!< Properties of transmitted and received frames.
491 uint8_t m_rate; //!< TX/RX data rate in units of 500 kbps
492 uint8_t m_channelPad; //!< Tx/Rx channel padding.
493 uint16_t m_channelFreq; //!< Tx/Rx frequency in MHz.
494 uint16_t m_channelFlags; //!< Tx/Rx channel flags.
495 int8_t m_antennaSignal; //!< RF signal power at the antenna, dB difference from an arbitrary,
496 //!< fixed reference.
497 int8_t m_antennaNoise; //!< RF noise power at the antenna, dB difference from an arbitrary,
498 //!< fixed reference.
499
500 uint8_t m_mcsKnown; //!< MCS Flags, known information field.
501 uint8_t m_mcsFlags; //!< MCS Flags, flags field.
502 uint8_t m_mcsRate; //!< MCS Flags, mcs rate index.
503
504 uint8_t m_ampduStatusPad; //!< A-MPDU Status Flags, padding before A-MPDU Status Field.
505 uint32_t m_ampduStatusRef; //!< A-MPDU Status Flags, reference number.
506 uint16_t m_ampduStatusFlags; //!< A-MPDU Status Flags, information about the received A-MPDU.
507 uint8_t m_ampduStatusCRC; //!< A-MPDU Status Flags, delimiter CRC value.
508
509 uint8_t m_vhtPad; //!< VHT padding.
510 uint16_t m_vhtKnown; //!< VHT known field.
511 uint8_t m_vhtFlags; //!< VHT flags field.
512 uint8_t m_vhtBandwidth; //!< VHT bandwidth field.
513 uint8_t m_vhtMcsNss[4]; //!< VHT mcs_nss field.
514 uint8_t m_vhtCoding; //!< VHT coding field.
515 uint8_t m_vhtGroupId; //!< VHT group_id field.
516 uint16_t m_vhtPartialAid; //!< VHT partial_aid field.
517
518 uint8_t m_hePad; //!< HE padding.
519 uint16_t m_heData1; //!< HE data1 field.
520 uint16_t m_heData2; //!< HE data2 field.
521 uint16_t m_heData3; //!< HE data3 field.
522 uint16_t m_heData4; //!< HE data4 field.
523 uint16_t m_heData5; //!< HE data5 field.
524 uint16_t m_heData6; //!< HE data6 field.
525
526 uint8_t m_heMuPad; //!< HE MU padding.
527 uint16_t m_heMuFlags1; //!< HE MU flags1 field.
528 uint16_t m_heMuFlags2; //!< HE MU flags2 field.
529
530 uint8_t m_heMuOtherUserPad; //!< HE MU other user padding.
531 uint16_t m_heMuPerUser1; //!< HE MU per_user_1 field.
532 uint16_t m_heMuPerUser2; //!< HE MU per_user_2 field.
533 uint8_t m_heMuPerUserPosition; //!< HE MU per_user_position field.
534 uint8_t m_heMuPerUserKnown; //!< HE MU per_user_known field.
535};
536
537} // namespace ns3
538
539#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.
uint8_t m_ampduStatusCRC
A-MPDU Status Flags, delimiter CRC value.
uint8_t m_rate
TX/RX data rate in units of 500 kbps.
uint16_t m_heMuPerUser1
HE MU per_user_1 field.
uint8_t m_mcsRate
MCS Flags, mcs rate index.
uint8_t m_vhtGroupId
VHT group_id field.
uint16_t m_ampduStatusFlags
A-MPDU Status Flags, information about the received A-MPDU.
static TypeId GetTypeId()
Get the type ID.
uint8_t m_heMuPerUserPosition
HE MU per_user_position field.
uint8_t m_ampduStatusPad
A-MPDU Status Flags, padding before A-MPDU Status Field.
void SetMcsFields(uint8_t known, uint8_t flags, uint8_t mcs)
Set the MCS fields.
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_mcsKnown
MCS Flags, known information field.
uint16_t m_heData4
HE data4 field.
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.
uint16_t m_vhtPartialAid
VHT partial_aid field.
uint16_t m_heMuFlags1
HE MU flags1 field.
void SetChannelFrequencyAndFlags(uint16_t frequency, uint16_t flags)
Set the transmit/receive channel frequency and flags.
uint8_t m_heMuPad
HE MU padding.
@ 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.
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...
uint16_t m_heData1
HE data1 field.
uint8_t m_heMuOtherUserPad
HE MU other user padding.
uint8_t m_hePad
HE padding.
@ HE_DATA2_PRISEC_80_SEC
pri/sec 80 MHz
@ HE_DATA2_PRE_FEC_PAD_KNOWN
Pre-FEC Padding Factor known.
@ HE_DATA2_TXOP_KNOWN
TXOP known.
@ HE_DATA2_PE_DISAMBIG_KNOWN
PE Disambiguity known.
@ HE_DATA2_RU_OFFSET
RU allocation offset.
@ HE_DATA2_NUM_LTF_SYMS_KNOWN
number of LTF symbols known
@ HE_DATA2_TXBF_KNOWN
TxBF known.
@ HE_DATA2_RU_OFFSET_KNOWN
RU allocation offset known.
@ HE_DATA2_MIDAMBLE_KNOWN
midamble periodicity known
@ HE_DATA2_PRISEC_80_KNOWN
pri/sec 80 MHz known
void SetRate(uint8_t rate)
Set the transmit/receive channel frequency in units of megahertz.
uint16_t m_heMuPerUser2
HE MU per_user_2 field.
int8_t m_antennaSignal
RF signal power at the antenna, dB difference from an arbitrary, fixed reference.
void SetVhtFields(uint16_t known, uint8_t flags, uint8_t bandwidth, uint8_t mcs_nss[4], uint8_t coding, uint8_t group_id, uint16_t partial_aid)
Set the VHT fields.
void SetAntennaSignalPower(double signal)
Set the RF signal power at the antenna as a decibel difference from an arbitrary, fixed reference.
uint8_t m_vhtBandwidth
VHT bandwidth field.
void SetTsft(uint64_t tsft)
Set the Time Synchronization Function Timer (TSFT) value.
uint16_t m_length
entire length of radiotap data + header
uint16_t m_heData6
HE data6 field.
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_vhtCoding
VHT coding field.
@ 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).
void SetHeFields(uint16_t data1, uint16_t data2, uint16_t data3, uint16_t data4, uint16_t data5, uint16_t data6)
Set the HE fields.
@ 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.
uint8_t m_vhtMcsNss[4]
VHT mcs_nss field.
uint16_t m_heData5
HE data5 field.
@ 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)
uint16_t m_channelFlags
Tx/Rx channel flags.
@ 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_DATA1_FORMAT_TRIG
HE TRIG PPDU format.
@ HE_DATA1_STBC_KNOWN
STBC 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_DATA1_LDPC_XSYMSEG_KNOWN
LDPC extra symbol segment known.
@ HE_DATA1_FORMAT_EXT_SU
HE EXT SU PPDU format.
@ HE_DATA1_SPTL_REUSE3_KNOWN
Spatial Reuse 3 known (HE TRIG PPDU format)
@ HE_DATA1_BEAM_CHANGE_KNOWN
Beam Change known.
@ HE_DATA1_DATA_MCS_KNOWN
data MCS known
@ HE_DATA1_SPTL_REUSE2_KNOWN
Spatial Reuse 2 known (HE TRIG PPDU format), STA-ID known (HE MU PPDU format)
@ HE_DATA1_BW_RU_ALLOC_KNOWN
data BW/RU allocation known
@ HE_DATA1_UL_DL_KNOWN
UL/DL known.
@ HE_DATA1_DOPPLER_KNOWN
Doppler known.
uint32_t m_present
bits describing which fields follow header
uint32_t m_ampduStatusRef
A-MPDU Status Flags, reference number.
void SetAmpduStatus(uint32_t referenceNumber, uint16_t flags, uint8_t crc)
Set the A-MPDU status fields.
uint16_t m_heData2
HE data2 field.
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.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
void SetHeMuPerUserFields(uint16_t perUser1, uint16_t perUser2, uint8_t perUserPosition, uint8_t perUserKnown)
Set the HE MU per user fields.
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.
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.
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.
uint8_t m_mcsFlags
MCS Flags, flags field.
void SetHeMuFields(uint16_t flags1, uint16_t flags2, const std::array< uint8_t, 4 > &ruChannel1, const std::array< uint8_t, 4 > &ruChannel2)
Set the HE MU fields.
void SetAntennaNoisePower(double noise)
Set the RF noise power at the antenna as a decibel difference from an arbitrary, fixed reference.
uint16_t m_heMuFlags2
HE MU flags2 field.
uint32_t GetSerializedSize() const override
This method is used by Packet::AddHeader to store the header into the byte buffer of a packet.
@ 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)
uint16_t m_vhtKnown
VHT known field.
uint16_t m_heData3
HE data3 field.
uint8_t m_vhtFlags
VHT flags field.
uint8_t m_channelPad
Tx/Rx channel padding.
@ HE_DATA5_PE_DISAMBIG
PE Disambiguity.
@ HE_DATA5_DATA_BW_RU_ALLOC_26T
26-tone RU allocation
@ HE_DATA5_DATA_BW_RU_ALLOC_484T
484-tone RU allocation
@ HE_DATA5_DATA_BW_RU_ALLOC_40MHZ
40 MHz data Bandwidth
@ HE_DATA5_DATA_BW_RU_ALLOC_2x996T
2x996-tone RU allocation
@ HE_DATA5_DATA_BW_RU_ALLOC_242T
242-tone RU allocation
@ 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_DATA5_LTF_SYM_SIZE
LTF symbol size.
@ HE_DATA5_DATA_BW_RU_ALLOC_160MHZ
160 MHz data Bandwidth
@ HE_DATA5_DATA_BW_RU_ALLOC_106T
106-tone RU allocation
@ HE_DATA5_DATA_BW_RU_ALLOC_996T
996-tone RU allocation
@ HE_DATA5_DATA_BW_RU_ALLOC_80MHZ
80 MHz data Bandwidth
uint8_t m_vhtPad
VHT padding.
uint16_t m_channelFreq
Tx/Rx frequency in MHz.
uint8_t m_flags
Properties of transmitted and received frames.
uint8_t m_heMuPerUserKnown
HE MU per_user_known field.
void SetFrameFlags(uint8_t flags)
Set the frame flags of the transmitted or received frame.
uint64_t m_tsft
Time Synchronization Function Timer (when the first bit of the MPDU arrived at the MAC)
RadiotapFlags
Radiotap flags.
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:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.