Repository navigation
[WIP] Modular Router Configuration - #386
Draft
nicolaskagami wants to merge 5 commits into
Draft
nicolaskagami wants to merge 5 commits into
nicolaskagami wants to merge 5 commits into
Conversation
nicolaskagami
force-pushed
the
nsk/662-modular-router-config
branch
2 times, most recently
from
October 9, 2026 19:37
d1af7ab to
d89bf67
Compare
nicolaskagami
force-pushed
the
nsk/662-modular-router-config
branch
from
October 16, 2026 17:19
d89bf67 to
21a3967
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.
Context
In order to implement RFD 662 - Modular Router Configuration, the switch needs to support separate routing contexts. For context, RFD 404 - Boundary Tunnel Routing defines how we use tunneling to achieve external reachability. We're modularizing external reachability (for tunneled traffic), not implementing VRFs.
This PR focuses on separating these routing contexts while keeping strong backwards compatibility. We'll now support multiple TEP endpoints, each redirecting to a separate router configuration (endpoint selection is done in OPTE). A "default" routing context is kept for backwards compatibility, allowing legacy APIs to remain functional. Thus, it's still used for both underlay routing and the default router configuration (which we'll likely want to remove later).
Internal Changes
route_index) are enriched with anexactmatch onrouting_table_id, used to select the routing context (lpm->(exact, lpm)).routing_table_idlives entirely inside dendrite, associated with the router configuration uuid provided by the control plane.meta.routing_table_id(8 bits) is added to ingress metadata and defaults to0.claimv6action now takes arouting_table_idand associates the registered address (TEP endpoint or other loopback) with it, enriching the packet metadata. Non-default tunnel endpoints use ids 1-255. Default endpoints and underlay use 0.IPV4_LPM_SIZE.IPV6seems to be unaffected.API Changes
(v14,
VERSION_MULTI_ROUTER)Routers
/routerBTreeMap<Uuid, Ipv6Addr>/router/{router_id}Ipv6Addr/router/{router_id}Ipv6Addr/router/{router_id}Routes
/router/{router_id}/route/{ip_family}/router/{router_id}/route/{ip_family}/{cidr}/router/{router_id}/route/{ip_family}/router/{router_id}/route/{ip_family}/router/{router_id}/route/{ip_family}/{cidr}/router/{router_id}/route/{ip_family}/{cidr}/{port_id}/{link_id}/{tgt_ip}Architectural decisions (in decreasing order of confidence)
routing_table_idlives indpd, not defined by the control plane (or derived from the uuid): This has many benefits, such as not introducing needless coupling, allowing switches to have different IDs and capacities in the long run and not limiting the total number of routing configurations to the minimum number any switch can support. For example, we could easily reassign the routing tables for different purposes in the future without breaking compatibility with the current API./route/*returns both underlay and default router routes.router_idname clashes with the Router ID concept. While it's identifying a (logical) router's context, it invites the wrong inference regarding its lifetime and purpose.default routercould be called thesystem routing tableor something else.TunnelEndpointsinstead of "routers".RoutersinsideRouteDataso they share a lock because otherwise I'd have to hold an async lock through await points because, for some reason,RouteDatais locked with an async lock. Loopbacks now also have a slight dependence on this data, which just means it needs to be locked in order. There are many improvements one can do to the overall structure depending on how we want to deal with endpoints x loopbacks. The current approach is trying to impose as few new architectural decisions as possible.companion sidecar-lite branch: nsk/662-modular-router-config