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< 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. 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... | |
A helper to make it easier to create a star topology with Csma links.
Definition at line 45 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 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.
ns3::CsmaStarHelper::~CsmaStarHelper | ( | ) |
Definition at line 45 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 111 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().
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 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().
Definition at line 50 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 62 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 74 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 86 of file csma-star-helper.cc.
References ns3::Ipv6InterfaceContainer::GetAddress(), and m_hubInterfaces6.
NetDeviceContainer ns3::CsmaStarHelper::GetSpokeDevices | ( | ) | const |
Definition at line 68 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 80 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 92 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 56 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 104 of file csma-star-helper.cc.
References m_hub, m_spokes, and first::stack.
Referenced by CsmaStarTestCase::DoRun().
uint32_t ns3::CsmaStarHelper::SpokeCount | ( | ) | const |
Definition at line 98 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 143 of file csma-star-helper.h.
Referenced by CsmaStarHelper(), GetHub(), and InstallStack().
|
private |
NetDeviceContainer for the hub node NetDevices.
Definition at line 144 of file csma-star-helper.h.
Referenced by CsmaStarHelper(), AssignIpv4Addresses(), AssignIpv6Addresses(), and GetHubDevices().
|
private |
Ipv4InterfaceContainer for the hub IPv4 interfaces.
Definition at line 147 of file csma-star-helper.h.
Referenced by AssignIpv4Addresses(), and GetHubIpv4Address().
|
private |
Ipv6InterfaceContainer for the hub IPv6 interfaces.
Definition at line 150 of file csma-star-helper.h.
Referenced by AssignIpv6Addresses(), and GetHubIpv6Address().
|
private |
NetDeviceContainer for the spokes nodes NetDevices.
Definition at line 146 of file csma-star-helper.h.
Referenced by CsmaStarHelper(), AssignIpv4Addresses(), AssignIpv6Addresses(), and GetSpokeDevices().
|
private |
Ipv4InterfaceContainer for the spokes IPv4 interfaces.
Definition at line 149 of file csma-star-helper.h.
Referenced by AssignIpv4Addresses(), and GetSpokeIpv4Address().
|
private |
Ipv6InterfaceContainer for the spokes IPv6 interfaces.
Definition at line 152 of file csma-star-helper.h.
Referenced by AssignIpv6Addresses(), and GetSpokeIpv6Address().
|
private |
NodeContainer for the spokes nodes.
Definition at line 145 of file csma-star-helper.h.
Referenced by CsmaStarHelper(), AssignIpv4Addresses(), AssignIpv6Addresses(), GetSpokeNode(), InstallStack(), and SpokeCount().