-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
bgpd, zebra: Add support for SRv6 uSID Behaviors #12219
bgpd, zebra: Add support for SRv6 uSID Behaviors #12219
Conversation
In this commit, we introduce the ability to specify flags for an SRv6 locator. Flags can be used to specify the properties of the locator. Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
In this commit, we add support for a new flag called `SRV6_LOCATOR_USID`. When the `SRV6_LOCATOR_USID` flag is set, the routing protocols will install SRv6 behaviors with the uSID in the dataplane. This flag is used to specify a locator as a uSID locator. When a locator is specified as a uSID locator, all the SRv6 SIDs allocated from the locator by the routing protocols (like BGP) are bound to the SRv6 uSID behaviors and use the SRv6 uSID codepoints in the BGP update message. We extend the SRv6 locator implementation to add support for a `usid` flag. When the `usid` flag is set, the bgpd will install SRv6 behaviors with the uSID in the dataplane and use the proper SRv6 Endpoint Behavior codepoint in the BGP advertisement. Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
In this commit, we extend the ZAPI to support encoding and decoding the locator flags contained in the messages exchanged between zebra and the routing daemons. Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Continuous Integration Result: FAILEDContinuous Integration Result: FAILEDSee below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: SuccessfulBasic Tests: FailedTopotests Ubuntu 18.04 arm8 part 4: Failed (click for details)Topotests Ubuntu 18.04 arm8 part 4: No useful log foundSuccessful on other platforms/tests
|
ci:rerun |
Continuous Integration Result: SUCCESSFULContinuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-8134/ This is a comment from an automated CI system. |
@@ -245,6 +245,10 @@ json_object *srv6_locator_json(const struct srv6_locator *loc) | |||
json_object_int_add(jo_root, "argumentBitsLength", | |||
loc->argument_bits_length); | |||
|
|||
/* set true if the locator is a Micro-segment (uSID) locator */ | |||
if (CHECK_FLAG(loc->flags, SRV6_LOCATOR_USID)) | |||
json_object_string_add(jo_root, "behavior", "usid"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest telling explicitly for the operator what is the behavior used, instead of just usid
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here the behavior defines the type of the locator which is usid
. Based on the type of the locator, the other processes (e.g., bgpd) will use the proper behavior (e.g., uDT4 for L3VPNv4) and use the corresponding IANA codepoint.
lib/srv6.h
Outdated
uint8_t flags; | ||
}; | ||
|
||
enum srv6_endpoint_behavior_codepoint_t { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For enums, we usually do not add _t
suffix. More like for typedefs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed srv6_endpoint_behavior_codepoint_t
to srv6_endpoint_behavior_codepoint
.
Thanks for the suggestion.
I also added a comment to remind us that these values are the codepoints defined by IANA.
zebra/zebra_srv6_vty.c
Outdated
DEFPY (locator_behavior, | ||
locator_behavior_cmd, | ||
"[no] behavior usid", | ||
NO_STR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems bad indentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something went wrong with tabs and spaces :)
Fixed, thanks.
|
||
def check_srv6_locator(router, expected_file): | ||
func = functools.partial(_check_srv6_locator, router, expected_file) | ||
success, result = topotest.run_and_expect(func, None, count=5, wait=0.5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we increase the waiting time a bit? Under high load, it might start failing...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to 3 seconds. Is it enough?
zebra/zebra_srv6.c
Outdated
if (!client) { | ||
zlog_warn( | ||
"%s: Not found zclient(proto=%u, instance=%u).", | ||
__func__, c->proto, c->instance); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, drop __func__
here too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropped, thanks.
In this commit, we introduce a new enumeration to encode the SRv6 Endpoint Behaviors codepoints defined in the IANA SRv6 Endpoint Behaviors Registry (https://www.iana.org/assignments/segment-routing/segment-routing.xhtml). Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Currently bgpd uses the opaque codepoint (0xFFFF) in the BGP advertisement. In this commit, we update bgpd to use the SRv6 codepoints defined in the IANA SRv6 Endpoint Behaviors Registry (https://www.iana.org/assignments/segment-routing/segment-routing.xhtml) Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
In this commit, we extend to print the `SRV6_LOCATOR_USID` flag. The output appears as follows: ``` { "locators":[ { "name":"loc1", "prefix":"fc00:0:1::/48", "blockBitsLength":32, "nodeBitsLength":16, "functionBitsLength":16, "argumentBitsLength":0, "uSID":true, "statusUp":true, "chunks":[ { "prefix":"fc00:0:1::/48", "proto":"bgp" } ] } ] } ``` Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
In this commit, we add two helper functions `zebra_notify_srv6_locator_add` and `zebra_notify_srv6_locator_delete`. These functions are used to notify locator additions/deletions to zclients. Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Install a new command `behavior usid` into the `SRV6_LOC_NODE` CLI node. This command allows the user to set/unset the `SRV6_LOCATOR_USID` flag for an SRv6 locator. The `SRV6_LOCATOR_USID` flag indicates whether a locator is a uSID locator or not. When the flag is set, the routing daemons (e.g., bgpd) will install SRv6 behaviors with the uSID in the dataplane. Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
This test ensures that the command `behavior usid` works properly. When the `behavior usid` command is set, a flag is added to the locator to indicate that the locator is a uSID locator. This test verifies that the locator works correctly when you set / unset the `behavior usid` command. Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add the documentation for the `behavior usid` command to zebra. When the `behavior usid` command is set, a flag is added to the locator to indicate that the locator is a uSID locator. When a locator is specified as a uSID locator, the bgpd will install SRv6 behaviors with the uSID in the dataplane and use the SRv6 uSID codepoints in the BGP update message. Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
13daf1a
to
439d4c9
Compare
Continuous Integration Result: FAILEDContinuous Integration Result: FAILEDSee below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: FailedUbuntu 18.04 amd64 build: Failed (click for details)Ubuntu 18.04 amd64 build: Unknown Log URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-8279/artifact/U1804AMD64/frr.xref.xz/frr.xref.xz Ubuntu 18.04 amd64 build: Unknown Log URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-8279/artifact/U1804AMD64/config.log/config.log.gz Ubuntu 18.04 amd64 build: config.status output from configure script can be found at https://ci1.netdef.org/browse/FRR-PULLREQ2-8279/artifact/U1804AMD64/config.status/config.statusDejaGNU Unittests (make check) failed for Ubuntu 18.04 amd64 build Successful on other platforms/tests
|
ci:rerun |
Continuous Integration Result: FAILEDContinuous Integration Result: FAILEDSee below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: SuccessfulBasic Tests: FailedTopotests Ubuntu 18.04 arm8 part 7: Failed (click for details)Topotests Ubuntu 18.04 arm8 part 7: No useful log foundTopotests Ubuntu 18.04 i386 part 9: Failed (click for details)Topotests Ubuntu 18.04 i386 part 9: Unknown Log URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-8280/artifact/TOPO9U18I386/ErrorLog/ Topotests Ubuntu 18.04 i386 part 9: No useful log foundSuccessful on other platforms/tests
|
ci:rerun |
Continuous Integration Result: FAILEDContinuous Integration Result: FAILEDSee below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: FailedUbuntu 18.04 amd64 build: Failed (click for details)Ubuntu 18.04 amd64 build: Unknown Log URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-8283/artifact/U1804AMD64/frr.xref.xz/frr.xref.xz Ubuntu 18.04 amd64 build: Unknown Log URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-8283/artifact/U1804AMD64/config.log/config.log.gz Ubuntu 18.04 amd64 build: config.status output from configure script can be found at https://ci1.netdef.org/browse/FRR-PULLREQ2-8283/artifact/U1804AMD64/config.status/config.statusDejaGNU Unittests (make check) failed for Ubuntu 18.04 amd64 build Successful on other platforms/tests
|
ci:rerun |
Continuous Integration Result: FAILEDContinuous Integration Result: FAILEDSee below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: SuccessfulBasic Tests: FailedTopotests Ubuntu 18.04 arm8 part 8: Failed (click for details)Topotests Ubuntu 18.04 arm8 part 8: No useful log foundSuccessful on other platforms/tests
|
ci:rerun failed |
Continuous Integration Result: FAILEDContinuous Integration Result: FAILEDSee below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: SuccessfulBasic Tests: FailedTopotests debian 10 amd64 part 7: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO7DEB10AMD64-8289/test Topology Tests failed for Topotests debian 10 amd64 part 7 Successful on other platforms/tests
|
ci:rerun |
Continuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-8296/ This is a comment from an automated CI system. |
@ton31337 Thank you for the review! |
SRv6 Network Programming defined in RFC8986 allows to encode any end-to-end policy as a network program. The network program contains a set of instructions. Each instruction is called SID. The SID can be bound to any behavior.
RFC8986 defines a set of SRv6 behaviors including End, End.X, End.DT*, End.DX*, which can be used to deliver several services such as L2VPN/L3VPN, Traffic Engineering, etc.
FRR currently supports L3VPN using SRv6. It supports an SRv6 behavior (known as End.DT4) to deliver L3VPN for IPv4 prefixes. Also, it supports an SRv6 Endpoint (known as End.DT6) to deliver L3VPN services for IPv6 prefixes.
Recently FRR added support to an SRv6 behavior (End.DT46) to deliver L3VPN for both IPv4 and IPv6 prefixes combined using a single SRv6 SID.
A new flavor for the SRv6 Network Programming behavior called micro-segment (uSID for short) is defined in https://datatracker.ietf.org/doc/draft-ietf-spring-srv6-srh-compression/
The new flavor allowed the realization of SRv6 use-cases with much less MTU overhead. As a single SID can be used to carry more than one micro-instruction (i.e., micro-segment “uSID”)
SRv6 uSID is supported in SONiC (sonic-net/sonic-swss#2335) as part of release 202212 (~Dec 2022). This PR allows for the integration of FRR and SONiC.
We will send another PR for the FPM Module extensions required for the integration with SONiC.
This PR extends the bgpd and zebra daemons of FRR to add support for uSID.
We extended the SRv6 locator implementation to add support for a
usid
flag. When theusid
flag is set, the bgpd will install SRv6 behaviors with the uSID in the dataplane and use the proper SRv6 Endpoint Behavior codepoint in the BGP advertisement.The SRv6 uSID can be enabled in FRR using
behavior usid
CLI command as shown belowIn the PR we added the required vtysh command, topotest, and the documentation changes required for the usid behavior.
Signed-off-by: Carmine Scarpitta carmine.scarpitta@uniroma2.it