Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

staticd: Add support for SRv6 Static SIDs #16894

Merged
merged 15 commits into from
Jan 20, 2025

Conversation

Yubin-Li
Copy link

@Yubin-Li Yubin-Li commented Sep 23, 2024

SRv6 is already supported in IS-IS and BGP. In this PR we extend staticd to support static allocation for SRv6 SIDs.

CLI example:

segment-routing
  srv6
    static-sids:
      sid fcbb:bbbb:1:fe01::/64 locator LOC1 behavior uDT4 vrf Vrf1

Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the rebase PR needs rebase label Sep 23, 2024
@donaldsharp
Copy link
Member

This should be broken up in to a bunch of smaller commits, with detailed explanations of what each commit is doing and why. Additionally I see white space changes that make it even harder to figure out what is going on. They should be removed.

@donaldsharp
Copy link
Member

Additionally this is not going to be even looked at until we have a topology test as well as documentation for the new functionality

@zice312963205 zice312963205 force-pushed the project-phoenixwing-ysj branch from 113f49b to 9d52e4a Compare November 23, 2024 14:18
@frrbot frrbot bot added the zebra label Nov 23, 2024
@Yubin-Li Yubin-Li changed the title add CLI about locator, related funcs and KERNELBYPASS flag on dplane_ctx Add CLI about locator and related funcs Nov 25, 2024
@frrbot frrbot bot added documentation libfrr tests Topotests, make check, etc labels Nov 27, 2024
@github-actions github-actions bot added size/XL and removed size/L labels Nov 27, 2024
@GaladrielZhao GaladrielZhao force-pushed the project-phoenixwing-ysj branch 3 times, most recently from 2c51a1d to 64739c5 Compare November 27, 2024 09:32
@GaladrielZhao
Copy link
Contributor

It seems some useless messages are transmitted to ZEBRA, at SID configuration. As if a RELEASE command was initially sent. I think if it is STATICD that sends this RELEASE message, then it can be avoided because no SIDs have really been allocated. I propose to add some defines to the flag value of the static sids:

  • ALLOCATED would mean that the SID is allocated, and the presence of the flag means do not send GET_SID. Reversely, if the flag is not present, no need to send RELEASE_SID.
