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 * 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=20s"
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
79using namespace ns3;
80
81NS_LOG_COMPONENT_DEFINE("TxopMpduAggregation");
82
83/**
84 * Keeps the maximum duration among all TXOPs
85 */
87{
88 /**
89 * Callback connected to TXOP duration trace source.
90 *
91 * \param startTime TXOP start time
92 * \param duration TXOP duration
93 * \param linkId the ID of the link
94 */
95 void Trace(Time startTime, Time duration, uint8_t linkId);
96 Time m_max{Seconds(0)}; //!< maximum TXOP duration
97};
98
99void
100TxopDurationTracer::Trace(Time startTime, Time duration, uint8_t linkId)
101{
102 if (duration > m_max)
103 {
104 m_max = duration;
105 }
106}
107
108int
109main(int argc, char* argv[])
110{
111 uint32_t payloadSize{1472}; // bytes
112 Time simulationTime{"10s"};
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", 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 // Modify EDCA configuration (TXOP limit) for AC_BE
177 mac.SetEdca(AC_BE, "TxopLimits", StringValue(std::to_string(txopLimit) + "us"));
178 apDeviceA = wifi.Install(phy, mac, wifiApNodes.Get(0));
179
180 // Modify EDCA configuration (TXOP limit) for AC_BE
181 Ptr<NetDevice> dev = wifiApNodes.Get(0)->GetDevice(0);
182 Ptr<WifiNetDevice> wifi_dev = DynamicCast<WifiNetDevice>(dev);
183 PointerValue ptr;
184 Ptr<QosTxop> edca;
185 wifi_dev->GetMac()->GetAttribute("BE_Txop", ptr);
186 edca = ptr.Get<QosTxop>();
187
188 // Trace TXOP duration for BE on AP A
190 edca->TraceConnectWithoutContext("TxopTrace", MakeCallback(&TxopDurationTracer::Trace, &netA));
191
192 // Network B
193 ssid = Ssid("network-B");
194 phy.Set("ChannelSettings", StringValue("{40, 0, BAND_5GHZ, 0}"));
195 mac.SetType("ns3::StaWifiMac", "Ssid", SsidValue(ssid));
196
197 staDeviceB = wifi.Install(phy, mac, wifiStaNodes.Get(1));
198
199 // Disable A-MPDU
200 dev = wifiStaNodes.Get(1)->GetDevice(0);
201 wifi_dev = DynamicCast<WifiNetDevice>(dev);
202 wifi_dev->GetMac()->SetAttribute("BE_MaxAmpduSize", UintegerValue(0));
203
204 mac.SetType("ns3::ApWifiMac",
205 "Ssid",
206 SsidValue(ssid),
207 "EnableBeaconJitter",
208 BooleanValue(false));
209 // Modify EDCA configuration (TXOP limit) for AC_BE
210 mac.SetEdca(AC_BE, "TxopLimits", StringValue(std::to_string(txopLimit) + "us"));
211 apDeviceB = wifi.Install(phy, mac, wifiApNodes.Get(1));
212
213 // Disable A-MPDU
214 dev = wifiApNodes.Get(1)->GetDevice(0);
215 wifi_dev = DynamicCast<WifiNetDevice>(dev);
216 wifi_dev->GetMac()->SetAttribute("BE_MaxAmpduSize", UintegerValue(0));
217
218 wifi_dev->GetMac()->GetAttribute("BE_Txop", ptr);
219 edca = ptr.Get<QosTxop>();
220
221 // Trace TXOP duration for BE on AP B
223 edca->TraceConnectWithoutContext("TxopTrace", MakeCallback(&TxopDurationTracer::Trace, &netB));
224
225 // Network C
226 ssid = Ssid("network-C");
227 phy.Set("ChannelSettings", StringValue("{44, 0, BAND_5GHZ, 0}"));
228 mac.SetType("ns3::StaWifiMac", "Ssid", SsidValue(ssid));
229
230 staDeviceC = wifi.Install(phy, mac, wifiStaNodes.Get(2));
231
232 // Disable A-MPDU and enable A-MSDU with the highest maximum size allowed by the standard (7935
233 // bytes)
234 dev = wifiStaNodes.Get(2)->GetDevice(0);
235 wifi_dev = DynamicCast<WifiNetDevice>(dev);
236 wifi_dev->GetMac()->SetAttribute("BE_MaxAmpduSize", UintegerValue(0));
237 wifi_dev->GetMac()->SetAttribute("BE_MaxAmsduSize", UintegerValue(7935));
238
239 mac.SetType("ns3::ApWifiMac",
240 "Ssid",
241 SsidValue(ssid),
242 "EnableBeaconJitter",
243 BooleanValue(false));
244 // Modify EDCA configuration (TXOP limit) for AC_BE
245 mac.SetEdca(AC_BE, "TxopLimits", StringValue(std::to_string(txopLimit) + "us"));
246 apDeviceC = wifi.Install(phy, mac, wifiApNodes.Get(2));
247
248 // Disable A-MPDU and enable A-MSDU with the highest maximum size allowed by the standard (7935
249 // bytes)
250 dev = wifiApNodes.Get(2)->GetDevice(0);
251 wifi_dev = DynamicCast<WifiNetDevice>(dev);
252 wifi_dev->GetMac()->SetAttribute("BE_MaxAmpduSize", UintegerValue(0));
253 wifi_dev->GetMac()->SetAttribute("BE_MaxAmsduSize", UintegerValue(7935));
254
255 wifi_dev->GetMac()->GetAttribute("BE_Txop", ptr);
256 edca = ptr.Get<QosTxop>();
257
258 // Trace TXOP duration for BE on AP C
260 edca->TraceConnectWithoutContext("TxopTrace", MakeCallback(&TxopDurationTracer::Trace, &netC));
261
262 // Network D
263 ssid = Ssid("network-D");
264 phy.Set("ChannelSettings", StringValue("{48, 0, BAND_5GHZ, 0}"));
265 mac.SetType("ns3::StaWifiMac", "Ssid", SsidValue(ssid));
266
267 staDeviceD = wifi.Install(phy, mac, wifiStaNodes.Get(3));
268
269 // Enable A-MPDU with a smaller size than the default one and
270 // enable A-MSDU with the smallest maximum size allowed by the standard (3839 bytes)
271 dev = wifiStaNodes.Get(3)->GetDevice(0);
272 wifi_dev = DynamicCast<WifiNetDevice>(dev);
273 wifi_dev->GetMac()->SetAttribute("BE_MaxAmpduSize", UintegerValue(32768));
274 wifi_dev->GetMac()->SetAttribute("BE_MaxAmsduSize", UintegerValue(3839));
275
276 mac.SetType("ns3::ApWifiMac",
277 "Ssid",
278 SsidValue(ssid),
279 "EnableBeaconJitter",
280 BooleanValue(false));
281 // Modify EDCA configuration (TXOP limit) for AC_BE
282 mac.SetEdca(AC_BE, "TxopLimits", StringValue(std::to_string(txopLimit) + "us"));
283 apDeviceD = wifi.Install(phy, mac, wifiApNodes.Get(3));
284
285 // Enable A-MPDU with a smaller size than the default one and
286 // enable A-MSDU with the smallest maximum size allowed by the standard (3839 bytes)
287 dev = wifiApNodes.Get(3)->GetDevice(0);
288 wifi_dev = DynamicCast<WifiNetDevice>(dev);
289 wifi_dev->GetMac()->SetAttribute("BE_MaxAmpduSize", UintegerValue(32768));
290 wifi_dev->GetMac()->SetAttribute("BE_MaxAmsduSize", UintegerValue(3839));
291
292 wifi_dev->GetMac()->GetAttribute("BE_Txop", ptr);
293 edca = ptr.Get<QosTxop>();
294
295 // Trace TXOP duration for BE on AP D
297 edca->TraceConnectWithoutContext("TxopTrace", MakeCallback(&TxopDurationTracer::Trace, &netD));
298
299 // Setting mobility model
301 Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator>();
302 mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
303
304 // Set position for APs
305 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
306 positionAlloc->Add(Vector(10.0, 0.0, 0.0));
307 positionAlloc->Add(Vector(20.0, 0.0, 0.0));
308 positionAlloc->Add(Vector(30.0, 0.0, 0.0));
309 // Set position for STAs
310 positionAlloc->Add(Vector(distance, 0.0, 0.0));
311 positionAlloc->Add(Vector(10 + distance, 0.0, 0.0));
312 positionAlloc->Add(Vector(20 + distance, 0.0, 0.0));
313 positionAlloc->Add(Vector(30 + distance, 0.0, 0.0));
314
315 mobility.SetPositionAllocator(positionAlloc);
316 mobility.Install(wifiApNodes);
317 mobility.Install(wifiStaNodes);
318
319 // Internet stack
321 stack.Install(wifiApNodes);
322 stack.Install(wifiStaNodes);
323
325 address.SetBase("192.168.1.0", "255.255.255.0");
326 Ipv4InterfaceContainer StaInterfaceA;
327 StaInterfaceA = address.Assign(staDeviceA);
328 Ipv4InterfaceContainer ApInterfaceA;
329 ApInterfaceA = address.Assign(apDeviceA);
330
331 address.SetBase("192.168.2.0", "255.255.255.0");
332 Ipv4InterfaceContainer StaInterfaceB;
333 StaInterfaceB = address.Assign(staDeviceB);
334 Ipv4InterfaceContainer ApInterfaceB;
335 ApInterfaceB = address.Assign(apDeviceB);
336
337 address.SetBase("192.168.3.0", "255.255.255.0");
338 Ipv4InterfaceContainer StaInterfaceC;
339 StaInterfaceC = address.Assign(staDeviceC);
340 Ipv4InterfaceContainer ApInterfaceC;
341 ApInterfaceC = address.Assign(apDeviceC);
342
343 address.SetBase("192.168.4.0", "255.255.255.0");
344 Ipv4InterfaceContainer StaInterfaceD;
345 StaInterfaceD = address.Assign(staDeviceD);
346 Ipv4InterfaceContainer ApInterfaceD;
347 ApInterfaceD = address.Assign(apDeviceD);
348
349 // Setting applications
350 uint16_t port = 9;
351 UdpServerHelper serverA(port);
352 ApplicationContainer serverAppA = serverA.Install(wifiStaNodes.Get(0));
353 serverAppA.Start(Seconds(0.0));
354 serverAppA.Stop(simulationTime + Seconds(1.0));
355
356 UdpClientHelper clientA(StaInterfaceA.GetAddress(0), port);
357 clientA.SetAttribute("MaxPackets", UintegerValue(4294967295U));
358 clientA.SetAttribute("Interval", TimeValue(Time("0.0001"))); // packets/s
359 clientA.SetAttribute("PacketSize", UintegerValue(payloadSize));
360
361 ApplicationContainer clientAppA = clientA.Install(wifiApNodes.Get(0));
362 clientAppA.Start(Seconds(1.0));
363 clientAppA.Stop(simulationTime + Seconds(1.0));
364
365 UdpServerHelper serverB(port);
366 ApplicationContainer serverAppB = serverB.Install(wifiStaNodes.Get(1));
367 serverAppB.Start(Seconds(0.0));
368 serverAppB.Stop(simulationTime + Seconds(1.0));
369
370 UdpClientHelper clientB(StaInterfaceB.GetAddress(0), port);
371 clientB.SetAttribute("MaxPackets", UintegerValue(4294967295U));
372 clientB.SetAttribute("Interval", TimeValue(Time("0.0001"))); // packets/s
373 clientB.SetAttribute("PacketSize", UintegerValue(payloadSize));
374
375 ApplicationContainer clientAppB = clientB.Install(wifiApNodes.Get(1));
376 clientAppB.Start(Seconds(1.0));
377 clientAppB.Stop(simulationTime + Seconds(1.0));
378
379 UdpServerHelper serverC(port);
380 ApplicationContainer serverAppC = serverC.Install(wifiStaNodes.Get(2));
381 serverAppC.Start(Seconds(0.0));
382 serverAppC.Stop(simulationTime + Seconds(1.0));
383
384 UdpClientHelper clientC(StaInterfaceC.GetAddress(0), port);
385 clientC.SetAttribute("MaxPackets", UintegerValue(4294967295U));
386 clientC.SetAttribute("Interval", TimeValue(Time("0.0001"))); // packets/s
387 clientC.SetAttribute("PacketSize", UintegerValue(payloadSize));
388
389 ApplicationContainer clientAppC = clientC.Install(wifiApNodes.Get(2));
390 clientAppC.Start(Seconds(1.0));
391 clientAppC.Stop(simulationTime + Seconds(1.0));
392
393 UdpServerHelper serverD(port);
394 ApplicationContainer serverAppD = serverD.Install(wifiStaNodes.Get(3));
395 serverAppD.Start(Seconds(0.0));
396 serverAppD.Stop(simulationTime + Seconds(1.0));
397
398 UdpClientHelper clientD(StaInterfaceD.GetAddress(0), port);
399 clientD.SetAttribute("MaxPackets", UintegerValue(4294967295U));
400 clientD.SetAttribute("Interval", TimeValue(Time("0.0001"))); // packets/s
401 clientD.SetAttribute("PacketSize", UintegerValue(payloadSize));
402
403 ApplicationContainer clientAppD = clientD.Install(wifiApNodes.Get(3));
404 clientAppD.Start(Seconds(1.0));
405 clientAppD.Stop(simulationTime + Seconds(1.0));
406
407 if (enablePcap)
408 {
409 phy.EnablePcap("AP_A", apDeviceA.Get(0));
410 phy.EnablePcap("STA_A", staDeviceA.Get(0));
411 phy.EnablePcap("AP_B", apDeviceB.Get(0));
412 phy.EnablePcap("STA_B", staDeviceB.Get(0));
413 phy.EnablePcap("AP_C", apDeviceC.Get(0));
414 phy.EnablePcap("STA_C", staDeviceC.Get(0));
415 phy.EnablePcap("AP_D", apDeviceD.Get(0));
416 phy.EnablePcap("STA_D", staDeviceD.Get(0));
417 }
418
419 Simulator::Stop(simulationTime + Seconds(1.0));
421
422 // Show results
423 double totalPacketsThroughA = DynamicCast<UdpServer>(serverAppA.Get(0))->GetReceived();
424 double totalPacketsThroughB = DynamicCast<UdpServer>(serverAppB.Get(0))->GetReceived();
425 double totalPacketsThroughC = DynamicCast<UdpServer>(serverAppC.Get(0))->GetReceived();
426 double totalPacketsThroughD = DynamicCast<UdpServer>(serverAppD.Get(0))->GetReceived();
427
429
430 auto throughput = totalPacketsThroughA * payloadSize * 8 / simulationTime.GetMicroSeconds();
431 std::cout << "Default configuration (A-MPDU aggregation enabled, 65kB): " << '\n'
432 << " Throughput = " << throughput << " Mbit/s" << '\n';
433 if (verifyResults && (throughput < 57.5 || throughput > 58.5))
434 {
435 NS_LOG_ERROR("Obtained throughput " << throughput << " is not in the expected boundaries!");
436 exit(1);
437 }
438 if (txopLimit)
439 {
440 std::cout << " Maximum TXOP duration (TXOP limit = " << txopLimit
441 << "us): " << netA.m_max.GetMicroSeconds() << " us" << '\n';
442 if (verifyResults && txopLimit &&
443 (netA.m_max < MicroSeconds(3350) || netA.m_max > MicroSeconds(3520)))
444 {
445 NS_LOG_ERROR("Maximum TXOP duration " << netA.m_max
446 << " is not in the expected boundaries!");
447 exit(1);
448 }
449 }
450
451 throughput = totalPacketsThroughB * payloadSize * 8 / simulationTime.GetMicroSeconds();
452 std::cout << "Aggregation disabled: " << '\n'
453 << " Throughput = " << throughput << " Mbit/s" << '\n';
454 if (verifyResults && (throughput < 38 || throughput > 39))
455 {
456 NS_LOG_ERROR("Obtained throughput " << throughput << " is not in the expected boundaries!");
457 exit(1);
458 }
459 if (txopLimit)
460 {
461 std::cout << " Maximum TXOP duration (TXOP limit = " << txopLimit
462 << "us): " << netB.m_max.GetMicroSeconds() << " us" << '\n';
463 if (verifyResults && (netB.m_max < MicroSeconds(3350) || netB.m_max > MicroSeconds(3520)))
464 {
465 NS_LOG_ERROR("Maximum TXOP duration " << netB.m_max
466 << " is not in the expected boundaries!");
467 exit(1);
468 }
469 }
470
471 throughput = totalPacketsThroughC * payloadSize * 8 / simulationTime.GetMicroSeconds();
472 std::cout << "A-MPDU disabled and A-MSDU enabled (8kB): " << '\n'
473 << " Throughput = " << throughput << " Mbit/s" << '\n';
474 if (verifyResults && (throughput < 52 || throughput > 53))
475 {
476 NS_LOG_ERROR("Obtained throughput " << throughput << " is not in the expected boundaries!");
477 exit(1);
478 }
479 if (txopLimit)
480 {
481 std::cout << " Maximum TXOP duration (TXOP limit = " << txopLimit
482 << "us): " << netC.m_max.GetMicroSeconds() << " us" << '\n';
483 if (verifyResults && (netC.m_max < MicroSeconds(3350) || netC.m_max > MicroSeconds(3520)))
484 {
485 NS_LOG_ERROR("Maximum TXOP duration " << netC.m_max
486 << " is not in the expected boundaries!");
487 exit(1);
488 }
489 }
490
491 throughput = totalPacketsThroughD * payloadSize * 8 / simulationTime.GetMicroSeconds();
492 std::cout << "A-MPDU enabled (32kB) and A-MSDU enabled (4kB): " << '\n'
493 << " Throughput = " << throughput << " Mbit/s" << '\n';
494 if (verifyResults && (throughput < 58 || throughput > 59))
495 {
496 NS_LOG_ERROR("Obtained throughput " << throughput << " is not in the expected boundaries!");
497 exit(1);
498 }
499 if (txopLimit)
500 {
501 std::cout << " Maximum TXOP duration (TXOP limit = " << txopLimit
502 << "us): " << netD.m_max.GetMicroSeconds() << " us" << '\n';
503 if (verifyResults && txopLimit &&
504 (netD.m_max < MicroSeconds(3350) || netD.m_max > MicroSeconds(3520)))
505 {
506 NS_LOG_ERROR("Maximum TXOP duration " << netD.m_max
507 << " is not in the expected boundaries!");
508 exit(1);
509 }
510 }
511
512 return 0;
513}
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:149
AttributeValue implementation for Pointer.
Definition: pointer.h:48
Ptr< T > Get() const
Definition: pointer.h:234
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
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.
@ 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:894
#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:1343
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1319
@ WIFI_STANDARD_80211n
@ AC_BE
Best Effort.
Definition: qos-utils.h:75
ns address
Definition: first.py:47
ns stack
Definition: first.py:44
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:700
ns cmd
Definition: second.py:40
ns wifi
Definition: third.py:95
ns ssid
Definition: third.py:93
ns mac
Definition: third.py:92
ns channel
Definition: third.py:88
ns mobility
Definition: third.py:103
ns wifiStaNodes
Definition: third.py:84
ns 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