A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ns3::PointToPointStarHelper Class Reference

A helper to make it easier to create a star topology with PointToPoint links. More...

#include <point-to-point-star.h>

Public Member Functions

 PointToPointStarHelper (uint32_t numSpokes, PointToPointHelper p2pHelper)
 
void AssignIpv4Addresses (Ipv4AddressHelper address)
 
void AssignIpv6Addresses (Ipv6Address network, Ipv6Prefix prefix)
 
void BoundingBox (double ulx, double uly, double lrx, double lry)
 
Ptr< NodeGetHub () const
 
Ipv4Address GetHubIpv4Address (uint32_t i) const
 
Ipv6Address GetHubIpv6Address (uint32_t i) const
 
Ipv4Address GetSpokeIpv4Address (uint32_t i) const
 
Ipv6Address GetSpokeIpv6Address (uint32_t i) const
 
Ptr< NodeGetSpokeNode (uint32_t i) const
 
void InstallStack (InternetStackHelper stack)
 
uint32_t SpokeCount () const
 

Private Attributes

NodeContainer m_hub
 
NetDeviceContainer m_hubDevices
 
Ipv4InterfaceContainer m_hubInterfaces
 
Ipv6InterfaceContainer m_hubInterfaces6
 
NetDeviceContainer m_spokeDevices
 
Ipv4InterfaceContainer m_spokeInterfaces
 
Ipv6InterfaceContainer m_spokeInterfaces6
 
NodeContainer m_spokes
 

Detailed Description

A helper to make it easier to create a star topology with PointToPoint links.

Definition at line 44 of file point-to-point-star.h.

Constructor & Destructor Documentation

ns3::PointToPointStarHelper::PointToPointStarHelper ( uint32_t  numSpokes,
PointToPointHelper  p2pHelper 
)

Create a PointToPointStarHelper in order to easily create star topologies using p2p links

Parameters
numSpokesthe number of links attached to the hub node, creating a total of numSpokes + 1 nodes
p2pHelperthe link helper for p2p links, used to link nodes together

Definition at line 35 of file point-to-point-star.cc.

References ns3::NetDeviceContainer::Add(), ns3::NodeContainer::Create(), ns3::NetDeviceContainer::Get(), ns3::NodeContainer::Get(), ns3::NodeContainer::GetN(), and ns3::PointToPointHelper::Install().

Member Function Documentation

void ns3::PointToPointStarHelper::AssignIpv4Addresses ( Ipv4AddressHelper  address)
Parameters
addressan Ipv4AddressHelper which is used to install Ipv4 addresses on all the node interfaces in the star

Definition at line 103 of file point-to-point-star.cc.

References ns3::Ipv4InterfaceContainer::Add(), ns3::Ipv4AddressHelper::Assign(), ns3::NetDeviceContainer::Get(), ns3::NodeContainer::GetN(), and ns3::Ipv4AddressHelper::NewNetwork().

void ns3::PointToPointStarHelper::AssignIpv6Addresses ( Ipv6Address  network,
Ipv6Prefix  prefix 
)
void ns3::PointToPointStarHelper::BoundingBox ( double  ulx,
double  uly,
double  lrx,
double  lry 
)

Sets up the node canvas locations for every node in the star. This is needed for use with the animation interface

Parameters
ulxupper left x value
ulyupper left y value
lrxlower right x value
lrylower right y value

Definition at line 135 of file point-to-point-star.cc.

References ns3::Object::AggregateObject(), ns3::NodeContainer::Get(), ns3::NodeContainer::GetN(), ns3::Object::GetObject(), ns3::Vector3D::x, and ns3::Vector3D::y.

Ptr< Node > ns3::PointToPointStarHelper::GetHub ( ) const
Returns
a node pointer to the hub node in the star, i.e., the center node

Definition at line 54 of file point-to-point-star.cc.

References ns3::NodeContainer::Get().

Ipv4Address ns3::PointToPointStarHelper::GetHubIpv4Address ( uint32_t  i) const
Parameters
iindex into the hub interfaces
Returns
Ipv4Address according to indexed hub interface

Definition at line 66 of file point-to-point-star.cc.

References ns3::Ipv4InterfaceContainer::GetAddress().

Ipv6Address ns3::PointToPointStarHelper::GetHubIpv6Address ( uint32_t  i) const
Parameters
iindex into the hub interfaces
Returns
Ipv6Address according to indexed hub interface

Definition at line 78 of file point-to-point-star.cc.

References ns3::Ipv6InterfaceContainer::GetAddress().

Ipv4Address ns3::PointToPointStarHelper::GetSpokeIpv4Address ( uint32_t  i) const
Parameters
iindex into the spoke interfaces
Returns
Ipv4Address according to indexed spoke interface

Definition at line 72 of file point-to-point-star.cc.

References ns3::Ipv4InterfaceContainer::GetAddress().

Ipv6Address ns3::PointToPointStarHelper::GetSpokeIpv6Address ( uint32_t  i) const
Parameters
iindex into the spoke interfaces
Returns
Ipv6Address according to indexed spoke interface

Definition at line 84 of file point-to-point-star.cc.

References ns3::Ipv6InterfaceContainer::GetAddress().

Ptr< Node > ns3::PointToPointStarHelper::GetSpokeNode ( uint32_t  i) const
Parameters
ian index into the spokes of the star
Returns
a node pointer to the node at the indexed spoke

Definition at line 60 of file point-to-point-star.cc.

References ns3::NodeContainer::Get().

void ns3::PointToPointStarHelper::InstallStack ( InternetStackHelper  stack)
Parameters
stackan InternetStackHelper which is used to install on every node in the star

Definition at line 96 of file point-to-point-star.cc.

References ns3::InternetStackHelper::Install().

uint32_t ns3::PointToPointStarHelper::SpokeCount ( ) const
Returns
the total number of spokes in the star

Definition at line 90 of file point-to-point-star.cc.

References ns3::NodeContainer::GetN().


The documentation for this class was generated from the following files: