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. More... | |
~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. More... | |
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. More... | |
NetDeviceContainer | m_hubDevices |
Hub node NetDevices. More... | |
Ipv4InterfaceContainer | m_hubInterfaces |
IPv4 hub interfaces. More... | |
Ipv6InterfaceContainer | m_hubInterfaces6 |
IPv6 hub interfaces. More... | |
NetDeviceContainer | m_spokeDevices |
Spoke nodes NetDevices. More... | |
Ipv4InterfaceContainer | m_spokeInterfaces |
IPv4 spoke nodes interfaces. More... | |
Ipv6InterfaceContainer | m_spokeInterfaces6 |
IPv6 spoke nodes interfaces. More... | |
NodeContainer | m_spokes |
Spoke nodes. More... | |
A helper to make it easier to create a star topology with PointToPoint links.
Definition at line 44 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 36 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 49 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 103 of file point-to-point-star.cc.
References ns3::Ipv4InterfaceContainer::Add(), first::address, 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 114 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().
void ns3::PointToPointStarHelper::BoundingBox | ( | double | ulx, |
double | uly, | ||
double | lrx, | ||
double | lry | ||
) |
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 135 of file point-to-point-star.cc.
References ns3::Object::AggregateObject(), ns3::NodeContainer::Get(), ns3::NodeContainer::GetN(), ns3::Object::GetObject(), m_hub, and m_spokes.
Definition at line 54 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 66 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 78 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 72 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 84 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 60 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 96 of file point-to-point-star.cc.
References m_hub, m_spokes, and first::stack.
uint32_t ns3::PointToPointStarHelper::SpokeCount | ( | ) | const |
Definition at line 90 of file point-to-point-star.cc.
References ns3::NodeContainer::GetN(), and m_spokes.
|
private |
Hub node.
Definition at line 141 of file point-to-point-star.h.
Referenced by PointToPointStarHelper(), BoundingBox(), GetHub(), and InstallStack().
|
private |
Hub node NetDevices.
Definition at line 142 of file point-to-point-star.h.
Referenced by PointToPointStarHelper(), AssignIpv4Addresses(), and AssignIpv6Addresses().
|
private |
IPv4 hub interfaces.
Definition at line 145 of file point-to-point-star.h.
Referenced by AssignIpv4Addresses(), and GetHubIpv4Address().
|
private |
IPv6 hub interfaces.
Definition at line 147 of file point-to-point-star.h.
Referenced by AssignIpv6Addresses(), and GetHubIpv6Address().
|
private |
Spoke nodes NetDevices.
Definition at line 144 of file point-to-point-star.h.
Referenced by PointToPointStarHelper(), AssignIpv4Addresses(), and AssignIpv6Addresses().
|
private |
IPv4 spoke nodes interfaces.
Definition at line 146 of file point-to-point-star.h.
Referenced by AssignIpv4Addresses(), and GetSpokeIpv4Address().
|
private |
IPv6 spoke nodes interfaces.
Definition at line 148 of file point-to-point-star.h.
Referenced by AssignIpv6Addresses(), and GetSpokeIpv6Address().
|
private |
Spoke nodes.
Definition at line 143 of file point-to-point-star.h.
Referenced by PointToPointStarHelper(), AssignIpv4Addresses(), AssignIpv6Addresses(), BoundingBox(), GetSpokeNode(), InstallStack(), and SpokeCount().