A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
point-to-point-star.h
Go to the documentation of this file.
1
/*
2
* This program is free software; you can redistribute it and/or modify
3
* it under the terms of the GNU General Public License version 2 as
4
* published by the Free Software Foundation;
5
*
6
* This program is distributed in the hope that it will be useful,
7
* but WITHOUT ANY WARRANTY; without even the implied warranty of
8
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9
* GNU General Public License for more details.
10
*
11
* You should have received a copy of the GNU General Public License
12
* along with this program; if not, write to the Free Software
13
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
14
*/
15
16
// Define an object to create a star topology.
17
18
#ifndef POINT_TO_POINT_STAR_HELPER_H
19
#define POINT_TO_POINT_STAR_HELPER_H
20
21
#include "ns3/internet-stack-helper.h"
22
#include "ns3/ipv4-address-helper.h"
23
#include "ns3/ipv4-interface-container.h"
24
#include "ns3/ipv6-address-helper.h"
25
#include "ns3/ipv6-interface-container.h"
26
#include "ns3/point-to-point-helper.h"
27
28
#include <string>
29
30
namespace
ns3
31
{
32
44
class
PointToPointStarHelper
45
{
46
public
:
58
PointToPointStarHelper
(uint32_t numSpokes,
PointToPointHelper
p2pHelper);
59
60
~PointToPointStarHelper
();
61
62
public
:
67
Ptr<Node>
GetHub
()
const
;
68
74
Ptr<Node>
GetSpokeNode
(uint32_t i)
const
;
75
81
Ipv4Address
GetHubIpv4Address
(uint32_t i)
const
;
82
88
Ipv4Address
GetSpokeIpv4Address
(uint32_t i)
const
;
89
95
Ipv6Address
GetHubIpv6Address
(uint32_t i)
const
;
96
102
Ipv6Address
GetSpokeIpv6Address
(uint32_t i)
const
;
103
107
uint32_t
SpokeCount
()
const
;
108
113
void
InstallStack
(
InternetStackHelper
stack
);
114
120
void
AssignIpv4Addresses
(
Ipv4AddressHelper
address
);
121
127
void
AssignIpv6Addresses
(
Ipv6Address
network,
Ipv6Prefix
prefix);
128
138
void
BoundingBox
(
double
ulx,
double
uly,
double
lrx,
double
lry);
139
140
private
:
141
NodeContainer
m_hub
;
142
NetDeviceContainer
m_hubDevices
;
143
NodeContainer
m_spokes
;
144
NetDeviceContainer
m_spokeDevices
;
145
Ipv4InterfaceContainer
m_hubInterfaces
;
146
Ipv4InterfaceContainer
m_spokeInterfaces
;
147
Ipv6InterfaceContainer
m_hubInterfaces6
;
148
Ipv6InterfaceContainer
m_spokeInterfaces6
;
149
};
150
151
}
// namespace ns3
152
153
#endif
/* POINT_TO_POINT_STAR_HELPER_H */
ns3::InternetStackHelper
aggregate IP/TCP/UDP functionality to existing Nodes.
Definition:
internet-stack-helper.h:92
ns3::Ipv4AddressHelper
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
Definition:
ipv4-address-helper.h:49
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition:
ipv4-address.h:42
ns3::Ipv4InterfaceContainer
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Definition:
ipv4-interface-container.h:56
ns3::Ipv6Address
Describes an IPv6 address.
Definition:
ipv6-address.h:49
ns3::Ipv6InterfaceContainer
Keep track of a set of IPv6 interfaces.
Definition:
ipv6-interface-container.h:40
ns3::Ipv6Prefix
Describes an IPv6 prefix.
Definition:
ipv6-address.h:455
ns3::NetDeviceContainer
holds a vector of ns3::NetDevice pointers
Definition:
net-device-container.h:43
ns3::NodeContainer
keep track of a set of node pointers.
Definition:
node-container.h:40
ns3::PointToPointHelper
Build a set of PointToPointNetDevice objects.
Definition:
point-to-point-helper.h:44
ns3::PointToPointStarHelper
A helper to make it easier to create a star topology with PointToPoint links.
Definition:
point-to-point-star.h:45
ns3::PointToPointStarHelper::GetSpokeNode
Ptr< Node > GetSpokeNode(uint32_t i) const
Definition:
point-to-point-star.cc:60
ns3::PointToPointStarHelper::m_hub
NodeContainer m_hub
Hub node.
Definition:
point-to-point-star.h:141
ns3::PointToPointStarHelper::m_hubInterfaces6
Ipv6InterfaceContainer m_hubInterfaces6
IPv6 hub interfaces.
Definition:
point-to-point-star.h:147
ns3::PointToPointStarHelper::GetHub
Ptr< Node > GetHub() const
Definition:
point-to-point-star.cc:54
ns3::PointToPointStarHelper::InstallStack
void InstallStack(InternetStackHelper stack)
Definition:
point-to-point-star.cc:96
ns3::PointToPointStarHelper::GetSpokeIpv4Address
Ipv4Address GetSpokeIpv4Address(uint32_t i) const
Definition:
point-to-point-star.cc:72
ns3::PointToPointStarHelper::m_spokes
NodeContainer m_spokes
Spoke nodes.
Definition:
point-to-point-star.h:143
ns3::PointToPointStarHelper::m_hubDevices
NetDeviceContainer m_hubDevices
Hub node NetDevices.
Definition:
point-to-point-star.h:142
ns3::PointToPointStarHelper::m_spokeInterfaces
Ipv4InterfaceContainer m_spokeInterfaces
IPv4 spoke nodes interfaces.
Definition:
point-to-point-star.h:146
ns3::PointToPointStarHelper::PointToPointStarHelper
PointToPointStarHelper(uint32_t numSpokes, PointToPointHelper p2pHelper)
Create a PointToPointStarHelper in order to easily create star topologies using p2p links.
Definition:
point-to-point-star.cc:36
ns3::PointToPointStarHelper::m_hubInterfaces
Ipv4InterfaceContainer m_hubInterfaces
IPv4 hub interfaces.
Definition:
point-to-point-star.h:145
ns3::PointToPointStarHelper::SpokeCount
uint32_t SpokeCount() const
Definition:
point-to-point-star.cc:90
ns3::PointToPointStarHelper::GetHubIpv4Address
Ipv4Address GetHubIpv4Address(uint32_t i) const
Definition:
point-to-point-star.cc:66
ns3::PointToPointStarHelper::~PointToPointStarHelper
~PointToPointStarHelper()
Definition:
point-to-point-star.cc:49
ns3::PointToPointStarHelper::AssignIpv6Addresses
void AssignIpv6Addresses(Ipv6Address network, Ipv6Prefix prefix)
Definition:
point-to-point-star.cc:114
ns3::PointToPointStarHelper::GetSpokeIpv6Address
Ipv6Address GetSpokeIpv6Address(uint32_t i) const
Definition:
point-to-point-star.cc:84
ns3::PointToPointStarHelper::BoundingBox
void BoundingBox(double ulx, double uly, double lrx, double lry)
Sets up the node canvas locations for every node in the star.
Definition:
point-to-point-star.cc:135
ns3::PointToPointStarHelper::AssignIpv4Addresses
void AssignIpv4Addresses(Ipv4AddressHelper address)
Definition:
point-to-point-star.cc:103
ns3::PointToPointStarHelper::GetHubIpv6Address
Ipv6Address GetHubIpv6Address(uint32_t i) const
Definition:
point-to-point-star.cc:78
ns3::PointToPointStarHelper::m_spokeInterfaces6
Ipv6InterfaceContainer m_spokeInterfaces6
IPv6 spoke nodes interfaces.
Definition:
point-to-point-star.h:148
ns3::PointToPointStarHelper::m_spokeDevices
NetDeviceContainer m_spokeDevices
Spoke nodes NetDevices.
Definition:
point-to-point-star.h:144
ns3::Ptr< Node >
first.address
address
Definition:
first.py:47
first.stack
stack
Definition:
first.py:44
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
point-to-point-layout
model
point-to-point-star.h
Generated on Sun Mar 3 2024 17:11:07 for ns-3 by
1.9.1