Package org.opendaylight.algo.impl
Class AbstractPathComputation
java.lang.Object
org.opendaylight.algo.impl.AbstractPathComputation
- All Implemented Interfaces:
PathComputationAlgorithm
- Direct Known Subclasses:
ConstrainedShortestPathFirst,Samcra,ShortestPathFirst
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Constraintsprotected final ConnectedGraphprotected CspfPathprotected CspfPathprotected final PriorityQueue<CspfPath> protected ComputationStatus -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ConstrainedPathcombineDivertPaths(CspfPath pcp, CspfPath scp) computeDivertPaths(VertexKey source, VertexKey destination, Constraints cts) Compute Divert path algorithms could be simple as: 1) compute first path, 2) remove edges and nodes in graph and 3) compute the second path.computeP2pPath(VertexKey source, VertexKey destination, Constraints cts) Compute Point to Point Path from source to destination taking into account constraints.protected abstract CspfPathcomputeSimplePath(VertexKey source, VertexKey destination) protected intgetComputedDelay(List<ConnectedEdge> path) protected intgetComputedMetric(List<ConnectedEdge> path) protected intgetComputedTeMetric(List<ConnectedEdge> path) protected @Nullable MplsLabelgetIpv4NodeSid(ConnectedVertex cvertex) Return the MPLS Label corresponding to the Node SID for IPv4 when the Connected Vertex is Segment Routing aware.protected @Nullable MplsLabelgetIpv6NodeSid(ConnectedVertex cvertex) Return the MPLS Label corresponding to the Node SID for IPv6 when the Connected Vertex is Segment Routing aware.protected List<PathDescription> getPathDescription(List<ConnectedEdge> edges) Convert List of Connected Edges into a Path Description as a List of IPv4, IPv6 or MPLS Label depending of the requested Address Family.protected ComputationStatusinitializePathComputation(VertexKey src, VertexKey dst) Initialize the various parameters for Path Computation, in particular the Source and Destination CspfPath.protected booleanpruneEdge(ConnectedEdge edge, CspfPath path) Check if Edge need to be prune regarding all constraints including address family.protected voidresetEdgesDiversity(List<ConnectedEdge> edges) protected voidresetVerticesDiversity(List<ConnectedEdge> edges) protected voidsetEdgesDiversity(List<ConnectedEdge> edges) protected voidsetVerticesDiversity(List<ConnectedEdge> edges) protected ConstrainedPathtoConstrainedPath(CspfPath path) protected ConstrainedPathtoConstrainedPath(CspfPath primary, CspfPath secondary) protected booleanverifySrlgs(ConnectedEdge edge, CspfPath path) Verify if Edge share SRLG with current path during Path Diversity computation.
-
Field Details
-
graph
-
pathSource
-
pathDestination
-
constraints
-
status
-
priorityQueue
-
processedPath
-
-
Constructor Details
-
AbstractPathComputation
-
-
Method Details
-
initializePathComputation
Initialize the various parameters for Path Computation, in particular the Source and Destination CspfPath.- Parameters:
src- Source Vertex Identifier in the Connected Graphdst- Destination Vertex Identifier in the Connected Graph- Returns:
- Computation Status
-
verifySrlgs
Verify if Edge share SRLG with current path during Path Diversity computation.- Parameters:
edge- Connected Edge to be verifiedpath- Current CSPF Path- Returns:
- True if Edge share SRLG with current path, False otherwise
-
pruneEdge
Check if Edge need to be prune regarding all constraints including address family.- Parameters:
edge- Connected Edge to be verifiedpath- Current Cspf Path- Returns:
- True if Edge must be prune, False if Edge must be keep
-
getIpv4NodeSid
Return the MPLS Label corresponding to the Node SID for IPv4 when the Connected Vertex is Segment Routing aware.- Parameters:
cvertex- Connected Vertex- Returns:
- MPLS Label if Connected Vertex is Segment Routing aware, Null otherwise
-
getIpv6NodeSid
Return the MPLS Label corresponding to the Node SID for IPv6 when the Connected Vertex is Segment Routing aware.- Parameters:
cvertex- Connected Vertex- Returns:
- MPLS Label if Connected Vertex is Segment Routing aware, Null otherwise
-
getPathDescription
Convert List of Connected Edges into a Path Description as a List of IPv4, IPv6 or MPLS Label depending of the requested Address Family.- Parameters:
edges- List of Connected Edges- Returns:
- Path Description
-
toConstrainedPath
-
toConstrainedPath
-
computeP2pPath
Description copied from interface:PathComputationAlgorithmCompute Point to Point Path from source to destination taking into account constraints.- Specified by:
computeP2pPathin interfacePathComputationAlgorithm- Parameters:
source- Source Vertex Keydestination- Destination Vertex Keycts- Constraints (Metric, TE Metric, Delay, Jitter, Loss, Bandwidth)- Returns:
- A Path that meet constraints or empty path otherwise. ConstrainedPath.Status indicates the result of the path computation (Completed or Failed)
-
setEdgesDiversity
-
resetEdgesDiversity
-
setVerticesDiversity
-
resetVerticesDiversity
-
getComputedMetric
-
getComputedTeMetric
-
getComputedDelay
-
combineDivertPaths
-
computeDivertPaths
Compute Divert path algorithms could be simple as: 1) compute first path, 2) remove edges and nodes in graph and 3) compute the second path. Named Remove and Find this simple solution is not optimal and frequently failed. Thus, we use here another approach based on Suurballe's algorithm: - Step1: Compute the first path P1 from graph G(V,E) - Step2: Replace P1 by -P1 in G(V,E) to form a new graph G'(V',E') - Step3: Compute the second path P2 from graph G'(V',E') - Step4: Take the union of P1 and P2, remove from the union the set of links consisting of those P1 links whose reversed links appear on P2, and vice versa; then group the remaining links into two paths P1' and P2' In our case, step2 will consist to mark P1 edge's and/or vertice's as "diverted" in Connected Graph as all edges are bi-directionnal and unmark them after step 3.- Specified by:
computeDivertPathsin interfacePathComputationAlgorithm- Parameters:
source- Source Vertex Keydestination- Destination Vertex Keycts- Constraints including diversity (link, node, srlg and endpoints if different)- Returns:
- Two diverted paths that meet constraints or empty paths otherwise. ConstrainedPath.Status indicates the result of the path computation (Completed or Failed). SecondaryPath contains the path description of the diverted path.
-
computeSimplePath
-