> ubuntu2204hwe(config)# debu zebra srv6 
> ubuntu2204hwe(config)# segment-routing 
> ubuntu2204hwe(config-sr)# srv6 
> ubuntu2204hwe(config-srv6)# locators 
> ubuntu2204hwe(config-srv6-locators)# locator LOC1
> ubuntu2204hwe(config-srv6-locator)# prefix 2001:db8::/48 
> ubuntu2204hwe(config-srv6-locator)# 2025/01/14 18:22:15 ZEBRA: [GKXY5-0G3W3] zebra_srv6_locator_format_set: Locator LOC1 format has changed, old=(null) new=(null)
> 2025/01/14 18:22:15 ZEBRA: [V0V6Q-AWJNG] zebra_srv6_locator_format_set: Locator LOC1 format has changed, send SRV6_LOCATOR_DEL notification to zclients
> 2025/01/14 18:22:15 ZEBRA: [HMET0-FQF78] zebra_srv6_locator_format_set: Locator LOC1 format has changed, send SRV6_LOCATOR_ADD notification to zclients
> ubuntu2204hwe(config-srv6-locator)# format usid-f3216 
> 2025/01/14 18:22:30 ZEBRA: [GKXY5-0G3W3] zebra_srv6_locator_format_set: Locator LOC1 format has changed, old=usid-f3216 new=usid-f3216
> 2025/01/14 18:22:30 ZEBRA: [V0V6Q-AWJNG] zebra_srv6_locator_format_set: Locator LOC1 format has changed, send SRV6_LOCATOR_DEL notification to zclients
> 2025/01/14 18:22:30 ZEBRA: [HMET0-FQF78] zebra_srv6_locator_format_set: Locator LOC1 format has changed, send SRV6_LOCATOR_ADD notification to zclients
> ubuntu2204hwe(config-srv6-locator)# end
> ubuntu2204hwe# conf
> ubuntu2204hwe(config)# segment-routing 
> ubuntu2204hwe(config-sr)# srv6 
> ubuntu2204hwe(config-srv6)# static-sids 
> ubuntu2204hwe(config-srv6-sids)# sid 2001:db8:fa00::/128 locator LOC1 behavior uDT4 vrf l3vrf1
> 2025/01/14 18:23:22 ZEBRA: [K8TFR-FJKD5] zebra message[ZEBRA_SRV6_MANAGER_RELEASE_SRV6_SID:default:42] comes from socket [30]
> 2025/01/14 18:23:22 ZEBRA: [H5D45-JW3Y6] Read 1 packets from client: static(30). Current ibuf fifo count: 1. Conf P2p 1000
> 2025/01/14 18:23:22 ZEBRA: [K8TFR-FJKD5] zebra message[ZEBRA_SRV6_MANAGER_RELEASE_SRV6_SID:default:42] comes from socket [30]
> 2025/01/14 18:23:22 ZEBRA: [K8TFR-FJKD5] zebra message[ZEBRA_SRV6_MANAGER_RELEASE_SRV6_SID:default:42] comes from socket [30]
> 2025/01/14 18:23:22 ZEBRA: [K8TFR-FJKD5] zebra message[ZEBRA_SRV6_MANAGER_GET_SRV6_SID:default:65] comes from socket [30]
> 2025/01/14 18:23:22 ZEBRA: [H5D45-JW3Y6] Read 3 packets from client: static(30). Current ibuf fifo count: 3. Conf P2p 1000
> 2025/01/14 18:23:22 ZEBRA: [M7N57-4RGGY] srv6_manager_release_sid_internal: releasing SRv6 SID associated with ctx unspec
> 2025/01/14 18:23:22 ZEBRA: [P6HBA-5AM85] srv6_manager_release_sid_internal: no SID associated with ctx unspec
> 2025/01/14 18:23:22 ZEBRA: [QGJBT-YJ11W] zsend_srv6_sid_notify: notifying ZEBRA_SRV6_SID_NOTIFY ctx unspec sid (null) note ZAPI_SRV6_SID_FAIL_RELEASE (proto=4, instance=0, sessionId=0)
> 2025/01/14 18:23:22 ZEBRA: [M7N57-4RGGY] srv6_manager_release_sid_internal: releasing SRv6 SID associated with ctx End.DT4 vrf_id 0
> 2025/01/14 18:23:22 ZEBRA: [P6HBA-5AM85] srv6_manager_release_sid_internal: no SID associated with ctx End.DT4 vrf_id 0
> 2025/01/14 18:23:22 ZEBRA: [QGJBT-YJ11W] zsend_srv6_sid_notify: notifying ZEBRA_SRV6_SID_NOTIFY ctx End.DT4 vrf_id 0 sid (null) note ZAPI_SRV6_SID_FAIL_RELEASE (proto=4, instance=0, sessionId=0)
> 2025/01/14 18:23:22 ZEBRA: [M7N57-4RGGY] srv6_manager_release_sid_internal: releasing SRv6 SID associated with ctx End.DT4 vrf_id 0
> 2025/01/14 18:23:22 ZEBRA: [P6HBA-5AM85] srv6_manager_release_sid_internal: no SID associated with ctx End.DT4 vrf_id 0
> 2025/01/14 18:23:22 ZEBRA: [QGJBT-YJ11W] zsend_srv6_sid_notify: notifying ZEBRA_SRV6_SID_NOTIFY ctx End.DT4 vrf_id 0 sid (null) note ZAPI_SRV6_SID_FAIL_RELEASE (proto=4, instance=0, sessionId=0)
> 2025/01/14 18:23:22 ZEBRA: [MZYPC-GBDGR] srv6_manager_get_sid_internal: getting SRv6 SID for ctx End.DT4 vrf_id 8, sid_value=2001:db8:fa00::, locator_name=LOC1
> 2025/01/14 18:23:22 ZEBRA: [XMBTQ-GE6EY] get_srv6_sid: received SRv6 SID alloc request: SID ctx End.DT4 vrf_id 8 (2001:db8:fa00::), mode=explicit
> 2025/01/14 18:23:22 ZEBRA: [XWV20-TGK70] alloc_srv6_sid_func_explicit: trying to allocate explicit SID function 0 from block 2001:db8::/32
> 2025/01/14 18:23:22 ZEBRA: [QGHMB-SWNFW] alloc_srv6_sid_func_explicit: function 0 is outside ELIB [65024/65279] and EWLIB alloc ranges [65527/65527]
> 2025/01/14 18:23:22 ZEBRA: [GKEYQ-X8WG5] get_srv6_sid_explicit: allocated explicit SRv6 SID 2001:db8:fa00:: for context End.DT4 vrf_id 8
> 2025/01/14 18:23:22 ZEBRA: [XBBYD-T1Q7P] srv6_manager_get_sid_internal: got new SRv6 SID for ctx End.DT4 vrf_id 8: sid_value=2001:db8:fa00:: (func=0) (proto=4, instance=0, sessionId=0), notifying all clients
> 2025/01/14 18:23:22 ZEBRA: [QGJBT-YJ11W] zsend_srv6_sid_notify: notifying ZEBRA_SRV6_SID_NOTIFY ctx End.DT4 vrf_id 8 sid 2001:db8:fa00:: note ZAPI_SRV6_SID_ALLOCATED (proto=4, instance=0, sessionId=0)
> ubuntu2204hwe(config-srv6-sids)# 2025/01/14 18:23:22 ZEBRA: [K8TFR-FJKD5] zebra message[ZEBRA_ROUTE_ADD:default:92] comes from socket [30]
> 2025/01/14 18:23:22 ZEBRA: [H5D45-JW3Y6] Read 1 packets from client: static(30). Current ibuf fifo count: 1. Conf P2p 1000
> 2025/01/14 18:23:22 ZEBRA: [J2S20-9B267] zread_route_add: p=(default:0)2001:db8:fa00::/128, msg flags=0x1, flags=0x1
> 2025/01/14 18:23:22 ZEBRA: [Q0JWX-M7WW7] zapi_read_nexthops: adding seg6local action End.DT4
> 2025/01/14 18:23:22 ZEBRA: [NFFEX-16SYW] zapi_read_nexthops: nh=if 8, vrf_id=0 
> 2025/01/14 18:23:22 ZEBRA: [HZ1TW-92EY6] Notifying Owner: static about prefix 2001:db8:fa00::/128(254) 2 vrf: 0
>

