Skip to content

controller: implement IS-IS flex-algo config and BGP color stamping (RFC-18, PR 3/4)#3476

Draft
ben-malbeclabs wants to merge 11 commits intobc/rfc18-activatorfrom
bc/rfc18-controller
Draft

controller: implement IS-IS flex-algo config and BGP color stamping (RFC-18, PR 3/4)#3476
ben-malbeclabs wants to merge 11 commits intobc/rfc18-activatorfrom
bc/rfc18-controller

Conversation

@ben-malbeclabs
Copy link
Copy Markdown
Contributor

@ben-malbeclabs ben-malbeclabs commented Apr 7, 2026

Summary of Changes

  • Adds features.yaml config file support (--features-config flag on the controller). A flex_algo.enabled flag gates all flex-algo config generation; when disabled, the controller produces identical output to today.
  • When enabled, the controller generates IS-IS TE admin-group assignments on link interfaces (one per topology the link belongs to), flex-algo topology definitions in IS-IS, and system-colored-tunnel-rib as the BGP next-hop resolution source.
  • BGP user tunnel route-maps now stamp the appropriate extcommunity color (derived from the tunnel's topology assignment) when a tenant has include_topologies set, subject to per-tenant and per-device allow/exclude lists in features.yaml.
  • Vpnv4 loopback config gains node-segment ipv4 index lines for each flex-algo, sourced from segment routing IDs backfilled by the activator.
  • Adds two golden fixture files (base.config.flex-algo.txt, base.config.flex-algo-disabled.txt) replacing string-based assertions in render tests.
  • Updates the Go SDK serviceability client to expose topology data needed by the controller.

Stacked PRs: This is PR 3/4. Depends on #3474 (smartcontract). Can merge in either order relative to #3475 (activator). #3477 (e2e) depends on this.

RFC: rfcs/rfc18-link-classification-flex-algo.md

Diff Breakdown

Category Files Lines (+/-) Net
Core logic 5 +310 / -20 +290
Tests 3 +243 / -12 +231
Fixtures 21 +540 / -0 +540
Scaffolding 1 +8 / -0 +8

Fixture-heavy: golden config files for flex-algo enabled/disabled cases replace ~200 lines of string assertions.

Key files (click to expand)
  • controlplane/controller/internal/controller/server.go — core config generation: admin-group tagging, flex-algo topology blocks, color community stamping, node-segment lines
  • controlplane/controller/internal/controller/templates/tunnel.tmpl — IS-IS admin-group, flex-algo, colored-tunnel-rib, and BGP color extcommunity route-maps
  • controlplane/controller/internal/controller/features_config.goFeaturesConfig struct with flex_algo.enabled, per-tenant/device stamping allowlists, link exclude lists
  • controlplane/controller/internal/controller/models.go — new fields surfacing topology and node-segment data for template rendering
  • controlplane/controller/cmd/controller/main.go--features-config flag wiring and startup logging
  • controlplane/controller/fixtures/base.config.flex-algo.txt — golden fixture: full flex-algo config output
  • controlplane/controller/fixtures/base.config.flex-algo-disabled.txt — golden fixture: config with flex-algo disabled (identical to today)

Testing Verification

  • go test ./controlplane/controller/... passes
  • Render tests use golden fixture comparison against both enabled and disabled fixtures, verifying template output exactly
  • features_config_test.go covers YAML parsing including empty/partial configs and defaults
  • Note: cEOS does not populate the colored tunnel RIB (works on physical hardware); template correctness is verified via golden fixtures rather than live cEOS state

  set extcommunity color {{ .TenantTopologyColors }} produced
  "set extcommunity color color 1" because TenantTopologyColors already
  includes the "color N" prefix. Removed the redundant "color" keyword
  from the template.

  Converted flex-algo render tests from substring assertions to golden
  fixtures with -update flag regeneration. Added four scenarios: single
  topology, multi-topology (unicast-default + high-bandwidth + CYOA),
  unicast-drained, and link-excluded.
…ace V3, and startup check

  - Emit no router traffic-engineering / no traffic-engineering / no next-hop
    resolution ribs when flex_algo.enabled is false (RFC-18 revert requirement)
  - Render flex-algo definition block for Exclude-constraint topologies
  - Fix internal Go SDK to correctly deserialize InterfaceV3
  - Block flex-algo config push when any VPNv4 loopback is missing node-segment
    data instead of just logging
  flex-algo string-check tests with golden fixtures
@ben-malbeclabs ben-malbeclabs marked this pull request as draft April 8, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant