18 #include "ns3/core-module.h"
19 #include "ns3/network-module.h"
20 #include "ns3/netanim-module.h"
21 #include "ns3/internet-module.h"
22 #include "ns3/point-to-point-module.h"
23 #include "ns3/applications-module.h"
24 #include "ns3/point-to-point-layout-module.h"
43 main (
int argc,
char *argv[])
60 cmd.
AddValue (
"nSpokes",
"Number of nodes to place in the star", nSpokes);
61 cmd.
Parse (argc, argv);
69 NS_LOG_INFO (
"Install internet stack on all nodes.");
80 uint16_t
port = 50000;
82 PacketSinkHelper packetSinkHelper (
"ns3::TcpSocketFactory", hubLocalAddress);
84 hubApp.
Start (Seconds (1.0));
85 hubApp.
Stop (Seconds (10.0));
96 for (uint32_t i = 0; i < star.
SpokeCount (); ++i)
102 spokeApps.
Start (Seconds (1.0));
103 spokeApps.
Stop (Seconds (10.0));
void AssignIpv4Addresses(Ipv4AddressHelper address)
holds a vector of ns3::Application pointers.
static Ipv4Address GetAny(void)
NS_LOG_COMPONENT_DEFINE("GrantedTimeWindowMpiInterface")
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 Add(ApplicationContainer other)
Append the contents of another ApplicationContainer to the end of this container. ...
A helper to make it easier to create a star topology with PointToPoint links.
static void Run(void)
Run the simulation until one of:
aggregate IP/TCP/UDP functionality to existing Nodes.
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes...
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
void EnablePcapAll(std::string prefix, bool promiscuous=false)
Enable pcap output on each device (which is of the appropriate type) in the set of all nodes created ...
Hold an unsigned integer type.
Ptr< Node > GetSpokeNode(uint32_t i) const
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)
Ptr< Node > GetHub() const
uint32_t SpokeCount() const
void SetChannelAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each Channel created by the helper.
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.
ApplicationContainer Install(NodeContainer c) const
Install an ns3::PacketSinkApplication on each node of the input container configured with all the att...
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.
void InstallStack(InternetStackHelper stack)
ApplicationContainer Install(NodeContainer c) const
Install an ns3::OnOffApplication on each node of the input container configured with all the attribut...
Ipv4Address GetHubIpv4Address(uint32_t i) const
void SetAttribute(std::string name, const AttributeValue &value)
Helper function used to set the underlying application attributes.