33 #include "ns3/core-module.h" 34 #include "ns3/network-module.h" 39 int main (
int argc,
char *argv[])
44 cmd.AddValue (
"verbose",
"turn on log components",
verbose);
45 cmd.Parse(argc, argv);
65 txDev = CreateObject<SimpleNetDevice> ();
66 nodes.Get (0)->AddDevice (txDev);
69 rxDev = CreateObject<SimpleNetDevice> ();
70 nodes.Get (1)->AddDevice (rxDev);
89 nodes.Get (0)->AddApplication (client);
93 nodes.Get (1)->AddApplication (server);
Smart pointer class similar to boost::intrusive_ptr.
void SetLocal(PacketSocketAddress addr)
set the local address and protocol to be used
an address for a packet socket
static void Run(void)
Run the simulation.
Give ns3::PacketSocket powers to ns3::Node.
void SetSingleDevice(uint32_t device)
Set the address to match only a specified NetDevice.
virtual void SetNode(Ptr< Node > node)
void LogComponentEnable(char const *name, enum LogLevel level)
Enable the logging output associated with that log component.
virtual Address GetAddress(void) const
Parse command-line arguments.
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetPhysicalAddress(const Address address)
Set the destination address.
keep track of a set of node pointers.
void SetRemote(PacketSocketAddress addr)
set the remote address and protocol to be used
void SetProtocol(uint16_t protocol)
Set the protocol.
void Install(Ptr< Node > node) const
Aggregate an instance of a ns3::PacketSocketFactory onto the provided node.
virtual uint32_t GetIfIndex(void) const
void SetChannel(Ptr< SimpleChannel > channel)
Attach a channel to this net device.