public class WDMUtils extends Object
Optical networks have been established as the enabling technology for today’s highspeed communication networks. Wavelength Division Multiplexing (WDM) enables the efficient utilization of optical fibers by dividing its tremendous bandwidth into a set of disjoint channels.
The socalled wavelength grid determines the wavelengths or wavebands used by a channel:
Flexigrid networks where all the channels occupy exactly one frequency slot, and the width of the slot is e.g. 100 GHz, are equivalent to a fixedgrid network with a 100 GHz width. For this reason, after Net2Plan 0.4.1 we have put together inside WDMUtils the functionalities of both fixed and flexi grid WDM networks (formerly, flexigrid networks were dealt with in FlexiGridUtils library, now eliminated).
In wavelengthrouted WDM networks, alloptical channels traversing several fibers, called lightpaths, can be established between pairs of nodes. A lightpath occupies one channel (a wavelength in fixedgrid networks, and a set of frequency slots in flexigrid networks) in each traversed link, and two lightpaths routed over the same physical link cannot use the same frequency slot in that link. This is called the wavelength or frequency slot clash constraint. The Routing and Spectrum Assignment (RSA) problem and the Routing and Wavelength Assignment (RWA) problem in flexi and fixed grid WDM networks respectively are the ones deciding for each lightpath the route and frequency slots (wavelengths) to occupy in each traversed fiber. Typically, the wavelength/slots of a lightpath cannot change along the traversed fibers (since wavelength converters are not available). In this case we say that the problem has the wavelength continuity constraint.
Higher layers in the network see a lightpath as a pipe to transmit traffic, and they are not necessarily aware of the actual sequence of fiber links of the lightpath.
The line rate of the lightpath is its capacity e.g. in Gbps. Typical line rates are 10, 40 and 100 Gbps. In flexigrid networks, it is possible to have lightpaths of different line rates, that occupy the same number of frequency slots. This is because, the transponders (the ones transmitting and receiving the optical signals) can be based on different optical modulations with different spectral efficiencies. For instance, a transponder using BPSK modulation has a spectral efficiency of 1 bps/Hz, while a more sophisticated transponder using 16QAM has 4 bps/Hz.
Nodes in wavelengthrouted networks are called Optical Add/Drop Multiplexers (OADMs). They are able to add new lightpaths initiated in the node, drop lightpaths terminating in the node, and optically switch (bypass) lightpaths that traverse the node. Usually, a lightpath occupies the same wavelength in all the traversed links. This is called the wavelength continuity constraint. However, it is possible (so far only in fixedgrid networks) to allocate optical wavelength converters at intermediate nodes of the lightpath that are able to change its wavelength. Nowadays, wavelength converters are composed of an optoelectronic receiver attached to an electrooptic transmitter. Then, the optical signal is regenerated, while its wavelength can be modified. More often, optical regenerators are used not for changing the wavelength in an intermediate node of a lightpath, but to regenerate the optical signal recovering it from its normal degradation caused by channel noise and other impairments.
In Net2Plan, the WDMUtils library is provided to ease the handling of WDM networks. WDMUtils assumptions are:
Offline and online network design algorithms for fixed/flexi grid WDM networks, as well as reports for showing WDM physical layer and RSA allocation information, can be found in the Net2Plan code repository under keyword WDM.
Modifier and Type  Class and Description 

static class 
WDMUtils.LightpathAdd
This class represents the request to add a new lightpath.

static class 
WDMUtils.LightpathModify
This class represents the request to modify an existing lightpath.

static class 
WDMUtils.LightpathRemove
This class represents the request to remove an existing lightpath.

static class 
WDMUtils.ModulationFormat
Class to define typical modulation formats.

static class 
WDMUtils.RSA
This class represents a Routing and Spectrum Assignment, valid for a lightpath in both fixed and flexigrid WDM networks.

static class 
WDMUtils.TransponderTypesInfo
This class is devoted to give easy access to the transponders information provided by the user in the
typical userdefined parameters
transponderTypesInfo . 
Modifier and Type  Method and Description 

