21 #include "ns3/core-module.h"
22 #include "ns3/network-module.h"
23 #include "ns3/internet-module.h"
24 #include "ns3/point-to-point-module.h"
25 #include "ns3/netanim-module.h"
26 #include "ns3/applications-module.h"
27 #include "ns3/point-to-point-layout-module.h"
31 int main (
int argc,
char *argv[])
36 uint32_t nLeftLeaf = 5;
37 uint32_t nRightLeaf = 5;
39 std::string animFile =
"dumbbell-animation.xml" ;
42 cmd.
AddValue (
"nLeftLeaf",
"Number of left side leaf nodes", nLeftLeaf);
43 cmd.
AddValue (
"nRightLeaf",
"Number of right side leaf nodes", nRightLeaf);
44 cmd.
AddValue (
"nLeaf",
"Number of left and right side leaf nodes", nLeaf);
45 cmd.
AddValue (
"animFile",
"File Name for Animation Output", animFile);
47 cmd.
Parse (argc,argv);
63 nRightLeaf, pointToPointLeaf,
89 clientApps.
Start (Seconds (0.0));
90 clientApps.
Stop (Seconds (10.0));
102 std::cout <<
"Animation Trace file created:" << animFile.c_str ()<< std::endl;
holds a vector of ns3::Application pointers.
static void PopulateRoutingTables(void)
Build a routing database and initialize the routing tables of the nodes in the simulation.
hold variables of type string
void BoundingBox(double ulx, double uly, double lrx, double lry)
Sets up the node canvas locations for every node in the dumbbell.
void Add(ApplicationContainer other)
Append the contents of another ApplicationContainer to the end of this container. ...
static void Run(void)
Run the simulation until one of:
aggregate IP/TCP/UDP functionality to existing Nodes.
Ptr< Node > GetRight() const
Build a set of PointToPointNetDevice objects.
void SetDeviceAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each NetDevice created by the helper.
A helper to make it easier to instantiate an ns3::OnOffApplication on a set of nodes.
a polymophic address class
Hold an unsigned integer type.
void Start(Time start)
Arrange for all of the Applications in this container to Start() at the Time given as a parameter...
Parse command-line arguments.
static void Destroy(void)
Every event scheduled by the Simulator::insertAtDestroy method is invoked.
void SetDefault(std::string name, const AttributeValue &value)
void AssignIpv4Addresses(Ipv4AddressHelper leftIp, Ipv4AddressHelper rightIp, Ipv4AddressHelper routerIp)
void SetChannelAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each Channel created by the helper.
uint32_t RightCount() const
hold objects of type ns3::Address
void Stop(Time stop)
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter...
int main(int argc, char *argv[])
void AddValue(const std::string &name, const std::string &help, T &value)
Add a program argument, assigning to POD.
void InstallStack(InternetStackHelper stack)
Interface to network animator.
A helper to make it easier to create a dumbbell topology with p2p links.
void Parse(int argc, char *argv[])
Parse the program arguments.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
Ipv4Address GetLeftIpv4Address(uint32_t i) const
ApplicationContainer Install(NodeContainer c) const
Install an ns3::OnOffApplication on each node of the input container configured with all the attribut...
void SetAttribute(std::string name, const AttributeValue &value)
Helper function used to set the underlying application attributes.