Class BriteNetworkTopology
java.lang.Object
org.cloudbus.cloudsim.network.topologies.BriteNetworkTopology
- All Implemented Interfaces:
NetworkTopology
public final class BriteNetworkTopology extends Object implements NetworkTopology
Implements a network layer by reading the topology from a file in the
BRITE
format, the Boston university
Representative Internet Topology gEnerator
(http://www.cs.bu.edu/brite/),
and generates a topological network
from it. Information of this network is used to simulate latency in network
traffic of CloudSim.
The topology file may contain more nodes than the number of entities in the simulation. It allows users to increase the scale of the simulation without changing the topology file. Nevertheless, each CloudSim entity must be mapped to one (and only one) BRITE node to allow proper work of the network simulation. Each BRITE node can be mapped to only one entity at a time.
- Since:
- CloudSim Toolkit 1.0
- Author:
- Rodrigo N. Calheiros, Anton Beloglazov
- See Also:
getInstance(String)
-
Field Summary
Fields inherited from interface org.cloudbus.cloudsim.network.topologies.NetworkTopology
NULL
-
Constructor Summary
Constructors Constructor Description BriteNetworkTopology()
Instantiates a Network Topology.BriteNetworkTopology(String filePath)
Instantiates a Network Topology if a given file exists and can be successfully parsed. -
Method Summary
Modifier and Type Method Description void
addLink(SimEntity src, SimEntity dest, double bandwidth, double latency)
Adds a new link in the network topology.double[][]
getBwMatrix()
Gets acopy of the matrix containing the bandwidth between every pair of nodes in the network.double
getDelay(SimEntity src, SimEntity dest)
Calculates the delay between two nodes.static BriteNetworkTopology
getInstance(String fileName)
Instantiates a Network Topology from a file inside the application's resource directory.TopologicalGraph
getTopologicalGraph()
Gets the Topological Graph of the network.boolean
isNetworkEnabled()
Checks if the network simulation is working.void
mapNode(SimEntity entity, int briteID)
Maps a CloudSim entity to a BRITE node in the network topology.void
removeLink(SimEntity src, SimEntity dest)
void
unmapNode(SimEntity entity)
Un-maps a previously mapped CloudSim entity to a BRITE node in the network topology.
-
Constructor Details
-
BriteNetworkTopology
public BriteNetworkTopology()Instantiates a Network Topology.- See Also:
BriteNetworkTopology(String)
,BriteNetworkTopology(InputStreamReader)
,getInstance(String)
-
BriteNetworkTopology
Instantiates a Network Topology if a given file exists and can be successfully parsed. File is written in the BRITE format and contains topological information on simulation entities.- Parameters:
filePath
- the path of the BRITE file- See Also:
BriteNetworkTopology()
,BriteNetworkTopology(InputStreamReader)
,getInstance(String)
-
-
Method Details
-
getInstance
Instantiates a Network Topology from a file inside the application's resource directory.- Parameters:
fileName
- the relative name of the BRITE file- Returns:
- the BriteNetworkTopology instance.
-
addLink
Description copied from interface:NetworkTopology
Adds a new link in the network topology. The CloudSim entities that represent the source and destination of the link will be mapped to BRITE entities.- Specified by:
addLink
in interfaceNetworkTopology
- Parameters:
src
- CloudSim entity that represents the link's source nodedest
- CloudSim entity that represents the link's destination nodebandwidth
- Link's bandwidthlatency
- link's latency
-
removeLink
- Specified by:
removeLink
in interfaceNetworkTopology
-
mapNode
Maps a CloudSim entity to a BRITE node in the network topology.- Parameters:
entity
- CloudSim entity being mappedbriteID
- ID of the BRITE node that corresponds to the CloudSim
-
unmapNode
Un-maps a previously mapped CloudSim entity to a BRITE node in the network topology.- Parameters:
entity
- CloudSim entity being unmapped
-
getDelay
Description copied from interface:NetworkTopology
Calculates the delay between two nodes.- Specified by:
getDelay
in interfaceNetworkTopology
- Parameters:
src
- CloudSim entity that represents the link's source nodedest
- CloudSim entity that represents the link's destination node- Returns:
- communication delay between the two nodes
-
isNetworkEnabled
public boolean isNetworkEnabled()Checks if the network simulation is working. If there were some problem during creation of network (e.g., during parsing of BRITE file) that does not allow a proper simulation of the network, this method returns false.- Returns:
- $true if network simulation is working, $false otherwise
-
getTopologicalGraph
Gets the Topological Graph of the network.- Returns:
-
getBwMatrix
public double[][] getBwMatrix()Gets acopy of the matrix containing the bandwidth between every pair of nodes in the network.
-