static Route 
addLightpath(Demand demand,
WDMUtils.RSA rsa,
double lineRateGbps)
Creates a new lightpath with the given RSA, as a
Route object. 
static void 
allocateResources(WDMUtils.RSA rsa,
DoubleMatrix2D frequencySlot2FiberOccupancy_se,
DoubleMatrix1D nodeRegeneratorOccupancy)
Updates
frequencySlot2FiberOccupancy_se and nodeRegeneratorOccupancy to consider that a new lightpath is occupying
the resources given by rsa . 
static void 
checkResourceAllocationClashing(NetPlan netPlan,
boolean countFailedLightpaths,
boolean checkRegeneratorsAsWavelengthConverters,
NetworkLayer... optionalLayerParameter)
Checks resource clashing: no frequency slot in the same fiber can be occupied by more than one lightpath, nor
any slot of an index higher than the fiber capacity can be occupied.

static List<Pair<Integer,Integer>> 
computeAvailableSpectrumVoids(TreeSet<Integer> slotOccupancy,
int totalAvailableSlotsPerFiber)
Computes the list of spectral voids (list of available contiguous slots)
from a slot availability vector (of a fiber or of a path).

static int 
computeMaximumRequests(List<Pair<Integer,Integer>> availableSpectrumVoids,
int numSlots)
Computes the maximum number of requests (each one of the same given number of frequency slots) which
can be simultaneously allocated in the given set of spectrum voids.

static WDMUtils.ModulationFormat 
computeModulationFormat(double pathLengthInKm,
Set<WDMUtils.ModulationFormat> availableModulationFormats)
Returns the modulation format among the ones given, (i) with the maximum spectral efficiency, (ii) but with enough optical reach for the given path length.

static WDMUtils.ModulationFormat 
computeModulationFormat(List<Link> seqFibers,
Set<WDMUtils.ModulationFormat> availableModulationFormats)
The same as
computeModulationFormat(lengthKm, availableModulationFormats) , where lengthKm is the length in km of the input path. 
static Map<List<Link>,WDMUtils.ModulationFormat> 
computeModulationFormatPerPath(Map<Pair<Node,Node>,List<List<Link>>> cpl,
Set<WDMUtils.ModulationFormat> availableModulationFormats)
Returns the modulation format with the maximum spectral efficiency, while
the optical reach constraint is fulfilled, for each path in the list of candidate paths (
cpl ) 
static int 
computeNumberOfSlots(double bandwidthInGbps,
double slotGranularityInGHz,
double guardBandInGHz,
WDMUtils.ModulationFormat modulationFormat)
Computes the number of frequency slots required for a lightpath that needs a given amount of Gbps, using a certain modulation (defining the Gbps/GHz spectral efficiency),
and that requires a given minimum guard band in GHz (this guard band is assumed to be the sum of the two guard bands at upper and lower side of the band)

static TreeSet<Integer> 
computePathSlotOccupancy(List<Link> seqFibers,
DoubleMatrix2D frequencySlot2FiberOccupancy_se)
Computes the slot availability vector of a path, represented by a sequence
of fibers, where each position indicates whether or not its corresponding
frequency slot is available along the path.

static int[] 
computeRegeneratorPositions(List<Link> seqFibers,
double maxRegeneratorDistanceInKm)
Returns the list of nodes within the lightpath route containing a regenerator,
only following a distance criterium, assuming no wavelength conversion is required.

static int[] 
computeRegeneratorPositions(List<Link> seqFibers,
DoubleMatrix2D seqFrequencySlots,
double maxRegeneratorDistanceInKm)
Returns the list of nodes within the lightpath route containing a regenerator,
only following a distance criterium.

static int 
getFiberNumFrequencySlots(Link fiber)
Returns the number of frequency slots for the given fiber.

static Pair<DoubleMatrix2D,DoubleMatrix1D> 
getNetworkSlotAndRegeneratorOcupancy(NetPlan netPlan,
boolean countFailedLightpaths,
NetworkLayer... optionalLayerParameter)
Returns the fiber occupied (columns) in each wavelength (rows), and an array with the number of occupied regenerators in each node.

