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
,
43
WIFI_PHY_STANDARD_80211p
,
45
WIFI_PHY_STANDARD_80211n
,
47
WIFI_PHY_STANDARD_80211ac
,
49
WIFI_PHY_STANDARD_80211ax
,
51
WIFI_PHY_STANDARD_UNSPECIFIED
52
};
53
61
inline
std::ostream&
operator<<
(std::ostream& os,
WifiPhyStandard
standard)
62
{
63
switch
(standard)
64
{
65
case
WIFI_PHY_STANDARD_80211a
:
66
return
(os <<
"802.11a"
);
67
case
WIFI_PHY_STANDARD_80211b
:
68
return
(os <<
"802.11b"
);
69
case
WIFI_PHY_STANDARD_80211g
:
70
return
(os <<
"802.11g"
);
71
case
WIFI_PHY_STANDARD_80211p
:
72
return
(os <<
"802.11p"
);
73
case
WIFI_PHY_STANDARD_80211n
:
74
return
(os <<
"802.11n"
);
75
case
WIFI_PHY_STANDARD_80211ac
:
76
return
(os <<
"802.11ac"
);
77
case
WIFI_PHY_STANDARD_80211ax
:
78
return
(os <<
"802.11ax"
);
79
case
WIFI_PHY_STANDARD_UNSPECIFIED
:
80
default
:
81
return
(os <<
"UNSPECIFIED"
);
82
}
83
}
84
89
enum
WifiMacStandard
90
{
91
WIFI_MAC_STANDARD_80211
,
92
WIFI_MAC_STANDARD_80211n
,
93
WIFI_MAC_STANDARD_80211ac
,
94
WIFI_MAC_STANDARD_80211ax
95
};
96
104
inline
std::ostream&
operator<<
(std::ostream& os,
WifiMacStandard
standard)
105
{
106
switch
(standard)
107
{
108
case
WIFI_MAC_STANDARD_80211
:
109
return
(os <<
"802.11"
);
110
case
WIFI_MAC_STANDARD_80211n
:
111
return
(os <<
"802.11n"
);
112
case
WIFI_MAC_STANDARD_80211ac
:
113
return
(os <<
"802.11ac"
);
114
case
WIFI_MAC_STANDARD_80211ax
:
115
return
(os <<
"802.11ax"
);
116
default
:
117
return
(os <<
"UNSPECIFIED"
);
118
}
119
}
120
125
enum
WifiStandard
126
{
127
WIFI_STANDARD_80211a
,
128
WIFI_STANDARD_80211b
,
129
WIFI_STANDARD_80211g
,
130
WIFI_STANDARD_80211p
,
131
WIFI_STANDARD_80211n_2_4GHZ
,
132
WIFI_STANDARD_80211n_5GHZ
,
133
WIFI_STANDARD_80211ac
,
134
WIFI_STANDARD_80211ax_2_4GHZ
,
135
WIFI_STANDARD_80211ax_5GHZ
,
136
WIFI_STANDARD_80211ax_6GHZ
137
};
138
146
inline
std::ostream&
operator<<
(std::ostream& os,
WifiStandard
standard)
147
{
148
switch
(standard)
149
{
150
case
WIFI_STANDARD_80211a
:
151
return
(os <<
"802.11a"
);
152
case
WIFI_STANDARD_80211b
:
153
return
(os <<
"802.11b"
);
154
case
WIFI_STANDARD_80211g
:
155
return
(os <<
"802.11g"
);
156
case
WIFI_STANDARD_80211p
:
157
return
(os <<
"802.11p"
);
158
case
WIFI_STANDARD_80211n_2_4GHZ
:
159
return
(os <<
"802.11n-2.4GHz"
);
160
case
WIFI_STANDARD_80211n_5GHZ
:
161
return
(os <<
"802.11n-5GHz"
);
162
case
WIFI_STANDARD_80211ac
:
163
return
(os <<
"802.11ac"
);
164
case
WIFI_STANDARD_80211ax_2_4GHZ
:
165
return
(os <<
"802.11ax-2.4GHz"
);
166
case
WIFI_STANDARD_80211ax_5GHZ
:
167
return
(os <<
"802.11ax-5GHz"
);
168
case
WIFI_STANDARD_80211ax_6GHZ
:
169
return
(os <<
"802.11ax-6GHz"
);
170
default
:
171
return
(os <<
"UNSPECIFIED"
);
172
}
173
}
174
178
struct
WifiStandardInfo
179
{
180
WifiPhyStandard
phyStandard
;
181
WifiPhyBand
phyBand
;
182
WifiMacStandard
macStandard
;
183
};
184
188
const
std::map<WifiStandard, WifiStandardInfo>
wifiStandards
=
189
{
190
{
WIFI_STANDARD_80211a
, {
WIFI_PHY_STANDARD_80211a
,
WIFI_PHY_BAND_5GHZ
,
WIFI_MAC_STANDARD_80211
} },
191
{
WIFI_STANDARD_80211b
, {
WIFI_PHY_STANDARD_80211b
,
WIFI_PHY_BAND_2_4GHZ
,
WIFI_MAC_STANDARD_80211
} },
192
{
WIFI_STANDARD_80211g
, {
WIFI_PHY_STANDARD_80211g
,
WIFI_PHY_BAND_2_4GHZ
,
WIFI_MAC_STANDARD_80211
} },
193
{
WIFI_STANDARD_80211p
, {
WIFI_PHY_STANDARD_80211p
,
WIFI_PHY_BAND_5GHZ
,
WIFI_MAC_STANDARD_80211
} },
194
{
WIFI_STANDARD_80211n_2_4GHZ
, {
WIFI_PHY_STANDARD_80211n
,
WIFI_PHY_BAND_2_4GHZ
,
WIFI_MAC_STANDARD_80211n
} },
195
{
WIFI_STANDARD_80211n_5GHZ
, {
WIFI_PHY_STANDARD_80211n
,
WIFI_PHY_BAND_5GHZ
,
WIFI_MAC_STANDARD_80211n
} },
196
{
WIFI_STANDARD_80211ac
, {
WIFI_PHY_STANDARD_80211ac
,
WIFI_PHY_BAND_5GHZ
,
WIFI_MAC_STANDARD_80211ac
} },
197
{
WIFI_STANDARD_80211ax_2_4GHZ
, {
WIFI_PHY_STANDARD_80211ax
,
WIFI_PHY_BAND_2_4GHZ
,
WIFI_MAC_STANDARD_80211ax
} },
198
{
WIFI_STANDARD_80211ax_5GHZ
, {
WIFI_PHY_STANDARD_80211ax
,
WIFI_PHY_BAND_5GHZ
,
WIFI_MAC_STANDARD_80211ax
} },
199
{
WIFI_STANDARD_80211ax_6GHZ
, {
WIFI_PHY_STANDARD_80211ax
,
WIFI_PHY_BAND_6GHZ
,
WIFI_MAC_STANDARD_80211ax
} }
200
};
201
206
enum
FrequencyChannelType
: uint8_t
207
{
208
WIFI_PHY_DSSS_CHANNEL
= 0,
209
WIFI_PHY_OFDM_CHANNEL
,
210
WIFI_PHY_80211p_CHANNEL
211
};
212
219
inline
FrequencyChannelType
GetFrequencyChannelType
(
WifiPhyStandard
standard)
220
{
221
switch
(standard)
222
{
223
case
WIFI_PHY_STANDARD_80211b
:
224
return
WIFI_PHY_DSSS_CHANNEL
;
225
case
WIFI_PHY_STANDARD_80211p
:
226
return
WIFI_PHY_80211p_CHANNEL
;
227
default
:
228
return
WIFI_PHY_OFDM_CHANNEL
;
229
}
230
}
231
238
inline
uint16_t
GetMaximumChannelWidth
(
WifiPhyStandard
standard)
239
{
240
switch
(standard)
241
{
242
case
WIFI_PHY_STANDARD_80211b
:
243
return
22;
244
case
WIFI_PHY_STANDARD_80211p
:
245
return
10;
246
case
WIFI_PHY_STANDARD_80211a
:
247
case
WIFI_PHY_STANDARD_80211g
:
248
return
20;
249
case
WIFI_PHY_STANDARD_80211n
:
250
return
40;
251
case
WIFI_PHY_STANDARD_80211ac
:
252
case
WIFI_PHY_STANDARD_80211ax
:
253
return
160;
254
default
:
255
NS_ABORT_MSG
(
"Unknown standard: "
<< standard);
256
return
0;
257
}
258
}
259
267
inline
uint16_t
GetDefaultChannelWidth
(
WifiPhyStandard
standard,
WifiPhyBand
band)
268
{
269
switch
(standard)
270
{
271
case
WIFI_PHY_STANDARD_80211b
:
272
return
22;
273
case
WIFI_PHY_STANDARD_80211p
:
274
return
10;
275
case
WIFI_PHY_STANDARD_80211ac
:
276
return
80;
277
case
WIFI_PHY_STANDARD_80211ax
:
278
return
(band ==
WIFI_PHY_BAND_2_4GHZ
? 20 : 80);
279
default
:
280
return
20;
281
}
282
}
283
284
}
//namespace ns3
285
286
#endif
/* WIFI_STANDARD_H */
ns3::WifiStandardInfo::phyBand
WifiPhyBand phyBand
the PHY band
Definition:
wifi-standards.h:181
ns3::WIFI_STANDARD_80211n_5GHZ
@ WIFI_STANDARD_80211n_5GHZ
Definition:
wifi-standards.h:132
ns3::WifiMacStandard
WifiMacStandard
Identifies the MAC specification that a Wifi device is configured to use.
Definition:
wifi-standards.h:90
ns3::FrequencyChannelType
FrequencyChannelType
Enumeration of frequency channel types.
Definition:
wifi-standards.h:207
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::WIFI_PHY_OFDM_CHANNEL
@ WIFI_PHY_OFDM_CHANNEL
Definition:
wifi-standards.h:209
ns3::WIFI_STANDARD_80211ax_2_4GHZ
@ WIFI_STANDARD_80211ax_2_4GHZ
Definition:
wifi-standards.h:134
ns3::WIFI_STANDARD_80211g
@ WIFI_STANDARD_80211g
Definition:
wifi-standards.h:129
ns3::WIFI_MAC_STANDARD_80211ac
@ WIFI_MAC_STANDARD_80211ac
Definition:
wifi-standards.h:93
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:267
ns3::WIFI_STANDARD_80211p
@ WIFI_STANDARD_80211p
Definition:
wifi-standards.h:130
ns3::GetFrequencyChannelType
FrequencyChannelType GetFrequencyChannelType(WifiPhyStandard standard)
Get the type of the frequency channel for the given PHY standard.
Definition:
wifi-standards.h:219
ns3::WIFI_PHY_BAND_5GHZ
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
Definition:
wifi-phy-band.h:37
ns3::WIFI_STANDARD_80211ax_5GHZ
@ WIFI_STANDARD_80211ax_5GHZ
Definition:
wifi-standards.h:135
ns3::WIFI_MAC_STANDARD_80211ax
@ WIFI_MAC_STANDARD_80211ax
Definition:
wifi-standards.h:94
wifi-phy-band.h
ns3::WifiStandardInfo::macStandard
WifiMacStandard macStandard
the MAC standard
Definition:
wifi-standards.h:182
ns3::WifiPhyStandard
WifiPhyStandard
Identifies the PHY specification that a Wifi device is configured to use.
Definition:
wifi-standards.h:35
ns3::WIFI_PHY_DSSS_CHANNEL
@ WIFI_PHY_DSSS_CHANNEL
Definition:
wifi-standards.h:208
ns3::WIFI_PHY_STANDARD_80211ax
@ WIFI_PHY_STANDARD_80211ax
HE PHY (clause 26)
Definition:
wifi-standards.h:49
ns3::WIFI_PHY_STANDARD_80211p
@ WIFI_PHY_STANDARD_80211p
OFDM PHY (Clause 17 - amendment for 10 MHz and 5 MHz channels)
Definition:
wifi-standards.h:43
ns3::WIFI_MAC_STANDARD_80211
@ WIFI_MAC_STANDARD_80211
Definition:
wifi-standards.h:91
ns3::WIFI_STANDARD_80211a
@ WIFI_STANDARD_80211a
Definition:
wifi-standards.h:127
ns3::WIFI_PHY_STANDARD_80211a
@ WIFI_PHY_STANDARD_80211a
OFDM PHY (Clause 17)
Definition:
wifi-standards.h:37
ns3::WIFI_STANDARD_80211b
@ WIFI_STANDARD_80211b
Definition:
wifi-standards.h:128
ns3::WIFI_PHY_STANDARD_80211b
@ WIFI_PHY_STANDARD_80211b
DSSS PHY (Clause 15) and HR/DSSS PHY (Clause 18)
Definition:
wifi-standards.h:39
ns3::WIFI_STANDARD_80211ax_6GHZ
@ WIFI_STANDARD_80211ax_6GHZ
Definition:
wifi-standards.h:136
ns3::WIFI_STANDARD_80211ac
@ WIFI_STANDARD_80211ac
Definition:
wifi-standards.h:133
ns3::WIFI_PHY_STANDARD_80211n
@ WIFI_PHY_STANDARD_80211n
HT PHY (clause 20)
Definition:
wifi-standards.h:45
ns3::WIFI_PHY_STANDARD_80211ac
@ WIFI_PHY_STANDARD_80211ac
VHT PHY (clause 22)
Definition:
wifi-standards.h:47
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_STANDARD_UNSPECIFIED
@ WIFI_PHY_STANDARD_UNSPECIFIED
Unspecified.
Definition:
wifi-standards.h:51
ns3::WifiStandardInfo::phyStandard
WifiPhyStandard phyStandard
the PHY standard
Definition:
wifi-standards.h:180
ns3::WIFI_PHY_BAND_6GHZ
@ WIFI_PHY_BAND_6GHZ
The 6 GHz band.
Definition:
wifi-phy-band.h:39
ns3::GetMaximumChannelWidth
uint16_t GetMaximumChannelWidth(WifiPhyStandard standard)
Get the maximum channel width in MHz allowed for the given PHY standard.
Definition:
wifi-standards.h:238
ns3::WifiPhyBand
WifiPhyBand
Identifies the PHY band.
Definition:
wifi-phy-band.h:33
ns3::wifiStandards
const std::map< WifiStandard, WifiStandardInfo > wifiStandards
map a given standard configured by the user to the corresponding WifiStandardInfo
Definition:
wifi-standards.h:188
ns3::WIFI_STANDARD_80211n_2_4GHZ
@ WIFI_STANDARD_80211n_2_4GHZ
Definition:
wifi-standards.h:131
ns3::WifiStandard
WifiStandard
Identifies the allowed configurations that a Wifi device is configured to use.
Definition:
wifi-standards.h:126
ns3::WIFI_MAC_STANDARD_80211n
@ WIFI_MAC_STANDARD_80211n
Definition:
wifi-standards.h:92
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition:
angles.cc:137
ns3::WIFI_PHY_80211p_CHANNEL
@ WIFI_PHY_80211p_CHANNEL
Definition:
wifi-standards.h:210
ns3::WIFI_PHY_STANDARD_80211g
@ WIFI_PHY_STANDARD_80211g
ERP-OFDM PHY (Clause 19, Section 19.5)
Definition:
wifi-standards.h:41
ns3::WifiStandardInfo
hold PHY and MAC information based on the selected standard.
Definition:
wifi-standards.h:179
NS_ABORT_MSG
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
Definition:
abort.h:50
src
wifi
model
wifi-standards.h
Generated on Fri Oct 1 2021 17:03:50 for ns-3 by
1.8.20