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-txop-aggregation.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/boolean.h"
21 #include "ns3/command-line.h"
22 #include "ns3/config.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/packet-sink-helper.h"
28 #include "ns3/pointer.h"
29 #include "ns3/qos-txop.h"
30 #include "ns3/ssid.h"
31 #include "ns3/string.h"
32 #include "ns3/udp-client-server-helper.h"
33 #include "ns3/udp-server.h"
34 #include "ns3/uinteger.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 is an example that illustrates how 802.11n aggregation is configured.
41 // It defines 4 independent Wi-Fi networks (working on different channels).
42 // Each network contains one access point and one station. Each station
43 // continuously transmits data packets to its respective AP.
44 //
45 // Network topology (numbers in parentheses are channel numbers):
46 //
47 // Network A (36) Network B (40) Network C (44) Network D (48)
48 // * * * * * * * *
49 // | | | | | | | |
50 // AP A STA A AP B STA B AP C STA C AP D STA D
51 //
52 // The aggregation parameters are configured differently on the 4 stations:
53 // - station A uses default aggregation parameter values (A-MSDU disabled, A-MPDU enabled with
54 // maximum size of 65 kB);
55 // - station B doesn't use aggregation (both A-MPDU and A-MSDU are disabled);
56 // - station C enables A-MSDU (with maximum size of 8 kB) but disables A-MPDU;
57 // - station D uses two-level aggregation (A-MPDU with maximum size of 32 kB and A-MSDU with maximum
58 // size of 4 kB).
59 //
60 // The user can select the distance between the stations and the APs, can enable/disable the RTS/CTS
61 // mechanism and can modify the duration of a TXOP. Example: ./ns3 run "wifi-txop-aggregation
62 // --distance=10 --enableRts=0 --simulationTime=20"
63 //
64 // The output prints the throughput and the maximum TXOP duration measured for the 4 cases/networks
65 // described above. When default aggregation parameters are enabled, the
66 // maximum A-MPDU size is 65 kB and the throughput is maximal. When aggregation is disabled, the
67 // throughput is about the half of the physical bitrate. When only A-MSDU is enabled, the throughput
68 // is increased but is not maximal, since the maximum A-MSDU size is limited to 7935 bytes (whereas
69 // the maximum A-MPDU size is limited to 65535 bytes). When A-MSDU and A-MPDU are both enabled (=
70 // two-level aggregation), the throughput is slightly smaller than the first scenario since we set a
71 // smaller maximum A-MPDU size.
72 //
73 // When the distance is increased, the frame error rate gets higher, and the output shows how it
74 // affects the throughput for the 4 networks. Even through A-MSDU has less overheads than A-MPDU,
75 // A-MSDU is less robust against transmission errors than A-MPDU. When the distance is augmented,
76 // the throughput for the third scenario is more affected than the throughput obtained in other
77 // networks.
78 
79 using namespace ns3;
80 
81 NS_LOG_COMPONENT_DEFINE("TxopMpduAggregation");
82 
86 struct TxopDurationTracer
87 {
95  void Trace(Time startTime, Time duration, uint8_t linkId);
96  Time m_max{Seconds(0)};
97 };
98 
99 void
100 TxopDurationTracer::Trace(Time startTime, Time duration, uint8_t linkId)
101 {
102  if (duration > m_max)
103  {
104  m_max = duration;
105  }
106 }
107 
108 int
109 main(int argc, char* argv[])
110 {
111  uint32_t payloadSize = 1472; // bytes
112  double simulationTime = 10; // seconds
113  double txopLimit = 3520; // microseconds
114  double distance = 5; // meters
115  bool enableRts = false;
116  bool enablePcap = false;
117  bool verifyResults = false; // used for regression
118 
119  CommandLine cmd(__FILE__);
120  cmd.AddValue("payloadSize", "Payload size in bytes", payloadSize);
121  cmd.AddValue("enableRts", "Enable or disable RTS/CTS", enableRts);
122  cmd.AddValue("txopLimit", "TXOP duration in microseconds", txopLimit);
123  cmd.AddValue("simulationTime", "Simulation time in seconds", simulationTime);
124  cmd.AddValue("distance",
125  "Distance in meters between the station and the access point",
126  distance);
127  cmd.AddValue("enablePcap", "Enable/disable pcap file generation", enablePcap);
128  cmd.AddValue("verifyResults",
129  "Enable/disable results verification at the end of the simulation",
130  verifyResults);
131  cmd.Parse(argc, argv);
132 
133  Config::SetDefault("ns3::WifiRemoteStationManager::RtsCtsThreshold",
134  enableRts ? StringValue("0") : StringValue("999999"));
135 
137  wifiStaNodes.Create(4);
138  NodeContainer wifiApNodes;
139  wifiApNodes.Create(4);
140 
143  phy.SetPcapDataLinkType(WifiPhyHelper::DLT_IEEE802_11_RADIO);
144  phy.SetChannel(channel.Create());
145 
147  wifi.SetStandard(WIFI_STANDARD_80211n);
148  wifi.SetRemoteStationManager("ns3::ConstantRateWifiManager",
149  "DataMode",
150  StringValue("HtMcs7"),
151  "ControlMode",
152  StringValue("HtMcs0"));
154 
155  NetDeviceContainer staDeviceA;
156  NetDeviceContainer staDeviceB;
157  NetDeviceContainer staDeviceC;
158  NetDeviceContainer staDeviceD;
159  NetDeviceContainer apDeviceA;
160  NetDeviceContainer apDeviceB;
161  NetDeviceContainer apDeviceC;
162  NetDeviceContainer apDeviceD;
163  Ssid ssid;
164 
165  // Network A
166  ssid = Ssid("network-A");
167  phy.Set("ChannelSettings", StringValue("{36, 0, BAND_5GHZ, 0}"));
168  mac.SetType("ns3::StaWifiMac", "Ssid", SsidValue(ssid));
169  staDeviceA = wifi.Install(phy, mac, wifiStaNodes.Get(0));
170 
171  mac.SetType("ns3::ApWifiMac",
172  "Ssid",
173  SsidValue(ssid),
174  "EnableBeaconJitter",
175  BooleanValue(false));
176  apDeviceA = wifi.Install(phy, mac, wifiApNodes.Get(0));
177 
178  // Modify EDCA configuration (TXOP limit) for AC_BE
179  Ptr<NetDevice> dev = wifiApNodes.Get(0)->GetDevice(0);
180  Ptr<WifiNetDevice> wifi_dev = DynamicCast<WifiNetDevice>(dev);
181  PointerValue ptr;
182  Ptr<QosTxop> edca;
183  wifi_dev->GetMac()->GetAttribute("BE_Txop", ptr);
184  edca = ptr.Get<QosTxop>();
185  edca->SetTxopLimit(MicroSeconds(txopLimit));
186 
187  // Trace TXOP duration for BE on AP A
188  TxopDurationTracer netA;
190 
191  // Network B
192  ssid = Ssid("network-B");
193  phy.Set("ChannelSettings", StringValue("{40, 0, BAND_5GHZ, 0}"));
194  mac.SetType("ns3::StaWifiMac", "Ssid", SsidValue(ssid));
195 
196  staDeviceB = wifi.Install(phy, mac, wifiStaNodes.Get(1));
197 
198  // Disable A-MPDU
199  dev = wifiStaNodes.Get(1)->GetDevice(0);
200  wifi_dev = DynamicCast<WifiNetDevice>(dev);
201  wifi_dev->GetMac()->SetAttribute("BE_MaxAmpduSize", UintegerValue(0));
202 
203  mac.SetType("ns3::ApWifiMac",
204  "Ssid",
205  SsidValue(ssid),
206  "EnableBeaconJitter",
207  BooleanValue(false));
208  apDeviceB = wifi.Install(phy, mac, wifiApNodes.Get(1));
209 
210  // Disable A-MPDU
211  dev = wifiApNodes.Get(1)->GetDevice(0);
212  wifi_dev = DynamicCast<WifiNetDevice>(dev);
213  wifi_dev->GetMac()->SetAttribute("BE_MaxAmpduSize", UintegerValue(0));
214 
215  // Modify EDCA configuration (TXOP limit) for AC_BE
216  wifi_dev->GetMac()->GetAttribute("BE_Txop", ptr);
217  edca = ptr.Get<QosTxop>();
218  edca->SetTxopLimit(MicroSeconds(txopLimit));
219 
220  // Trace TXOP duration for BE on AP B
221  TxopDurationTracer netB;
223 
224  // Network C
225  ssid = Ssid("network-C");
226  phy.Set("ChannelSettings", StringValue("{44, 0, BAND_5GHZ, 0}"));
227  mac.SetType("ns3::StaWifiMac", "Ssid", SsidValue(ssid));
228 
229  staDeviceC = wifi.Install(phy, mac, wifiStaNodes.Get(2));
230 
231  // Disable A-MPDU and enable A-MSDU with the highest maximum size allowed by the standard (7935
232  // bytes)
233  dev = wifiStaNodes.Get(2)->GetDevice(0);
234  wifi_dev = DynamicCast<WifiNetDevice>(dev);
235  wifi_dev->GetMac()->SetAttribute("BE_MaxAmpduSize", UintegerValue(0));
236  wifi_dev->GetMac()->SetAttribute("BE_MaxAmsduSize", UintegerValue(7935));
237 
238  mac.SetType("ns3::ApWifiMac",
239  "Ssid",
240  SsidValue(ssid),
241  "EnableBeaconJitter",
242  BooleanValue(false));
243  apDeviceC = wifi.Install(phy, mac, wifiApNodes.Get(2));
244 
245  // Disable A-MPDU and enable A-MSDU with the highest maximum size allowed by the standard (7935
246  // bytes)
247  dev = wifiApNodes.Get(2)->GetDevice(0);
248  wifi_dev = DynamicCast<WifiNetDevice>(dev);
249  wifi_dev->GetMac()->SetAttribute("BE_MaxAmpduSize", UintegerValue(0));
250  wifi_dev->GetMac()->SetAttribute("BE_MaxAmsduSize", UintegerValue(7935));
251 
252  // Modify EDCA configuration (TXOP limit) for AC_BE
253  wifi_dev->GetMac()->GetAttribute("BE_Txop", ptr);
254  edca = ptr.Get<QosTxop>();
255  edca->SetTxopLimit(MicroSeconds(txopLimit));
256 
257  // Trace TXOP duration for BE on AP C
258  TxopDurationTracer netC;
260 
261  // Network D
262  ssid = Ssid("network-D");
263  phy.Set("ChannelSettings", StringValue("{48, 0, BAND_5GHZ, 0}"));
264  mac.SetType("ns3::StaWifiMac", "Ssid", SsidValue(ssid));
265 
266  staDeviceD = wifi.Install(phy, mac, wifiStaNodes.Get(3));
267 
268  // Enable A-MPDU with a smaller size than the default one and
269  // enable A-MSDU with the smallest maximum size allowed by the standard (3839 bytes)
270  dev = wifiStaNodes.Get(3)->GetDevice(0);
271  wifi_dev = DynamicCast<WifiNetDevice>(dev);
272  wifi_dev->GetMac()->SetAttribute("BE_MaxAmpduSize", UintegerValue(32768));
273  wifi_dev->GetMac()->SetAttribute("BE_MaxAmsduSize", UintegerValue(3839));
274 
275  mac.SetType("ns3::ApWifiMac",
276  "Ssid",
277  SsidValue(ssid),
278  "EnableBeaconJitter",
279  BooleanValue(false));
280  apDeviceD = wifi.Install(phy, mac, wifiApNodes.Get(3));
281 
282  // Enable A-MPDU with a smaller size than the default one and
283  // enable A-MSDU with the smallest maximum size allowed by the standard (3839 bytes)
284  dev = wifiApNodes.Get(3)->GetDevice(0);
285  wifi_dev = DynamicCast<WifiNetDevice>(dev);
286  wifi_dev->GetMac()->SetAttribute("BE_MaxAmpduSize", UintegerValue(32768));
287  wifi_dev->GetMac()->SetAttribute("BE_MaxAmsduSize", UintegerValue(3839));
288 
289  // Modify EDCA configuration (TXOP limit) for AC_BE
290  wifi_dev->GetMac()->GetAttribute("BE_Txop", ptr);
291  edca = ptr.Get<QosTxop>();
292  edca->SetTxopLimit(MicroSeconds(txopLimit));
293 
294  // Trace TXOP duration for BE on AP D
295  TxopDurationTracer netD;
297 
298  // Setting mobility model
300  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator>();
301  mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
302 
303  // Set position for APs
304  positionAlloc->Add(Vector(0.0, 0.0, 0.0));
305  positionAlloc->Add(Vector(10.0, 0.0, 0.0));
306  positionAlloc->Add(Vector(20.0, 0.0, 0.0));
307  positionAlloc->Add(Vector(30.0, 0.0, 0.0));
308  // Set position for STAs
309  positionAlloc->Add(Vector(distance, 0.0, 0.0));
310  positionAlloc->Add(Vector(10 + distance, 0.0, 0.0));
311  positionAlloc->Add(Vector(20 + distance, 0.0, 0.0));
312  positionAlloc->Add(Vector(30 + distance, 0.0, 0.0));
313 
314  mobility.SetPositionAllocator(positionAlloc);
315  mobility.Install(wifiApNodes);
316  mobility.Install(wifiStaNodes);
317 
318  // Internet stack
320  stack.Install(wifiApNodes);
321  stack.Install(wifiStaNodes);
322 
324  address.SetBase("192.168.1.0", "255.255.255.0");
325  Ipv4InterfaceContainer StaInterfaceA;
326  StaInterfaceA = address.Assign(staDeviceA);
327  Ipv4InterfaceContainer ApInterfaceA;
328  ApInterfaceA = address.Assign(apDeviceA);
329 
330  address.SetBase("192.168.2.0", "255.255.255.0");
331  Ipv4InterfaceContainer StaInterfaceB;
332  StaInterfaceB = address.Assign(staDeviceB);
333  Ipv4InterfaceContainer ApInterfaceB;
334  ApInterfaceB = address.Assign(apDeviceB);
335 
336  address.SetBase("192.168.3.0", "255.255.255.0");
337  Ipv4InterfaceContainer StaInterfaceC;
338  StaInterfaceC = address.Assign(staDeviceC);
339  Ipv4InterfaceContainer ApInterfaceC;
340  ApInterfaceC = address.Assign(apDeviceC);
341 
342  address.SetBase("192.168.4.0", "255.255.255.0");
343  Ipv4InterfaceContainer StaInterfaceD;
344  StaInterfaceD = address.Assign(staDeviceD);
345  Ipv4InterfaceContainer ApInterfaceD;
346  ApInterfaceD = address.Assign(apDeviceD);
347 
348  // Setting applications
349  uint16_t port = 9;
350  UdpServerHelper serverA(port);
351  ApplicationContainer serverAppA = serverA.Install(wifiStaNodes.Get(0));
352  serverAppA.Start(Seconds(0.0));
353  serverAppA.Stop(Seconds(simulationTime + 1));
354 
355  UdpClientHelper clientA(StaInterfaceA.GetAddress(0), port);
356  clientA.SetAttribute("MaxPackets", UintegerValue(4294967295U));
357  clientA.SetAttribute("Interval", TimeValue(Time("0.0001"))); // packets/s
358  clientA.SetAttribute("PacketSize", UintegerValue(payloadSize));
359 
360  ApplicationContainer clientAppA = clientA.Install(wifiApNodes.Get(0));
361  clientAppA.Start(Seconds(1.0));
362  clientAppA.Stop(Seconds(simulationTime + 1));
363 
364  UdpServerHelper serverB(port);
365  ApplicationContainer serverAppB = serverB.Install(wifiStaNodes.Get(1));
366  serverAppB.Start(Seconds(0.0));
367  serverAppB.Stop(Seconds(simulationTime + 1));
368 
369  UdpClientHelper clientB(StaInterfaceB.GetAddress(0), port);
370  clientB.SetAttribute("MaxPackets", UintegerValue(4294967295U));
371  clientB.SetAttribute("Interval", TimeValue(Time("0.0001"))); // packets/s
372  clientB.SetAttribute("PacketSize", UintegerValue(payloadSize));
373 
374  ApplicationContainer clientAppB = clientB.Install(wifiApNodes.Get(1));
375  clientAppB.Start(Seconds(1.0));
376  clientAppB.Stop(Seconds(simulationTime + 1));
377 
378  UdpServerHelper serverC(port);
379  ApplicationContainer serverAppC = serverC.Install(wifiStaNodes.Get(2));
380  serverAppC.Start(Seconds(0.0));
381  serverAppC.Stop(Seconds(simulationTime + 1));
382 
383  UdpClientHelper clientC(StaInterfaceC.GetAddress(0), port);
384  clientC.SetAttribute("MaxPackets", UintegerValue(4294967295U));
385  clientC.SetAttribute("Interval", TimeValue(Time("0.0001"))); // packets/s
386  clientC.SetAttribute("PacketSize", UintegerValue(payloadSize));
387 
388  ApplicationContainer clientAppC = clientC.Install(wifiApNodes.Get(2));
389  clientAppC.Start(Seconds(1.0));
390  clientAppC.Stop(Seconds(simulationTime + 1));
391 
392  UdpServerHelper serverD(port);
393  ApplicationContainer serverAppD = serverD.Install(wifiStaNodes.Get(3));
394  serverAppD.Start(Seconds(0.0));
395  serverAppD.Stop(Seconds(simulationTime + 1));
396 
397  UdpClientHelper clientD(StaInterfaceD.GetAddress(0), port);
398  clientD.SetAttribute("MaxPackets", UintegerValue(4294967295U));
399  clientD.SetAttribute("Interval", TimeValue(Time("0.0001"))); // packets/s
400  clientD.SetAttribute("PacketSize", UintegerValue(payloadSize));
401 
402  ApplicationContainer clientAppD = clientD.Install(wifiApNodes.Get(3));
403  clientAppD.Start(Seconds(1.0));
404  clientAppD.Stop(Seconds(simulationTime + 1));
405 
406  if (enablePcap)
407  {
408  phy.EnablePcap("AP_A", apDeviceA.Get(0));
409  phy.EnablePcap("STA_A", staDeviceA.Get(0));
410  phy.EnablePcap("AP_B", apDeviceB.Get(0));
411  phy.EnablePcap("STA_B", staDeviceB.Get(0));
412  phy.EnablePcap("AP_C", apDeviceC.Get(0));
413  phy.EnablePcap("STA_C", staDeviceC.Get(0));
414  phy.EnablePcap("AP_D", apDeviceD.Get(0));
415  phy.EnablePcap("STA_D", staDeviceD.Get(0));
416  }
417 
418  Simulator::Stop(Seconds(simulationTime + 1));
419  Simulator::Run();
420 
421  // Show results
422  uint64_t totalPacketsThroughA = DynamicCast<UdpServer>(serverAppA.Get(0))->GetReceived();
423  uint64_t totalPacketsThroughB = DynamicCast<UdpServer>(serverAppB.Get(0))->GetReceived();
424  uint64_t totalPacketsThroughC = DynamicCast<UdpServer>(serverAppC.Get(0))->GetReceived();
425  uint64_t totalPacketsThroughD = DynamicCast<UdpServer>(serverAppD.Get(0))->GetReceived();
426 
428 
429  double throughput = totalPacketsThroughA * payloadSize * 8 / (simulationTime * 1000000.0);
430  std::cout << "Default configuration (A-MPDU aggregation enabled, 65kB): " << '\n'
431  << " Throughput = " << throughput << " Mbit/s" << '\n';
432  if (verifyResults && (throughput < 57.5 || throughput > 58.5))
433  {
434  NS_LOG_ERROR("Obtained throughput " << throughput << " is not in the expected boundaries!");
435  exit(1);
436  }
437  if (txopLimit)
438  {
439  std::cout << " Maximum TXOP duration (TXOP limit = " << txopLimit
440  << "us): " << netA.m_max.GetMicroSeconds() << " us" << '\n';
441  if (verifyResults && txopLimit &&
442  (netA.m_max < MicroSeconds(3350) || netA.m_max > MicroSeconds(3520)))
443  {
444  NS_LOG_ERROR("Maximum TXOP duration " << netA.m_max
445  << " is not in the expected boundaries!");
446  exit(1);
447  }
448  }
449 
450  throughput = totalPacketsThroughB * payloadSize * 8 / (simulationTime * 1000000.0);
451  std::cout << "Aggregation disabled: " << '\n'
452  << " Throughput = " << throughput << " Mbit/s" << '\n';
453  if (verifyResults && (throughput < 38 || throughput > 39))
454  {
455  NS_LOG_ERROR("Obtained throughput " << throughput << " is not in the expected boundaries!");
456  exit(1);
457  }
458  if (txopLimit)
459  {
460  std::cout << " Maximum TXOP duration (TXOP limit = " << txopLimit
461  << "us): " << netB.m_max.GetMicroSeconds() << " us" << '\n';
462  if (verifyResults && (netB.m_max < MicroSeconds(3350) || netB.m_max > MicroSeconds(3520)))
463  {
464  NS_LOG_ERROR("Maximum TXOP duration " << netB.m_max
465  << " is not in the expected boundaries!");
466  exit(1);
467  }
468  }
469 
470  throughput = totalPacketsThroughC * payloadSize * 8 / (simulationTime * 1000000.0);
471  std::cout << "A-MPDU disabled and A-MSDU enabled (8kB): " << '\n'
472  << " Throughput = " << throughput << " Mbit/s" << '\n';
473  if (verifyResults && (throughput < 52 || throughput > 53))
474  {
475  NS_LOG_ERROR("Obtained throughput " << throughput << " is not in the expected boundaries!");
476  exit(1);
477  }
478  if (txopLimit)
479  {
480  std::cout << " Maximum TXOP duration (TXOP limit = " << txopLimit
481  << "us): " << netC.m_max.GetMicroSeconds() << " us" << '\n';
482  if (verifyResults && (netC.m_max < MicroSeconds(3350) || netC.m_max > MicroSeconds(3520)))
483  {
484  NS_LOG_ERROR("Maximum TXOP duration " << netC.m_max
485  << " is not in the expected boundaries!");
486  exit(1);
487  }
488  }
489 
490  throughput = totalPacketsThroughD * payloadSize * 8 / (simulationTime * 1000000.0);
491  std::cout << "A-MPDU enabled (32kB) and A-MSDU enabled (4kB): " << '\n'
492  << " Throughput = " << throughput << " Mbit/s" << '\n';
493  if (verifyResults && (throughput < 58 || throughput > 59))
494  {
495  NS_LOG_ERROR("Obtained throughput " << throughput << " is not in the expected boundaries!");
496  exit(1);
497  }
498  if (txopLimit)
499  {
500  std::cout << " Maximum TXOP duration (TXOP limit = " << txopLimit
501  << "us): " << netD.m_max.GetMicroSeconds() << " us" << '\n';
502  if (verifyResults && txopLimit &&
503  (netD.m_max < MicroSeconds(3350) || netD.m_max > MicroSeconds(3520)))
504  {
505  NS_LOG_ERROR("Maximum TXOP duration " << netD.m_max
506  << " is not in the expected boundaries!");
507  exit(1);
508  }
509  }
510 
511  return 0;
512 }
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
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
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
keep track of a set of node pointers.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
Ptr< NetDevice > GetDevice(uint32_t index) const
Retrieve the index-th NetDevice associated to this node.
Definition: node.cc:152
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
Definition: object-base.cc:315
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Definition: object-base.cc:204
void GetAttribute(std::string name, AttributeValue &value) const
Get the value of an attribute, raising fatal errors if unsuccessful.
Definition: object-base.cc:244
Hold objects of type Ptr<T>.
Definition: pointer.h:37
Ptr< T > Get() const
Definition: pointer.h:202
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Handle packet fragmentation and retransmissions for QoS data frames as well as MSDU aggregation (A-MS...
Definition: qos-txop.h:74
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
The IEEE 802.11 SSID Information Element.
Definition: ssid.h:36
Hold variables of type string.
Definition: string.h:56
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
int64_t GetMicroSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:413
void SetTxopLimit(Time txopLimit)
Set the TXOP limit.
Definition: txop.cc:389
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.
Ptr< WifiMac > GetMac() const
@ DLT_IEEE802_11_RADIO
Include Radiotap link layer information.
Definition: wifi-helper.h:178
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.
uint16_t port
Definition: dsdv-manet.cc:44
void SetDefault(std::string name, const AttributeValue &value)
Definition: config.cc:890
#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:1350
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
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.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Definition: callback.h:704
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
mobility
Definition: third.py:105
wifiStaNodes
Definition: third.py:84
phy
Definition: third.py:89
Keeps the maximum duration among all TXOPs.
void Trace(Time startTime, Time duration, uint8_t linkId)
Callback connected to TXOP duration trace source.
Time m_max
maximum TXOP duration
std::ofstream throughput