@pguibert6WIND We added flags to avoid sending useless messages.

@GaladrielZhao GaladrielZhao force-pushed the project-phoenixwing-ysj branch 2 times, most recently from c13fbcd to 41f7b84 Compare January 17, 2025 12:20
@zice312963205
Copy link
Contributor

LGTM

@pguibert6WIND
Copy link
Member

ci:rerun

@pguibert6WIND
Copy link
Member

The code is ok to me. lets wait last change about yang description field before turning on approval.
thanks

Copy link
Contributor

@zice312963205 zice312963205 left a comment

Choose a reason for hiding this comment

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

LGTM

This commit adds datastructures and helper functions required to support SRv6 in staticd.

* List of locators
* List of SIDs
* Data structure to represent an SRv6 SID
* Functions to allocate/deallocate an SRv6 SID
* Functions to allocate, deallocate and lookup a locator
* Function to initialize/Cleanup SRv6

Signed-off-by: Yuqing Zhao <[email protected]>
This commit moves DEFAULT_SRV6_IFNAME from isis_srv6.h to srv6.h
because there are other daemons that might want to use it (e.g. staticd).

Signed-off-by: Yuqing Zhao <[email protected]>
Add Northbound APIs to create/modify/destroy an SRv6 SID

Signed-off-by: Yuqing Zhao <[email protected]>
Add the srv6 static sids configuration and
show running-config sections in static.rst.

Signed-off-by: Yuqing Zhao <[email protected]>
@GaladrielZhao GaladrielZhao force-pushed the project-phoenixwing-ysj branch from 41f7b84 to f56a773 Compare January 18, 2025 10:30
@GaladrielZhao
Copy link
Contributor

The code is ok to me. lets wait last change about yang description field before turning on approval. thanks

@pguibert6WIND Thanks very much. We pushed the code with the required changes.

Copy link
Contributor

@cscarpitta cscarpitta left a comment

Choose a reason for hiding this comment

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

LGTM

@pguibert6WIND pguibert6WIND merged commit 084ebc9 into FRRouting:master Jan 20, 2025
11 checks passed
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.

9 participants