static Pair<Map<Pair<Link,Integer>,List<Route>>,Map<Node,List<Route>>> 
getNetworkSlotOccupancyMap(NetPlan netPlan,
boolean countFailedLightpaths,
NetworkLayer... optionalLayerParameter)
Returns two maps, showing the frequency slots in the links and signal regenerator in the nodes occupancies.

static DoubleMatrix1D 
getVectorFiberNumFrequencySlots(NetPlan netPlan,
NetworkLayer... optionalLayerParameter)
Returns the total number of frequency slots in each fiber.

static boolean 
isAllocatableRSASet(DoubleMatrix2D frequencySlot2FiberOccupancy_se,
WDMUtils.RSA... rsas)
Returns
true if all the RSAs are allocatable (the needed frequency slots are free in the given sequence of links), false otherwise. 
static boolean 
isWDMFormatCorrect(Link fiber)
Returns true if the
Link object representing a fiber is well formed, according to the WDMUtils requirements. 
static boolean 
isWDMFormatCorrect(NetPlan netPlan,
NetworkLayer... optionalLayerParameter)
Performs some checks in a WDM network.

static boolean 
isWDMFormatCorrect(Route lp)
Returns true if the
Route object is a well formed lightpath, according to the WDMUtils requirements. 
static void 
releaseResources(WDMUtils.RSA rsa,
DoubleMatrix2D frequencySlot2FiberOccupancy_se,
DoubleMatrix1D nodeRegeneratorOccupancy)
Updates
frequencySlot2FiberOccupancy_se to consider that a lightpath is releasing
used frequency slots, and nodeRegeneratorOccupancy to consider that the lightpath releases the occupied regenerators 
static void 
revertToInitialRSA(Route r)
The full RSA of the lightpath (travsersed fibers, occupied slots and regenerators) is reverted to its primary path.

static void 
setFiberNumFrequencySlots(Link fiber,
int numFrequencySlots)
Sets the number of frequency slots available on the given fiber.

static void 
setFibersNumFrequencySlots(NetPlan netPlan,
int numFrequencySlots,
NetworkLayer... optionalLayerParameter)
Sets the number of frequency slots available in each fiber to the same value.

static void 
setLightpathRSAAttributes(Route lp,
WDMUtils.RSA rsa,
boolean initializeThePrimaryRoute)
Sets the attributes of the given
Route object to reflect the RSA occupation in current, primary or a backup path. 
static int 
spectrumAssignment_firstFit(List<Link> seqFibers,
DoubleMatrix2D frequencySlot2FiberOccupancy_se,
int numContiguousSlotsRequired)
Frequency slot assignment algorithm based on a firstfit fashion.

static Pair<Integer,Integer> 
spectrumAssignment_firstFitTwoRoutes(List<Link> seqFibers_1,
List<Link> seqFibers_2,
DoubleMatrix2D frequencySlot2FiberOccupancy_se,
int numContiguousSlotsRequired)
Frequency slot assignment algorithm based on a firstfit fashion for two different paths.

static Pair<int[],int[]> 
wavelengthAssignment_RPP_firstFit(List<Link> seqFibers,
DoubleMatrix2D frequencySlot2FiberOccupancy_se,
DoubleMatrix1D nodeRegeneratorOccupancy,
double maxRegeneratorDistanceInKm)
Wavelength assignment algorithm based on a firstfit fashion assuming
full wavelength conversion and regeneration capabilities.

public static Route addLightpath(Demand demand, WDMUtils.RSA rsa, double lineRateGbps)
Route
object. The attributes of the lightpath to store the WDM information are initialized appropriatelydemand
 The demand the lightpath belongs torsa
 the RSAlineRateGbps
 the line rate of the lightpath in Gbpspublic static void allocateResources(WDMUtils.RSA rsa, DoubleMatrix2D frequencySlot2FiberOccupancy_se, DoubleMatrix1D nodeRegeneratorOccupancy)
