18#include "ns3/core-module.h"
19#include "ns3/network-module.h"
20#include "ns3/internet-module.h"
21#include "ns3/applications-module.h"
22#include "ns3/point-to-point-module.h"
78main (
int argc,
char *argv[])
81 cmd.Parse (argc, argv);
111 address.SetBase (
"10.1.1.0",
"255.255.255.252");
114 uint16_t sinkPort = 8080;
121 Ptr<Socket> ns3TcpSocket = Socket::CreateSocket (
nodes.Get (0), TcpSocketFactory::GetTypeId ());
125 app->Setup (ns3TcpSocket, sinkAddress, 1040, 1000,
DataRate (
"1Mbps"));
126 nodes.Get (0)->AddApplication (app);
127 app->SetStartTime (
Seconds (1.));
128 app->SetStopTime (
Seconds (20.));
132 Simulator::Stop (
Seconds (20));
134 Simulator::Destroy ();
a polymophic address class
holds a vector of ns3::Application pointers.
void Start(Time start)
Arrange for all of the Applications in this container to Start() at the Time given as a parameter.
void Stop(Time stop)
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter.
Parse command-line arguments.
Class for representing data rates.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
aggregate IP/TCP/UDP functionality to existing Nodes.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
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.
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
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.
Build a set of PointToPointNetDevice objects.
Hold objects of type Ptr<T>.
Hold variables of type string.
AttributeValue implementation for TypeId.
Hold an unsigned integer type.
static void RxDrop(Ptr< const Packet > p)
static void CwndChange(uint32_t oldCwnd, uint32_t newCwnd)
void SetDefault(std::string name, const AttributeValue &value)
#define NS_LOG_UNCOND(msg)
Output the requested message unconditionally.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
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, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...