A helper to make it easier to create a star topology with PointToPoint links. More...
#include "point-to-point-star.h"
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< Node > | GetHub () 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< Node > | GetSpokeNode (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. | |
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.
ns3::PointToPointStarHelper::PointToPointStarHelper | ( | uint32_t | numSpokes, |
PointToPointHelper | p2pHelper ) |
Create a PointToPointStarHelper in order to easily create star topologies using p2p links.
numSpokes | the number of links attached to the hub node, creating a total of numSpokes + 1 nodes |
p2pHelper | the 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.
ns3::PointToPointStarHelper::~PointToPointStarHelper | ( | ) |
Definition at line 38 of file point-to-point-star.cc.
void ns3::PointToPointStarHelper::AssignIpv4Addresses | ( | Ipv4AddressHelper | address | ) |
address | an 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.
void ns3::PointToPointStarHelper::AssignIpv6Addresses | ( | Ipv6Address | network, |
Ipv6Prefix | prefix ) |
network | an IPv6 address representing the network portion of the IPv6 Address |
prefix | the 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().
Sets up the node canvas locations for every node in the star.
This is needed for use with the animation interface
ulx | upper left x value |
uly | upper left y value |
lrx | lower right x value |
lry | lower 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.
Definition at line 43 of file point-to-point-star.cc.
References ns3::NodeContainer::Get(), and m_hub.
Ipv4Address ns3::PointToPointStarHelper::GetHubIpv4Address | ( | uint32_t | i | ) | const |
i | index into the hub interfaces |
Definition at line 55 of file point-to-point-star.cc.
References ns3::Ipv4InterfaceContainer::GetAddress(), and m_hubInterfaces.
Ipv6Address ns3::PointToPointStarHelper::GetHubIpv6Address | ( | uint32_t | i | ) | const |
i | index into the hub interfaces |
Definition at line 67 of file point-to-point-star.cc.
References ns3::Ipv6InterfaceContainer::GetAddress(), and m_hubInterfaces6.
Ipv4Address ns3::PointToPointStarHelper::GetSpokeIpv4Address | ( | uint32_t | i | ) | const |
i | index into the spoke interfaces |
Definition at line 61 of file point-to-point-star.cc.
References ns3::Ipv4InterfaceContainer::GetAddress(), and m_spokeInterfaces.
Ipv6Address ns3::PointToPointStarHelper::GetSpokeIpv6Address | ( | uint32_t | i | ) | const |
i | index into the spoke interfaces |
Definition at line 73 of file point-to-point-star.cc.
References ns3::Ipv6InterfaceContainer::GetAddress(), and m_spokeInterfaces6.
i | an index into the spokes of the star |
Definition at line 49 of file point-to-point-star.cc.
References ns3::NodeContainer::Get(), and m_spokes.
void ns3::PointToPointStarHelper::InstallStack | ( | InternetStackHelper | stack | ) |
stack | an InternetStackHelper which is used to install on every node in the star |
Definition at line 85 of file point-to-point-star.cc.
uint32_t ns3::PointToPointStarHelper::SpokeCount | ( | ) | const |
Definition at line 79 of file point-to-point-star.cc.
References ns3::NodeContainer::GetN(), and m_spokes.
|
private |
Hub node.
Definition at line 130 of file point-to-point-star.h.
Referenced by PointToPointStarHelper(), BoundingBox(), GetHub(), and InstallStack().
|
private |
Hub node NetDevices.
Definition at line 131 of file point-to-point-star.h.
Referenced by PointToPointStarHelper(), AssignIpv4Addresses(), and AssignIpv6Addresses().
|
private |
IPv4 hub interfaces.
Definition at line 134 of file point-to-point-star.h.
Referenced by AssignIpv4Addresses(), and GetHubIpv4Address().
|
private |
IPv6 hub interfaces.
Definition at line 136 of file point-to-point-star.h.
Referenced by AssignIpv6Addresses(), and GetHubIpv6Address().
|
private |
Spoke nodes NetDevices.
Definition at line 133 of file point-to-point-star.h.
Referenced by PointToPointStarHelper(), AssignIpv4Addresses(), and AssignIpv6Addresses().
|
private |
IPv4 spoke nodes interfaces.
Definition at line 135 of file point-to-point-star.h.
Referenced by AssignIpv4Addresses(), and GetSpokeIpv4Address().
|
private |
IPv6 spoke nodes interfaces.
Definition at line 137 of file point-to-point-star.h.
Referenced by AssignIpv6Addresses(), and GetSpokeIpv6Address().
|
private |
Spoke nodes.
Definition at line 132 of file point-to-point-star.h.
Referenced by PointToPointStarHelper(), AssignIpv4Addresses(), AssignIpv6Addresses(), BoundingBox(), GetSpokeNode(), InstallStack(), and SpokeCount().