A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-phy-configuration.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016 Tom Henderson
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Tom Henderson <tomh@tomh.org>
7 */
8
9// This example shows (and tests) some possible configurations for
10// the Wi-Fi physical layer, particularly the interaction between
11// WifiHelper.SetStandard () and the physical layer channel number,
12// center frequency, and channel width.
13
14#include "ns3/boolean.h"
15#include "ns3/command-line.h"
16#include "ns3/config-store.h"
17#include "ns3/config.h"
18#include "ns3/log.h"
19#include "ns3/ssid.h"
20#include "ns3/string.h"
21#include "ns3/uinteger.h"
22#include "ns3/wifi-net-device.h"
23#include "ns3/yans-wifi-helper.h"
24#include "ns3/yans-wifi-phy.h"
25
26using namespace ns3;
27
28NS_LOG_COMPONENT_DEFINE("WifiPhyConfigurationExample");
29
30/**
31 * Get the Yans Wifi Phy Ptr object for the 1st node in the NodeContainer
32 *
33 * \param nc The node container.
34 * \return the Yans Wifi Phy Ptr object of the 1st node in the NodeContainer
35 */
38{
39 Ptr<WifiNetDevice> wnd = nc.Get(0)->GetObject<WifiNetDevice>();
40 Ptr<WifiPhy> wp = wnd->GetPhy();
41 return wp->GetObject<YansWifiPhy>();
42}
43
44/**
45 * Print the attributes to a file.
46 *
47 * \param enabled Enable printing.
48 */
49void
51{
52 if (enabled)
53 {
54 ConfigStore outputConfig;
55 outputConfig.ConfigureAttributes();
56 }
57}
58
59int
60main(int argc, char* argv[])
61{
62 uint32_t testCase = 0;
63 bool printAttributes = false;
64 bool exceptionThrown = false;
65
66 CommandLine cmd(__FILE__);
67 cmd.AddValue("testCase", "Test case", testCase);
68 cmd.AddValue("printAttributes", "If true, print out attributes", printAttributes);
69 cmd.Parse(argc, argv);
70
71 NodeContainer wifiStaNode;
72 wifiStaNode.Create(1);
74 wifiApNode.Create(1);
75
78 phy.SetChannel(channel.Create());
80 wifi.SetRemoteStationManager("ns3::IdealWifiManager");
81
82 // Configure and declare other generic components of this example
83 Ssid ssid;
84 ssid = Ssid("wifi-phy-configuration");
85 WifiMacHelper macSta;
86 macSta.SetType("ns3::StaWifiMac",
87 "Ssid",
88 SsidValue(ssid),
89 "ActiveProbing",
90 BooleanValue(false));
91 WifiMacHelper macAp;
92 macAp.SetType("ns3::ApWifiMac",
93 "Ssid",
94 SsidValue(ssid),
95 "BeaconInterval",
96 TimeValue(MicroSeconds(102400)),
97 "BeaconGeneration",
98 BooleanValue(true));
99 NetDeviceContainer staDevice;
100 NetDeviceContainer apDevice;
101 Ptr<YansWifiPhy> phySta;
102 Config::SetDefault("ns3::ConfigStore::Filename",
103 StringValue("output-attributes-" + std::to_string(testCase) + ".txt"));
104 Config::SetDefault("ns3::ConfigStore::FileFormat", StringValue("RawText"));
105 Config::SetDefault("ns3::ConfigStore::Mode", StringValue("Save"));
106
107 switch (testCase)
108 {
109 case 0:
110 // Default configuration, without WifiHelper::SetStandard or WifiHelper
111 phySta = CreateObject<YansWifiPhy>();
112 // The default results in an invalid configuration
113 NS_ASSERT(!phySta->GetOperatingChannel().IsSet());
114 PrintAttributesIfEnabled(printAttributes);
115 break;
116
117 // The following cases test the setting of WifiPhyStandard alone;
118 // i.e. without further channel number/width/frequency configuration
119
120 case 1:
121 wifi.SetStandard(WIFI_STANDARD_80211a);
122 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
123 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
124 phySta = GetYansWifiPhyPtr(staDevice);
125 // We expect channel 36, width 20, frequency 5180
126 NS_ASSERT(phySta->GetChannelNumber() == 36);
127 NS_ASSERT(phySta->GetChannelWidth() == 20);
128 NS_ASSERT(phySta->GetFrequency() == 5180);
129 PrintAttributesIfEnabled(printAttributes);
130 break;
131 case 2:
132 wifi.SetStandard(WIFI_STANDARD_80211b);
133 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
134 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
135 phySta = GetYansWifiPhyPtr(staDevice);
136 // We expect channel 1, width 22, frequency 2412
137 NS_ASSERT(phySta->GetChannelNumber() == 1);
138 NS_ASSERT(phySta->GetChannelWidth() == 22);
139 NS_ASSERT(phySta->GetFrequency() == 2412);
140 PrintAttributesIfEnabled(printAttributes);
141 break;
142 case 3:
143 wifi.SetStandard(WIFI_STANDARD_80211g);
144 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
145 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
146 phySta = GetYansWifiPhyPtr(staDevice);
147 // We expect channel 1, width 20, frequency 2412
148 NS_ASSERT(phySta->GetChannelNumber() == 1);
149 NS_ASSERT(phySta->GetChannelWidth() == 20);
150 NS_ASSERT(phySta->GetFrequency() == 2412);
151 PrintAttributesIfEnabled(printAttributes);
152 break;
153 case 4:
154 wifi.SetStandard(WIFI_STANDARD_80211n);
155 phy.Set("ChannelSettings", StringValue("{0, 0, BAND_5GHZ, 0}"));
156 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
157 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
158 phySta = GetYansWifiPhyPtr(staDevice);
159 // We expect channel 36, width 20, frequency 5180
160 NS_ASSERT(phySta->GetChannelNumber() == 36);
161 NS_ASSERT(phySta->GetChannelWidth() == 20);
162 NS_ASSERT(phySta->GetFrequency() == 5180);
163 PrintAttributesIfEnabled(printAttributes);
164 break;
165 case 5:
166 wifi.SetStandard(WIFI_STANDARD_80211n);
167 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
168 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
169 phySta = GetYansWifiPhyPtr(staDevice);
170 // We expect channel 1, width 20, frequency 2412
171 NS_ASSERT(phySta->GetChannelNumber() == 1);
172 NS_ASSERT(phySta->GetChannelWidth() == 20);
173 NS_ASSERT(phySta->GetFrequency() == 2412);
174 PrintAttributesIfEnabled(printAttributes);
175 break;
176 case 6:
177 wifi.SetStandard(WIFI_STANDARD_80211ac);
178 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
179 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
180 phySta = GetYansWifiPhyPtr(staDevice);
181 // We expect channel 42, width 80, frequency 5210
182 NS_ASSERT(phySta->GetChannelNumber() == 42);
183 NS_ASSERT(phySta->GetChannelWidth() == 80);
184 NS_ASSERT(phySta->GetFrequency() == 5210);
185 PrintAttributesIfEnabled(printAttributes);
186 break;
187 case 7:
188 // By default, WifiHelper will use WIFI_STANDARD_80211ax
189 wifi.SetStandard(WIFI_STANDARD_80211ax);
190 phy.Set("ChannelSettings", StringValue("{0, 0, BAND_2_4GHZ, 0}"));
191 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
192 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
193 phySta = GetYansWifiPhyPtr(staDevice);
194 // We expect channel 1, width 20, frequency 2412
195 NS_ASSERT(phySta->GetChannelNumber() == 1);
196 NS_ASSERT(phySta->GetChannelWidth() == 20);
197 NS_ASSERT(phySta->GetFrequency() == 2412);
198 PrintAttributesIfEnabled(printAttributes);
199 break;
200 case 8:
201 wifi.SetStandard(WIFI_STANDARD_80211ax);
202 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
203 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
204 phySta = GetYansWifiPhyPtr(staDevice);
205 // We expect channel 42, width 80, frequency 5210
206 NS_ASSERT(phySta->GetChannelNumber() == 42);
207 NS_ASSERT(phySta->GetChannelWidth() == 80);
208 NS_ASSERT(phySta->GetFrequency() == 5210);
209 PrintAttributesIfEnabled(printAttributes);
210 break;
211 case 9:
212 wifi.SetStandard(WIFI_STANDARD_80211ax);
213 phy.Set("ChannelSettings", StringValue("{0, 0, BAND_6GHZ, 0}"));
214 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
215 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
216 phySta = GetYansWifiPhyPtr(staDevice);
217 // We expect channel 7, width 80, frequency 5985
218 NS_ASSERT(phySta->GetChannelNumber() == 7);
219 NS_ASSERT(phySta->GetChannelWidth() == 80);
220 NS_ASSERT(phySta->GetFrequency() == 5985);
221 PrintAttributesIfEnabled(printAttributes);
222 break;
223 case 10:
224 wifi.SetStandard(WIFI_STANDARD_80211p);
225 phy.Set("ChannelSettings", StringValue("{0, 10, BAND_5GHZ, 0}"));
226 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
227 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
228 phySta = GetYansWifiPhyPtr(staDevice);
229 // We expect channel 172, width 10, frequency 5860
230 NS_ASSERT(phySta->GetChannelNumber() == 172);
231 NS_ASSERT(phySta->GetChannelWidth() == 10);
232 NS_ASSERT(phySta->GetFrequency() == 5860);
233 PrintAttributesIfEnabled(printAttributes);
234 break;
235 case 11:
236 wifi.SetStandard(WIFI_STANDARD_80211p);
237 phy.Set("ChannelSettings", StringValue("{0, 5, BAND_5GHZ, 0}"));
238 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
239 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
240 phySta = GetYansWifiPhyPtr(staDevice);
241 // We expect channel 171, width 5, frequency 5860
242 NS_ASSERT(phySta->GetChannelNumber() == 171);
243 NS_ASSERT(phySta->GetChannelWidth() == 5);
244 NS_ASSERT(phySta->GetFrequency() == 5860);
245 PrintAttributesIfEnabled(printAttributes);
246 break;
247 case 12:
248 wifi.SetStandard(WIFI_STANDARD_80211n);
249 phy.Set("ChannelSettings", StringValue("{44, 20, BAND_5GHZ, 0}"));
250 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
251 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
252 phySta = GetYansWifiPhyPtr(staDevice);
253 // We expect channel 44, width 20, frequency 5220
254 NS_ASSERT(phySta->GetChannelNumber() == 44);
255 NS_ASSERT(phySta->GetChannelWidth() == 20);
256 NS_ASSERT(phySta->GetFrequency() == 5220);
257 PrintAttributesIfEnabled(printAttributes);
258 break;
259 case 13:
260 wifi.SetStandard(WIFI_STANDARD_80211n);
261 phy.Set("ChannelSettings", StringValue("{44, 0, BAND_5GHZ, 0}"));
262 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
263 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
264 phySta = GetYansWifiPhyPtr(staDevice);
265 // Post-install reconfiguration to channel number 40
267 "/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelSettings",
268 StringValue("{40, 0, BAND_5GHZ, 0}"));
270 "/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelSettings",
271 StringValue("{40, 0, BAND_5GHZ, 0}"));
272 // We expect channel 40, width 20, frequency 5200
273 NS_ASSERT(phySta->GetChannelNumber() == 40);
274 NS_ASSERT(phySta->GetChannelWidth() == 20);
275 NS_ASSERT(phySta->GetFrequency() == 5200);
276 PrintAttributesIfEnabled(printAttributes);
277 break;
278 case 14:
279 wifi.SetStandard(WIFI_STANDARD_80211n);
280 phy.Set("ChannelSettings", StringValue("{44, 0, BAND_5GHZ, 0}"));
281 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
282 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
283 phySta = GetYansWifiPhyPtr(staDevice);
284 // Post-install reconfiguration to a 40 MHz channel
286 "/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelSettings",
287 StringValue("{46, 0, BAND_5GHZ, 0}"));
289 "/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelSettings",
290 StringValue("{46, 0, BAND_5GHZ, 0}"));
291 NS_ASSERT(phySta->GetChannelNumber() == 46);
292 NS_ASSERT(phySta->GetChannelWidth() == 40);
293 NS_ASSERT(phySta->GetFrequency() == 5230);
294 PrintAttributesIfEnabled(printAttributes);
295 break;
296 case 15:
297 Config::SetDefault("ns3::WifiPhy::ChannelSettings", StringValue("{44, 0, BAND_5GHZ, 0}"));
298 wifi.SetStandard(WIFI_STANDARD_80211n);
299 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
300 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
301 phySta = GetYansWifiPhyPtr(staDevice);
302 // Post-install reconfiguration to a 40 MHz channel
304 "/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelSettings",
305 StringValue("{46, 0, BAND_5GHZ, 0}"));
307 "/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelSettings",
308 StringValue("{46, 0, BAND_5GHZ, 0}"));
309 NS_ASSERT(phySta->GetChannelNumber() == 46);
310 NS_ASSERT(phySta->GetChannelWidth() == 40);
311 NS_ASSERT(phySta->GetFrequency() == 5230);
312 PrintAttributesIfEnabled(printAttributes);
313 break;
314 case 16:
315 // Test that setting channel number to a non-standard value will throw an exception
316 Config::SetDefault("ns3::WifiPhy::ChannelSettings", StringValue("{45, 0, BAND_5GHZ, 0}"));
317 wifi.SetStandard(WIFI_STANDARD_80211n);
318 exceptionThrown = false;
319 try
320 {
321 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
322 }
323 catch (const std::runtime_error&)
324 {
325 exceptionThrown = true;
326 }
327 NS_ASSERT(exceptionThrown);
328 exceptionThrown = false;
329 try
330 {
331 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
332 }
333 catch (const std::runtime_error&)
334 {
335 exceptionThrown = true;
336 }
337 NS_ASSERT(exceptionThrown);
338 PrintAttributesIfEnabled(printAttributes);
339 break;
340 case 17:
341 // Test that setting Frequency to a standard value will set the
342 // channel number correctly
343 Config::SetDefault("ns3::WifiPhy::ChannelSettings", StringValue("{100, 0, BAND_5GHZ, 0}"));
344 wifi.SetStandard(WIFI_STANDARD_80211n);
345 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
346 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
347 phySta = GetYansWifiPhyPtr(staDevice);
348 // We expect channel number to be 100 due to frequency 5500
349 NS_ASSERT(phySta->GetChannelNumber() == 100);
350 NS_ASSERT(phySta->GetChannelWidth() == 20);
351 NS_ASSERT(phySta->GetFrequency() == 5500);
352 PrintAttributesIfEnabled(printAttributes);
353 break;
354 case 18:
355 // Set a wrong channel after initialization
356 wifi.SetStandard(WIFI_STANDARD_80211n);
357 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
358 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
359 phySta = GetYansWifiPhyPtr(staDevice);
360 exceptionThrown = false;
361 try
362 {
363 phySta->SetOperatingChannel(WifiPhy::ChannelTuple{99, 40, WIFI_PHY_BAND_5GHZ, 0});
364 }
365 catch (const std::runtime_error&)
366 {
367 exceptionThrown = true;
368 }
369 NS_ASSERT(exceptionThrown);
370 PrintAttributesIfEnabled(printAttributes);
371 break;
372 case 19:
373 // Test how channel number behaves when frequency is non-standard
374 wifi.SetStandard(WIFI_STANDARD_80211n);
375 phy.Set("ChannelSettings", StringValue("{44, 0, BAND_5GHZ, 0}"));
376 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
377 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
378 phySta = GetYansWifiPhyPtr(staDevice);
379 exceptionThrown = false;
380 try
381 {
382 phySta->SetAttribute("ChannelSettings", StringValue("{45, 0, BAND_5GHZ, 0}"));
383 }
384 catch (const std::runtime_error&)
385 {
386 exceptionThrown = true;
387 }
388 // We expect that an exception is thrown due to unknown channel number 45
389 NS_ASSERT(exceptionThrown);
390 phySta->SetAttribute("ChannelSettings", StringValue("{36, 0, BAND_5GHZ, 0}"));
391 // We expect channel number to be 36 due to known center frequency 5180
392 NS_ASSERT(phySta->GetChannelNumber() == 36);
393 NS_ASSERT(phySta->GetChannelWidth() == 20);
394 NS_ASSERT(phySta->GetFrequency() == 5180);
395 exceptionThrown = false;
396 try
397 {
398 phySta->SetAttribute("ChannelSettings", StringValue("{43, 0, BAND_5GHZ, 0}"));
399 }
400 catch (const std::runtime_error&)
401 {
402 exceptionThrown = true;
403 }
404 // We expect that an exception is thrown due to unknown channel number 43
405 NS_ASSERT(exceptionThrown);
406 phySta->SetAttribute("ChannelSettings", StringValue("{36, 0, BAND_5GHZ, 0}"));
407 NS_ASSERT(phySta->GetChannelNumber() == 36);
408 NS_ASSERT(phySta->GetChannelWidth() == 20);
409 NS_ASSERT(phySta->GetFrequency() == 5180);
410 PrintAttributesIfEnabled(printAttributes);
411 break;
412 case 20:
413 // Set both channel and frequency to consistent values before initialization
414 Config::SetDefault("ns3::WifiPhy::ChannelSettings", StringValue("{40, 0, BAND_5GHZ, 0}"));
415 wifi.SetStandard(WIFI_STANDARD_80211n);
416 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
417 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
418 phySta = GetYansWifiPhyPtr(staDevice);
419 NS_ASSERT(phySta->GetChannelNumber() == 40);
420 NS_ASSERT(phySta->GetChannelWidth() == 20);
421 NS_ASSERT(phySta->GetFrequency() == 5200);
422 // Set both channel and frequency to consistent values after initialization
423 wifi.SetStandard(WIFI_STANDARD_80211n);
424 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
425 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
426 phySta = GetYansWifiPhyPtr(staDevice);
427 phySta->SetAttribute("ChannelSettings", StringValue("{40, 0, BAND_5GHZ, 0}"));
428 NS_ASSERT(phySta->GetChannelNumber() == 40);
429 NS_ASSERT(phySta->GetChannelWidth() == 20);
430 NS_ASSERT(phySta->GetFrequency() == 5200);
431 exceptionThrown = false;
432 try
433 {
434 phySta->SetAttribute("ChannelSettings", StringValue("{45, 0, BAND_5GHZ, 0}"));
435 }
436 catch (const std::runtime_error&)
437 {
438 exceptionThrown = true;
439 }
440 phySta->SetAttribute("ChannelSettings", StringValue("{36, 0, BAND_5GHZ, 0}"));
441 // We expect channel number to be 36 and an exception to be thrown
442 NS_ASSERT(phySta->GetChannelNumber() == 36);
443 NS_ASSERT(phySta->GetChannelWidth() == 20);
444 NS_ASSERT(phySta->GetFrequency() == 5180);
445 NS_ASSERT(exceptionThrown);
446 exceptionThrown = false;
447 try
448 {
449 phySta->SetAttribute("ChannelSettings", StringValue("{43, 0, BAND_5GHZ, 0}"));
450 }
451 catch (const std::runtime_error&)
452 {
453 exceptionThrown = true;
454 }
455 phySta->SetAttribute("ChannelSettings", StringValue("{36, 0, BAND_5GHZ, 0}"));
456 // We expect channel number to be 36 and an exception to be thrown
457 NS_ASSERT(phySta->GetChannelNumber() == 36);
458 NS_ASSERT(phySta->GetChannelWidth() == 20);
459 NS_ASSERT(phySta->GetFrequency() == 5180);
460 NS_ASSERT(exceptionThrown);
461 PrintAttributesIfEnabled(printAttributes);
462 break;
463 default:
464 std::cerr << "Invalid testcase number " << testCase << std::endl;
465 exit(1);
466 break;
467 }
468
469 // No need to Simulator::Run (); this is a configuration example
471
472 return 0;
473}
AttributeValue implementation for Boolean.
Definition boolean.h:26
Parse command-line arguments.
Introspection did not find any typical Config paths.
void ConfigureAttributes()
Configure the attribute values.
holds a vector of ns3::NetDevice pointers
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
keep track of a set of node pointers.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
Smart pointer class similar to boost::intrusive_ptr.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
Definition simulator.cc:131
The IEEE 802.11 SSID Information Element.
Definition ssid.h:25
AttributeValue implementation for Ssid.
Definition ssid.h:85
Hold variables of type string.
Definition string.h:45
AttributeValue implementation for Time.
Definition nstime.h:1395
helps to create WifiNetDevice objects
create MAC layers for a ns3::WifiNetDevice.
void SetType(std::string type, Args &&... args)
Hold together all Wifi-related objects.
std::tuple< uint8_t, MHz_u, WifiPhyBand, uint8_t > ChannelTuple
Tuple identifying a segment of an operating channel.
Definition wifi-phy.h:919
manage and create wifi channel objects for the YANS model.
static YansWifiChannelHelper Default()
Create a channel helper in a default working state.
Make it easy to create and manage PHY objects for the YANS model.
802.11 PHY layer model
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition assert.h:55
void SetDefault(std::string name, const AttributeValue &value)
Definition config.cc:883
void Set(std::string path, const AttributeValue &value)
Definition config.cc:869
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition object.h:619
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1332
@ WIFI_STANDARD_80211a
@ WIFI_STANDARD_80211p
@ WIFI_STANDARD_80211n
@ WIFI_STANDARD_80211g
@ WIFI_STANDARD_80211ax
@ WIFI_STANDARD_80211ac
@ WIFI_STANDARD_80211b
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ssid
Definition third.py:82
channel
Definition third.py:77
wifi
Definition third.py:84
wifiApNode
Definition third.py:75
phy
Definition third.py:78
void PrintAttributesIfEnabled(bool enabled)
Print the attributes to a file.
Ptr< YansWifiPhy > GetYansWifiPhyPtr(const NetDeviceContainer &nc)
Get the Yans Wifi Phy Ptr object for the 1st node in the NodeContainer.