Add a data structure to represent an SRv6 End.X SID Sub-TLV as per
RFC 9352 section #8.1.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add copyright claim for "IS-IS Extensions to Support SRv6" (RFC 9352)
to isis_tlvs.c and isis_tlvs.h.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
According to RFC 9352 section #5, the SRv6 Locators associated with
algorithms 0 and 1 should be also advertised in a Prefix Reachability
TLV (236 or 237) to allow legacy routers (i.e., routers that do not
support SRv6) installing a forwarding entry for algorithms 0 and 1 SRv6
traffic.
This commits extend IS-IS to advertise SRv6 Locators in IPv6
Reachability TLV.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a function to build an SRv6 SID Structure Sub-Sub-TLV (RFC 9352
section #9) to advertise the structure of a specific SRv6 End SID passed
as an argument.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a function to build an SRv6 End SID TLV (RFC 9352 section #7.2) to
advertise a specific SRv6 End SID passed as an argument.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a function to build an SRv6 Locator TLV (RFC 9352 section #7.1) to
advertise a specific SRv6 Locator passed as an argument.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
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>
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>
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>
General Sub-Sub-TLV processing functions (i.e., copy, format, free,
pack, and unpack) perform a lookup of the handler specific for a
Sub-Sub-TLV in the `tlv_table`, and then call the specific handler to
process the Sub-Sub-TLV.
This commit adds the handlers for the SRv6 Structure Sub-Sub-TLV (stored
in `subsubtlv_srv6_sid_structure_ops`) to the `tlv_table`.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Use the SUBSUBTLV_OPS macro to define the TLV operations for the SRv6
SID Structure Sub-Sub-TLV (RFC 9352 section #9).
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Extend generic Sub-Sub-TLVs format function to return information about
SRv6 SID Structure Sub-Sub-TLVs (RFC 9352 section #9).
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a function to return information about an SRv6 SID Structure
Sub-Sub-TLV (RFC 9352 section #9).
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Extend SRv6 End SID Sub-TLV format function to return information about
Sub-Sub-TLVs (RFC 9352 section #7.2).
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a function to pack all the Sub-Sub-TLVs passed as an argument.
At this time, this function does not pack any Sub-Sub-TLVs because no
Sub-Sub-TLVs have been defined yet. This function will be extended in
future commits to pack specific Sub-Sub-TLVs, as they become supported.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a function to free all the Sub-Sub-TLVs and the `isis_subsubtlvs`
data structure passed as an argument.
At this time, this function only frees the `isis_subsubtlvs`. It does
not free any specific Sub-Sub-TLVs because no Sub-Sub-TLVs have been
defined yet. This function will be extended in future commits to free
specific Sub-Sub-TLVs, as they become supported.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a function to return information about all the Sub-Sub-TLVs passed
as an argument.
At this time, this function does nothing because no Sub-Sub-TLVs have
been defined yet. This function will be extended in
future commits to return information about specific Sub-Sub-TLVs,
as they become supported.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a function to copy all the Sub-Sub-TLVs passed as an argument.
At this time, this function does not copy any Sub-Sub-TLVs because no
Sub-Sub-TLVs have been defined yet. This function will be extended in
future commits to copy specific Sub-Sub-TLVs, as they become supported.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a data structure to store IS-IS Sub-Sub-TLVs information. At this
time, does not contain any Sub-Sub-TLV information because no
Sub-Sub-TLVs have been defined yet. This data structure will be extended
in future commits to store specific Sub-Sub-TLVs, as they become
supported.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add two macros `SUBSUBTLV_OPS` and `ITEM_SUBSUBTLV_OPS` that help the
developer to define the TLV operations for the IS-IS Sub-Sub-TLVs.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Extend generic Sub-TLVs format function to return information about
SRv6 End SID Sub-TLVs (RFC 9352 section #7.2).
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
General Sub-TLV processing functions (i.e., copy, format, free, pack,
and unpack) perform a lookup of the specific handler for a Sub-TLV in
the `tlv_table`, and then call the specific handler to process the
Sub-TLV.
This commit adds the handlers for the SRv6 End SID Sub-TLV (stored in
`tlv_srv6_end_sid_ops`) to the `tlv_table`.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Use the ITEM_SUBTLV_OPS macro to define the TLV operations for the SRv6
End SID Sub-TLV (RFC 9352 section #7.2).
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a function to return information about an SRv6 End SID Sub-TLV
(RFC 9352 section #7.2).
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a new TLV context value for the SRv6 End SID Sub-TLV. It will be
needed to support unpacking of the Sub-Sub-TLVs of the SRv6 End SID
Sub-TLV in future commits.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a data structure to represent an SRv6 End SID Sub-TLV as per
RFC 9352 section #7.2.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
The SRv6 Locator TLV (RFC 9352 section #7.1) starts with the MTID field.
Let's expect the MTID as the first field when we are unpacking an SRv6
Locator TLV.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
The SRv6 Locator TLV (RFC 9352 section #7.1) starts with the MTID field.
Let's put the MTID as the first field when we are packing an SRv6
Locator TLV.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
General TLV processing functions (i.e., copy, format, free, pack, and
unpack) perform a lookup of the specific handler for a TLV in the
`tlv_table`, and then call the specific handler to process the TLV.
This commit adds the handlers for the SRv6 Locator TLV (stored in
`tlv_srv6_locator_ops`) to the `tlv_table`.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Use the ITEM_TLV_OPS macro to define the TLV operations for the SRv6
Locator TLV (RFC 9352 section #7.1).
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a function to unpack an SRv6 Locator TLV and all its Sub-TLVs
(RFC 9352 section #7.1).
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a function to pack an SRv6 Locator TLV and all its Sub-TLVs
(RFC 9352 section #7.1).
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a function to free an SRv6 Locator TLV and all its Sub-TLVs
(RFC 9352 section #7.1).
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Extend generic TLVs format function to return information about SRv6
Locator TLVs (RFC 9352 section #7.1).
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add the `IS-IS SRv6 SID Structure Sub-Sub-TLV Codepoint` as defined in the
`IS-IS Sub-Sub-TLVs for SRv6 SID Sub-TLVs` IANA registry. This codepoint
will be used as the Sub-Sub-TLV Type to advertise the SRv6 SID Structure
Sub-Sub-TLV in the SRv6 End SID, SRv6 End.X SID, and SRv6 LAN End.X SID
Sub-TLVs.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add the `IS-IS SRv6 End SID Sub-TLV Codepoint` as defined in the
`IS-IS Sub-TLVs for TLVs Advertising Prefix Reachability` IANA registry.
This codepoint will be used as the Sub-TLV
Type to advertise the SRv6 End SID Sub-TLV in the SRv6 Locator TLV.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Extend Router Capabilities TLV format function to return information
about SRv6 Capabilities Sub-TLVs (RFC 9352 section #2).
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a new TLV context value for the SRv6 Locator TLV. It will be needed
to support unpacking of the Sub-TLVs of the SRv6 Locator TLV in future
commits.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add IS-IS SRv6 Locator TLV Codepoint as defined in the IANA registry
IS-IS Top-Level TLV Codepoints.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
When an SRv6 locator is unset, remove all the SRv6 End SIDs allocated
from that locator.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
When zebra assigns a chunk to IS-IS, zebra sends a
ZEBRA_SRV6_MANAGER_GET_LOCATOR_CHUNK notification to IS-IS.
IS-IS invokes the `isis_zebra_process_srv6_locator_chunk()` callback to
process the received notification.
Actually, `isis_zebra_process_srv6_locator_chunk()` iterates over all
areas of the current IS-IS instance and looks for an area for which the
received chunk was requested.
If a match is found, the new chunk is added to the area's chunk list and
`lsp_regenerate_schedule()` is called to regenerate the LSPs to
advertise the new SRv6 locator.
This commit extends the `isis_zebra_process_srv6_locator_chunk()`
function to automatically allocate an SRv6 End SID from the received
chunk and install it in the data plane.
The SRv6 End SID is the instantiation of a Prefix-SID (RFC 8986 section
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
In some cases, IS-IS may attempt to remove routes that have not been
installed before. We can prevent IS-IS from doing this by aborting
`isis_zebra_route_del_route` when the ISIS_ROUTE_FLAG_ZEBRA_SYNCED flag
is unset, meaning that the route is not installed in the kernel.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
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>
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>
Define a new memtype `MTYPE_ISIS_SRV6_SID` used to allocate objects of
type `IS-IS SRv6 SID`.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
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>
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>
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>
Add a CLI command to unset a previously configured SRv6 locator for a
specific IS-IS instance.
Example:
r1# configure
r1(config)# router isis FOO
r1(config-router)# segment-routing srv6
r1(config-router-srv6)# no locator loc1
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a northbound command to show information about the SRv6 locator
configured in IS-IS.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a northbound command to unset an SRv6 locator for a specific
IS-IS area. This is a wrapper around `isis_srv6_locator_unset()`.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a northbound command to configure an SRv6 locator for a specific
IS-IS area.
After configuring a locator, `isis_zebra_srv6_manager_get_locator_chunk`
is called to ask zebra to allocate a chunk from the configured locator.
The allocated chunk will be owned by IS-IS. IS-IS can allocate SIDs from
its chunk.
Currently, we support only one locator per-area. Therefore, before
configuring a locator we unset the previously configured locator, if
there was any.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
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>
Add a callback function `isis_zebra_process_srv6_locator_delete()` that
is called when an SRv6 locator is deleted in zebra.
When an existing SRv6 locator is deleted in zebra, zebra sends a
ZEBRA_SRV6_LOCATOR_DELETE notification to all daemons informing them of
the deleted locator.
In IS-IS, we register the new `isis_zebra_process_srv6_locator_delete()`
callback as the handler for ZEBRA_SRV6_LOCATOR_DELETE.
This callback iterates over all areas of the current IS-IS instance and
looks for an area for which the deleted locator was configured.
If a match is found, we remove
the locator's chunks from the area's chunks list and call
`lsp_regenerate_schedule` to remove the locator from the SRv6 Locator
TLV advertised in the LSPs and regenerate the LSPs.
If no match is found, we do nothing.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a callback function `isis_zebra_process_srv6_locator_add()` that is
called upon receiving an SRv6 locator from zebra.
When a new SRv6 locator is created in zebra, zebra sends a
ZEBRA_SRV6_LOCATOR_ADD notification to all daemons informing them of the
new locator.
In IS-IS, we register the new `isis_zebra_process_srv6_locator_add()`
callback as the handler for ZEBRA_SRV6_LOCATOR_ADD.
This callback iterates over all areas of the current IS-IS instance and
looks for an area for which the new locator was configured.
If a match is found, we call
`isis_zebra_srv6_manager_get_locator_chunk()` to ask zebra a chunk from
the locator.
If no match is found, we do nothing.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a callback function that is called upon receiving an SRv6 locator
chunk from zebra.
This function iterates over all areas of the current IS-IS instance and
looks for an area for which the received chunk was requested.
If a match is found, the new chunk is added to the area's chunk list and
`lsp_regenerate_schedule()` is called to regenerate the LSPs to
advertise the new SRv6 locator.
If no match is found, we free the allocated resources and do nothing.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a function to ask zebra to release a chunk from the SRv6 locator
specified as a parameter.
The chunk to be released must have been allocated by a previous call to
`isis_zebra_srv6_manager_get_locator_chunk()`.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a function to ask zebra to allocate a chunk from the SRv6 locator
specified as a parameter.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
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>
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>
Add a CLI command to print SRv6 capabilities, algorithms and MSDs
supported by the IS-IS nodes.
Example:
r1# show isis segment-routing srv6 node
Area FOO:
IS-IS L1 SRv6-Nodes:
IS-IS L2 SRv6-Nodes:
System ID Algorithm SRH Max SL SRH Max End Pop SRH Max H.encaps SRH Max End D
-----------------------------------------------------------------------------------------
1111.1111.1111 SPF 16 0 1 2
2222.2222.2222 SPF 16 0 1 2
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add Node MSD Sub-TLV containing the SRv6 MSDs to the Router Capabilities
TLV in the LSPs generated with the `lsp_build()` function.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>