User Manual for the Simulator Introduction The Simple Simulator may be used to simulate and analyze traffic engineering approaches with MPLS. It simulates the placement of TE-LSPs, defined in a traffic matrix, on a given topology according to different algorithms. The simulator takes the following as input: The network topology1 The IGP metrics2 associated with the topology The traffic matrix (the set of LSP requests 3 that are to be placed) A reference for the algorithm to be used for the placement It provides the following as output: The paths computed for the input traffic for a given scale factor 4 The maximum scale factor5 The forte of the simulator is its generic design. This design facilitates the addition of new algorithms in the simulator without any changes in the simulator. A new algorithm can reuse already implemented algorithms. Hence, a new algorithm can be implemented with very little code and without recompiling the original simulator. The simulator provides a Router Class which can be extended to provide any other routing functionality without recompiling the simulator. The simulator can be configured to use a particular router and algorithm at run time using a configuration file. Currently, the simulator does not have a GUI but the event based design (Observer Pattern) would be used to develop a GUI in a subsequent iteration of the simulator with minimal changes in the simulator code. The simulator does not simulate the advertisement of link state information. It assumes that such information is available globally (Singleton Pattern) to each node. It is the province of an algorithm to see to it that what sub-set of that information may actually be accessible to a node according to its assumptions. 1 The network topology comprises of the nodes and links. 2 The IGP metrics are the link metrics that are propagated using an IGP routing protocol. An LSP request is a request to set up a label switched path with a certain bandwidth requirement between two nodes. 3 The scale factor is a positive number by which the demand of each LSP request in the Traffic matrix is multiplied. 4 The maximum scale factor is the highest scale factor for which the algorithm successfully places all the LSP requests. 5 Just like algorithms and routing functionality are generic, new fields specific to an algorithm may be added to the input topology and traffic matrix files without affecting the algorithms that are not using those fields. Hence the network topology and the traffic matrix are flexible enough to support any new algorithm. How to add your own algorithm, topologies and routers to the simulator One may specify following information in the configuration file. Information about the algorithm to use as primary/active placement algorithm. Information about which router class to use. If the event that no information is provided, the simulator default router is used. Information about the algorithm to use for backup path computation. If no backup algorithm is specified the simulator does not compute any backups. Names of the network topology and traffic matrix files. Information about the initial value for scaling. Sample configuration file: #The comments start with a number sign (#) #Specifying a Primary LSP CSPF algorithm is required. The ‘algorithm_class’ variable needs to # be set for this purpose. # Specifying a Backup LSP CSPF algorithm is optional. If ‘optional_node_backup_algorithm’ # variable is not specified then the simulator will only perform the primary LSP placement. # ‘optional_router_extention’ variable may be set to specify the extension of the Router Class. # Only one of the following algorithms must be un-commented before running the simulation. # New algorithms may be added using the same format. #----------------- Simple OSPF ---------------------------------------#algorithm_class=model.OSPFAlgorithm #------------------ CSPF Algorithm -----------------------------------#algorithm_class=model.CSPFAlgorithm #-------------------JPAlgorithm for Node Protection ------------------#algorithm_class=model.JP.PoolBasedPrimaryCSPFAlgo #optional_router_extention=model.JP.JPRouter #optional_node_backup_algorithm=model.JP.CSPFFacilityNodeBKAlgo #--------------------No Sharing Algo for Active and Backup------------algorithm_class=model.CSPFAlgorithm optional_node_backup_algorithm=model.noSharing.CSPFNoSharingBkUpAlgo #-------------------JPAlgorithm with MaxBW Algo as Backup ------------------#algorithm_class=model.MaxBW.MaxBWAlgorithm #optional_router_extention=model.MaxBW.MaxBWRouter #optional_node_backup_algorithm=model.JP.CSPFFacilityNodeBKAlgo #-------------------JPAlgorithm for Node Protection WITH IMPROVEMENT------------------#algorithm_class=model.CSPFAlgorithm #optional_router_extention=model.JP.JPRouter #optional_node_backup_algorithm=model.JP.improve.NoPoolCSPFFacilityNodeBkAlgo #-------------------------------------------------------------------------------------#use ‘topology_file’ variable to specify the topology file. The syntax of the topology is explained #in sample topology file. This is a required variable. topology_file=./simpletopology.txt #use ‘traffic_list_file’ variable to specify the input traffic demand file. This variable must be set. traffic_list_file=./lsps.txt #Use the ‘scale_factor_limit’ variable to specify the resolution of the scale factor. # A Smaller value will give more accurate result but the simulation will take longer. scale_factor_limit=0.01 #If ‘do_scale’ variable is set to "on" then the simulator will find a scale factor automatically . #Otherwise if it is equal to “of”. it will perform a test on ‘scale_initialize_POS’ value and #will not scale further automatically do_scale=on # ‘scale_initialize_POS’ variable should set greater then or equal to 1. # This variable defines the initial value of the scale factor. scale_initialize_POS=1 # ‘scale_initialize_POF’ variable is a rough estimate of the scale factor at which the input traffic # matrix cannot be placed.. It should be set to –1 if one does not know this point a priori. # Specifying this variable can reduce the simulation time. scale_initialize_POF=-1 #l ‘log_path’ variable specifys the directory where the various log files related to the # simulation will be placed. The simulator creates the directory if it does not exist. log_path=log\ #************************************************************** # The following variables are used by specific algorithms only. #************************************************************** # ‘backup_pool’ variable defined the percentage bandwidth of each link that is to be used for # placing backup paths. This vairable is ignored if the variable ‘auto_generate_backup_pool’ is # set to ‘on’. backup_pool=-1 #if the variable ‘auto_generate_backup_pool’ is set to on the simulator finds an optimal backup pool between the limits defined by ‘backup_pool_start’ and ‘backup_pool_end’ variables. auto_generate_backup_pool=on # ‘backup_pool_start’ variable value should not be smaller then one backup_pool_start=1 # ‘backup_pool_end’ variable value should not be greater then one hundred backup_pool_end=100 Sample Topology File: # The comments start with number sign (#) #The first four fields are required and represent source node id, destination node id, IGP metric and # bandwidth of the link between source and destination nodes. # A source and destination nodes should be immediate neighbors. # A Row defines a uni-directional link. # A link can have any algorithm specific additional attributes which can be added after the four # required fields. Algorithms that are not using those additional attributes will ignore them. #actives 1, 2, 1, 200 2, 3, 1, 200 3, 4, 1, 300 4, 5, 1, 100 3, 8, 1, 99 8, 5, 1, 100 1, 6, 1, 100 6, 3, 1, 100 2, 7, 1, 100 7, 4, 1, 100 3, 10, 1, 100 10, 5, 1, 100 Below is the pictorial representation of above topology file. 8 6 100 100 200 1 200 2 100 99 300 3 100 4 5 100 100 7 100 10 100 Sample Traffic Matrix File: # The comments start with number sign (#) # The first three fields are required and a traffic demand can have any number of additional algorithm # specific fields. # The first three required fields are the ingress node, egress node and bandwidth demand. 1, 5, 7 3, 5, 7 Class Diagram: The object oriented design of simulator contains many packages and classes. Given below are the major classes that form the simulator. Class diagram for classes in Model package and its sub packages: Class diagram for class in event package: Observer Design Pattern: java.util.Observable These classes are in the event package. These events are fired by the simulator and any view programmer can select to listen/observe some of these events and ignore others. This make the simulator code independent from any View implementation. EventBase GeneralErrorEvent LSPPlacementEvent LSPErrorLiveEvent ScalingEvent StatisticsEvent Class diagram for classes in exception package: DebugLogLiveEvent java.lang.Exception These classes are placed under 'exception' package. These custom exceptions are thrown by different backend classes. InsufficientAttributesException DestinationUnreachableException FlowSyntexException InvalidTopologyException Algorithm Interface: Some algorithms have been implemented in the simulator. An algorithm must implement the interface named “SPAlgorithm” or can extend any other algorithm which is already implementing “SPAlgorithm”. package model; import java.util.*; import exception.*; /** * <p>Title: </p> * <br>Description: All Algorithm (primary as well as back up) should implement this Interface * <p>Copyright: Copyright (c) 2003</P> * <p>Company: </p> * @author Faisal Aslam * @version 2.0 */ public interface SPAlgorithm { /** * * @param thisRouter * The Router object which is the ingress. * @param destinationIP * The IP of the destination. * @param demand * The demand BW in MBs * @param attributes * Any other attributes in the order of they appearance in the topology file * @return * ERO - A path with least cost. If more then one path exists then it selects one of them. * @throws InsufficientAttributesException * @throws DestinationUnreachableException */ public ERO getShortestPath(Router thisRouter, int destinationIP, double demand, Vector attributes) throws InsufficientAttributesException, DestinationUnreachableException; /** * This method is called from getShortestPaths and getShortestPath methods. * So if the meaning of cost change from one algorithm to another then only * overriding this method will be sufficent to implement a new algorithm * Example:- return 1/link.residualBW; * @param link * @return * */ public double getLinkCost(Link link); /** * This method is called from Router class when it traverses the shortest * path (primary or backup). For example: implement this method for changing * link bandwidth (residual) etc. * @param ero * @param link * @param flow */ public void changeInLinkWhenTrafficFlow(ERO ero, Link link, TrafficFlow flow); /** * One can prune link (not to be consider in shortest path) by overriding this method. * <br> For Example:- if (aLink.residualBW < 10) return true; * <br>In the above example we do not consider a link part of the shortest path if its residual BW * <br>is less then 10. * @param aLink * @param demand * @param attributes * @return */ public boolean pruneLink(Link aLink, double demand, Vector attributes); /** * * @param router * @param attributes * @return */ public boolean pruneRouter(Router router, Vector attributes); /** * * @param eroEnh */ public void computePathConstrain(EROEnhanced eroEnh); /** * * @param eroEnh * @return */ public boolean prunePathBasedPathConstrain(EROEnhanced eroEnh); /** * * @param router * @param primaryERO * @param flow * @return */ public boolean shouldComputeNodeBackupAtThisNode(Router router, ERO primaryERO, TrafficFlow flow); } Router’s Interface: package model; import java.util.Vector; import exception.DestinationUnreachableException; import exception.InsufficientAttributesException; import exception.InvalidTopologyException; /** * <p>Title: </p> * <p>Description: Every new customized routering class should extends from simulator's</p> * <br> "Router Class". The "Router Class" implements this interface. * <p>Copyright: Copyright (c) 2003</p> * <p>Company: </p> * @author Faisal Aslam * @version 2.0 */ public interface RouterInterface { /** * * @param linkId - every link has a unique id. This id is generated by the simulator. * @return - a link of a router. */ public Link getLink (int linkId); /** * * @return - all the links of the router. */ public Vector getAllLinks (); /** * * @param link - a link object to be added in the Router class. * @throws InvalidTopologyException */ public void addLink (Link link) throws InvalidTopologyException; /** * * @return the ip of the router. Every router have unique ip. */ public int getRouterIP (); /** * * @param router * @return it tell if two router are same (based on their ip addresses) */ public boolean equals (Router router); /** * * @param routerIP is the ip address to be set */ public void setRouterIP (int routerIP); /** * This method calls the algorithm. It have no knowledge that what algorithm * <BR>is used for primary or backup so it only work using an SPAlgorithm interface. * <BR>After getting the ERO from the algorithm it then change states of the links in the * <BR>ERO depending on the algorithm. * @param ero - in start this is null. * @param flow - tell the ingress and egress routers, demand etc. * @param algorithm * - the class of primary algorithm that is implementing the SPAlgorithm Interface. * @param backupAlgor * - the class of backup algorithm that is implementing the SPAlgorithm Interface. * @throws DestinationUnreachableException * - this exception is thrown if path cannot be find. * @throws InsufficientAttributesException */ public void placeLSPUsingAnyAlgorithm (ERO ero, TrafficFlow flow, SPAlgorithm algorithm, SPAlgorithm backupAlgor) throws DestinationUnreachableException, InsufficientAttributesException; /** * This method select a Point of Local Repair (PLR), Merge Point (MP) and * <BR> attributes to send before calling the backupAlgorithm. This function is called * <BR> from placeLSPUsingAnyAlgorithm function. If placeLSPUsingAnyAlgorithm have null as * <BR> a backup algorithm then this function is not called. * @param ero * @param demand * @param backupAlgor * @return * @throws DestinationUnreachableException * @throws InsufficientAttributesException */ public ERO callBackupPathAlgorithm (ERO ero, double demand, SPAlgorithm backupAlgor) throws DestinationUnreachableException, InsufficientAttributesException; }