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 */
ERP-OFDM PHY (Clause 19, Section 19.5)
#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.
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