42#include "ns3/applications-module.h"
43#include "ns3/core-module.h"
44#include "ns3/internet-module.h"
45#include "ns3/network-module.h"
46#include "ns3/point-to-point-module.h"
47#include "ns3/traffic-control-module.h"
54main(
int argc,
char* argv[])
56 std::string testName =
"rrul";
62 std::string tcpType =
"TcpLinuxReno";
71 cmd.AddValue(
"test",
"Type of ns-3 Flent test", testName);
72 cmd.AddValue(
"rtt",
"Delay value", rtt);
73 cmd.AddValue(
"bw",
"Data Rate", bw);
74 cmd.AddValue(
"length",
"Base test duration (--length in Flent)", length);
75 cmd.AddValue(
"delay",
"Time to delay test (--delay in Flent)", delay);
76 cmd.AddValue(
"verbose",
"Verbose output",
verbose);
77 cmd.AddValue(
"tcpType",
"TCP congestion control type (e.g. TcpCubic, TcpLinuxReno)", tcpType);
78 cmd.Parse(argc, argv);
83 if (testName !=
"rrul" && testName !=
"tcp_upload" && testName !=
"tcp_download" &&
86 NS_FATAL_ERROR(
"Test name must be one of 'rrul', 'tcp_upload', 'tcp_download', or 'ping'");
89 std::optional<ShowProgress> progress;
92 progress.emplace(
Seconds(10), std::cerr);
109 DataRate edgeRate(100 * bw.GetBitRate());
114 devices0 = deviceHelper.
Install(n0);
116 devices2 = deviceHelper.
Install(n2);
121 devices1 = deviceHelper.
Install(n1);
132 qdiscs = tch.
Install(devices0);
133 qdiscs = tch.
Install(devices1);
134 qdiscs = tch.
Install(devices2);
137 address.SetBase(
"10.1.1.0",
"255.255.255.0");
148 flentHelper.SetTestStartTime(delay);
149 flentHelper.SetTestLength(length);
152 flentHelper.Install(n.
Get(0));
Parse command-line arguments.
Class for representing data rates.
A helper to make it easier to instantiate an ns3::FlentApplication.
aggregate IP/TCP/UDP functionality to existing Nodes.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
static void PopulateRoutingTables()
Build a routing database and initialize the routing tables of the nodes in the simulation.
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
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.
void Add(const NodeContainer &nc)
Append the contents of another NodeContainer to the end of this container.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
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.
void SetChannelAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each Channel created by the helper.
void SetQueue(std::string type, Ts &&... args)
Each point to point net device must have a queue to pass packets through.
NetDeviceContainer Install(NodeContainer c)
Holds a vector of ns3::QueueDisc pointers.
Class for representing queue sizes.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void Run()
Run the simulation.
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Hold variables of type string.
Simulation virtual time values and global simulation resolution.
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.
void SetQueueLimits(std::string type, Args &&... args)
Helper function used to add a queue limits object to the transmission queues of the devices.
Hold an unsigned integer type.
void SetDefault(std::string name, const AttributeValue &value)
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time Seconds(double value)
Construct a Time in the indicated unit.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.