-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example Declarative Configuration for establishing BGP session using GoBGP #19
Conversation
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 fake gNMI server simply mirrors whatever is set for its config leafs in its state leafs. It also has a mechanism for adding new "tasks", or go thread agents that can subscribe to particular values in ONDATRA's OpenConfig tree and write back values to it. See gnmi/main/README.md for running/testing the server.
…ONDATRA. Set's implementation is simplified due to removal of hacks to deal with ONDATRA's idiosyncratic GoStructs not suitable for the reference implementation, which has to work with them extensively.
ONDATRA's idiosyncratic GoStructs are not suitable for use with the reference implementation, because it prefers state over config, and uses shadow paths, which is a feature that has limited support, which in turn makes working with it awkward.
For a working test sample see feature/bgp/bgp_base/tests/bgp_establish_test.go, note you will need some changes in the Ondatra and KNE repos to get this working.
Pull Request Test Coverage Report for Build 2958845816
💛 - Coveralls |
Workaround required to ignore staticcheck rules: golangci/golangci-lint#741 |
DanG100
reviewed
Aug 30, 2022
DanG100
reviewed
Aug 30, 2022
DanG100
approved these changes
Aug 30, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
goBgpTask's doc comments discusses the design for declarative configuration for GoBGP. It is similar in idea to GoBGP's implementation for declarative configuration using its own config language (instead of OpenConfig/gNMI):
https://github.com/osrg/gobgp/blob/a5bb236b0d8d2a976bea8c62ffb2ab5c70ed6e9d/pkg/config/config.go#L367
Unfortunately I can't get the connection to be established yet. It only goes to "ACTIVE".
Incidentally, GoBGP actually uses an old version of OpenConfig for its configuration, although it uses its own custom Go binding instead of ygot based on viper. We may want to use this when we're actually implementing GoBGP to avoid re-inventing the wheel. For other protocols we will need our own implementation since GoBGP's implementation is very BGP specific. See the "Assumptions:" section below to see my concerns for why we might want something different.