70#include "ns3/applications-module.h"
71#include "ns3/core-module.h"
72#include "ns3/flow-monitor-module.h"
73#include "ns3/internet-module.h"
74#include "ns3/ipv4-global-routing-helper.h"
75#include "ns3/network-module.h"
76#include "ns3/packet-sink.h"
77#include "ns3/point-to-point-module.h"
78#include "ns3/traffic-control-module.h"
98 << std::setw(12) <<
newval << std::endl;
105 << std::setw(12) <<
newval.GetBitRate() / 1
e6 << std::endl;
112 << std::setw(12) <<
newval << std::endl;
119 <<
" tx " << p->GetSize() << std::endl;
126 <<
" rx " << p->GetSize() << std::endl;
169 cmd.AddValue(
"tracing",
"Flag to enable/disable Ascii and Pcap tracing",
tracing);
170 cmd.AddValue(
"maxBytes",
"Total number of bytes for application to send",
maxBytes);
171 cmd.AddValue(
"isPacingEnabled",
"Flag to enable/disable pacing in TCP",
isPacingEnabled);
173 cmd.AddValue(
"useEcn",
"Flag to enable/disable ECN",
useEcn);
174 cmd.AddValue(
"useQueueDisc",
"Flag to enable/disable queue disc on bottleneck",
useQueueDisc);
175 cmd.AddValue(
"shouldPaceInitialWindow",
176 "Flag to enable/disable pacing of TCP initial window",
232 ipv4.SetBase(
"10.1.1.0",
"255.255.255.0");
235 ipv4.SetBase(
"10.1.2.0",
"255.255.255.0");
238 ipv4.SetBase(
"10.1.3.0",
"255.255.255.0");
241 ipv4.SetBase(
"10.1.4.0",
"255.255.255.0");
244 ipv4.SetBase(
"10.1.5.0",
"255.255.255.0");
288 regLink.EnableAsciiAll(
ascii.CreateFileStream(
"tcp-dynamic-pacing.tr"));
289 regLink.EnablePcapAll(
"tcp-dynamic-pacing",
false);
292 cwndStream.open(
"tcp-dynamic-pacing-cwnd.dat", std::ios::out);
293 cwndStream <<
"#Time(s) Congestion Window (B)" << std::endl;
298 ssThreshStream.open(
"tcp-dynamic-pacing-ssthresh.dat", std::ios::out);
299 ssThreshStream <<
"#Time(s) Slow Start threshold (B)" << std::endl;
313 monitor->CheckForLostPackets();
316 for (
auto i = stats.begin();
i != stats.end(); ++
i)
321 <<
t.destinationAddress <<
")\n";
322 std::cout <<
" Tx Packets: " <<
i->second.txPackets <<
"\n";
323 std::cout <<
" Tx Bytes: " <<
i->second.txBytes <<
"\n";
324 std::cout <<
" TxOffered: "
327 std::cout <<
" Rx Packets: " <<
i->second.rxPackets <<
"\n";
328 std::cout <<
" Rx Bytes: " <<
i->second.rxBytes <<
"\n";
329 std::cout <<
" Throughput: "
NodeContainer n2n3
Nodecontainer n2 + n3.
NodeContainer n1n2
Nodecontainer n1 + n2.
NodeContainer n3n4
Nodecontainer n3 + n4.
NodeContainer n0n2
Nodecontainer n0 + n2.
NodeContainer n3n5
Nodecontainer n3 + n5.
a polymophic address class
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.
Manage ASCII trace files for device models.
AttributeValue implementation for Boolean.
A helper to make it easier to instantiate an ns3::BulkSendApplication on a set of nodes.
Parse command-line arguments.
Class for representing data rates.
AttributeValue implementation for DataRate.
Hold variables of type enum.
Helper to enable IP flow monitoring on a set of Nodes.
std::map< FlowId, FlowStats > FlowStatsContainer
Container: FlowId, FlowStats.
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.
holds a vector of std::pair of Ptr<Ipv4> and interface index.
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.
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes.
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.
Smart pointer class similar to boost::intrusive_ptr.
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.
Data structure that records the congestion state of a connection.
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.
static TypeId LookupByName(std::string name)
Get a TypeId by name.
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)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
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.
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...
Structure to classify a packet.
Ipv4Address sourceAddress
Source address.
std::ofstream packetTraceStream
static void TxTracer(Ptr< const Packet > p, Ptr< Ipv4 > ipv4, uint32_t interface)
static void RxTracer(Ptr< const Packet > p, Ptr< Ipv4 > ipv4, uint32_t interface)
std::ofstream ssThreshStream
static void CwndTracer(uint32_t oldval, uint32_t newval)
std::ofstream pacingRateStream
static void SsThreshTracer(uint32_t oldval, uint32_t newval)
static void PacingRateTracer(DataRate oldval, DataRate newval)
void ConnectSocketTraces()
bool tracing
Flag to enable/disable generation of tracing files.