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-units.h"
14
15#include "ns3/abort.h"
16#include "ns3/wifi-export.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 */
81WIFI_EXPORT extern const std::map<WifiStandard, std::list<WifiPhyBand>> wifiStandards;
82
83/**
84 * @ingroup wifi
85 * @brief Enumeration of frequency channel types
86 */
87enum class FrequencyChannelType : uint8_t
88{
89 DSSS = 0,
92};
93
94/**
95 * Get the type of the frequency channel for the given standard
96 *
97 * @param standard the standard
98 * @return the type of the frequency channel for the given standard
99 */
100inline FrequencyChannelType
102{
103 switch (standard)
104 {
109 default:
111 }
112}
113
114/**
115 * Get the default channel width for the given PHY standard and band.
116 *
117 * @param standard the given standard
118 * @param band the given PHY band
119 * @return the default channel width for the given standard
120 */
121inline MHz_u
123{
124 switch (standard)
125 {
127 return MHz_u{22};
129 return MHz_u{10};
131 return MHz_u{80};
133 return MHz_u{2160};
136 return (band == WIFI_PHY_BAND_2_4GHZ ? MHz_u{20} : MHz_u{80});
137 default:
138 return MHz_u{20};
139 }
140}
141
142/**
143 * Get the default PHY band for the given standard.
144 *
145 * @param standard the given standard
146 * @return the default PHY band for the given standard
147 */
148inline WifiPhyBand
150{
151 switch (standard)
152 {
158 return WIFI_PHY_BAND_5GHZ;
160 return WIFI_PHY_BAND_60GHZ;
161 default:
163 }
164}
165
166/**
167 * Get the TypeId name for the FrameExchangeManager corresponding to the given standard.
168 *
169 * @param standard the given standard
170 * @param qosSupported whether QoS is supported (ignored if standard is at least HT)
171 * @return the TypeId name for the FrameExchangeManager corresponding to the given standard
172 */
173inline std::string
175{
176 if (standard >= WIFI_STANDARD_80211be)
177 {
178 return "ns3::EhtFrameExchangeManager";
179 }
180 if (standard >= WIFI_STANDARD_80211ax)
181 {
182 return "ns3::HeFrameExchangeManager";
183 }
184 if (standard >= WIFI_STANDARD_80211ac)
185 {
186 return "ns3::VhtFrameExchangeManager";
187 }
188 if (standard >= WIFI_STANDARD_80211n)
189 {
190 return "ns3::HtFrameExchangeManager";
191 }
192 if (qosSupported)
193 {
194 return "ns3::QosFrameExchangeManager";
195 }
196 return "ns3::FrameExchangeManager";
197}
198
199} // namespace ns3
200
201#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.
@ 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.