A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
wifi-standards.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2007 INRIA
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
*/
20
21
#ifndef WIFI_STANDARD_H
22
#define WIFI_STANDARD_H
23
24
#include <map>
25
#include "
wifi-phy-band.h
"
26
#include "ns3/abort.h"
27
28
namespace
ns3
{
29
34
enum
WifiPhyStandard
35
{
37
WIFI_PHY_STANDARD_80211a
,
39
WIFI_PHY_STANDARD_80211b
,
41
WIFI_PHY_STANDARD_80211g
,
44
WIFI_PHY_STANDARD_80211_10MHZ
,
47
WIFI_PHY_STANDARD_80211_5MHZ
,
49
WIFI_PHY_STANDARD_80211p
,
52
WIFI_PHY_STANDARD_80211n_2_4GHZ
,
55
WIFI_PHY_STANDARD_80211n_5GHZ
,
57
WIFI_PHY_STANDARD_80211n
,
59
WIFI_PHY_STANDARD_80211ac
,
61
WIFI_PHY_STANDARD_80211ax
,
63
WIFI_PHY_STANDARD_UNSPECIFIED
64
};
65
73
inline
std::ostream&
operator<<
(std::ostream& os,
WifiPhyStandard
standard)
74
{
75
switch
(standard)
76
{
77
case
WIFI_PHY_STANDARD_80211a
:
78
return
(os <<
"802.11a"
);
79
case
WIFI_PHY_STANDARD_80211b
:
80
return
(os <<
"802.11b"
);
81
case
WIFI_PHY_STANDARD_80211g
:
82
return
(os <<
"802.11g"
);
83
case
WIFI_PHY_STANDARD_80211p
:
84
return
(os <<
"802.11p"
);
85
case
WIFI_PHY_STANDARD_80211n
:
86
return
(os <<
"802.11n"
);
87
case
WIFI_PHY_STANDARD_80211ac
:
88
return
(os <<
"802.11ac"
);
89
case
WIFI_PHY_STANDARD_80211ax
:
90
return
(os <<
"802.11ax"
);
91
case
WIFI_PHY_STANDARD_UNSPECIFIED
:
92
default
:
93
return
(os <<
"UNSPECIFIED"
);
94
}
95
}
96
101
enum
WifiMacStandard
102
{
103
WIFI_MAC_STANDARD_80211
,
104
WIFI_MAC_STANDARD_80211n
,
105
WIFI_MAC_STANDARD_80211ac
,
106
WIFI_MAC_STANDARD_80211ax
107
};
108
116
inline
std::ostream&
operator<<
(std::ostream& os,
WifiMacStandard
standard)
117
{
118
switch
(standard)
119
{
120
case
WIFI_MAC_STANDARD_80211
:
121
return
(os <<
"802.11"
);
122
case
WIFI_MAC_STANDARD_80211n
:
123
return
(os <<
"802.11n"
);
124
case
WIFI_MAC_STANDARD_80211ac
:
125
return
(os <<
"802.11ac"
);
126
case
WIFI_MAC_STANDARD_80211ax
:
127
return
(os <<
"802.11ax"
);
128
default
:
129
return
(os <<
"UNSPECIFIED"
);
130
}
131
}
132
137
enum
WifiStandard
138
{
139
WIFI_STANDARD_80211a
,
140
WIFI_STANDARD_80211b
,
141
WIFI_STANDARD_80211g
,
142
WIFI_STANDARD_80211p
,
143
WIFI_STANDARD_80211n_2_4GHZ
,
144
WIFI_STANDARD_80211n_5GHZ
,
145
WIFI_STANDARD_80211ac
,
146
WIFI_STANDARD_80211ax_2_4GHZ
,
147
WIFI_STANDARD_80211ax_5GHZ
,
148
WIFI_STANDARD_80211ax_6GHZ
149
};
150
158
inline
std::ostream&
operator<<
(std::ostream& os,
WifiStandard
standard)
159
{
160
switch
(standard)
161
{
162
case
WIFI_STANDARD_80211a
:
163
return
(os <<
"802.11a"
);
164
case
WIFI_STANDARD_80211b
:
165
return
(os <<
"802.11b"
);
166
case
WIFI_STANDARD_80211g
:
167
return
(os <<
"802.11g"
);
168
case
WIFI_STANDARD_80211p
:
169
return
(os <<
"802.11p"
);
170
case
WIFI_STANDARD_80211n_2_4GHZ
:
171
return
(os <<
"802.11n-2.4GHz"
);
172
case
WIFI_STANDARD_80211n_5GHZ
:
173
return
(os <<
"802.11n-5GHz"
);
174
case
WIFI_STANDARD_80211ac
:
175
return
(os <<
"802.11ac"
);
176
case
WIFI_STANDARD_80211ax_2_4GHZ
:
177
return
(os <<
"802.11ax-2.4GHz"
);
178
case
WIFI_STANDARD_80211ax_5GHZ
:
179
return
(os <<
"802.11ax-5GHz"
);
180
case
WIFI_STANDARD_80211ax_6GHZ
:
181
return
(os <<
"802.11ax-6GHz"
);
182
default
:
183
return
(os <<
"UNSPECIFIED"
);
184
}
185
}
186
190
struct
WifiStandardInfo
191
{
192
WifiPhyStandard
phyStandard
;
193
WifiPhyBand
phyBand
;
194
WifiMacStandard
macStandard
;
195
};
196
200
const
std::map<WifiStandard, WifiStandardInfo>
wifiStandards
=
201
{
202
{
WIFI_STANDARD_80211a
, {
WIFI_PHY_STANDARD_80211a
,
WIFI_PHY_BAND_5GHZ
,
WIFI_MAC_STANDARD_80211
} },
203
{
WIFI_STANDARD_80211b
, {
WIFI_PHY_STANDARD_80211b
,
WIFI_PHY_BAND_2_4GHZ
,
WIFI_MAC_STANDARD_80211
} },
204
{
WIFI_STANDARD_80211g
, {
WIFI_PHY_STANDARD_80211g
,
WIFI_PHY_BAND_2_4GHZ
,
WIFI_MAC_STANDARD_80211
} },
205
{
WIFI_STANDARD_80211p
, {
WIFI_PHY_STANDARD_80211p
,
WIFI_PHY_BAND_5GHZ
,
WIFI_MAC_STANDARD_80211
} },
206
{
WIFI_STANDARD_80211n_2_4GHZ
, {
WIFI_PHY_STANDARD_80211n
,
WIFI_PHY_BAND_2_4GHZ
,
WIFI_MAC_STANDARD_80211n
} },
207
{
WIFI_STANDARD_80211n_5GHZ
, {
WIFI_PHY_STANDARD_80211n
,
WIFI_PHY_BAND_5GHZ
,
WIFI_MAC_STANDARD_80211n
} },
208
{
WIFI_STANDARD_80211ac
, {
WIFI_PHY_STANDARD_80211ac
,
WIFI_PHY_BAND_5GHZ
,
WIFI_MAC_STANDARD_80211ac
} },
209
{
WIFI_STANDARD_80211ax_2_4GHZ
, {
WIFI_PHY_STANDARD_80211ax
,
WIFI_PHY_BAND_2_4GHZ
,
WIFI_MAC_STANDARD_80211ax
} },
210
{
WIFI_STANDARD_80211ax_5GHZ
, {
WIFI_PHY_STANDARD_80211ax
,
WIFI_PHY_BAND_5GHZ
,
WIFI_MAC_STANDARD_80211ax
} },
211
{
WIFI_STANDARD_80211ax_6GHZ
, {
WIFI_PHY_STANDARD_80211ax
,
WIFI_PHY_BAND_6GHZ
,
WIFI_MAC_STANDARD_80211ax
} }
212
};
213
218
enum
FrequencyChannelType
: uint8_t
219
{
220
WIFI_PHY_DSSS_CHANNEL
= 0,
221
WIFI_PHY_OFDM_CHANNEL
,
222
WIFI_PHY_80211p_CHANNEL
223
};
224
231
inline
FrequencyChannelType
GetFrequencyChannelType
(
WifiPhyStandard
standard)
232
{
233
switch
(standard)
234
{
235
case
WIFI_PHY_STANDARD_80211b
:
236
return
WIFI_PHY_DSSS_CHANNEL
;
237
case
WIFI_PHY_STANDARD_80211p
:
238
return
WIFI_PHY_80211p_CHANNEL
;
239
default
:
240
return
WIFI_PHY_OFDM_CHANNEL
;
241
}
242
}
243
250
inline
uint16_t
GetMaximumChannelWidth
(
WifiPhyStandard
standard)
251
{
252
switch
(standard)
253
{
254
case
WIFI_PHY_STANDARD_80211b
:
255
return
22;
256
case
WIFI_PHY_STANDARD_80211p
:
257
return
10;
258
case
WIFI_PHY_STANDARD_80211a
:
259
case
WIFI_PHY_STANDARD_80211g
:
260
return
20;
261
case
WIFI_PHY_STANDARD_80211n
:
262
return
40;
263
case
WIFI_PHY_STANDARD_80211ac
:
264
case
WIFI_PHY_STANDARD_80211ax
:
265
return
160;
266
default
:
267
NS_ABORT_MSG
(
"Unknown standard: "
<< standard);
268
return
0;
269
}
270
}
271
279
inline
uint16_t
GetDefaultChannelWidth
(
WifiPhyStandard
standard,
WifiPhyBand
band)
280
{
281
switch
(standard)
282
{
283
case
WIFI_PHY_STANDARD_80211b
:
284
return
22;
285
case
WIFI_PHY_STANDARD_80211p
:
286
return
10;
287
case
WIFI_PHY_STANDARD_80211ac
:
288
return
80;
289
case
WIFI_PHY_STANDARD_80211ax
:
290
return
(band ==
WIFI_PHY_BAND_2_4GHZ
? 20 : 80);
291
default
:
292
return
20;
293
}
294
}
295
296
}
//namespace ns3
297
298
#endif
/* WIFI_STANDARD_H */
ns3::WIFI_PHY_STANDARD_80211g
ERP-OFDM PHY (Clause 19, Section 19.5)
Definition:
wifi-standards.h:41
ns3::WIFI_PHY_STANDARD_80211_5MHZ
OFDM PHY for the 5 GHz band (Clause 17 with 5 MHz channel bandwidth)
Definition:
wifi-standards.h:47
ns3::WIFI_PHY_OFDM_CHANNEL
Definition:
wifi-standards.h:221
ns3::WIFI_PHY_STANDARD_80211n_5GHZ
HT PHY for the 5 GHz band (clause 20)
Definition:
wifi-standards.h:55
NS_ABORT_MSG
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
Definition:
abort.h:50
ns3::WIFI_STANDARD_80211g
Definition:
wifi-standards.h:141
ns3::WIFI_MAC_STANDARD_80211ac
Definition:
wifi-standards.h:105
ns3::WIFI_STANDARD_80211p
Definition:
wifi-standards.h:142
ns3::WIFI_STANDARD_80211ax_5GHZ
Definition:
wifi-standards.h:147
ns3::GetMaximumChannelWidth
uint16_t GetMaximumChannelWidth(WifiPhyStandard standard)
Get the maximum channel width in MHz allowed for the given PHY standard.
Definition:
wifi-standards.h:250
ns3::WIFI_PHY_STANDARD_80211_10MHZ
OFDM PHY for the 5 GHz band (Clause 17 with 10 MHz channel bandwidth)
Definition:
wifi-standards.h:44
ns3::WIFI_STANDARD_80211ax_2_4GHZ
Definition:
wifi-standards.h:146
wifi-phy-band.h
ns3::WIFI_PHY_STANDARD_80211n_2_4GHZ
HT PHY for the 2.4 GHz band (clause 20)
Definition:
wifi-standards.h:52
ns3::WIFI_PHY_BAND_5GHZ
The 5 GHz band.
Definition:
wifi-phy-band.h:37
ns3::WifiStandardInfo::phyStandard
WifiPhyStandard phyStandard
the PHY standard
Definition:
wifi-standards.h:192
ns3::wifiStandards
const std::map< WifiStandard, WifiStandardInfo > wifiStandards
map a given standard configured by the user to the corresponding WifiStandardInfo ...
Definition:
wifi-standards.h:200
ns3::WIFI_MAC_STANDARD_80211ax
Definition:
wifi-standards.h:106
ns3::WIFI_PHY_DSSS_CHANNEL
Definition:
wifi-standards.h:220
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition:
angles.cc:137
ns3::WifiPhyStandard
WifiPhyStandard
Identifies the PHY specification that a Wifi device is configured to use.
Definition:
wifi-standards.h:34
ns3::FrequencyChannelType
FrequencyChannelType
Enumeration of frequency channel types.
Definition:
wifi-standards.h:218
ns3::WifiStandardInfo::phyBand
WifiPhyBand phyBand
the PHY band
Definition:
wifi-standards.h:193
ns3::WIFI_PHY_STANDARD_80211ax
HE PHY (clause 26)
Definition:
wifi-standards.h:61
ns3::WIFI_STANDARD_80211a
Definition:
wifi-standards.h:139
ns3::WIFI_PHY_STANDARD_80211p
OFDM PHY (Clause 17 - amendment for 10 MHz and 5 MHz channels)
Definition:
wifi-standards.h:49
ns3::WIFI_STANDARD_80211b
Definition:
wifi-standards.h:140
ns3::WIFI_MAC_STANDARD_80211
Definition:
wifi-standards.h:103
ns3::WIFI_STANDARD_80211ax_6GHZ
Definition:
wifi-standards.h:148
ns3::WifiMacStandard
WifiMacStandard
Identifies the MAC specification that a Wifi device is configured to use.
Definition:
wifi-standards.h:101
ns3::WIFI_PHY_STANDARD_80211a
OFDM PHY (Clause 17)
Definition:
wifi-standards.h:37
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::WifiStandard
WifiStandard
Identifies the allowed configurations that a Wifi device is configured to use.
Definition:
wifi-standards.h:137
ns3::WIFI_PHY_STANDARD_80211ac
VHT PHY (clause 22)
Definition:
wifi-standards.h:59
ns3::WIFI_PHY_STANDARD_80211b
DSSS PHY (Clause 15) and HR/DSSS PHY (Clause 18)
Definition:
wifi-standards.h:39
ns3::WIFI_PHY_BAND_2_4GHZ
The 2.4 GHz band.
Definition:
wifi-phy-band.h:35
ns3::WifiStandardInfo
hold PHY and MAC information based on the selected standard.
Definition:
wifi-standards.h:190
ns3::WIFI_STANDARD_80211ac
Definition:
wifi-standards.h:145
ns3::WIFI_PHY_STANDARD_80211n
HT PHY (clause 20)
Definition:
wifi-standards.h:57
ns3::WIFI_PHY_STANDARD_UNSPECIFIED
Unspecified.
Definition:
wifi-standards.h:63
ns3::WifiStandardInfo::macStandard
WifiMacStandard macStandard
the MAC standard
Definition:
wifi-standards.h:194
ns3::WifiPhyBand
WifiPhyBand
Identifies the PHY band.
Definition:
wifi-phy-band.h:32
ns3::GetDefaultChannelWidth
uint16_t GetDefaultChannelWidth(WifiPhyStandard standard, WifiPhyBand band)
Get the default channel width for the given PHY standard and band.
Definition:
wifi-standards.h:279
ns3::WIFI_STANDARD_80211n_2_4GHZ
Definition:
wifi-standards.h:143
ns3::WIFI_MAC_STANDARD_80211n
Definition:
wifi-standards.h:104
ns3::GetFrequencyChannelType
FrequencyChannelType GetFrequencyChannelType(WifiPhyStandard standard)
Get the type of the frequency channel for the given PHY standard.
Definition:
wifi-standards.h:231
ns3::WIFI_PHY_BAND_6GHZ
The 6 GHz band.
Definition:
wifi-phy-band.h:39
ns3::WIFI_PHY_80211p_CHANNEL
Definition:
wifi-standards.h:222
ns3::WIFI_STANDARD_80211n_5GHZ
Definition:
wifi-standards.h:144
src
wifi
model
wifi-standards.h
Generated on Wed Jul 14 2021 13:24:48 for ns-3 by
1.8.14