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 * 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
21namespace ns3
22{
23
24/**
25 * \ingroup wifi
26 * Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
27 */
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 */
50inline std::ostream&
51operator<<(std::ostream& os, WifiStandard standard)
52{
53 switch (standard)
54 {
56 return (os << "802.11a");
58 return (os << "802.11b");
60 return (os << "802.11g");
62 return (os << "802.11p");
64 return (os << "802.11n");
66 return (os << "802.11ac");
68 return (os << "802.11ad");
70 return (os << "802.11ax");
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 */
81extern 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 */
89inline FrequencyChannelType
91{
92 switch (standard)
93 {
98 default:
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 */
110inline MHz_u
112{
113 switch (standard)
114 {
116 return 22;
118 return 10;
120 return 80;
122 return 2160;
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 */
137inline WifiPhyBand
139{
140 switch (standard)
141 {
147 return WIFI_PHY_BAND_5GHZ;
149 return WIFI_PHY_BAND_60GHZ;
150 default:
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 */
162inline std::string
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 */
WifiStandard
Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
WifiPhyBand
Identifies the PHY band.
@ 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_BAND_2_4GHZ
The 2.4 GHz band.
@ WIFI_PHY_BAND_60GHZ
The 60 GHz band.
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
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:148
std::string GetFrameExchangeManagerTypeIdName(WifiStandard standard, bool qosSupported)
Get the TypeId name for the FrameExchangeManager corresponding to the given standard.
double MHz_u
MHz weak type.
Definition wifi-units.h:31
MHz_u GetDefaultChannelWidth(WifiStandard standard, WifiPhyBand band)
Get the default channel width for the given PHY standard and band.
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
FrequencyChannelType GetFrequencyChannelType(WifiStandard standard)
Get the type of the frequency channel for the given standard.
Declaration of the SI units (as weak types aliases) used across wifi module.