A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
wifi-types.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2023 DERONNE SOFTWARE ENGINEERING
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Sébastien Deronne <sebastien.deronne@gmail.com>
7
*/
8
9
#ifndef WIFI_TYPES_H
10
#define WIFI_TYPES_H
11
12
#include "
wifi-units.h
"
13
14
#include "ns3/fatal-error.h"
15
16
#include <compare>
17
#include <map>
18
#include <ostream>
19
20
namespace
ns3
21
{
22
23
/**
24
* @ingroup wifi
25
* Enumeration of the possible channel widths
26
*/
27
enum class
WifiChannelWidthType
: uint8_t
28
{
29
UNKNOWN
= 0,
30
CW_20MHZ
,
31
CW_22MHZ
,
32
CW_5MHZ
,
33
CW_10MHZ
,
34
CW_40MHZ
,
35
CW_80MHZ
,
36
CW_160MHZ
,
37
CW_80_PLUS_80MHZ
,
38
CW_320MHZ
,
39
CW_2160MHZ
,
40
MAX
,
41
};
42
43
/**
44
* @ingroup wifi
45
* The type of an MPDU.
46
*/
47
enum
MpduType
48
{
49
/** The MPDU is not part of an A-MPDU */
50
NORMAL_MPDU
,
51
/** The MPDU is a single MPDU */
52
SINGLE_MPDU
,
53
/** The MPDU is the first aggregate in an A-MPDU with multiple MPDUs, but is not the last
54
* aggregate */
55
FIRST_MPDU_IN_AGGREGATE
,
56
/** The MPDU is part of an A-MPDU with multiple MPDUs, but is neither the first nor the last
57
* aggregate */
58
MIDDLE_MPDU_IN_AGGREGATE
,
59
/** The MPDU is the last aggregate in an A-MPDU with multiple MPDUs */
60
LAST_MPDU_IN_AGGREGATE
61
};
62
63
/// SignalNoiseDbm structure
64
struct
SignalNoiseDbm
65
{
66
dBm_u
signal
;
///< signal strength
67
dBm_u
noise
;
///< noise power
68
};
69
70
/// MpduInfo structure
71
struct
MpduInfo
72
{
73
MpduType
type
;
///< type of MPDU
74
uint32_t
mpduRefNumber
;
///< MPDU ref number
75
};
76
77
/// RxSignalInfo structure containing info on the received signal
78
struct
RxSignalInfo
79
{
80
double
snr
;
///< SNR in linear scale
81
dBm_u
rssi
;
///< RSSI
82
};
83
84
/**
85
* @ingroup wifi
86
* @brief Enumeration of frequency channel types
87
*/
88
enum class
FrequencyChannelType
: uint8_t
89
{
90
DSSS
= 0,
91
OFDM
,
92
CH_80211P
93
};
94
95
/**
96
* The different Resource Unit (RU) types.
97
*/
98
enum class
RuType
: uint8_t
99
{
100
RU_26_TONE
= 0,
101
RU_52_TONE
,
102
RU_106_TONE
,
103
RU_242_TONE
,
104
RU_484_TONE
,
105
RU_996_TONE
,
106
RU_2x996_TONE
,
107
RU_4x996_TONE
,
108
RU_TYPE_MAX
109
};
110
111
/**
112
* @brief Stream insertion operator.
113
*
114
* @param os the stream
115
* @param ruType the RU type
116
* @returns a reference to the stream
117
*/
118
inline
std::ostream&
119
operator<<
(std::ostream& os,
const
RuType
& ruType)
120
{
121
switch
(ruType)
122
{
123
case
RuType::RU_26_TONE
:
124
os <<
"26-tones"
;
125
break
;
126
case
RuType::RU_52_TONE
:
127
os <<
"52-tones"
;
128
break
;
129
case
RuType::RU_106_TONE
:
130
os <<
"106-tones"
;
131
break
;
132
case
RuType::RU_242_TONE
:
133
os <<
"242-tones"
;
134
break
;
135
case
RuType::RU_484_TONE
:
136
os <<
"484-tones"
;
137
break
;
138
case
RuType::RU_996_TONE
:
139
os <<
"996-tones"
;
140
break
;
141
case
RuType::RU_2x996_TONE
:
142
os <<
"2x996-tones"
;
143
break
;
144
case
RuType::RU_4x996_TONE
:
145
os <<
"4x996-tones"
;
146
break
;
147
default
:
148
NS_FATAL_ERROR
(
"Unknown RU type"
);
149
}
150
return
os;
151
}
152
153
/// (lowest index, highest index) pair defining a subcarrier range
154
using
SubcarrierRange
= std::pair<int16_t, int16_t>;
155
156
/// a vector of subcarrier ranges defining a subcarrier group
157
using
SubcarrierGroup
= std::vector<SubcarrierRange>;
158
159
/// (bandwidth, number of tones) pair
160
using
BwTonesPair
= std::pair<MHz_u, RuType>;
161
162
/// map (bandwidth, number of tones) pairs to the group of subcarrier ranges
163
using
SubcarrierGroups
= std::map<BwTonesPair, std::vector<SubcarrierGroup>>;
164
165
}
// namespace ns3
166
167
#endif
/* WIFI_TYPES_H */
double
uint32_t
NS_FATAL_ERROR
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition
fatal-error.h:186
ns3::FrequencyChannelType
FrequencyChannelType
Enumeration of frequency channel types.
Definition
wifi-types.h:89
ns3::WifiChannelWidthType
WifiChannelWidthType
Enumeration of the possible channel widths.
Definition
wifi-types.h:28
ns3::MpduType
MpduType
The type of an MPDU.
Definition
wifi-types.h:48
ns3::UNKNOWN
@ UNKNOWN
Definition
wifi-phy-common.h:412
ns3::FrequencyChannelType::DSSS
@ DSSS
ns3::FrequencyChannelType::OFDM
@ OFDM
ns3::FrequencyChannelType::CH_80211P
@ CH_80211P
ns3::WifiChannelWidthType::CW_160MHZ
@ CW_160MHZ
ns3::WifiChannelWidthType::CW_10MHZ
@ CW_10MHZ
ns3::WifiChannelWidthType::MAX
@ MAX
ns3::WifiChannelWidthType::CW_320MHZ
@ CW_320MHZ
ns3::WifiChannelWidthType::CW_80_PLUS_80MHZ
@ CW_80_PLUS_80MHZ
ns3::WifiChannelWidthType::CW_20MHZ
@ CW_20MHZ
ns3::WifiChannelWidthType::CW_5MHZ
@ CW_5MHZ
ns3::WifiChannelWidthType::CW_22MHZ
@ CW_22MHZ
ns3::WifiChannelWidthType::CW_40MHZ
@ CW_40MHZ
ns3::WifiChannelWidthType::CW_80MHZ
@ CW_80MHZ
ns3::WifiChannelWidthType::CW_2160MHZ
@ CW_2160MHZ
ns3::LAST_MPDU_IN_AGGREGATE
@ LAST_MPDU_IN_AGGREGATE
The MPDU is the last aggregate in an A-MPDU with multiple MPDUs.
Definition
wifi-types.h:60
ns3::NORMAL_MPDU
@ NORMAL_MPDU
The MPDU is not part of an A-MPDU.
Definition
wifi-types.h:50
ns3::FIRST_MPDU_IN_AGGREGATE
@ FIRST_MPDU_IN_AGGREGATE
The MPDU is the first aggregate in an A-MPDU with multiple MPDUs, but is not the last aggregate.
Definition
wifi-types.h:55
ns3::SINGLE_MPDU
@ SINGLE_MPDU
The MPDU is a single MPDU.
Definition
wifi-types.h:52
ns3::MIDDLE_MPDU_IN_AGGREGATE
@ MIDDLE_MPDU_IN_AGGREGATE
The MPDU is part of an A-MPDU with multiple MPDUs, but is neither the first nor the last aggregate.
Definition
wifi-types.h:58
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::SubcarrierRange
std::pair< int16_t, int16_t > SubcarrierRange
(lowest index, highest index) pair defining a subcarrier range
Definition
wifi-types.h:154
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition
angles.cc:148
ns3::RuType
RuType
The different Resource Unit (RU) types.
Definition
wifi-types.h:99
ns3::RuType::RU_52_TONE
@ RU_52_TONE
ns3::RuType::RU_26_TONE
@ RU_26_TONE
ns3::RuType::RU_996_TONE
@ RU_996_TONE
ns3::RuType::RU_484_TONE
@ RU_484_TONE
ns3::RuType::RU_TYPE_MAX
@ RU_TYPE_MAX
ns3::RuType::RU_106_TONE
@ RU_106_TONE
ns3::RuType::RU_4x996_TONE
@ RU_4x996_TONE
ns3::RuType::RU_2x996_TONE
@ RU_2x996_TONE
ns3::RuType::RU_242_TONE
@ RU_242_TONE
ns3::SubcarrierGroup
std::vector< SubcarrierRange > SubcarrierGroup
a vector of subcarrier ranges defining a subcarrier group
Definition
wifi-types.h:157
ns3::SubcarrierGroups
std::map< BwTonesPair, std::vector< SubcarrierGroup > > SubcarrierGroups
map (bandwidth, number of tones) pairs to the group of subcarrier ranges
Definition
wifi-types.h:163
ns3::BwTonesPair
std::pair< MHz_u, RuType > BwTonesPair
(bandwidth, number of tones) pair
Definition
wifi-types.h:160
ns3::MpduInfo
MpduInfo structure.
Definition
wifi-types.h:72
ns3::MpduInfo::type
MpduType type
type of MPDU
Definition
wifi-types.h:73
ns3::MpduInfo::mpduRefNumber
uint32_t mpduRefNumber
MPDU ref number.
Definition
wifi-types.h:74
ns3::RxSignalInfo
RxSignalInfo structure containing info on the received signal.
Definition
wifi-types.h:79
ns3::RxSignalInfo::snr
double snr
SNR in linear scale.
Definition
wifi-types.h:80
ns3::RxSignalInfo::rssi
dBm_u rssi
RSSI.
Definition
wifi-types.h:81
ns3::SignalNoiseDbm
SignalNoiseDbm structure.
Definition
wifi-types.h:65
ns3::SignalNoiseDbm::noise
dBm_u noise
noise power
Definition
wifi-types.h:67
ns3::SignalNoiseDbm::signal
dBm_u signal
signal strength
Definition
wifi-types.h:66
wifi-units.h
Declaration of the SI units (as weak types aliases) used across wifi module.
src
wifi
model
wifi-types.h
Generated on Mon Jun 9 2025 11:07:05 for ns-3 by
1.11.0