23#include "ns3/core-module.h"
24#include "ns3/network-module.h"
25#include "ns3/internet-module.h"
49 socket->
Send (Create<Packet> (size));
61 while ((packet = socket->
Recv ()))
67int main (
int argc,
char *argv[])
70 cmd.Parse (argc, argv);
79 TypeId tid = TypeId::LookupByName (
"ns3::UdpSocketFactory");
93 Simulator::Destroy ();
Parse command-line arguments.
aggregate IP/TCP/UDP functionality to existing Nodes.
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
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.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
virtual int Send(Ptr< Packet > p, uint32_t flags)=0
Send data (or dummy data) to the remote host.
virtual int Connect(const Address &address)=0
Initiate a connection to a remote host.
virtual int Close(void)=0
Close a socket.
virtual Ptr< Packet > Recv(uint32_t maxSize, uint32_t flags)=0
Read data from the socket.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
a unique identifier for an interface.
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.
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, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...