A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-spectrum-saturation-example.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 MIRKO BANCHI
3 * Copyright (c) 2015 University of Washington
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 * Authors: Mirko Banchi <mk.banchi@gmail.com>
19 * Sebastien Deronne <sebastien.deronne@gmail.com>
20 * Tom Henderson <tomhend@u.washington.edu>
21 *
22 * Adapted from wifi-ht-network.cc example
23 */
24
25#include "ns3/boolean.h"
26#include "ns3/command-line.h"
27#include "ns3/config.h"
28#include "ns3/double.h"
29#include "ns3/internet-stack-helper.h"
30#include "ns3/ipv4-address-helper.h"
31#include "ns3/log.h"
32#include "ns3/mobility-helper.h"
33#include "ns3/multi-model-spectrum-channel.h"
34#include "ns3/propagation-loss-model.h"
35#include "ns3/spectrum-wifi-helper.h"
36#include "ns3/ssid.h"
37#include "ns3/string.h"
38#include "ns3/udp-client-server-helper.h"
39#include "ns3/uinteger.h"
40#include "ns3/yans-wifi-channel.h"
41#include "ns3/yans-wifi-helper.h"
42
43#include <iomanip>
44
45// This is a simple example of an IEEE 802.11n Wi-Fi network.
46//
47// The main use case is to enable and test SpectrumWifiPhy vs YansWifiPhy
48// under saturation conditions (for max throughput).
49//
50// Network topology:
51//
52// Wi-Fi 192.168.1.0
53//
54// STA AP
55// * <-- distance --> *
56// | |
57// n1 n2
58//
59// Users may vary the following command-line arguments in addition to the
60// attributes, global values, and default values typically available:
61//
62// --simulationTime: Simulation time in seconds [10]
63// --distance: meters separation between nodes [1]
64// --index: restrict index to single value between 0 and 31 [256]
65// --wifiType: select ns3::SpectrumWifiPhy or ns3::YansWifiPhy [ns3::SpectrumWifiPhy]
66// --errorModelType: select ns3::NistErrorRateModel or ns3::YansErrorRateModel
67// [ns3::NistErrorRateModel]
68// --enablePcap: enable pcap output [false]
69//
70// By default, the program will step through 64 index values, corresponding
71// to the following MCS, channel width, and guard interval combinations:
72// index 0-7: MCS 0-7, long guard interval, 20 MHz channel
73// index 8-15: MCS 0-7, short guard interval, 20 MHz channel
74// index 16-23: MCS 0-7, long guard interval, 40 MHz channel
75// index 24-31: MCS 0-7, short guard interval, 40 MHz channel
76// index 32-39: MCS 8-15, long guard interval, 20 MHz channel
77// index 40-47: MCS 8-15, short guard interval, 20 MHz channel
78// index 48-55: MCS 8-15, long guard interval, 40 MHz channel
79// index 56-63: MCS 8-15, short guard interval, 40 MHz channel
80// and send packets at a high rate using each MCS, using the SpectrumWifiPhy
81// and the NistErrorRateModel, at a distance of 1 meter. The program outputs
82// results such as:
83//
84// wifiType: ns3::SpectrumWifiPhy distance: 1m
85// index MCS width Rate (Mb/s) Tput (Mb/s) Received
86// 0 0 20 6.5 5.96219 5063
87// 1 1 20 13 11.9491 10147
88// 2 2 20 19.5 17.9184 15216
89// 3 3 20 26 23.9253 20317
90// ...
91//
92// selection of index values 32-63 will result in MCS selection 8-15
93// involving two spatial streams
94
95using namespace ns3;
96
97NS_LOG_COMPONENT_DEFINE("WifiSpectrumSaturationExample");
98
99int
100main(int argc, char* argv[])
101{
102 double distance = 1;
103 double simulationTime = 10; // seconds
104 uint16_t index = 256;
105 uint32_t channelWidth = 0;
106 std::string wifiType = "ns3::SpectrumWifiPhy";
107 std::string errorModelType = "ns3::NistErrorRateModel";
108 bool enablePcap = false;
109
110 CommandLine cmd(__FILE__);
111 cmd.AddValue("simulationTime", "Simulation time in seconds", simulationTime);
112 cmd.AddValue("distance", "meters separation between nodes", distance);
113 cmd.AddValue("index", "restrict index to single value between 0 and 63", index);
114 cmd.AddValue("wifiType", "select ns3::SpectrumWifiPhy or ns3::YansWifiPhy", wifiType);
115 cmd.AddValue("errorModelType",
116 "select ns3::NistErrorRateModel or ns3::YansErrorRateModel",
117 errorModelType);
118 cmd.AddValue("enablePcap", "enable pcap output", enablePcap);
119 cmd.Parse(argc, argv);
120
121 uint16_t startIndex = 0;
122 uint16_t stopIndex = 63;
123 if (index < 64)
124 {
125 startIndex = index;
126 stopIndex = index;
127 }
128
129 std::cout << "wifiType: " << wifiType << " distance: " << distance << "m" << std::endl;
130 std::cout << std::setw(5) << "index" << std::setw(6) << "MCS" << std::setw(8) << "width"
131 << std::setw(12) << "Rate (Mb/s)" << std::setw(12) << "Tput (Mb/s)" << std::setw(10)
132 << "Received " << std::endl;
133 for (uint16_t i = startIndex; i <= stopIndex; i++)
134 {
135 uint32_t payloadSize;
136 payloadSize = 1472; // 1500 bytes IPv4
137
138 NodeContainer wifiStaNode;
139 wifiStaNode.Create(1);
141 wifiApNode.Create(1);
142
144 SpectrumWifiPhyHelper spectrumPhy;
145 if (wifiType == "ns3::YansWifiPhy")
146 {
148 channel.AddPropagationLoss("ns3::FriisPropagationLossModel");
149 channel.SetPropagationDelay("ns3::ConstantSpeedPropagationDelayModel");
150 phy.SetChannel(channel.Create());
151 phy.Set("TxPowerStart", DoubleValue(1));
152 phy.Set("TxPowerEnd", DoubleValue(1));
153
154 if (i > 31 && i <= 39)
155 {
156 phy.Set("Antennas", UintegerValue(2));
157 phy.Set("MaxSupportedTxSpatialStreams", UintegerValue(2));
158 phy.Set("MaxSupportedRxSpatialStreams", UintegerValue(2));
159 }
160 else if (i > 39 && i <= 47)
161 {
162 phy.Set("Antennas", UintegerValue(2));
163 phy.Set("MaxSupportedTxSpatialStreams", UintegerValue(2));
164 phy.Set("MaxSupportedRxSpatialStreams", UintegerValue(2));
165 }
166 else if (i > 47 && i <= 55)
167 {
168 phy.Set("Antennas", UintegerValue(2));
169 phy.Set("MaxSupportedTxSpatialStreams", UintegerValue(2));
170 phy.Set("MaxSupportedRxSpatialStreams", UintegerValue(2));
171 }
172 else if (i > 55 && i <= 63)
173 {
174 phy.Set("Antennas", UintegerValue(2));
175 phy.Set("MaxSupportedTxSpatialStreams", UintegerValue(2));
176 phy.Set("MaxSupportedRxSpatialStreams", UintegerValue(2));
177 }
178 }
179 else if (wifiType == "ns3::SpectrumWifiPhy")
180 {
181 Ptr<MultiModelSpectrumChannel> spectrumChannel =
182 CreateObject<MultiModelSpectrumChannel>();
183 Ptr<FriisPropagationLossModel> lossModel = CreateObject<FriisPropagationLossModel>();
184 spectrumChannel->AddPropagationLossModel(lossModel);
185
187 CreateObject<ConstantSpeedPropagationDelayModel>();
188 spectrumChannel->SetPropagationDelayModel(delayModel);
189
190 spectrumPhy.SetChannel(spectrumChannel);
191 spectrumPhy.SetErrorRateModel(errorModelType);
192 spectrumPhy.Set("TxPowerStart", DoubleValue(1));
193 spectrumPhy.Set("TxPowerEnd", DoubleValue(1));
194
195 if (i > 31 && i <= 39)
196 {
197 spectrumPhy.Set("Antennas", UintegerValue(2));
198 spectrumPhy.Set("MaxSupportedTxSpatialStreams", UintegerValue(2));
199 spectrumPhy.Set("MaxSupportedRxSpatialStreams", UintegerValue(2));
200 }
201 else if (i > 39 && i <= 47)
202 {
203 spectrumPhy.Set("Antennas", UintegerValue(2));
204 spectrumPhy.Set("MaxSupportedTxSpatialStreams", UintegerValue(2));
205 spectrumPhy.Set("MaxSupportedRxSpatialStreams", UintegerValue(2));
206 }
207 else if (i > 47 && i <= 55)
208 {
209 spectrumPhy.Set("Antennas", UintegerValue(2));
210 spectrumPhy.Set("MaxSupportedTxSpatialStreams", UintegerValue(2));
211 spectrumPhy.Set("MaxSupportedRxSpatialStreams", UintegerValue(2));
212 }
213 else if (i > 55 && i <= 63)
214 {
215 spectrumPhy.Set("Antennas", UintegerValue(2));
216 spectrumPhy.Set("MaxSupportedTxSpatialStreams", UintegerValue(2));
217 spectrumPhy.Set("MaxSupportedRxSpatialStreams", UintegerValue(2));
218 }
219 }
220 else
221 {
222 NS_FATAL_ERROR("Unsupported WiFi type " << wifiType);
223 }
224
226 wifi.SetStandard(WIFI_STANDARD_80211n);
228
229 Ssid ssid = Ssid("ns380211n");
230
231 double datarate = 0;
233 if (i == 0)
234 {
235 DataRate = StringValue("HtMcs0");
236 datarate = 6.5;
237 }
238 else if (i == 1)
239 {
240 DataRate = StringValue("HtMcs1");
241 datarate = 13;
242 }
243 else if (i == 2)
244 {
245 DataRate = StringValue("HtMcs2");
246 datarate = 19.5;
247 }
248 else if (i == 3)
249 {
250 DataRate = StringValue("HtMcs3");
251 datarate = 26;
252 }
253 else if (i == 4)
254 {
255 DataRate = StringValue("HtMcs4");
256 datarate = 39;
257 }
258 else if (i == 5)
259 {
260 DataRate = StringValue("HtMcs5");
261 datarate = 52;
262 }
263 else if (i == 6)
264 {
265 DataRate = StringValue("HtMcs6");
266 datarate = 58.5;
267 }
268 else if (i == 7)
269 {
270 DataRate = StringValue("HtMcs7");
271 datarate = 65;
272 }
273 else if (i == 8)
274 {
275 DataRate = StringValue("HtMcs0");
276 datarate = 7.2;
277 }
278 else if (i == 9)
279 {
280 DataRate = StringValue("HtMcs1");
281 datarate = 14.4;
282 }
283 else if (i == 10)
284 {
285 DataRate = StringValue("HtMcs2");
286 datarate = 21.7;
287 }
288 else if (i == 11)
289 {
290 DataRate = StringValue("HtMcs3");
291 datarate = 28.9;
292 }
293 else if (i == 12)
294 {
295 DataRate = StringValue("HtMcs4");
296 datarate = 43.3;
297 }
298 else if (i == 13)
299 {
300 DataRate = StringValue("HtMcs5");
301 datarate = 57.8;
302 }
303 else if (i == 14)
304 {
305 DataRate = StringValue("HtMcs6");
306 datarate = 65;
307 }
308 else if (i == 15)
309 {
310 DataRate = StringValue("HtMcs7");
311 datarate = 72.2;
312 }
313 else if (i == 16)
314 {
315 DataRate = StringValue("HtMcs0");
316 datarate = 13.5;
317 }
318 else if (i == 17)
319 {
320 DataRate = StringValue("HtMcs1");
321 datarate = 27;
322 }
323 else if (i == 18)
324 {
325 DataRate = StringValue("HtMcs2");
326 datarate = 40.5;
327 }
328 else if (i == 19)
329 {
330 DataRate = StringValue("HtMcs3");
331 datarate = 54;
332 }
333 else if (i == 20)
334 {
335 DataRate = StringValue("HtMcs4");
336 datarate = 81;
337 }
338 else if (i == 21)
339 {
340 DataRate = StringValue("HtMcs5");
341 datarate = 108;
342 }
343 else if (i == 22)
344 {
345 DataRate = StringValue("HtMcs6");
346 datarate = 121.5;
347 }
348 else if (i == 23)
349 {
350 DataRate = StringValue("HtMcs7");
351 datarate = 135;
352 }
353 else if (i == 24)
354 {
355 DataRate = StringValue("HtMcs0");
356 datarate = 15;
357 }
358 else if (i == 25)
359 {
360 DataRate = StringValue("HtMcs1");
361 datarate = 30;
362 }
363 else if (i == 26)
364 {
365 DataRate = StringValue("HtMcs2");
366 datarate = 45;
367 }
368 else if (i == 27)
369 {
370 DataRate = StringValue("HtMcs3");
371 datarate = 60;
372 }
373 else if (i == 28)
374 {
375 DataRate = StringValue("HtMcs4");
376 datarate = 90;
377 }
378 else if (i == 29)
379 {
380 DataRate = StringValue("HtMcs5");
381 datarate = 120;
382 }
383 else if (i == 30)
384 {
385 DataRate = StringValue("HtMcs6");
386 datarate = 135;
387 }
388 else if (i == 31)
389 {
390 DataRate = StringValue("HtMcs7");
391 datarate = 150;
392 }
393 else if (i == 32)
394 {
395 DataRate = StringValue("HtMcs8");
396 datarate = 13;
397 }
398 else if (i == 33)
399 {
400 DataRate = StringValue("HtMcs9");
401 datarate = 26;
402 }
403 else if (i == 34)
404 {
405 DataRate = StringValue("HtMcs10");
406 datarate = 39;
407 }
408 else if (i == 35)
409 {
410 DataRate = StringValue("HtMcs11");
411 datarate = 52;
412 }
413 else if (i == 36)
414 {
415 DataRate = StringValue("HtMcs12");
416 datarate = 78;
417 }
418 else if (i == 37)
419 {
420 DataRate = StringValue("HtMcs13");
421 datarate = 104;
422 }
423 else if (i == 38)
424 {
425 DataRate = StringValue("HtMcs14");
426 datarate = 117;
427 }
428 else if (i == 39)
429 {
430 DataRate = StringValue("HtMcs15");
431 datarate = 130;
432 }
433 else if (i == 40)
434 {
435 DataRate = StringValue("HtMcs8");
436 datarate = 14.4;
437 }
438 else if (i == 41)
439 {
440 DataRate = StringValue("HtMcs9");
441 datarate = 28.9;
442 }
443 else if (i == 42)
444 {
445 DataRate = StringValue("HtMcs10");
446 datarate = 43.3;
447 }
448 else if (i == 43)
449 {
450 DataRate = StringValue("HtMcs11");
451 datarate = 57.8;
452 }
453 else if (i == 44)
454 {
455 DataRate = StringValue("HtMcs12");
456 datarate = 86.7;
457 }
458 else if (i == 45)
459 {
460 DataRate = StringValue("HtMcs13");
461 datarate = 115.6;
462 }
463 else if (i == 46)
464 {
465 DataRate = StringValue("HtMcs14");
466 datarate = 130.3;
467 }
468 else if (i == 47)
469 {
470 DataRate = StringValue("HtMcs15");
471 datarate = 144.4;
472 }
473 else if (i == 48)
474 {
475 DataRate = StringValue("HtMcs8");
476 datarate = 27;
477 }
478 else if (i == 49)
479 {
480 DataRate = StringValue("HtMcs9");
481 datarate = 54;
482 }
483 else if (i == 50)
484 {
485 DataRate = StringValue("HtMcs10");
486 datarate = 81;
487 }
488 else if (i == 51)
489 {
490 DataRate = StringValue("HtMcs11");
491 datarate = 108;
492 }
493 else if (i == 52)
494 {
495 DataRate = StringValue("HtMcs12");
496 datarate = 162;
497 }
498 else if (i == 53)
499 {
500 DataRate = StringValue("HtMcs13");
501 datarate = 216;
502 }
503 else if (i == 54)
504 {
505 DataRate = StringValue("HtMcs14");
506 datarate = 243;
507 }
508 else if (i == 55)
509 {
510 DataRate = StringValue("HtMcs15");
511 datarate = 270;
512 }
513 else if (i == 56)
514 {
515 DataRate = StringValue("HtMcs8");
516 datarate = 30;
517 }
518 else if (i == 57)
519 {
520 DataRate = StringValue("HtMcs9");
521 datarate = 60;
522 }
523 else if (i == 58)
524 {
525 DataRate = StringValue("HtMcs10");
526 datarate = 90;
527 }
528 else if (i == 59)
529 {
530 DataRate = StringValue("HtMcs11");
531 datarate = 120;
532 }
533 else if (i == 60)
534 {
535 DataRate = StringValue("HtMcs12");
536 datarate = 180;
537 }
538 else if (i == 61)
539 {
540 DataRate = StringValue("HtMcs13");
541 datarate = 240;
542 }
543 else if (i == 62)
544 {
545 DataRate = StringValue("HtMcs14");
546 datarate = 270;
547 }
548 else if (i == 63)
549 {
550 DataRate = StringValue("HtMcs15");
551 datarate = 300;
552 }
553 else
554 {
555 NS_FATAL_ERROR("Illegal index i " << i);
556 }
557
558 wifi.SetRemoteStationManager("ns3::ConstantRateWifiManager",
559 "DataMode",
560 DataRate,
561 "ControlMode",
562 DataRate);
563
564 NetDeviceContainer staDevice;
565 NetDeviceContainer apDevice;
566
567 channelWidth = (i <= 15 || (i > 31 && i <= 47) ? 20 : 40);
568 std::string channelStr = "{0, " + std::to_string(channelWidth) + ", BAND_5GHZ, 0}";
569
570 if (wifiType == "ns3::YansWifiPhy")
571 {
572 mac.SetType("ns3::StaWifiMac", "Ssid", SsidValue(ssid));
573 phy.Set("ChannelSettings", StringValue(channelStr));
574
575 staDevice = wifi.Install(phy, mac, wifiStaNode);
576 mac.SetType("ns3::ApWifiMac", "Ssid", SsidValue(ssid));
577 phy.Set("ChannelSettings", StringValue(channelStr));
578 apDevice = wifi.Install(phy, mac, wifiApNode);
579 }
580 else if (wifiType == "ns3::SpectrumWifiPhy")
581 {
582 mac.SetType("ns3::StaWifiMac", "Ssid", SsidValue(ssid));
583 phy.Set("ChannelSettings", StringValue(channelStr));
584 staDevice = wifi.Install(spectrumPhy, mac, wifiStaNode);
585 mac.SetType("ns3::ApWifiMac", "Ssid", SsidValue(ssid));
586 phy.Set("ChannelSettings", StringValue(channelStr));
587 apDevice = wifi.Install(spectrumPhy, mac, wifiApNode);
588 }
589
590 if ((i <= 7) || (i > 31 && i <= 39))
591 {
592 Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/"
593 "ShortGuardIntervalSupported",
594 BooleanValue(false));
595 }
596 else if ((i > 7 && i <= 15) || (i > 39 && i <= 47))
597 {
598 Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/"
599 "ShortGuardIntervalSupported",
600 BooleanValue(true));
601 }
602 else if ((i > 15 && i <= 23) || (i > 47 && i <= 55))
603 {
604 Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/"
605 "ShortGuardIntervalSupported",
606 BooleanValue(false));
607 }
608 else
609 {
610 Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/"
611 "ShortGuardIntervalSupported",
612 BooleanValue(true));
613 }
614
615 // mobility.
617 Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator>();
618
619 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
620 positionAlloc->Add(Vector(distance, 0.0, 0.0));
621 mobility.SetPositionAllocator(positionAlloc);
622
623 mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
624
625 mobility.Install(wifiApNode);
626 mobility.Install(wifiStaNode);
627
628 /* Internet stack*/
630 stack.Install(wifiApNode);
631 stack.Install(wifiStaNode);
632
634 address.SetBase("192.168.1.0", "255.255.255.0");
635 Ipv4InterfaceContainer staNodeInterface;
636 Ipv4InterfaceContainer apNodeInterface;
637
638 staNodeInterface = address.Assign(staDevice);
639 apNodeInterface = address.Assign(apDevice);
640
641 /* Setting applications */
642 uint16_t port = 9;
644 ApplicationContainer serverApp = server.Install(wifiStaNode.Get(0));
645 serverApp.Start(Seconds(0.0));
646 serverApp.Stop(Seconds(simulationTime + 1));
647
648 UdpClientHelper client(staNodeInterface.GetAddress(0), port);
649 client.SetAttribute("MaxPackets", UintegerValue(4294967295U));
650 client.SetAttribute("Interval", TimeValue(Time("0.0001"))); // packets/s
651 client.SetAttribute("PacketSize", UintegerValue(payloadSize));
652 ApplicationContainer clientApp = client.Install(wifiApNode.Get(0));
653 clientApp.Start(Seconds(1.0));
654 clientApp.Stop(Seconds(simulationTime + 1));
655
656 if (enablePcap)
657 {
658 phy.SetPcapDataLinkType(WifiPhyHelper::DLT_IEEE802_11_RADIO);
659 std::stringstream ss;
660 ss << "wifi-spectrum-saturation-example-" << i;
661 phy.EnablePcap(ss.str(), apDevice);
662 }
663
664 Simulator::Stop(Seconds(simulationTime + 1));
666
667 double throughput;
668 uint64_t totalPacketsThrough;
669 totalPacketsThrough = DynamicCast<UdpServer>(serverApp.Get(0))->GetReceived();
670 throughput = totalPacketsThrough * payloadSize * 8 / (simulationTime * 1000000.0); // Mbit/s
671 std::cout << std::setw(5) << i << std::setw(6) << (i % 8) + 8 * (i / 32) << std::setw(8)
672 << channelWidth << std::setw(10) << datarate << std::setw(12) << throughput
673 << std::setw(8) << totalPacketsThrough << std::endl;
675 }
676 return 0;
677}
holds a vector of ns3::Application pointers.
void Start(Time start) const
Start all of the Applications in this container at the start time given as a parameter.
Ptr< Application > Get(uint32_t i) const
Get the Ptr<Application> stored in this container at a given index.
void Stop(Time stop) const
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter.
AttributeValue implementation for Boolean.
Definition: boolean.h:37
Parse command-line arguments.
Definition: command-line.h:232
Class for representing data rates.
Definition: data-rate.h:89
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition: double.h:42
aggregate IP/TCP/UDP functionality to existing Nodes.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
Helper class used to assign positions and mobility models to nodes.
holds a vector of ns3::NetDevice pointers
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:78
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
Definition: simulator.cc:140
static void Run()
Run the simulation.
Definition: simulator.cc:176
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Definition: simulator.cc:184
Make it easy to create and manage PHY objects for the spectrum model.
void SetChannel(const Ptr< SpectrumChannel > channel)
The IEEE 802.11 SSID Information Element.
Definition: ssid.h:36
AttributeValue implementation for Ssid.
Hold variables of type string.
Definition: string.h:56
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
AttributeValue implementation for Time.
Definition: nstime.h:1423
Create a client application which sends UDP packets carrying a 32bit sequence number and a 64 bit tim...
Create a server application which waits for input UDP packets and uses the information carried into t...
Hold an unsigned integer type.
Definition: uinteger.h:45
helps to create WifiNetDevice objects
Definition: wifi-helper.h:324
create MAC layers for a ns3::WifiNetDevice.
void Set(std::string name, const AttributeValue &v)
Definition: wifi-helper.cc:163
void SetErrorRateModel(std::string type, Args &&... args)
Helper function used to set the error rate model.
Definition: wifi-helper.h:550
@ DLT_IEEE802_11_RADIO
Include Radiotap link layer information.
Definition: wifi-helper.h:178
manage and create wifi channel objects for the YANS model.
Make it easy to create and manage PHY objects for the YANS model.
uint16_t port
Definition: dsdv-manet.cc:44
void Set(std::string path, const AttributeValue &value)
Definition: config.cc:877
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:179
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1336
@ WIFI_STANDARD_80211n
ns address
Definition: first.py:40
ns stack
Definition: first.py:37
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns cmd
Definition: second.py:33
ns wifi
Definition: third.py:88
ns ssid
Definition: third.py:86
ns mac
Definition: third.py:85
ns wifiApNode
Definition: third.py:79
ns channel
Definition: third.py:81
ns mobility
Definition: third.py:96
ns phy
Definition: third.py:82