38#include "ns3/applications-module.h"
39#include "ns3/config-store.h"
40#include "ns3/core-module.h"
42#include "ns3/error-model.h"
43#include "ns3/event-id.h"
44#include "ns3/internet-module.h"
45#include "ns3/ipv4-global-routing-helper.h"
46#include "ns3/network-module.h"
47#include "ns3/point-to-point-module.h"
48#include "ns3/tcp-header.h"
49#include "ns3/traffic-control-module.h"
50#include "ns3/udp-header.h"
70 *stream->GetStream() <<
oldval <<
" " <<
newval << std::endl;
91 "/NodeList/0/$ns3::TcpL4Protocol/SocketList/0/CongestionWindow",
105 *stream->GetStream() <<
newval << std::endl;
126 "$ns3::CoDelQueueDisc/SojournTime",
141 *stream->GetStream() <<
oldval <<
" " <<
newval << std::endl;
155 NS_LOG_DEBUG(
"No trace file for queue length provided");
162 "/NodeList/2/$ns3::TrafficControlLayer/RootQueueDiscList/0/BytesInQueue",
190 NS_LOG_DEBUG(
"No trace file for every drop event provided");
197 "/NodeList/2/$ns3::TrafficControlLayer/RootQueueDiscList/0/Drop",
235 NS_LOG_DEBUG(
"No trace file for dropping state provided");
242 "$ns3::CoDelQueueDisc/DropState",
307 float startTime = 0.1F;
314 cmd.AddValue(
"serverCmtsDelay",
"Link delay between server and CMTS",
serverCmtsDelay);
315 cmd.AddValue(
"cmtsRouterDelay",
"Link delay between CMTS and rounter",
cmtsRouterDelay);
316 cmd.AddValue(
"routerHostDelay",
"Link delay between router and host",
routerHostDelay);
323 cmd.AddValue(
"routerWanQueueDiscType",
324 "Router WAN queue disc type: "
327 cmd.AddValue(
"queueSize",
"Queue size in packets",
queueSize);
328 cmd.AddValue(
"pktSize",
"Packet size in bytes",
pktSize);
329 cmd.AddValue(
"numOfUpLoadBulkFlows",
330 "Number of upload bulk transfer flows",
332 cmd.AddValue(
"numOfDownLoadBulkFlows",
333 "Number of download bulk transfer flows",
336 cmd.AddValue(
"numOfDownLoadOnOffFlows",
337 "Number of download OnOff flows",
339 cmd.AddValue(
"startTime",
"Simulation start time", startTime);
340 cmd.AddValue(
"simDuration",
"Simulation duration in seconds",
simDuration);
341 cmd.AddValue(
"isPcapEnabled",
"Flag to enable/disable pcap",
isPcapEnabled);
342 cmd.AddValue(
"logging",
"Flag to enable/disable logging", logging);
396 NS_LOG_INFO(
"Create channels and install net devices on nodes");
432 NS_LOG_INFO(
"Install Internet stack on all nodes");
461 ipv4.SetBase(
"10.1.1.0",
"255.255.255.0");
463 ipv4.SetBase(
"10.1.2.0",
"255.255.255.0");
465 ipv4.SetBase(
"10.1.3.0",
"255.255.255.0");
472 uint16_t
port1 = 50000;
492 uint16_t
port2 = 50001;
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.
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.
Introspection did not find any typical Config paths.
void ConfigureDefaults()
Configure the default values.
static void Bind(std::string name, const AttributeValue &value)
Iterate over the set of GlobalValues until a matching name is found and then set its value with Globa...
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.
static void Add(std::string name, Ptr< Object > object)
Add the association between the string "name" and the Ptr<Object> obj.
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.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
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.
Build a set of PointToPointNetDevice objects.
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 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.
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.
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.
Hold an unsigned integer type.
static void TraceCwnd(std::string cwndTrFileName)
Setup for TCP congestion window tracking.
static void SojournTracer(Ptr< OutputStreamWrapper > stream, Time newval)
Traffic Control Sojourn tracker.
static void TraceDroppingState(std::string dropStateTrFileName)
Setup for Traffic Control dropping tracking.
void CreateBulkFlow(AddressValue remoteAddress, Ptr< Node > sender, uint32_t pktSize, float stopTime)
Create a Bulk Flow application.
static void CwndTracer(Ptr< OutputStreamWrapper > stream, uint32_t oldval, uint32_t newval)
TCP Congestion window tracker.
static void DroppingStateTracer(Ptr< OutputStreamWrapper > stream, bool oldVal, bool newVal)
Traffic Control Dropping state trace.
static void EveryDropTracer(Ptr< OutputStreamWrapper > stream, Ptr< const QueueDiscItem > item)
Traffic control drop trace.
void CreateOnOffFlow(AddressValue remoteAddress, Ptr< Node > sender, float stopTime)
Create a On Off Flow application.
static void TraceSojourn(std::string sojournTrFileName)
Setup for Traffic Control Sojourn time tracking.
static void TraceEveryDrop(std::string everyDropTrFileName)
Setup for Traffic Control drop tracking.
static void TraceQueueLength(std::string queueLengthTrFileName)
Setup for Traffic Control Queue length tracking.
static void QueueLengthTracer(Ptr< OutputStreamWrapper > stream, uint32_t oldval, uint32_t newval)
Traffic Control Queue length tracker.
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_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
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 Seconds(double 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.
@ LOG_LEVEL_FUNCTION
LOG_FUNCTION and above.
uint32_t pktSize
packet size used for the simulation (in bytes)