11#include "ns3/applications-module.h"
12#include "ns3/brite-module.h"
13#include "ns3/core-module.h"
14#include "ns3/internet-module.h"
15#include "ns3/mobility-module.h"
16#include "ns3/network-module.h"
17#include "ns3/nix-vector-helper.h"
18#include "ns3/point-to-point-module.h"
29main(
int argc,
char* argv[])
39 std::string
confFile =
"src/brite/examples/conf_files/TD_ASBarabasi_RTWaxman.conf";
44 cmd.AddValue(
"confFile",
"BRITE conf file", confFile);
45 cmd.AddValue(
"tracing",
"Enable or disable ascii tracing",
tracing);
46 cmd.AddValue(
"nix",
"Enable or disable nix-vector routing", nix);
48 cmd.Parse(argc, argv);
65 stack.SetRoutingHelper(nixRouting);
69 address.SetBase(
"10.0.0.0",
"255.255.255.252");
71 bth.BuildBriteTopology(stack);
72 bth.AssignIpv4Addresses(address);
85 stack.Install(client);
89 client.Add(
bth.GetLeafNodeForAs(0, numLeafNodesInAsZero - 1));
92 stack.Install(server);
96 server.Add(
bth.GetLeafNodeForAs(1, numLeafNodesInAsOne - 1));
107 address.SetBase(
"10.1.0.0",
"255.255.0.0");
111 address.SetBase(
"10.2.0.0",
"255.255.0.0");
holds a vector of ns3::Application pointers.
Manage ASCII trace files for device models.
Ptr< OutputStreamWrapper > CreateFileStream(std::string filename, std::ios::openmode filemode=std::ios::out)
Create and initialize an output stream object we'll use to write the traced bits.
Interface with BRITE, the Boston university Representative Internet Topology gEnerator.
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.
static void PopulateRoutingTables()
Build a routing database and initialize the routing tables of the nodes in the simulation.
holds a vector of std::pair of Ptr<Ipv4> and interface index.
holds a vector of ns3::NetDevice pointers
Helper class that adds Nix-vector routing to nodes.
keep track of a set of node pointers.
Build a set of PointToPointNetDevice objects.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void Run()
Run the simulation.
static void Stop()
Tell the Simulator the calling event should be the last one executed.
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.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
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_ALL
Print everything.
bool tracing
Flag to enable/disable generation of tracing files.