A Discrete-Event Network Simulator
API
codel-vs-pfifo-asymmetric.cc
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2014 ResiliNets, ITTC, University of Kansas
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: Truc Anh N Nguyen <trucanh524@gmail.com>
19 * Modified by: Pasquale Imputato <p.imputato@gmail.com>
20 *
21 */
22
23/*
24 * This is an example that compares CoDel and PfifoFast queues using a
25 * typical cable modem topology and delay
26 * (total RTT 37 ms as measured by Measuring Broadband America)
27 *
28 * 10gigE 22 Mb/s gigE
29 * 15 ms 1 ms 0.1 ms
30 * -------- ------- (1) -------- -------
31 * | |------>| |------>| |------->| |
32 * |server| |CMTS | |Router| |Host |
33 * | |<------| |<------| |<-------| |
34 * -------- -------- (2)-------- -------
35 * 10gigE 5 Mb/s gigE
36 * 15 ms 6 ms 0.1 ms
37 *
38 * (1) PfifoFast queue , 256K bytes
39 * (2) PfifoFast, CoDel
40 *
41 * The server initiates a bulk send TCP transfer to the host.
42 * The host initiates a bulk send TCP transfer to the server.
43 * Also, isochronous traffic (VoIP-like) between server and host
44 * The default TCP version in ns-3, TcpNewReno, is used as the transport-layer
45 * protocol.
46 * Packets transmitted during a simulation run are captured into a .pcap file,
47 * and congestion window values are also traced.
48 */
49
50#include <iostream>
51#include <fstream>
52#include <string>
53
54#include "ns3/core-module.h"
55#include "ns3/network-module.h"
56#include "ns3/internet-module.h"
57#include "ns3/point-to-point-module.h"
58#include "ns3/applications-module.h"
59#include "ns3/config-store-module.h"
60#include "ns3/error-model.h"
61#include "ns3/tcp-header.h"
62#include "ns3/udp-header.h"
63#include "ns3/enum.h"
64#include "ns3/event-id.h"
65#include "ns3/ipv4-global-routing-helper.h"
66#include "ns3/traffic-control-module.h"
67
68using namespace ns3;
69
70NS_LOG_COMPONENT_DEFINE ("CoDelPfifoFastAsymmetricTest");
71
79static void
81{
82 *stream->GetStream () << oldval << " " << newval << std::endl;
83}
84
90static void
91TraceCwnd (std::string cwndTrFileName)
92{
93 AsciiTraceHelper ascii;
94 if (cwndTrFileName.compare ("") == 0)
95 {
96 NS_LOG_DEBUG ("No trace file for cwnd provided");
97 return;
98 }
99 else
100 {
101 Ptr<OutputStreamWrapper> stream = ascii.CreateFileStream (cwndTrFileName.c_str ());
102 Config::ConnectWithoutContext ("/NodeList/0/$ns3::TcpL4Protocol/SocketList/0/CongestionWindow",MakeBoundCallback (&CwndTracer, stream));
103 }
104}
105
112static void
114{
115 *stream->GetStream () << newval << std::endl;
116}
117
123static void
124TraceSojourn (std::string sojournTrFileName)
125{
126 AsciiTraceHelper ascii;
127 if (sojournTrFileName.compare ("") == 0)
128 {
129 NS_LOG_DEBUG ("No trace file for sojourn provided");
130 return;
131 }
132 else
133 {
134 Ptr<OutputStreamWrapper> stream = ascii.CreateFileStream (sojournTrFileName.c_str ());
135 Config::ConnectWithoutContext ("/NodeList/2/$ns3::TrafficControlLayer/RootQueueDiscList/0/$ns3::CoDelQueueDisc/SojournTime", MakeBoundCallback (&SojournTracer, stream));
136 }
137}
138
146static void
148{
149 *stream->GetStream () << oldval << " " << newval << std::endl;
150}
151
157static void
158TraceQueueLength (std::string queueLengthTrFileName)
159{
160 AsciiTraceHelper ascii;
161 if (queueLengthTrFileName.compare ("") == 0)
162 {
163 NS_LOG_DEBUG ("No trace file for queue length provided");
164 return;
165 }
166 else
167 {
168 Ptr<OutputStreamWrapper> stream = ascii.CreateFileStream (queueLengthTrFileName.c_str ());
169 Config::ConnectWithoutContext ("/NodeList/2/$ns3::TrafficControlLayer/RootQueueDiscList/0/BytesInQueue", MakeBoundCallback (&QueueLengthTracer, stream));
170 }
171}
172
179static void
181{
182 *stream->GetStream () << Simulator::Now ().GetSeconds () << " " << item << std::endl;
183}
184
190static void
191TraceEveryDrop (std::string everyDropTrFileName)
192{
193 AsciiTraceHelper ascii;
194 if (everyDropTrFileName.compare ("") == 0)
195 {
196 NS_LOG_DEBUG ("No trace file for every drop event provided");
197 return;
198 }
199 else
200 {
201 Ptr<OutputStreamWrapper> stream = ascii.CreateFileStream (everyDropTrFileName.c_str ());
202 Config::ConnectWithoutContext ("/NodeList/2/$ns3::TrafficControlLayer/RootQueueDiscList/0/Drop", MakeBoundCallback (&EveryDropTracer, stream));
203 }
204}
205
213static void
214DroppingStateTracer (Ptr<OutputStreamWrapper> stream, bool oldVal, bool newVal)
215{
216 if (oldVal == false && newVal == true)
217 {
218 NS_LOG_INFO ("Entering the dropping state");
219 *stream->GetStream () << Simulator::Now ().GetSeconds () << " ";
220 }
221 else if (oldVal == true && newVal == false)
222 {
223 NS_LOG_INFO ("Leaving the dropping state");
224 *stream->GetStream () << Simulator::Now ().GetSeconds () << std::endl;
225 }
226}
227
233static void
234TraceDroppingState (std::string dropStateTrFileName)
235{
236 AsciiTraceHelper ascii;
237 if (dropStateTrFileName.compare ("") == 0)
238 {
239 NS_LOG_DEBUG ("No trace file for dropping state provided");
240 return;
241 }
242 else
243 {
244 Ptr<OutputStreamWrapper> stream = ascii.CreateFileStream (dropStateTrFileName.c_str ());
245 Config::ConnectWithoutContext ("/NodeList/2/$ns3::TrafficControlLayer/RootQueueDiscList/0/$ns3::CoDelQueueDisc/DropState", MakeBoundCallback (&DroppingStateTracer, stream));
246 }
247}
248
257void
259{
260 BulkSendHelper sourceHelper ("ns3::TcpSocketFactory", Address ());
261 sourceHelper.SetAttribute ("Remote", remoteAddress);
262 sourceHelper.SetAttribute ("SendSize", UintegerValue (pktSize));
263 sourceHelper.SetAttribute ("MaxBytes", UintegerValue (0));
264 ApplicationContainer sourceApp = sourceHelper.Install (sender);
265 sourceApp.Start (Seconds (0));
266 sourceApp.Stop (Seconds (stopTime - 3));
267}
268
276void
277CreateOnOffFlow (AddressValue remoteAddress, Ptr<Node> sender, float stopTime)
278{
279 OnOffHelper sourceHelper ("ns3::UdpSocketFactory", Address ());
280 sourceHelper.SetAttribute ("PacketSize", UintegerValue (280));
281 sourceHelper.SetAttribute ("Remote", remoteAddress);
282 ApplicationContainer sourceApp = sourceHelper.Install (sender);
283 sourceApp.Start (Seconds (0));
284 sourceApp.Stop (Seconds (stopTime - 3));
285}
286
287int main (int argc, char *argv[])
288{
289 std::string serverCmtsDelay = "15ms";
290 std::string cmtsRouterDelay = "6ms";
291 std::string routerHostDelay = "0.1ms";
292 std::string serverLanDataRate = "10Gbps";
293 std::string cmtsLanDataRate = "10Gbps";
294 std::string cmtsWanDataRate = "22Mbps";
295 std::string routerWanDataRate = "5Mbps";
296 std::string routerLanDataRate = "10Gbps";
297 std::string hostLanDataRate = "10Gbps";
298
299 std::string routerWanQueueDiscType = "CoDel"; // outbound cable router queue
300 uint32_t pktSize = 1458; // in bytes. 1458 to prevent fragments
301 uint32_t queueSize = 1000; // in packets
302 uint32_t numOfUpLoadBulkFlows = 1; // # of upload bulk transfer flows
303 uint32_t numOfDownLoadBulkFlows = 1; // # of download bulk transfer flows
304 uint32_t numOfUpLoadOnOffFlows = 1; // # of upload onoff flows
305 uint32_t numOfDownLoadOnOffFlows = 1; // # of download onoff flows
306 bool isPcapEnabled = true;
307
308 float startTime = 0.1f;
309 float simDuration = 60; //in seconds
310
311 std::string fileNamePrefix = "codel-vs-pfifo-fast-asymmetric";
312 bool logging = true;
313
314 CommandLine cmd (__FILE__);
315 cmd.AddValue ("serverCmtsDelay", "Link delay between server and CMTS", serverCmtsDelay);
316 cmd.AddValue ("cmtsRouterDelay", "Link delay between CMTS and rounter", cmtsRouterDelay);
317 cmd.AddValue ("routerHostDelay", "Link delay between router and host", routerHostDelay);
318 cmd.AddValue ("serverLanDataRate", "Server LAN net device data rate", serverLanDataRate);
319 cmd.AddValue ("cmtsLanDataRate", "CMTS LAN net device data rate", cmtsLanDataRate);
320 cmd.AddValue ("cmtsWanDataRate", "CMTS WAN net device data rate", cmtsWanDataRate);
321 cmd.AddValue ("routerWanDataRate", "Router WAN net device data rate", routerWanDataRate);
322 cmd.AddValue ("routerLanDataRate", "Router LAN net device data rate", routerLanDataRate);
323 cmd.AddValue ("hostLanDataRate", "Host LAN net device data rate", hostLanDataRate);
324 cmd.AddValue ("routerWanQueueDiscType", "Router WAN queue disc type: "
325 "PfifoFast, CoDel", routerWanQueueDiscType);
326 cmd.AddValue ("queueSize", "Queue size in packets", queueSize);
327 cmd.AddValue ("pktSize", "Packet size in bytes", pktSize);
328 cmd.AddValue ("numOfUpLoadBulkFlows", "Number of upload bulk transfer flows", numOfUpLoadBulkFlows);
329 cmd.AddValue ("numOfDownLoadBulkFlows", "Number of download bulk transfer flows", numOfDownLoadBulkFlows);
330 cmd.AddValue ("numOfUpLoadOnOffFlows", "Number of upload OnOff flows", numOfUpLoadOnOffFlows);
331 cmd.AddValue ("numOfDownLoadOnOffFlows", "Number of download OnOff flows", numOfDownLoadOnOffFlows);
332 cmd.AddValue ("startTime", "Simulation start time", startTime);
333 cmd.AddValue ("simDuration", "Simulation duration in seconds", simDuration);
334 cmd.AddValue ("isPcapEnabled", "Flag to enable/disable pcap", isPcapEnabled);
335 cmd.AddValue ("logging", "Flag to enable/disable logging", logging);
336 cmd.Parse (argc, argv);
337
338 float stopTime = startTime + simDuration;
339
340 std::string pcapFileName = fileNamePrefix + "-" + routerWanQueueDiscType;
341 std::string cwndTrFileName = fileNamePrefix + "-" + routerWanQueueDiscType + "-cwnd" + ".tr";
342 std::string attributeFileName = fileNamePrefix + "-" + routerWanQueueDiscType + ".attr";
343 std::string sojournTrFileName = fileNamePrefix + "-" + routerWanQueueDiscType + "-sojourn" + ".tr";
344 std::string queueLengthTrFileName = fileNamePrefix + "-" + routerWanQueueDiscType + "-length" + ".tr";
345 std::string everyDropTrFileName = fileNamePrefix + "-" + routerWanQueueDiscType + "-drop" + ".tr";
346 std::string dropStateTrFileName = fileNamePrefix + "-" + routerWanQueueDiscType + "-drop-state" + ".tr";
347 if (logging)
348 {
349 //LogComponentEnable ("CoDelPfifoFastAsymmetricTest", LOG_LEVEL_ALL);
350 //LogComponentEnable ("BulkSendApplication", LOG_LEVEL_INFO);
351 //LogComponentEnable ("PfifoFastQueue", LOG_LEVEL_ALL);
352 LogComponentEnable ("CoDelQueueDisc", LOG_LEVEL_FUNCTION);
353 }
354
355 // Queue defaults
356 Config::SetDefault ("ns3::PfifoFastQueueDisc::MaxSize",
358 Config::SetDefault ("ns3::CoDelQueueDisc::MaxSize",
360
361 // Create the nodes
362 NS_LOG_INFO ("Create nodes");
364 nodes.Create (4);
365 // Descriptive names
366 Names::Add ("server", nodes.Get (0));
367 Names::Add ("cmts", nodes.Get (1));
368 Names::Add ("router", nodes.Get (2));
369 Names::Add ("host", nodes.Get (3));
370 NodeContainer serverCmts;
371 serverCmts = NodeContainer (nodes.Get (0), nodes.Get (1));
372 NodeContainer cmtsRouter;
373 cmtsRouter = NodeContainer (nodes.Get (1), nodes.Get (2));
374 NodeContainer routerHost;
375 routerHost = NodeContainer (nodes.Get (2), nodes.Get (3));
376
377 // Enable checksum
378 if (isPcapEnabled)
379 {
380 GlobalValue::Bind ("ChecksumEnabled", BooleanValue (true));
381 }
382
383 Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (pktSize));
384
385 NS_LOG_INFO ("Create channels and install net devices on nodes");
387
388 p2p.SetChannelAttribute ("Delay", StringValue (serverCmtsDelay));
389 NetDeviceContainer serverCmtsDev = p2p.Install (serverCmts);
390 Names::Add ("server/lan", serverCmtsDev.Get (0));
391 Names::Add ("cmts/lan", serverCmtsDev.Get (1));
392 Ptr<PointToPointNetDevice> serverLanDev = DynamicCast<PointToPointNetDevice> (serverCmtsDev.Get (0));
393 serverLanDev->SetAttribute ("DataRate", StringValue (serverLanDataRate));
394 Ptr<PointToPointNetDevice> cmtsLanDev = DynamicCast<PointToPointNetDevice> (serverCmtsDev.Get (1));
395 cmtsLanDev->SetAttribute ("DataRate", StringValue (cmtsLanDataRate));
396
397 p2p.SetChannelAttribute ("Delay", StringValue (cmtsRouterDelay));
398 NetDeviceContainer cmtsRouterDev = p2p.Install (cmtsRouter);
399 Names::Add ("cmts/wan", cmtsRouterDev.Get (0));
400 Names::Add ("router/wan", cmtsRouterDev.Get (1));
401 Ptr<PointToPointNetDevice> cmtsWanDev = DynamicCast<PointToPointNetDevice> (cmtsRouterDev.Get (0));
402 cmtsWanDev->SetAttribute ("DataRate", StringValue (cmtsWanDataRate));
403 Ptr<PointToPointNetDevice> routerWanDev = DynamicCast<PointToPointNetDevice> (cmtsRouterDev.Get (1));
404 routerWanDev->SetAttribute ("DataRate", StringValue (routerWanDataRate));
405
406 p2p.SetChannelAttribute ("Delay", StringValue (routerHostDelay));
407 NetDeviceContainer routerHostDev = p2p.Install (routerHost);
408 Names::Add ("router/lan", routerHostDev.Get (0));
409 Names::Add ("host/lan", routerHostDev.Get (1));
410 Ptr<PointToPointNetDevice> routerLanDev = DynamicCast<PointToPointNetDevice> (routerHostDev.Get (0));
411 routerLanDev->SetAttribute ("DataRate", StringValue (routerLanDataRate));
412 Ptr<PointToPointNetDevice> hostLanDev = DynamicCast<PointToPointNetDevice> (routerHostDev.Get (1));
413 hostLanDev->SetAttribute ("DataRate", StringValue (hostLanDataRate));
414
415 NS_LOG_INFO ("Install Internet stack on all nodes");
417 stack.InstallAll ();
418
419 TrafficControlHelper tchPfifo;
420 tchPfifo.SetRootQueueDisc ("ns3::PfifoFastQueueDisc");
421
422 TrafficControlHelper tchCoDel;
423 tchCoDel.SetRootQueueDisc ("ns3::CoDelQueueDisc");
424
425 tchPfifo.Install (serverCmtsDev);
426 tchPfifo.Install (cmtsWanDev);
427 if (routerWanQueueDiscType.compare ("PfifoFast") == 0)
428 {
429 tchPfifo.Install (routerWanDev);
430 }
431 else if (routerWanQueueDiscType.compare ("CoDel") == 0)
432 {
433 tchCoDel.Install (routerWanDev);
434 }
435 else
436 {
437 NS_LOG_DEBUG ("Invalid router WAN queue disc type");
438 exit (1);
439 }
440 tchPfifo.Install (routerHostDev);
441
442 NS_LOG_INFO ("Assign IP Addresses");
444 ipv4.SetBase ("10.1.1.0", "255.255.255.0");
445 Ipv4InterfaceContainer serverCmtsInterface = ipv4.Assign (serverCmtsDev);
446 ipv4.SetBase ("10.1.2.0", "255.255.255.0");
447 Ipv4InterfaceContainer cmtsRouterInterface = ipv4.Assign (cmtsRouterDev);
448 ipv4.SetBase ("10.1.3.0", "255.255.255.0");
449 Ipv4InterfaceContainer routerHostInterface = ipv4.Assign (routerHostDev);
450
451 NS_LOG_INFO ("Initialize Global Routing");
452 Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
453
454 NS_LOG_INFO ("Configure downstream");
455 uint16_t port1 = 50000;
456 Address sinkLocalAddress1 (InetSocketAddress (Ipv4Address::GetAny (), port1));
457 PacketSinkHelper sinkHelper1 ("ns3::TcpSocketFactory", sinkLocalAddress1);
458 ApplicationContainer sinkApp1 = sinkHelper1.Install (routerHost.Get (1));
459 sinkApp1.Start (Seconds (0));
460 sinkApp1.Stop (Seconds (stopTime));
461 AddressValue remoteAddress1 (InetSocketAddress (routerHostInterface.GetAddress (1), port1));
462 while (numOfDownLoadBulkFlows)
463 {
464 CreateBulkFlow (remoteAddress1, serverCmts.Get (0), pktSize, stopTime);
465 numOfDownLoadBulkFlows--;
466 }
467
468 while (numOfDownLoadOnOffFlows)
469 {
470 CreateOnOffFlow (remoteAddress1, serverCmts.Get (0), stopTime);
471 numOfDownLoadOnOffFlows--;
472 }
473
474 NS_LOG_INFO ("Configure upstream");
475 uint16_t port2 = 50001;
476 Address sinkLocalAddress2 (InetSocketAddress (Ipv4Address::GetAny (), port2));
477 PacketSinkHelper sinkHelper2 ("ns3::TcpSocketFactory", sinkLocalAddress2);
478 ApplicationContainer sinkApp2 = sinkHelper2.Install (serverCmts.Get (0));
479 sinkApp2.Start (Seconds (0));
480 sinkApp2.Stop (Seconds (stopTime));
481 AddressValue remoteAddress2 (InetSocketAddress (serverCmtsInterface.GetAddress (0), port2));
482 while (numOfUpLoadBulkFlows)
483 {
484 CreateBulkFlow (remoteAddress2, routerHost.Get (1), pktSize, stopTime);
485 numOfUpLoadBulkFlows--;
486 }
487
488 while (numOfUpLoadOnOffFlows)
489 {
490 CreateOnOffFlow (remoteAddress2, routerHost.Get (1), stopTime);
491 numOfUpLoadOnOffFlows--;
492 }
493
494 Simulator::Schedule (Seconds (0.00001), &TraceCwnd, cwndTrFileName);
495 TraceEveryDrop (everyDropTrFileName);
496 if (routerWanQueueDiscType.compare ("CoDel") == 0)
497 {
498 TraceSojourn (sojournTrFileName);
499 TraceQueueLength (queueLengthTrFileName);
500 TraceDroppingState (dropStateTrFileName);
501 }
502 if (isPcapEnabled)
503 {
504 p2p.EnablePcapAll (pcapFileName);
505 }
506
507 // Output config store to txt format
508 Config::SetDefault ("ns3::ConfigStore::Filename", StringValue (attributeFileName));
509 Config::SetDefault ("ns3::ConfigStore::FileFormat", StringValue ("RawText"));
510 Config::SetDefault ("ns3::ConfigStore::Mode", StringValue ("Save"));
511 ConfigStore outputConfig;
512 outputConfig.ConfigureDefaults ();
513 outputConfig.ConfigureAttributes ();
514
515 Simulator::Stop (Seconds (stopTime));
517
518 Simulator::Destroy ();
519 return 0;
520}
void Run(ObjectFactory &factory, uint32_t pop, uint32_t total, uint32_t runs, Ptr< RandomVariableStream > eventStream, bool calRev)
Perform the runs for a single scheduler type.
a polymophic address class
Definition: address.h:91
AttributeValue implementation for Address.
holds a vector of ns3::Application pointers.
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.
Manage ASCII trace files for device models.
Definition: trace-helper.h:163
Ptr< OutputStreamWrapper > CreateFileStream(std::string filename, std::ios::openmode filemode=std::ios::out)
Create and initialize an output stream object we'll use to write the traced bits.
AttributeValue implementation for Boolean.
Definition: boolean.h:37
A helper to make it easier to instantiate an ns3::BulkSendApplication on a set of nodes.
void SetAttribute(std::string name, const AttributeValue &value)
Helper function used to set the underlying application attributes, not the socket attributes.
ApplicationContainer Install(NodeContainer c) const
Install an ns3::BulkSendApplication on each node of the input container configured with all the attri...
Parse command-line arguments.
Definition: command-line.h:229
Introspection did not find any typical Config paths.
Definition: config-store.h:60
void ConfigureDefaults(void)
Configure the default values.
void ConfigureAttributes(void)
Configure the attribute values.
an Inet address class
aggregate IP/TCP/UDP functionality to existing Nodes.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
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.
A helper to make it easier to instantiate an ns3::OnOffApplication on a set of nodes.
Definition: on-off-helper.h:43
ApplicationContainer Install(NodeContainer c) const
Install an ns3::OnOffApplication on each node of the input container configured with all the attribut...
void SetAttribute(std::string name, const AttributeValue &value)
Helper function used to set the underlying application attributes.
std::ostream * GetStream(void)
Return a pointer to an ostream previously set in the wrapper.
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes.
void EnablePcapAll(std::string prefix, bool promiscuous=false)
Enable pcap output on each device (which is of the appropriate type) in the set of all nodes created ...
Build a set of PointToPointNetDevice objects.
void SetChannelAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each Channel created by the helper.
NetDeviceContainer Install(NodeContainer c)
Class for representing queue sizes.
Definition: queue-size.h:95
AttributeValue implementation for QueueSize.
Hold variables of type string.
Definition: string.h:41
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:380
Build a set of QueueDisc objects.
QueueDiscContainer Install(NetDeviceContainer c)
uint16_t SetRootQueueDisc(const std::string &type, Args &&... args)
Helper function used to set a root queue disc of the given type and with the given attributes.
Hold an unsigned integer type.
Definition: uinteger.h:44
static void TraceCwnd(std::string cwndTrFileName)
Setup for TCP congestion window tracking.
static void SojournTracer(Ptr< OutputStreamWrapper > stream, Time newval)
Traffic Control Sojourn tracker.
static void TraceDroppingState(std::string dropStateTrFileName)
Setup for Traffic Control dropping tracking.
void CreateBulkFlow(AddressValue remoteAddress, Ptr< Node > sender, uint32_t pktSize, float stopTime)
Create a Bulk Flow application.
static void CwndTracer(Ptr< OutputStreamWrapper > stream, uint32_t oldval, uint32_t newval)
TCP Congestion window tracker.
static void DroppingStateTracer(Ptr< OutputStreamWrapper > stream, bool oldVal, bool newVal)
Traffic Control Dropping state trace.
static void EveryDropTracer(Ptr< OutputStreamWrapper > stream, Ptr< const QueueDiscItem > item)
Traffic control drop trace.
void CreateOnOffFlow(AddressValue remoteAddress, Ptr< Node > sender, float stopTime)
Create a On Off Flow application.
static void TraceSojourn(std::string sojournTrFileName)
Setup for Traffic Control Sojourn time tracking.
static void TraceEveryDrop(std::string everyDropTrFileName)
Setup for Traffic Control drop tracking.
static void TraceQueueLength(std::string queueLengthTrFileName)
Setup for Traffic Control Queue length tracking.
static void QueueLengthTracer(Ptr< OutputStreamWrapper > stream, uint32_t oldval, uint32_t newval)
Traffic Control Queue length tracker.
Time stopTime
void SetDefault(std::string name, const AttributeValue &value)
Definition: config.cc:849
void ConnectWithoutContext(std::string path, const CallbackBase &cb)
Definition: config.cc:901
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:206
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:274
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:282
auto MakeBoundCallback(R(*fnPtr)(Args...), BArgs... bargs)
Make Callbacks with varying number of bound arguments.
Definition: callback.h:714
@ PACKETS
Use number of packets for queue size.
Definition: queue-size.h:44
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
Definition: simulator.cc:287
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1245
NodeContainer nodes
stack
Definition: first.py:37
Every class exported by the ns3 library is enclosed in the ns3 namespace.
@ LOG_LEVEL_FUNCTION
LOG_FUNCTION and above.
Definition: log.h:111
void LogComponentEnable(char const *name, enum LogLevel level)
Enable the logging output associated with that log component.
Definition: log.cc:361
cmd
Definition: second.py:43
uint32_t pktSize
packet size used for the simulation (in bytes)
Definition: wifi-bianchi.cc:90