A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
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
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
};
50
58
inline
std::ostream&
59
operator<<
(std::ostream& os,
WifiStandard
standard)
60
{
61
switch
(standard)
62
{
63
case
WIFI_STANDARD_80211a
:
64
return
(os <<
"802.11a"
);
65
case
WIFI_STANDARD_80211b
:
66
return
(os <<
"802.11b"
);
67
case
WIFI_STANDARD_80211g
:
68
return
(os <<
"802.11g"
);
69
case
WIFI_STANDARD_80211p
:
70
return
(os <<
"802.11p"
);
71
case
WIFI_STANDARD_80211n
:
72
return
(os <<
"802.11n"
);
73
case
WIFI_STANDARD_80211ac
:
74
return
(os <<
"802.11ac"
);
75
case
WIFI_STANDARD_80211ad
:
76
return
(os <<
"802.11ad"
);
77
case
WIFI_STANDARD_80211ax
:
78
return
(os <<
"802.11ax"
);
79
case
WIFI_STANDARD_80211be
:
80
return
(os <<
"802.11be"
);
81
default
:
82
return
(os <<
"UNSPECIFIED"
);
83
}
84
}
85
89
const
std::map<WifiStandard, std::list<WifiPhyBand>>
wifiStandards
= {
90
{
WIFI_STANDARD_80211a
, {
WIFI_PHY_BAND_5GHZ
}},
91
{
WIFI_STANDARD_80211b
, {
WIFI_PHY_BAND_2_4GHZ
}},
92
{
WIFI_STANDARD_80211g
, {
WIFI_PHY_BAND_2_4GHZ
}},
93
{
WIFI_STANDARD_80211p
, {
WIFI_PHY_BAND_5GHZ
}},
94
{
WIFI_STANDARD_80211n
, {
WIFI_PHY_BAND_2_4GHZ
,
WIFI_PHY_BAND_5GHZ
}},
95
{
WIFI_STANDARD_80211ac
, {
WIFI_PHY_BAND_5GHZ
}},
96
{
WIFI_STANDARD_80211ad
, {
WIFI_PHY_BAND_60GHZ
}},
97
{
WIFI_STANDARD_80211ax
, {
WIFI_PHY_BAND_2_4GHZ
,
WIFI_PHY_BAND_5GHZ
,
WIFI_PHY_BAND_6GHZ
}},
98
{
WIFI_STANDARD_80211be
, {
WIFI_PHY_BAND_2_4GHZ
,
WIFI_PHY_BAND_5GHZ
,
WIFI_PHY_BAND_6GHZ
}},
99
};
100
105
enum
FrequencyChannelType
: uint8_t
106
{
107
WIFI_PHY_DSSS_CHANNEL
= 0,
108
WIFI_PHY_OFDM_CHANNEL
,
109
WIFI_PHY_80211p_CHANNEL
110
};
111
118
inline
FrequencyChannelType
119
GetFrequencyChannelType
(
WifiStandard
standard)
120
{
121
switch
(standard)
122
{
123
case
WIFI_STANDARD_80211b
:
124
return
WIFI_PHY_DSSS_CHANNEL
;
125
case
WIFI_STANDARD_80211p
:
126
return
WIFI_PHY_80211p_CHANNEL
;
127
default
:
128
return
WIFI_PHY_OFDM_CHANNEL
;
129
}
130
}
131
139
inline
uint16_t
140
GetDefaultChannelWidth
(
WifiStandard
standard,
WifiPhyBand
band)
141
{
142
switch
(standard)
143
{
144
case
WIFI_STANDARD_80211b
:
145
return
22;
146
case
WIFI_STANDARD_80211p
:
147
return
10;
148
case
WIFI_STANDARD_80211ac
:
149
return
80;
150
case
WIFI_STANDARD_80211ad
:
151
return
2160;
152
case
WIFI_STANDARD_80211ax
:
153
case
WIFI_STANDARD_80211be
:
154
return
(band ==
WIFI_PHY_BAND_2_4GHZ
? 20 : 80);
155
default
:
156
return
20;
157
}
158
}
159
166
inline
WifiPhyBand
167
GetDefaultPhyBand
(
WifiStandard
standard)
168
{
169
switch
(standard)
170
{
171
case
WIFI_STANDARD_80211p
:
172
case
WIFI_STANDARD_80211a
:
173
case
WIFI_STANDARD_80211ac
:
174
case
WIFI_STANDARD_80211ax
:
175
case
WIFI_STANDARD_80211be
:
176
return
WIFI_PHY_BAND_5GHZ
;
177
case
WIFI_STANDARD_80211ad
:
178
return
WIFI_PHY_BAND_60GHZ
;
179
default
:
180
return
WIFI_PHY_BAND_2_4GHZ
;
181
}
182
}
183
184
}
// namespace ns3
185
186
#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:106
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_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:109
ns3::WIFI_PHY_OFDM_CHANNEL
@ WIFI_PHY_OFDM_CHANNEL
Definition:
wifi-standards.h:108
ns3::WIFI_PHY_DSSS_CHANNEL
@ WIFI_PHY_DSSS_CHANNEL
Definition:
wifi-standards.h:107
ns3::WIFI_PHY_BAND_6GHZ
@ WIFI_PHY_BAND_6GHZ
The 6 GHz band.
Definition:
wifi-phy-band.h:39
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::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.h:89
ns3::GetDefaultPhyBand
WifiPhyBand GetDefaultPhyBand(WifiStandard standard)
Get the default PHY band for the given standard.
Definition:
wifi-standards.h:167
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:140
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition:
angles.cc:159
ns3::GetFrequencyChannelType
FrequencyChannelType GetFrequencyChannelType(WifiStandard standard)
Get the type of the frequency channel for the given standard.
Definition:
wifi-standards.h:119
wifi-phy-band.h
src
wifi
model
wifi-standards.h
Generated on Sun Mar 3 2024 17:11:12 for ns-3 by
1.9.1