Refine routing control-plane participation semantics#552
Closed
zzw4257 wants to merge 11 commits into
Closed
Conversation
…rticipation create rr_design
…rticipation update rr_design
…rticipation update rr_design
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.
Summary
This PR implements the first routing-control-plane evolution slice on top of the latest
developmentbranch. The goal is to make SEED express a key control-plane question more explicitly:The legacy behavior is preserved by default. New realism-oriented behavior is opt-in and built around explicit participation, router roles, and shared routing metadata, so existing IPv4/BIRD examples keep their historical semantics while larger or higher-fidelity topologies can avoid making every internal router an iBGP participant.
Why
The previous default iBGP model was convenient for examples, but too implicit for realistic transit networks: every internally reachable router could be pulled into full-mesh iBGP. That means core routers can end up carrying BGP external routes even when the intended design is edge-only iBGP, route reflection, explicit peering, or MPLS-style core isolation.
This PR does not replace the old model. It turns the old model into an explicit compatibility mode and adds the APIs needed for new examples and benchmark topologies to state their routing intent precisely.
Key Changes
Router role hints
Router.setControlPlaneRole("edge|core|rr|rr-client").Router.getControlPlaneRole().Router.disableControlPlane("ibgp")for per-router participation exclusion.iBGP participation modes
Ibgp()still defaults to the historical full-mesh behavior.New opt-in AS modes:
legacy-full-mesh: existing behavior, preserved as the default.edge-full-mesh: only declared participants or routers with roleedgeparticipate.route-reflector: only explicit cluster/RR members participate; unclustered core routers do not silently join.explicit: only declaredaddSession()pairs render iBGP sessions.disabled: disables iBGP for the AS, aligned with existing masking semantics.All generated sessions still go through
_bgp_metadata.install_router_bgp_session(), andRoutingremains responsible for rendering BIRD/FRR config.OSPF classification mode
Adds opt-in
Ospf.setAsMode(asn, "router-transit-only"):markAsStub()andmaskNetwork()keep priority;legacyOSPF behavior is unchanged.This keeps OSPF focused on internal reachability while avoiding noisy active OSPF on host-facing networks in new realistic examples.
Explicit eBGP IX router selection
Adds APIs for multi-router IX topologies:
Ebgp.addPrivatePeeringByRouters(ix, a, aRouter, b, bRouter, ...)Ebgp.addRsPeerByRouter(ix, peer, routerName)addPrivatePeering(..., aRouter=..., bRouter=...)andaddRsPeer(..., routerName=...).The old API path still resolves the first matching IX router for backward compatibility. The new APIs make the intended edge router explicit when an AS has multiple routers connected to the same IX.
MPLS BGP intent convergence
Mplsfor this PR; full MPLS renderer migration is intentionally out of scope.Compileall cleanup
.pyto.shand updates the template loader.utility_server_setup.sh; this only preventspython -m compileall seedemufrom trying to compile a bash script.Design Boundaries
This PR intentionally does not:
Routing.Those are separate design slices. This PR focuses on participation semantics and safe intent convergence.
Compatibility Notes
Ibgp()behavior remains legacy full mesh.Ospf()behavior remains legacy broad Local-network OSPF.Ebgp.addPrivatePeering()andaddRsPeer()continue to work without new arguments.Routingfrom shared metadata.Validation
Local validation completed:
Review Focus
Recommended review order:
seedemu/layers/Ibgp.py: default compatibility and new participation modes.seedemu/core/Node.py: router role and per-router iBGP disable API.seedemu/layers/Ebgp.py: explicit IX router selection without breaking legacy selection.seedemu/layers/Ospf.py: opt-in router-transit-only classification.seedemu/layers/Mpls.py: BGP intent moved into shared metadata while LDP/OSPF remains scoped to MPLS.test_frr_exabgp_foundation.py: behavior-level guard tests for default compatibility and new modes.