Skip to content

fix(api): Widen BGPRouter nodeID to the full 16-bit uSID field - #24

Merged
privateip merged 1 commit into
mainfrom
fix/bgprouter-nodeid-16-bit
Sep 21, 2026
Merged

privateip merged 1 commit into
mainfrom
fix/bgprouter-nodeid-16-bit

Conversation

@privateip

Copy link
Copy Markdown
Collaborator

Summary

BGPRouter's nodeID was capped at 254, an 8-bit bound the uSID carrier format outgrew long ago — Node-ID is a 16-bit field spanning 0x0001–0xDFFF, with 0xE000 and above reserved as Function space. Any allocation scheme that partitions Node-ID into sub-fields lands above 254 and was rejected outright at admission. The maximum now matches the carrier format, and the field's doc comment names its real width and reserved ranges.

The change is purely permissive, so every BGPRouter valid today stays valid.

Test plan

  • A BGPRouter with a nodeID above 254 is admitted
  • nodeID 0 and values above 57343 are still rejected

🤖 Generated with Claude Code

BGPRouterSpec.NodeID was declared an 8-bit slot -- kubebuilder Maximum=254, with a doc comment reading "Values 0 and 255 are reserved". The uSID carrier format it encodes has always treated Node-ID as a 16-bit field at bits 49-64; galactic's uformat.NodeIDMin/NodeIDMax are 0x0001-0xDFFF (0xE000-0xFFFF is the LIB, Function space rather than Node-ID space). The CRD was simply never updated when the field widened, so the API has been rejecting three quarters of the assignable range.

This blocks any allocation scheme that partitions Node-ID into sub-fields. Splitting it into a 4-bit service selector plus a 12-bit node index -- so one node can hold a tenant-delivery identity, a NAT egress shard and an edge gateway without the three colliding on the /64 that ownership is decided at -- puts the very first delivery Node-ID at 0x1001, or 4097. Against the old bound every such router failed admission outright:

  The BGPRouter "galactic-router" is invalid: spec.nodeID: Invalid value: 4097:
  spec.nodeID in body should be less than or equal to 254

Raise Maximum to 57343 (0xDFFF) to match uformat, and rewrite the doc comment to name the field's real width and the ranges the carrier format reserves. Minimum stays 1: Node-ID 0x0000 is invalid. The change is purely permissive, so no existing BGPRouter becomes invalid under it.

Regenerated config/crd/ and docs/api/ via task generate.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@privateip
privateip requested a review from a team as a code owner September 21, 2026 19:51
@privateip
privateip merged commit 82863ca into main Sep 21, 2026
6 checks passed
@privateip
privateip deleted the fix/bgprouter-nodeid-16-bit branch September 21, 2026 20:04
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.

2 participants