A Discrete-Event Network Simulator
API
wifi-mixed-network.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 Sébastien Deronne
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Sébastien Deronne <sebastien.deronne@gmail.com>
18  */
19 
20 #include "ns3/command-line.h"
21 #include "ns3/config.h"
22 #include "ns3/ht-configuration.h"
23 #include "ns3/internet-stack-helper.h"
24 #include "ns3/ipv4-address-helper.h"
25 #include "ns3/log.h"
26 #include "ns3/mobility-helper.h"
27 #include "ns3/on-off-helper.h"
28 #include "ns3/packet-sink-helper.h"
29 #include "ns3/packet-sink.h"
30 #include "ns3/pointer.h"
31 #include "ns3/qos-txop.h"
32 #include "ns3/ssid.h"
33 #include "ns3/string.h"
34 #include "ns3/udp-client-server-helper.h"
35 #include "ns3/wifi-mac.h"
36 #include "ns3/wifi-net-device.h"
37 #include "ns3/yans-wifi-channel.h"
38 #include "ns3/yans-wifi-helper.h"
39 
40 // This example shows how to configure mixed networks (i.e. mixed b/g and HT/non-HT) and how are
41 // performance in several scenarios.
42 //
43 // The example compares first g only and mixed b/g cases with various configurations depending on
44 // the following parameters:
45 // - protection mode that is configured on the AP;
46 // - whether short PPDU format is supported by the 802.11b station;
47 // - whether short slot time is supported by both the 802.11g station and the AP.
48 //
49 // The example then compares HT only and mixed HT/non-HT cases.
50 //
51 // The output results show that the presence of an 802.11b station strongly affects 802.11g
52 // performance. Protection mechanisms ensure that the NAV value of 802.11b stations is set correctly
53 // in case of 802.11g transmissions. In practice, those protection mechanism add a lot of overhead,
54 // resulting in reduced performance. CTS-To-Self introduces less overhead than Rts-Cts, but is not
55 // heard by hidden stations (and is thus generally only recommended as a protection mechanism for
56 // access points). Since short slot time is disabled once an 802.11b station enters the network,
57 // benefits from short slot time are only observed in a g only configuration.
58 //
59 // The user can also select the payload size and can choose either an UDP or a TCP connection.
60 // Example: ./ns3 run "wifi-mixed-network --isUdp=1"
61 
62 using namespace ns3;
63 
64 NS_LOG_COMPONENT_DEFINE("MixedNetwork");
65 
67 struct Parameters
68 {
69  std::string testName;
71  std::string erpProtectionMode;
75  uint32_t nWifiB;
76  bool bHasTraffic;
77  uint32_t nWifiG;
78  bool gHasTraffic;
79  uint32_t nWifiN;
80  bool nHasTraffic;
81  bool isUdp;
82  uint32_t payloadSize;
83  double simulationTime;
84 };
85 
86 class Experiment
87 {
88  public:
95  double Run(Parameters params);
96 };
97 
99 {
100 }
101 
102 double
104 {
105  std::string apTypeString;
106  if (params.apType == WIFI_STANDARD_80211g)
107  {
108  apTypeString = "WIFI_STANDARD_80211g";
109  }
110  else if (params.apType == WIFI_STANDARD_80211n)
111  {
112  apTypeString = "WIFI_STANDARD_80211n_2_4GHZ";
113  }
114 
115  std::cout << "Run: " << params.testName
116  << "\n\t enableErpProtection=" << params.enableErpProtection
117  << "\n\t erpProtectionMode=" << params.erpProtectionMode
118  << "\n\t enableShortSlotTime=" << params.enableShortSlotTime
119  << "\n\t enableShortPhyPreamble=" << params.enableShortPhyPreamble
120  << "\n\t apType=" << apTypeString << "\n\t nWifiB=" << params.nWifiB
121  << "\n\t bHasTraffic=" << params.bHasTraffic << "\n\t nWifiG=" << params.nWifiG
122  << "\n\t gHasTraffic=" << params.gHasTraffic << "\n\t nWifiN=" << params.nWifiN
123  << "\n\t nHasTraffic=" << params.nHasTraffic << std::endl;
124 
125  Config::SetDefault("ns3::WifiRemoteStationManager::ErpProtectionMode",
126  StringValue(params.erpProtectionMode));
127 
128  double throughput = 0;
129  uint32_t nWifiB = params.nWifiB;
130  uint32_t nWifiG = params.nWifiG;
131  uint32_t nWifiN = params.nWifiN;
132  double simulationTime = params.simulationTime;
133  uint32_t payloadSize = params.payloadSize;
134 
135  NodeContainer wifiBStaNodes;
136  wifiBStaNodes.Create(nWifiB);
137  NodeContainer wifiGStaNodes;
138  wifiGStaNodes.Create(nWifiG);
139  NodeContainer wifiNStaNodes;
140  wifiNStaNodes.Create(nWifiN);
142  wifiApNode.Create(1);
143 
145  channel.AddPropagationLoss("ns3::RangePropagationLossModel");
146 
148  phy.SetChannel(channel.Create());
149 
151  wifi.SetRemoteStationManager("ns3::IdealWifiManager");
152 
153  // 802.11b STA
154  wifi.SetStandard(WIFI_STANDARD_80211b);
155 
157  Ssid ssid = Ssid("ns-3-ssid");
158 
159  mac.SetType("ns3::StaWifiMac",
160  "Ssid",
161  SsidValue(ssid),
162  "ShortSlotTimeSupported",
163  BooleanValue(params.enableShortSlotTime));
164 
165  // Configure the PHY preamble type: long or short
166  phy.Set("ShortPlcpPreambleSupported", BooleanValue(params.enableShortPhyPreamble));
167 
168  NetDeviceContainer bStaDevice;
169  bStaDevice = wifi.Install(phy, mac, wifiBStaNodes);
170 
171  // 802.11b/g STA
172  wifi.SetStandard(WIFI_STANDARD_80211g);
173  NetDeviceContainer gStaDevice;
174  gStaDevice = wifi.Install(phy, mac, wifiGStaNodes);
175 
176  // 802.11b/g/n STA
177  wifi.SetStandard(WIFI_STANDARD_80211n);
178  NetDeviceContainer nStaDevice;
179  mac.SetType("ns3::StaWifiMac",
180  "Ssid",
181  SsidValue(ssid),
182  "BE_BlockAckThreshold",
183  UintegerValue(2),
184  "ShortSlotTimeSupported",
185  BooleanValue(params.enableShortSlotTime));
186  nStaDevice = wifi.Install(phy, mac, wifiNStaNodes);
187 
188  // AP
189  NetDeviceContainer apDevice;
190  wifi.SetStandard(params.apType);
191  mac.SetType("ns3::ApWifiMac",
192  "Ssid",
193  SsidValue(ssid),
194  "EnableBeaconJitter",
195  BooleanValue(false),
196  "BE_BlockAckThreshold",
197  UintegerValue(2),
198  "EnableNonErpProtection",
199  BooleanValue(params.enableErpProtection),
200  "ShortSlotTimeSupported",
201  BooleanValue(params.enableShortSlotTime));
202  apDevice = wifi.Install(phy, mac, wifiApNode);
203 
204  // Set TXOP limit
205  if (params.apType == WIFI_STANDARD_80211n)
206  {
207  Ptr<NetDevice> dev = wifiApNode.Get(0)->GetDevice(0);
208  Ptr<WifiNetDevice> wifi_dev = DynamicCast<WifiNetDevice>(dev);
209  Ptr<WifiMac> wifi_mac = wifi_dev->GetMac();
210  PointerValue ptr;
211  wifi_mac->GetAttribute("BE_Txop", ptr);
212  Ptr<QosTxop> edca = ptr.Get<QosTxop>();
213  edca->SetTxopLimit(MicroSeconds(3008));
214  }
215  if (nWifiN > 0)
216  {
217  Ptr<NetDevice> dev = wifiNStaNodes.Get(0)->GetDevice(0);
218  Ptr<WifiNetDevice> wifi_dev = DynamicCast<WifiNetDevice>(dev);
219  Ptr<WifiMac> wifi_mac = wifi_dev->GetMac();
220  PointerValue ptr;
221  wifi_mac->GetAttribute("BE_Txop", ptr);
222  Ptr<QosTxop> edca = ptr.Get<QosTxop>();
223  edca->SetTxopLimit(MicroSeconds(3008));
224  }
225 
226  Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/BE_MaxAmpduSize",
227  UintegerValue(0)); // Disable A-MPDU
228 
229  // Define mobility model
231  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator>();
232 
233  positionAlloc->Add(Vector(0.0, 0.0, 0.0));
234  for (uint32_t i = 0; i < nWifiB; i++)
235  {
236  positionAlloc->Add(Vector(5.0, 0.0, 0.0));
237  }
238  for (uint32_t i = 0; i < nWifiG; i++)
239  {
240  positionAlloc->Add(Vector(0.0, 5.0, 0.0));
241  }
242  for (uint32_t i = 0; i < nWifiN; i++)
243  {
244  positionAlloc->Add(Vector(0.0, 0.0, 5.0));
245  }
246 
247  mobility.SetPositionAllocator(positionAlloc);
248  mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
249  mobility.Install(wifiApNode);
250  mobility.Install(wifiBStaNodes);
251  mobility.Install(wifiGStaNodes);
252  mobility.Install(wifiNStaNodes);
253 
254  // Internet stack
256  stack.Install(wifiApNode);
257  stack.Install(wifiBStaNodes);
258  stack.Install(wifiGStaNodes);
259  stack.Install(wifiNStaNodes);
260 
262  address.SetBase("192.168.1.0", "255.255.255.0");
263  Ipv4InterfaceContainer bStaInterface;
264  bStaInterface = address.Assign(bStaDevice);
265  Ipv4InterfaceContainer gStaInterface;
266  gStaInterface = address.Assign(gStaDevice);
267  Ipv4InterfaceContainer nStaInterface;
268  nStaInterface = address.Assign(nStaDevice);
269  Ipv4InterfaceContainer ApInterface;
270  ApInterface = address.Assign(apDevice);
271 
272  // Setting applications
273  if (params.isUdp)
274  {
275  uint16_t port = 9;
276  UdpServerHelper server(port);
277  ApplicationContainer serverApp = server.Install(wifiApNode);
278  serverApp.Start(Seconds(0.0));
279  serverApp.Stop(Seconds(simulationTime + 1));
280 
281  UdpClientHelper client(ApInterface.GetAddress(0), port);
282  client.SetAttribute("MaxPackets", UintegerValue(4294967295U));
283  client.SetAttribute("Interval", TimeValue(Time("0.0002"))); // packets/s
284  client.SetAttribute("PacketSize", UintegerValue(payloadSize));
285 
287  if (params.bHasTraffic)
288  {
289  clientApps.Add(client.Install(wifiBStaNodes));
290  }
291  if (params.gHasTraffic)
292  {
293  clientApps.Add(client.Install(wifiGStaNodes));
294  }
295  if (params.nHasTraffic)
296  {
297  clientApps.Add(client.Install(wifiNStaNodes));
298  }
299  clientApps.Start(Seconds(1.0));
300  clientApps.Stop(Seconds(simulationTime + 1));
301 
302  Simulator::Stop(Seconds(simulationTime + 1));
303  Simulator::Run();
304 
305  uint64_t totalPacketsThrough = DynamicCast<UdpServer>(serverApp.Get(0))->GetReceived();
306  throughput = totalPacketsThrough * payloadSize * 8 / (simulationTime * 1000000.0);
307  }
308  else
309  {
310  uint16_t port = 50000;
312  PacketSinkHelper packetSinkHelper("ns3::TcpSocketFactory", localAddress);
313 
314  ApplicationContainer serverApp = packetSinkHelper.Install(wifiApNode.Get(0));
315  serverApp.Start(Seconds(0.0));
316  serverApp.Stop(Seconds(simulationTime + 1));
317 
318  OnOffHelper onoff("ns3::TcpSocketFactory", Ipv4Address::GetAny());
319  onoff.SetAttribute("OnTime", StringValue("ns3::ConstantRandomVariable[Constant=1]"));
320  onoff.SetAttribute("OffTime", StringValue("ns3::ConstantRandomVariable[Constant=0]"));
321  onoff.SetAttribute("PacketSize", UintegerValue(payloadSize));
322  onoff.SetAttribute("DataRate", DataRateValue(150000000)); // bit/s
323 
324  AddressValue remoteAddress(InetSocketAddress(ApInterface.GetAddress(0), port));
325  onoff.SetAttribute("Remote", remoteAddress);
326 
328  if (params.bHasTraffic)
329  {
330  clientApps.Add(onoff.Install(wifiBStaNodes));
331  }
332  if (params.gHasTraffic)
333  {
334  clientApps.Add(onoff.Install(wifiGStaNodes));
335  }
336  if (params.nHasTraffic)
337  {
338  clientApps.Add(onoff.Install(wifiNStaNodes));
339  }
340  clientApps.Start(Seconds(1.0));
341  clientApps.Stop(Seconds(simulationTime + 1));
342 
343  Simulator::Stop(Seconds(simulationTime + 1));
344  Simulator::Run();
345 
346  uint64_t totalPacketsThrough = DynamicCast<PacketSink>(serverApp.Get(0))->GetTotalRx();
347  throughput += totalPacketsThrough * 8 / (simulationTime * 1000000.0);
348  }
350  return throughput;
351 }
352 
353 int
354 main(int argc, char* argv[])
355 {
357  params.testName = "";
358  params.enableErpProtection = false;
359  params.erpProtectionMode = "Cts-To-Self";
360  params.enableShortSlotTime = false;
361  params.enableShortPhyPreamble = false;
362  params.apType = WIFI_STANDARD_80211g;
363  params.nWifiB = 0;
364  params.bHasTraffic = false;
365  params.nWifiG = 1;
366  params.gHasTraffic = true;
367  params.nWifiN = 0;
368  params.nHasTraffic = false;
369  params.isUdp = true;
370  params.payloadSize = 1472; // bytes
371  params.simulationTime = 10; // seconds
372 
373  bool verifyResults = 0; // used for regression
374 
375  CommandLine cmd(__FILE__);
376  cmd.AddValue("payloadSize", "Payload size in bytes", params.payloadSize);
377  cmd.AddValue("simulationTime", "Simulation time in seconds", params.simulationTime);
378  cmd.AddValue("isUdp", "UDP if set to 1, TCP otherwise", params.isUdp);
379  cmd.AddValue("verifyResults",
380  "Enable/disable results verification at the end of the simulation",
381  verifyResults);
382  cmd.Parse(argc, argv);
383 
385  double throughput = 0;
386 
387  params.testName = "g only with all g features disabled";
388  throughput = experiment.Run(params);
389  if (verifyResults && (throughput < 22.5 || throughput > 23.5))
390  {
391  NS_LOG_ERROR("Obtained throughput " << throughput << " is not in the expected boundaries!");
392  exit(1);
393  }
394  std::cout << "Throughput: " << throughput << " Mbit/s \n" << std::endl;
395 
396  params.testName = "g only with short slot time enabled";
397  params.enableErpProtection = false;
398  params.enableShortSlotTime = true;
399  params.enableShortPhyPreamble = false;
400  params.nWifiB = 0;
401  throughput = experiment.Run(params);
402  if (verifyResults && (throughput < 29 || throughput > 30))
403  {
404  NS_LOG_ERROR("Obtained throughput " << throughput << " is not in the expected boundaries!");
405  exit(1);
406  }
407  std::cout << "Throughput: " << throughput << " Mbit/s \n" << std::endl;
408 
409  params.testName = "Mixed b/g with all g features disabled";
410  params.enableErpProtection = false;
411  params.enableShortSlotTime = false;
412  params.enableShortPhyPreamble = false;
413  params.nWifiB = 1;
414  throughput = experiment.Run(params);
415  if (verifyResults && (throughput < 22.5 || throughput > 23.5))
416  {
417  NS_LOG_ERROR("Obtained throughput " << throughput << " is not in the expected boundaries!");
418  exit(1);
419  }
420  std::cout << "Throughput: " << throughput << " Mbit/s \n" << std::endl;
421 
422  params.testName = "Mixed b/g with short plcp preamble enabled";
423  params.enableErpProtection = false;
424  params.enableShortSlotTime = false;
425  params.enableShortPhyPreamble = true;
426  params.nWifiB = 1;
427  throughput = experiment.Run(params);
428  if (verifyResults && (throughput < 22.5 || throughput > 23.5))
429  {
430  NS_LOG_ERROR("Obtained throughput " << throughput << " is not in the expected boundaries!");
431  exit(1);
432  }
433  std::cout << "Throughput: " << throughput << " Mbit/s \n" << std::endl;
434 
435  params.testName = "Mixed b/g with short slot time enabled using RTS-CTS protection";
436  params.enableErpProtection = true;
437  params.erpProtectionMode = "Rts-Cts";
438  params.enableShortSlotTime = false;
439  params.enableShortPhyPreamble = false;
440  params.nWifiB = 1;
441  throughput = experiment.Run(params);
442  if (verifyResults && (throughput < 19 || throughput > 20))
443  {
444  NS_LOG_ERROR("Obtained throughput " << throughput << " is not in the expected boundaries!");
445  exit(1);
446  }
447  std::cout << "Throughput: " << throughput << " Mbit/s \n" << std::endl;
448 
449  params.testName = "Mixed b/g with short plcp preamble enabled using RTS-CTS protection";
450  params.enableErpProtection = true;
451  params.enableShortSlotTime = false;
452  params.enableShortPhyPreamble = true;
453  params.nWifiB = 1;
454  throughput = experiment.Run(params);
455  if (verifyResults && (throughput < 19 || throughput > 20))
456  {
457  NS_LOG_ERROR("Obtained throughput " << throughput << " is not in the expected boundaries!");
458  exit(1);
459  }
460  std::cout << "Throughput: " << throughput << " Mbit/s \n" << std::endl;
461 
462  params.testName = "Mixed b/g with short slot time enabled using CTS-TO-SELF protection";
463  params.enableErpProtection = true;
464  params.erpProtectionMode = "Cts-To-Self";
465  params.enableShortSlotTime = false;
466  params.enableShortPhyPreamble = false;
467  params.nWifiB = 1;
468  throughput = experiment.Run(params);
469  if (verifyResults && (throughput < 20.5 || throughput > 21.5))
470  {
471  NS_LOG_ERROR("Obtained throughput " << throughput << " is not in the expected boundaries!");
472  exit(1);
473  }
474  std::cout << "Throughput: " << throughput << " Mbit/s \n" << std::endl;
475 
476  params.testName = "Mixed b/g with short plcp preamble enabled using CTS-TO-SELF protection";
477  params.enableErpProtection = true;
478  params.enableShortSlotTime = false;
479  params.enableShortPhyPreamble = true;
480  params.nWifiB = 1;
481  throughput = experiment.Run(params);
482  if (verifyResults && (throughput < 20.5 || throughput > 21.5))
483  {
484  NS_LOG_ERROR("Obtained throughput " << throughput << " is not in the expected boundaries!");
485  exit(1);
486  }
487  std::cout << "Throughput: " << throughput << " Mbit/s \n" << std::endl;
488 
489  params.testName = "HT only";
490  params.enableErpProtection = false;
491  params.enableShortSlotTime = false;
492  params.enableShortPhyPreamble = false;
493  params.apType = WIFI_STANDARD_80211n;
494  params.nWifiB = 0;
495  params.bHasTraffic = false;
496  params.nWifiG = 0;
497  params.gHasTraffic = false;
498  params.nWifiN = 1;
499  params.nHasTraffic = true;
500  throughput = experiment.Run(params);
501  if (verifyResults && (throughput < 44 || throughput > 45))
502  {
503  NS_LOG_ERROR("Obtained throughput " << throughput << " is not in the expected boundaries!");
504  exit(1);
505  }
506  std::cout << "Throughput: " << throughput << " Mbit/s \n" << std::endl;
507 
508  params.testName = "Mixed HT/non-HT";
509  params.enableErpProtection = false;
510  params.enableShortSlotTime = false;
511  params.enableShortPhyPreamble = false;
512  params.apType = WIFI_STANDARD_80211n;
513  params.nWifiB = 0;
514  params.bHasTraffic = false;
515  params.nWifiG = 1;
516  params.gHasTraffic = false;
517  params.nWifiN = 1;
518  params.nHasTraffic = true;
519  throughput = experiment.Run(params);
520  if (verifyResults && (throughput < 44 || throughput > 45))
521  {
522  NS_LOG_ERROR("Obtained throughput " << throughput << " is not in the expected boundaries!");
523  exit(1);
524  }
525  std::cout << "Throughput: " << throughput << " Mbit/s \n" << std::endl;
526 
527  return 0;
528 }
WiFi adhoc experiment class.
Definition: wifi-adhoc.cc:45
Gnuplot2dDataset Run(const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, const WifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel)
Run an experiment.
Definition: wifi-adhoc.cc:162
a polymophic address class
Definition: address.h:100
AttributeValue implementation for Address.
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
AttributeValue implementation for DataRate.
an Inet address class
aggregate IP/TCP/UDP functionality to existing Nodes.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
static Ipv4Address GetAny()
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.
Ptr< NetDevice > GetDevice(uint32_t index) const
Retrieve the index-th NetDevice associated to this node.
Definition: node.cc:152
void GetAttribute(std::string name, AttributeValue &value) const
Get the value of an attribute, raising fatal errors if unsuccessful.
Definition: object-base.cc:240
A helper to make it easier to instantiate an ns3::OnOffApplication on a set of nodes.
Definition: on-off-helper.h:44
ApplicationContainer Install(NodeContainer c) const
Install an ns3::OnOffApplication on each node of the input container configured with all the attribut...
void SetAttribute(std::string name, const AttributeValue &value)
Helper function used to set the underlying application attributes.
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes.
ApplicationContainer Install(NodeContainer c) const
Install an ns3::PacketSinkApplication on each node of the input container configured with all the att...
Hold objects of type Ptr<T>.
Definition: pointer.h:37
Ptr< T > Get() const
Definition: pointer.h:206
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
Handle packet fragmentation and retransmissions for QoS data frames as well as MSDU aggregation (A-MS...
Definition: qos-txop.h:73
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
The IEEE 802.11 SSID Information Element.
Definition: ssid.h:36
AttributeValue implementation for Ssid.
Hold variables of type string.
Definition: string.h:56
AttributeValue implementation for Time.
Definition: nstime.h:1423
void SetTxopLimit(Time txopLimit)
Set the TXOP limit.
Definition: txop.cc:376
Create a client application which sends UDP packets carrying a 32bit sequence number and a 64 bit tim...
void SetAttribute(std::string name, const AttributeValue &value)
Record an attribute to be set in each Application after it is is created.
ApplicationContainer Install(NodeContainer c)
Create a server application which waits for input UDP packets and uses the information carried into t...
ApplicationContainer Install(NodeContainer c)
Create one UDP server application on each of the Nodes in the NodeContainer.
Hold an unsigned integer type.
Definition: uinteger.h:45
helps to create WifiNetDevice objects
Definition: wifi-helper.h:325
create MAC layers for a ns3::WifiNetDevice.
Ptr< WifiMac > GetMac() const
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.
void experiment(std::string queue_disc_type)
uint16_t port
Definition: dsdv-manet.cc:45
void SetDefault(std::string name, const AttributeValue &value)
Definition: config.cc:891
void Set(std::string path, const AttributeValue &value)
Definition: config.cc:877
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
Definition: log.h:254
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1360
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1336
WifiStandard
Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
@ WIFI_STANDARD_80211n
@ WIFI_STANDARD_80211g
@ WIFI_STANDARD_80211b
address
Definition: first.py:40
clientApps
Definition: first.py:58
stack
Definition: first.py:37
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Definition: nstime.h:848
Every class exported by the ns3 library is enclosed in the ns3 namespace.
cmd
Definition: second.py:33
ssid
Definition: third.py:86
channel
Definition: third.py:81
mac
Definition: third.py:85
wifi
Definition: third.py:88
wifiApNode
Definition: third.py:79
mobility
Definition: third.py:96
phy
Definition: third.py:82
params
Fit Fluctuating Two Ray model to the 3GPP TR 38.901 using the Anderson-Darling goodness-of-fit ##.
Parameters.
WifiStandard apType
Wifi standard for AP.
uint32_t nWifiB
Number of 802.11b stations.
uint32_t nWifiN
Number of 802.11n stations.
bool enableErpProtection
True to enable ERP protection.
bool nHasTraffic
True if 802.11n stations generate traffic.
bool gHasTraffic
True if 802.11g stations generate traffic.
double simulationTime
Simulation time in seconds.
std::string erpProtectionMode
ERP protection mode.
bool enableShortSlotTime
True to enable short slot time.
bool bHasTraffic
True if 802.11b stations generate traffic.
bool isUdp
True to generate UDP traffic.
std::string testName
Test name.
bool enableShortPhyPreamble
True to enable short PHY preamble.
uint32_t nWifiG
Number of 802.11g stations.
uint32_t payloadSize
Payload size in bytes.