frequencySlot2FiberOccupancy_se
and nodeRegeneratorOccupancy
to consider that a new lightpath is occupying
the resources given by rsa
.rsa
 The rsafrequencySlot2FiberOccupancy_se
 Current slotfiber occupancy (updated inside the method)nodeRegeneratorOccupancy
 Current number of regenerators occupied per nodepublic static void checkResourceAllocationClashing(NetPlan netPlan, boolean countFailedLightpaths, boolean checkRegeneratorsAsWavelengthConverters, NetworkLayer... optionalLayerParameter)
netPlan
 The object representing the networkcountFailedLightpaths
 Include paths (current, primary or backup) that are downcheckRegeneratorsAsWavelengthConverters
 Whether or not to check that a lighpath occupies one regenerator in every node where the RSA checnges the frequency slots (that is, where a wavelength conversion occurs)optionalLayerParameter
 WDM network layer. If not present, the default layer is assumedpublic static List<Pair<Integer,Integer>> computeAvailableSpectrumVoids(TreeSet<Integer> slotOccupancy, int totalAvailableSlotsPerFiber)
Computes the list of spectral voids (list of available contiguous slots) from a slot availability vector (of a fiber or of a path).
slotOccupancy
 Set of slots that are already occupiedtotalAvailableSlotsPerFiber
 Number of slots per fiberpublic static int computeMaximumRequests(List<Pair<Integer,Integer>> availableSpectrumVoids, int numSlots)
availableSpectrumVoids
 List of available spectrum voids (first item of each pair is the initial slot identifier, the second one is the number of consecutive slots)numSlots
 Number of required slots of all the connectionspublic static WDMUtils.ModulationFormat computeModulationFormat(double pathLengthInKm, Set<WDMUtils.ModulationFormat> availableModulationFormats)
pathLengthInKm
 Path length (in kilometers): the minimum reach of the returned modulation formatavailableModulationFormats
 Set of candidate modulation formatspublic static WDMUtils.ModulationFormat computeModulationFormat(List<Link> seqFibers, Set<WDMUtils.ModulationFormat> availableModulationFormats)
computeModulationFormat(lengthKm, availableModulationFormats)
, where lengthKm
is the length in km of the input path.seqFibers
 Sequence of fibers of the pathavailableModulationFormats
 Set of candidate modulation formatspublic static Map<List<Link>,WDMUtils.ModulationFormat> computeModulationFormatPerPath(Map<Pair<Node,Node>,List<List<Link>>> cpl, Set<WDMUtils.ModulationFormat> availableModulationFormats)
cpl
)cpl
 The list of paths (the key of the map is the pair of end nodes, the value is the list of the paths between these nodes)availableModulationFormats
 Set of candidate modulation formatspublic static int computeNumberOfSlots(double bandwidthInGbps, double slotGranularityInGHz, double guardBandInGHz, WDMUtils.ModulationFormat modulationFormat)
bandwidthInGbps
 Requested bandwidth (in Gbps)slotGranularityInGHz
 Slot granularity (in GHz)guardBandInGHz
 Guardband size (in GHz) (summing the one with upper and lower wavelengths)modulationFormat
 Modulation formatpublic static TreeSet<Integer> computePathSlotOccupancy(List<Link> seqFibers, DoubleMatrix2D frequencySlot2FiberOccupancy_se)
Computes the slot availability vector of a path, represented by a sequence of fibers, where each position indicates whether or not its corresponding frequency slot is available along the path.
Important: Loopfree paths should be employed, but it is not checked by the method.
frequencySlot2FiberOccupancy_se
 Indicates per each fiber its slot occupancy, where alreadyoccupied slots appearseqFibers
 (Loopfree) Sequence of traversed fibers (unchecked for conitinuity or cycles)public static int[] computeRegeneratorPositions(List<Link> seqFibers, double maxRegeneratorDistanceInKm)
seqFibers
 Sequence of traversed fibersmaxRegeneratorDistanceInKm
 Maximum regeneration distance: after this distance from the initial node or from the last regenerator, the signal is considered not recuperablepublic static int[] computeRegeneratorPositions(List<Link> seqFibers, DoubleMatrix2D seqFrequencySlots, double maxRegeneratorDistanceInKm)
