Commit graph

32 commits

Author SHA1 Message Date
Carmine Scarpitta 0b76fb3c13 isisd: Add helper function to request SRv6 locator information
This commit adds a function that iterates over all IS-IS areas and asks
the SRv6 Manager for information about the configured locators.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-15 10:39:30 +01:00
Yuqing Zhao 7aefc15f64 lib, isisd: Move DEFAULT_SRV6_IFNAME to global srv6.h header
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 <galadriel.zyq@alibaba-inc.com>
2025-01-18 10:28:49 +00:00
Carmine Scarpitta 38a62df517 isisd: Request SRv6 SIDs to SID Manager
Currently, IS-IS allocates SIDs without interacting with Zebra.

Recently, the SRv6 implementation has been improved. Now, the daemons
need to interact with Zebra through ZAPI to obtain and release SIDs.

This commit extends IS-IS to request SIDs from Zebra instead of
allocating the SIDs on its own.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-06-18 18:33:29 +02:00
Carmine Scarpitta 9ae38eede8 isisd: Deal with SRv6 locator instead of chunk
Currently, when SRv6 is enabled in IS-IS, IS-IS requests a locator chunk
from Zebra. Zebra assigns a locator chunk to IS-IS, and then IS-IS can
allocate SIDs from the locator chunk.

Recently, the implementation of SRv6 in Zebra has been improved, and a
new API has been introduced for obtaining/releasing the SIDs.

Now, the daemons no longer need to request a chunk.

Instead, the daemons interact with Zebra to obtain information about the
locator and subsequently to allocate/release the SIDs.

This commit extends IS-IS to use the new SRv6 API. In particular, it
removes the chunk throughout the IS-IS code and modifies IS-IS to
request/save/advertise the locator instead of the chunk.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-06-18 18:33:29 +02:00
Philippe Guibert ad874c7d3b isisd: fix renaming backup define for ENDX SID
The define has inheritated from a wrong naming in sr-mpls.
Fix this by renaming ISIS_SRV6_LAN_BACKUP to ISIS_SRV6_ADJ_BACKUP.

Fixes: 2566656a6f ("isisd: Add data structure for SRv6 Adjacency SIDs")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-22 10:00:07 +02:00
Carmine Scarpitta 7e5f1a0bb4 isisd: Fix openfabric crash
`isis_srv6_area_init` should not use `yang_get_default_*` functions for
fabricd.

