6#include "ns3/applications-module.h"
7#include "ns3/core-module.h"
8#include "ns3/csma-module.h"
9#include "ns3/csma-star-helper.h"
10#include "ns3/internet-module.h"
11#include "ns3/ipv6-address-generator.h"
12#include "ns3/network-module.h"
56 cmd.AddValue(
"nSpokes",
"Number of spoke nodes to place in the star",
nSpokes);
86 NS_LOG_INFO(
"Install internet stack on all nodes.");
88 star.InstallStack(internet);
117 std::ostringstream
subnet;
118 subnet <<
"10.1." <<
i <<
".0";
120 address.SetBase(
subnet.str().c_str(),
"255.255.255.0",
"0.0.0.3");
144 uint16_t
port = 50000;
233 csma.EnablePcapAll(
"csma-star",
false);
a polymophic address class
AttributeValue implementation for Address.
holds a vector of ns3::Application pointers.
void Start(Time start) const
Start all of the Applications in this container at the start time given as a parameter.
Parse command-line arguments.
build a set of CsmaNetDevice objects
A helper to make it easier to create a star topology with Csma links.
aggregate IP/TCP/UDP functionality to existing Nodes.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
static Ipv4Address GetAny()
static void PopulateRoutingTables()
Build a routing database and initialize the routing tables of the nodes in the simulation.
static void Init(const Ipv6Address net, const Ipv6Prefix prefix, const Ipv6Address interfaceId="::1")
Initialise the base network and interfaceId for the generator.
static Ipv6Address GetNetwork(const Ipv6Prefix prefix)
Get the current network of the given Ipv6Prefix.
Helper class to auto-assign global IPv6 unicast addresses.
Describes an IPv6 address.
static Ipv6Address GetAny()
Get the "any" (::) Ipv6Address.
Describes an IPv6 prefix.
holds a vector of ns3::NetDevice pointers
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.
A helper to make it easier to instantiate an ns3::OnOffApplication on a set of nodes.
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes.
Smart pointer class similar to boost::intrusive_ptr.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void Run()
Run the simulation.
Hold variables of type string.
Hold an unsigned integer type.
void SetDefault(std::string name, const AttributeValue &value)
#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.
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.