GridSim 5.0 beta

gridsim.util
Class NetworkReader

Object
  extended by NetworkReader

public class NetworkReader
extends Object

This is an utility class, which parses a file and constructs the network topology automatically.
The file that defines the network has the following form:

# specify the number of routers
number_of_routers

# specify the name of each router and (optional) logging facility
router_name1 [true/false]
router_name2 [true/false]
router_name3 [true/false]
... // other router names

# linking two routers. NOTE: the router name is case sensitive!
router_name1 router_name2 baud_rate(GB/s) prop_delay(ms) mtu(byte)
router_name1 router_name3 baud_rate(GB/s) prop_delay(ms) mtu(byte)
... // linking other routers

NOTE: [] means an optional parameter for logging activities inside a router. If it is not given, then by default the value is false.

Since:
GridSim Toolkit 4.0
Author:
Uros Cibej and Anthony Sulistio

Constructor Summary
NetworkReader()
           
 
Method Summary
static LinkedList createFIFO(String filename)
          Creates a network topology that uses a FIFO packet scheduler
static LinkedList createFlow(String filename)
          Creates a network topology that uses the flow network functionality.
static LinkedList createRate(String filename, double[] percentage)
          Creates a network topology that uses a Rate controlled packet scheduler
static LinkedList createSCFQ(String filename, double[] weight)
          Creates a network topology that uses a SCFQ packet scheduler
static Router getRouter(String name, LinkedList routerList)
          Gets a Router object from the list
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetworkReader

public NetworkReader()
Method Detail

createFIFO

public static LinkedList createFIFO(String filename)
Creates a network topology that uses a FIFO packet scheduler

Parameters:
filename - the name of the file containing the description of the network topology
Returns:
the list of Routers of the network or null if an error occurs
See Also:
FIFOScheduler

createSCFQ

public static LinkedList createSCFQ(String filename,
                                    double[] weight)
Creates a network topology that uses a SCFQ packet scheduler

Parameters:
filename - the name of the file containing the description of the network topology
weight - a linear array of the weights to be assigned to different classes of traffic.
Returns:
the list of Routers of the network or null if an error occurs
See Also:
SCFQScheduler

createRate

public static LinkedList createRate(String filename,
                                    double[] percentage)
Creates a network topology that uses a Rate controlled packet scheduler

Parameters:
filename - the name of the file containing the description of the network topology
percentage - a linear array of bandwidth percentage to be assigned to different classes of traffic.
Returns:
the list of Routers of the network or null if an error occurs
See Also:
RateControlledScheduler

getRouter

public static Router getRouter(String name,
                               LinkedList routerList)
Gets a Router object from the list

Parameters:
name - a router name
routerList - a list containing the Router objects
Returns:
a Router object or null if not found

createFlow

public static LinkedList createFlow(String filename)
Creates a network topology that uses the flow network functionality.

Parameters:
filename - the name of the file containing the description of the network topology
Returns:
the list of Routers of the network or null if an error occurs
See Also:
FlowRouter, FlowLink

GridSim 5.0 beta

The University of Melbourne, Australia, 2009