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