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