[refactor] decouple routingServer into BGPWatcher, BGPHandler and routingHandler#800
Open
aritrbas wants to merge 1 commit intoabasu-peers-watcher-rem-pubsubfrom
Open
[refactor] decouple routingServer into BGPWatcher, BGPHandler and routingHandler#800aritrbas wants to merge 1 commit intoabasu-peers-watcher-rem-pubsubfrom
aritrbas wants to merge 1 commit intoabasu-peers-watcher-rem-pubsubfrom
Conversation
e85057b to
b19dd0a
Compare
45f1afe to
b6d1d35
Compare
ffb8c29 to
eb5adeb
Compare
b6d1d35 to
d231e16
Compare
d231e16 to
3a7370a
Compare
eb5adeb to
d64a12d
Compare
…ingHandler The refactoring splits the monolithic routingServer into three focused components: i) BGPWatcher - observes GoBGP RIB state ii) BGPHandler - handles BGP protocol business logic iii) RoutingHandler - handles route installation business logic There is a clear separation of monitoring (BGPWatcher) and business logic: i) GoBGP programming via the BGPHandler ii) Linux Kernel programming via the routingHandler iii) VPP programming via the connectivityHandler Signed-off-by: Aritra Basu <aritrbas@cisco.com>
3a7370a to
1214464
Compare
This file contains hidden or 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
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.
Overview
routingServerwith mixed responsibilities:routingServerinto three focused components:Summary of Components:
1. BGPWatcher (
watchers/bgp_watcher.go)BGPHandler)BGPHandler2. BGPHandler (
felix/routing/bgp_handler.go)RoutingHandler):Connectivityevents)SRv6Policyevents)ConnectivityAdded- Route learned from BGP peerConnectivityDeleted- Route withdrawn by BGP peerSRv6PolicyAdded- SRv6 tunnel route learnedSRv6PolicyDeleted- SRv6 tunnel route withdrawn3. RoutingHandler (
felix/routing/routing_handler.go)BGPHandler):BGPPathevents →BGPHandler→GoBGP server)BGPPathAdded- Local prefix to announceBGPPathDeleted- Local prefix to withdraw4. PeerHandler (
felix/routing/peer_handler.go)BGPHandler)BGPPeerevents →BGPHandler→GoBGP server)BGPPeerAdded- New peer to configureBGPPeerUpdated- Peer configuration changedBGPPeerDeleted- Peer to remove5. ConnectivityHandler (
felix/connectivity/connectivity_handler.go)Event-Driven Architecture
The refactoring introduces a clean event-driven pattern:
Event Flow
All BGP related events now flow through Felix server's event loop:
New Events Registered
The following events are now registered in
felix_server.goand handled inhandleFelixServerEvents():Separation of Watching vs Business Logic
Watching Logic (Observation)
Business Logic (Decision & Execution)
BGPHandler]BGPHandler]