A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::CsmaStarHelper Class Reference

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

#include "csma-star-helper.h"

+ Collaboration diagram for ns3::CsmaStarHelper:

Public Member Functions

 CsmaStarHelper (uint32_t numSpokes, CsmaHelper csmaHelper)
 Create a CsmaStarHelper in order to easily create star topologies using Csma links.
 
 ~CsmaStarHelper ()
 
void AssignIpv4Addresses (Ipv4AddressHelper address)
 
void AssignIpv6Addresses (Ipv6Address network, Ipv6Prefix prefix)
 
Ptr< NodeGetHub () const
 
NetDeviceContainer GetHubDevices () const
 
Ipv4Address GetHubIpv4Address (uint32_t i) const
 
Ipv6Address GetHubIpv6Address (uint32_t i) const
 
NetDeviceContainer GetSpokeDevices () 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
 NodeContainer for the hub node.
 
NetDeviceContainer m_hubDevices
 NetDeviceContainer for the hub node NetDevices.
 
Ipv4InterfaceContainer m_hubInterfaces
 Ipv4InterfaceContainer for the hub IPv4 interfaces.
 
Ipv6InterfaceContainer m_hubInterfaces6
 Ipv6InterfaceContainer for the hub IPv6 interfaces.
 
NetDeviceContainer m_spokeDevices
 NetDeviceContainer for the spokes nodes NetDevices.
 
Ipv4InterfaceContainer m_spokeInterfaces
 Ipv4InterfaceContainer for the spokes IPv4 interfaces.
 
Ipv6InterfaceContainer m_spokeInterfaces6
 Ipv6InterfaceContainer for the spokes IPv6 interfaces.
 
NodeContainer m_spokes
 NodeContainer for the spokes nodes.
 

Detailed Description

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

Definition at line 45 of file csma-star-helper.h.

Constructor & Destructor Documentation

◆ CsmaStarHelper()

ns3::CsmaStarHelper::CsmaStarHelper ( uint32_t  numSpokes,
CsmaHelper  csmaHelper 
)

Create a CsmaStarHelper in order to easily create star topologies using Csma links.

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

Definition at line 31 of file csma-star-helper.cc.

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

+ Here is the call graph for this function:

◆ ~CsmaStarHelper()

ns3::CsmaStarHelper::~CsmaStarHelper ( )

Definition at line 45 of file csma-star-helper.cc.

Member Function Documentation

◆ AssignIpv4Addresses()

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

Definition at line 111 of file csma-star-helper.cc.

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

Referenced by CsmaStarTestCase::DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AssignIpv6Addresses()

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

Definition at line 122 of file csma-star-helper.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:

◆ GetHub()

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

Definition at line 50 of file csma-star-helper.cc.

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

Referenced by CsmaStarTestCase::DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetHubDevices()

NetDeviceContainer ns3::CsmaStarHelper::GetHubDevices ( ) const
Returns
the net-device container which contains all of the devices on the hub node

Definition at line 62 of file csma-star-helper.cc.

References m_hubDevices.

◆ GetHubIpv4Address()

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

Definition at line 74 of file csma-star-helper.cc.

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

Referenced by CsmaStarTestCase::DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetHubIpv6Address()

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

Definition at line 86 of file csma-star-helper.cc.

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

+ Here is the call graph for this function:

◆ GetSpokeDevices()

NetDeviceContainer ns3::CsmaStarHelper::GetSpokeDevices ( ) const
Returns
the net-device container which contains all of the spoke node devices

Definition at line 68 of file csma-star-helper.cc.

References m_spokeDevices.

Referenced by CsmaStarTestCase::DoRun().

+ Here is the caller graph for this function:

◆ GetSpokeIpv4Address()

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

Definition at line 80 of file csma-star-helper.cc.

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

+ Here is the call graph for this function:

◆ GetSpokeIpv6Address()

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

Definition at line 92 of file csma-star-helper.cc.

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

+ Here is the call graph for this function:

◆ GetSpokeNode()

Ptr< Node > ns3::CsmaStarHelper::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 56 of file csma-star-helper.cc.

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

Referenced by CsmaStarTestCase::DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ InstallStack()

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

Definition at line 104 of file csma-star-helper.cc.

References m_hub, and m_spokes.

Referenced by CsmaStarTestCase::DoRun().

+ Here is the caller graph for this function:

◆ SpokeCount()

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

Definition at line 98 of file csma-star-helper.cc.

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

Referenced by CsmaStarTestCase::DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_hub

NodeContainer ns3::CsmaStarHelper::m_hub
private

NodeContainer for the hub node.

Definition at line 143 of file csma-star-helper.h.

Referenced by CsmaStarHelper(), GetHub(), and InstallStack().

◆ m_hubDevices

NetDeviceContainer ns3::CsmaStarHelper::m_hubDevices
private

NetDeviceContainer for the hub node NetDevices.

Definition at line 144 of file csma-star-helper.h.

Referenced by CsmaStarHelper(), AssignIpv4Addresses(), AssignIpv6Addresses(), and GetHubDevices().

◆ m_hubInterfaces

Ipv4InterfaceContainer ns3::CsmaStarHelper::m_hubInterfaces
private

Ipv4InterfaceContainer for the hub IPv4 interfaces.

Definition at line 147 of file csma-star-helper.h.

Referenced by AssignIpv4Addresses(), and GetHubIpv4Address().

◆ m_hubInterfaces6

Ipv6InterfaceContainer ns3::CsmaStarHelper::m_hubInterfaces6
private

Ipv6InterfaceContainer for the hub IPv6 interfaces.

Definition at line 150 of file csma-star-helper.h.

Referenced by AssignIpv6Addresses(), and GetHubIpv6Address().

◆ m_spokeDevices

NetDeviceContainer ns3::CsmaStarHelper::m_spokeDevices
private

NetDeviceContainer for the spokes nodes NetDevices.

Definition at line 146 of file csma-star-helper.h.

Referenced by CsmaStarHelper(), AssignIpv4Addresses(), AssignIpv6Addresses(), and GetSpokeDevices().

◆ m_spokeInterfaces

Ipv4InterfaceContainer ns3::CsmaStarHelper::m_spokeInterfaces
private

Ipv4InterfaceContainer for the spokes IPv4 interfaces.

Definition at line 149 of file csma-star-helper.h.

Referenced by AssignIpv4Addresses(), and GetSpokeIpv4Address().

◆ m_spokeInterfaces6

Ipv6InterfaceContainer ns3::CsmaStarHelper::m_spokeInterfaces6
private

Ipv6InterfaceContainer for the spokes IPv6 interfaces.

Definition at line 152 of file csma-star-helper.h.

Referenced by AssignIpv6Addresses(), and GetSpokeIpv6Address().

◆ m_spokes

NodeContainer ns3::CsmaStarHelper::m_spokes
private

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