-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
99 changed files
with
1,611 additions
and
448 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
docker/db-migration/migrations/012-add-diverse-and-affinity-group-id-to-flow-class.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
databaseChangeLog: | ||
- changeSet: | ||
id: tag | ||
author: dpoltavets | ||
changes: | ||
- tagDatabase: | ||
tag: 012-add-diverse-and-affinity-group-id-to-flow-class | ||
|
||
- changeSet: | ||
id: add_diverse_and_affinity_group_id_to_flow_class | ||
author: dpoltavets | ||
changes: | ||
- sql: "CREATE PROPERTY flow.diverse_group_id IF NOT EXISTS STRING" | ||
- sql: "CREATE INDEX flow.diverse_group_id NOTUNIQUE_HASH_INDEX" | ||
- sql: "CREATE PROPERTY flow.affinity_group_id IF NOT EXISTS STRING" | ||
- sql: "CREATE INDEX flow.affinity_group_id NOTUNIQUE_HASH_INDEX" | ||
- sql: "CREATE PROPERTY flow_dump.diverse_group_id IF NOT EXISTS STRING" | ||
- sql: "CREATE PROPERTY flow_dump.affinity_group_id IF NOT EXISTS STRING" | ||
rollback: | ||
- sql: "DROP INDEX flow.diverse_group_id" | ||
- sql: "UPDATE flow REMOVE diverse_group_id" | ||
- sql: "DROP PROPERTY flow.diverse_group_id" | ||
- sql: "DROP INDEX flow.affinity_group_id" | ||
- sql: "UPDATE flow REMOVE affinity_group_id" | ||
- sql: "DROP PROPERTY flow.affinity_group_id" | ||
- sql: "UPDATE flow_dump REMOVE diverse_group_id" | ||
- sql: "DROP PROPERTY flow_dump.diverse_group_id" | ||
- sql: "UPDATE flow_dump REMOVE affinity_group_id" | ||
- sql: "DROP PROPERTY flow_dump.affinity_group_id" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+76.6 KB
docs/design/solutions/pce-affinity-flows/pce-affinity-flows-create.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions
57
docs/design/solutions/pce-affinity-flows/pce-affinity-flows-create.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
@startuml | ||
title Affinity flows | ||
|
||
participant NB | ||
participant FlowHSTopology | ||
participant PathComputer | ||
participant AvailableNetwork | ||
database OrientDB | ||
|
||
activate FlowHSTopology | ||
NB -> FlowHSTopology : create affinity flow | ||
|
||
FlowHSTopology -> OrientDB : get affinity flow by id | ||
OrientDB --> FlowHSTopology : Flow instance | ||
alt flow affinity group property is not defined | ||
FlowHSTopology -> OrientDB : save affinity flow id as affinity group id | ||
end | ||
|
||
FlowHSTopology -> PathComputer : get path with flow affinity group id | ||
activate PathComputer | ||
|
||
PathComputer -> AvailableNetwork : getAvailableNetwork\nwith flow affinity group id | ||
activate AvailableNetwork | ||
|
||
group Build AvailableNetwork | ||
AvailableNetwork -> OrientDB: get active links | ||
OrientDB--> AvailableNetwork | ||
AvailableNetwork -> AvailableNetwork : create network from retrieved links | ||
|
||
group Fill network affinity weights | ||
AvailableNetwork -> OrientDB : get flow segments for main flow in the affinity group | ||
OrientDB--> AvailableNetwork : path segments | ||
|
||
AvailableNetwork -> AvailableNetwork: fill affinity weights using\naffinity flow segments | ||
end | ||
AvailableNetwork --> PathComputer : AvailableNetwork | ||
deactivate AvailableNetwork | ||
end | ||
|
||
group Find path | ||
PathComputer -> PathComputer : PathFinder.findPathInNetwork | ||
PathComputer --> FlowHSTopology : computed path | ||
deactivate PathComputer | ||
end | ||
|
||
alt path found | ||
FlowHSTopology -> OrientDB : create new flow with affinity group id | ||
|
||
FlowHSTopology --> NB : flow create operation response | ||
|
||
else path not found | ||
FlowHSTopology --> NB: creation error | ||
end | ||
|
||
deactivate FlowHSTopology | ||
|
||
@enduml |
43 changes: 43 additions & 0 deletions
43
docs/design/solutions/pce-affinity-flows/pce-affinity-flows.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Affinity flows | ||
|
||
## Goals | ||
The main goal is to be able to search for paths that maximally repeat the path of a certain main flow. | ||
|
||
## NB contract changes | ||
Create\Update Flow Request: add optional flow id, to make flow affinity with. | ||
|
||
Flow Response: If flow is in an affinity group, flow response will contain an `affinity_with` field | ||
with a main flow id of that group. | ||
|
||
## DB changes | ||
Flow relation keeps flow affinity group id as a property. | ||
|
||
## Path computation algorithm changes | ||
In PCE flow affinity working similar to diversity groups. During available network computation weight for all edges not used by affinity flow paths is increased by the configurable parameter value. These penalties should make calculated paths to prefer reuse as many links as possible. In other words if we need to compare two possible paths: first step is to compare number of links unused by affinity flow and second step is compare weights by path computation strategy (cost, latency etc). | ||
|
||
### Use cases | ||
1. Affinity flow has path 1-2-3. We need to build path from node 1 to 4. There are three available paths: 1-4, 1-2-4, 1-2-3-4. Since they all have only one link unused by main path they will have the same affinity penalty and the path with minimal total weight will be chosen. If we have equal initial weights for all these links we will use path 1-4 because it's total weight is minimal. | ||
|
||
![Use case 1](use-case-1.png) | ||
|
||
2. Affinity flow has path 1-2-3-4. We need to build path from node 1 to 7. A lot of paths are available but only two of them has one link unused by main path: 1-2-3-7 and 1-2-3-4-7. All other paths will have more links unused by main path and thus will have greater affinity penalty. If we have equal initial weights for all these links we will use path 1-2-3-7 because it's total weight is minimal. | ||
|
||
![Use case 2](use-case-2.png) | ||
|
||
3. Affinity flow has path 1-2-5. We need to build path from node 3 to 6. Two paths are available 3-2-5-6 and 3-4-7-6. First path reuses one link from main flow so has lesser affinity penalty and should be used. | ||
|
||
![Use case 3](use-case-3.png) | ||
|
||
## Limitations | ||
- Flow can only belong to one flow affinity group. | ||
|
||
- Flow affinity groups are an implementation detail and there is no API to access it directly. | ||
|
||
- In the current implementation, affinity and diverse groups can not be specified at the same time for one flow. | ||
([Diverse flows](../pce-diverse-flows/pce-diverse-flows.md)) | ||
|
||
- In current implementation affinity groups doesn't support protected flows because protected flows implemented using diversity feature. | ||
|
||
## Sequence Diagram | ||
![Create affinity flows](pce-affinity-flows-create.png) | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.