A Discrete-Event Network Simulator
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
30namespace ns3
31{
32
33/**
34 * \ingroup wifi
35 * Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
36 */
38{
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 */
59inline std::ostream&
60operator<<(std::ostream& os, WifiStandard standard)
61{
62 switch (standard)
63 {
65 return (os << "802.11a");
67 return (os << "802.11b");
69 return (os << "802.11g");
71 return (os << "802.11p");
73 return (os << "802.11n");
75 return (os << "802.11ac");
77 return (os << "802.11ad");
79 return (os << "802.11ax");
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 */
90extern const std::map<WifiStandard, std::list<WifiPhyBand>> wifiStandards;
91
92/**
93 * \ingroup wifi
94 * \brief Enumeration of frequency channel types
95 */
97{
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 */
111{
112 switch (standard)
113 {
118 default:
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 */
130inline uint16_t
132{
133 switch (standard)
134 {
136 return 22;
138 return 10;
140 return 80;
142 return 2160;
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 */
157inline WifiPhyBand
159{
160 switch (standard)
161 {
167 return WIFI_PHY_BAND_5GHZ;
169 return WIFI_PHY_BAND_60GHZ;
170 default:
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 */
182inline std::string
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 */
WifiStandard
Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
FrequencyChannelType
Enumeration of frequency channel types.
WifiPhyBand
Identifies the PHY band.
Definition: wifi-phy-band.h:33
@ WIFI_STANDARD_80211a
@ WIFI_STANDARD_80211ad
@ WIFI_STANDARD_COUNT
@ WIFI_STANDARD_80211p
@ WIFI_STANDARD_80211be
@ WIFI_STANDARD_80211n
@ WIFI_STANDARD_80211g
@ WIFI_STANDARD_80211ax
@ WIFI_STANDARD_UNSPECIFIED
@ WIFI_STANDARD_80211ac
@ WIFI_STANDARD_80211b
@ WIFI_PHY_80211p_CHANNEL
@ WIFI_PHY_OFDM_CHANNEL
@ WIFI_PHY_DSSS_CHANNEL
@ WIFI_PHY_BAND_2_4GHZ
The 2.4 GHz band.
Definition: wifi-phy-band.h:35
@ WIFI_PHY_BAND_60GHZ
The 60 GHz band.
Definition: wifi-phy-band.h:41
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
Definition: wifi-phy-band.h:37
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:159
std::string GetFrameExchangeManagerTypeIdName(WifiStandard standard, bool qosSupported)
Get the TypeId name for the FrameExchangeManager corresponding to the given standard.
WifiPhyBand GetDefaultPhyBand(WifiStandard standard)
Get the default PHY band for the given standard.
const std::map< WifiStandard, std::list< WifiPhyBand > > wifiStandards
map a given standard configured by the user to the allowed PHY bands
uint16_t GetDefaultChannelWidth(WifiStandard standard, WifiPhyBand band)
Get the default channel width for the given PHY standard and band.
FrequencyChannelType GetFrequencyChannelType(WifiStandard standard)
Get the type of the frequency channel for the given standard.