seqFibers
 Sequence of traversed fibersseqFrequencySlots
 Sequence of frequency slots occupied (one row per slot, one column per traversed fiber)maxRegeneratorDistanceInKm
 Maximum regeneration distance: after this distance from the initial node or from the last regenerator, the signal is considered not recuperablepublic static int getFiberNumFrequencySlots(Link fiber)
getCapacity()
from the Link
object,
but converting capacity value from double
to int
.fiber
 Link fiberpublic static Pair<DoubleMatrix2D,DoubleMatrix1D> getNetworkSlotAndRegeneratorOcupancy(NetPlan netPlan, boolean countFailedLightpaths, NetworkLayer... optionalLayerParameter)
netPlan
 Current designcountFailedLightpaths
 Include paths (current, primary or backup) that are downoptionalLayerParameter
 WDM network layer. If not present, the default layer is assumedpublic static Pair<Map<Pair<Link,Integer>,List<Route>>,Map<Node,List<Route>>> getNetworkSlotOccupancyMap(NetPlan netPlan, boolean countFailedLightpaths, NetworkLayer... optionalLayerParameter)
Route
) objects occupying the slot, and a list of
the backup lightpaths (as a pair with route, and the index of the backup lightpath in the list of backup paths for the route)
occupying the slot. If more than one lightpath occupies an slot an exception is NOT thrown. The second map is a map with one key for each
Node
with at least one signal regeneration placed in its RSA, and the value is the pair of two lists
of lightpaths (regular and protection) with a regenerator in it. If a lightpath has more than one regenerator in a node,
it appears as many times as the number of regenerators there.netPlan
 Current designcountFailedLightpaths
 if false, only those paths (current, primary, or backup) that are not down are accountedoptionalLayerParameter
 WDM network layer. If not present, the default layer is assumedpublic static DoubleMatrix1D getVectorFiberNumFrequencySlots(NetPlan netPlan, NetworkLayer... optionalLayerParameter)
netPlan
 A NetPlan
representing a WDM physical topologyoptionalLayerParameter
 WDM network layer. If not present, the default layer is assumedpublic static boolean isAllocatableRSASet(DoubleMatrix2D frequencySlot2FiberOccupancy_se, WDMUtils.RSA... rsas)
true
if all the RSAs are allocatable (the needed frequency slots are free in the given sequence of links), false
otherwise.frequencySlot2FiberOccupancy_se
 Current slotfiber occupancyrsas
 one or more RSAs to check. We start allocating them in order (never releasing the resources of the previous ones). Then, true
is returned if it is possible to allocate all of them simultaneously. In other words, if two RSAs in rsas
require the same frequency slot in the same link, they are not allocatable.public static boolean isWDMFormatCorrect(Link fiber)
Link
object representing a fiber is well formed, according to the WDMUtils
requirements.
This means that the link capacity is an integer (which reflect the maximum number of slots occupied)fiber
 Checks if the given link is a fiber.public static boolean isWDMFormatCorrect(NetPlan netPlan, NetworkLayer... optionalLayerParameter)
netPlan
 The object representing the networkoptionalLayerParameter
 WDM network layer. If not present, the default layer is assumedpublic static boolean isWDMFormatCorrect(Route lp)
Route
object is a well formed lightpath, according to the WDMUtils
requirements. This means that
the attributes stating the assigned frequency slots, occupied signal regenerators are correct, and lp occupied link
capacity (curent and in no failure state) are non negative integers. This mehotd does NOT
check any frequency slot clashing (two lightpaths occupying the same slot in the same fiber).lp
 the lightpathtrue
if the lightpath attributes are well formed, false
otherwisepublic static void releaseResources(WDMUtils.RSA rsa, DoubleMatrix2D frequencySlot2FiberOccupancy_se, DoubleMatrix1D nodeRegeneratorOccupancy)
frequencySlot2FiberOccupancy_se
to consider that a lightpath is releasing
used frequency slots, and nodeRegeneratorOccupancy
to consider that the lightpath releases the occupied regeneratorsrsa
 The RSA to releasefrequencySlot2FiberOccupancy_se
 Current slotfiber occupancy (updated inside the method)nodeRegeneratorOccupancy
 Current node regenerator occupancy (updated inside the method). If null
