10#include "ns3/applications-module.h"
11#include "ns3/core-module.h"
12#include "ns3/flow-monitor-module.h"
13#include "ns3/internet-module.h"
14#include "ns3/network-module.h"
15#include "ns3/point-to-point-module.h"
16#include "ns3/traffic-control-module.h"
66 std::cout <<
"TcPacketsInQueue " <<
oldValue <<
" to " <<
newValue << std::endl;
78 std::cout <<
"DevicePacketsInQueue " <<
oldValue <<
" to " <<
newValue << std::endl;
95 double simulationTime = 10;
100 cmd.AddValue(
"transportProt",
"Transport protocol to use: Tcp, Udp",
transportProt);
133 "/NodeList/1/$ns3::TrafficControlLayer/RootQueueDiscList/0/SojournTime",
142 address.SetBase(
"10.1.1.0",
"255.255.255.0");
159 onoff.SetAttribute(
"OnTime",
StringValue(
"ns3::ConstantRandomVariable[Constant=1]"));
160 onoff.SetAttribute(
"OffTime",
StringValue(
"ns3::ConstantRandomVariable[Constant=0]"));
179 std::map<FlowId, FlowMonitor::FlowStats> stats =
monitor->GetFlowStats();
180 std::cout << std::endl <<
"*** Flow monitor statistics ***" << std::endl;
181 std::cout <<
" Tx Packets/Bytes: " << stats[1].txPackets <<
" / " << stats[1].txBytes
183 std::cout <<
" Offered Load: "
184 << stats[1].txBytes * 8.0 /
185 (stats[1].timeLastTxPacket.GetSeconds() -
186 stats[1].timeFirstTxPacket.GetSeconds()) /
188 <<
" Mbps" << std::endl;
189 std::cout <<
" Rx Packets/Bytes: " << stats[1].rxPackets <<
" / " << stats[1].rxBytes
209 std::cout <<
" Throughput: "
210 << stats[1].rxBytes * 8.0 /
211 (stats[1].timeLastRxPacket.GetSeconds() -
212 stats[1].timeFirstRxPacket.GetSeconds()) /
214 <<
" Mbps" << std::endl;
215 std::cout <<
" Mean delay: " << stats[1].delaySum.GetSeconds() / stats[1].rxPackets
217 std::cout <<
" Mean jitter: " << stats[1].jitterSum.GetSeconds() / (stats[1].rxPackets - 1)
222 std::cout <<
" DSCP value: 0x" << std::hex << static_cast<uint32_t>(p.first) << std::dec
223 <<
" count: " << p.second << std::endl;
228 std::cout << std::endl <<
"*** Application statistics ***" << std::endl;
233 std::cout <<
" Average Goodput: " <<
thr <<
" Mbit/s" << std::endl;
234 std::cout << std::endl <<
"*** TC Layer statistics ***" << std::endl;
235 std::cout << q->GetStats() << std::endl;
a polymophic address class
AttributeValue implementation for Address.
holds a vector of ns3::Application pointers.
Parse command-line arguments.
Helper to enable IP flow monitoring on a set of Nodes.
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()
@ DROP_QUEUE_DISC
Packet dropped by the queue disc.
@ DROP_QUEUE
Packet dropped due to queue overflow.
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.
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.
Holds a vector of ns3::QueueDisc pointers.
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.
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.
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.
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.
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...
void TcPacketsInQueueTrace(uint32_t oldValue, uint32_t newValue)
Number of packets in TX queue trace.
void SojournTimeTrace(Time sojournTime)
TC Soujoun time trace.
void DevicePacketsInQueueTrace(uint32_t oldValue, uint32_t newValue)
Packets in the device queue trace.