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-standards.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2007 INRIA
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7
*/
8
9
#ifndef WIFI_STANDARD_H
10
#define WIFI_STANDARD_H
11
12
#include "
wifi-phy-band.h
"
13
#include "
wifi-units.h
"
14
15
#include "ns3/abort.h"
16
#include "ns3/wifi-export.h"
17
18
#include <list>
19
#include <map>
20
21
namespace
ns3
22
{
23
24
/**
25
* @ingroup wifi
26
* Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
27
*/
28
enum
WifiStandard
29
{
30
WIFI_STANDARD_UNSPECIFIED
,
31
WIFI_STANDARD_80211a
,
32
WIFI_STANDARD_80211b
,
33
WIFI_STANDARD_80211g
,
34
WIFI_STANDARD_80211p
,
35
WIFI_STANDARD_80211n
,
36
WIFI_STANDARD_80211ac
,
37
WIFI_STANDARD_80211ad
,
38
WIFI_STANDARD_80211ax
,
39
WIFI_STANDARD_80211be
,
40
WIFI_STANDARD_COUNT
41
};
42
43
/**
44
* @brief Stream insertion operator.
45
*
46
* @param os the stream
47
* @param standard the standard
48
* @returns a reference to the stream
49
*/
50
inline
std::ostream&
51
operator<<
(std::ostream& os,
WifiStandard
standard)
52
{
53
switch
(standard)
54
{
55
case
WIFI_STANDARD_80211a
:
56
return
(os <<
"802.11a"
);
57
case
WIFI_STANDARD_80211b
:
58
return
(os <<
"802.11b"
);
59
case
WIFI_STANDARD_80211g
:
60
return
(os <<
"802.11g"
);
61
case
WIFI_STANDARD_80211p
:
62
return
(os <<
"802.11p"
);
63
case
WIFI_STANDARD_80211n
:
64
return
(os <<
"802.11n"
);
65
case
WIFI_STANDARD_80211ac
:
66
return
(os <<
"802.11ac"
);
67
case
WIFI_STANDARD_80211ad
:
68
return
(os <<
"802.11ad"
);
69
case
WIFI_STANDARD_80211ax
:
70
return
(os <<
"802.11ax"
);
71
case
WIFI_STANDARD_80211be
:
72
return
(os <<
"802.11be"
);
73
default
:
74
return
(os <<
"UNSPECIFIED"
);
75
}
76
}
77
78
/**
79
* @brief map a given standard configured by the user to the allowed PHY bands
80
*/
81
WIFI_EXPORT
extern
const
std::map<WifiStandard, std::list<WifiPhyBand>>
wifiStandards
;
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
* Get the type of the frequency channel for the given standard
96
*
97
* @param standard the standard
98
* @return the type of the frequency channel for the given standard
99
*/
100
inline
FrequencyChannelType
101
GetFrequencyChannelType
(
WifiStandard
standard)
102
{
103
switch
(standard)
104
{
105
case
WIFI_STANDARD_80211b
:
106
return
FrequencyChannelType::DSSS
;
107
case
WIFI_STANDARD_80211p
:
108
return
FrequencyChannelType::CH_80211P
;
109
default
:
110
return
FrequencyChannelType::OFDM
;
111
}
112
}
113
114
/**
115
* Get the default channel width for the given PHY standard and band.
116
*
117
* @param standard the given standard
118
* @param band the given PHY band
119
* @return the default channel width for the given standard
120
*/
121
inline
MHz_u
122
GetDefaultChannelWidth
(
WifiStandard
standard,
WifiPhyBand
band)
123
{
124
switch
(standard)
125
{
126
case
WIFI_STANDARD_80211b
:
127
return
MHz_u
{22};
128
case
WIFI_STANDARD_80211p
:
129
return
MHz_u
{10};
130
case
WIFI_STANDARD_80211ac
:
131
return
MHz_u
{80};
132
case
WIFI_STANDARD_80211ad
:
133
return
MHz_u
{2160};
134
case
WIFI_STANDARD_80211ax
:
135
case
WIFI_STANDARD_80211be
:
136
return
(band ==
WIFI_PHY_BAND_2_4GHZ
?
MHz_u
{20} :
MHz_u
{80});
137
default
:
138
return
MHz_u
{20};
139
}
140
}
141
142
/**
143
* Get the default PHY band for the given standard.
144
*
145
* @param standard the given standard
146
* @return the default PHY band for the given standard
147
*/
148
inline
WifiPhyBand
149
GetDefaultPhyBand
(
WifiStandard
standard)
150
{
151
switch
(standard)
152
{
153
case
WIFI_STANDARD_80211p
:
154
case
WIFI_STANDARD_80211a
:
155
case
WIFI_STANDARD_80211ac
:
156
case
WIFI_STANDARD_80211ax
:
157
case
WIFI_STANDARD_80211be
:
158
return
WIFI_PHY_BAND_5GHZ
;
159
case
WIFI_STANDARD_80211ad
:
160
return
WIFI_PHY_BAND_60GHZ
;
161
default
:
162
return
WIFI_PHY_BAND_2_4GHZ
;
163
}
164
}
165
166
/**
167
* Get the TypeId name for the FrameExchangeManager corresponding to the given standard.
168
*
169
* @param standard the given standard
170
* @param qosSupported whether QoS is supported (ignored if standard is at least HT)
171
* @return the TypeId name for the FrameExchangeManager corresponding to the given standard
172
*/
173
inline
std::string
174
GetFrameExchangeManagerTypeIdName
(
WifiStandard
standard,
bool
qosSupported)
175
{
176
if
(standard >=
WIFI_STANDARD_80211be
)
177
{
178
return
"ns3::EhtFrameExchangeManager"
;
179
}
180
if
(standard >=
WIFI_STANDARD_80211ax
)
181
{
182
return
"ns3::HeFrameExchangeManager"
;
183
}
184
if
(standard >=
WIFI_STANDARD_80211ac
)
185
{
186
return
"ns3::VhtFrameExchangeManager"
;
187
}
188
if
(standard >=
WIFI_STANDARD_80211n
)
189
{
190
return
"ns3::HtFrameExchangeManager"
;
191
}
192
if
(qosSupported)
193
{
194
return
"ns3::QosFrameExchangeManager"
;
195
}
196
return
"ns3::FrameExchangeManager"
;
197
}
198
199
}
// namespace ns3
200
201
#endif
/* WIFI_STANDARD_H */
ns3::WifiStandard
WifiStandard
Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
Definition
wifi-standards.h:29
ns3::FrequencyChannelType
FrequencyChannelType
Enumeration of frequency channel types.
Definition
wifi-standards.h:88
ns3::WifiPhyBand
WifiPhyBand
Identifies the PHY band.
Definition
wifi-phy-band.h:22
ns3::WIFI_STANDARD_80211a
@ WIFI_STANDARD_80211a
Definition
wifi-standards.h:31
ns3::WIFI_STANDARD_80211ad
@ WIFI_STANDARD_80211ad
Definition
wifi-standards.h:37
ns3::WIFI_STANDARD_COUNT
@ WIFI_STANDARD_COUNT
Definition
wifi-standards.h:40
ns3::WIFI_STANDARD_80211p
@ WIFI_STANDARD_80211p
Definition
wifi-standards.h:34
ns3::WIFI_STANDARD_80211be
@ WIFI_STANDARD_80211be
Definition
wifi-standards.h:39
ns3::WIFI_STANDARD_80211n
@ WIFI_STANDARD_80211n
Definition
wifi-standards.h:35
ns3::WIFI_STANDARD_80211g
@ WIFI_STANDARD_80211g
Definition
wifi-standards.h:33
ns3::WIFI_STANDARD_80211ax
@ WIFI_STANDARD_80211ax
Definition
wifi-standards.h:38
ns3::WIFI_STANDARD_UNSPECIFIED
@ WIFI_STANDARD_UNSPECIFIED
Definition
wifi-standards.h:30
ns3::WIFI_STANDARD_80211ac
@ WIFI_STANDARD_80211ac
Definition
wifi-standards.h:36
ns3::WIFI_STANDARD_80211b
@ WIFI_STANDARD_80211b
Definition
wifi-standards.h:32
ns3::FrequencyChannelType::DSSS
@ DSSS
Definition
wifi-standards.h:89
ns3::FrequencyChannelType::OFDM
@ OFDM
Definition
wifi-standards.h:90
ns3::FrequencyChannelType::CH_80211P
@ CH_80211P
Definition
wifi-standards.h:91
ns3::WIFI_PHY_BAND_2_4GHZ
@ WIFI_PHY_BAND_2_4GHZ
The 2.4 GHz band.
Definition
wifi-phy-band.h:24
ns3::WIFI_PHY_BAND_60GHZ
@ WIFI_PHY_BAND_60GHZ
The 60 GHz band.
Definition
wifi-phy-band.h:30
ns3::WIFI_PHY_BAND_5GHZ
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
Definition
wifi-phy-band.h:26
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition
angles.cc:148
ns3::GetFrameExchangeManagerTypeIdName
std::string GetFrameExchangeManagerTypeIdName(WifiStandard standard, bool qosSupported)
Get the TypeId name for the FrameExchangeManager corresponding to the given standard.
Definition
wifi-standards.h:174
ns3::MHz_u
double MHz_u
MHz weak type.
Definition
wifi-units.h:31
ns3::GetDefaultChannelWidth
MHz_u GetDefaultChannelWidth(WifiStandard standard, WifiPhyBand band)
Get the default channel width for the given PHY standard and band.
Definition
wifi-standards.h:122
ns3::GetDefaultPhyBand
WifiPhyBand GetDefaultPhyBand(WifiStandard standard)
Get the default PHY band for the given standard.
Definition
wifi-standards.h:149
ns3::wifiStandards
const std::map< WifiStandard, std::list< WifiPhyBand > > wifiStandards
map a given standard configured by the user to the allowed PHY bands
Definition
wifi-standards.cc:14
ns3::GetFrequencyChannelType
FrequencyChannelType GetFrequencyChannelType(WifiStandard standard)
Get the type of the frequency channel for the given standard.
Definition
wifi-standards.h:101
wifi-phy-band.h
wifi-units.h
Declaration of the SI units (as weak types aliases) used across wifi module.
src
wifi
model
wifi-standards.h
Generated on Fri Oct 3 2025 18:23:04 for ns-3 by
1.13.2