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 {
64 };
65 
73 inline std::ostream& operator<< (std::ostream& os, WifiPhyStandard standard)
74 {
75  switch (standard)
76  {
78  return (os << "802.11a");
80  return (os << "802.11b");
82  return (os << "802.11g");
84  return (os << "802.11p");
86  return (os << "802.11n");
88  return (os << "802.11ac");
90  return (os << "802.11ax");
92  default:
93  return (os << "UNSPECIFIED");
94  }
95 }
96 
102 {
107 };
108 
116 inline std::ostream& operator<< (std::ostream& os, WifiMacStandard standard)
117 {
118  switch (standard)
119  {
121  return (os << "802.11");
123  return (os << "802.11n");
125  return (os << "802.11ac");
127  return (os << "802.11ax");
128  default:
129  return (os << "UNSPECIFIED");
130  }
131 }
132 
138 {
149 };
150 
158 inline std::ostream& operator<< (std::ostream& os, WifiStandard standard)
159 {
160  switch (standard)
161  {
163  return (os << "802.11a");
165  return (os << "802.11b");
167  return (os << "802.11g");
169  return (os << "802.11p");
171  return (os << "802.11n-2.4GHz");
173  return (os << "802.11n-5GHz");
175  return (os << "802.11ac");
177  return (os << "802.11ax-2.4GHz");
179  return (os << "802.11ax-5GHz");
181  return (os << "802.11ax-6GHz");
182  default:
183  return (os << "UNSPECIFIED");
184  }
185 }
186 
191 {
195 };
196 
200 const std::map<WifiStandard, WifiStandardInfo> wifiStandards =
201 {
212 };
213 
218 enum FrequencyChannelType : uint8_t
219 {
223 };
224 
232 {
233  switch (standard)
234  {
236  return WIFI_PHY_DSSS_CHANNEL;
239  default:
240  return WIFI_PHY_OFDM_CHANNEL;
241  }
242 }
243 
250 inline uint16_t GetMaximumChannelWidth (WifiPhyStandard standard)
251 {
252  switch (standard)
253  {
255  return 22;
257  return 10;
260  return 20;
262  return 40;
265  return 160;
266  default:
267  NS_ABORT_MSG ("Unknown standard: " << standard);
268  return 0;
269  }
270 }
271 
279 inline uint16_t GetDefaultChannelWidth (WifiPhyStandard standard, WifiPhyBand band)
280 {
281  switch (standard)
282  {
284  return 22;
286  return 10;
288  return 80;
290  return (band == WIFI_PHY_BAND_2_4GHZ ? 20 : 80);
291  default:
292  return 20;
293  }
294 }
295 
296 } //namespace ns3
297 
298 #endif /* WIFI_STANDARD_H */
ERP-OFDM PHY (Clause 19, Section 19.5)
OFDM PHY for the 5 GHz band (Clause 17 with 5 MHz channel bandwidth)
HT PHY for the 5 GHz band (clause 20)
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
Definition: abort.h:50
uint16_t GetMaximumChannelWidth(WifiPhyStandard standard)
Get the maximum channel width in MHz allowed for the given PHY standard.
OFDM PHY for the 5 GHz band (Clause 17 with 10 MHz channel bandwidth)
HT PHY for the 2.4 GHz band (clause 20)
The 5 GHz band.
Definition: wifi-phy-band.h:37
WifiPhyStandard phyStandard
the PHY standard
const std::map< WifiStandard, WifiStandardInfo > wifiStandards
map a given standard configured by the user to the corresponding WifiStandardInfo ...
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:137
WifiPhyStandard
Identifies the PHY specification that a Wifi device is configured to use.
FrequencyChannelType
Enumeration of frequency channel types.
WifiPhyBand phyBand
the PHY band
OFDM PHY (Clause 17 - amendment for 10 MHz and 5 MHz channels)
WifiMacStandard
Identifies the MAC specification that a Wifi device is configured to use.
OFDM PHY (Clause 17)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
WifiStandard
Identifies the allowed configurations that a Wifi device is configured to use.
DSSS PHY (Clause 15) and HR/DSSS PHY (Clause 18)
The 2.4 GHz band.
Definition: wifi-phy-band.h:35
hold PHY and MAC information based on the selected standard.
WifiMacStandard macStandard
the MAC standard
WifiPhyBand
Identifies the PHY band.
Definition: wifi-phy-band.h:32
uint16_t GetDefaultChannelWidth(WifiPhyStandard standard, WifiPhyBand band)
Get the default channel width for the given PHY standard and band.
FrequencyChannelType GetFrequencyChannelType(WifiPhyStandard standard)
Get the type of the frequency channel for the given PHY standard.
The 6 GHz band.
Definition: wifi-phy-band.h:39