A Discrete-Event Network Simulator
API
ns3::BriteTopologyHelper Class Reference

Interface with BRITE, the Boston university Representative Internet Topology gEnerator. More...

#include "brite-topology-helper.h"

+ Collaboration diagram for ns3::BriteTopologyHelper:

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. More...
 
 BriteTopologyHelper (std::string confFile, std::string seedFile, std::string newseedFile)
 Construct a BriteTopologyHelper. More...
 
 ~BriteTopologyHelper ()
 
void AssignIpv4Addresses (Ipv4AddressHelper &address)
 
void AssignIpv6Addresses (Ipv6AddressHelper &address)
 
void AssignStreams (int64_t streamNumber)
 Assigns stream number to UniformRandomVariable used to generate brite seed file. More...
 
void BuildBriteTopology (InternetStackHelper &stack)
 Create NS3 topology using information generated from BRITE. More...
 
void BuildBriteTopology (InternetStackHelper &stack, const uint32_t systemCount)
 Create NS3 topology using information generated from BRITE and configure topology for MPI use. More...
 
Ptr< NodeGetLeafNodeForAs (uint32_t asNum, uint32_t leafNum)
 Returns a given router leaf node from a given AS. More...
 
uint32_t GetNAs (void) const
 Returns the number of AS created in the topology. More...
 
uint32_t GetNEdgesTopology () const
 Returns the number of edges created within the topology. More...
 
uint32_t GetNLeafNodesForAs (uint32_t asNum)
 Returns the number of router leaf nodes for a given AS. More...
 
uint32_t GetNNodesForAs (uint32_t asNum)
 Returns the total number of nodes for a given AS. More...
 
uint32_t GetNNodesTopology () const
 Returns the number of nodes created within the topology. More...
 
Ptr< NodeGetNodeForAs (uint32_t asNum, uint32_t nodeNum)
 Returns a given router node for a given AS. More...
 
uint32_t GetSystemNumberForAs (uint32_t asNum) const
 Returns the system number for the MPI instance that this AS is assigned to. More...
 

Private Member Functions

void BuildBriteEdgeInfoList (void)
 Build the Edge Info list. More...
 
void BuildBriteNodeInfoList (void)
 Build the Node Info list. More...
 
void ConstructTopology (void)
 Construct the topology. More...
 
void GenerateBriteTopology (void)
 Generate the BRITE topology. More...
 

Private Attributes

std::vector< NodeContainer * > m_asLeafNodes
 stores the leaf router nodes for each AS More...
 
PointToPointHelper m_britePointToPointHelper
 used to create the links within the topology More...
 
std::string m_confFile
 brite configuration file to use More...
 
std::vector< NetDeviceContainer * > m_netDevices
 stores the netdevices created for each AS More...
 
std::string m_newSeedFile
 brite seed file to generate for next run More...
 
NodeContainer m_nodes
 stores all of the nodes used in the BRITE generated topology More...
 
std::vector< NodeContainer * > m_nodesByAs
 stores all of the nodes in the brite topology by AS number More...
 
uint32_t m_numAs
 stores the number of AS in the BRITE generated topology More...
 
uint32_t m_numEdges
 stores the number of edges created in the BRITE topology More...
 
uint32_t m_numNodes
 stores the number of nodes created in the BRITE topology More...
 
std::string m_seedFile
 brite seed file to use More...
 
std::vector< int > m_systemForAs
 stores the MPI system number each AS assigned to. All assigned to 0 if MPI not used. More...
 
brite::Topology * m_topology
 the Brite topology More...
 
Ptr< UniformRandomVariablem_uv
 random variable stream for brite seed file More...
 

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. More...
 
typedef std::vector< BriteNodeInfoBriteNodeInfoList
 The BRITE code generates multiple nodes and edges. More...
 
typedef std::vector< BriteEdgeInfoBriteEdgeInfoList
 The BRITE code generates multiple nodes and edges. More...
 
BriteNodeInfoList m_briteNodeInfoList
 The BRITE code generates multiple nodes and edges. More...
 
BriteEdgeInfoList m_briteEdgeInfoList
 The BRITE code generates multiple nodes and edges. More...
 

