Segment Routing requires some additional router capabilities to be advertised to other routers in the area.
These SR capabilities are advertised in the Router Information Opaque LSA (defined in [
RFC 7770]). The TLVs defined below are applicable to both OSPFv2 and OSPFv3; see also [
RFC 8666].
The SR-Algorithm TLV is a top-level TLV of the Router Information Opaque LSA (defined in [
RFC 7770]).
The SR-Algorithm TLV is optional. It
SHOULD only be advertised once in the Router Information Opaque LSA. If the SR-Algorithm TLV is not advertised by the node, such a node is considered as not being Segment Routing capable.
An SR Router can use various algorithms when calculating reachability to OSPF routers or prefixes in an OSPF area. Examples of these algorithms are metric-based Shortest Path First (SPF), various flavors of Constrained SPF, etc. The SR-Algorithm TLV allows a router to advertise the algorithms currently used by the router to other routers in an OSPF area. The SR-Algorithm TLV has the following format:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Algorithm 1 | Algorithm... | Algorithm n | |
+- -+
| |
+ +
where:
-
-
Type:
-
8
-
Length:
-
Variable, in octets, depending on the number of algorithms advertised
-
Algorithm:
-
Single octet identifying the algorithm. The following values are defined by this document:
-
0:
-
Shortest Path First (SPF) algorithm based on link metric. This is the standard shortest path algorithm as computed by the OSPF protocol. Consistent with the deployed practice for link-state protocols, Algorithm 0 permits any node to overwrite the SPF path with a different path based on its local policy. If the SR-Algorithm TLV is advertised, Algorithm 0 MUST be included.
-
1:
-
Strict Shortest Path First (SPF) algorithm based on link metric. The algorithm is identical to Algorithm 0, but Algorithm 1 requires that all nodes along the path will honor the SPF routing decision. Local policy at the node claiming support for Algorithm 1 MUST NOT alter the SPF paths computed by Algorithm 1.
When multiple SR-Algorithm TLVs are received from a given router, the receiver
MUST use the first occurrence of the TLV in the Router Information Opaque LSA. If the SR-Algorithm TLV appears in multiple Router Information Opaque LSAs that have different flooding scopes, the SR-Algorithm TLV in the Router Information Opaque LSA with the area-scoped flooding scope
MUST be used. If the SR-Algorithm TLV appears in multiple Router Information Opaque LSAs that have the same flooding scope, the SR-Algorithm TLV in the Router Information (RI) Opaque LSA with the numerically smallest Instance ID
MUST be used and subsequent instances of the SR-Algorithm TLV
MUST be ignored.
The RI LSA can be advertised at any of the defined opaque flooding scopes (link, area, or Autonomous System (AS)). For the purpose of SR-Algorithm TLV advertisement, area-scoped flooding is
REQUIRED.
Prefix-SIDs
MAY be advertised in the form of an index as described in
Section 5. Such an index defines the offset in the SID/Label space advertised by the router. The SID/Label Range TLV is used to advertise such SID/Label space.
The SID/Label Range TLV is a top-level TLV of the Router Information Opaque LSA (defined in [
RFC 7770]).
The SID/Label Range TLV
MAY appear multiple times and has the following format:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Range Size | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sub-TLVs (variable) |
+- -+
| |
+ +
where:
-
-
Type:
-
9
-
Length:
-
Variable, in octets, depending on the sub-TLVs
-
Range Size:
-
3-octet SID/label range size (i.e., the number of SIDs or labels in the range including the first SID/label). It MUST be greater than 0.
-
Reserved:
-
SHOULD be set to 0 on transmission and MUST be ignored on reception
Initially, the only supported sub-TLV is the SID/Label Sub-TLV as defined in
Section 2.1. The SID/Label Sub-TLV
MUST be included in the SID/Label Range TLV. The SID/Label advertised in the SID/Label Sub-TLV represents the first SID/Label in the advertised range.
Only a single SID/Label Sub-TLV
MAY be advertised in the SID/Label Range TLV. If more than one SID/Label Sub-TLV is present, the SID/Label Range TLV
MUST be ignored.
Multiple occurrences of the SID/Label Range TLV
MAY be advertised in order to advertise multiple ranges. In such a case:
-
The originating router MUST encode each range into a different SID/Label Range TLV.
-
The originating router decides the order in which the set of SID/Label Range TLVs are advertised inside the Router Information Opaque LSA. The originating router MUST ensure the order is the same after a graceful restart (using checkpointing, nonvolatile storage, or any other mechanism) in order to ensure the SID/Label range and SID index correspondence is preserved across graceful restarts.
-
The receiving router MUST adhere to the order in which the ranges are advertised when calculating a SID/Label from a SID index.
-
The originating router MUST NOT advertise overlapping ranges.
-
When a router receives multiple overlapping ranges, it MUST conform to the procedures defined in [RFC 8660].
The following example illustrates the advertisement of multiple ranges.
The originating router advertises the following ranges:
Range 1: Range Size: 100 SID/Label Sub-TLV: 100
Range 1: Range Size: 100 SID/Label Sub-TLV: 1000
Range 1: Range Size: 100 SID/Label Sub-TLV: 500
The receiving routers concatenate the ranges and build the Segment Routing Global Block (SRGB) as follows:
SRGB = [100, 199]
[1000, 1099]
[500, 599]
The indexes span multiple ranges:
index 0 means label 100
...
index 99 means label 199
index 100 means label 1000
index 199 means label 1099
...
index 200 means label 500
...
The RI LSA can be advertised at any of the defined flooding scopes (link, area, or autonomous system (AS)). For the purpose of SID/Label Range TLV advertisement, area-scoped flooding is
REQUIRED.
The SR Local Block TLV (SRLB TLV) contains the range of labels the node has reserved for Local SIDs. SIDs from the SRLB
MAY be used for Adjacency SIDs but also by components other than the OSPF protocol. As an example, an application or a controller can instruct the router to allocate a specific Local SID. Some controllers or applications can use the control plane to discover the available set of Local SIDs on a particular router. In such cases, the SRLB is advertised in the control plane. The requirement to advertise the SRLB is further described in [
RFC 8660]. The SRLB TLV is used to advertise the SRLB.
The SRLB TLV is a top-level TLV of the Router Information Opaque LSA (defined in [
RFC 7770]).
The SRLB TLV
MAY appear multiple times in the Router Information Opaque LSA and has the following format:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Range Size | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sub-TLVs (variable) |
+- -+
| |
+ +
where:
-
-
Type:
-
14
-
Length:
-
Variable, in octets, depending on the sub-TLVs
-
Range Size:
-
3-octet SID/Label range size (i.e., the number of SIDs or labels in the range including the first SID/Label). It MUST be greater than 0.
-
Reserved:
-
SHOULD be set to 0 on transmission and MUST be ignored on reception
Initially, the only supported sub-TLV is the SID/Label Sub-TLV as defined in
Section 2.1. The SID/Label Sub-TLV
MUST be included in the SRLB TLV. The SID/Label advertised in the SID/Label Sub-TLV represents the first SID/Label in the advertised range.
Only a single SID/Label Sub-TLV
MAY be advertised in the SRLB TLV. If more than one SID/Label Sub-TLV is present, the SRLB TLV
MUST be ignored.
The originating router
MUST NOT advertise overlapping ranges.
Each time a SID from the SRLB is allocated, it
SHOULD also be reported to all components (e.g., controller or applications) in order for these components to have an up-to-date view of the current SRLB allocation. This is required to avoid collisions between allocation instructions.
Within the context of OSPF, the reporting of Local SIDs is done through OSPF sub-TLVs, such as the Adjacency SID (
Section 6). However, the reporting of allocated Local SIDs can also be done through other means and protocols, which are outside the scope of this document.
A router advertising the SRLB TLV
MAY also have other label ranges, outside of the SRLB, used for its local allocation purposes and not advertised in the SRLB TLV. For example, it is possible that an Adjacency SID is allocated using a local label that is not part of the SRLB.
The RI LSA can be advertised at any of the defined flooding scopes (link, area, or autonomous system (AS)). For the purpose of SRLB TLV advertisement, area-scoped flooding is
REQUIRED.
The Segment Routing Mapping Server Preference TLV (SRMS Preference TLV) is used to advertise a preference associated with the node that acts as an SR Mapping Server. The role of an SRMS is described in [
RFC 8661]. SRMS preference is defined in [
RFC 8661].
The SRMS Preference TLV is a top-level TLV of the Router Information Opaque LSA (defined in [
RFC 7770]).
The SRMS Preference TLV
MAY only be advertised once in the Router Information Opaque LSA and has the following format:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Preference | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
where:
-
-
Type:
-
15
-
Length:
-
4 octets
-
Preference:
-
1 octet, with an SRMS preference value from 0 to 255
-
Reserved:
-
SHOULD be set to 0 on transmission and MUST be ignored on reception
When multiple SRMS Preference TLVs are received from a given router, the receiver
MUST use the first occurrence of the TLV in the Router Information Opaque LSA. If the SRMS Preference TLV appears in multiple Router Information Opaque LSAs that have different flooding scopes, the SRMS Preference TLV in the Router Information Opaque LSA with the narrowest flooding scope
MUST be used. If the SRMS Preference TLV appears in multiple Router Information Opaque LSAs that have the same flooding scope, the SRMS Preference TLV in the Router Information Opaque LSA with the numerically smallest Instance ID
MUST be used and subsequent instances of the SRMS Preference TLV
MUST be ignored.
The RI LSA can be advertised at any of the defined flooding scopes (link, area, or autonomous system (AS)). For the purpose of the SRMS Preference TLV advertisement, AS-scoped flooding
SHOULD be used. This is because SRMS servers can be located in a different area than consumers of the SRMS advertisements. If the SRMS advertisements from the SRMS server are only used inside the SRMS server's area, area-scoped flooding
MAY be used.