public class ProtectionSegment extends Link
This class contains a representation of a protection segment. This is a contiguous sequence of links in a particular network layer (with a routing of type source routnig), and an amount of reserved capacity in each of the traversed links. A protection segment can be associated to an arbitrary number of routes in the same network layer. Its reserved capacity can be used as backup for those routes, if the primary route fails. When a route fails, the rerouting using associated protection segments is not automatic: it would be the role of a built-in or user-defined algorithm how the routes should be rerouted in the associated segments.
A ProtectionSegment object is a subclass of Link. This has no special importance for the regular user. It becomes useful when writing network recovery algoithms, since the routes can be rerouted using protection segments as if they were links
Modifier and Type | Method and Description |
---|---|
void |
coupleToLowerLayerDemand(Demand demand)
This method cannot be called for protection segments (raises an exception)
|
Demand |
coupleToNewDemandCreated(NetworkLayer newLinkLayer)
This method cannot be called for protection segments (raises an exception)
|
Set<Route> |
getAssociatedRoutesToWhichIsBackup()
Returns the routes this segment is a potential backing up segment
|
double |
getCarriedTraffic()
The carried traffic (in traffic units) of the routes traversing this segment.
|
double |
getCarriedTrafficIncludingProtectionSegments()
This method cannot be called for protection segments (raises an exception)
|
double |
getCarriedTrafficNotIncludingProtectionSegments()
This method cannot be called for protection segments (raises an exception)
|
Map<Pair<Demand,Link>,Double> |
getForwardingRules()
This method cannot be called for protection segments (raises an exception)
|
int |
getNumberOfHops()
Returns the segment number of traversed links.
|
double |
getOccupiedCapacityIncludingProtectionSegments()
This method cannot be called for protection segments (raises an exception)
|
double |
getOccupiedCapacityNotIncludingProtectionSegments()
This method cannot be called for protection segments (raises an exception)
|
double |
getOccupiedLinkCapacity()
The occupied link capacity (in link capacity units) of the routes traversing this segment.
|
double |
getPropagationDelayInMs()
Returns the segment propagation delay in miliseconds, traversing all the links.
|
double |
getReservedCapacityForProtection()
Returns the segment reserved capacity in the traversed links.
|
List<Link> |
getSeqLinks()
Returns the protection segment sequence of links.
|
List<Node> |
getSeqNodes()
Returns the protection segment sequence of nodes
|
Set<SharedRiskGroup> |
getSRGs()
Returns the set of SRGs the that affect this protection segment.
|
Set<ProtectionSegment> |
getTraversingProtectionSegments()
This method cannot be called for protection segments (raises an exception)
|
double |
getUtilization()
Returns the utilization of the protection segment: capacity occupied by the carried traffic, divided by reserved capacity.
|
double |
getUtilizationIncludingProtectionSegments()
This method cannot be called for protection segments (raises an exception)
|
double |
getUtilizationNotIncludingProtectionSegments()
This method cannot be called for protection segments (raises an exception)
|
boolean |
isDedicated()
Returns
tue if the protection segment is dedicated: assigned to exactly one route |
boolean |
isDown()
Returns true if the protection segment is traversing a link or node that is down.
|
boolean |
isUp()
Returns
false if the protection segment is traversing a link or node that is down |
void |
remove()
Removes a protection segment.
|
void |
removeAllForwardingRules()
This method cannot be called for protection segments (raises an exception)
|
void |
setCapacity(double linkCapacity)
This method cannot be called for protection segments (raises an exception)
|
boolean |
setFailureState(boolean setAsUp)
This method cannot be called for protection segments (raises an exception)
|
void |
setLengthInKm(double lengthInKm)
This method cannot be called for protection segments (raises an exception)
|
void |
setPropagationSpeedInKmPerSecond(double speed)
This method cannot be called for protection segments (raises an exception)
|
void |
setReservedCapacity(double capacity)
Sets the segment reserved capacity in the traversed links
|
String |
toString()
Returns a
String representation of the protection segment. |
getBidirectionalPair, getCapacity, getCoupledDemand, getCoupledMulticastDemand, getDestinationNode, getLayer, getLengthInKm, getMulticastCarriedTraffic, getMulticastOccupiedLinkCapacity, getOriginNode, getPropagationSpeedInKmPerSecond, getTraversingRoutes, getTraversingTrees, isCoupled, isOversubscribed
checkAttachedToNetPlanObject, checkAttachedToNetPlanObject, equals, getAttribute, getAttributes, getId, getIndex, getNetPlan, removeAllAttributes, removeAttribute, setAttribute, setAttributeMap, wasRemoved
public void coupleToLowerLayerDemand(Demand demand)
coupleToLowerLayerDemand
in class Link
demand
- The demand to be coupled topublic Demand coupleToNewDemandCreated(NetworkLayer newLinkLayer)
coupleToNewDemandCreated
in class Link
newLinkLayer
- The layer where the demand will be created (and coupled to the link)public Set<Route> getAssociatedRoutesToWhichIsBackup()
Returns the routes this segment is a potential backing up segment
public double getCarriedTraffic()
The carried traffic (in traffic units) of the routes traversing this segment.
public double getCarriedTrafficIncludingProtectionSegments()
getCarriedTrafficIncludingProtectionSegments
in class Link
public double getCarriedTrafficNotIncludingProtectionSegments()
getCarriedTrafficNotIncludingProtectionSegments
in class Link
public Map<Pair<Demand,Link>,Double> getForwardingRules()
getForwardingRules
in class Link
[0,1]
splitting factorspublic int getNumberOfHops()
Returns the segment number of traversed links.
public double getOccupiedCapacityIncludingProtectionSegments()
getOccupiedCapacityIncludingProtectionSegments
in class Link
public double getOccupiedCapacityNotIncludingProtectionSegments()
getOccupiedCapacityNotIncludingProtectionSegments
in class Link
public double getOccupiedLinkCapacity()
The occupied link capacity (in link capacity units) of the routes traversing this segment.
public double getPropagationDelayInMs()
Returns the segment propagation delay in miliseconds, traversing all the links.
getPropagationDelayInMs
in class Link
public double getReservedCapacityForProtection()
Returns the segment reserved capacity in the traversed links.
getReservedCapacityForProtection
in class Link
public List<Link> getSeqLinks()
Returns the protection segment sequence of links.
public List<Node> getSeqNodes()
Returns the protection segment sequence of nodes
public Set<SharedRiskGroup> getSRGs()
Returns the set of SRGs the that affect this protection segment.
public Set<ProtectionSegment> getTraversingProtectionSegments()
getTraversingProtectionSegments
in class Link
Set
with the traversing protection segments. If no protection segments traverse the link, an empty Set
is returnedpublic double getUtilization()
Returns the utilization of the protection segment: capacity occupied by the carried traffic, divided by reserved capacity.
public double getUtilizationIncludingProtectionSegments()
getUtilizationIncludingProtectionSegments
in class Link
public double getUtilizationNotIncludingProtectionSegments()
getUtilizationNotIncludingProtectionSegments
in class Link
public boolean isDedicated()
Returns tue
if the protection segment is dedicated: assigned to exactly one route
True
if dedicated, false
otherwisepublic boolean isDown()
Returns true if the protection segment is traversing a link or node that is down. Then, it will not be able to carry traffic
public boolean isUp()
Returns false
if the protection segment is traversing a link or node that is down
public void remove()
Removes a protection segment. Routes currently traversing the segment are also removed. Routes not currently traversing the protection segment, but that have this segment as a potential backup, are not removed.
public void removeAllForwardingRules()
removeAllForwardingRules
in class Link
public void setCapacity(double linkCapacity)
setCapacity
in class Link
linkCapacity
- The link capacity (must be non-negative)public boolean setFailureState(boolean setAsUp)
setFailureState
in class Link
setAsUp
- The new failure state: true
if up, false
if downpublic void setLengthInKm(double lengthInKm)
setLengthInKm
in class Link
lengthInKm
- New link length in km (must be non-negative)public void setPropagationSpeedInKmPerSecond(double speed)
setPropagationSpeedInKmPerSecond
in class Link
speed
- The speed in km per secondpublic void setReservedCapacity(double capacity)
capacity
- the reserved capacity (in link capacity units)