12#include "ns3/applications-module.h"
13#include "ns3/core-module.h"
14#include "ns3/internet-module.h"
15#include "ns3/network-module.h"
16#include "ns3/point-to-point-layout-module.h"
17#include "ns3/point-to-point-module.h"
18#include "ns3/traffic-control-module.h"
43 cmd.AddValue(
"nLeaf",
"Number of left and right side leaf nodes",
nLeaf);
44 cmd.AddValue(
"maxPackets",
"Max Packets allowed in the device queue",
maxPackets);
45 cmd.AddValue(
"queueDiscLimitPackets",
46 "Max Packets allowed in the queue disc",
48 cmd.AddValue(
"queueDiscType",
"Set Queue disc type to RED or NLRED",
queueDiscType);
49 cmd.AddValue(
"appPktSize",
"Set OnOff App Packet Size",
pktSize);
50 cmd.AddValue(
"appDataRate",
"Set OnOff App DataRate",
appDataRate);
51 cmd.AddValue(
"modeBytes",
"Set Queue disc mode to Packets (false) or bytes (true)",
modeBytes);
53 cmd.AddValue(
"redMinTh",
"RED queue minimum threshold",
minTh);
54 cmd.AddValue(
"redMaxTh",
"RED queue maximum threshold",
maxTh);
59 std::cout <<
"Invalid queue disc type: Use --queueDiscType=RED or --queueDiscType=NLRED"
73 "ns3::RedQueueDisc::MaxSize",
79 "ns3::RedQueueDisc::MaxSize",
119 stack.Install(
d.GetLeft());
120 stack.Install(
d.GetRight());
159 std::cout <<
"Running the simulation" << std::endl;
166 std::cout <<
"There should be some unforced drops" << std::endl;
172 std::cout <<
"There should be zero drops due to queue full" << std::endl;
176 std::cout <<
"*** Stats from the bottleneck queue disc ***" << std::endl;
177 std::cout <<
st << std::endl;
178 std::cout <<
"Destroying the simulation" << std::endl;
a polymophic address class
AttributeValue implementation for Address.
holds a vector of ns3::Application pointers.
void Add(ApplicationContainer other)
Append the contents of another ApplicationContainer to the end of this container.
AttributeValue implementation for Boolean.
Parse command-line arguments.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
aggregate IP/TCP/UDP functionality to existing Nodes.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
static Ipv4Address GetAny()
static void PopulateRoutingTables()
Build a routing database and initialize the routing tables of the nodes in the simulation.
A helper to make it easier to instantiate an ns3::OnOffApplication on a set of nodes.
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes.
A helper to make it easier to create a dumbbell topology with p2p links.
Build a set of PointToPointNetDevice objects.
void SetDeviceAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each NetDevice created by the helper.
Holds a vector of ns3::QueueDisc pointers.
static constexpr const char * INTERNAL_QUEUE_DROP
Packet dropped by an internal queue.
Class for representing queue sizes.
AttributeValue implementation for QueueSize.
static constexpr const char * UNFORCED_DROP
Early probability drops.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void Run()
Run the simulation.
Hold variables of type string.
Build a set of QueueDisc objects.
Hold an unsigned integer type.
void SetDefault(std::string name, const AttributeValue &value)
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Structure that keeps the queue disc statistics.
uint32_t pktSize
packet size used for the simulation (in bytes)