|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
25 #include "ns3/point-to-point-star.h"
26 #include "ns3/constant-position-mobility-model.h"
28 #include "ns3/node-list.h"
29 #include "ns3/point-to-point-net-device.h"
30 #include "ns3/vector.h"
31 #include "ns3/ipv6-address-generator.h"
125 addressHelper.
SetBase (v6network, prefix);
138 double lrx,
double lry)
164 hubLoc = CreateObject<ConstantPositionMobilityModel> ();
167 Vector hubVec (ulx + xDist/2.0, uly + yDist/2.0, 0);
168 hubLoc->SetPosition (hubVec);
173 spokeDist = yDist/4.0;
177 spokeDist = xDist/4.0;
187 spokeLoc = CreateObject<ConstantPositionMobilityModel> ();
190 Vector spokeVec (hubVec.x + std::cos (theta*i) * spokeDist,
191 hubVec.y + std::sin (theta*i) * spokeDist,
193 spokeLoc->SetPosition (spokeVec);
holds a vector of ns3::NetDevice pointers
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void AssignIpv6Addresses(Ipv6Address network, Ipv6Prefix prefix)
Ipv6Address GetHubIpv6Address(uint32_t i) const
Mobility model for which the current position does not change once it has been set and until it is se...
uint32_t SpokeCount() const
Every class exported by the ns3 library is enclosed in the ns3 namespace.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
Ptr< Node > GetSpokeNode(uint32_t i) const
static Ipv6Address GetNetwork(const Ipv6Prefix prefix)
Get the current network of the given Ipv6Prefix.
Ipv6InterfaceContainer m_hubInterfaces6
IPv6 hub interfaces.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Ptr< Node > GetHub() const
NetDeviceContainer Install(NodeContainer c)
Ipv4 addresses are stored in host order in this class.
Describes an IPv6 address.
uint32_t GetN(void) const
Get the number of Ptr<Node> stored in this container.
void SetBase(Ipv6Address network, Ipv6Prefix prefix, Ipv6Address base=Ipv6Address("::1"))
Set the base network number, network prefix, and base interface ID.
Ipv4InterfaceContainer m_spokeInterfaces
IPv4 spoke nodes interfaces.
Helper class to auto-assign global IPv6 unicast addresses.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
PointToPointStarHelper(uint32_t numSpokes, PointToPointHelper p2pHelper)
Create a PointToPointStarHelper in order to easily create star topologies using p2p links.
~PointToPointStarHelper()
Ipv6InterfaceContainer Assign(const NetDeviceContainer &c)
Allocate an Ipv6InterfaceContainer with auto-assigned addresses.
Ipv4Address GetSpokeIpv4Address(uint32_t i) const
static Ipv6Address NextNetwork(const Ipv6Prefix prefix)
Get the next network according to the given Ipv6Prefix.
Ipv6Address GetAddress(uint32_t i, uint32_t j) const
Get the address for the specified index.
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
Keep track of a set of IPv6 interfaces.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
void BoundingBox(double ulx, double uly, double lrx, double lry)
Sets up the node canvas locations for every node in the star.
void Add(Ptr< Ipv6 > ipv6, uint32_t interface)
Add a couple IPv6/interface.
NodeContainer m_spokes
Spoke nodes.
Ipv4InterfaceContainer m_hubInterfaces
IPv4 hub interfaces.
void Add(const Ipv4InterfaceContainer &other)
Concatenate the entries in the other container with ours.
Ipv6Address GetSpokeIpv6Address(uint32_t i) const
NodeContainer m_hub
Hub node.
NetDeviceContainer m_hubDevices
Hub node NetDevices.
Build a set of PointToPointNetDevice objects.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
NetDeviceContainer m_spokeDevices
Spoke nodes NetDevices.
Ipv6InterfaceContainer m_spokeInterfaces6
IPv6 spoke nodes interfaces.
void InstallStack(InternetStackHelper stack)
Ipv4Address GetHubIpv4Address(uint32_t i) const
static void Init(const Ipv6Address net, const Ipv6Prefix prefix, const Ipv6Address interfaceId="::1")
Initialise the base network and interfaceId for the generator.
void AssignIpv4Addresses(Ipv4AddressHelper address)
Describes an IPv6 prefix.
aggregate IP/TCP/UDP functionality to existing Nodes.
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.