-
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
108 changed files
with
4,827 additions
and
317 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions
38
docs/design/hub-and-spoke/crud/path/flow-path-delete-fsm.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,38 @@ | ||
@startuml | ||
title Flow path delete FSM state diagram | ||
|
||
[*] --> DELETE | ||
|
||
DELETE: enter / activate next segments chunk | ||
DELETE: enter / fire "no_more_chunks" if there is no more chunks | ||
DELETE: enter / emit DELETE request for each segment in active chunk | ||
DELETE: enter / fire "chunk_complete" if there is no more pending requests | ||
DELETE: enter / fire "next" | ||
DELETE --> WAIT_PENDING: next | ||
DELETE --> REVERT: error / set result_code into SPEAKER_ERROR | ||
DELETE --> REVERT_WAIT_PENDING: cancel / set result_code into CANCEL | ||
DELETE --> END: (chunk_complete | no_more_chunks) | ||
|
||
WAIT_PENDING --> REVERT: error / set result_code into SPEAKER_ERROR | ||
WAIT_PENDING --> REVERT_WAIT_PENDING: cancel / set result_code into CANCEL | ||
WAIT_PENDING --> DELETE: chunk_complete | ||
WAIT_PENDING: speaker_response / handle speaker response | ||
WAIT_PENDING: speaker_response / [no more pending request && no error responses received] fire "chunk_complete" | ||
WAIT_PENDING: speaker_response / [no more pending request && error responses are present] fire "error" | ||
|
||
REVERT_WAIT_PENDING --> REVERT: (error | chunk_complete) | ||
REVERT_WAIT_PENDING: speaker_response / handle speaker response | ||
REVERT_WAIT_PENDING: speaker_response / [no more pending request && no error responses received] fire "chunk_complete" | ||
REVERT_WAIT_PENDING: speaker_response / [no more pending request && error responses are present] fire "error" | ||
|
||
REVERT: enter / [! is revert enabled] fire "chunk_complete" | ||
REVERT: enter / assemble and activate revert chunk | ||
REVERT: enter / emit INSTALL request for each segment in active chunk | ||
REVERT --> END: (chunk_complete | error) | ||
REVERT: speaker_response / handle speaker response | ||
REVERT: speaker_response / [no more pending request && no error responses received] fire "chunk_complete" | ||
REVERT: speaker_response / [no more pending request && error responses are present] fire "error" | ||
|
||
END: enter / [result code is null] set result_code into success | ||
END --> [*] | ||
@enduml |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions
41
docs/design/hub-and-spoke/crud/path/flow-patth-install-fsm.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,41 @@ | ||
@startuml | ||
title Flow path install FSM state diagram | ||
|
||
[*] --> INSTALL | ||
|
||
INSTALL: enter / activate next segments chunk | ||
INSTALL: enter / fire "no_more_chunks" if there is no more chunks | ||
INSTALL: enter / emit INSTALL request for each segment in active chunk | ||
INSTALL: enter / fire "chunk_complete" if there is no more pending requests | ||
INSTALL --> REVERT: error / set result_code into SPEAKER_ERROR | ||
INSTALL --> REVERT_WAIT_PENDING: cancel / set result_code into CANCEL | ||
INSTALL --> VERIFY: chunk_complete | ||
INSTALL --> END: no_more_chunks | ||
INSTALL: speaker_response / handle speaker response | ||
INSTALL: speaker_response / [no more pending request && no error responses received] fire "chunk_complete" | ||
INSTALL: speaker_response / [no more pending request && error responses are present] fire "error" | ||
|
||
VERIFY: enter / emit VERIFY request for each segment in active chunk | ||
VERIFY --> REVERT: error / set result_code into SPEAKER_ERROR | ||
VERIFY --> REVERT_WAIT_PENDING: cancel / set result_code into CANCEL | ||
VERIFY --> INSTALL: chunk_complete | ||
VERIFY: speaker_response / handle speaker response | ||
VERIFY: speaker_response / [no more pending request && no error responses received] fire "chunk_complete" | ||
VERIFY: speaker_response / [no more pending request && error responses are present] fire "error" | ||
|
||
REVERT_WAIT_PENDING --> END: (chunk_complete | error) | ||
REVERT_WAIT_PENDING: speaker_response / handle speaker response | ||
REVERT_WAIT_PENDING: speaker_response / [no more pending request && no error responses received] fire "chunk_complete" | ||
REVERT_WAIT_PENDING: speaker_response / [no more pending request && error responses are present] fire "error" | ||
|
||
REVERT: enter / [! is revert enabled] fire "chunk_complete" | ||
REVERT: enter / assemble and activate revert chunk | ||
REVERT: enter / emit DELETE request for each segment in active chunk | ||
REVERT --> END: (chunk_complete | error) | ||
REVERT: speaker_response / handle speaker response | ||
REVERT: speaker_response / [no more pending request && no error responses received] fire "chunk_complete" | ||
REVERT: speaker_response / [no more pending request && error responses are present] fire "error" | ||
|
||
END: enter / [result code is null] set result_code into success | ||
END --> [*] | ||
@enduml |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
@startuml | ||
title Flow sync FSM state diagram | ||
|
||
[*] -> SETUP | ||
SETUP: enter / fire "error" if flow is IN_PROGRESS status | ||
SETUP: enter / set flow status to IN_PROGRESS | ||
SETUP: enter / apply postponed flow changes | ||
SETUP --> SYNC: next | ||
SETUP --> COMMIT_ERROR: error | ||
|
||
SYNC: enter / launch main path install operation | ||
SYNC: enter / [have protected path] launch protected path install operation | ||
SYNC --> SYNC_FAIL: sync_fail | ||
SYNC --> COMMIT_SUCCESS: guard_passed | ||
SYNC --> CANCEL: error | ||
SYNC --> CANCEL: timeout / report global timeout | ||
SYNC: path_operation_response / handle path operation response | ||
SYNC: path_operation_response / fire "sync_fail" on failed path response | ||
SYNC: path_operation_response / fire "guard_passed" if no more pending operations | ||
|
||
CANCEL: enter / request cancel path operation for all pending operations | ||
CANCEL --> COMMIT_ERROR: guard_passed | ||
CANCEL: path_operation_response / handle path operation response | ||
CANCEL: path_operation_response / fire "guard_passed" if no more pending operations | ||
CANCEL: error / fire "guard_passed" if no pending operations | ||
CANCEL: timeout / report global timeout | ||
|
||
SYNC_FAIL: enter / fire "guard_passed" if no pending operations | ||
SYNC_FAIL --> COMMIT_ERROR: guard_passed | ||
SYNC_FAIL --> CANCEL: error | ||
SYNC_FAIL --> CANCEL: timeout / report global timeout | ||
SYNC_FAIL: path_operation_response / handle path operation response | ||
SYNC_FAIL: path_operation_response / fire "guard_passed" if no more pending operations | ||
|
||
COMMIT_SUCCESS: enter / update flow status | ||
COMMIT_SUCCESS: enter / send success response | ||
COMMIT_SUCCESS --> FINISHED: next | ||
COMMIT_SUCCESS --> COMMIT_ERROR: error | ||
|
||
COMMIT_ERROR: enter / update flow status | ||
COMMIT_ERROR: enter / send failed response | ||
COMMIT_ERROR --> FINISHED_WITH_ERROR: next | ||
|
||
FINISHED --> [*] | ||
FINISHED_WITH_ERROR --> [*] | ||
@enduml |
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 |
---|---|---|
@@ -1,13 +1,19 @@ | ||
# Implementation details for RuleManager library | ||
|
||
Facade of RuleManager lib is implemented as an interface with two methods: | ||
1. buildRulesForPaths(SwitchId switchId, DataAdapter adapter) | ||
2. buildRulesForSwitch(PathId flowPathId, DataAdapter adapter) | ||
1. buildRulesForSwitch(SwitchId switchId, DataAdapter adapter) | ||
2. buildRulesForPath(FlowPath flowPath, boolean filterOutUsedSharedRules, DataAdapter adapter) | ||
3. buildRulesForYFlow(List<FlowPath> flowPaths, DataAdapter adapter) | ||
4. buildIslServiceRules(SwitchId switchId, int port, DataAdapter adapter) | ||
|
||
![Class diagram](class-diagram.png "class diagram") | ||
|
||
Different adapter implementations may query database or read a file under the hood. Each operation should use separate adapter because they may cache data for better performance. All required parameters are provided as constructor params and filled by the calling component. | ||
|
||
To generate service rules generators hierarchy (similar to current SwitchManager implementation) is used but the logic is moved from floodlight to RuleManager lib and result is in custom Command format. To generate flow related rules similar way is introduced. Custom Command format is close to OpenFlow format to simplify translation in speaker. | ||
|
||
From floodlight perspective 3 new SpeakerCommands added: InstallCommand, VerifyCommand and RemoveCommand. Each command contains only one Command. Commands should be sent to speaker one by one or using a batch grouped by target switch. Floodlight should translate custom Commands into loxigen OpenFlow representation, send it to devices and process results. RuleManager returns collection of Commands with dependencies and the calling component (Flow-HS or SwitchManager) is responsible for encapsulating and sending this commands into floodlight in right order and correct batch options. | ||
From floodlight perspective 3 new SpeakerCommands added: InstallSpeakerCommandsRequest, ModifySpeakerCommandsRequest and DeleteSpeakerCommandsRequest. Each request contains a collection of Commands of the same type (install/modify/delete). Commands inside collection may have dependepcies on each other. Requests should be sent to speaker one by one. Floodlight should build dependency tree, check it for errors (missing dependency, cycles etc), split collection to execution stages according to dependency, translate custom Commands into loxigen OpenFlow representation, send it to devices and process results. | ||
|
||
RuleManager returns collection of Commands and the calling component (Flow-HS/SwitchManager/Network) is responsible for encapsulating and sending this commands into floodlight in right order and correct batch options. | ||
|
||
![Install/delete service isl rules sequence diagram](isl-service-rules.png "Install/delete service isl rules sequence diagram") |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
@startuml | ||
title Service isl rules installation | ||
|
||
box "Network topology" #LightBlue | ||
participant NetworkIslService | ||
participant carrier | ||
participant IslRuleService | ||
participant RuleManager | ||
participant SpeakerRulesWorker | ||
end box | ||
control speaker.topic | ||
control network.speaker.topic | ||
participant Floodlight | ||
|
||
== Install service isl rules == | ||
|
||
NetworkIslService -> carrier : SpeakerRulesIslInstallCommand | ||
carrier -> IslRuleService : SpeakerRulesIslInstallCommand | ||
IslRuleService -> RuleManager : create isl service rules | ||
RuleManager -> IslRuleService : SpeakerData | ||
activate IslRuleService | ||
IslRuleService -> IslRuleService : form InstallSpeakerCommandsRequest | ||
IslRuleService -> carrier : InstallSpeakerCommandsRequest | ||
deactivate IslRuleService | ||
carrier -> SpeakerRulesWorker : InstallSpeakerCommandsRequest | ||
SpeakerRulesWorker -> speaker.topic : InstallSpeakerCommandsRequest | ||
speaker.topic -> Floodlight : InstallSpeakerCommandsRequest | ||
Floodlight -> network.speaker.topic : SpeakerCommandResponse | ||
network.speaker.topic -> SpeakerRulesWorker | ||
SpeakerRulesWorker -> carrier : SpeakerCommandResponse | ||
carrier -> IslRuleService : SpeakerCommandResponse | ||
IslRuleService -> carrier : IslDefaultRuleCreatedCommand | ||
carrier -> NetworkIslService : IslDefaultRuleCreatedCommand | ||
|
||
== Delete service isl rules == | ||
|
||
NetworkIslService -> carrier : SpeakerRulesIslRemoveCommand | ||
carrier -> IslRuleService : SpeakerRulesIslRemoveCommand | ||
IslRuleService -> RuleManager : create isl service rules | ||
RuleManager -> IslRuleService : SpeakerData | ||
activate IslRuleService | ||
IslRuleService -> IslRuleService : form DeleteSpeakerCommandsRequest | ||
IslRuleService -> carrier : DeleteSpeakerCommandsRequest | ||
deactivate IslRuleService | ||
carrier -> SpeakerRulesWorker : DeleteSpeakerCommandsRequest | ||
SpeakerRulesWorker -> speaker.topic : DeleteSpeakerCommandsRequest | ||
speaker.topic -> Floodlight : DeleteSpeakerCommandsRequest | ||
Floodlight -> network.speaker.topic : SpeakerCommandResponse | ||
network.speaker.topic -> SpeakerRulesWorker | ||
SpeakerRulesWorker -> carrier : SpeakerCommandResponse | ||
carrier -> IslRuleService : SpeakerCommandResponse | ||
IslRuleService -> carrier : IslDefaultRuleRemovedommand | ||
carrier -> NetworkIslService : IslDefaultRuleRemovedCommand | ||
|
||
@enduml |
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.