Detailed Description

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 65 of file brite-topology-helper.h.

Member Typedef Documentation

◆ BriteEdgeInfoList

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 292 of file brite-topology-helper.h.

◆ BriteNodeInfoList

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 291 of file brite-topology-helper.h.

Constructor & Destructor Documentation

◆ BriteTopologyHelper() [1/2]

ns3::BriteTopologyHelper::BriteTopologyHelper ( std::string  confFile,
std::string  seedFile,
std::string  newseedFile 
)

Construct a BriteTopologyHelper.

Parameters
confFilea BRITE configuration file
seedFilea BRITE seed file
newseedFilea BRITE seed file with newly generated values

Definition at line 37 of file brite-topology-helper.cc.

References m_uv, and NS_LOG_FUNCTION.

◆ BriteTopologyHelper() [2/2]

ns3::BriteTopologyHelper::BriteTopologyHelper ( std::string  confFile)

Construct a BriteTopologyHelper using NS3 to generate seed values need by BRITE.

Parameters
confFilea BRITE configuration file

Definition at line 54 of file brite-topology-helper.cc.

References m_uv, and NS_LOG_FUNCTION.

◆ ~BriteTopologyHelper()

ns3::BriteTopologyHelper::~BriteTopologyHelper ( )

Member Function Documentation

◆ AssignIpv4Addresses()

void ns3::BriteTopologyHelper::AssignIpv4Addresses ( Ipv4AddressHelper address)
Parameters
addressan Ipv4AddressHelper which is used to install IPv4 addresses on all the node interfaces in the topology

Definition at line 421 of file brite-topology-helper.cc.

References first::address, m_netDevices, and NS_LOG_FUNCTION.

Referenced by BriteTopologyFunctionTestCase::DoRun().

+ Here is the caller graph for this function:

◆ AssignIpv6Addresses()

void ns3::BriteTopologyHelper::AssignIpv6Addresses ( Ipv6AddressHelper address)
Parameters
addressan Ipv6AddressHelper which is used to install IPv6 addresses on all the node interfaces in the topology

Definition at line 433 of file brite-topology-helper.cc.

References first::address, m_netDevices, and NS_LOG_FUNCTION.

◆ AssignStreams()

void ns3::BriteTopologyHelper::AssignStreams ( int64_t  streamNumber)

Assigns stream number to UniformRandomVariable used to generate brite seed file.

Parameters
streamNumberthe stream number to assign

Definition at line 92 of file brite-topology-helper.cc.

References m_uv, and ns3::RandomVariableStream::SetStream().

Referenced by BriteTopologyStructureTestCase::DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ BuildBriteEdgeInfoList()

◆ BuildBriteNodeInfoList()

◆ BuildBriteTopology() [1/2]

void ns3::BriteTopologyHelper::BuildBriteTopology ( InternetStackHelper stack)

Create NS3 topology using information generated from BRITE.

Parameters
stackInternet stack to assign to nodes in topology

Definition at line 366 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, NS_LOG_FUNCTION, and first::stack.

Referenced by BriteTopologyStructureTestCase::DoRun(), and BriteTopologyFunctionTestCase::DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ BuildBriteTopology() [2/2]

void ns3::BriteTopologyHelper::BuildBriteTopology ( InternetStackHelper stack,
const uint32_t  systemCount 
)

Create NS3 topology using information generated from BRITE and configure topology for MPI use.

Parameters
stackInternet stack to assign to nodes in topology.
systemCountThe number of MPI instances to be used in the simulation.

Definition at line 391 of file brite-topology-helper.cc.

References ns3::NodeContainer::Add(), ConstructTopology(), GenerateBriteTopology(), GetSystemNumberForAs(), m_briteNodeInfoList, m_nodes, m_numAs, m_numNodes, m_systemForAs, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, and first::stack.

+ Here is the call graph for this function:

◆ ConstructTopology()

void ns3::BriteTopologyHelper::ConstructTopology ( void  )
private

◆ GenerateBriteTopology()

void ns3::BriteTopologyHelper::GenerateBriteTopology ( void  )
private

Generate the BRITE topology.

Definition at line 318 of file brite-topology-helper.cc.

