Interface with BRITE, the Boston university Representative Internet Topology gEnerator. More...
#include "brite-topology-helper.h"
Classes | |
struct | BriteEdgeInfo |
Edge information from BRITE. More... | |
struct | BriteNodeInfo |
Node information from BRITE. More... | |
Public Member Functions | |
BriteTopologyHelper (std::string confFile) | |
Construct a BriteTopologyHelper using NS3 to generate seed values need by BRITE. | |
BriteTopologyHelper (std::string confFile, std::string seedFile, std::string newseedFile) | |
Construct a BriteTopologyHelper. | |
~BriteTopologyHelper () | |
void | AssignIpv4Addresses (Ipv4AddressHelper &address) |
Assign IPv4 addresses. | |
void | AssignIpv6Addresses (Ipv6AddressHelper &address) |
Assign IPv6 addresses. | |
void | AssignStreams (int64_t streamNumber) |
Assigns stream number to UniformRandomVariable used to generate brite seed file. | |
void | BuildBriteTopology (InternetStackHelper &stack) |
Create NS3 topology using information generated from BRITE. | |
void | BuildBriteTopology (InternetStackHelper &stack, const uint32_t systemCount) |
Create NS3 topology using information generated from BRITE and configure topology for MPI use. | |
Ptr< Node > | GetLeafNodeForAs (uint32_t asNum, uint32_t leafNum) |
Returns a given router leaf node from a given AS. | |
uint32_t | GetNAs () const |
Returns the number of AS created in the topology. | |
uint32_t | GetNEdgesTopology () const |
Returns the number of edges created within the topology. | |
uint32_t | GetNLeafNodesForAs (uint32_t asNum) |
Returns the number of router leaf nodes for a given AS. | |
uint32_t | GetNNodesForAs (uint32_t asNum) |
Returns the total number of nodes for a given AS. | |
uint32_t | GetNNodesTopology () const |
Returns the number of nodes created within the topology. | |
Ptr< Node > | GetNodeForAs (uint32_t asNum, uint32_t nodeNum) |
Returns a given router node for a given AS. | |
uint32_t | GetSystemNumberForAs (uint32_t asNum) const |
Returns the system number for the MPI instance that this AS is assigned to. | |
Private Member Functions | |
void | BuildBriteEdgeInfoList () |
Build the Edge Info list. | |
void | BuildBriteNodeInfoList () |
Build the Node Info list. | |
void | ConstructTopology () |
Construct the topology. | |
void | GenerateBriteTopology () |
Generate the BRITE topology. | |
Private Attributes | |
std::vector< NodeContainer * > | m_asLeafNodes |
stores the leaf router nodes for each AS | |
PointToPointHelper | m_britePointToPointHelper |
used to create the links within the topology | |
std::string | m_confFile |
brite configuration file to use | |
std::vector< NetDeviceContainer * > | m_netDevices |
stores the netdevices created for each AS | |
std::string | m_newSeedFile |
brite seed file to generate for next run | |
NodeContainer | m_nodes |
stores all of the nodes used in the BRITE generated topology | |
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 | |
uint32_t | m_numEdges |
stores the number of edges created in the BRITE topology | |
uint32_t | m_numNodes |
stores the number of nodes created in the BRITE topology | |
std::string | m_seedFile |
brite seed file to use | |
std::vector< int > | m_systemForAs |
stores the MPI system number each AS assigned to. All assigned to 0 if MPI not used. | |
brite::Topology * | m_topology |
the Brite topology | |
Ptr< UniformRandomVariable > | m_uv |
random variable stream for brite seed file | |
Static Private Attributes | |
static const int | mbpsToBps = 1000000 |
brite values are unitless however all examples provided use mbps to specify rate this constant value is used to convert the mbps provided by brite to bps. | |
typedef std::vector< BriteNodeInfo > | BriteNodeInfoList |
The BRITE code generates multiple nodes and edges. | |
typedef std::vector< BriteEdgeInfo > | BriteEdgeInfoList |
The BRITE code generates multiple nodes and edges. | |
BriteNodeInfoList | m_briteNodeInfoList |
The BRITE code generates multiple nodes and edges. | |
BriteEdgeInfoList | m_briteEdgeInfoList |
The BRITE code generates multiple nodes and edges. | |
Interface with BRITE, the Boston university Representative Internet Topology gEnerator.
This helper class creates an interface with BRITE and allows the user to easily create ns-3 topologies from BRITE generated graphs. This class accepts a BRITE configuration and seed file, much like the stand-alone BRITE software. Using these files, BRITE generates a graph which is stored herein. ns-3 examples can then grab the BRITE generated nodes and edges from this helper and create ns-3 specific topologies.
Definition at line 59 of file brite-topology-helper.h.
|
private |
The BRITE code generates multiple nodes and edges.
Each node and edge is stored in a BriteNodeInfo or BriteEdgeInfo struct, and each instance is stored in a vector.
Definition at line 286 of file brite-topology-helper.h.
|
private |
The BRITE code generates multiple nodes and edges.
Each node and edge is stored in a BriteNodeInfo or BriteEdgeInfo struct, and each instance is stored in a vector.
Definition at line 285 of file brite-topology-helper.h.
ns3::BriteTopologyHelper::BriteTopologyHelper | ( | std::string | confFile, |
std::string | seedFile, | ||
std::string | newseedFile ) |
Construct a BriteTopologyHelper.
confFile | a BRITE configuration file |
seedFile | a BRITE seed file |
newseedFile | a BRITE seed file with newly generated values |
Definition at line 28 of file brite-topology-helper.cc.
References ns3::CreateObject(), m_uv, and NS_LOG_FUNCTION.
ns3::BriteTopologyHelper::BriteTopologyHelper | ( | std::string | confFile | ) |
Construct a BriteTopologyHelper using NS3 to generate seed values need by BRITE.
confFile | a BRITE configuration file |
Definition at line 44 of file brite-topology-helper.cc.
References ns3::CreateObject(), m_uv, and NS_LOG_FUNCTION.
ns3::BriteTopologyHelper::~BriteTopologyHelper | ( | ) |
Definition at line 56 of file brite-topology-helper.cc.
References m_asLeafNodes, m_netDevices, m_nodesByAs, m_topology, and NS_LOG_FUNCTION.
void ns3::BriteTopologyHelper::AssignIpv4Addresses | ( | Ipv4AddressHelper & | address | ) |
Assign IPv4 addresses.
address | an Ipv4AddressHelper which is used to install IPv4 addresses on all the node interfaces in the topology |
Definition at line 423 of file brite-topology-helper.cc.
References m_netDevices, and NS_LOG_FUNCTION.
void ns3::BriteTopologyHelper::AssignIpv6Addresses | ( | Ipv6AddressHelper & | address | ) |
Assign IPv6 addresses.
address | an Ipv6AddressHelper which is used to install IPv6 addresses on all the node interfaces in the topology |
Definition at line 435 of file brite-topology-helper.cc.
References m_netDevices, and NS_LOG_FUNCTION.
void ns3::BriteTopologyHelper::AssignStreams | ( | int64_t | streamNumber | ) |
Assigns stream number to UniformRandomVariable used to generate brite seed file.
streamNumber | the stream number to assign |
Definition at line 81 of file brite-topology-helper.cc.
References m_uv.
Referenced by BriteTopologyStructureTestCase::DoRun().
|
private |
Build the Edge Info list.
Definition at line 174 of file brite-topology-helper.cc.
References ns3::BriteTopologyHelper::BriteEdgeInfo::asFrom, ns3::BriteTopologyHelper::BriteEdgeInfo::asTo, ns3::BriteTopologyHelper::BriteEdgeInfo::bandwidth, ns3::BriteTopologyHelper::BriteEdgeInfo::delay, ns3::BriteTopologyHelper::BriteEdgeInfo::destId, ns3::BriteTopologyHelper::BriteEdgeInfo::edgeId, ns3::BriteTopologyHelper::BriteEdgeInfo::length, m_briteEdgeInfoList, m_topology, NS_FATAL_ERROR, NS_LOG_FUNCTION, ns3::BriteTopologyHelper::BriteEdgeInfo::srcId, and ns3::BriteTopologyHelper::BriteEdgeInfo::type.
Referenced by GenerateBriteTopology().
|
private |
Build the Node Info list.
Definition at line 87 of file brite-topology-helper.cc.
References ns3::BriteTopologyHelper::BriteNodeInfo::asId, ns3::BriteTopologyHelper::BriteNodeInfo::inDegree, m_briteNodeInfoList, m_numAs, m_topology, ns3::BriteTopologyHelper::BriteNodeInfo::nodeId, NS_FATAL_ERROR, NS_LOG_FUNCTION, ns3::BriteTopologyHelper::BriteNodeInfo::outDegree, ns3::BriteTopologyHelper::BriteNodeInfo::type, ns3::BriteTopologyHelper::BriteNodeInfo::xCoordinate, and ns3::BriteTopologyHelper::BriteNodeInfo::yCoordinate.
Referenced by GenerateBriteTopology().
void ns3::BriteTopologyHelper::BuildBriteTopology | ( | InternetStackHelper & | stack | ) |
Create NS3 topology using information generated from BRITE.
stack | Internet stack to assign to nodes in topology |
Definition at line 368 of file brite-topology-helper.cc.
References ConstructTopology(), ns3::NodeContainer::Create(), GenerateBriteTopology(), m_briteNodeInfoList, m_nodes, m_numAs, m_numNodes, m_systemForAs, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by BriteTopologyStructureTestCase::DoRun().
void ns3::BriteTopologyHelper::BuildBriteTopology | ( | InternetStackHelper & | stack, |
const uint32_t | systemCount ) |
Create NS3 topology using information generated from BRITE and configure topology for MPI use.
stack | Internet stack to assign to nodes in topology. |
systemCount | The number of MPI instances to be used in the simulation. |
Definition at line 393 of file brite-topology-helper.cc.
References ns3::NodeContainer::Add(), ConstructTopology(), ns3::CreateObject(), GenerateBriteTopology(), GetSystemNumberForAs(), m_briteNodeInfoList, m_nodes, m_numAs, m_numNodes, m_systemForAs, NS_LOG_FUNCTION, NS_LOG_INFO, and NS_LOG_LOGIC.
|
private |
Construct the topology.
Definition at line 447 of file brite-topology-helper.cc.
References ns3::NodeContainer::Get(), ns3::PointToPointHelper::Install(), m_asLeafNodes, m_briteEdgeInfoList, m_briteNodeInfoList, m_britePointToPointHelper, m_netDevices, m_nodes, m_nodesByAs, m_numAs, m_numEdges, mbpsToBps, NS_LOG_FUNCTION, NS_LOG_INFO, ns3::Seconds(), ns3::PointToPointHelper::SetChannelAttribute(), and ns3::PointToPointHelper::SetDeviceAttribute().
Referenced by BuildBriteTopology(), and BuildBriteTopology().
|
private |
Generate the BRITE topology.
Definition at line 314 of file brite-topology-helper.cc.
References BuildBriteEdgeInfoList(), BuildBriteNodeInfoList(), m_confFile, m_newSeedFile, m_seedFile, m_topology, m_uv, NS_ASSERT, NS_ASSERT_MSG, and NS_LOG_LOGIC.
Referenced by BuildBriteTopology(), and BuildBriteTopology().
Returns a given router leaf node from a given AS.
asNum | the AS number |
leafNum | the leaf number |
Definition at line 266 of file brite-topology-helper.cc.
References m_asLeafNodes.
uint32_t ns3::BriteTopologyHelper::GetNAs | ( | ) | const |
Returns the number of AS created in the topology.
Definition at line 302 of file brite-topology-helper.cc.
References m_numAs.
Referenced by BriteTopologyStructureTestCase::DoRun().
uint32_t ns3::BriteTopologyHelper::GetNEdgesTopology | ( | ) | const |
Returns the number of edges created within the topology.
Definition at line 296 of file brite-topology-helper.cc.
References m_numEdges.
Referenced by BriteTopologyStructureTestCase::DoRun().
Returns the number of router leaf nodes for a given AS.
asNum | the AS number |
Definition at line 284 of file brite-topology-helper.cc.
References m_asLeafNodes.
Referenced by BriteTopologyStructureTestCase::DoRun().
Returns the total number of nodes for a given AS.
asNum | the AS number |
Definition at line 278 of file brite-topology-helper.cc.
References m_nodesByAs.
uint32_t ns3::BriteTopologyHelper::GetNNodesTopology | ( | ) | const |
Returns the number of nodes created within the topology.
Definition at line 290 of file brite-topology-helper.cc.
References m_numNodes.
Referenced by BriteTopologyStructureTestCase::DoRun().
Returns a given router node for a given AS.
asNum | the AS number |
nodeNum | the Node number |
Definition at line 272 of file brite-topology-helper.cc.
References m_nodesByAs.
Returns the system number for the MPI instance that this AS is assigned to.
Will always return 0 if MPI not used
asNum | The AS Number |
Definition at line 308 of file brite-topology-helper.cc.
References m_systemForAs.
Referenced by BuildBriteTopology().
|
private |
stores the leaf router nodes for each AS
Definition at line 262 of file brite-topology-helper.h.
Referenced by ~BriteTopologyHelper(), ConstructTopology(), GetLeafNodeForAs(), and GetNLeafNodesForAs().
|
private |
The BRITE code generates multiple nodes and edges.
Each node and edge is stored in a BriteNodeInfo or BriteEdgeInfo struct, and each instance is stored in a vector.
Definition at line 289 of file brite-topology-helper.h.
Referenced by BuildBriteEdgeInfoList(), and ConstructTopology().
|
private |
The BRITE code generates multiple nodes and edges.
Each node and edge is stored in a BriteNodeInfo or BriteEdgeInfo struct, and each instance is stored in a vector.
Definition at line 288 of file brite-topology-helper.h.
Referenced by BuildBriteNodeInfoList(), BuildBriteTopology(), BuildBriteTopology(), and ConstructTopology().
|
private |
used to create the links within the topology
Definition at line 293 of file brite-topology-helper.h.
Referenced by ConstructTopology().
|
private |
brite configuration file to use
Definition at line 247 of file brite-topology-helper.h.
Referenced by GenerateBriteTopology().
|
private |
stores the netdevices created for each AS
Definition at line 259 of file brite-topology-helper.h.
Referenced by ~BriteTopologyHelper(), AssignIpv4Addresses(), AssignIpv6Addresses(), and ConstructTopology().
|
private |
brite seed file to generate for next run
Definition at line 253 of file brite-topology-helper.h.
Referenced by GenerateBriteTopology().
|
private |
stores all of the nodes used in the BRITE generated topology
Definition at line 235 of file brite-topology-helper.h.
Referenced by BuildBriteTopology(), BuildBriteTopology(), and ConstructTopology().
|
private |
stores all of the nodes in the brite topology by AS number
Definition at line 265 of file brite-topology-helper.h.
Referenced by ~BriteTopologyHelper(), ConstructTopology(), GetNNodesForAs(), and GetNodeForAs().
|
private |
stores the number of AS in the BRITE generated topology
Definition at line 256 of file brite-topology-helper.h.
Referenced by BuildBriteNodeInfoList(), BuildBriteTopology(), BuildBriteTopology(), ConstructTopology(), and GetNAs().
|
private |
stores the number of edges created in the BRITE topology
Definition at line 277 of file brite-topology-helper.h.
Referenced by ConstructTopology(), and GetNEdgesTopology().
|
private |
stores the number of nodes created in the BRITE topology
Definition at line 274 of file brite-topology-helper.h.
Referenced by BuildBriteTopology(), BuildBriteTopology(), and GetNNodesTopology().
|
private |
brite seed file to use
Definition at line 250 of file brite-topology-helper.h.
Referenced by GenerateBriteTopology().
|
private |
stores the MPI system number each AS assigned to. All assigned to 0 if MPI not used.
Definition at line 268 of file brite-topology-helper.h.
Referenced by BuildBriteTopology(), BuildBriteTopology(), and GetSystemNumberForAs().
|
private |
the Brite topology
Definition at line 271 of file brite-topology-helper.h.
Referenced by ~BriteTopologyHelper(), BuildBriteEdgeInfoList(), BuildBriteNodeInfoList(), and GenerateBriteTopology().
|
private |
random variable stream for brite seed file
Definition at line 296 of file brite-topology-helper.h.
Referenced by BriteTopologyHelper(), BriteTopologyHelper(), AssignStreams(), and GenerateBriteTopology().
|
staticprivate |
brite values are unitless however all examples provided use mbps to specify rate this constant value is used to convert the mbps provided by brite to bps.
Definition at line 194 of file brite-topology-helper.h.
Referenced by ConstructTopology().