A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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"

+ Collaboration diagram for ns3::PointToPointStarHelper:

Public Member Functions

 PointToPointStarHelper (uint32_t numSpokes, PointToPointHelper p2pHelper)
 Create a PointToPointStarHelper in order to easily create star topologies using p2p links.
 
 ~PointToPointStarHelper ()
 
void AssignIpv4Addresses (Ipv4AddressHelper address)
 
void AssignIpv6Addresses (Ipv6Address network, Ipv6Prefix prefix)
 
void BoundingBox (double ulx, double uly, double lrx, double lry)
 Sets up the node canvas locations for every node in the star.
 
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
 Hub node.
 
NetDeviceContainer m_hubDevices
 Hub node NetDevices.
 
Ipv4InterfaceContainer m_hubInterfaces
 IPv4 hub interfaces.
 
Ipv6InterfaceContainer m_hubInterfaces6
 IPv6 hub interfaces.
 
NetDeviceContainer m_spokeDevices
 Spoke nodes NetDevices.
 
Ipv4InterfaceContainer m_spokeInterfaces
 IPv4 spoke nodes interfaces.
 
Ipv6InterfaceContainer m_spokeInterfaces6
 IPv6 spoke nodes interfaces.
 
NodeContainer m_spokes
 Spoke nodes.
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ PointToPointStarHelper()

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 25 of file point-to-point-star.cc.

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

+ Here is the call graph for this function:

◆ ~PointToPointStarHelper()

ns3::PointToPointStarHelper::~PointToPointStarHelper ( )

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

Member Function Documentation

◆ AssignIpv4Addresses()

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 92 of file point-to-point-star.cc.

References ns3::Ipv4InterfaceContainer::Add(), ns3::NetDeviceContainer::Get(), ns3::NodeContainer::GetN(), m_hubDevices, m_hubInterfaces, m_spokeDevices, m_spokeInterfaces, and m_spokes.

+ Here is the call graph for this function:

◆ AssignIpv6Addresses()

void ns3::PointToPointStarHelper::AssignIpv6Addresses ( Ipv6Address network,
Ipv6Prefix prefix )
Parameters
networkan IPv6 address representing the network portion of the IPv6 Address
prefixthe prefix length

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

References ns3::Ipv6InterfaceContainer::Add(), ns3::Ipv6AddressHelper::Assign(), ns3::NetDeviceContainer::Get(), ns3::NodeContainer::GetN(), ns3::Ipv6AddressGenerator::GetNetwork(), ns3::Ipv6AddressGenerator::Init(), m_hubDevices, m_hubInterfaces6, m_spokeDevices, m_spokeInterfaces6, m_spokes, ns3::Ipv6AddressGenerator::NextNetwork(), and ns3::Ipv6AddressHelper::SetBase().

+ Here is the call graph for this function:

◆ BoundingBox()

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 124 of file point-to-point-star.cc.

References ns3::CreateObject(), ns3::NodeContainer::Get(), ns3::NodeContainer::GetN(), m_hub, and m_spokes.

+ Here is the call graph for this function:

◆ GetHub()

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 43 of file point-to-point-star.cc.

References ns3::NodeContainer::Get(), and m_hub.

+ Here is the call graph for this function:

◆ GetHubIpv4Address()

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

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

References ns3::Ipv4InterfaceContainer::GetAddress(), and m_hubInterfaces.

+ Here is the call graph for this function:

◆ GetHubIpv6Address()

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

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

References ns3::Ipv6InterfaceContainer::GetAddress(), and m_hubInterfaces6.

+ Here is the call graph for this function:

◆ GetSpokeIpv4Address()

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

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

References ns3::Ipv4InterfaceContainer::GetAddress(), and m_spokeInterfaces.

+ Here is the call graph for this function:

◆ GetSpokeIpv6Address()

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

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

References ns3::Ipv6InterfaceContainer::GetAddress(), and m_spokeInterfaces6.

+ Here is the call graph for this function:

◆ GetSpokeNode()

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 49 of file point-to-point-star.cc.

References ns3::NodeContainer::Get(), and m_spokes.

+ Here is the call graph for this function:

◆ InstallStack()

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

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

References m_hub, and m_spokes.

◆ SpokeCount()

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

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

References ns3::NodeContainer::GetN(), and m_spokes.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_hub

NodeContainer ns3::PointToPointStarHelper::m_hub
private

Hub node.

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

Referenced by PointToPointStarHelper(), BoundingBox(), GetHub(), and InstallStack().

◆ m_hubDevices

NetDeviceContainer ns3::PointToPointStarHelper::m_hubDevices
private

Hub node NetDevices.

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

Referenced by PointToPointStarHelper(), AssignIpv4Addresses(), and AssignIpv6Addresses().

◆ m_hubInterfaces

Ipv4InterfaceContainer ns3::PointToPointStarHelper::m_hubInterfaces
private

IPv4 hub interfaces.

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

Referenced by AssignIpv4Addresses(), and GetHubIpv4Address().

◆ m_hubInterfaces6

Ipv6InterfaceContainer ns3::PointToPointStarHelper::m_hubInterfaces6
private

IPv6 hub interfaces.

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

Referenced by AssignIpv6Addresses(), and GetHubIpv6Address().

◆ m_spokeDevices

NetDeviceContainer ns3::PointToPointStarHelper::m_spokeDevices
private

Spoke nodes NetDevices.

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

Referenced by PointToPointStarHelper(), AssignIpv4Addresses(), and AssignIpv6Addresses().

◆ m_spokeInterfaces

Ipv4InterfaceContainer ns3::PointToPointStarHelper::m_spokeInterfaces
private

IPv4 spoke nodes interfaces.

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

Referenced by AssignIpv4Addresses(), and GetSpokeIpv4Address().

◆ m_spokeInterfaces6

Ipv6InterfaceContainer ns3::PointToPointStarHelper::m_spokeInterfaces6
private

IPv6 spoke nodes interfaces.

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

Referenced by AssignIpv6Addresses(), and GetSpokeIpv6Address().

◆ m_spokes

NodeContainer ns3::PointToPointStarHelper::m_spokes
private

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