A Discrete-Event Network Simulator
API
wifi-txop-aggregation.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2016 Sébastien Deronne
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Sébastien Deronne <sebastien.deronne@gmail.com>
19  */
20 
21 #include "ns3/command-line.h"
22 #include "ns3/config.h"
23 #include "ns3/uinteger.h"
24 #include "ns3/boolean.h"
25 #include "ns3/string.h"
26 #include "ns3/pointer.h"
27 #include "ns3/log.h"
28 #include "ns3/yans-wifi-helper.h"
29 #include "ns3/ssid.h"
30 #include "ns3/mobility-helper.h"
31 #include "ns3/internet-stack-helper.h"
32 #include "ns3/ipv4-address-helper.h"
33 #include "ns3/udp-client-server-helper.h"
34 #include "ns3/packet-sink-helper.h"
35 #include "ns3/yans-wifi-channel.h"
36 #include "ns3/wifi-net-device.h"
37 #include "ns3/wifi-mac.h"
38 #include "ns3/qos-txop.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 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 size of 4 kB).
57 //
58 // The user can select the distance between the stations and the APs, can enable/disable the RTS/CTS mechanism
59 // and can modify the duration of a TXOP.
60 // Example: ./waf --run "wifi-txop-aggregation --distance=10 --enableRts=0 --simulationTime=20"
61 //
62 // The output prints the throughput and the maximum TXOP duration measured for the 4 cases/networks
63 // described above. When default aggregation parameters are enabled, the
64 // maximum A-MPDU size is 65 kB and the throughput is maximal. When aggregation is disabled, the throughput is about the half of the physical
65 // bitrate. When only A-MSDU is enabled, the throughput is increased but is not maximal, since the maximum A-MSDU size is limited to 7935 bytes
66 // (whereas the maximum A-MPDU size is limited to 65535 bytes). When A-MSDU and A-MPDU are both enabled (= two-level aggregation),
67 // the throughput is slightly smaller than the first scenario since we set a smaller maximum A-MPDU size.
68 //
69 // When the distance is increased, the frame error rate gets higher, and the output shows how it affects the throughput for the 4 networks.
70 // Even through A-MSDU has less overheads than A-MPDU, A-MSDU is less robust against transmission errors than A-MPDU. When the distance is
71 // augmented, the throughput for the third scenario is more affected than the throughput obtained in other networks.
72 
73 using namespace ns3;
74 
75 NS_LOG_COMPONENT_DEFINE ("TxopMpduAggregation");
76 
80 struct TxopDurationTracer
81 {
82  void Trace (Time startTime, Time duration);
83  Time m_max {Seconds (0)};
84 };
85 
86 void
88 {
89  if (duration > m_max)
90  {
91  m_max = duration;
92  }
93 }
94 
95 int main (int argc, char *argv[])
96 {
97  uint32_t payloadSize = 1472; //bytes
98  double simulationTime = 10; //seconds
99  double txopLimit = 3520; //microseconds
100  double distance = 5; //meters
101  bool enableRts = 0;
102  bool enablePcap = 0;
103  bool verifyResults = 0; //used for regression
104 
105  CommandLine cmd (__FILE__);
106  cmd.AddValue ("payloadSize", "Payload size in bytes", payloadSize);
107  cmd.AddValue ("enableRts", "Enable or disable RTS/CTS", enableRts);
108  cmd.AddValue ("txopLimit", "TXOP duration in microseconds", txopLimit);
109  cmd.AddValue ("simulationTime", "Simulation time in seconds", simulationTime);
110  cmd.AddValue ("distance", "Distance in meters between the station and the access point", distance);
111  cmd.AddValue ("enablePcap", "Enable/disable pcap file generation", enablePcap);
112  cmd.AddValue ("verifyResults", "Enable/disable results verification at the end of the simulation", verifyResults);
113  cmd.Parse (argc, argv);
114 
115  Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", enableRts ? StringValue ("0") : StringValue ("999999"));
116 
118  wifiStaNodes.Create (4);
119  NodeContainer wifiApNodes;
120  wifiApNodes.Create (4);
121 
124  phy.SetPcapDataLinkType (WifiPhyHelper::DLT_IEEE802_11_RADIO);
125  phy.SetChannel (channel.Create ());
126 
128  wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ);
129  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue ("HtMcs7"), "ControlMode", StringValue ("HtMcs0"));
131 
132  NetDeviceContainer staDeviceA, staDeviceB, staDeviceC, staDeviceD, apDeviceA, apDeviceB, apDeviceC, apDeviceD;
133  Ssid ssid;
134 
135  // Network A
136  ssid = Ssid ("network-A");
137  phy.Set ("ChannelNumber", UintegerValue (36));
138  mac.SetType ("ns3::StaWifiMac",
139  "Ssid", SsidValue (ssid));
140  staDeviceA = wifi.Install (phy, mac, wifiStaNodes.Get (0));
141 
142  mac.SetType ("ns3::ApWifiMac",
143  "Ssid", SsidValue (ssid),
144  "EnableBeaconJitter", BooleanValue (false));
145  apDeviceA = wifi.Install (phy, mac, wifiApNodes.Get (0));
146 
147  // Modify EDCA configuration (TXOP limit) for AC_BE
148  Ptr<NetDevice> dev = wifiApNodes.Get (0)->GetDevice (0);
149  Ptr<WifiNetDevice> wifi_dev = DynamicCast<WifiNetDevice> (dev);
150  PointerValue ptr;
151  Ptr<QosTxop> edca;
152  wifi_dev->GetMac ()->GetAttribute ("BE_Txop", ptr);
153  edca = ptr.Get<QosTxop> ();
154  edca->SetTxopLimit (MicroSeconds (txopLimit));
155 
156  // Trace TXOP duration for BE on AP A
157  TxopDurationTracer netA;
159 
160  // Network B
161  ssid = Ssid ("network-B");
162  phy.Set ("ChannelNumber", UintegerValue (40));
163  mac.SetType ("ns3::StaWifiMac",
164  "Ssid", SsidValue (ssid));
165 
166  staDeviceB = wifi.Install (phy, mac, wifiStaNodes.Get (1));
167 
168  // Disable A-MPDU
169  dev = wifiStaNodes.Get (1)->GetDevice (0);
170  wifi_dev = DynamicCast<WifiNetDevice> (dev);
171  wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmpduSize", UintegerValue (0));
172 
173  mac.SetType ("ns3::ApWifiMac",
174  "Ssid", SsidValue (ssid),
175  "EnableBeaconJitter", BooleanValue (false));
176  apDeviceB = wifi.Install (phy, mac, wifiApNodes.Get (1));
177 
178  // Disable A-MPDU
179  dev = wifiApNodes.Get (1)->GetDevice (0);
180  wifi_dev = DynamicCast<WifiNetDevice> (dev);
181  wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmpduSize", UintegerValue (0));
182 
183  // Modify EDCA configuration (TXOP limit) for AC_BE
184  wifi_dev->GetMac ()->GetAttribute ("BE_Txop", ptr);
185  edca = ptr.Get<QosTxop> ();
186  edca->SetTxopLimit (MicroSeconds (txopLimit));
187 
188  // Trace TXOP duration for BE on AP B
189  TxopDurationTracer netB;
191 
192  // Network C
193  ssid = Ssid ("network-C");
194  phy.Set ("ChannelNumber", UintegerValue (44));
195  mac.SetType ("ns3::StaWifiMac",
196  "Ssid", SsidValue (ssid));
197 
198  staDeviceC = wifi.Install (phy, mac, wifiStaNodes.Get (2));
199 
200  // Disable A-MPDU and enable A-MSDU with the highest maximum size allowed by the standard (7935 bytes)
201  dev = wifiStaNodes.Get (2)->GetDevice (0);
202  wifi_dev = DynamicCast<WifiNetDevice> (dev);
203  wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmpduSize", UintegerValue (0));
204  wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmsduSize", UintegerValue (7935));
205 
206  mac.SetType ("ns3::ApWifiMac",
207  "Ssid", SsidValue (ssid),
208  "EnableBeaconJitter", BooleanValue (false));
209  apDeviceC = wifi.Install (phy, mac, wifiApNodes.Get (2));
210 
211  // Disable A-MPDU and enable A-MSDU with the highest maximum size allowed by the standard (7935 bytes)
212  dev = wifiApNodes.Get (2)->GetDevice (0);
213  wifi_dev = DynamicCast<WifiNetDevice> (dev);
214  wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmpduSize", UintegerValue (0));
215  wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmsduSize", UintegerValue (7935));
216 
217  // Modify EDCA configuration (TXOP limit) for AC_BE
218  wifi_dev->GetMac ()->GetAttribute ("BE_Txop", ptr);
219  edca = ptr.Get<QosTxop> ();
220  edca->SetTxopLimit (MicroSeconds (txopLimit));
221 
222  // Trace TXOP duration for BE on AP C
223  TxopDurationTracer netC;
225 
226  // Network D
227  ssid = Ssid ("network-D");
228  phy.Set ("ChannelNumber", UintegerValue (48));
229  mac.SetType ("ns3::StaWifiMac",
230  "Ssid", SsidValue (ssid));
231 
232  staDeviceD = wifi.Install (phy, mac, wifiStaNodes.Get (3));
233 
234  // Enable A-MPDU with a smaller size than the default one and
235  // enable A-MSDU with the smallest maximum size allowed by the standard (3839 bytes)
236  dev = wifiStaNodes.Get (3)->GetDevice (0);
237  wifi_dev = DynamicCast<WifiNetDevice> (dev);
238  wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmpduSize", UintegerValue (32768));
239  wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmsduSize", UintegerValue (3839));
240 
241  mac.SetType ("ns3::ApWifiMac",
242  "Ssid", SsidValue (ssid),
243  "EnableBeaconJitter", BooleanValue (false));
244  apDeviceD = wifi.Install (phy, mac, wifiApNodes.Get (3));
245 
246  // Enable A-MPDU with a smaller size than the default one and
247  // enable A-MSDU with the smallest maximum size allowed by the standard (3839 bytes)
248  dev = wifiApNodes.Get (3)->GetDevice (0);
249  wifi_dev = DynamicCast<WifiNetDevice> (dev);
250  wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmpduSize", UintegerValue (32768));
251  wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmsduSize", UintegerValue (3839));
252 
253  // Modify EDCA configuration (TXOP limit) for AC_BE
254  wifi_dev->GetMac ()->GetAttribute ("BE_Txop", ptr);
255  edca = ptr.Get<QosTxop> ();
256  edca->SetTxopLimit (MicroSeconds (txopLimit));
257 
258  // Trace TXOP duration for BE on AP D
259  TxopDurationTracer netD;
261 
262  // Setting mobility model
264  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
265  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
266 
267  // Set position for APs
268  positionAlloc->Add (Vector (0.0, 0.0, 0.0));
269  positionAlloc->Add (Vector (10.0, 0.0, 0.0));
270  positionAlloc->Add (Vector (20.0, 0.0, 0.0));
271  positionAlloc->Add (Vector (30.0, 0.0, 0.0));
272  // Set position for STAs
273  positionAlloc->Add (Vector (distance, 0.0, 0.0));
274  positionAlloc->Add (Vector (10 + distance, 0.0, 0.0));
275  positionAlloc->Add (Vector (20 + distance, 0.0, 0.0));
276  positionAlloc->Add (Vector (30 + distance, 0.0, 0.0));
277 
278  mobility.SetPositionAllocator (positionAlloc);
279  mobility.Install (wifiApNodes);
280  mobility.Install (wifiStaNodes);
281 
282  // Internet stack
284  stack.Install (wifiApNodes);
285  stack.Install (wifiStaNodes);
286 
288  address.SetBase ("192.168.1.0", "255.255.255.0");
289  Ipv4InterfaceContainer StaInterfaceA;
290  StaInterfaceA = address.Assign (staDeviceA);
291  Ipv4InterfaceContainer ApInterfaceA;
292  ApInterfaceA = address.Assign (apDeviceA);
293 
294  address.SetBase ("192.168.2.0", "255.255.255.0");
295  Ipv4InterfaceContainer StaInterfaceB;
296  StaInterfaceB = address.Assign (staDeviceB);
297  Ipv4InterfaceContainer ApInterfaceB;
298  ApInterfaceB = address.Assign (apDeviceB);
299 
300  address.SetBase ("192.168.3.0", "255.255.255.0");
301  Ipv4InterfaceContainer StaInterfaceC;
302  StaInterfaceC = address.Assign (staDeviceC);
303  Ipv4InterfaceContainer ApInterfaceC;
304  ApInterfaceC = address.Assign (apDeviceC);
305 
306  address.SetBase ("192.168.4.0", "255.255.255.0");
307  Ipv4InterfaceContainer StaInterfaceD;
308  StaInterfaceD = address.Assign (staDeviceD);
309  Ipv4InterfaceContainer ApInterfaceD;
310  ApInterfaceD = address.Assign (apDeviceD);
311 
312  // Setting applications
313  uint16_t port = 9;
314  UdpServerHelper serverA (port);
315  ApplicationContainer serverAppA = serverA.Install (wifiStaNodes.Get (0));
316  serverAppA.Start (Seconds (0.0));
317  serverAppA.Stop (Seconds (simulationTime + 1));
318 
319  UdpClientHelper clientA (StaInterfaceA.GetAddress (0), port);
320  clientA.SetAttribute ("MaxPackets", UintegerValue (4294967295u));
321  clientA.SetAttribute ("Interval", TimeValue (Time ("0.0001"))); //packets/s
322  clientA.SetAttribute ("PacketSize", UintegerValue (payloadSize));
323 
324  ApplicationContainer clientAppA = clientA.Install (wifiApNodes.Get (0));
325  clientAppA.Start (Seconds (1.0));
326  clientAppA.Stop (Seconds (simulationTime + 1));
327 
328  UdpServerHelper serverB (port);
329  ApplicationContainer serverAppB = serverB.Install (wifiStaNodes.Get (1));
330  serverAppB.Start (Seconds (0.0));
331  serverAppB.Stop (Seconds (simulationTime + 1));
332 
333  UdpClientHelper clientB (StaInterfaceB.GetAddress (0), port);
334  clientB.SetAttribute ("MaxPackets", UintegerValue (4294967295u));
335  clientB.SetAttribute ("Interval", TimeValue (Time ("0.0001"))); //packets/s
336  clientB.SetAttribute ("PacketSize", UintegerValue (payloadSize));
337 
338  ApplicationContainer clientAppB = clientB.Install (wifiApNodes.Get (1));
339  clientAppB.Start (Seconds (1.0));
340  clientAppB.Stop (Seconds (simulationTime + 1));
341 
342  UdpServerHelper serverC (port);
343  ApplicationContainer serverAppC = serverC.Install (wifiStaNodes.Get (2));
344  serverAppC.Start (Seconds (0.0));
345  serverAppC.Stop (Seconds (simulationTime + 1));
346 
347  UdpClientHelper clientC (StaInterfaceC.GetAddress (0), port);
348  clientC.SetAttribute ("MaxPackets", UintegerValue (4294967295u));
349  clientC.SetAttribute ("Interval", TimeValue (Time ("0.0001"))); //packets/s
350  clientC.SetAttribute ("PacketSize", UintegerValue (payloadSize));
351 
352  ApplicationContainer clientAppC = clientC.Install (wifiApNodes.Get (2));
353  clientAppC.Start (Seconds (1.0));
354  clientAppC.Stop (Seconds (simulationTime + 1));
355 
356  UdpServerHelper serverD (port);
357  ApplicationContainer serverAppD = serverD.Install (wifiStaNodes.Get (3));
358  serverAppD.Start (Seconds (0.0));
359  serverAppD.Stop (Seconds (simulationTime + 1));
360 
361  UdpClientHelper clientD (StaInterfaceD.GetAddress (0), port);
362  clientD.SetAttribute ("MaxPackets", UintegerValue (4294967295u));
363  clientD.SetAttribute ("Interval", TimeValue (Time ("0.0001"))); //packets/s
364  clientD.SetAttribute ("PacketSize", UintegerValue (payloadSize));
365 
366  ApplicationContainer clientAppD = clientD.Install (wifiApNodes.Get (3));
367  clientAppD.Start (Seconds (1.0));
368  clientAppD.Stop (Seconds (simulationTime + 1));
369 
370  if (enablePcap)
371  {
372  phy.EnablePcap ("AP_A", apDeviceA.Get (0));
373  phy.EnablePcap ("STA_A", staDeviceA.Get (0));
374  phy.EnablePcap ("AP_B", apDeviceB.Get (0));
375  phy.EnablePcap ("STA_B", staDeviceB.Get (0));
376  phy.EnablePcap ("AP_C", apDeviceC.Get (0));
377  phy.EnablePcap ("STA_C", staDeviceC.Get (0));
378  phy.EnablePcap ("AP_D", apDeviceD.Get (0));
379  phy.EnablePcap ("STA_D", staDeviceD.Get (0));
380  }
381 
382  Simulator::Stop (Seconds (simulationTime + 1));
383  Simulator::Run ();
384 
385  // Show results
386  uint64_t totalPacketsThroughA = DynamicCast<UdpServer> (serverAppA.Get (0))->GetReceived ();
387  uint64_t totalPacketsThroughB = DynamicCast<UdpServer> (serverAppB.Get (0))->GetReceived ();
388  uint64_t totalPacketsThroughC = DynamicCast<UdpServer> (serverAppC.Get (0))->GetReceived ();
389  uint64_t totalPacketsThroughD = DynamicCast<UdpServer> (serverAppD.Get (0))->GetReceived ();
390 
392 
393  double throughput = totalPacketsThroughA * payloadSize * 8 / (simulationTime * 1000000.0);
394  std::cout << "Default configuration (A-MPDU aggregation enabled, 65kB): " << '\n'
395  << " Throughput = " << throughput << " Mbit/s" << '\n';
396  if (verifyResults && (throughput < 57.5 || throughput > 58.5))
397  {
398  NS_LOG_ERROR ("Obtained throughput " << throughput << " is not in the expected boundaries!");
399  exit (1);
400  }
401  if (txopLimit)
402  {
403  std::cout << " Maximum TXOP duration (TXOP limit = " << txopLimit << "us): "
404  << netA.m_max.GetMicroSeconds () << " us" << '\n';
405  if (verifyResults && txopLimit && (netA.m_max < MicroSeconds (3350) || netA.m_max > MicroSeconds (3520)))
406  {
407  NS_LOG_ERROR ("Maximum TXOP duration " << netA.m_max << " is not in the expected boundaries!");
408  exit (1);
409  }
410  }
411 
412  throughput = totalPacketsThroughB * payloadSize * 8 / (simulationTime * 1000000.0);
413  std::cout << "Aggregation disabled: " << '\n'
414  << " Throughput = " << throughput << " Mbit/s" << '\n';
415  if (verifyResults && (throughput < 38 || throughput > 39))
416  {
417  NS_LOG_ERROR ("Obtained throughput " << throughput << " is not in the expected boundaries!");
418  exit (1);
419  }
420  if (txopLimit)
421  {
422  std::cout << " Maximum TXOP duration (TXOP limit = " << txopLimit << "us): "
423  << netB.m_max.GetMicroSeconds () << " us" << '\n';
424  if (verifyResults && (netB.m_max < MicroSeconds (3350) || netB.m_max > MicroSeconds (3520)))
425  {
426  NS_LOG_ERROR ("Maximum TXOP duration " << netB.m_max << " is not in the expected boundaries!");
427  exit (1);
428  }
429  }
430 
431  throughput = totalPacketsThroughC * payloadSize * 8 / (simulationTime * 1000000.0);
432  std::cout << "A-MPDU disabled and A-MSDU enabled (8kB): " << '\n'
433  << " Throughput = " << throughput << " Mbit/s" << '\n';
434  if (verifyResults && (throughput < 52 || throughput > 53))
435  {
436  NS_LOG_ERROR ("Obtained throughput " << throughput << " is not in the expected boundaries!");
437  exit (1);
438  }
439  if (txopLimit)
440  {
441  std::cout << " Maximum TXOP duration (TXOP limit = " << txopLimit << "us): "
442  << netC.m_max.GetMicroSeconds () << " us" << '\n';
443  if (verifyResults && (netC.m_max < MicroSeconds (3350) || netC.m_max > MicroSeconds (3520)))
444  {
445  NS_LOG_ERROR ("Maximum TXOP duration " << netC.m_max << " is not in the expected boundaries!");
446  exit (1);
447  }
448  }
449 
450  throughput = totalPacketsThroughD * payloadSize * 8 / (simulationTime * 1000000.0);
451  std::cout << "A-MPDU enabled (32kB) and A-MSDU enabled (4kB): " << '\n'
452  << " Throughput = " << throughput << " Mbit/s" << '\n';
453  if (verifyResults && (throughput < 58 || throughput > 59))
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 << "us): "
461  << netD.m_max.GetMicroSeconds () << " us" << '\n';
462  if (verifyResults && txopLimit && (netD.m_max < MicroSeconds (3350) || netD.m_max > MicroSeconds (3520)))
463  {
464  NS_LOG_ERROR ("Maximum TXOP duration " << netD.m_max << " is not in the expected boundaries!");
465  exit (1);
466  }
467  }
468 
469  return 0;
470 }
holds a vector of ns3::Application pointers.
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
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.
static YansWifiChannelHelper Default(void)
Create a channel helper in a default working state.
Ptr< NetDevice > GetDevice(uint32_t index) const
Retrieve the index-th NetDevice associated to this node.
Definition: node.cc:144
bool enablePcap
Handle packet fragmentation and retransmissions for QoS data frames as well as MSDU aggregation (A-MS...
Definition: qos-txop.h:74
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.
Keeps the maximum duration among all TXOPs.
cmd
Definition: second.py:35
helps to create WifiNetDevice objects
Definition: wifi-helper.h:326
stack
Definition: first.py:41
void Trace(Time startTime, Time duration)
uint16_t port
Definition: dsdv-manet.cc:45
channel
Definition: third.py:92
mobility
Definition: third.py:108
phy
Definition: third.py:93
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
Hold an unsigned integer type.
Definition: uinteger.h:44
double startTime
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...
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.
int64_t GetMicroSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:388
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
Definition: object-base.cc:293
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
Hold objects of type Ptr<T>.
Definition: pointer.h:36
address
Definition: first.py:44
manage and create wifi channel objects for the YANS model.
create MAC layers for a ns3::WifiNetDevice.
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...
Ptr< WifiMac > GetMac(void) const
void SetTxopLimit(Time txopLimit)
Set the TXOP limit.
Definition: txop.cc:248
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
Definition: simulator.cc:180
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1289
AttributeValue implementation for Ssid.
Definition: ssid.h:105
void SetDefault(std::string name, const AttributeValue &value)
Definition: config.cc:849
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.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1305
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
Definition: log.h:257
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
wifiStaNodes
Definition: third.py:88
Include Radiotap link layer information.
Definition: wifi-helper.h:180
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Definition: callback.h:1642
Ptr< Application > Get(uint32_t i) const
Get the Ptr<Application> stored in this container at a given index.