[refactor] decouple routingServer into BGPWatcher, BGPHandler and routingHandler - #800
Open
aritrbas wants to merge 1 commit into
Open
[refactor] decouple routingServer into BGPWatcher, BGPHandler and routingHandler#800aritrbas wants to merge 1 commit into
aritrbas wants to merge 1 commit into
Conversation
aritrbas
marked this pull request as draft
September 24, 2025 05:53
aritrbas
force-pushed
the
abasu-split-routing
branch
from
October 2, 2025 19:27
e85057b to
b19dd0a
Compare
aritrbas
changed the base branch from
nsk-split-svc
to
abasu-peers-watcher-rem-pubsub
October 2, 2025 19:28
aritrbas
force-pushed
the
abasu-split-routing
branch
3 times, most recently
from
October 8, 2025 04:27
45f1afe to
b6d1d35
Compare
aritrbas
marked this pull request as ready for review
October 8, 2025 04:27
aritrbas
marked this pull request as draft
October 9, 2025 15:33
aritrbas
force-pushed
the
abasu-peers-watcher-rem-pubsub
branch
2 times, most recently
from
October 10, 2025 00:20
ffb8c29 to
eb5adeb
Compare
aritrbas
force-pushed
the
abasu-split-routing
branch
from
October 14, 2025 22:49
b6d1d35 to
d231e16
Compare
aritrbas
marked this pull request as ready for review
October 14, 2025 22:53
aritrbas
force-pushed
the
abasu-split-routing
branch
from
October 14, 2025 23:11
d231e16 to
3a7370a
Compare
aritrbas
force-pushed
the
abasu-peers-watcher-rem-pubsub
branch
from
October 23, 2025 22:34
eb5adeb to
d64a12d
Compare
aritrbas
force-pushed
the
abasu-split-routing
branch
from
October 24, 2025 18:36
3a7370a to
1214464
Compare
aritrbas
force-pushed
the
abasu-peers-watcher-rem-pubsub
branch
2 times, most recently
from
May 20, 2026 00:15
4cc6f82 to
7041ac6
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+gh@cisco.com>
aritrbas
force-pushed
the
abasu-split-routing
branch
from
May 20, 2026 04:36
1214464 to
d048e8c
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]Made the changes on top of the abasu-peers-watcher-rem-pubsub branch for now, will rebase on top of master once those commits for single thread agent are merged.