A Discrete-Event Network Simulator
API
Public Member Functions | Private Attributes | List of all members
ns3::CsmaStarHelper Class Reference

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

#include "csma-star-helper.h"

Public Member Functions

 CsmaStarHelper (uint32_t numSpokes, CsmaHelper csmaHelper)
 Create a CsmaStarHelper in order to easily create star topologies using Csma links. More...
 
 ~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. More...
 
NetDeviceContainer m_hubDevices
 NetDeviceContainer for the hub node NetDevices. More...
 
Ipv4InterfaceContainer m_hubInterfaces
 Ipv4InterfaceContainer for the hub IPv4 interfaces. More...
 
Ipv6InterfaceContainer m_hubInterfaces6
 Ipv6InterfaceContainer for the hub IPv6 interfaces. More...
 
NetDeviceContainer m_spokeDevices
 NetDeviceContainer for the spokes nodes NetDevices. More...
 
Ipv4InterfaceContainer m_spokeInterfaces
 Ipv4InterfaceContainer for the spokes IPv4 interfaces. More...
 
Ipv6InterfaceContainer m_spokeInterfaces6
 Ipv6InterfaceContainer for the spokes IPv6 interfaces. More...
 
NodeContainer m_spokes
 NodeContainer for the spokes nodes. More...
 

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::NodeContainer::Get(), ns3::NodeContainer::GetN(), ns3::CsmaHelper::Install(), m_hub, m_hubDevices, m_spokeDevices, m_spokes, and first::nodes.

◆ ~CsmaStarHelper()

ns3::CsmaStarHelper::~CsmaStarHelper ( )

Definition at line 46 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 112 of file csma-star-helper.cc.

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

Referenced by CsmaStarTestCase::DoRun().

◆ AssignIpv6Addresses()

void ns3::CsmaStarHelper::AssignIpv6Addresses ( Ipv6Address  network,
Ipv6Prefix  prefix 
)

◆ 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 51 of file csma-star-helper.cc.

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

Referenced by CsmaStarTestCase::DoRun().

◆ GetHubDevices()

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

Definition at line 63 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 75 of file csma-star-helper.cc.

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

Referenced by CsmaStarTestCase::DoRun().

◆ 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 87 of file csma-star-helper.cc.

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

◆ GetSpokeDevices()

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

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

References m_spokeDevices.

Referenced by CsmaStarTestCase::DoRun().

◆ 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 81 of file csma-star-helper.cc.

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

◆ 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 93 of file csma-star-helper.cc.

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

◆ 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 57 of file csma-star-helper.cc.

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

Referenced by CsmaStarTestCase::DoRun().

◆ InstallStack()

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

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

References m_hub, m_spokes, and first::stack.

Referenced by CsmaStarTestCase::DoRun().

◆ SpokeCount()

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

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

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

Referenced by CsmaStarTestCase::DoRun().

Member Data Documentation

◆ m_hub

NodeContainer ns3::CsmaStarHelper::m_hub
private

NodeContainer for the hub node.

Definition at line 144 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 145 of file csma-star-helper.h.

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

◆ m_hubInterfaces

Ipv4InterfaceContainer ns3::CsmaStarHelper::m_hubInterfaces
private

Ipv4InterfaceContainer for the hub IPv4 interfaces.

Definition at line 148 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 147 of file csma-star-helper.h.

Referenced by AssignIpv4Addresses(), AssignIpv6Addresses(), CsmaStarHelper(), 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 151 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: