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/wifi-ns3-constants.h"
24#include "ns3/yans-wifi-helper.h"
25#include "ns3/yans-wifi-phy.h"
26
27using namespace ns3;
28
29NS_LOG_COMPONENT_DEFINE("WifiPhyConfigurationExample");
30
31/**
32 * Get the Yans Wifi Phy Ptr object for the 1st node in the NodeContainer
33 *
34 * @param nc The node container.
35 * @return the Yans Wifi Phy Ptr object of the 1st node in the NodeContainer
36 */
39{
40 Ptr<WifiNetDevice> wnd = nc.Get(0)->GetObject<WifiNetDevice>();
41 Ptr<WifiPhy> wp = wnd->GetPhy();
42 return wp->GetObject<YansWifiPhy>();
43}
44
45/**
46 * Print the attributes to a file.
47 *
48 * @param enabled Enable printing.
49 */
50void
52{
53 if (enabled)
54 {
55 ConfigStore outputConfig;
56 outputConfig.ConfigureAttributes();
57 }
58}
59
60int
61main(int argc, char* argv[])
62{
63 uint32_t testCase = 0;
64 bool printAttributes = false;
65 bool exceptionThrown = false;
66
67 CommandLine cmd(__FILE__);
68 cmd.AddValue("testCase", "Test case", testCase);
69 cmd.AddValue("printAttributes", "If true, print out attributes", printAttributes);
70 cmd.Parse(argc, argv);
71
72 NodeContainer wifiStaNode;
73 wifiStaNode.Create(1);
75 wifiApNode.Create(1);
76
79 phy.SetChannel(channel.Create());
81 wifi.SetRemoteStationManager("ns3::IdealWifiManager");
82
83 // Configure and declare other generic components of this example
84 Ssid ssid;
85 ssid = Ssid("wifi-phy-configuration");
86 WifiMacHelper macSta;
87 macSta.SetType("ns3::StaWifiMac",
88 "Ssid",
89 SsidValue(ssid),
90 "ActiveProbing",
91 BooleanValue(false));
92 WifiMacHelper macAp;
93 macAp.SetType("ns3::ApWifiMac",
94 "Ssid",
95 SsidValue(ssid),
96 "BeaconInterval",
98 "BeaconGeneration",
99 BooleanValue(true));
100 NetDeviceContainer staDevice;
101 NetDeviceContainer apDevice;
102 Ptr<YansWifiPhy> phySta;
103 Config::SetDefault("ns3::ConfigStore::Filename",
104 StringValue("output-attributes-" + std::to_string(testCase) + ".txt"));
105 Config::SetDefault("ns3::ConfigStore::FileFormat", StringValue("RawText"));
106 Config::SetDefault("ns3::ConfigStore::Mode", StringValue("Save"));
107
108 switch (testCase)
109 {
110 case 0:
111 // Default configuration, without WifiHelper::SetStandard or WifiHelper
112 phySta = CreateObject<YansWifiPhy>();
113 // The default results in an invalid configuration
114 NS_ASSERT(!phySta->GetOperatingChannel().IsSet());
115 PrintAttributesIfEnabled(printAttributes);
116 break;
117
118 // The following cases test the setting of WifiPhyStandard alone;
119 // i.e. without further channel number/width/frequency configuration
120
121 case 1:
122 wifi.SetStandard(WIFI_STANDARD_80211a);
123 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
124 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
125 phySta = GetYansWifiPhyPtr(staDevice);
126 // We expect channel 36, width 20, frequency 5180
127 NS_ASSERT(phySta->GetChannelNumber() == 36);
128 NS_ASSERT(phySta->GetChannelWidth() == MHz_u{20});
129 NS_ASSERT(phySta->GetFrequency() == MHz_u{5180});
130 PrintAttributesIfEnabled(printAttributes);
131 break;
132 case 2:
133 wifi.SetStandard(WIFI_STANDARD_80211b);
134 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
135 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
136 phySta = GetYansWifiPhyPtr(staDevice);
137 // We expect channel 1, width 22, frequency 2412
138 NS_ASSERT(phySta->GetChannelNumber() == 1);
139 NS_ASSERT(phySta->GetChannelWidth() == MHz_u{22});
140 NS_ASSERT(phySta->GetFrequency() == MHz_u{2412});
141 PrintAttributesIfEnabled(printAttributes);
142 break;
143 case 3:
144 wifi.SetStandard(WIFI_STANDARD_80211g);
145 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
146 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
147 phySta = GetYansWifiPhyPtr(staDevice);
148 // We expect channel 1, width 20, frequency 2412
149 NS_ASSERT(phySta->GetChannelNumber() == 1);
150 NS_ASSERT(phySta->GetChannelWidth() == MHz_u{20});
151 NS_ASSERT(phySta->GetFrequency() == MHz_u{2412});
152 PrintAttributesIfEnabled(printAttributes);
153 break;
154 case 4:
155 wifi.SetStandard(WIFI_STANDARD_80211n);
156 phy.Set("ChannelSettings", StringValue("{0, 0, BAND_5GHZ, 0}"));
157 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
158 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
159 phySta = GetYansWifiPhyPtr(staDevice);
160 // We expect channel 36, width 20, frequency 5180
161 NS_ASSERT(phySta->GetChannelNumber() == 36);
162 NS_ASSERT(phySta->GetChannelWidth() == MHz_u{20});
163 NS_ASSERT(phySta->GetFrequency() == MHz_u{5180});
164 PrintAttributesIfEnabled(printAttributes);
165 break;
166 case 5:
167 wifi.SetStandard(WIFI_STANDARD_80211n);
168 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
169 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
170 phySta = GetYansWifiPhyPtr(staDevice);
171 // We expect channel 1, width 20, frequency 2412
172 NS_ASSERT(phySta->GetChannelNumber() == 1);
173 NS_ASSERT(phySta->GetChannelWidth() == MHz_u{20});
174 NS_ASSERT(phySta->GetFrequency() == MHz_u{2412});
175 PrintAttributesIfEnabled(printAttributes);
176 break;
177 case 6:
178 wifi.SetStandard(WIFI_STANDARD_80211ac);
179 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
180 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
181 phySta = GetYansWifiPhyPtr(staDevice);
182 // We expect channel 42, width 80, frequency 5210
183 NS_ASSERT(phySta->GetChannelNumber() == 42);
184 NS_ASSERT(phySta->GetChannelWidth() == MHz_u{80});
185 NS_ASSERT(phySta->GetFrequency() == MHz_u{5210});
186 PrintAttributesIfEnabled(printAttributes);
187 break;
188 case 7:
189 // By default, WifiHelper will use WIFI_STANDARD_80211ax
190 wifi.SetStandard(WIFI_STANDARD_80211ax);
191 phy.Set("ChannelSettings", StringValue("{0, 0, BAND_2_4GHZ, 0}"));
192 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
193 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
194 phySta = GetYansWifiPhyPtr(staDevice);
195 // We expect channel 1, width 20, frequency 2412
196 NS_ASSERT(phySta->GetChannelNumber() == 1);
197 NS_ASSERT(phySta->GetChannelWidth() == MHz_u{20});
198 NS_ASSERT(phySta->GetFrequency() == MHz_u{2412});
199 PrintAttributesIfEnabled(printAttributes);
200 break;
201 case 8:
202 wifi.SetStandard(WIFI_STANDARD_80211ax);
203 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
204 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
205 phySta = GetYansWifiPhyPtr(staDevice);
206 // We expect channel 42, width 80, frequency 5210
207 NS_ASSERT(phySta->GetChannelNumber() == 42);
208 NS_ASSERT(phySta->GetChannelWidth() == MHz_u{80});
209 NS_ASSERT(phySta->GetFrequency() == MHz_u{5210});
210 PrintAttributesIfEnabled(printAttributes);
211 break;
212 case 9:
213 wifi.SetStandard(WIFI_STANDARD_80211ax);
214 phy.Set("ChannelSettings", StringValue("{0, 0, BAND_6GHZ, 0}"));
215 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
216 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
217 phySta = GetYansWifiPhyPtr(staDevice);
218 // We expect channel 7, width 80, frequency 5985
219 NS_ASSERT(phySta->GetChannelNumber() == 7);
220 NS_ASSERT(phySta->GetChannelWidth() == MHz_u{80});
221 NS_ASSERT(phySta->GetFrequency() == MHz_u{5985});
222 PrintAttributesIfEnabled(printAttributes);
223 break;
224 case 10:
225 wifi.SetStandard(WIFI_STANDARD_80211p);
226 phy.Set("ChannelSettings", StringValue("{0, 10, BAND_5GHZ, 0}"));
227 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
228 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
229 phySta = GetYansWifiPhyPtr(staDevice);
230 // We expect channel 172, width 10, frequency 5860
231 NS_ASSERT(phySta->GetChannelNumber() == 172);
232 NS_ASSERT(phySta->GetChannelWidth() == MHz_u{10});
233 NS_ASSERT(phySta->GetFrequency() == MHz_u{5860});
234 PrintAttributesIfEnabled(printAttributes);
235 break;
236 case 11:
237 wifi.SetStandard(WIFI_STANDARD_80211p);
238 phy.Set("ChannelSettings", StringValue("{0, 5, BAND_5GHZ, 0}"));
239 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
240 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
241 phySta = GetYansWifiPhyPtr(staDevice);
242 // We expect channel 171, width 5, frequency 5860
243 NS_ASSERT(phySta->GetChannelNumber() == 171);
244 NS_ASSERT(phySta->GetChannelWidth() == MHz_u{5});
245 NS_ASSERT(phySta->GetFrequency() == MHz_u{5860});
246 PrintAttributesIfEnabled(printAttributes);
247 break;
248 case 12:
249 wifi.SetStandard(WIFI_STANDARD_80211n);
250 phy.Set("ChannelSettings", StringValue("{44, 20, BAND_5GHZ, 0}"));
251 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
252 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
253 phySta = GetYansWifiPhyPtr(staDevice);
254 // We expect channel 44, width 20, frequency 5220
255 NS_ASSERT(phySta->GetChannelNumber() == 44);
256 NS_ASSERT(phySta->GetChannelWidth() == MHz_u{20});
257 NS_ASSERT(phySta->GetFrequency() == MHz_u{5220});
258 PrintAttributesIfEnabled(printAttributes);
259 break;
260 case 13:
261 wifi.SetStandard(WIFI_STANDARD_80211n);
262 phy.Set("ChannelSettings", StringValue("{44, 0, BAND_5GHZ, 0}"));
263 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
264 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
265 phySta = GetYansWifiPhyPtr(staDevice);
266 // Post-install reconfiguration to channel number 40
268 "/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelSettings",
269 StringValue("{40, 0, BAND_5GHZ, 0}"));
271 "/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelSettings",
272 StringValue("{40, 0, BAND_5GHZ, 0}"));
273 // We expect channel 40, width 20, frequency 5200
274 NS_ASSERT(phySta->GetChannelNumber() == 40);
275 NS_ASSERT(phySta->GetChannelWidth() == MHz_u{20});
276 NS_ASSERT(phySta->GetFrequency() == MHz_u{5200});
277 PrintAttributesIfEnabled(printAttributes);
278 break;
279 case 14:
280 wifi.SetStandard(WIFI_STANDARD_80211n);
281 phy.Set("ChannelSettings", StringValue("{44, 0, BAND_5GHZ, 0}"));
282 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
283 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
284 phySta = GetYansWifiPhyPtr(staDevice);
285 // Post-install reconfiguration to a 40 MHz channel
287 "/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelSettings",
288 StringValue("{46, 0, BAND_5GHZ, 0}"));
290 "/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelSettings",
291 StringValue("{46, 0, BAND_5GHZ, 0}"));
292 NS_ASSERT(phySta->GetChannelNumber() == 46);
293 NS_ASSERT(phySta->GetChannelWidth() == MHz_u{40});
294 NS_ASSERT(phySta->GetFrequency() == MHz_u{5230});
295 PrintAttributesIfEnabled(printAttributes);
296 break;
297 case 15:
298 Config::SetDefault("ns3::WifiPhy::ChannelSettings", StringValue("{44, 0, BAND_5GHZ, 0}"));
299 wifi.SetStandard(WIFI_STANDARD_80211n);
300 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
301 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
302 phySta = GetYansWifiPhyPtr(staDevice);
303 // Post-install reconfiguration to a 40 MHz channel
305 "/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelSettings",
306 StringValue("{46, 0, BAND_5GHZ, 0}"));
308 "/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelSettings",
309 StringValue("{46, 0, BAND_5GHZ, 0}"));
310 NS_ASSERT(phySta->GetChannelNumber() == 46);
311 NS_ASSERT(phySta->GetChannelWidth() == MHz_u{40});
312 NS_ASSERT(phySta->GetFrequency() == MHz_u{5230});
313 PrintAttributesIfEnabled(printAttributes);
314 break;
315 case 16:
316 // Test that setting channel number to a non-standard value will throw an exception
317 Config::SetDefault("ns3::WifiPhy::ChannelSettings", StringValue("{45, 0, BAND_5GHZ, 0}"));
318 wifi.SetStandard(WIFI_STANDARD_80211n);
319 exceptionThrown = false;
320 try
321 {
322 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
323 }
324 catch (const std::runtime_error&)
325 {
326 exceptionThrown = true;
327 }
328 NS_ASSERT(exceptionThrown);
329 exceptionThrown = false;
330 try
331 {
332 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
333 }
334 catch (const std::runtime_error&)
335 {
336 exceptionThrown = true;
337 }
338 NS_ASSERT(exceptionThrown);
339 PrintAttributesIfEnabled(printAttributes);
340 break;
341 case 17:
342 // Test that setting Frequency to a standard value will set the
343 // channel number correctly
344 Config::SetDefault("ns3::WifiPhy::ChannelSettings", StringValue("{100, 0, BAND_5GHZ, 0}"));
345 wifi.SetStandard(WIFI_STANDARD_80211n);
346 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
347 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
348 phySta = GetYansWifiPhyPtr(staDevice);
349 // We expect channel number to be 100 due to frequency 5500
350 NS_ASSERT(phySta->GetChannelNumber() == 100);
351 NS_ASSERT(phySta->GetChannelWidth() == MHz_u{20});
352 NS_ASSERT(phySta->GetFrequency() == MHz_u{5500});
353 PrintAttributesIfEnabled(printAttributes);
354 break;
355 case 18:
356 // Set a wrong channel after initialization
357 wifi.SetStandard(WIFI_STANDARD_80211n);
358 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
359 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
360 phySta = GetYansWifiPhyPtr(staDevice);
361 exceptionThrown = false;
362 try
363 {
364 phySta->SetOperatingChannel(WifiPhy::ChannelTuple{99, 40, WIFI_PHY_BAND_5GHZ, 0});
365 }
366 catch (const std::runtime_error&)
367 {
368 exceptionThrown = true;
369 }
370 NS_ASSERT(exceptionThrown);
371 PrintAttributesIfEnabled(printAttributes);
372 break;
373 case 19:
374 // Test how channel number behaves when frequency is non-standard
375 wifi.SetStandard(WIFI_STANDARD_80211n);
376 phy.Set("ChannelSettings", StringValue("{44, 0, BAND_5GHZ, 0}"));
377 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
378 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
379 phySta = GetYansWifiPhyPtr(staDevice);
380 exceptionThrown = false;
381 try
382 {
383 phySta->SetAttribute("ChannelSettings", StringValue("{45, 0, BAND_5GHZ, 0}"));
384 }
385 catch (const std::runtime_error&)
386 {
387 exceptionThrown = true;
388 }
389 // We expect that an exception is thrown due to unknown channel number 45
390 NS_ASSERT(exceptionThrown);
391 phySta->SetAttribute("ChannelSettings", StringValue("{36, 0, BAND_5GHZ, 0}"));
392 // We expect channel number to be 36 due to known center frequency 5180
393 NS_ASSERT(phySta->GetChannelNumber() == 36);
394 NS_ASSERT(phySta->GetChannelWidth() == MHz_u{20});
395 NS_ASSERT(phySta->GetFrequency() == MHz_u{5180});
396 exceptionThrown = false;
397 try
398 {
399 phySta->SetAttribute("ChannelSettings", StringValue("{43, 0, BAND_5GHZ, 0}"));
400 }
401 catch (const std::runtime_error&)
402 {
403 exceptionThrown = true;
404 }
405 // We expect that an exception is thrown due to unknown channel number 43
406 NS_ASSERT(exceptionThrown);
407 phySta->SetAttribute("ChannelSettings", StringValue("{36, 0, BAND_5GHZ, 0}"));
408 NS_ASSERT(phySta->GetChannelNumber() == 36);
409 NS_ASSERT(phySta->GetChannelWidth() == MHz_u{20});
410 NS_ASSERT(phySta->GetFrequency() == MHz_u{5180});
411 PrintAttributesIfEnabled(printAttributes);
412 break;
413 case 20:
414 // Set both channel and frequency to consistent values before initialization
415 Config::SetDefault("ns3::WifiPhy::ChannelSettings", StringValue("{40, 0, BAND_5GHZ, 0}"));
416 wifi.SetStandard(WIFI_STANDARD_80211n);
417 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
418 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
419 phySta = GetYansWifiPhyPtr(staDevice);
420 NS_ASSERT(phySta->GetChannelNumber() == 40);
421 NS_ASSERT(phySta->GetChannelWidth() == MHz_u{20});
422 NS_ASSERT(phySta->GetFrequency() == MHz_u{5200});
423 // Set both channel and frequency to consistent values after initialization
424 wifi.SetStandard(WIFI_STANDARD_80211n);
425 staDevice = wifi.Install(phy, macSta, wifiStaNode.Get(0));
426 apDevice = wifi.Install(phy, macAp, wifiApNode.Get(0));
427 phySta = GetYansWifiPhyPtr(staDevice);
428 phySta->SetAttribute("ChannelSettings", StringValue("{40, 0, BAND_5GHZ, 0}"));
429 NS_ASSERT(phySta->GetChannelNumber() == 40);
430 NS_ASSERT(phySta->GetChannelWidth() == MHz_u{20});
431 NS_ASSERT(phySta->GetFrequency() == MHz_u{5200});
432 exceptionThrown = false;
433 try
434 {
435 phySta->SetAttribute("ChannelSettings", StringValue("{45, 0, BAND_5GHZ, 0}"));
436 }
437 catch (const std::runtime_error&)
438 {
439 exceptionThrown = true;
440 }
441 phySta->SetAttribute("ChannelSettings", StringValue("{36, 0, BAND_5GHZ, 0}"));
442 // We expect channel number to be 36 and an exception to be thrown
443 NS_ASSERT(phySta->GetChannelNumber() == 36);
444 NS_ASSERT(phySta->GetChannelWidth() == MHz_u{20});
445 NS_ASSERT(phySta->GetFrequency() == MHz_u{5180});
446 NS_ASSERT(exceptionThrown);
447 exceptionThrown = false;
448 try
449 {
450 phySta->SetAttribute("ChannelSettings", StringValue("{43, 0, BAND_5GHZ, 0}"));
451 }
452 catch (const std::runtime_error&)
453 {
454 exceptionThrown = true;
455 }
456 phySta->SetAttribute("ChannelSettings", StringValue("{36, 0, BAND_5GHZ, 0}"));
457 // We expect channel number to be 36 and an exception to be thrown
458 NS_ASSERT(phySta->GetChannelNumber() == 36);
459 NS_ASSERT(phySta->GetChannelWidth() == MHz_u{20});
460 NS_ASSERT(phySta->GetFrequency() == MHz_u{5180});
461 NS_ASSERT(exceptionThrown);
462 PrintAttributesIfEnabled(printAttributes);
463 break;
464 default:
465 std::cerr << "Invalid testcase number " << testCase << std::endl;
466 exit(1);
467 break;
468 }
469
470 // No need to Simulator::Run (); this is a configuration example
472
473 return 0;
474}
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.
Definition ptr.h:70
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
Definition simulator.cc:125
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:1375
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.
WifiChannelConfig::SegmentWithoutUnits ChannelTuple
kept for backward compatibility, can be deprecated when using strong types
Definition wifi-phy.h:954
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:886
void Set(std::string path, const AttributeValue &value)
Definition config.cc:872
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:194
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition object.h:627
@ 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.
double MHz_u
MHz weak type.
Definition wifi-units.h:31
const Time DEFAULT_BEACON_INTERVAL
Default Beacon interval.
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.