120#include "ns3/applications-module.h"
121#include "ns3/core-module.h"
122#include "ns3/internet-apps-module.h"
123#include "ns3/internet-module.h"
124#include "ns3/network-module.h"
125#include "ns3/point-to-point-module.h"
126#include "ns3/traffic-control-module.h"
166 double cwnd =
static_cast<double>(
newCwnd) / 1448;
167 if ((now > 5.43) && (now < 5.465) && (cwnd < 500))
172 else if ((now > 5.795) && (now < 6) && (cwnd > 190))
177 else if ((now > 14) && (now < 14.197) && (cwnd < 224))
182 else if ((now > 17) && (now < 18.026) && (cwnd < 212))
209 if ((now < 7.5) && (alpha < 0.1))
214 else if ((now > 11) && (now < 30) && (alpha > 0.01))
219 else if ((now > 34) && (alpha < 0.015) && (alpha > 0.025))
222 <<
" (expected 0.015 <= alpha <= 0.025)");
229 if ((now > 5.6) && (alpha > 0.1))
234 if ((now > 7) && ((alpha > 0.09) || (alpha < 0.049)))
237 <<
" (expected 0.09 <= alpha <= 0.049)");
447 <<
" (expected <= 20)");
453 <<
" (expected <= 48)");
459 <<
" (expected 47.5 <= throughput <= 48.5)");
469 <<
" (expected 48 <= throughput <= 49)");
502 "/NodeList/1/$ns3::TcpL4Protocol/SocketList/0/CongestionWindow",
527 "CongestionOps/$ns3::TcpDctcp/CongestionEstimate",
540 "CongestionOps/$ns3::TcpDctcp/CongestionEstimate",
647 cmd.AddValue(
"firstTcpType",
"first TCP type (cubic, dctcp, or reno)",
firstTcpType);
648 cmd.AddValue(
"secondTcpType",
"second TCP type (cubic, dctcp, or reno)",
secondTcpType);
649 cmd.AddValue(
"queueType",
"bottleneck queue type (fq, codel, pie, or red)",
queueType);
651 cmd.AddValue(
"ceThreshold",
"CoDel CE threshold (for DCTCP)",
ceThreshold);
652 cmd.AddValue(
"linkRate",
"data rate of bottleneck link",
linkRate);
653 cmd.AddValue(
"stopTime",
"simulation stop time",
stopTime);
656 cmd.AddValue(
"validate",
"validation case to run",
g_validate);
727 std::cout <<
"Warning: using DCTCP with queue ECN disabled" << std::endl;
797 <<
"; ceThreshold: " <<
ceThreshold.GetSeconds() * 1000 <<
"ms");
803 <<
"; ceThreshold: " <<
ceThreshold.GetSeconds() * 1000 <<
"ms");
919 tchFq.SetQueueLimits(
"ns3::DynamicQueueLimits",
"HoldTime",
StringValue(
"1ms"));
934 ipv4.SetBase(
"10.1.1.0",
"255.255.255.0");
936 ipv4.SetBase(
"10.1.2.0",
"255.255.255.0");
938 ipv4.SetBase(
"10.1.3.0",
"255.255.255.0");
940 ipv4.SetBase(
"172.16.1.0",
"255.255.255.0");
942 ipv4.SetBase(
"192.168.1.0",
"255.255.255.0");
944 ipv4.SetBase(
"192.168.2.0",
"255.255.255.0");
946 ipv4.SetBase(
"192.168.3.0",
"255.255.255.0");
1011 qd->TraceConnectWithoutContext(
1061 p2p.EnablePcapAll(
"tcp-validation",
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.
Hold variables of type enum.
static TypeId GetTypeId()
Get the type ID.
aggregate IP/TCP/UDP functionality to existing Nodes.
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
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.
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.
static TypeId GetTypeId()
Get the type ID.
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 TypeId GetTypeId()
Get the type ID.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
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.
AttributeValue implementation for TypeId.
Hold an unsigned integer type.
void SetDefault(std::string name, const AttributeValue &value)
void ConnectWithoutContext(std::string path, const CallbackBase &cb)
bool ConnectWithoutContextFailSafe(std::string path, const CallbackBase &cb)
#define NS_ABORT_MSG_UNLESS(cond, msg)
Abnormal program termination if a condition is false, with a message.
#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.
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
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 Now()
create an ns3::Time instance which contains the current simulation time.
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.
void LogComponentEnable(const std::string &name, LogLevel level)
Enable the logging output associated with that log component.
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...
LogLevel
Logging severity classes and levels.
@ LOG_LEVEL_ALL
Print everything.
@ LOG_PREFIX_FUNC
Prefix all trace prints with function.
@ LOG_PREFIX_TIME
Prefix all trace prints with simulation time.
@ LOG_PREFIX_NODE
Prefix all trace prints with simulation node.
void TracePingRtt(std::ofstream *ofStream, uint16_t, Time rtt)
Trace ping RTT.
void ScheduleSecondDctcpTraceConnection(std::ofstream *ofStream)
Schedule trace connection.
void TraceMarksFrequency(std::ofstream *ofStream, Time marksSamplingInterval)
Trace marks frequency.
void ScheduleSecondTcpRttTraceConnection(std::ofstream *ofStream)
Schedule trace connection.
void TraceSecondRtt(std::ofstream *ofStream, Time oldRtt, Time newRtt)
Trace second RTT.
void TraceSecondDctcp(std::ofstream *ofStream, uint32_t bytesMarked, uint32_t bytesAcked, double alpha)
Trace second TcpDctcp.
void TraceSecondThroughput(std::ofstream *ofStream, Time throughputInterval)
Trace the second throughput.
void TraceFirstThroughput(std::ofstream *ofStream, Time throughputInterval)
Trace the first throughput.
void ScheduleFirstDctcpTraceConnection(std::ofstream *ofStream)
Schedule trace connection.
void TraceSecondCwnd(std::ofstream *ofStream, uint32_t oldCwnd, uint32_t newCwnd)
Trace second congestion window.
void TraceQueueMark(std::ofstream *ofStream, Ptr< const QueueDiscItem > item, const char *reason)
Trace queue marks.
bool g_validationFailed
True if validation failed.
void ScheduleFirstPacketSinkConnection()
Schedule trace connection.
void TraceQueueLength(std::ofstream *ofStream, DataRate queueLinkRate, uint32_t oldVal, uint32_t newVal)
Trace queue length.
void TraceFirstRx(Ptr< const Packet > packet, const Address &address)
Trace first Rx.
void TraceFirstCwnd(std::ofstream *ofStream, uint32_t oldCwnd, uint32_t newCwnd)
Trace first congestion window.
void TraceQueueDrop(std::ofstream *ofStream, Ptr< const QueueDiscItem > item)
Trace queue drop.
uint32_t g_marksObserved
Number of marked packets observed.
void ScheduleSecondPacketSinkConnection()
Schedule trace connection.
void ScheduleSecondTcpCwndTraceConnection(std::ofstream *ofStream)
Schedule trace connection.
void TraceSecondRx(Ptr< const Packet > packet, const Address &address)
Trace second Rx.
void TraceFirstRtt(std::ofstream *ofStream, Time oldRtt, Time newRtt)
Trace first RTT.
uint32_t g_firstBytesReceived
First received packet size.
std::string g_validate
Empty string disables validation.
uint32_t g_secondBytesReceived
Second received packet size.
uint32_t g_dropsObserved
Number of dropped packets observed.
void TraceFirstDctcp(std::ofstream *ofStream, uint32_t bytesMarked, uint32_t bytesAcked, double alpha)
Trace first TcpDctcp.
void ScheduleFirstTcpRttTraceConnection(std::ofstream *ofStream)
Schedule trace connection.
void ScheduleFirstTcpCwndTraceConnection(std::ofstream *ofStream)
Schedule trace connection.