A Discrete-Event Network Simulator
API
csma-star-helper.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License version 2 as
5  * published by the Free Software Foundation;
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15  */
16 
17 // Define an object to create a star topology.
18 
19 #ifndef CSMA_STAR_HELPER_H
20 #define CSMA_STAR_HELPER_H
21 
22 #include <string>
23 
24 #include "csma-helper.h"
25 #include "ipv4-address-helper.h"
26 #include "ipv6-address-helper.h"
27 #include "internet-stack-helper.h"
30 #include "ipv6-address-generator.h"
31 
32 namespace ns3 {
33 
46 {
47 public:
59  CsmaStarHelper (uint32_t numSpokes,
60  CsmaHelper csmaHelper);
61 
62  ~CsmaStarHelper ();
63 
64 public:
69  Ptr<Node> GetHub () const;
70 
76  Ptr<Node> GetSpokeNode (uint32_t i) const;
77 
83 
89 
95  Ipv4Address GetHubIpv4Address (uint32_t i) const;
96 
102  Ipv6Address GetHubIpv6Address (uint32_t i) const;
103 
109  Ipv4Address GetSpokeIpv4Address (uint32_t i) const;
110 
116  Ipv6Address GetSpokeIpv6Address (uint32_t i) const;
117 
121  uint32_t SpokeCount () const;
122 
128 
135 
141  void AssignIpv6Addresses (Ipv6Address network, Ipv6Prefix prefix);
142 
143 private:
152 };
153 
154 } // namespace ns3
155 
156 #endif /* CSMA_STAR_HELPER_H */
Ipv6Address GetSpokeIpv6Address(uint32_t i) const
void AssignIpv4Addresses(Ipv4AddressHelper address)
void InstallStack(InternetStackHelper stack)
Keep track of a set of IPv6 interfaces.
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Ipv6Address GetHubIpv6Address(uint32_t i) const
uint32_t SpokeCount() const
aggregate IP/TCP/UDP functionality to existing Nodes.
NodeContainer m_hub
NodeContainer for the hub node.
CsmaStarHelper(uint32_t numSpokes, CsmaHelper csmaHelper)
Create a CsmaStarHelper in order to easily create star topologies using Csma links.
NodeContainer m_spokes
NodeContainer for the spokes nodes.
Ptr< Node > GetHub() const
stack
Definition: first.py:34
holds a vector of ns3::NetDevice pointers
NetDeviceContainer GetHubDevices() const
Ipv4InterfaceContainer m_hubInterfaces
Ipv4InterfaceContainer for the hub IPv4 interfaces.
NetDeviceContainer m_spokeDevices
NetDeviceContainer for the spokes nodes NetDevices.
NetDeviceContainer GetSpokeDevices() const
NetDeviceContainer m_hubDevices
NetDeviceContainer for the hub node NetDevices.
Ipv4InterfaceContainer m_spokeInterfaces
Ipv4InterfaceContainer for the spokes IPv4 interfaces.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
address
Definition: first.py:37
void AssignIpv6Addresses(Ipv6Address network, Ipv6Prefix prefix)
build a set of CsmaNetDevice objects
Definition: csma-helper.h:46
Ptr< Node > GetSpokeNode(uint32_t i) const
Describes an IPv6 address.
Definition: ipv6-address.h:49
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:40
Ipv4Address GetHubIpv4Address(uint32_t i) const
Ipv6InterfaceContainer m_spokeInterfaces6
Ipv6InterfaceContainer for the spokes IPv6 interfaces.
Ipv4Address GetSpokeIpv4Address(uint32_t i) const
Describes an IPv6 prefix.
Definition: ipv6-address.h:428
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
A helper to make it easier to create a star topology with Csma links.
Ipv6InterfaceContainer m_hubInterfaces6
Ipv6InterfaceContainer for the hub IPv6 interfaces.