public class IPUtils
extends java.lang.Object
Constructor and Description |
---|
IPUtils() |
Modifier and Type | Method and Description |
---|---|
static double |
calculateIGPCost(double[] y_e,
double[] u_e)
Returns the cost of a routing scheme according to the carried traffic per
link and link capacities, assuming the IGP-WO cost model [1].
|
static double[][] |
computeECMPRoutingTableMatrix(int[][] linkTable,
double[] linkWeights,
int N)
Computes the routing tables for ECMP (Equal-Cost Multi-Path) using an OSPF-like (or IS-IS) mechanism, given a set of link weights (links with weight equal to
Double.MAX_VALUE are forbidden). |
static double[][] |
computeOMPRoutingTableMatrix(int[][] linkTable,
double[] linkWeights,
int N)
Computes the optimal routing tables using an OSPF-OMP-like mechanism, given a set of link weights.
|
static double[] |
getLinkWeightAttributes(NetPlan netPlan)
Obtains the set of link weights (link attribute 'linkWeight', default: 1) from a given a network design.
|
static double[][] |
getRoutingTableMatrix(NetPlan netPlan)
Obtains a destination-based routing from a given network design.
|
static void |
main(java.lang.String[] args)
Main method to test methods from this class.
|
static java.lang.String |
routingTableMatrixToString(int[][] linkTable,
double[][] f_te)
Outputs a given set of routing tables to a
String . |
static void |
setLinkWeightAttributes(NetPlan netPlan,
double linkWeight)
Adds a 'linkWeight' attribute to each link with an associated link weight.
|
static void |
setLinkWeightAttributes(NetPlan netPlan,
double[] linkWeights)
Adds a 'linkWeight' attribute to each link with an associated link weight.
|
static void |
setRoutesFromRoutingTableMatrix(NetPlan netPlan,
double[][] f_te)
Generates routes from the demand set of a given a network design using a given set of routing tables.
|
public static void main(java.lang.String[] args)
public static double[][] computeECMPRoutingTableMatrix(int[][] linkTable, double[] linkWeights, int N)
Computes the routing tables for ECMP (Equal-Cost Multi-Path) using an OSPF-like (or IS-IS) mechanism, given a set of link weights (links with weight equal to Double.MAX_VALUE
are forbidden).
The point with ECMP-based routing is that traffic is equally split among the candidate output links, not between paths. For example, if three shortest paths go from a node n to the egress node t, and there are only two candidate output links, each link will forward 50% of traffic to node t, instead of a 33.33%/66.66% ratio. To achieve a behavior like the latter, use the computeOMPRoutingTableMatrix()
method.
Important: Although non-integer values are allowed, usage of positive integer values is encouraged to follow the OSPF standard
linkTable
- Set of links defining a physical topologylinkWeights
- Set of link weights (must be greater or equal than one)N
- Number of nodes in the networkpublic static double[][] computeOMPRoutingTableMatrix(int[][] linkTable, double[] linkWeights, int N)
Computes the optimal routing tables using an OSPF-OMP-like mechanism, given a set of link weights.
Contrary to ECMP, this routing scheme equally splits traffic among multiple shortest paths. For example, if three shortest paths go from a node n to the egress node t, and there are only two candidate output links, traffic will be divided following a 33.33%/66.66% ratio.
linkTable
- Set of links defining a physical topologylinkWeights
- Set of link weights (must be greater or equal than one)N
- Number of nodes in the networkpublic static double[] getLinkWeightAttributes(NetPlan netPlan)
netPlan
- Network designpublic static double[][] getRoutingTableMatrix(NetPlan netPlan)
netPlan
- Network designpublic static java.lang.String routingTableMatrixToString(int[][] linkTable, double[][] f_te)
String
. For debugging purposes.linkTable
- Set of links defining a physical topologyf_te
- Destination-based routing in the form of fractions fte (fraction of the traffic targeted to node t that arrives (or is generated in) node a(e) (the initial node of link e), that is forwarded through link e)String
from the given routing tablespublic static void setLinkWeightAttributes(NetPlan netPlan, double linkWeight)
netPlan
- Network designlinkWeight
- Link weight value (same for every link)public static void setLinkWeightAttributes(NetPlan netPlan, double[] linkWeights)
netPlan
- Network designlinkWeights
- Set of link weights (must be greater than zero)public static void setRoutesFromRoutingTableMatrix(NetPlan netPlan, double[][] f_te)
netPlan
- Network designf_te
- Destination-based routing in the form of fractions fte (fraction of the traffic targeted to node t that arrives (or is generated in) node a(e) (the initial node of link e), that is forwarded through link e)public static double calculateIGPCost(double[] y_e, double[] u_e)
Returns the cost of a routing scheme according to the carried traffic per link and link capacities, assuming the IGP-WO cost model [1].
Let E be a set of links, where ue is the capacity for link e ∈ E, and ye is the carried traffic by link e ∈ E. Then, the total cost of the associated routing, denoted as C, is the sum for every link e ∈ E of its associated cost ce, which is computed as follows:
where ρe is the ratio ye / ue.
y_e
- Carried traffic per link vectoru_e
- Link capacity vectorH. Ümit, "Techniques and Tools for Intra-domain Traffic Engineering," Ph.D. Thesis, Université catholique de Louvain (Belgium), December 2009