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