262#include "ns3/applications-module.h"
263#include "ns3/core-module.h"
264#include "ns3/flow-monitor-helper.h"
265#include "ns3/internet-apps-module.h"
266#include "ns3/internet-module.h"
267#include "ns3/network-module.h"
268#include "ns3/point-to-point-module.h"
269#include "ns3/traffic-control-module.h"
351 <<
static_cast<double>(
newVal * 8) / (
linkRate.GetBitRate() / 1000) << std::endl;
444 if (address ==
"192.168.2.2")
449 else if (address ==
"192.168.3.2")
470 std::string
dir =
"results/FqCoDel-L4S/";
521 cmd.AddValue(
"n0TcpType",
"n0 TCP type (bic, dctcp, or reno)",
n0TcpType);
522 cmd.AddValue(
"n1TcpType",
"n1 TCP type (bic, dctcp, or reno)",
n1TcpType);
523 cmd.AddValue(
"scenarioNum",
524 "Scenario number from the scenarios available in the file (1-9)",
526 cmd.AddValue(
"bottleneckQueueType",
"n2 queue type (fq or codel)",
queueType);
529 cmd.AddValue(
"useEcn",
"use ECN",
useEcn);
533 cmd.AddValue(
"stopTime",
"simulation stop time",
stopTime);
538 cmd.AddValue(
"n0TcpThroughputTraceFile",
539 "filename for n0 throughput tracing",
543 cmd.AddValue(
"n1TcpThroughputTraceFile",
544 "filename for n1 throughput tracing",
546 cmd.AddValue(
"dropTraceFile",
"filename for n2 drops tracing",
dropTraceFile);
547 cmd.AddValue(
"dropsFrequencyTraceFile",
548 "filename for n2 drop frequency tracing",
550 cmd.AddValue(
"lengthTraceFile",
"filename for n2 queue length tracing",
lengthTraceFile);
551 cmd.AddValue(
"markTraceFile",
"filename for n2 mark tracing",
markTraceFile);
552 cmd.AddValue(
"marksFrequencyTraceFile",
553 "filename for n2 mark frequency tracing",
555 cmd.AddValue(
"queueDelayN0TraceFile",
556 "filename for n0 queue delay tracing",
558 cmd.AddValue(
"queueDelayN1TraceFile",
559 "filename for n1 queue delay tracing",
774 tchFq.SetQueueLimits(
"ns3::DynamicQueueLimits",
"HoldTime",
StringValue(
"1ms"));
784 tchN2.SetQueueLimits(
"ns3::DynamicQueueLimits",
"HoldTime",
StringValue(
"1000ms"));
788 ipv4.SetBase(
"10.1.1.0",
"255.255.255.0");
790 ipv4.SetBase(
"10.1.2.0",
"255.255.255.0");
792 ipv4.SetBase(
"10.1.3.0",
"255.255.255.0");
794 ipv4.SetBase(
"172.16.1.0",
"255.255.255.0");
796 ipv4.SetBase(
"192.168.1.0",
"255.255.255.0");
798 ipv4.SetBase(
"192.168.2.0",
"255.255.255.0");
800 ipv4.SetBase(
"192.168.3.0",
"255.255.255.0");
863 qd->TraceConnectWithoutContext(
866 qd->TraceConnectWithoutContext(
908 p2p.EnablePcapAll(
"FqCoDel-L4S-example",
false);
a polymophic address class
AttributeValue implementation for Address.
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.
AttributeValue implementation for Boolean.
A helper to make it easier to instantiate an ns3::BulkSendApplication on a set of nodes.
static TypeId GetTypeId()
Get the type ID.
Parse command-line arguments.
Class for representing data rates.
AttributeValue implementation for DataRate.
static TypeId GetTypeId()
Get the type ID.
aggregate IP/TCP/UDP functionality to existing Nodes.
void InstallAll() const
Aggregate IPv4, IPv6, UDP, and TCP stacks to all nodes in the simulation.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
Ipv4 addresses are stored in host order in this class.
static Ipv4Address GetAny()
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.
Ipv4QueueDiscItem is a subclass of QueueDiscItem which stores IPv4 packets.
holds a vector of ns3::NetDevice pointers
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes.
Create a ping application and associate it to a node.
This application behaves similarly to the Unix ping application, although with fewer options supporte...
Build a set of PointToPointNetDevice objects.
A Device for a Point to Point Network Link.
Smart pointer class similar to boost::intrusive_ptr.
Class for representing queue sizes.
AttributeValue implementation for QueueSize.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static Time Now()
Return the current simulation virtual time.
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.
static TypeId GetTypeId()
Get the type ID.
static TypeId GetTypeId()
Get the type ID.
TCP socket creation and multiplexing/demultiplexing.
static TypeId GetTypeId()
Get the type ID.
static TypeId GetTypeId()
Get the type ID.
Simulation virtual time values and global simulation resolution.
double GetSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
AttributeValue implementation for Time.
Build a set of QueueDisc objects.
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.
The Traffic Control layer aims at introducing an equivalent of the Linux Traffic Control infrastructu...
a unique identifier for an interface.
static TypeId LookupByName(std::string name)
Get a TypeId by name.
AttributeValue implementation for TypeId.
Hold an unsigned integer type.
void TraceDropsFrequency(std::ofstream *ofStream, Time dropsSamplingInterval)
void TraceN0Rx(Ptr< const Packet > packet, const Address &address)
void ScheduleN0TcpCwndTraceConnection(std::ofstream *ofStream)
void TraceMarksFrequency(std::ofstream *ofStream, Time marksSamplingInterval)
void ScheduleN1TcpRttTraceConnection(std::ofstream *ofStream)
void TraceN0Cwnd(std::ofstream *ofStream, uint32_t oldCwnd, uint32_t newCwnd)
void TraceN1Throughput(std::ofstream *ofStream, Time throughputInterval)
void TraceMark(std::ofstream *ofStream, Ptr< const QueueDiscItem > item, const char *reason)
void TraceN1Cwnd(std::ofstream *ofStream, uint32_t oldCwnd, uint32_t newCwnd)
uint32_t g_n1BytesReceived
void TraceDrop(std::ofstream *ofStream, Ptr< const QueueDiscItem > item)
uint32_t g_n0BytesReceived
void TraceN0Throughput(std::ofstream *ofStream, Time throughputInterval)
void TraceN1Rtt(std::ofstream *ofStream, Time oldRtt, Time newRtt)
void ScheduleN1PacketSinkConnection()
void ScheduleN1TcpCwndTraceConnection(std::ofstream *ofStream)
void ScheduleN0PacketSinkConnection()
void TraceN0Rtt(std::ofstream *ofStream, Time oldRtt, Time newRtt)
static void PacketDequeue(std::ofstream *n0OfStream, std::ofstream *n1OfStream, Ptr< const QueueDiscItem > item)
void TraceQueueLength(std::ofstream *ofStream, DataRate linkRate, uint32_t oldVal, uint32_t newVal)
void TraceN1Rx(Ptr< const Packet > packet, const Address &address)
void TracePingRtt(std::ofstream *ofStream, uint16_t seqNo, Time rtt)
void ScheduleN0TcpRttTraceConnection(std::ofstream *ofStream)
void SetDefault(std::string name, const AttributeValue &value)
void ConnectWithoutContext(std::string path, const CallbackBase &cb)
#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.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
auto MakeBoundCallback(R(*fnPtr)(Args...), BArgs &&... bargs)
Make Callbacks with varying number of bound arguments.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
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.
U * PeekPointer(const Ptr< U > &p)
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...