A Discrete-Event Network Simulator
API
wifi-spectrum-saturation-example.cc
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2009 MIRKO BANCHI
4  * Copyright (c) 2015 University of Washington
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Authors: Mirko Banchi <mk.banchi@gmail.com>
20  * Sebastien Deronne <sebastien.deronne@gmail.com>
21  * Tom Henderson <tomhend@u.washington.edu>
22  *
23  * Adapted from wifi-ht-network.cc example
24  */
25 
26 #include <iomanip>
27 #include "ns3/command-line.h"
28 #include "ns3/config.h"
29 #include "ns3/uinteger.h"
30 #include "ns3/boolean.h"
31 #include "ns3/double.h"
32 #include "ns3/string.h"
33 #include "ns3/log.h"
34 #include "ns3/yans-wifi-helper.h"
35 #include "ns3/spectrum-wifi-helper.h"
36 #include "ns3/ssid.h"
37 #include "ns3/mobility-helper.h"
38 #include "ns3/internet-stack-helper.h"
39 #include "ns3/ipv4-address-helper.h"
40 #include "ns3/udp-client-server-helper.h"
41 #include "ns3/yans-wifi-channel.h"
42 #include "ns3/multi-model-spectrum-channel.h"
43 #include "ns3/propagation-loss-model.h"
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 [50]
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 [ns3::NistErrorRateModel]
67 // --enablePcap: enable pcap output [false]
68 //
69 // By default, the program will step through 64 index values, corresponding
70 // to the following MCS, channel width, and guard interval combinations:
71 // index 0-7: MCS 0-7, long guard interval, 20 MHz channel
72 // index 8-15: MCS 0-7, short guard interval, 20 MHz channel
73 // index 16-23: MCS 0-7, long guard interval, 40 MHz channel
74 // index 24-31: MCS 0-7, short guard interval, 40 MHz channel
75 // index 32-39: MCS 8-15, long guard interval, 20 MHz channel
76 // index 40-47: MCS 8-15, short guard interval, 20 MHz channel
77 // index 48-55: MCS 8-15, long guard interval, 40 MHz channel
78 // index 56-63: MCS 8-15, short guard interval, 40 MHz channel
79 // and send packets at a high rate using each MCS, using the SpectrumWifiPhy
80 // and the NistErrorRateModel, at a distance of 1 meter. The program outputs
81 // results such as:
82 //
83 // wifiType: ns3::SpectrumWifiPhy distance: 1m
84 // index MCS width Rate (Mb/s) Tput (Mb/s) Received
85 // 0 0 20 6.5 5.96219 5063
86 // 1 1 20 13 11.9491 10147
87 // 2 2 20 19.5 17.9184 15216
88 // 3 3 20 26 23.9253 20317
89 // ...
90 //
91 // selection of index values 32-63 will result in MCS selection 8-15
92 // involving two spatial streams
93 
94 using namespace ns3;
95 
96 NS_LOG_COMPONENT_DEFINE ("WifiSpectrumSaturationExample");
97 
98 int main (int argc, char *argv[])
99 {
100  double distance = 1;
101  double simulationTime = 10; //seconds
102  uint16_t index = 256;
103  uint32_t channelWidth = 0;
104  std::string wifiType = "ns3::SpectrumWifiPhy";
105  std::string errorModelType = "ns3::NistErrorRateModel";
106  bool enablePcap = false;
107 
108  CommandLine cmd (__FILE__);
109  cmd.AddValue ("simulationTime", "Simulation time in seconds", simulationTime);
110  cmd.AddValue ("distance", "meters separation between nodes", distance);
111  cmd.AddValue ("index", "restrict index to single value between 0 and 63", index);
112  cmd.AddValue ("wifiType", "select ns3::SpectrumWifiPhy or ns3::YansWifiPhy", wifiType);
113  cmd.AddValue ("errorModelType", "select ns3::NistErrorRateModel or ns3::YansErrorRateModel", errorModelType);
114  cmd.AddValue ("enablePcap", "enable pcap output", enablePcap);
115  cmd.Parse (argc,argv);
116 
117  uint16_t startIndex = 0;
118  uint16_t stopIndex = 63;
119  if (index < 64)
120  {
121  startIndex = index;
122  stopIndex = index;
123  }
124 
125  std::cout << "wifiType: " << wifiType << " distance: " << distance << "m" << std::endl;
126  std::cout << std::setw (5) << "index" <<
127  std::setw (6) << "MCS" <<
128  std::setw (8) << "width" <<
129  std::setw (12) << "Rate (Mb/s)" <<
130  std::setw (12) << "Tput (Mb/s)" <<
131  std::setw (10) << "Received " <<
132  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> ();
184  = 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_5GHZ);
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","DataMode", DataRate,
560  "ControlMode", DataRate);
561 
562  NetDeviceContainer staDevice;
563  NetDeviceContainer apDevice;
564 
565  channelWidth = (i <= 15 || (i > 31 && i <= 47) ? 20 : 40);
566 
567  if (wifiType == "ns3::YansWifiPhy")
568  {
569  mac.SetType ("ns3::StaWifiMac",
570  "Ssid", SsidValue (ssid));
571  phy.Set ("ChannelWidth", UintegerValue (channelWidth));
572  staDevice = wifi.Install (phy, mac, wifiStaNode);
573  mac.SetType ("ns3::ApWifiMac",
574  "Ssid", SsidValue (ssid));
575  phy.Set ("ChannelWidth", UintegerValue (channelWidth));
576  apDevice = wifi.Install (phy, mac, wifiApNode);
577 
578  }
579  else if (wifiType == "ns3::SpectrumWifiPhy")
580  {
581  mac.SetType ("ns3::StaWifiMac",
582  "Ssid", SsidValue (ssid));
583  phy.Set ("ChannelWidth", UintegerValue (channelWidth));
584  staDevice = wifi.Install (spectrumPhy, mac, wifiStaNode);
585  mac.SetType ("ns3::ApWifiMac",
586  "Ssid", SsidValue (ssid));
587  phy.Set ("ChannelWidth", UintegerValue (channelWidth));
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/ShortGuardIntervalSupported", BooleanValue (false));
594  }
595  else if ((i > 7 && i <= 15) || (i > 39 && i <= 47))
596  {
597  Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/ShortGuardIntervalSupported", BooleanValue (true));
598  }
599  else if ((i > 15 && i <= 23) || (i > 47 && i <= 55))
600  {
601  Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/ShortGuardIntervalSupported", BooleanValue (false));
602  }
603  else
604  {
605  Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/ShortGuardIntervalSupported", BooleanValue (true));
606  }
607 
608  // mobility.
610  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
611 
612  positionAlloc->Add (Vector (0.0, 0.0, 0.0));
613  positionAlloc->Add (Vector (distance, 0.0, 0.0));
614  mobility.SetPositionAllocator (positionAlloc);
615 
616  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
617 
618  mobility.Install (wifiApNode);
619  mobility.Install (wifiStaNode);
620 
621  /* Internet stack*/
623  stack.Install (wifiApNode);
624  stack.Install (wifiStaNode);
625 
627  address.SetBase ("192.168.1.0", "255.255.255.0");
628  Ipv4InterfaceContainer staNodeInterface;
629  Ipv4InterfaceContainer apNodeInterface;
630 
631  staNodeInterface = address.Assign (staDevice);
632  apNodeInterface = address.Assign (apDevice);
633 
634  /* Setting applications */
635  uint16_t port = 9;
636  UdpServerHelper server (port);
637  ApplicationContainer serverApp = server.Install (wifiStaNode.Get (0));
638  serverApp.Start (Seconds (0.0));
639  serverApp.Stop (Seconds (simulationTime + 1));
640 
641  UdpClientHelper client (staNodeInterface.GetAddress (0), port);
642  client.SetAttribute ("MaxPackets", UintegerValue (4294967295u));
643  client.SetAttribute ("Interval", TimeValue (Time ("0.0001"))); //packets/s
644  client.SetAttribute ("PacketSize", UintegerValue (payloadSize));
645  ApplicationContainer clientApp = client.Install (wifiApNode.Get (0));
646  clientApp.Start (Seconds (1.0));
647  clientApp.Stop (Seconds (simulationTime + 1));
648 
649  if (enablePcap)
650  {
651  phy.SetPcapDataLinkType (WifiPhyHelper::DLT_IEEE802_11_RADIO);
652  std::stringstream ss;
653  ss << "wifi-spectrum-saturation-example-" << i;
654  phy.EnablePcap (ss.str (), apDevice);
655  }
656 
657  Simulator::Stop (Seconds (simulationTime + 1));
658  Simulator::Run ();
659 
660  double throughput;
661  uint64_t totalPacketsThrough;
662  totalPacketsThrough = DynamicCast<UdpServer> (serverApp.Get (0))->GetReceived ();
663  throughput = totalPacketsThrough * payloadSize * 8 / (simulationTime * 1000000.0); //Mbit/s
664  std::cout << std::setw (5) << i <<
665  std::setw (6) << (i % 8) + 8 * (i / 32) <<
666  std::setw (8) << channelWidth <<
667  std::setw (10) << datarate <<
668  std::setw (12) << throughput <<
669  std::setw (8) << totalPacketsThrough <<
670  std::endl;
672  }
673  return 0;
674 }
void Set(std::string name, const AttributeValue &v)
Definition: wifi-helper.cc:140
holds a vector of ns3::Application pointers.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
AttributeValue implementation for Boolean.
Definition: boolean.h:36
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Hold variables of type string.
Definition: string.h:41
Make it easy to create and manage PHY objects for the YANS model.
void Set(std::string path, const AttributeValue &value)
Definition: config.cc:839
bool enablePcap
static void Run(void)
Run the simulation.
Definition: simulator.cc:172
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
aggregate IP/TCP/UDP functionality to existing Nodes.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:165
cmd
Definition: second.py:35
void AddPropagationLossModel(Ptr< PropagationLossModel > loss)
Add the single-frequency propagation loss model to be used.
helps to create WifiNetDevice objects
Definition: wifi-helper.h:326
stack
Definition: first.py:41
uint16_t port
Definition: dsdv-manet.cc:45
channel
Definition: third.py:92
mobility
Definition: third.py:108
phy
Definition: third.py:93
Class for representing data rates.
Definition: data-rate.h:88
Create a client application which sends UDP packets carrying a 32bit sequence number and a 64 bit tim...
AttributeValue implementation for Time.
Definition: nstime.h:1353
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
void SetChannel(Ptr< SpectrumChannel > channel)
Hold an unsigned integer type.
Definition: uinteger.h:44
ssid
Definition: third.py:100
holds a vector of ns3::NetDevice pointers
mac
Definition: third.py:99
Create a server application which waits for input UDP packets and uses the information carried into t...
wifiApNode
Definition: third.py:90
void Start(Time start)
Arrange for all of the Applications in this container to Start() at the Time given as a parameter...
Parse command-line arguments.
Definition: command-line.h:227
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
Definition: simulator.cc:136
void SetAttribute(std::string name, const AttributeValue &value)
Record an attribute to be set in each Application after it is is created.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
address
Definition: first.py:44
manage and create wifi channel objects for the YANS model.
create MAC layers for a ns3::WifiNetDevice.
void SetErrorRateModel(std::string name, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
Definition: wifi-helper.cc:146
The IEEE 802.11 SSID Information Element.
Definition: ssid.h:35
wifi
Definition: third.py:96
Helper class used to assign positions and mobility models to nodes.
void Stop(Time stop)
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter...
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
Definition: simulator.cc:180
void SetPropagationDelayModel(Ptr< PropagationDelayModel > delay)
Set the propagation delay model to be used.
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1289
AttributeValue implementation for Ssid.
Definition: ssid.h:105
void Add(Vector v)
Add a position to the list of positions.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
This class can be used to hold variables of floating point type such as &#39;double&#39; or &#39;float&#39;...
Definition: double.h:41
Include Radiotap link layer information.
Definition: wifi-helper.h:180
void(* DataRate)(DataRate oldValue, DataRate newValue)
TracedValue callback signature for DataRate.
Definition: data-rate.h:329
Ptr< Application > Get(uint32_t i) const
Get the Ptr<Application> stored in this container at a given index.
Make it easy to create and manage PHY objects for the spectrum model.