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