10#include "ns3/applications-module.h"
11#include "ns3/core-module.h"
12#include "ns3/internet-module.h"
13#include "ns3/ipv4-list-routing-helper.h"
14#include "ns3/ipv4-static-routing-helper.h"
15#include "ns3/network-module.h"
16#include "ns3/nix-vector-helper.h"
17#include "ns3/point-to-point-module.h"
126main(
int argc,
char* argv[])
129 cmd.Parse(argc, argv);
138 nodes23.
Add(nodes12.
Get(1));
142 nodes34.
Add(nodes23.
Get(1));
155 stack.SetRoutingHelper(nixRouting);
156 stack.Install(allNodes);
166 address1.
SetBase(
"10.1.1.0",
"255.255.255.0");
168 address2.
SetBase(
"10.1.2.0",
"255.255.255.0");
170 address3.
SetBase(
"10.1.3.0",
"255.255.255.0");
172 address4.
SetBase(
"10.2.1.0",
"255.255.255.0");
174 address5.
SetBase(
"10.2.3.0",
"255.255.255.0");
176 address1.
Assign(devices12);
177 address2.
Assign(devices23);
206 Ipv4NixVectorHelper::PrintRoutingTableAllAt(
Seconds(4), routingStream);
215 Ipv4NixVectorHelper::PrintRoutingTableAllAt(
Seconds(6), routingStream);
holds a vector of ns3::Application pointers.
Parse command-line arguments.
aggregate IP/TCP/UDP functionality to existing Nodes.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
Ipv4 addresses are stored in host order in this class.
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
holds a vector of ns3::NetDevice pointers
Helper class that adds Nix-vector routing to nodes.
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.
void Add(const NodeContainer &nc)
Append the contents of another NodeContainer to the end of this container.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
Build a set of PointToPointNetDevice objects.
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 void Run()
Run the simulation.
Hold variables of type string.
Create an application which sends a UDP packet and waits for an echo of this packet.
Create a server application which waits for input UDP packets and sends them back to the original sen...
Hold an unsigned integer type.
#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.
void LogComponentEnable(const std::string &name, LogLevel level)
Enable the logging output associated with that log component.
@ LOG_LEVEL_INFO
LOG_INFO and above.