public class TrafficMatrixGenerationModels
extends java.lang.Object
Set of methods implementing different traffic generation models based on traffic matrices. All of them are based on those detailed in [1].
Important: In Net2Plan
self-demands are not allowed, thus the diagonal of the traffic matrices must be always zero.
[1] R. S. Cahn, Wide area network design: concepts and tools for optimization, Morgan Kaufmann Publishers Inc., 1998
Constructor and Description |
---|
TrafficMatrixGenerationModels() |
Modifier and Type | Method and Description |
---|---|
static double |
activityFactor(double UTC,
int timezoneOffset,
double minValueFactor,
double maxValueFactor)
Returns the activity factor of a node, given the current UTC hour and its timezone (see [1]).
|
static double[][] |
bimodalUniformRandom(int N,
double percentageThreshold,
double minValueClass1,
double maxValueClass1,
double minValueClass2,
double maxValueClass2)
Generates a traffic matrix using a bimodal uniform random distribution, that is, a distribution in which a value is taken for a uniform random distribution with probability p, and from the other one with probability 1-p.
|
static java.util.List<double[][]> |
computeMatricesCAGR(double[][] trafficMatrix,
double cagr,
int numMatrices)
Computes a set of matrices from a seminal one, using a traffic forecast
based on the compound annual growth rate (CAGR) concept.
|
static java.util.List<double[][]> |
computeMatricesRandomGaussianVariation(double[][] trafficMatrix,
double cv,
double maxRelativeVariation,
int numMatrices)
Computes a set of matrices from a seminal one, using a random Gaussian distribution.
|
static java.util.List<double[][]> |
computeMatricesRandomUniformVariation(double[][] trafficMatrix,
double maxRelativeVariation,
int numMatrices)
Computes a set of matrices from a seminal one, using a random uniform distribution.
|
static double[][] |
constant(int N,
double value)
Generates a constant traffic matrix.
|
static double[][] |
gravityModel(double[] ingressTrafficPerNode,
double[] egressTrafficPerNode)
Generates a traffic matrix using a 'gravity model' (see [1]).
|
static double[][] |
normalizationPattern_incomingTraffic(double[][] trafficMatrix,
double[] incomingTraffic)
Normalizes the input traffic matrix with respect to a given incoming traffic vector.
|
static double[][] |
normalizationPattern_outgoingTraffic(double[][] trafficMatrix,
double[] outgoingTraffic)
Normalizes the input traffic matrix with respect to a given outgoing traffic vector.
|
static double[][] |
normalizationPattern_totalTraffic(double[][] trafficMatrix,
double totalTraffic)
Normalizes the input traffic matrix so that the sum of all entries is equal to a given value.
|
static double[][] |
normalizeToLinkLoad(double[][] trafficMatrix,
double linkCapacity,
double load)
Normalizes the load of a traffic matrix in an effort to assess the merits
of the algorithms for different traffic load conditions.
|
static double[] |
normalizeTraffic_linkCapacity_xde(NetPlan netPlan,
java.lang.String solverName,
java.lang.String solverLibraryName)
Returns the maximum scaled version of the offered traffic vector that
can be carried by the network, provided that no link is oversubscribed.
|
static double[] |
normalizeTraffic_networkCapacity(NetPlan netPlan,
Constants.ShortestPathType shortestPathType)
Returns the maximum scaled version of the offered traffic vector so
that the network capacity (summation of capacity of all links) is exhausted.
|
static double[][] |
populationDistanceModel(double[][] distanceMatrix,
int[] populationVector,
int[] levelVector,
double[][] levelMatrix,
double randomFactor,
double populationOffset,
double populationPower,
double distanceOffset,
double distancePower)
Generates a traffic matrix using the population-distance model detailed in [1].
|
static double[][] |
read2DMatrixFromFile(java.io.File f,
boolean checkSameColumns)
Reads a 2D matrix from a file.
|
static void |
symmetrizeTrafficMatrix(double[][] trafficMatrix)
Symmetrizes the input traffic matrix setting each node-pair traffic value
equal to the average between the traffic in both directions.
|
static double[][] |
uniformRandom(int N,
double minValue,
double maxValue)
Generates a traffic matrix using a uniform random distribution.
|
public static double activityFactor(double UTC, int timezoneOffset, double minValueFactor, double maxValueFactor)
UTC
- Universal Time Coordinated hour in decimal format (e.g. 10:30h is represented as 10.5)timezoneOffset
- Timezone offset from UTC in range [-12, 12]minValueFactor
- Minimum value at low-traffic hour in range [0,1] (in ref. [1] is equal to 0.1)maxValueFactor
- Maximum value at peak hour in range [0,1] (in ref. [1] is equal to 1)J. Milbrandt, M. Menth, S. Kopf, "Adaptive Bandwidth Allocation: Impact of Traffic Demand Models for Wide Area Networks," University of Würzburg, Germany, Report No. 363, June 2005
public static double[][] bimodalUniformRandom(int N, double percentageThreshold, double minValueClass1, double maxValueClass1, double minValueClass2, double maxValueClass2)
N
- Number of nodespercentageThreshold
- Mixture coefficientminValueClass1
- Minimum traffic value for class 1maxValueClass1
- Maximum traffic value for class 1minValueClass2
- Minimum traffic value for class 2maxValueClass2
- Maximum traffic value for class 2public static double[][] constant(int N, double value)
N
- Number of nodesvalue
- Traffic valuepublic static double[][] gravityModel(double[] ingressTrafficPerNode, double[] egressTrafficPerNode)
Generates a traffic matrix using a 'gravity model' (see [1]). This basic model predicts the demand between node i and j as:
sij=Cte(i)tx(j)
where C is a normalization constant that makes the sum of estimated demands equal to the total traffic entering/leaving the network.
ingressTrafficPerNode
- Ingress traffic per nodeegressTrafficPerNode
- Egress traffic per nodeAnders Gunnar, Mikael Johansson, Thomas Telkamp, "Traffic Matrix Estimation on a Large IP Backbone – A Comparison on Real Data," in Proc. of IMC'04, October 2004
public static double[][] uniformRandom(int N, double minValue, double maxValue)
N
- Number of nodesminValue
- Minimum traffic valuemaxValue
- Maximum traffic valuepublic static double[][] populationDistanceModel(double[][] distanceMatrix, int[] populationVector, int[] levelVector, double[][] levelMatrix, double randomFactor, double populationOffset, double populationPower, double distanceOffset, double distancePower)
distanceMatrix
- Distance matrix, where cell (i, j) represents the distance from node i to node jpopulationVector
- Vector with N elements in which each element is the population of the corresponding nodelevelVector
- Vector with N elements in which each element is the level (i.e. type) of the corresponding nodelevelMatrix
- Level matrixrandomFactor
- Random factorpopulationOffset
- Population offsetpopulationPower
- Population powerdistanceOffset
- Distance offsetdistancePower
- Distance powermore information, see [1]
public static double[][] normalizationPattern_outgoingTraffic(double[][] trafficMatrix, double[] outgoingTraffic)
trafficMatrix
- Input traffic matrixoutgoingTraffic
- Vector of outgoing traffic to each nodepublic static double[][] normalizationPattern_incomingTraffic(double[][] trafficMatrix, double[] incomingTraffic)
trafficMatrix
- Input traffic matrixincomingTraffic
- Vector of incoming traffic to each nodepublic static double[][] normalizationPattern_totalTraffic(double[][] trafficMatrix, double totalTraffic)
trafficMatrix
- Input traffic matrixtotalTraffic
- Total traffic expectedpublic static double[][] normalizeToLinkLoad(double[][] trafficMatrix, double linkCapacity, double load)
Normalizes the load of a traffic matrix in an effort to assess the merits
of the algorithms for different traffic load conditions. The value
load
represents the average amount of traffic between two nodes,
among all the entries, during the highest loaded time, measured in number of links.
Consequently, a value of load
=0.5 corresponds to the case
when the (maximum) average traffic between two nodes equals 50% of a single link capacity.
In constrast, a value of load
=10 captures cases in which the
(maximum) average traffic between two nodes fills on average 10 links.
trafficMatrix
- Input traffic matrixlinkCapacity
- Link capacity (in same units as trafficMatrix
)load
- Load factor (measured in number of links). The highest value of the resulting traffic matrix will be equal to load
*linkCapacity
public static double[][] read2DMatrixFromFile(java.io.File f, boolean checkSameColumns)
f
- Input filecheckSameColumns
- Checks whether the number of columns is the same for every rowpublic static void symmetrizeTrafficMatrix(double[][] trafficMatrix)
trafficMatrix
- Traffic matrixpublic static double[] normalizeTraffic_networkCapacity(NetPlan netPlan, Constants.ShortestPathType shortestPathType)
Returns the maximum scaled version of the offered traffic vector so that the network capacity (summation of capacity of all links) is exhausted.
netPlan
- Network design with physical topology (nodes and links) and a set of demandsshortestPathType
- Shortest path type (hops or km)public static double[] normalizeTraffic_linkCapacity_xde(NetPlan netPlan, java.lang.String solverName, java.lang.String solverLibraryName)
Returns the maximum scaled version of the offered traffic vector that can be carried by the network, provided that no link is oversubscribed. It is assumed no protection capacity is reserved.
Important: JOM
library is required here.
netPlan
- Network design with physical topology (nodes and links) and a set of demandssolverName
- The solver name to be used by JOMsolverLibraryName
- The solver library full or relative path, to be used by JOM. Leave blank to use JOM defaultpublic static java.util.List<double[][]> computeMatricesCAGR(double[][] trafficMatrix, double cagr, int numMatrices)
Computes a set of matrices from a seminal one, using a traffic forecast based on the compound annual growth rate (CAGR) concept.
Traffic forecast for node pair (i,j) on year k from the reference one is given by:
TM(i,j,k) = TM(i,j,0) * (1+CAGRk)
trafficMatrix
- Seminal traffic matrixcagr
- Compound Annual Growth Rate (0.2 means an increase of 20% with respect to the previous year)numMatrices
- Number of matrices to generatepublic static java.util.List<double[][]> computeMatricesRandomGaussianVariation(double[][] trafficMatrix, double cv, double maxRelativeVariation, int numMatrices)
trafficMatrix
- Seminal traffic matrixcv
- Coefficient of variationmaxRelativeVariation
- Maximum relative variation from the mean value (0.2 means a maximum variation of +-20%)numMatrices
- Number of matrices to generatepublic static java.util.List<double[][]> computeMatricesRandomUniformVariation(double[][] trafficMatrix, double maxRelativeVariation, int numMatrices)
trafficMatrix
- Seminal traffic matrixmaxRelativeVariation
- Maximum relative variation from the mean value (0.2 means a maximum variation of +-20%)numMatrices
- Number of matrices to generate