Class BriteNetworkTopology
java.lang.Object
org.cloudbus.cloudsim.network.topologies.BriteNetworkTopology
- All Implemented Interfaces:
NetworkTopology
Implements a network layer by reading the topology from a file in the
BRITE
format, the Boston university
Representative Internet Topology gEnerator,
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:
-
Field Summary
Fields inherited from interface org.cloudbus.cloudsim.network.topologies.NetworkTopology
NULL
-
Constructor Summary
ConstructorDescriptionInstantiates an empty Network Topology.BriteNetworkTopology
(String filePath) Instantiates a Network Topology if a given file exists and can be successfully parsed. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a new link in the network topology.double[][]
Gets a copy of the matrix containing the bandwidth (in Megabits/s) between every pair ofSimEntity
s in the network.double
Calculates the delay (in seconds) between two nodes.static BriteNetworkTopology
getInstance
(String fileName) Instantiates a Network Topology from a file inside the application's resource directory.Gets the Topological Graph of the network.boolean
Checks if the network simulation is working.void
Maps aSimEntity
to a BRITE node in the network topology.void
removeLink
(SimEntity src, SimEntity dest) void
Un-maps a previously mappedSimEntity
to a BRITE node in the network topology.
-
Constructor Details
-
BriteNetworkTopology
public BriteNetworkTopology()Instantiates an empty 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. TheSimEntity
s that represent the source and destination of the link will be mapped to BRITE entities.- Specified by:
addLink
in interfaceNetworkTopology
- Parameters:
src
-SimEntity
that represents the link's source nodedest
-SimEntity
that represents the link's destination nodebandwidth
- link's bandwidth (in Megabits/s)latency
- link's latency (in seconds)
-
removeLink
- Specified by:
removeLink
in interfaceNetworkTopology
-
mapNode
Maps aSimEntity
to a BRITE node in the network topology.- Parameters:
entity
-SimEntity
being mappedbriteID
- ID of the BRITE node that corresponds to the CloudSim
-
unmapNode
Un-maps a previously mappedSimEntity
to a BRITE node in the network topology.- Parameters:
entity
-SimEntity
being unmapped
-
getDelay
Description copied from interface:NetworkTopology
Calculates the delay (in seconds) between two nodes.- Specified by:
getDelay
in interfaceNetworkTopology
- Parameters:
src
-SimEntity
that represents the link's source nodedest
-SimEntity
that represents the link's destination node- Returns:
- communication delay (in seconds) 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 a copy of the matrix containing the bandwidth (in Megabits/s) between every pair ofSimEntity
s in the network.
-