public class Link extends NetworkElement
This class contains a representation of a link. A link is characterized by its initial and end node, the network layer it belongs to,
and its capacity, measured in the layer link capacity units. When the routing type at the link layer is SOURCE_ROUTING
, the link
carries traffic of the traversing routes, and can have some capacity reserved by protection segments. If the routing type is HOP_BY_HOP_ROUTING
, the
link carried traffic depends on the demands offered traffic and the forwarding rules. In both routing types, links can be part of multicast trees and
carry their traffic.
SOURCE_ROUTING
), the splitting factors of the forwarding rules through it are set to zero
(HOP_BY_HOP_ROUTING
), and the carried traffic of any traversing multicast tree is set to zero.Modifier and Type | Method and Description |
---|---|
void |
coupleToLowerLayerDemand(Demand demand)
Couples the link to a unicast
Demand in the lower layer. |
Demand |
coupleToNewDemandCreated(NetworkLayer newDemandLayer,
Constants.RoutingType routingTypeDemand)
Creates a new
Demand in the given layer, with same end nodes as the link, and then couples the link to the new created demand. |
Link |
createBidirectionalPair()
Creates a link in the opposite direction as this, and with the same attributes, and associate both as bidirectional pairs.
|
void |
decouple() |
Link |
getBidirectionalPair()
If the link was added using addLinkBidirectional()
returns the link in the opposite direction (if it was not previously removed).
|
double |
getCapacity()
Returns the link capacity.
|
double |
getCarriedTraffic()
Returns the link carried traffic (in traffic demand units).
|
Demand |
getCoupledDemand()
Returns the unicast
Demand the link is coupled to, or null if none. |
MulticastDemand |
getCoupledMulticastDemand()
Returns the
MulticastDemand the link is coupled to, or null if none. |
Triple<SortedSet<Demand>,SortedSet<Demand>,SortedSet<MulticastDemand>> |
getDemandsPotentiallyTraversingThisLink()
Returns the set of demands that could potentially put traffic in this link,
according to the routes/forwarding rules defined.
|
SortedSet<Demand> |
getDemandsWithNonZeroForwardingRules()
Returns the set of demands in this layer, with non zero forwarding rules defined for them in this link.
|
Node |
getDestinationNode()
Returns the link destination
Node . |
SortedMap<Pair<Demand,Link>,Double> |
getForwardingRules()
Returns the non zero forwarding rules that are defined in the link.
|
NetworkLayer |
getLayer()
Returns the
NetworkLayer the link belongs to. |
double |
getLengthInKm()
Returns the link length in km.
|
Triple<SortedMap<Demand,SortedSet<Link>>,SortedMap<Demand,SortedSet<Link>>,SortedMap<Pair<MulticastDemand,Node>,SortedSet<Link>>> |
getLinksDownPropagationPotentiallyCarryingTrafficTraversingThisLink()
Returns the set of links in lower layers carry the traffic that traverses this link, before and after traversing it,
according to the routes/forwarding rules defined.
|
Triple<SortedMap<Demand,SortedSet<Link>>,SortedMap<Demand,SortedSet<Link>>,SortedMap<Pair<MulticastDemand,Node>,SortedSet<Link>>> |
getLinksThisLayerPotentiallyCarryingTrafficTraversingThisLink()
Returns the set of links in this layer (including this) that carry the traffic that traverses this link, before and after traversing it,
according to the routes/forwarding rules defined.
|
TrafficSeries |
getMonitoredOrForecastedCarriedTraffic()
Returns the object contianing the monitored or forecasted time series information for the carried traffic
|
double |
getMulticastCarriedTraffic()
Returns the sum of the traffic carried by the
MulticastTree traversing the link. |
double |
getMulticastOccupiedLinkCapacity()
Returns the sum of the occupied link capacity by the traffic of the
Multicast Trees traversing the link. |
int |
getNumberOfForwardingRules()
Returns the number of forwarding rules defined for this link (with non-zero split factor)
|
int |
getNumberOfTraversingBackupRoutes()
Returns the set number of routes traversing the link that are designated as backup of other route
|
int |
getNumberOfTraversingRoutes()
Returns the number of routes traversing this link.
|
int |
getNumberOfTraversingTrees()
Returns the number of multicast trees traversing this link
|
double |
getOccupiedCapacity()
Returns the link occupied capacity (in link capacity units).
|
double |
getOccupiedCapacityFromDemand(Demand d) |
double |
getOccupiedCapacityOnlyBackupRoutes()
Returns the link occupied capacity (in link capacity units).
|
Node |
getOriginNode()
Returns the link origin node.
|
double |
getOversubscribedTraffic()
Returns the amount of traffic over the link capacity.
|
SortedMap<String,Pair<Double,Double>> |
getPerQoSOccupationAndQosViolationMap()
Returns for each traversing demand, a pair with i) the occupied capacity in the link of that
demand, ii) the amount of such occupied capacity that is violating the demand QoS assigned capacity.
|
double |
getPropagationDelayInMs()
Returns the link propagation delay in miliseconds.
|
double |
getPropagationSpeedInKmPerSecond()
Returns the link propagation speed in km per second.
|
Pair<Double,Double> |
getQosOccupationAndQosViolation(String qosType)
Returns the total traffic occupied in the link by the demands of a given QoS type, and
the amount out of that traffic that is violating the QoS
|
Pair<Integer,Double> |
getQosTypePriorityAndMaxLinkUtilization(String qosType)
Returns the priority (lower better) and link percentage maximum utilization, assigned to the
QoS type indicated.
|
SortedMap<String,Pair<Integer,Double>> |
getQosTypePriorityAndMaxLinkUtilizationMap()
Returns the priority (lower better) and link percentage maximum utilization, assigned to the
QoS type indicated, for each of the QoS types with traffic traversing the link.
|
SortedSet<String> |
getQosViolated()
Returns the set of QoS types that have violated traffic in this link
|
SortedSet<SharedRiskGroup> |
getSRGs()
Returns the Shared Risk Groups (
SRGs ) the link belongs to. |
SortedSet<Route> |
getTraversingBackupRoutes()
Returns the set of routes traversing the link that are designated as backup of other route
|
SortedSet<Route> |
getTraversingRoutes()
Returns the
Routes traversing the link. |
SortedMap<Route,Integer> |
getTraversingRoutesAndMultiplicity()
Returns a map with the routes traversing this link, and the number of times they traverse it
|
SortedSet<MulticastTree> |
getTraversingTrees()
Returns the
Multicast Trees traversing the link. |
double |
getUtilization()
Returns the link utilization, measured as the ratio between the total occupied capacity in the link and the total link capacity.
|
boolean |
isBidirectional()
Returns true if the link is bidirectional.
|
boolean |
isCoupled()
|
boolean |
isCoupledInDifferentLayer()
Returns
true if the link is coupled to a demand in a different layer than the demnad (and thus an *upper* layer)
, false otherwise. |
boolean |
isCoupledInSameLayer()
Returns
true if the link is coupled to a demand in the same layer as the demand, false otherwise. |
boolean |
isDown()
Returns whether the link is down (in failure) or not.
|
boolean |
isOversubscribed()
Returns true if the link is oversubscribed, up to the Net2Plan defined precision factor.
|
boolean |
isQoSViolated(String qosType)
Returns true if the traffic of the given QoS is violating the QoS in the link
|
boolean |
isUp()
Returns whether the link is up (not in failure) or down.
|
void |
remove()
Removes the link.
|
void |
removeAllForwardingRules()
Removes all forwarding rules associated to the link.
|
void |
removeQosTypePriorityAndMaxLinkUtilization(String qosType)
Removes any information on the priority (lower better) and link percentage maximum utilization, assigned to the
QoS type indicated.
|
void |
setBidirectionalPair(Link e)
Sets the given link as the bidirectional pair of this link.
|
void |
setCapacity(double newLinkCapacity)
Sets the link capacity.
|
boolean |
setFailureState(boolean setAsUp)
Sets the failure state of the link: up or down and returns the previous failure state.
|
void |
setLengthInKm(double lengthInKm)
Sets the link length in km.
|
void |
setMonitoredOrForecastedCarriedTraffic(TrafficSeries newTimeSeries)
Sets the new time series for the monitored or forecasted offered traffic, eliminating any previous values
|
void |
setPropagationSpeedInKmPerSecond(double speed)
Sets the link propagation speed in km per second.
|
void |
setQosTypePriorityAndMaxLinkUtilization(String qosType,
int priority,
double maxLinkUtilization)
Sets the priority (lower better) and link percentage maximum utilization, assigned to the
QoS type indicated.
|
String |
toString()
Returns a
String representation of the link. |
addTag, checkAttachedToNetPlanObject, checkAttachedToNetPlanObject, compareTo, equals, getAttribute, getAttribute, getAttributeAsDouble, getAttributeAsDoubleList, getAttributeAsDoubleMatrix, getAttributeAsDoubleMatrix, getAttributeAsStringList, getAttributeAsStringMatrix, getAttributes, getDescription, getId, getIndex, getName, getNetPlan, getNeType, getTags, hasTag, removeAllAttributes, removeAttribute, removeTag, setAttribute, setAttribute, setAttributeAsNumberList, setAttributeAsNumberMatrix, setAttributeAsNumberMatrix, setAttributeAsStringList, setAttributeAsStringMatrix, setAttributeMap, setDescription, setName, wasRemoved
public void coupleToLowerLayerDemand(Demand demand)
Couples the link to a unicast Demand
in the lower layer.
demand
- The demand to be coupled topublic Demand coupleToNewDemandCreated(NetworkLayer newDemandLayer, Constants.RoutingType routingTypeDemand)
Creates a new Demand
in the given layer, with same end nodes as the link, and then couples the link to the new created demand.
newDemandLayer
- The layer where the demand will be created (and coupled to the link)routingTypeDemand
- Routing typepublic Link createBidirectionalPair()
public void decouple()
public Link getBidirectionalPair()
If the link was added using addLinkBidirectional()
returns the link in the opposite direction (if it was not previously removed). Returns null
otherwise.
null
if nonepublic double getCapacity()
Returns the link capacity.
public double getCarriedTraffic()
Returns the link carried traffic (in traffic demand units).
public Demand getCoupledDemand()
Returns the unicast Demand
the link is coupled to, or null
if none.
null
public MulticastDemand getCoupledMulticastDemand()
Returns the MulticastDemand
the link is coupled to, or null
if none.
null
public Triple<SortedSet<Demand>,SortedSet<Demand>,SortedSet<MulticastDemand>> getDemandsPotentiallyTraversingThisLink()
public SortedSet<Demand> getDemandsWithNonZeroForwardingRules()
public Node getDestinationNode()
Returns the link destination Node
.
public SortedMap<Pair<Demand,Link>,Double> getForwardingRules()
Returns the non zero forwarding rules that are defined in the link. If the routing type of the layer where the link is attached is not
HOP_BY_HOP_ROUTING
an exception is thrown.
[0,1]
splitting factorspublic NetworkLayer getLayer()
Returns the NetworkLayer
the link belongs to.
public double getLengthInKm()
Returns the link length in km.
public Triple<SortedMap<Demand,SortedSet<Link>>,SortedMap<Demand,SortedSet<Link>>,SortedMap<Pair<MulticastDemand,Node>,SortedSet<Link>>> getLinksDownPropagationPotentiallyCarryingTrafficTraversingThisLink()
Note: this link is not included in any set an any map
capacity in itpublic Triple<SortedMap<Demand,SortedSet<Link>>,SortedMap<Demand,SortedSet<Link>>,SortedMap<Pair<MulticastDemand,Node>,SortedSet<Link>>> getLinksThisLayerPotentiallyCarryingTrafficTraversingThisLink()
public TrafficSeries getMonitoredOrForecastedCarriedTraffic()
public double getMulticastCarriedTraffic()
Returns the sum of the traffic carried by the MulticastTree
traversing the link.
public double getMulticastOccupiedLinkCapacity()
Returns the sum of the occupied link capacity by the traffic of the Multicast Trees
traversing the link.
public int getNumberOfForwardingRules()
public int getNumberOfTraversingBackupRoutes()
public int getNumberOfTraversingRoutes()
Returns the number of routes traversing this link.
public int getNumberOfTraversingTrees()
public double getOccupiedCapacity()
Returns the link occupied capacity (in link capacity units).
public double getOccupiedCapacityFromDemand(Demand d)
public double getOccupiedCapacityOnlyBackupRoutes()
Returns the link occupied capacity (in link capacity units).
public Node getOriginNode()
Returns the link origin node.
public double getOversubscribedTraffic()
Returns the amount of traffic over the link capacity.
True
if oversubscribed, false
otherwiseConfiguration
public SortedMap<String,Pair<Double,Double>> getPerQoSOccupationAndQosViolationMap()
public double getPropagationDelayInMs()
Returns the link propagation delay in miliseconds.
public double getPropagationSpeedInKmPerSecond()
Returns the link propagation speed in km per second.
public Pair<Double,Double> getQosOccupationAndQosViolation(String qosType)
qosType
- see abovepublic Pair<Integer,Double> getQosTypePriorityAndMaxLinkUtilization(String qosType)
qosType
- see abovepublic SortedMap<String,Pair<Integer,Double>> getQosTypePriorityAndMaxLinkUtilizationMap()
public SortedSet<String> getQosViolated()
public SortedSet<SharedRiskGroup> getSRGs()
Returns the Shared Risk Groups (SRGs
) the link belongs to. The link fails when any of these SRGs is down.
public SortedSet<Route> getTraversingBackupRoutes()
public SortedSet<Route> getTraversingRoutes()
Returns the Routes
traversing the link. If network layer routing type is not
SOURCE_ROUTING
, an exception is thrown.
SortedSet
of traversing routes. If no routes exist, an empty SortedSet
is returnedpublic SortedMap<Route,Integer> getTraversingRoutesAndMultiplicity()
Returns a map with the routes traversing this link, and the number of times they traverse it
public SortedSet<MulticastTree> getTraversingTrees()
Returns the Multicast Trees
traversing the link.
SortedSet
of traversing multicast trees. If no tree exists, an empty set is returnedpublic double getUtilization()
Returns the link utilization, measured as the ratio between the total occupied capacity in the link and the total link capacity.
public boolean isBidirectional()
public boolean isCoupled()
Returns True
if the link is coupled to a Demand
from other layer, false
otherwise.
True
if the link is coupled, false
otherwisepublic boolean isCoupledInDifferentLayer()
Returns true
if the link is coupled to a demand in a different layer than the demnad (and thus an *upper* layer)
, false otherwise.
public boolean isCoupledInSameLayer()
Returns true
if the link is coupled to a demand in the same layer as the demand, false otherwise.
public boolean isDown()
Returns whether the link is down (in failure) or not.
True
if down, false
if uppublic boolean isOversubscribed()
Returns true if the link is oversubscribed, up to the Net2Plan defined precision factor. That is, if the occupied capacity by the traversing
traffic exceeds the link capacity plus said precision factor. In SOURCE_ROUTING
, the link capacity includes any reserved capacity, and the occupied
link capacity includes that from the traversing routes and protection segments.
True
if oversubscribed, false
otherwiseConfiguration
public boolean isQoSViolated(String qosType)
qosType
- see abovepublic boolean isUp()
Returns whether the link is up (not in failure) or down.
true
if up, false
if downpublic void remove()
Removes the link. The routing is updated removing any associated routes, protection segments, multicast trees or forwarding rules.
If the link is coupled to a unicast or multicast demand, it is first decoupled. In the multicast case, this means that the multicast demand is decoupled from ALL the links it is coupled to.
public void removeAllForwardingRules()
Removes all forwarding rules associated to the link.
If routing type is not HOP_BY_HOP_ROUTING
, an exeception is thrown.
public void removeQosTypePriorityAndMaxLinkUtilization(String qosType)
qosType
- see abovepublic void setBidirectionalPair(Link e)
Sets the given link as the bidirectional pair of this link. If any of the links was previously set as bidirectional link of other link, such relation is removed. The links must bein the same layer, and have opposite end nodes
e
- the other linkpublic void setCapacity(double newLinkCapacity)
Sets the link capacity.
newLinkCapacity
- The link capacity (must be non-negative)public boolean setFailureState(boolean setAsUp)
Sets the failure state of the link: up or down and returns the previous failure state. The routing is updated if the failure state changed.
setAsUp
- The new failure state: true
if up, false
if downpublic void setLengthInKm(double lengthInKm)
Sets the link length in km.
lengthInKm
- New link length in km (must be non-negative)public void setMonitoredOrForecastedCarriedTraffic(TrafficSeries newTimeSeries)
newTimeSeries
- see abovepublic void setPropagationSpeedInKmPerSecond(double speed)
Sets the link propagation speed in km per second.
speed
- The speed in km per secondpublic void setQosTypePriorityAndMaxLinkUtilization(String qosType, int priority, double maxLinkUtilization)
qosType
- see abovepriority
- see abovemaxLinkUtilization
- must be between zero and 1public String toString()
Returns a String
representation of the link.
toString
in class NetworkElement
String
representation of the linkCopyright © 2018. All rights reserved.