References BuildBriteEdgeInfoList(), BuildBriteNodeInfoList(), ns3::UniformRandomVariable::GetInteger(), m_confFile, m_newSeedFile, m_seedFile, m_topology, m_uv, NS_ASSERT, NS_ASSERT_MSG, and NS_LOG_LOGIC.

Referenced by BuildBriteTopology().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetLeafNodeForAs()

Ptr< Node > ns3::BriteTopologyHelper::GetLeafNodeForAs ( uint32_t  asNum,
uint32_t  leafNum 
)

Returns a given router leaf node from a given AS.

Parameters
asNumthe AS number
leafNumthe leaf number
Returns
the specified node

Definition at line 271 of file brite-topology-helper.cc.

References m_asLeafNodes.

◆ GetNAs()

uint32_t ns3::BriteTopologyHelper::GetNAs ( void  ) const

Returns the number of AS created in the topology.

Returns
the number of AS created in the topology

Definition at line 307 of file brite-topology-helper.cc.

References m_numAs.

Referenced by BriteTopologyStructureTestCase::DoRun().

+ Here is the caller graph for this function:

◆ GetNEdgesTopology()

uint32_t ns3::BriteTopologyHelper::GetNEdgesTopology ( ) const

Returns the number of edges created within the topology.

Returns
the total number of edges within the brite topology

Definition at line 301 of file brite-topology-helper.cc.

References m_numEdges.

Referenced by BriteTopologyStructureTestCase::DoRun().

+ Here is the caller graph for this function:

◆ GetNLeafNodesForAs()

uint32_t ns3::BriteTopologyHelper::GetNLeafNodesForAs ( uint32_t  asNum)

Returns the number of router leaf nodes for a given AS.

Parameters
asNumthe AS number
Returns
the number of leaf nodes in the specified AS

Definition at line 289 of file brite-topology-helper.cc.

References m_asLeafNodes.

Referenced by BriteTopologyStructureTestCase::DoRun().

+ Here is the caller graph for this function:

◆ GetNNodesForAs()

uint32_t ns3::BriteTopologyHelper::GetNNodesForAs ( uint32_t  asNum)

Returns the total number of nodes for a given AS.

Parameters
asNumthe AS number
Returns
the total number of nodes in the given AS

Definition at line 283 of file brite-topology-helper.cc.

References m_nodesByAs.

Referenced by BriteTopologyFunctionTestCase::DoRun().

+ Here is the caller graph for this function:

◆ GetNNodesTopology()

uint32_t ns3::BriteTopologyHelper::GetNNodesTopology ( ) const

Returns the number of nodes created within the topology.

Returns
the total number of nodes within the brite topology

Definition at line 295 of file brite-topology-helper.cc.

References m_numNodes.

Referenced by BriteTopologyStructureTestCase::DoRun().

+ Here is the caller graph for this function:

◆ GetNodeForAs()

Ptr< Node > ns3::BriteTopologyHelper::GetNodeForAs ( uint32_t  asNum,
uint32_t  nodeNum 
)

Returns a given router node for a given AS.

Parameters
asNumthe AS number
nodeNumthe Node number
Returns
the specified node

Definition at line 277 of file brite-topology-helper.cc.

References m_nodesByAs.

Referenced by BriteTopologyFunctionTestCase::DoRun().

+ Here is the caller graph for this function:

◆ GetSystemNumberForAs()

uint32_t ns3::BriteTopologyHelper::GetSystemNumberForAs ( uint32_t  asNum) const

Returns the system number for the MPI instance that this AS is assigned to.

Will always return 0 if MPI not used

Returns
The system number that the specified AS number belongs to
Parameters
asNumThe AS Number

Definition at line 313 of file brite-topology-helper.cc.

References m_systemForAs.

Referenced by BuildBriteTopology().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_asLeafNodes

std::vector<NodeContainer*> ns3::BriteTopologyHelper::m_asLeafNodes
private

stores the leaf router nodes for each AS

Definition at line 268 of file brite-topology-helper.h.

Referenced by ~BriteTopologyHelper(), ConstructTopology(), GetLeafNodeForAs(), and GetNLeafNodesForAs().

◆ m_briteEdgeInfoList

