9#include "ns3/core-module.h"
10#include "ns3/internet-module.h"
11#include "ns3/network-module.h"
49 while ((packet = socket->Recv()))
57main(
int argc,
char* argv[])
60 cmd.Parse(argc, argv);
75 source->Connect(remote);
Parse command-line arguments.
aggregate IP/TCP/UDP functionality to existing Nodes.
static Ipv4Address GetLoopback()
static Ipv4Address GetAny()
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.
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 Ptr< Socket > CreateSocket(Ptr< Node > node, TypeId tid)
This method wraps the creation of sockets that is performed on a given node by a SocketFactory specif...
double GetSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
a unique identifier for an interface.
static TypeId LookupByName(std::string name)
Get a TypeId by 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.
static void GenerateTraffic(Ptr< Socket > socket, int32_t size)
Generates traffic.
static void SocketPrinter(Ptr< Socket > socket)
Prints the packets received by a socket.
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...
Ptr< PacketSink > sink
Pointer to the packet sink application.