public class Route extends NetworkElement
This class contains a representation of a unidirectional route, an structure used to carry traffic of unicast demands at a layer, when the layer routing type is source routing. Routes are characterized by the unicast demand they carry traffic of, the traversed links which should form a path from the demand ingress node to the demand egress node, the amount of traffic of the demand that they carry (in traffic units of the layer), amount of link capacity that they occupy in the traversed links (in link capacoty units for its layer).
Naturally, the links and the demand belong to the same layer, the layer of the route.
Routes can be rerouted (change in its sequence of links), and its carried traffic and occupied capacity can change, but not its associate demand. If a route traverses a link or node that is down, its carried traffic automatically drops to zero. If the failing links/nodes are set to up state, its carried traffic and occupied link capacity goes back to the value before the failure.
Routes can be associated to an arbitrary number of protection segments. Protection segments are just reserved capacity in the links, that a route may use. Typically, a built-in or user-made algorithm that reacts to link and node failures decides how and when the assigned protection segments to a route are used.
Modifier and Type | Method and Description |
---|---|
void |
addProtectionSegment(ProtectionSegment segment)
Adds a protection segment to the list of backup protection segments (both must belong to the same layer).
|
double |
getCarriedTraffic()
Returns the route carried traffic at this moment.
|
double |
getCarriedTrafficInNoFailureState()
Returns the route amount of carried traffic, if the tree was not traversing any failing link or node.
|
List<ProtectionSegment> |
getCurrentlyTraversedProtectionSegments()
Returns a list with the currently traversed protection segments for this route, in the same order in which they are traversed.
|
Demand |
getDemand()
Returns the demand that the route is associated to
|
Node |
getEgressNode()
Returns the route egress node, which is the egress node if its associated demand
|
Node |
getFirstAvailableNodeAfterFailures()
Returns the first node in the route that is in up state after all failures in the route.
|
Node |
getFirstAvailableNodeBeforeFailures()
Returns the first node starting from the route ingress node that is in up state, and is immediatly before
a failed resource for this route.
|
Node |
getIngressNode()
Returns the route ingress node, which is the ingress node if its associated demand
|
List<Link> |
getInitialSequenceOfLinks()
Return the sequence of links of the route when it was created (before any rerouting operation could be made).
|
NetworkLayer |
getLayer()
Returns the route layer
|
double |
getLengthInKm()
Returns the route length in km, summing the traversed link lengths, as many times as the link is traversed.
|
int |
getNumberOfHops()
Returns the route number of traversed links, counting also the links inside any traversed protection segment.
|
int |
getNumberOfTimesLinkIsTraversed(Link e)
Returns the number of times that a particular link (not a protection segment) is traversed in its real path (that when the traversed protection segments are expended in its links)
|
double |
getOccupiedCapacity()
Returns the route occupied capacity at the traversing links at this moment.
|
double |
getOccupiedCapacityInNoFailureState()
Returns the route capacity occupied in the links, if the route was not traversing any failing link or node.
|
Set<ProtectionSegment> |
getPotentialBackupProtectionSegments()
Returns the list of protection segments that are registered as potential segmet backups to this route
|
double |
getPropagationDelayInMiliseconds()
Returns the route propagation delay in seconds, summing the traversed link propagation delays
|
double |
getPropagationSpeedInKmPerSecond()
Returns the route average propagation speed in km per second, as the ratio between the tota route length and the total route delay
|
List<Link> |
getSeqLinksAndProtectionSegments()
Returns the route current sequence of traversed links and protection segments (which are subclasses of Link).
|
List<Link> |
getSeqLinksRealPath()
Returns the route sequence of traversed links.
|
List<Node> |
getSeqNodesRealPath()
Returns the route sequence of traversed nodes (the sequence corresponds to the real, so traversed protection segments are converted into their links before computing the traversed nodes)
|
Set<SharedRiskGroup> |
getSRGs()
Returns the SRGs the route is affected by (any traversed node or link is in the SRG)
|
boolean |
hasLoops()
Returns true if the route has loops (traverses a node more than once), and false otherwise
|
boolean |
isDown()
Returns true if the route is traversing a link or node that is down.
|
boolean |
isUpTheInitialSequenceOfLinks()
Returns true if the initial sequence of links when the route was created is at this moment NOT traversing failing links or nodes, and thus is not
subject to any failure.
|
void |
remove()
Removes this route.
|
void |
removeProtectionSegmentFromBackupSegmentList(ProtectionSegment segment)
Removes a protection segment from the list of backup protection segments of a route.
|
void |
revertToInitialSequenceOfLinks()
Equivalent to setSeqLinksAndProtectionSegments(getInitialSequenceOfLinks ()).
|
void |
setCarriedTraffic(double newCarriedTraffic,
double newOccupiedLinkCapacity)
Sets the route carried traffic and occupied capacity in the traversed links (typically the same amount).
|
void |
setSeqLinksAndProtectionSegments(List<Link> seqLinksAndProtectionSegments)
Sets the new sequence of links and/or protection segments travsered by the route.
|
String |
toString()
Returns a
String representation of the network element. |
checkAttachedToNetPlanObject, checkAttachedToNetPlanObject, equals, getAttribute, getAttributes, getId, getIndex, getNetPlan, removeAllAttributes, removeAttribute, setAttribute, setAttributeMap, wasRemoved
public void addProtectionSegment(ProtectionSegment segment)
Adds a protection segment to the list of backup protection segments (both must belong to the same layer).
segment
- The protection segment (must be in the same layer as this route)public double getCarriedTraffic()
public double getCarriedTrafficInNoFailureState()
public List<ProtectionSegment> getCurrentlyTraversedProtectionSegments()
public Demand getDemand()
public Node getEgressNode()
public Node getFirstAvailableNodeAfterFailures()
public Node getFirstAvailableNodeBeforeFailures()
public Node getIngressNode()
public List<Link> getInitialSequenceOfLinks()
public NetworkLayer getLayer()
public double getLengthInKm()
public int getNumberOfHops()
public int getNumberOfTimesLinkIsTraversed(Link e)
e
- the link to checkpublic double getOccupiedCapacity()
public double getOccupiedCapacityInNoFailureState()
public Set<ProtectionSegment> getPotentialBackupProtectionSegments()
public double getPropagationDelayInMiliseconds()
public double getPropagationSpeedInKmPerSecond()
public List<Link> getSeqLinksAndProtectionSegments()
public List<Link> getSeqLinksRealPath()
public List<Node> getSeqNodesRealPath()
public Set<SharedRiskGroup> getSRGs()
public boolean hasLoops()
public boolean isDown()
public boolean isUpTheInitialSequenceOfLinks()
public void remove()
Removes this route.
public void removeProtectionSegmentFromBackupSegmentList(ProtectionSegment segment)
Removes a protection segment from the list of backup protection segments of a route. If the segment was not in the list, nothing happens
segment
- the segment to removepublic void revertToInitialSequenceOfLinks()
public void setCarriedTraffic(double newCarriedTraffic, double newOccupiedLinkCapacity)
newCarriedTraffic
- the new carried trafficnewOccupiedLinkCapacity
- the new occuppied link capacitypublic void setSeqLinksAndProtectionSegments(List<Link> seqLinksAndProtectionSegments)
seqLinksAndProtectionSegments
- the new sequence of links and protection segmentspublic String toString()
NetworkElement
Returns a String
representation of the network element.
toString
in class NetworkElement
String
representation of the network element