Fixes: https://github.com/FRRouting/frr/issues/14722

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2023-11-03 13:19:24 +01:00
Carmine Scarpitta bfec26bc7a isisd: Make SRv6 interface configurable
Add CLI command and functions to configure the interface used for
installing SRv6 SIDs into Linux data plane

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 22:11:51 +02:00
Carmine Scarpitta bdbbb26d55 isisd: Make SRv6 Node MSDs customizable
Add CLI commands to customize SRv6 Node MSD values.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 22:11:50 +02:00
Carmine Scarpitta ecb2675f1e isisd: Add support for SRv6 Adjacency SIDs
An SRv6 adjacency SID is a SID that is associated with a particular
adjacency. Adjacency SIDs are advertised using the SRv6 End.X SID
Sub-TLV (RFC 9352 section #8.1) or SRv6 LAN End.X SID Sub-TLV (RFC 9352
section #8.2).

This commit defines the following Adj SIDs management functions:
* srv6_endx_sid_add_single: add a new SRv6 Adjacency SID
* srv6_endx_sid_del: delete an SRv6 Adjacency SID
* isis_srv6_endx_sid_find: lookup SRv6 End.X SID by type

It also attaches some callbacks to the hooks isis_adj_state_change_hook,
isis_adj_ip_enabled_hook, isis_adj_ip_disabled_hook, which are
responsible for installing/removing an SRv6 Adjacency SID automatically
when the state of an IS-IS adjacency changes.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 22:11:47 +02:00
Carmine Scarpitta 2566656a6f isisd: Add data structure for SRv6 Adjacency SIDs
An SRv6 adjacency SID is a SID that is associated with a particular
adjacency. Adjacency SIDs are advertised using the SRv6 End.X SID
Sub-TLV (RFC 9352 section #8.1) or SRv6 LAN End.X SID Sub-TLV (RFC 9352
section #8.2).

This commit defines a data structure `srv6_adjacency` for storing
information about an SRv6 Adjacency SID. This data structure will be
used to support SRv6 Adjacency SIDs functionalities in future commits.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 22:11:46 +02:00
Carmine Scarpitta 7e340af13b isisd: Add func to fill in SID Struct Sub-Sub-TLV
Add a function to fill in an SRv6 SID Structure Sub-Sub-TLV with
information from an SRv6 SID (RFC 9352 section #9).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 22:11:37 +02:00
Carmine Scarpitta 43786ccfdc isisd: Add func to fill in an SRv6 End SID Sub-TLV
Add a function to fill in an SRv6 End SID Sub-TLV with information from
an SRv6 End SID (RFC 9352 section #7.2).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 22:11:37 +02:00
Carmine Scarpitta 6cd23c6d95 isisd: Add function to fill in an SRv6 Locator TLV
Add a function to fill in an SRv6 Locator TLV with information from an
SRv6 locator (RFC 9352 section #7.1).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 22:11:37 +02:00
Carmine Scarpitta 791ca51ecf isisd: Add SRv6 locator data structure
Add a data structure to represent an SRv6 locator (RFC 9352
section 7.1)

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 22:11:36 +02:00
Carmine Scarpitta 8b6d051c54 isisd: Add func to install SRv6 SID in dplane
Add a function to install an SRv6 SID in the data plane through
zebra.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 17:35:05 +02:00
Carmine Scarpitta 8d1af2a4b0 isisd: Add function to allocate an SRv6 SID
Add a function to allocate an SRv6 SID from an SRv6 locator chunk owned
by IS-IS. The chunk must be allocated by a previous call to
`isis_zebra_srv6_manager_get_locator_chunk()`.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 17:35:00 +02:00
Carmine Scarpitta 26d7806d20 isisd: Add SRv6 SIDs to SRv6 configuration
Add the list of SRv6 SIDs allocated by the IS-IS instance to the per-area
SRv6 configuration. The list is area-specific. Each IS-IS area has its
own SRv6 SIDs list. The list is initialized when an IS-IS area is
created and freed when an IS-IS area is destroyed.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 17:35:00 +02:00
Carmine Scarpitta f6238e10b0 isisd: Add function to free an SRv6 SID
Add a function to free an SRv6 SID.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 17:34:59 +02:00
Carmine Scarpitta a933a4dd5d isisd: Add SRv6 SID structure to SRv6 SID
Add SRv6 SID structure as a member of the SRv6 SID to specify the format
of a specific SID (i.e., block/node/function/argument length).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 17:34:58 +02:00
Carmine Scarpitta 057e9df2cc isisd: Add SRv6 SID structure data structure
Add `struct isis_srv6_sid_structure` data structure to represent an SRv6
SID structure (as defined in RFC 8986 section #3.1).

The struct has the following members:
* loc_block_len: locator block length
* loc_node_len: locator node length
* func_len: function length
* arg_len: argument length

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 17:34:58 +02:00
Carmine Scarpitta e047b39dc1 isisd: Add SRv6 SID data structure
Add `struct isis_srv6_sid` data structure to represent an SRv6 SID.

The struct has the following members:
* next: pointer to the next SID, used to build linked lists of SRv6 SIDs
* flags: SID flags
* behavior: the behavior bound to the SRv6 SID (as defined in RFC 8986)
* value: the SID value (i.e., an IPv6 address)
* locator: a backpointer to the parent locator from which the SID has
been allocated.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 17:34:58 +02:00
Carmine Scarpitta f49937e340 isisd: Add func to unset the SRv6 locator
Add a function to unset the SRv6 locator for a specific IS-IS area.

This function calls `isis_zebra_srv6_manager_release_locator_chunk()` to
ask zebra to release the locator chunk owned by IS-IS and removes the
chunk from the area's chunks list.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 17:34:55 +02:00
Carmine Scarpitta 2e8d254ac7 isisd: Add SRv6 locator chunks to SRv6 config
Add a list of SRv6 locator chunks allocated to a specific IS-IS area.
The list is initialized when the IS-IS area is created and freed when
the IS-IS area is destroyed. Subsequent commits will introduce the
possibility to allocate and release locator chunks.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 17:34:52 +02:00
Carmine Scarpitta 1a9c3a1e57 isisd: Add SRv6 locator name to SRv6 configuration
Add the name of the SRv6 locator to use with IS-IS to the per-area SRv6
configuration. If an SRv6 locator is not configured for an IS-IS
instance, the locator name is an empty string. When an IS-IS instance is
configured to use an SRv6 locator,  the locator name stores the name of
the selected locator.

Subsequent commits will add the possibility to set and unset an SRv6
locator for a specific IS-IS instance.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 17:34:51 +02:00
Carmine Scarpitta 340fdf6a80 isisd: Add support for SRv6 MSDs
Add Maximum SRv6 SID Depths (MSDs) parameters as per RFC 9352 section #4
to the per-area IS-IS SRv6 Data Base. Currently the MSD values are
hardcoded.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-08-04 09:29:16 +02:00
Carmine Scarpitta 5e21aaf1e7 isisd: Add function to terminate the SRv6 module
`isis_srv6_area_term()` cleans up SRv6 information for a specific
IS-IS area. This commit adds a new function `isis_srv6_term()` that will
be used to perform global SRv6 cleanup.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-08-04 09:29:16 +02:00
Carmine Scarpitta 5fb8d335ca isisd: Add function to initialize the SRv6 module
`isis_srv6_area_init()` initializes SRv6 information for a specific
IS-IS area. This commit adds a new function `isis_srv6_init()` that will
be used to perform global SRv6 initialization.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-08-04 09:29:16 +02:00
Carmine Scarpitta 91905e44b9 isisd: Add a bool to enable/disable SRv6
Add a boolean flag to indicate whether SRv6 is administratively enabled
on a given IS-IS area or not.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-08-04 09:29:15 +02:00
Carmine Scarpitta 9c51247ea3 isisd: Add func to terminate SRv6 for a given area
Add function to terminate SRv6 for a given IS-IS area.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-08-04 09:29:15 +02:00
Carmine Scarpitta 0359045d97 isisd: Add function to initialize SRv6 DB
Add function to initialize per-area SRv6 DB (`area->srv6db`).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-08-04 09:29:15 +02:00
Carmine Scarpitta 975ce69a27 isisd: Add data structure for SRv6 information
Add `struct isis_srv6_db` to store per-area SRv6 information.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-08-04 09:29:15 +02:00
Carmine Scarpitta d52c6c88b2 isisd: Add isis_srv6.[c, h] files
Add `isis_srv6.c` and `isis_srv6.h` files needed to support SRv6 in IS-IS
(as per RFC 9352).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-08-04 09:29:15 +02:00