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, 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:
  • Constructor Details

    • BriteNetworkTopology

      public BriteNetworkTopology()
      Instantiates an empty Network Topology.
      See Also:
    • BriteNetworkTopology

      public BriteNetworkTopology(String filePath)
      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:
  • Method Details

    • getInstance

      public static BriteNetworkTopology getInstance(String fileName)
      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

      public void addLink(SimEntity src, SimEntity dest, double bandwidth, double latency)
      Description copied from interface: NetworkTopology
      Adds a new link in the network topology. The SimEntitys that represent the source and destination of the link will be mapped to BRITE entities.
      Specified by:
      addLink in interface NetworkTopology
      Parameters:
      src - SimEntity that represents the link's source node
      dest - SimEntity that represents the link's destination node
      bandwidth - link's bandwidth (in Megabits/s)
      latency - link's latency (in seconds)
    • removeLink

      public void removeLink(SimEntity src, SimEntity dest)
      Specified by:
      removeLink in interface NetworkTopology
    • mapNode

      public void mapNode(SimEntity entity, int briteID)
      Maps a SimEntity to a BRITE node in the network topology.
      Parameters:
      entity - SimEntity being mapped
      briteID - ID of the BRITE node that corresponds to the CloudSim
    • unmapNode

      public void unmapNode(SimEntity entity)
      Un-maps a previously mapped SimEntity to a BRITE node in the network topology.
      Parameters:
      entity - SimEntity being unmapped
    • getDelay

      public double getDelay(SimEntity src, SimEntity dest)
      Description copied from interface: NetworkTopology
      Calculates the delay (in seconds) between two nodes.
      Specified by:
      getDelay in interface NetworkTopology
      Parameters:
      src - SimEntity that represents the link's source node
      dest - 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

      public TopologicalGraph 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 of SimEntitys in the network.