BriteEdgeInfoList ns3::BriteTopologyHelper::m_briteEdgeInfoList
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 295 of file brite-topology-helper.h.

Referenced by BuildBriteEdgeInfoList(), and ConstructTopology().

◆ m_briteNodeInfoList

BriteNodeInfoList ns3::BriteTopologyHelper::m_briteNodeInfoList
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 294 of file brite-topology-helper.h.

Referenced by BuildBriteNodeInfoList(), BuildBriteTopology(), and ConstructTopology().

◆ m_britePointToPointHelper

PointToPointHelper ns3::BriteTopologyHelper::m_britePointToPointHelper
private

used to create the links within the topology

Definition at line 299 of file brite-topology-helper.h.

Referenced by ConstructTopology().

◆ m_confFile

std::string ns3::BriteTopologyHelper::m_confFile
private

brite configuration file to use

Definition at line 253 of file brite-topology-helper.h.

Referenced by GenerateBriteTopology().

◆ m_netDevices

std::vector<NetDeviceContainer*> ns3::BriteTopologyHelper::m_netDevices
private

stores the netdevices created for each AS

Definition at line 265 of file brite-topology-helper.h.

Referenced by ~BriteTopologyHelper(), AssignIpv4Addresses(), AssignIpv6Addresses(), and ConstructTopology().

◆ m_newSeedFile

std::string ns3::BriteTopologyHelper::m_newSeedFile
private

brite seed file to generate for next run

Definition at line 259 of file brite-topology-helper.h.

Referenced by GenerateBriteTopology().

◆ m_nodes

NodeContainer ns3::BriteTopologyHelper::m_nodes
private

stores all of the nodes used in the BRITE generated topology

Definition at line 241 of file brite-topology-helper.h.

Referenced by BuildBriteTopology(), and ConstructTopology().

◆ m_nodesByAs

std::vector<NodeContainer*> ns3::BriteTopologyHelper::m_nodesByAs
private

stores all of the nodes in the brite topology by AS number

Definition at line 271 of file brite-topology-helper.h.

Referenced by ~BriteTopologyHelper(), ConstructTopology(), GetNNodesForAs(), and GetNodeForAs().

◆ m_numAs

uint32_t ns3::BriteTopologyHelper::m_numAs
private

stores the number of AS in the BRITE generated topology

Definition at line 262 of file brite-topology-helper.h.

Referenced by BuildBriteNodeInfoList(), BuildBriteTopology(), ConstructTopology(), and GetNAs().

◆ m_numEdges

uint32_t ns3::BriteTopologyHelper::m_numEdges
private

stores the number of edges created in the BRITE topology

Definition at line 283 of file brite-topology-helper.h.

Referenced by ConstructTopology(), and GetNEdgesTopology().

◆ m_numNodes

uint32_t ns3::BriteTopologyHelper::m_numNodes
private

stores the number of nodes created in the BRITE topology

Definition at line 280 of file brite-topology-helper.h.

Referenced by BuildBriteTopology(), and GetNNodesTopology().

◆ m_seedFile

std::string ns3::BriteTopologyHelper::m_seedFile
private

brite seed file to use

Definition at line 256 of file brite-topology-helper.h.

Referenced by GenerateBriteTopology().

◆ m_systemForAs

std::vector<int> ns3::BriteTopologyHelper::m_systemForAs
private

stores the MPI system number each AS assigned to. All assigned to 0 if MPI not used.

Definition at line 274 of file brite-topology-helper.h.

Referenced by BuildBriteTopology(), and GetSystemNumberForAs().

◆ m_topology

brite::Topology* ns3::BriteTopologyHelper::m_topology
private

◆ m_uv

Ptr<UniformRandomVariable> ns3::BriteTopologyHelper::m_uv
private

random variable stream for brite seed file

Definition at line 302 of file brite-topology-helper.h.

Referenced by BriteTopologyHelper(), AssignStreams(), and GenerateBriteTopology().

◆ mbpsToBps

const int ns3::BriteTopologyHelper::mbpsToBps = 1000000
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 200 of file brite-topology-helper.h.

Referenced by ConstructTopology().


The documentation for this class was generated from the following files: