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

Add support for SRv6 SID Manager #15604

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

cscarpitta
Copy link
Contributor

In the current FRR implementation, the SRv6 locator can only be used by one client at a time. This PR adds support for the SRv6 SID Manager, a zebra component responsible for SID allocation/management. The SRv6 SID Manager exposes a SID allocation/release APIs, allowing clients to request and release an SRv6 SID. The SID manager allows the SRv6 Locator to be shared among many clients such as IS-IS, BGP and others. The PR extends the BGP, IS-IS daemons to communicate with the SRv6 SID Manager to allocate/release SRv6 SIDs.

The SID Manager supports two SRv6 SID allocation schemes:

@frrbot frrbot bot added bgp isis libfrr tests Topotests, make check, etc vtysh zebra labels Mar 22, 2024
@cscarpitta cscarpitta force-pushed the srv6-sid-manager branch 7 times, most recently from 4008b0a to e308339 Compare March 26, 2024 07:54
@riw777 riw777 self-requested a review March 26, 2024 14:14
Copy link

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

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.

Documentation is missing yet. Another question: is this similar to the label allocation manager (synchronous)?

lib/srv6.h Outdated Show resolved Hide resolved
lib/zclient.c Outdated Show resolved Hide resolved
lib/zclient.c Outdated Show resolved Hide resolved
lib/zclient.c Outdated Show resolved Hide resolved
Copy link

github-actions bot commented May 1, 2024

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

@cscarpitta cscarpitta requested a review from ton31337 May 3, 2024 18:10
@cscarpitta cscarpitta force-pushed the srv6-sid-manager branch 2 times, most recently from 6a21fe3 to 19ce93d Compare May 6, 2024 15:57
@pguibert6WIND
Copy link
Member

there are some address sanitizer error : https://ci1.netdef.org/browse/FRR-PULLREQ3-3112/artifact/ASAN7/AddressSanitizerError/AddressSanitzer.txt , and it seems related to your dev.
please use ./configure ... --enable-address-sanitizer and run the topotest to see asan files in /tmp/topotests//.

@cscarpitta
Copy link
Contributor Author

@pguibert6WIND Thanks for the review. I fixed the errors reported by address sanitizer.

Copy link
Member

@riw777 riw777 left a comment

Choose a reason for hiding this comment

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

I think we'll need topo tests for this one (?) ... other than that, the code looks fine

@cscarpitta
Copy link
Contributor Author

I think we'll need topo tests for this one (?) ... other than that, the code looks fine

@riw777 Many thanks for the review.

We have another PR with the topotest (#15679). The topotest extensively tests the SID manager and the interaction with the client daemons (BGP, IS-IS).

Please note, originally the SID manager, client daemon extension (BGP, IS-IS) and the topotest were in a single PR.
But the PR was very large, hence we split into SID Manager, BGP extension, IS-IS extension, and topotest.

Add functionalities to manage SRv6 SID formats (allocate / free /
register / unregister / lookup) and create two SID formats upon SRv6
Manager initialization: `uncompressed` and `usid-f3216`.

In future commits, we will add the CLI to allow the user to choose
between the two formats.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Add CLI commands to support overriding default configuration of the SID
format.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Add CLI commands to support overriding default configuration of the SID
format.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Add CLI commands to support overriding default configuration of the SID
format.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
An SRv6 block is an IPv6 prefix from which SIDs are allocated. This
commit adds support for SRv6 SID blocks. Specifically, it adds a data
structure to store information about an SRv6 block (e.g., its occupancy
status, which SIDs have been allocated and which are available, which
SID format is used for that block, etc.). It also adds some functions to
manage the block (allocate / free / lookup).

These functions will be used in the next commits to support the
allocation of SIDs from a block in the SID Manager.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Add the CLI to choose the SID format of a locator. When the SID format
of a locator is changed, the SIDs allocated from that locator might no
longer be valid (for example, because the new format might involve a
different SID allocation schema). In such a case, it is necessary to
notify all the zclients so that they can withdraw/uninstall the old SIDs
that use the previous format and allocate/install/advertise the new SIDs
based on the new format.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Add a data structure to represent an SRv6 SID context and the related
management functions (allocate/free).

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Add a data structure to represent an SRv6 SID context and the related
management functions (allocate/free).

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Add a new ZAPI operation, ZEBRA_SRV6_MANAGER_GET_LOCATOR, which allows a
daemon to request information about a specific locator from the SRv6 SID
Manager.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Add two new ZAPI operations: `ZEBRA_SRV6_MANAGER_GET_SRV6_SID` and
`ZEBRA_SRV6_MANAGER_RELEASE_SRV6_SID`. These APIs allow a daemon to get and
release an SRv6 SID, respectively.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Include block/node/function/argument lengthi when
encoding/decoding an SRv6 locator.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
The previous commits introduced a new operation,
`ZEBRA_SRV6_MANAGER_GET_LOCATOR`, allowing a daemon to request
information about a specific SRv6 locator from the SRv6 SID Manager.

This commit extends the SID Manager to respond to a
`ZEBRA_SRV6_MANAGER_GET_LOCATOR` request and provide the requested
locator information.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Add functions to allocate/release SRv6 SIDs. SIDs can be allocated
either explicitly (allocate a specific SID) or dynamically (allocate any
available SID).

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Previous commits introduced two new ZAPI operations,
`ZEBRA_SRV6_MANAGER_GET_SRV6_SID` and
`ZEBRA_SRV6_MANAGER_RELEASE_SRV6_SID`. These operations allow a daemon
to interact with the SRv6 SID Manager to get and release an SRv6 SID,
respectively.

This commit extends the SID Manager by adding logic to process the
requests `ZEBRA_SRV6_MANAGER_GET_SRV6_SID` and
`ZEBRA_SRV6_MANAGER_RELEASE_SRV6_SID`, and allocate/release SIDs to
requesting daemons.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Add a new ZAPI command `ZEBRA_SRV6_SID_NOTIFY` used by zebra to send
asynchronous SRv6 SIDs notifications to zclients.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Send asynchronous notifications to zclients when an SRv6 SID is
allocated/released and when a SID alloc/release operation fails.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Currently, when a locator is deleted in zebra, zebra notifies only the
zclient that owns the locator.

With the introduction of SID Manager, the locator is no longer owned by
any client. Instead, the locator is owned by Zebra, and clients can
allocate and release SIDs from the locator using the ZAPI
ZEBRA_SRV6_MANAGER_GET_SID and ZEBRA_SRV6_MANAGER_RELEASE_SID.

Therefore, when a locator is removed in Zebra, we need to notify all
daemons so that they can release/uninstall the SIDs allocated by that
locator.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Copy link
Member

@riw777 riw777 left a comment

Choose a reason for hiding this comment

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

looks good

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.

None yet

5 participants