regenerator information is not updatedpublic static void revertToInitialRSA(Route r)
r
 The route of the lightpath to revertpublic static void setFiberNumFrequencySlots(Link fiber, int numFrequencySlots)
fiber
 Link fibernumFrequencySlots
 Number of of frequency slots for the given fiberpublic static void setFibersNumFrequencySlots(NetPlan netPlan, int numFrequencySlots, NetworkLayer... optionalLayerParameter)
netPlan
 A NetPlan
representing a WDM physical topologynumFrequencySlots
 Number of wavelengths for all fibersoptionalLayerParameter
 WDM network layer. If not present, the default layer is assumedpublic static void setLightpathRSAAttributes(Route lp, WDMUtils.RSA rsa, boolean initializeThePrimaryRoute)
Route
object to reflect the RSA occupation in current, primary or a backup path.lp
 the route objectrsa
 the RSA informationinitializeThePrimaryRoute
 If true
, we assume that the RSA corresponds to the primary path information in the Route
object.public static int spectrumAssignment_firstFit(List<Link> seqFibers, DoubleMatrix2D frequencySlot2FiberOccupancy_se, int numContiguousSlotsRequired)
Frequency slot assignment algorithm based on a firstfit fashion. It tries to find a set of contiguous slots that are available in all the traversed links, and gets the one which starts in the lowest slot id (the initial slot id of the block is returned)
Important: frequencySlot2FiberOccupancy_se
is not updated by this method
seqFibers
 Sequence of traversed fibersfrequencySlot2FiberOccupancy_se
 Current slotfiber occupancynumContiguousSlotsRequired
 Number of slots of the block (in fixedgrid WDM, this is 1)public static Pair<Integer,Integer> spectrumAssignment_firstFitTwoRoutes(List<Link> seqFibers_1, List<Link> seqFibers_2, DoubleMatrix2D frequencySlot2FiberOccupancy_se, int numContiguousSlotsRequired)
Frequency slot assignment algorithm based on a firstfit fashion for two different paths.
It tries to find the lowest (s1,s2)
pair, so that a contiguous block of the needed slots, starting in s1, are free in the first path,
and starting in s2
are free in the second path (assuming the occupied slots in the first path are not available now).
Among all the feasible (s1,s2)
pairs, the returned is the one with lowest s1
, and if more than one, with the lowest s2
.
If no (s1,s2)
pair exists with the required idle frequency slots, the method returns null
Important: frequencySlot2FiberOccupancy_se
is not updated by this method
seqFibers_1
 First sequence of traversed fibersseqFibers_2
 Second sequence of traversed fibersfrequencySlot2FiberOccupancy_se
 Current slotfiber occupancynumContiguousSlotsRequired
 Number of slots of the block (in fixedgrid WDM, this is 1)public static Pair<int[],int[]> wavelengthAssignment_RPP_firstFit(List<Link> seqFibers, DoubleMatrix2D frequencySlot2FiberOccupancy_se, DoubleMatrix1D nodeRegeneratorOccupancy, double maxRegeneratorDistanceInKm)
Wavelength assignment algorithm based on a firstfit fashion assuming full wavelength conversion and regeneration capabilities. This algorithm is targeted for fixedfrid WDM networks, where all lightpaths occupy just one frequency slot (we call it, the lightpath wavelength). In the algorithm, each node selects the first free block for its output fiber, and next nodes in the lightpath try to maintain it. If not possible, or regeneration is needed, then include a regenerator (can act also as a full wavelength converter) and search for the first free wavelength, and so on.
In case a lightpath cannot be allocated, the corresponding sequence of
wavelengths (seqWavelengths
parameter) will be an empty array.
seqFibers
 Sequence of traversed fibersfrequencySlot2FiberOccupancy_se
 Current slotfiber occupancynodeRegeneratorOccupancy
 Number of regenerators installed per nodemaxRegeneratorDistanceInKm
 Maximum regeneration distanceCopyright © 2017. All rights reserved.