A Discrete-Event Network Simulator
API
brite-topology-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
17#ifndef BRITE_TOPOLOGY_HELPER_H
18#define BRITE_TOPOLOGY_HELPER_H
19
20#include "ns3/channel.h"
21#include "ns3/internet-stack-helper.h"
22#include "ns3/ipv6-address-helper.h"
23#include "ns3/node-container.h"
24#include "ns3/node-list.h"
25#include "ns3/point-to-point-helper.h"
26#include "ns3/random-variable-stream.h"
27
28#include <string>
29#include <vector>
30
31// located in BRITE source directory
32#include "Brite.h"
33
34namespace ns3
35{
36
37class PointToPointHelper;
38class Ipv4AddressHelper;
39
67{
68 public:
76 BriteTopologyHelper(std::string confFile, std::string seedFile, std::string newseedFile);
77
83 BriteTopologyHelper(std::string confFile);
84
86
93 void AssignStreams(int64_t streamNumber);
94
101
109 void BuildBriteTopology(InternetStackHelper& stack, const uint32_t systemCount);
110
118
127
135
143 Ptr<Node> GetNodeForAs(uint32_t asNum, uint32_t nodeNum);
144
150 uint32_t GetNAs() const;
151
161
170
179
187
195
196 private:
201 static const int mbpsToBps = 1000000;
202
211 {
212 int nodeId;
213 double xCoordinate;
214 double yCoordinate;
217 int asId;
218 std::string type;
219 };
220
229 {
230 int edgeId;
231 int srcId;
232 int destId;
233 double length;
234 double delay;
235 double bandwidth;
236 int asFrom;
237 int asTo;
238 std::string type;
239 };
240
243
249 void ConstructTopology();
252
254 std::string m_confFile;
255
257 std::string m_seedFile;
258
260 std::string m_newSeedFile;
261
264
266 std::vector<NetDeviceContainer*> m_netDevices;
267
269 std::vector<NodeContainer*> m_asLeafNodes;
270
272 std::vector<NodeContainer*> m_nodesByAs;
273
275 std::vector<int> m_systemForAs;
276
278 brite::Topology* m_topology;
279
282
285
292 typedef std::vector<BriteNodeInfo> BriteNodeInfoList;
293 typedef std::vector<BriteEdgeInfo> BriteEdgeInfoList;
294
301
304};
305
306} // namespace ns3
307
308#endif /* BRITE_TOPOLOGY_HELPER_H */
Interface with BRITE, the Boston university Representative Internet Topology gEnerator.
BriteNodeInfoList m_briteNodeInfoList
The BRITE code generates multiple nodes and edges.
void AssignIpv6Addresses(Ipv6AddressHelper &address)
Assign IPv6 addresses.
void AssignStreams(int64_t streamNumber)
Assigns stream number to UniformRandomVariable used to generate brite seed file.
BriteEdgeInfoList m_briteEdgeInfoList
The BRITE code generates multiple nodes and edges.
PointToPointHelper m_britePointToPointHelper
used to create the links within the topology
Ptr< UniformRandomVariable > m_uv
random variable stream for brite seed file
brite::Topology * m_topology
the Brite topology
uint32_t m_numNodes
stores the number of nodes created in the BRITE topology
uint32_t GetNAs() const
Returns the number of AS created in the topology.
std::vector< NetDeviceContainer * > m_netDevices
stores the netdevices created for each AS
uint32_t m_numEdges
stores the number of edges created in the BRITE topology
uint32_t GetNNodesTopology() const
Returns the number of nodes created within the topology.
void BuildBriteTopology(InternetStackHelper &stack)
Create NS3 topology using information generated from BRITE.
std::vector< NodeContainer * > m_asLeafNodes
stores the leaf router nodes for each AS
std::vector< NodeContainer * > m_nodesByAs
stores all of the nodes in the brite topology by AS number
uint32_t m_numAs
stores the number of AS in the BRITE generated topology
void BuildBriteNodeInfoList()
Build the Node Info list.
void GenerateBriteTopology()
Generate the BRITE topology.
static const int mbpsToBps
brite values are unitless however all examples provided use mbps to specify rate this constant value ...
Ptr< Node > GetNodeForAs(uint32_t asNum, uint32_t nodeNum)
Returns a given router node for a given AS.
void ConstructTopology()
Construct the topology.
void BuildBriteEdgeInfoList()
Build the Edge Info list.
void AssignIpv4Addresses(Ipv4AddressHelper &address)
Assign IPv4 addresses.
uint32_t GetNNodesForAs(uint32_t asNum)
Returns the total number of nodes for a given AS.
uint32_t GetNLeafNodesForAs(uint32_t asNum)
Returns the number of router leaf nodes for a given AS.
std::string m_newSeedFile
brite seed file to generate for next run
std::vector< BriteNodeInfo > BriteNodeInfoList
The BRITE code generates multiple nodes and edges.
std::string m_seedFile
brite seed file to use
std::vector< BriteEdgeInfo > BriteEdgeInfoList
The BRITE code generates multiple nodes and edges.
std::vector< int > m_systemForAs
stores the MPI system number each AS assigned to. All assigned to 0 if MPI not used.
NodeContainer m_nodes
stores all of the nodes used in the BRITE generated topology
uint32_t GetNEdgesTopology() const
Returns the number of edges created within the topology.
BriteTopologyHelper(std::string confFile, std::string seedFile, std::string newseedFile)
Construct a BriteTopologyHelper.
Ptr< Node > GetLeafNodeForAs(uint32_t asNum, uint32_t leafNum)
Returns a given router leaf node from a given AS.
uint32_t GetSystemNumberForAs(uint32_t asNum) const
Returns the system number for the MPI instance that this AS is assigned to.
std::string m_confFile
brite configuration file to use
aggregate IP/TCP/UDP functionality to existing Nodes.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
Helper class to auto-assign global IPv6 unicast addresses.
keep track of a set of node pointers.
Build a set of PointToPointNetDevice objects.
address
Definition: first.py:40
stack
Definition: first.py:37
Every class exported by the ns3 library is enclosed in the ns3 namespace.