public class IPUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
IP_WEIGHT_ATTRIBUTE_NAME
Link attribute name for IP weight setting.
|
Constructor and Description |
---|
IPUtils() |
Modifier and Type | Method and Description |
---|---|
static double |
calculateIGPCost(DoubleMatrix1D y_e,
DoubleMatrix1D 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.
|
static Quadruple<DoubleMatrix2D,DoubleMatrix2D,DoubleMatrix1D,DoubleMatrix1D> |
computeCarriedTrafficFromIGPWeights(NetPlan netPlan,
DoubleMatrix1D linkWeightVector,
NetworkLayer... optionalLayer)
Computes the resulting carried traffic according to a link weight setting
and OSPF/ECMP routing.
|
static Triple<List<Demand>,List<Link>,List<Double>> |
computeECMPForwardinRules(List<Node> nodes,
List<Link> links,
List<Demand> demands,
DoubleMatrix1D linkWeightVector)
Computes the forwarding rules according to an OSPF/ECMP scheme, for the given demands.
|
static DoubleMatrix2D |
computeECMPRoutingTableMatrix_fte(List<Node> nodes,
List<Link> links,
DoubleMatrix1D linkWeightVector)
Computes the routing table matrix according to an OSPF/ECMP scheme.
|
static double |
getLinkWeight(Link link)
Returns the weight associated to a given link.
|
static DoubleMatrix1D |
getLinkWeightVector(NetPlan netPlan,
NetworkLayer... optionalLayer)
Obtains the vector of ink weights from a given a network design.
|
static String |
routingTableMatrixToString(List<Node> nodes,
List<Link> links,
DoubleMatrix2D f_te)
Outputs a given set of routing tables to a
String . |
static void |
setECMPForwardingRulesFromLinkWeights(NetPlan netPlan,
DoubleMatrix1D linkWeightMap,
NetworkLayer... optionalLayer)
Sets the OSPF/ECMP forwarding rules in the given design, according to the
given IGP weight setting.
|
static void |
setLinkWeight(Link link,
double linkWeight)
Sets the weight associated to the link.
|
static void |
setLinkWeights(NetPlan netPlan,
DoubleMatrix1D linkWeightVector,
NetworkLayer... optionalLayer)
Sets the weight associated to each link.
|
static void |
setLinkWeights(NetPlan netPlan,
double linkWeight,
NetworkLayer... optionalLayer)
Sets the weight associated to every link.
|
public static final String IP_WEIGHT_ATTRIBUTE_NAME
public static double calculateIGPCost(DoubleMatrix1D y_e, DoubleMatrix1D 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.
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.
Reference: H. Ümit, "Techniques and Tools for Intra-domain Traffic Engineering," Ph.D. Thesis, Université Catholique de Louvain (Belgium), December 2009
y_e
- Carried traffic per linku_e
- Capacity per linkpublic static Quadruple<DoubleMatrix2D,DoubleMatrix2D,DoubleMatrix1D,DoubleMatrix1D> computeCarriedTrafficFromIGPWeights(NetPlan netPlan, DoubleMatrix1D linkWeightVector, NetworkLayer... optionalLayer)
netPlan
- Network designoptionalLayer
- Network layer (optional)linkWeightVector
- Cost per linkQuadruple
composed of f_de
(splitting rules), x_de
(carried traffic for demand 'd' through link 'e'), r_d
(end-to-end carried traffic for demand 'd'), and y_e
(carried traffic by link 'e')public static Triple<List<Demand>,List<Link>,List<Double>> computeECMPForwardinRules(List<Node> nodes, List<Link> links, List<Demand> demands, DoubleMatrix1D linkWeightVector)
nodes
- List of nodeslinks
- List of linksdemands
- Demands for which the ECMP forwarding rules will be computedlinkWeightVector
- Cost per link vector. Links with weight Double.MAX_VALUE are not consideredt
)public static DoubleMatrix2D computeECMPRoutingTableMatrix_fte(List<Node> nodes, List<Link> links, DoubleMatrix1D linkWeightVector)
f_te[t][e]
sets the 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. It must hold that for every
node n different of t, the sum of the fractions
fte along its outgoing links must be 1. For every
destination t, fte = 0 for all the links e
that are outgoing links of t.nodes
- List of nodeslinks
- List of linkslinkWeightVector
- Cost per link vectort
)public static double getLinkWeight(Link link)
link
- LinkDouble.MAX_VALUE
if link is down)public static DoubleMatrix1D getLinkWeightVector(NetPlan netPlan, NetworkLayer... optionalLayer)
netPlan
- Network designoptionalLayer
- Network layer (optional)public static String routingTableMatrixToString(List<Node> nodes, List<Link> links, DoubleMatrix2D f_te)
String
. For debugging purposes.nodes
- List of nodeslinks
- List of linksf_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 setECMPForwardingRulesFromLinkWeights(NetPlan netPlan, DoubleMatrix1D linkWeightMap, NetworkLayer... optionalLayer)
computeECMPForwardingRules
and setForwardingRules
methods.netPlan
- Network designoptionalLayer
- Network layer (optional)linkWeightMap
- Cost per link vectorpublic static void setLinkWeight(Link link, double linkWeight)
link
- LinklinkWeight
- IGP weight associated to the link (must be greater or equal than one)public static void setLinkWeights(NetPlan netPlan, DoubleMatrix1D linkWeightVector, NetworkLayer... optionalLayer)
netPlan
- Network designoptionalLayer
- Network layer (optionallinkWeightVector
- IGP weight per link (must be greater or equal than one)public static void setLinkWeights(NetPlan netPlan, double linkWeight, NetworkLayer... optionalLayer)
netPlan
- Network designlinkWeight
- IGP weight associated to each link (must be greater or equal than one)optionalLayer
- Network layer (optional)Copyright © 2018. All rights reserved.