Skip to content

Conversation

@maxime-leroy
Copy link
Contributor

Extend the srv6 sid CLI to support non-uSID SRv6 endpoint behaviors (End, End_X, End_DT6, End_DT4, End_DT46), including VRF/interface/nexthop handling when applicable. The CLI keyword End_X represents the SRv6 End.X behavior (dot replaced by underscore for CLI token parsing).

Extend the `srv6 sid` CLI to support non-uSID SRv6 endpoint behaviors
(End, End_X, End_DT6, End_DT4, End_DT46), including VRF/interface/nexthop
handling when applicable. The CLI keyword `End_X` represents the SRv6
End.X behavior (dot replaced by underscore for CLI token parsing).

Signed-off-by: Maxime Leroy <[email protected]>
@maxime-leroy maxime-leroy force-pushed the staticd_srv6_non_usid branch from a70eca9 to 177ecdc Compare December 4, 2025 10:32
Copy link
Member

@ton31337 ton31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documention update is needed too?

@maxime-leroy
Copy link
Contributor Author

Indeed, a documentation update is needed.

Anyway, it turns out the situation is more complex than expected after further testing.
The show segment-routing srv6 sid command does not behave the same when the locator has behavior usid configured versus when it doesn’t.

Example with behavior usid on the locator:

f915aef81415# configure
f915aef81415(config)# segment-routing
f915aef81415(config-sr)# srv6
f915aef81415(config-srv6)# static-sids
f915aef81415(config-srv6-sids)# sid fcbb:bbbb:1:fe01::/64 locator LOC1 behavior uDT4 vrf Vrf1
f915aef81415(config-srv6-sids)# exit
f915aef81415(config-srv6)# locators
f915aef81415(config-srv6-locators)# locator LOC1
f915aef81415(config-srv6-locator)# prefix fcbb:bbbb:1::/48
f915aef81415(config-srv6-locator)# behavior usid
f915aef81415(config-srv6-locator)# do show segment-routing srv6 sid
SID Behavior Context Daemon/Instance Locator AllocationType


fcbb:bbbb:1:fe01:: uDT4 VRF 'Vrf1' static(0) LOC1 explicit

Example without behavior usid on the locator

f915aef81415# configure
f915aef81415(config)# segment-routing
f915aef81415(config-sr)# srv6
f915aef81415(config-srv6)# static-sids
f915aef81415(config-srv6-sids)# sid fcbb:bbbb:1:fe01::/64 locator LOC1 behavior uDT4 vrf Vrf1
f915aef81415(config-srv6-sids)# exit
f915aef81415(config-srv6)# locators
f915aef81415(config-srv6-locators)# locator LOC1
f915aef81415(config-srv6-locator)# do show segment-routing srv6 sid
SID Behavior Context Daemon/Instance Locator AllocationType


fcbb:bbbb:1:fe01:: End.DT4 VRF 'Vrf1' static(0) LOC1 explicit

Internally, do_show_srv6_sid_json() uses different functions to format the SID behavior depending on whether the locator uses a uSID SID format:

447│ json_object_string_addf(json_sid, "sid", "%pI6", &entry->sid_value);
448├───────────────> if ((entry->locator->sid_format &&
449│ entry->locator->sid_format->type == SRV6_SID_FORMAT_TYPE_USID) ||
450│ (!entry->locator->sid_format &&
451│ CHECK_FLAG(entry->locator->flags, SRV6_LOCATOR_USID))) {
452│ json_object_string_add(json_sid, "behavior",
453│ show_srv6_sid_seg6_action(sid_ctx->ctx.behavior));
454│ } else {
455│ json_object_string_add(json_sid, "behavior",
456│ seg6local_action2str(sid_ctx->ctx.behavior));
457│ }

However, in zebra, the installed nexthop always uses the NEXT_CSID flavor.

So currently staticd always tries to install SIDs as uSID format, regardless of the locator.

To properly support non-uSID locators, we have two possible approaches:

Option A — Automatic behavior selection

  • If the locator is not uSID → automatically use classic End.DT4
  • If the locator is uSID → automatically use uDT4

Option B — Strict validation

  • Reject mismatched combinations such as:
    • uDT4 with a non-uSID locator
    • End.DT4 with a uSID locator

Another issue: CLI parsing prevents the use of a dot (.) in non-uSID behaviors (e.g., End.DT4).
I had to temporarily switch to an alternative form (e.g., End_DT4) but changing WORD in the lexer breaks other commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants