A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
csma-star-helper.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 CSMA_STAR_HELPER_H
19
#define CSMA_STAR_HELPER_H
20
21
#include "ns3/csma-helper.h"
22
#include "ns3/internet-stack-helper.h"
23
#include "ns3/ipv4-address-helper.h"
24
#include "ns3/ipv4-interface-container.h"
25
#include "ns3/ipv6-address-generator.h"
26
#include "ns3/ipv6-address-helper.h"
27
#include "ns3/ipv6-interface-container.h"
28
29
#include <string>
30
31
namespace
ns3
32
{
33
45
class
CsmaStarHelper
46
{
47
public
:
59
CsmaStarHelper
(
uint32_t
numSpokes,
CsmaHelper
csmaHelper);
60
61
~CsmaStarHelper
();
62
63
public
:
68
Ptr<Node>
GetHub
()
const
;
69
75
Ptr<Node>
GetSpokeNode
(
uint32_t
i)
const
;
76
81
NetDeviceContainer
GetHubDevices
()
const
;
82
87
NetDeviceContainer
GetSpokeDevices
()
const
;
88
94
Ipv4Address
GetHubIpv4Address
(
uint32_t
i)
const
;
95
101
Ipv6Address
GetHubIpv6Address
(
uint32_t
i)
const
;
102
108
Ipv4Address
GetSpokeIpv4Address
(
uint32_t
i)
const
;
109
115
Ipv6Address
GetSpokeIpv6Address
(
uint32_t
i)
const
;
116
120
uint32_t
SpokeCount
()
const
;
121
126
void
InstallStack
(
InternetStackHelper
stack);
127
133
void
AssignIpv4Addresses
(
Ipv4AddressHelper
address);
134
140
void
AssignIpv6Addresses
(
Ipv6Address
network,
Ipv6Prefix
prefix);
141
142
private
:
143
NodeContainer
m_hub
;
144
NetDeviceContainer
m_hubDevices
;
145
NodeContainer
m_spokes
;
146
NetDeviceContainer
m_spokeDevices
;
147
Ipv4InterfaceContainer
m_hubInterfaces
;
148
Ipv4InterfaceContainer
149
m_spokeInterfaces
;
150
Ipv6InterfaceContainer
m_hubInterfaces6
;
151
Ipv6InterfaceContainer
152
m_spokeInterfaces6
;
153
};
154
155
}
// namespace ns3
156
157
#endif
/* CSMA_STAR_HELPER_H */
ns3::CsmaHelper
build a set of CsmaNetDevice objects
Definition:
csma-helper.h:48
ns3::CsmaStarHelper
A helper to make it easier to create a star topology with Csma links.
Definition:
csma-star-helper.h:46
ns3::CsmaStarHelper::AssignIpv6Addresses
void AssignIpv6Addresses(Ipv6Address network, Ipv6Prefix prefix)
Definition:
csma-star-helper.cc:122
ns3::CsmaStarHelper::InstallStack
void InstallStack(InternetStackHelper stack)
Definition:
csma-star-helper.cc:104
ns3::CsmaStarHelper::m_spokeInterfaces6
Ipv6InterfaceContainer m_spokeInterfaces6
Ipv6InterfaceContainer for the spokes IPv6 interfaces.
Definition:
csma-star-helper.h:152
ns3::CsmaStarHelper::m_spokeDevices
NetDeviceContainer m_spokeDevices
NetDeviceContainer for the spokes nodes NetDevices.
Definition:
csma-star-helper.h:146
ns3::CsmaStarHelper::GetSpokeIpv4Address
Ipv4Address GetSpokeIpv4Address(uint32_t i) const
Definition:
csma-star-helper.cc:80
ns3::CsmaStarHelper::m_spokes
NodeContainer m_spokes
NodeContainer for the spokes nodes.
Definition:
csma-star-helper.h:145
ns3::CsmaStarHelper::GetHubIpv4Address
Ipv4Address GetHubIpv4Address(uint32_t i) const
Definition:
csma-star-helper.cc:74
ns3::CsmaStarHelper::~CsmaStarHelper
~CsmaStarHelper()
Definition:
csma-star-helper.cc:45
ns3::CsmaStarHelper::GetHubIpv6Address
Ipv6Address GetHubIpv6Address(uint32_t i) const
Definition:
csma-star-helper.cc:86
ns3::CsmaStarHelper::AssignIpv4Addresses
void AssignIpv4Addresses(Ipv4AddressHelper address)
Definition:
csma-star-helper.cc:111
ns3::CsmaStarHelper::GetSpokeNode
Ptr< Node > GetSpokeNode(uint32_t i) const
Definition:
csma-star-helper.cc:56
ns3::CsmaStarHelper::GetHub
Ptr< Node > GetHub() const
Definition:
csma-star-helper.cc:50
ns3::CsmaStarHelper::m_hubInterfaces6
Ipv6InterfaceContainer m_hubInterfaces6
Ipv6InterfaceContainer for the hub IPv6 interfaces.
Definition:
csma-star-helper.h:150
ns3::CsmaStarHelper::m_hubDevices
NetDeviceContainer m_hubDevices
NetDeviceContainer for the hub node NetDevices.
Definition:
csma-star-helper.h:144
ns3::CsmaStarHelper::m_hubInterfaces
Ipv4InterfaceContainer m_hubInterfaces
Ipv4InterfaceContainer for the hub IPv4 interfaces.
Definition:
csma-star-helper.h:147
ns3::CsmaStarHelper::GetSpokeDevices
NetDeviceContainer GetSpokeDevices() const
Definition:
csma-star-helper.cc:68
ns3::CsmaStarHelper::SpokeCount
uint32_t SpokeCount() const
Definition:
csma-star-helper.cc:98
ns3::CsmaStarHelper::m_spokeInterfaces
Ipv4InterfaceContainer m_spokeInterfaces
Ipv4InterfaceContainer for the spokes IPv4 interfaces.
Definition:
csma-star-helper.h:149
ns3::CsmaStarHelper::m_hub
NodeContainer m_hub
NodeContainer for the hub node.
Definition:
csma-star-helper.h:143
ns3::CsmaStarHelper::GetHubDevices
NetDeviceContainer GetHubDevices() const
Definition:
csma-star-helper.cc:62
ns3::CsmaStarHelper::GetSpokeIpv6Address
Ipv6Address GetSpokeIpv6Address(uint32_t i) const
Definition:
csma-star-helper.cc:92
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::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
csma-layout
model
csma-star-helper.h
Generated on Thu Feb 8 2024 09:24:39 for ns-3 by
1.9.6