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: ./ns3 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
73using namespace ns3;
74
75NS_LOG_COMPONENT_DEFINE ("TxopMpduAggregation");
76
81{
88 void Trace (Time startTime, Time duration);
89 Time m_max {Seconds (0)};
90};
91
92void
93TxopDurationTracer::Trace (Time startTime, Time duration)
94{
95 if (duration > m_max)
96 {
97 m_max = duration;
98 }
99}
100
101int main (int argc, char *argv[])
102{
103 uint32_t payloadSize = 1472; //bytes
104 double simulationTime = 10; //seconds
105 double txopLimit = 3520; //microseconds
106 double distance = 5; //meters
107 bool enableRts = 0;
108 bool enablePcap = 0;
109 bool verifyResults = 0; //used for regression
110
111 CommandLine cmd (__FILE__);
112 cmd.AddValue ("payloadSize", "Payload size in bytes", payloadSize);
113 cmd.AddValue ("enableRts", "Enable or disable RTS/CTS", enableRts);
114 cmd.AddValue ("txopLimit", "TXOP duration in microseconds", txopLimit);
115 cmd.AddValue ("simulationTime", "Simulation time in seconds", simulationTime);
116 cmd.AddValue ("distance", "Distance in meters between the station and the access point", distance);
117 cmd.AddValue ("enablePcap", "Enable/disable pcap file generation", enablePcap);
118 cmd.AddValue ("verifyResults", "Enable/disable results verification at the end of the simulation", verifyResults);
119 cmd.Parse (argc, argv);
120
121 Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", enableRts ? StringValue ("0") : StringValue ("999999"));
122
124 wifiStaNodes.Create (4);
125 NodeContainer wifiApNodes;
126 wifiApNodes.Create (4);
127
128 YansWifiChannelHelper channel = YansWifiChannelHelper::Default ();
130 phy.SetPcapDataLinkType (WifiPhyHelper::DLT_IEEE802_11_RADIO);
131 phy.SetChannel (channel.Create ());
132
134 wifi.SetStandard (WIFI_STANDARD_80211n);
135 wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue ("HtMcs7"), "ControlMode", StringValue ("HtMcs0"));
137
138 NetDeviceContainer staDeviceA, staDeviceB, staDeviceC, staDeviceD, apDeviceA, apDeviceB, apDeviceC, apDeviceD;
139 Ssid ssid;
140
141 // Network A
142 ssid = Ssid ("network-A");
143 phy.Set ("ChannelSettings", StringValue ("{36, 0, BAND_5GHZ, 0}"));
144 mac.SetType ("ns3::StaWifiMac",
145 "Ssid", SsidValue (ssid));
146 staDeviceA = wifi.Install (phy, mac, wifiStaNodes.Get (0));
147
148 mac.SetType ("ns3::ApWifiMac",
149 "Ssid", SsidValue (ssid),
150 "EnableBeaconJitter", BooleanValue (false));
151 apDeviceA = wifi.Install (phy, mac, wifiApNodes.Get (0));
152
153 // Modify EDCA configuration (TXOP limit) for AC_BE
154 Ptr<NetDevice> dev = wifiApNodes.Get (0)->GetDevice (0);
155 Ptr<WifiNetDevice> wifi_dev = DynamicCast<WifiNetDevice> (dev);
156 PointerValue ptr;
157 Ptr<QosTxop> edca;
158 wifi_dev->GetMac ()->GetAttribute ("BE_Txop", ptr);
159 edca = ptr.Get<QosTxop> ();
160 edca->SetTxopLimit (MicroSeconds (txopLimit));
161
162 // Trace TXOP duration for BE on AP A
165
166 // Network B
167 ssid = Ssid ("network-B");
168 phy.Set ("ChannelSettings", StringValue ("{40, 0, BAND_5GHZ, 0}"));
169 mac.SetType ("ns3::StaWifiMac",
170 "Ssid", SsidValue (ssid));
171
172 staDeviceB = wifi.Install (phy, mac, wifiStaNodes.Get (1));
173
174 // Disable A-MPDU
175 dev = wifiStaNodes.Get (1)->GetDevice (0);
176 wifi_dev = DynamicCast<WifiNetDevice> (dev);
177 wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmpduSize", UintegerValue (0));
178
179 mac.SetType ("ns3::ApWifiMac",
180 "Ssid", SsidValue (ssid),
181 "EnableBeaconJitter", BooleanValue (false));
182 apDeviceB = wifi.Install (phy, mac, wifiApNodes.Get (1));
183
184 // Disable A-MPDU
185 dev = wifiApNodes.Get (1)->GetDevice (0);
186 wifi_dev = DynamicCast<WifiNetDevice> (dev);
187 wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmpduSize", UintegerValue (0));
188
189 // Modify EDCA configuration (TXOP limit) for AC_BE
190 wifi_dev->GetMac ()->GetAttribute ("BE_Txop", ptr);
191 edca = ptr.Get<QosTxop> ();
192 edca->SetTxopLimit (MicroSeconds (txopLimit));
193
194 // Trace TXOP duration for BE on AP B
197
198 // Network C
199 ssid = Ssid ("network-C");
200 phy.Set ("ChannelSettings", StringValue ("{44, 0, BAND_5GHZ, 0}"));
201 mac.SetType ("ns3::StaWifiMac",
202 "Ssid", SsidValue (ssid));
203
204 staDeviceC = wifi.Install (phy, mac, wifiStaNodes.Get (2));
205
206 // Disable A-MPDU and enable A-MSDU with the highest maximum size allowed by the standard (7935 bytes)
207 dev = wifiStaNodes.Get (2)->GetDevice (0);
208 wifi_dev = DynamicCast<WifiNetDevice> (dev);
209 wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmpduSize", UintegerValue (0));
210 wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmsduSize", UintegerValue (7935));
211
212 mac.SetType ("ns3::ApWifiMac",
213 "Ssid", SsidValue (ssid),
214 "EnableBeaconJitter", BooleanValue (false));
215 apDeviceC = wifi.Install (phy, mac, wifiApNodes.Get (2));
216
217 // Disable A-MPDU and enable A-MSDU with the highest maximum size allowed by the standard (7935 bytes)
218 dev = wifiApNodes.Get (2)->GetDevice (0);
219 wifi_dev = DynamicCast<WifiNetDevice> (dev);
220 wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmpduSize", UintegerValue (0));
221 wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmsduSize", UintegerValue (7935));
222
223 // Modify EDCA configuration (TXOP limit) for AC_BE
224 wifi_dev->GetMac ()->GetAttribute ("BE_Txop", ptr);
225 edca = ptr.Get<QosTxop> ();
226 edca->SetTxopLimit (MicroSeconds (txopLimit));
227
228 // Trace TXOP duration for BE on AP C
231
232 // Network D
233 ssid = Ssid ("network-D");
234 phy.Set ("ChannelSettings", StringValue ("{48, 0, BAND_5GHZ, 0}"));
235 mac.SetType ("ns3::StaWifiMac",
236 "Ssid", SsidValue (ssid));
237
238 staDeviceD = wifi.Install (phy, mac, wifiStaNodes.Get (3));
239
240 // Enable A-MPDU with a smaller size than the default one and
241 // enable A-MSDU with the smallest maximum size allowed by the standard (3839 bytes)
242 dev = wifiStaNodes.Get (3)->GetDevice (0);
243 wifi_dev = DynamicCast<WifiNetDevice> (dev);
244 wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmpduSize", UintegerValue (32768));
245 wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmsduSize", UintegerValue (3839));
246
247 mac.SetType ("ns3::ApWifiMac",
248 "Ssid", SsidValue (ssid),
249 "EnableBeaconJitter", BooleanValue (false));
250 apDeviceD = wifi.Install (phy, mac, wifiApNodes.Get (3));
251
252 // Enable A-MPDU with a smaller size than the default one and
253 // enable A-MSDU with the smallest maximum size allowed by the standard (3839 bytes)
254 dev = wifiApNodes.Get (3)->GetDevice (0);
255 wifi_dev = DynamicCast<WifiNetDevice> (dev);
256 wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmpduSize", UintegerValue (32768));
257 wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmsduSize", UintegerValue (3839));
258
259 // Modify EDCA configuration (TXOP limit) for AC_BE
260 wifi_dev->GetMac ()->GetAttribute ("BE_Txop", ptr);
261 edca = ptr.Get<QosTxop> ();
262 edca->SetTxopLimit (MicroSeconds (txopLimit));
263
264 // Trace TXOP duration for BE on AP D
267
268 // Setting mobility model
270 Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
271 mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
272
273 // Set position for APs
274 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
275 positionAlloc->Add (Vector (10.0, 0.0, 0.0));
276 positionAlloc->Add (Vector (20.0, 0.0, 0.0));
277 positionAlloc->Add (Vector (30.0, 0.0, 0.0));
278 // Set position for STAs
279 positionAlloc->Add (Vector (distance, 0.0, 0.0));
280 positionAlloc->Add (Vector (10 + distance, 0.0, 0.0));
281 positionAlloc->Add (Vector (20 + distance, 0.0, 0.0));
282 positionAlloc->Add (Vector (30 + distance, 0.0, 0.0));
283
284 mobility.SetPositionAllocator (positionAlloc);
285 mobility.Install (wifiApNodes);
286 mobility.Install (wifiStaNodes);
287
288 // Internet stack
290 stack.Install (wifiApNodes);
291 stack.Install (wifiStaNodes);
292
294 address.SetBase ("192.168.1.0", "255.255.255.0");
295 Ipv4InterfaceContainer StaInterfaceA;
296 StaInterfaceA = address.Assign (staDeviceA);
297 Ipv4InterfaceContainer ApInterfaceA;
298 ApInterfaceA = address.Assign (apDeviceA);
299
300 address.SetBase ("192.168.2.0", "255.255.255.0");
301 Ipv4InterfaceContainer StaInterfaceB;
302 StaInterfaceB = address.Assign (staDeviceB);
303 Ipv4InterfaceContainer ApInterfaceB;
304 ApInterfaceB = address.Assign (apDeviceB);
305
306 address.SetBase ("192.168.3.0", "255.255.255.0");
307 Ipv4InterfaceContainer StaInterfaceC;
308 StaInterfaceC = address.Assign (staDeviceC);
309 Ipv4InterfaceContainer ApInterfaceC;
310 ApInterfaceC = address.Assign (apDeviceC);
311
312 address.SetBase ("192.168.4.0", "255.255.255.0");
313 Ipv4InterfaceContainer StaInterfaceD;
314 StaInterfaceD = address.Assign (staDeviceD);
315 Ipv4InterfaceContainer ApInterfaceD;
316 ApInterfaceD = address.Assign (apDeviceD);
317
318 // Setting applications
319 uint16_t port = 9;
320 UdpServerHelper serverA (port);
321 ApplicationContainer serverAppA = serverA.Install (wifiStaNodes.Get (0));
322 serverAppA.Start (Seconds (0.0));
323 serverAppA.Stop (Seconds (simulationTime + 1));
324
325 UdpClientHelper clientA (StaInterfaceA.GetAddress (0), port);
326 clientA.SetAttribute ("MaxPackets", UintegerValue (4294967295u));
327 clientA.SetAttribute ("Interval", TimeValue (Time ("0.0001"))); //packets/s
328 clientA.SetAttribute ("PacketSize", UintegerValue (payloadSize));
329
330 ApplicationContainer clientAppA = clientA.Install (wifiApNodes.Get (0));
331 clientAppA.Start (Seconds (1.0));
332 clientAppA.Stop (Seconds (simulationTime + 1));
333
334 UdpServerHelper serverB (port);
335 ApplicationContainer serverAppB = serverB.Install (wifiStaNodes.Get (1));
336 serverAppB.Start (Seconds (0.0));
337 serverAppB.Stop (Seconds (simulationTime + 1));
338
339 UdpClientHelper clientB (StaInterfaceB.GetAddress (0), port);
340 clientB.SetAttribute ("MaxPackets", UintegerValue (4294967295u));
341 clientB.SetAttribute ("Interval", TimeValue (Time ("0.0001"))); //packets/s
342 clientB.SetAttribute ("PacketSize", UintegerValue (payloadSize));
343
344 ApplicationContainer clientAppB = clientB.Install (wifiApNodes.Get (1));
345 clientAppB.Start (Seconds (1.0));
346 clientAppB.Stop (Seconds (simulationTime + 1));
347
348 UdpServerHelper serverC (port);
349 ApplicationContainer serverAppC = serverC.Install (wifiStaNodes.Get (2));
350 serverAppC.Start (Seconds (0.0));
351 serverAppC.Stop (Seconds (simulationTime + 1));
352
353 UdpClientHelper clientC (StaInterfaceC.GetAddress (0), port);
354 clientC.SetAttribute ("MaxPackets", UintegerValue (4294967295u));
355 clientC.SetAttribute ("Interval", TimeValue (Time ("0.0001"))); //packets/s
356 clientC.SetAttribute ("PacketSize", UintegerValue (payloadSize));
357
358 ApplicationContainer clientAppC = clientC.Install (wifiApNodes.Get (2));
359 clientAppC.Start (Seconds (1.0));
360 clientAppC.Stop (Seconds (simulationTime + 1));
361
362 UdpServerHelper serverD (port);
363 ApplicationContainer serverAppD = serverD.Install (wifiStaNodes.Get (3));
364 serverAppD.Start (Seconds (0.0));
365 serverAppD.Stop (Seconds (simulationTime + 1));
366
367 UdpClientHelper clientD (StaInterfaceD.GetAddress (0), port);
368 clientD.SetAttribute ("MaxPackets", UintegerValue (4294967295u));
369 clientD.SetAttribute ("Interval", TimeValue (Time ("0.0001"))); //packets/s
370 clientD.SetAttribute ("PacketSize", UintegerValue (payloadSize));
371
372 ApplicationContainer clientAppD = clientD.Install (wifiApNodes.Get (3));
373 clientAppD.Start (Seconds (1.0));
374 clientAppD.Stop (Seconds (simulationTime + 1));
375
376 if (enablePcap)
377 {
378 phy.EnablePcap ("AP_A", apDeviceA.Get (0));
379 phy.EnablePcap ("STA_A", staDeviceA.Get (0));
380 phy.EnablePcap ("AP_B", apDeviceB.Get (0));
381 phy.EnablePcap ("STA_B", staDeviceB.Get (0));
382 phy.EnablePcap ("AP_C", apDeviceC.Get (0));
383 phy.EnablePcap ("STA_C", staDeviceC.Get (0));
384 phy.EnablePcap ("AP_D", apDeviceD.Get (0));
385 phy.EnablePcap ("STA_D", staDeviceD.Get (0));
386 }
387
388 Simulator::Stop (Seconds (simulationTime + 1));
389 Simulator::Run ();
390
391 // Show results
392 uint64_t totalPacketsThroughA = DynamicCast<UdpServer> (serverAppA.Get (0))->GetReceived ();
393 uint64_t totalPacketsThroughB = DynamicCast<UdpServer> (serverAppB.Get (0))->GetReceived ();
394 uint64_t totalPacketsThroughC = DynamicCast<UdpServer> (serverAppC.Get (0))->GetReceived ();
395 uint64_t totalPacketsThroughD = DynamicCast<UdpServer> (serverAppD.Get (0))->GetReceived ();
396
397 Simulator::Destroy ();
398
399 double throughput = totalPacketsThroughA * payloadSize * 8 / (simulationTime * 1000000.0);
400 std::cout << "Default configuration (A-MPDU aggregation enabled, 65kB): " << '\n'
401 << " Throughput = " << throughput << " Mbit/s" << '\n';
402 if (verifyResults && (throughput < 57.5 || throughput > 58.5))
403 {
404 NS_LOG_ERROR ("Obtained throughput " << throughput << " is not in the expected boundaries!");
405 exit (1);
406 }
407 if (txopLimit)
408 {
409 std::cout << " Maximum TXOP duration (TXOP limit = " << txopLimit << "us): "
410 << netA.m_max.GetMicroSeconds () << " us" << '\n';
411 if (verifyResults && txopLimit && (netA.m_max < MicroSeconds (3350) || netA.m_max > MicroSeconds (3520)))
412 {
413 NS_LOG_ERROR ("Maximum TXOP duration " << netA.m_max << " is not in the expected boundaries!");
414 exit (1);
415 }
416 }
417
418 throughput = totalPacketsThroughB * payloadSize * 8 / (simulationTime * 1000000.0);
419 std::cout << "Aggregation disabled: " << '\n'
420 << " Throughput = " << throughput << " Mbit/s" << '\n';
421 if (verifyResults && (throughput < 38 || throughput > 39))
422 {
423 NS_LOG_ERROR ("Obtained throughput " << throughput << " is not in the expected boundaries!");
424 exit (1);
425 }
426 if (txopLimit)
427 {
428 std::cout << " Maximum TXOP duration (TXOP limit = " << txopLimit << "us): "
429 << netB.m_max.GetMicroSeconds () << " us" << '\n';
430 if (verifyResults && (netB.m_max < MicroSeconds (3350) || netB.m_max > MicroSeconds (3520)))
431 {
432 NS_LOG_ERROR ("Maximum TXOP duration " << netB.m_max << " is not in the expected boundaries!");
433 exit (1);
434 }
435 }
436
437 throughput = totalPacketsThroughC * payloadSize * 8 / (simulationTime * 1000000.0);
438 std::cout << "A-MPDU disabled and A-MSDU enabled (8kB): " << '\n'
439 << " Throughput = " << throughput << " Mbit/s" << '\n';
440 if (verifyResults && (throughput < 52 || throughput > 53))
441 {
442 NS_LOG_ERROR ("Obtained throughput " << throughput << " is not in the expected boundaries!");
443 exit (1);
444 }
445 if (txopLimit)
446 {
447 std::cout << " Maximum TXOP duration (TXOP limit = " << txopLimit << "us): "
448 << netC.m_max.GetMicroSeconds () << " us" << '\n';
449 if (verifyResults && (netC.m_max < MicroSeconds (3350) || netC.m_max > MicroSeconds (3520)))
450 {
451 NS_LOG_ERROR ("Maximum TXOP duration " << netC.m_max << " is not in the expected boundaries!");
452 exit (1);
453 }
454 }
455
456 throughput = totalPacketsThroughD * payloadSize * 8 / (simulationTime * 1000000.0);
457 std::cout << "A-MPDU enabled (32kB) and A-MSDU enabled (4kB): " << '\n'
458 << " Throughput = " << throughput << " Mbit/s" << '\n';
459 if (verifyResults && (throughput < 58 || throughput > 59))
460 {
461 NS_LOG_ERROR ("Obtained throughput " << throughput << " is not in the expected boundaries!");
462 exit (1);
463 }
464 if (txopLimit)
465 {
466 std::cout << " Maximum TXOP duration (TXOP limit = " << txopLimit << "us): "
467 << netD.m_max.GetMicroSeconds () << " us" << '\n';
468 if (verifyResults && txopLimit && (netD.m_max < MicroSeconds (3350) || netD.m_max > MicroSeconds (3520)))
469 {
470 NS_LOG_ERROR ("Maximum TXOP duration " << netD.m_max << " is not in the expected boundaries!");
471 exit (1);
472 }
473 }
474
475 return 0;
476}
holds a vector of ns3::Application pointers.
Ptr< Application > Get(uint32_t i) const
Get the Ptr<Application> stored in this container at a given index.
void Start(Time start)
Arrange for all of the Applications in this container to Start() at the Time given as a parameter.
void Stop(Time stop)
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:229
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:144
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
Definition: object-base.cc:364
Hold objects of type Ptr<T>.
Definition: pointer.h:37
Ptr< T > Get(void) const
Definition: pointer.h:201
Handle packet fragmentation and retransmissions for QoS data frames as well as MSDU aggregation (A-MS...
Definition: qos-txop.h:72
The IEEE 802.11 SSID Information Element.
Definition: ssid.h:36
AttributeValue implementation for Ssid.
Hold variables of type string.
Definition: string.h:41
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
int64_t GetMicroSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:387
AttributeValue implementation for Time.
Definition: nstime.h:1308
void SetTxopLimit(Time txopLimit)
Set the TXOP limit.
Definition: txop.cc:254
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:44
Vector3D Vector
Vector alias typedef for compatibility with mobility models.
Definition: vector.h:324
helps to create WifiNetDevice objects
Definition: wifi-helper.h:323
create MAC layers for a ns3::WifiNetDevice.
Ptr< WifiMac > GetMac(void) const
manage and create wifi channel objects for the YANS model.
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:849
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
Definition: log.h:257
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1260
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1244
@ WIFI_STANDARD_80211n
address
Definition: first.py:44
stack
Definition: first.py:41
Every class exported by the ns3 library is enclosed in the ns3 namespace.
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:1648
cmd
Definition: second.py:35
ssid
Definition: third.py:97
channel
Definition: third.py:92
mac
Definition: third.py:96
wifi
Definition: third.py:99
mobility
Definition: third.py:107
wifiStaNodes
Definition: third.py:88
phy
Definition: third.py:93
Keeps the maximum duration among all TXOPs.
Time m_max
maximum TXOP duration
void Trace(Time startTime, Time duration)
Callback connected to TXOP duration trace source.