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. | |
~CsmaStarHelper () | |
void | AssignIpv4Addresses (Ipv4AddressHelper address) |
void | AssignIpv6Addresses (Ipv6Address network, Ipv6Prefix prefix) |
Ptr< Node > | GetHub () 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< Node > | GetSpokeNode (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. | |
A helper to make it easier to create a star topology with Csma links.
Definition at line 34 of file csma-star-helper.h.
ns3::CsmaStarHelper::CsmaStarHelper | ( | uint32_t | numSpokes, |
CsmaHelper | csmaHelper ) |
Create a CsmaStarHelper in order to easily create star topologies using Csma links.
numSpokes | the number of links attached to the hub node, creating a total of numSpokes + 1 nodes |
csmaHelper | the link helper for Csma links, used to link nodes together |
Definition at line 20 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.
ns3::CsmaStarHelper::~CsmaStarHelper | ( | ) |
Definition at line 34 of file csma-star-helper.cc.
void ns3::CsmaStarHelper::AssignIpv4Addresses | ( | Ipv4AddressHelper | address | ) |
address | an Ipv4AddressHelper which is used to install Ipv4 addresses on all the node interfaces in the star |
Definition at line 100 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().
void ns3::CsmaStarHelper::AssignIpv6Addresses | ( | Ipv6Address | network, |
Ipv6Prefix | prefix ) |
network | an IPv6 Address representing the network portion of the Ipv6 Address |
prefix | the prefix length |
Definition at line 111 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().
Definition at line 39 of file csma-star-helper.cc.
References ns3::NodeContainer::Get(), and m_hub.
Referenced by CsmaStarTestCase::DoRun().
NetDeviceContainer ns3::CsmaStarHelper::GetHubDevices | ( | ) | const |
Definition at line 51 of file csma-star-helper.cc.
References m_hubDevices.
Ipv4Address ns3::CsmaStarHelper::GetHubIpv4Address | ( | uint32_t | i | ) | const |
i | index into the hub interfaces |
Definition at line 63 of file csma-star-helper.cc.
References ns3::Ipv4InterfaceContainer::GetAddress(), and m_hubInterfaces.
Referenced by CsmaStarTestCase::DoRun().
Ipv6Address ns3::CsmaStarHelper::GetHubIpv6Address | ( | uint32_t | i | ) | const |
i | index into the hub interfaces |
Definition at line 75 of file csma-star-helper.cc.
References ns3::Ipv6InterfaceContainer::GetAddress(), and m_hubInterfaces6.
NetDeviceContainer ns3::CsmaStarHelper::GetSpokeDevices | ( | ) | const |
Definition at line 57 of file csma-star-helper.cc.
References m_spokeDevices.
Referenced by CsmaStarTestCase::DoRun().
Ipv4Address ns3::CsmaStarHelper::GetSpokeIpv4Address | ( | uint32_t | i | ) | const |
i | index into the spoke interfaces |
Definition at line 69 of file csma-star-helper.cc.
References ns3::Ipv4InterfaceContainer::GetAddress(), and m_spokeInterfaces.
Ipv6Address ns3::CsmaStarHelper::GetSpokeIpv6Address | ( | uint32_t | i | ) | const |
i | index into the spoke interfaces |
Definition at line 81 of file csma-star-helper.cc.
References ns3::Ipv6InterfaceContainer::GetAddress(), and m_spokeInterfaces6.
i | an index into the spokes of the star |
Definition at line 45 of file csma-star-helper.cc.
References ns3::NodeContainer::Get(), and m_spokes.
Referenced by CsmaStarTestCase::DoRun().
void ns3::CsmaStarHelper::InstallStack | ( | InternetStackHelper | stack | ) |
stack | an InternetStackHelper which is used to install on every node in the star |
Definition at line 93 of file csma-star-helper.cc.
References m_hub, and m_spokes.
Referenced by CsmaStarTestCase::DoRun().
uint32_t ns3::CsmaStarHelper::SpokeCount | ( | ) | const |
Definition at line 87 of file csma-star-helper.cc.
References ns3::NodeContainer::GetN(), and m_spokes.
Referenced by CsmaStarTestCase::DoRun().
|
private |
NodeContainer for the hub node.
Definition at line 132 of file csma-star-helper.h.
Referenced by CsmaStarHelper(), GetHub(), and InstallStack().
|
private |
NetDeviceContainer for the hub node NetDevices.
Definition at line 133 of file csma-star-helper.h.
Referenced by CsmaStarHelper(), AssignIpv4Addresses(), AssignIpv6Addresses(), and GetHubDevices().
|
private |
Ipv4InterfaceContainer for the hub IPv4 interfaces.
Definition at line 136 of file csma-star-helper.h.
Referenced by AssignIpv4Addresses(), and GetHubIpv4Address().
|
private |
Ipv6InterfaceContainer for the hub IPv6 interfaces.
Definition at line 139 of file csma-star-helper.h.
Referenced by AssignIpv6Addresses(), and GetHubIpv6Address().
|
private |
NetDeviceContainer for the spokes nodes NetDevices.
Definition at line 135 of file csma-star-helper.h.
Referenced by CsmaStarHelper(), AssignIpv4Addresses(), AssignIpv6Addresses(), and GetSpokeDevices().
|
private |
Ipv4InterfaceContainer for the spokes IPv4 interfaces.
Definition at line 138 of file csma-star-helper.h.
Referenced by AssignIpv4Addresses(), and GetSpokeIpv4Address().
|
private |
Ipv6InterfaceContainer for the spokes IPv6 interfaces.
Definition at line 141 of file csma-star-helper.h.
Referenced by AssignIpv6Addresses(), and GetSpokeIpv6Address().
|
private |
NodeContainer for the spokes nodes.
Definition at line 134 of file csma-star-helper.h.
Referenced by CsmaStarHelper(), AssignIpv4Addresses(), AssignIpv6Addresses(), GetSpokeNode(), InstallStack(), and SpokeCount().