A Discrete-Event Network Simulator
API
radiotap-header.h
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2009 CTTC
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Include., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Authors: Nicola Baldo <nbaldo@cttc.es>
19 * S├ębastien Deronne <sebastien.deronne@gmail.com>
20 */
21
22#ifndef RADIOTAP_HEADER_H
23#define RADIOTAP_HEADER_H
24
25#include <ns3/header.h>
26
27namespace ns3 {
28
37class RadiotapHeader : public Header
38{
39public:
45 static TypeId GetTypeId (void);
46 virtual TypeId GetInstanceTypeId (void) const;
47
55 virtual uint32_t GetSerializedSize (void) const;
56
65 virtual void Serialize (Buffer::Iterator start) const;
66
77
91 virtual void Print (std::ostream &os) const;
92
101 void SetTsft (uint64_t tsft);
102
107 {
117 };
118
123 void SetFrameFlags (uint8_t flags);
124
129 void SetRate (uint8_t rate);
130
135 {
144 CHANNEL_FLAG_GFSK = 0x0800
145 };
146
153 void SetChannelFrequencyAndFlags (uint16_t frequency, uint16_t flags);
154
162 void SetAntennaSignalPower (double signal);
163
171 void SetAntennaNoisePower (double noise);
172
177 {
187 };
188
193 {
203 };
204
212 void SetMcsFields (uint8_t known, uint8_t flags, uint8_t mcs);
213
218 {
226 };
227
235 void SetAmpduStatus (uint32_t referenceNumber, uint16_t flags, uint8_t crc);
236
241 {
242 VHT_KNOWN_NONE = 0x0000,
243 VHT_KNOWN_STBC = 0x0001,
252 };
253
258 {
266 };
267
279 void SetVhtFields (uint16_t known, uint8_t flags,
280 uint8_t bandwidth, uint8_t mcs_nss [4],
281 uint8_t coding, uint8_t group_id,
282 uint16_t partial_aid);
283
288 {
306 };
307
312 {
324 };
325
330 {
346 HE_DATA5_TXBF = 0x4000,
348 };
349
360 void SetHeFields (uint16_t data1,
361 uint16_t data2,
362 uint16_t data3,
363 uint16_t data4,
364 uint16_t data5,
365 uint16_t data6);
366
371 {
383 };
384
389 {
397 };
398
407 void SetHeMuFields (uint16_t flags1, uint16_t flags2, const std::array<uint8_t, 4> &ruChannel1, const std::array<uint8_t, 4> &ruChannel2);
408
413 {
422 };
423
432 void SetHeMuPerUserFields (uint16_t perUser1, uint16_t perUser2, uint8_t perUserPosition, uint8_t perUserKnown);
433
434private:
439 {
440 RADIOTAP_TSFT = 0x00000001,
441 RADIOTAP_FLAGS = 0x00000002,
442 RADIOTAP_RATE = 0x00000004,
443 RADIOTAP_CHANNEL = 0x00000008,
444 RADIOTAP_FHSS = 0x00000010,
451 RADIOTAP_ANTENNA = 0x00000800,
454 RADIOTAP_RX_FLAGS = 0x00004000,
455 RADIOTAP_MCS = 0x00080000,
457 RADIOTAP_VHT = 0x00200000,
458 RADIOTAP_HE = 0x00800000,
459 RADIOTAP_HE_MU = 0x01000000,
462 RADIOTAP_LSIG = 0x08000000,
463 RADIOTAP_EXT = 0x80000000
464 };
465
466 uint16_t m_length;
468
469 uint64_t m_tsft;
470 uint8_t m_flags;
471 uint8_t m_rate;
472 uint8_t m_channelPad;
473 uint16_t m_channelFreq;
474 uint16_t m_channelFlags;
477
478 uint8_t m_mcsKnown;
479 uint8_t m_mcsFlags;
480 uint8_t m_mcsRate;
481
486
487 uint8_t m_vhtPad;
488 uint16_t m_vhtKnown;
489 uint8_t m_vhtFlags;
491 uint8_t m_vhtMcsNss[4];
492 uint8_t m_vhtCoding;
493 uint8_t m_vhtGroupId;
495
496 uint8_t m_hePad;
497 uint16_t m_heData1;
498 uint16_t m_heData2;
499 uint16_t m_heData3;
500 uint16_t m_heData4;
501 uint16_t m_heData5;
502 uint16_t m_heData6;
503
504 uint8_t m_heMuPad;
505 uint16_t m_heMuFlags1;
506 uint16_t m_heMuFlags2;
507
509 uint16_t m_heMuPerUser1;
510 uint16_t m_heMuPerUser2;
513};
514
515} // namespace ns3
516
517#endif /* RADIOTAP_HEADER_H */
iterator in a Buffer instance
Definition: buffer.h:99
Protocol header serialization and deserialization.
Definition: header.h:43
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.
virtual uint32_t GetSerializedSize(void) const
This method is used by Packet::AddHeader to store the header into the byte buffer of a packet.
uint8_t m_vhtGroupId
VHT group_id field.
uint16_t m_ampduStatusFlags
A-MPDU Status Flags, information about the received A-MPDU.
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.
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
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.
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_GI_KNOWN
GI 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
static TypeId GetTypeId(void)
Get the type ID.
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.
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.
HeMuFlags2
HE MU flags2.
@ 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.
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.
virtual void Print(std::ostream &os) const
This method is used by Packet::Print to print the content of the header as ascii data to a C++ output...
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.
virtual uint32_t Deserialize(Buffer::Iterator start)
This method is used by Packet::RemoveHeader to re-create a header from the byte buffer of a packet.
uint16_t m_heMuFlags2
HE MU flags2 field.
HeMuFlags1
HE MU flags1.
@ 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.
virtual void Serialize(Buffer::Iterator start) const
This method is used by Packet::AddHeader to store the header into the byte buffer of a packet.
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:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.
def start()
Definition: core.py:1853