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
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18
*/
19
20
#ifndef WIFI_STANDARD_H
21
#define WIFI_STANDARD_H
22
23
#include "
wifi-phy-band.h
"
24
25
#include "ns3/abort.h"
26
27
#include <list>
28
#include <map>
29
30
namespace
ns3
31
{
32
33
/**
34
* \ingroup wifi
35
* Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
36
*/
37
enum
WifiStandard
38
{
39
WIFI_STANDARD_UNSPECIFIED
,
40
WIFI_STANDARD_80211a
,
41
WIFI_STANDARD_80211b
,
42
WIFI_STANDARD_80211g
,
43
WIFI_STANDARD_80211p
,
44
WIFI_STANDARD_80211n
,
45
WIFI_STANDARD_80211ac
,
46
WIFI_STANDARD_80211ad
,
47
WIFI_STANDARD_80211ax
,
48
WIFI_STANDARD_80211be
,
49
WIFI_STANDARD_COUNT
50
};
51
52
/**
53
* \brief Stream insertion operator.
54
*
55
* \param os the stream
56
* \param standard the standard
57
* \returns a reference to the stream
58
*/
59
inline
std::ostream&
60
operator<<
(std::ostream& os,
WifiStandard
standard)
61
{
62
switch
(standard)
63
{
64
case
WIFI_STANDARD_80211a
:
65
return
(os <<
"802.11a"
);
66
case
WIFI_STANDARD_80211b
:
67
return
(os <<
"802.11b"
);
68
case
WIFI_STANDARD_80211g
:
69
return
(os <<
"802.11g"
);
70
case
WIFI_STANDARD_80211p
:
71
return
(os <<
"802.11p"
);
72
case
WIFI_STANDARD_80211n
:
73
return
(os <<
"802.11n"
);
74
case
WIFI_STANDARD_80211ac
:
75
return
(os <<
"802.11ac"
);
76
case
WIFI_STANDARD_80211ad
:
77
return
(os <<
"802.11ad"
);
78
case
WIFI_STANDARD_80211ax
:
79
return
(os <<
"802.11ax"
);
80
case
WIFI_STANDARD_80211be
:
81
return
(os <<
"802.11be"
);
82
default
:
83
return
(os <<
"UNSPECIFIED"
);
84
}
85
}
86
87
/**
88
* \brief map a given standard configured by the user to the allowed PHY bands
89
*/
90
extern
const
std::map<WifiStandard, std::list<WifiPhyBand>>
wifiStandards
;
91
92
/**
93
* \ingroup wifi
94
* \brief Enumeration of frequency channel types
95
*/
96
enum
FrequencyChannelType
: uint8_t
97
{
98
WIFI_PHY_DSSS_CHANNEL
= 0,
99
WIFI_PHY_OFDM_CHANNEL
,
100
WIFI_PHY_80211p_CHANNEL
101
};
102
103
/**
104
* Get the type of the frequency channel for the given standard
105
*
106
* \param standard the standard
107
* \return the type of the frequency channel for the given standard
108
*/
109
inline
FrequencyChannelType
110
GetFrequencyChannelType
(
WifiStandard
standard)
111
{
112
switch
(standard)
113
{
114
case
WIFI_STANDARD_80211b
:
115
return
WIFI_PHY_DSSS_CHANNEL
;
116
case
WIFI_STANDARD_80211p
:
117
return
WIFI_PHY_80211p_CHANNEL
;
118
default
:
119
return
WIFI_PHY_OFDM_CHANNEL
;
120
}
121
}
122
123
/**
124
* Get the default channel width for the given PHY standard and band.
125
*
126
* \param standard the given standard
127
* \param band the given PHY band
128
* \return the default channel width (MHz) for the given standard
129
*/
130
inline
uint16_t
131
GetDefaultChannelWidth
(
WifiStandard
standard,
WifiPhyBand
band)
132
{
133
switch
(standard)
134
{
135
case
WIFI_STANDARD_80211b
:
136
return
22;
137
case
WIFI_STANDARD_80211p
:
138
return
10;
139
case
WIFI_STANDARD_80211ac
:
140
return
80;
141
case
WIFI_STANDARD_80211ad
:
142
return
2160;
143
case
WIFI_STANDARD_80211ax
:
144
case
WIFI_STANDARD_80211be
:
145
return
(band ==
WIFI_PHY_BAND_2_4GHZ
? 20 : 80);
146
default
:
147
return
20;
148
}
149
}
150
151
/**
152
* Get the default PHY band for the given standard.
153
*
154
* \param standard the given standard
155
* \return the default PHY band for the given standard
156
*/
157
inline
WifiPhyBand
158
GetDefaultPhyBand
(
WifiStandard
standard)
159
{
160
switch
(standard)
161
{
162
case
WIFI_STANDARD_80211p
:
163
case
WIFI_STANDARD_80211a
:
164
case
WIFI_STANDARD_80211ac
:
165
case
WIFI_STANDARD_80211ax
:
166
case
WIFI_STANDARD_80211be
:
167
return
WIFI_PHY_BAND_5GHZ
;
168
case
WIFI_STANDARD_80211ad
:
169
return
WIFI_PHY_BAND_60GHZ
;
170
default
:
171
return
WIFI_PHY_BAND_2_4GHZ
;
172
}
173
}
174
175
/**
176
* Get the TypeId name for the FrameExchangeManager corresponding to the given standard.
177
*
178
* \param standard the given standard
179
* \param qosSupported whether QoS is supported (ignored if standard is at least HT)
180
* \return the TypeId name for the FrameExchangeManager corresponding to the given standard
181
*/
182
inline
std::string
183
GetFrameExchangeManagerTypeIdName
(
WifiStandard
standard,
bool
qosSupported)
184
{
185
if
(standard >=
WIFI_STANDARD_80211be
)
186
{
187
return
"ns3::EhtFrameExchangeManager"
;
188
}
189
if
(standard >=
WIFI_STANDARD_80211ax
)
190
{
191
return
"ns3::HeFrameExchangeManager"
;
192
}
193
if
(standard >=
WIFI_STANDARD_80211ac
)
194
{
195
return
"ns3::VhtFrameExchangeManager"
;
196
}
197
if
(standard >=
WIFI_STANDARD_80211n
)
198
{
199
return
"ns3::HtFrameExchangeManager"
;
200
}
201
if
(qosSupported)
202
{
203
return
"ns3::QosFrameExchangeManager"
;
204
}
205
return
"ns3::FrameExchangeManager"
;
206
}
207
208
}
// namespace ns3
209
210
#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:38
ns3::FrequencyChannelType
FrequencyChannelType
Enumeration of frequency channel types.
Definition:
wifi-standards.h:97
ns3::WifiPhyBand
WifiPhyBand
Identifies the PHY band.
Definition:
wifi-phy-band.h:33
ns3::WIFI_STANDARD_80211a
@ WIFI_STANDARD_80211a
Definition:
wifi-standards.h:40
ns3::WIFI_STANDARD_80211ad
@ WIFI_STANDARD_80211ad
Definition:
wifi-standards.h:46
ns3::WIFI_STANDARD_COUNT
@ WIFI_STANDARD_COUNT
Definition:
wifi-standards.h:49
ns3::WIFI_STANDARD_80211p
@ WIFI_STANDARD_80211p
Definition:
wifi-standards.h:43
ns3::WIFI_STANDARD_80211be
@ WIFI_STANDARD_80211be
Definition:
wifi-standards.h:48
ns3::WIFI_STANDARD_80211n
@ WIFI_STANDARD_80211n
Definition:
wifi-standards.h:44
ns3::WIFI_STANDARD_80211g
@ WIFI_STANDARD_80211g
Definition:
wifi-standards.h:42
ns3::WIFI_STANDARD_80211ax
@ WIFI_STANDARD_80211ax
Definition:
wifi-standards.h:47
ns3::WIFI_STANDARD_UNSPECIFIED
@ WIFI_STANDARD_UNSPECIFIED
Definition:
wifi-standards.h:39
ns3::WIFI_STANDARD_80211ac
@ WIFI_STANDARD_80211ac
Definition:
wifi-standards.h:45
ns3::WIFI_STANDARD_80211b
@ WIFI_STANDARD_80211b
Definition:
wifi-standards.h:41
ns3::WIFI_PHY_80211p_CHANNEL
@ WIFI_PHY_80211p_CHANNEL
Definition:
wifi-standards.h:100
ns3::WIFI_PHY_OFDM_CHANNEL
@ WIFI_PHY_OFDM_CHANNEL
Definition:
wifi-standards.h:99
ns3::WIFI_PHY_DSSS_CHANNEL
@ WIFI_PHY_DSSS_CHANNEL
Definition:
wifi-standards.h:98
ns3::WIFI_PHY_BAND_2_4GHZ
@ WIFI_PHY_BAND_2_4GHZ
The 2.4 GHz band.
Definition:
wifi-phy-band.h:35
ns3::WIFI_PHY_BAND_60GHZ
@ WIFI_PHY_BAND_60GHZ
The 60 GHz band.
Definition:
wifi-phy-band.h:41
ns3::WIFI_PHY_BAND_5GHZ
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
Definition:
wifi-phy-band.h:37
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:159
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:183
ns3::GetDefaultPhyBand
WifiPhyBand GetDefaultPhyBand(WifiStandard standard)
Get the default PHY band for the given standard.
Definition:
wifi-standards.h:158
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:25
ns3::GetDefaultChannelWidth
uint16_t GetDefaultChannelWidth(WifiStandard standard, WifiPhyBand band)
Get the default channel width for the given PHY standard and band.
Definition:
wifi-standards.h:131
ns3::GetFrequencyChannelType
FrequencyChannelType GetFrequencyChannelType(WifiStandard standard)
Get the type of the frequency channel for the given standard.
Definition:
wifi-standards.h:110
wifi-phy-band.h
src
wifi
model
wifi-standards.h
Generated on Tue May 28 2024 23:40:44 for ns-3 by
1.9.6