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_2160MHZ
,
39
MAX
,
40
};
41
42
/**
43
* @ingroup wifi
44
* The type of an MPDU.
45
*/
46
enum
MpduType
47
{
48
/** The MPDU is not part of an A-MPDU */
49
NORMAL_MPDU
,
50
/** The MPDU is a single MPDU */
51
SINGLE_MPDU
,
52
/** The MPDU is the first aggregate in an A-MPDU with multiple MPDUs, but is not the last
53
* aggregate */
54
FIRST_MPDU_IN_AGGREGATE
,
55
/** The MPDU is part of an A-MPDU with multiple MPDUs, but is neither the first nor the last
56
* aggregate */
57
MIDDLE_MPDU_IN_AGGREGATE
,
58
/** The MPDU is the last aggregate in an A-MPDU with multiple MPDUs */
59
LAST_MPDU_IN_AGGREGATE
60
};
61
62
/// SignalNoiseDbm structure
63
struct
SignalNoiseDbm
64
{
65
dBm_u
signal
;
///< signal strength
66
dBm_u
noise
;
///< noise power
67
};
68
69
/// MpduInfo structure
70
struct
MpduInfo
71
{
72
MpduType
type
;
///< type of MPDU
73
uint32_t
mpduRefNumber
;
///< MPDU ref number
74
};
75
76
/// RxSignalInfo structure containing info on the received signal
77
struct
RxSignalInfo
78
{
79
double
snr
;
///< SNR in linear scale
80
dBm_u
rssi
;
///< RSSI
81
};
82
83
/**
84
* @ingroup wifi
85
* @brief Enumeration of frequency channel types
86
*/
87
enum class
FrequencyChannelType
: uint8_t
88
{
89
DSSS
= 0,
90
OFDM
,
91
CH_80211P
92
};
93
94
/**
95
* The different Resource Unit (RU) types.
96
*/
97
enum class
RuType
: uint8_t
98
{
99
RU_26_TONE
= 0,
100
RU_52_TONE
,
101
RU_106_TONE
,
102
RU_242_TONE
,
103
RU_484_TONE
,
104
RU_996_TONE
,
105
RU_2x996_TONE
,
106
RU_4x996_TONE
,
107
RU_TYPE_MAX
108
};
109
110
/**
111
* @brief Stream insertion operator.
112
*
113
* @param os the stream
114
* @param ruType the RU type
115
* @returns a reference to the stream
116
*/
117
inline
std::ostream&
118
operator<<
(std::ostream& os,
const
RuType
& ruType)
119
{
120
switch
(ruType)
121
{
122
case
RuType::RU_26_TONE
:
123
os <<
"26-tones"
;
124
break
;
125
case
RuType::RU_52_TONE
:
126
os <<
"52-tones"
;
127
break
;
128
case
RuType::RU_106_TONE
:
129
os <<
"106-tones"
;
130
break
;
131
case
RuType::RU_242_TONE
:
132
os <<
"242-tones"
;
133
break
;
134
case
RuType::RU_484_TONE
:
135
os <<
"484-tones"
;
136
break
;
137
case
RuType::RU_996_TONE
:
138
os <<
"996-tones"
;
139
break
;
140
case
RuType::RU_2x996_TONE
:
141
os <<
"2x996-tones"
;
142
break
;
143
case
RuType::RU_4x996_TONE
:
144
os <<
"4x996-tones"
;
145
break
;
146
default
:
147
NS_FATAL_ERROR
(
"Unknown RU type"
);
148
}
149
return
os;
150
}
151
152
/// (lowest index, highest index) pair defining a subcarrier range
153
using
SubcarrierRange
= std::pair<int16_t, int16_t>;
154
155
/// a vector of subcarrier ranges defining a subcarrier group
156
using
SubcarrierGroup
= std::vector<SubcarrierRange>;
157
158
/// (bandwidth, number of tones) pair
159
using
BwTonesPair
= std::pair<MHz_u, RuType>;
160
161
/// map (bandwidth, number of tones) pairs to the group of subcarrier ranges
162
using
SubcarrierGroups
= std::map<BwTonesPair, std::vector<SubcarrierGroup>>;
163
164
}
// namespace ns3
165
166
#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:168
ns3::FrequencyChannelType
FrequencyChannelType
Enumeration of frequency channel types.
Definition
wifi-types.h:88
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:47
ns3::UNKNOWN
@ UNKNOWN
Definition
wifi-phy-common.h:414
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_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:59
ns3::NORMAL_MPDU
@ NORMAL_MPDU
The MPDU is not part of an A-MPDU.
Definition
wifi-types.h:49
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:54
ns3::SINGLE_MPDU
@ SINGLE_MPDU
The MPDU is a single MPDU.
Definition
wifi-types.h:51
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:57
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:153
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:98
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:156
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:162
ns3::BwTonesPair
std::pair< MHz_u, RuType > BwTonesPair
(bandwidth, number of tones) pair
Definition
wifi-types.h:159
ns3::MpduInfo
MpduInfo structure.
Definition
wifi-types.h:71
ns3::MpduInfo::type
MpduType type
type of MPDU
Definition
wifi-types.h:72
ns3::MpduInfo::mpduRefNumber
uint32_t mpduRefNumber
MPDU ref number.
Definition
wifi-types.h:73
ns3::RxSignalInfo
RxSignalInfo structure containing info on the received signal.
Definition
wifi-types.h:78
ns3::RxSignalInfo::snr
double snr
SNR in linear scale.
Definition
wifi-types.h:79
ns3::RxSignalInfo::rssi
dBm_u rssi
RSSI.
Definition
wifi-types.h:80
ns3::SignalNoiseDbm
SignalNoiseDbm structure.
Definition
wifi-types.h:64
ns3::SignalNoiseDbm::noise
dBm_u noise
noise power
Definition
wifi-types.h:66
ns3::SignalNoiseDbm::signal
dBm_u signal
signal strength
Definition
wifi-types.h:65
wifi-units.h
Declaration of the SI units (as weak types aliases) used across wifi module.
src
wifi
model
wifi-types.h
Generated on Tue Apr 29 2025 18:20:55 for ns-3 by
1.11.0