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-types.h
"
14
#include "
wifi-units.h
"
15
16
#include "ns3/abort.h"
17
#include "ns3/wifi-export.h"
18
19
#include <list>
20
#include <map>
21
22
namespace
ns3
23
{
24
25
/**
26
* @ingroup wifi
27
* Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
28
*/
29
enum
WifiStandard
30
{
31
WIFI_STANDARD_UNSPECIFIED
,
32
WIFI_STANDARD_80211a
,
33
WIFI_STANDARD_80211b
,
34
WIFI_STANDARD_80211g
,
35
WIFI_STANDARD_80211p
,
36
WIFI_STANDARD_80211n
,
37
WIFI_STANDARD_80211ac
,
38
WIFI_STANDARD_80211ad
,
39
WIFI_STANDARD_80211ax
,
40
WIFI_STANDARD_80211be
,
41
WIFI_STANDARD_COUNT
42
};
43
44
/**
45
* @brief Stream insertion operator.
46
*
47
* @param os the stream
48
* @param standard the standard
49
* @returns a reference to the stream
50
*/
51
inline
std::ostream&
52
operator<<
(std::ostream& os,
WifiStandard
standard)
53
{
54
switch
(standard)
55
{
56
case
WIFI_STANDARD_80211a
:
57
return
(os <<
"802.11a"
);
58
case
WIFI_STANDARD_80211b
:
59
return
(os <<
"802.11b"
);
60
case
WIFI_STANDARD_80211g
:
61
return
(os <<
"802.11g"
);
62
case
WIFI_STANDARD_80211p
:
63
return
(os <<
"802.11p"
);
64
case
WIFI_STANDARD_80211n
:
65
return
(os <<
"802.11n"
);
66
case
WIFI_STANDARD_80211ac
:
67
return
(os <<
"802.11ac"
);
68
case
WIFI_STANDARD_80211ad
:
69
return
(os <<
"802.11ad"
);
70
case
WIFI_STANDARD_80211ax
:
71
return
(os <<
"802.11ax"
);
72
case
WIFI_STANDARD_80211be
:
73
return
(os <<
"802.11be"
);
74
default
:
75
return
(os <<
"UNSPECIFIED"
);
76
}
77
}
78
79
/**
80
* @brief map a given standard configured by the user to the allowed PHY bands
81
*/
82
WIFI_EXPORT
extern
const
std::map<WifiStandard, std::list<WifiPhyBand>>
wifiStandards
;
83
84
/**
85
* Get the type of the frequency channel for the given standard
86
*
87
* @param standard the standard
88
* @return the type of the frequency channel for the given standard
89
*/
90
inline
FrequencyChannelType
91
GetFrequencyChannelType
(
WifiStandard
standard)
92
{
93
switch
(standard)
94
{
95
case
WIFI_STANDARD_80211b
:
96
return
FrequencyChannelType::DSSS
;
97
case
WIFI_STANDARD_80211p
:
98
return
FrequencyChannelType::CH_80211P
;
99
default
:
100
return
FrequencyChannelType::OFDM
;
101
}
102
}
103
104
/**
105
* Get the default channel width for the given PHY standard and band.
106
*
107
* @param standard the given standard
108
* @param band the given PHY band
109
* @return the default channel width for the given standard
110
*/
111
inline
MHz_u
112
GetDefaultChannelWidth
(
WifiStandard
standard,
WifiPhyBand
band)
113
{
114
switch
(standard)
115
{
116
case
WIFI_STANDARD_80211b
:
117
return
MHz_u
{22};
118
case
WIFI_STANDARD_80211p
:
119
return
MHz_u
{10};
120
case
WIFI_STANDARD_80211ac
:
121
return
MHz_u
{80};
122
case
WIFI_STANDARD_80211ad
:
123
return
MHz_u
{2160};
124
case
WIFI_STANDARD_80211ax
:
125
case
WIFI_STANDARD_80211be
:
126
return
(band ==
WIFI_PHY_BAND_2_4GHZ
?
MHz_u
{20} :
MHz_u
{80});
127
default
:
128
return
MHz_u
{20};
129
}
130
}
131
132
/**
133
* Get the default PHY band for the given standard.
134
*
135
* @param standard the given standard
136
* @return the default PHY band for the given standard
137
*/
138
inline
WifiPhyBand
139
GetDefaultPhyBand
(
WifiStandard
standard)
140
{
141
switch
(standard)
142
{
143
case
WIFI_STANDARD_80211p
:
144
case
WIFI_STANDARD_80211a
:
145
case
WIFI_STANDARD_80211ac
:
146
case
WIFI_STANDARD_80211ax
:
147
case
WIFI_STANDARD_80211be
:
148
return
WIFI_PHY_BAND_5GHZ
;
149
case
WIFI_STANDARD_80211ad
:
150
return
WIFI_PHY_BAND_60GHZ
;
151
default
:
152
return
WIFI_PHY_BAND_2_4GHZ
;
153
}
154
}
155
156
/**
157
* Get the TypeId name for the FrameExchangeManager corresponding to the given standard.
158
*
159
* @param standard the given standard
160
* @param qosSupported whether QoS is supported (ignored if standard is at least HT)
161
* @return the TypeId name for the FrameExchangeManager corresponding to the given standard
162
*/
163
inline
std::string
164
GetFrameExchangeManagerTypeIdName
(
WifiStandard
standard,
bool
qosSupported)
165
{
166
if
(standard >=
WIFI_STANDARD_80211be
)
167
{
168
return
"ns3::EhtFrameExchangeManager"
;
169
}
170
if
(standard >=
WIFI_STANDARD_80211ax
)
171
{
172
return
"ns3::HeFrameExchangeManager"
;
173
}
174
if
(standard >=
WIFI_STANDARD_80211ac
)
175
{
176
return
"ns3::VhtFrameExchangeManager"
;
177
}
178
if
(standard >=
WIFI_STANDARD_80211n
)
179
{
180
return
"ns3::HtFrameExchangeManager"
;
181
}
182
if
(qosSupported)
183
{
184
return
"ns3::QosFrameExchangeManager"
;
185
}
186
return
"ns3::FrameExchangeManager"
;
187
}
188
189
}
// namespace ns3
190
191
#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:30
ns3::WifiPhyBand
WifiPhyBand
Identifies the PHY band.
Definition
wifi-phy-band.h:22
ns3::WIFI_STANDARD_80211a
@ WIFI_STANDARD_80211a
Definition
wifi-standards.h:32
ns3::WIFI_STANDARD_80211ad
@ WIFI_STANDARD_80211ad
Definition
wifi-standards.h:38
ns3::WIFI_STANDARD_COUNT
@ WIFI_STANDARD_COUNT
Definition
wifi-standards.h:41
ns3::WIFI_STANDARD_80211p
@ WIFI_STANDARD_80211p
Definition
wifi-standards.h:35
ns3::WIFI_STANDARD_80211be
@ WIFI_STANDARD_80211be
Definition
wifi-standards.h:40
ns3::WIFI_STANDARD_80211n
@ WIFI_STANDARD_80211n
Definition
wifi-standards.h:36
ns3::WIFI_STANDARD_80211g
@ WIFI_STANDARD_80211g
Definition
wifi-standards.h:34
ns3::WIFI_STANDARD_80211ax
@ WIFI_STANDARD_80211ax
Definition
wifi-standards.h:39
ns3::WIFI_STANDARD_UNSPECIFIED
@ WIFI_STANDARD_UNSPECIFIED
Definition
wifi-standards.h:31
ns3::WIFI_STANDARD_80211ac
@ WIFI_STANDARD_80211ac
Definition
wifi-standards.h:37
ns3::WIFI_STANDARD_80211b
@ WIFI_STANDARD_80211b
Definition
wifi-standards.h:33
ns3::FrequencyChannelType::DSSS
@ DSSS
Definition
wifi-types.h:90
ns3::FrequencyChannelType::OFDM
@ OFDM
Definition
wifi-types.h:91
ns3::FrequencyChannelType::CH_80211P
@ CH_80211P
Definition
wifi-types.h:92
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:164
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:112
ns3::GetDefaultPhyBand
WifiPhyBand GetDefaultPhyBand(WifiStandard standard)
Get the default PHY band for the given standard.
Definition
wifi-standards.h:139
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:91
wifi-phy-band.h
wifi-types.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 Mon Sep 1 2025 18:21:07 for ns-3 by
1.13.2