A Discrete-Event Network Simulator
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 
35 {
52 };
53 
61 inline std::ostream& operator<< (std::ostream& os, WifiPhyStandard standard)
62 {
63  switch (standard)
64  {
66  return (os << "802.11a");
68  return (os << "802.11b");
70  return (os << "802.11g");
72  return (os << "802.11p");
74  return (os << "802.11n");
76  return (os << "802.11ac");
78  return (os << "802.11ax");
80  default:
81  return (os << "UNSPECIFIED");
82  }
83 }
84 
90 {
95 };
96 
104 inline std::ostream& operator<< (std::ostream& os, WifiMacStandard standard)
105 {
106  switch (standard)
107  {
109  return (os << "802.11");
111  return (os << "802.11n");
113  return (os << "802.11ac");
115  return (os << "802.11ax");
116  default:
117  return (os << "UNSPECIFIED");
118  }
119 }
120 
126 {
137 };
138 
146 inline std::ostream& operator<< (std::ostream& os, WifiStandard standard)
147 {
148  switch (standard)
149  {
151  return (os << "802.11a");
153  return (os << "802.11b");
155  return (os << "802.11g");
157  return (os << "802.11p");
159  return (os << "802.11n-2.4GHz");
161  return (os << "802.11n-5GHz");
163  return (os << "802.11ac");
165  return (os << "802.11ax-2.4GHz");
167  return (os << "802.11ax-5GHz");
169  return (os << "802.11ax-6GHz");
170  default:
171  return (os << "UNSPECIFIED");
172  }
173 }
174 
179 {
183 };
184 
188 const std::map<WifiStandard, WifiStandardInfo> wifiStandards =
189 {
200 };
201 
206 enum FrequencyChannelType : uint8_t
207 {
211 };
212 
220 {
221  switch (standard)
222  {
224  return WIFI_PHY_DSSS_CHANNEL;
227  default:
228  return WIFI_PHY_OFDM_CHANNEL;
229  }
230 }
231 
238 inline uint16_t GetMaximumChannelWidth (WifiPhyStandard standard)
239 {
240  switch (standard)
241  {
243  return 22;
245  return 10;
248  return 20;
250  return 40;
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  {
272  return 22;
274  return 10;
276  return 80;
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