The concept of a segment routing policy is described by the IETF draft draft-filsfils-spring-segment-routing-policy. A segment routing policy specifies a source-routed path from a head-end router to some network endpoint, and it specifies the traffic flows that are steered into that source-routed path. A segment routing policy intended for use by a particular head-end router can be statically configured on that router or advertised to that router in the form of a BGP route.
The following terms are important to understanding the structure of a segment routing policy and the relationship between one policy and another.
A segment routing policy is statically configured on the router using one of the supported management interfaces. In the Nokia data model, static policies are configured under config>router>segment-routing>sr-policies.
There are two types of static policies: local and non-local. A static policy is local when its head-end parameter is configured with the value local. This means that the policy is intended for use by the router where the static policy is configured. Local static policies are imported into the local segment routing database for further processing. If the local segment routing database chooses a local static policy as the best path for a particular (color, endpoint) then the associated path and its segment lists will be installed into the tunnel table (for next-hop resolution) and as a BSID-indexed MPLS label entry.
A static policy is non-local when its head-end parameter is set to any IPv4 address (even an IPv4 address that is associated with the local router, which is a configuration that should generally be avoided). A non-local policy is intended for use by a different router than the one where the policy is configured. Non-local policies are not installed in the local segment routing database and do not affect the forwarding state of the router where they are configured. In order to advertise non-local policies to the target router, either directly (over a single BGP session) or indirectly (using other intermediate routers, such as BGP route reflectors), the static non-local policies must be imported into the BGP RIB and then re-advertised as BGP routes. In order to import static non-local policies into BGP, you must configure the sr-policy-import command under config>router>bgp. In order to advertise BGP routes containing segment routing policies, you must add the sr-policy-ipv4 family to the configuration of a BGP neighbor or group (or the entire base router BGP instance) so that the capability is negotiated with other routers.
Local and non-local static policies have the same configurable attributes. The function and rules associated with each attribute are:
The following are configuration rules related to the previously described attributes:
Each static policy (local and non-local) must include, in its configuration, at least one segment-list containing at least one segment. Each static-policy can have up to 32 segment-lists, each containing up to 11 segments. Each segment-list can be assigned a weight to influence the share of traffic that it carries compared to other segment-lists of the same policy. The default weight is 1.
The segment routing policy draft standard allows a segment-list to be configured (and signaled) with a mix of different segment types. When the head-end router attempts to install such a segment routing policy, it must resolve all of the segments into a stack of MPLS labels. In the current SR OS implementation this complexity is avoided by requiring that all (configured and signaled) segments must already be provided in the form of MPLS label values. In terms of the draft standard, this means that only type-1 segments are supported.
The base router BGP instance is configured to send and receive BGP routes containing segment routing policies. In order to exchange routes belonging to the AFI=1, SAFI=73 address family with a particular base router BGP neighbor, the family configuration that applies to that neighbor must include the sr-policy-ipv4 keyword.
When BGP receives an sr-policy-ipv4 route (AFI=1, SAFI=73) from a peer, it runs its standard BGP best path selection algorithm to choose the best path for each NLRI combination of distinguisher, endpoint, and color. If the best path is targeted to this router as head-end, BGP extracts the segment routing policy details into the local segment routing database. A BGP segment routing policy route is deemed to be targeted to this router as the head-end if either:
An sr-policy-ipv4 route can be received from either an IBGP or EBGP peer but it is never propagated to an EBGP peer. An sr-policy-ipv4 route can be reflected to route reflector clients if this is allowed (a NO_ADVERTISE community is not attached) and the router does not consider itself the head-end of the policy.
Note: A BGP segment routing policy route is considered malformed, and triggers error-handling procedures such as session reset or treat-as-withdraw, if it does not have at least one segment-list TLV with at least one segment TLV. |
Segment Routing policies (static and BGP) for which the local router is head-end are processed by the local segment routing database. For each (color, endpoint) combination, the database must validate each candidate path and choose one to be the active path. The steps of this process are outlined in Table 54.
Step | Logic |
1 | Is the path missing a binding SID in the form of an MPLS label? Yes: This path is invalid and cannot be used. No: Go to next step |
2 | Does the path have any segment-list containing a segment type not equal to 1 (an MPLS label)? Yes: This path is invalid and cannot be used. No: Go to next step |
3 | Are all segment-lists of the path invalid? A segment-list is invalid if it is empty, if the first SID cannot be resolved to a set of one or more next-hops, or if the weight is 0. Yes: This path is invalid and cannot be used. No: Go to next step |
4 | Is the binding-SID an available label in the reserved-label-block range? Yes: Go to next step. No: This path is invalid and cannot be used. |
5 | Is there another path that has reached this step that has a higher preference value? Yes: This path loses the tie-break and cannot be used. No: Go to next step. |
6 | Is there a static path? Yes: Select the static path as the active path because the protocol-origin value associated with static paths (30) is higher than the protocol-origin value associated with BGP learned paths (20). No: Go to next step. |
7 | Is there a BGP path with a lower originator value? The originator is a 160-bit numerical value formed by the concatenation of a 32-bit ASN and a 128-bit peer address (with IPv4 addresses encoded in the lowest 32 bits.) Yes: This path loses the tie-break and cannot be used. |
8 | Is there another BGP path with a higher distinguisher value? Yes: Select the BGP path with the highest distinguisher value. |
At step 3 of Table 54, the router attempts to resolve the first segment of each segment-list to a set of one or more next-hops and outgoing labels. It does so by looking for a matching SID in the segment routing module, which must correspond to one of the following:
Note: The label value in the first segment of the segment-list is matched against ILM label values that the local router has assigned to node-SIDs, adjacency-SIDs, and adjacency-set SIDs. The matched ILM entry may not program a swap to the same label value encoded in the segment routing policy - for example, in the case of an adjacency SID, or a node-SID reachable through a next-hop using a different SRGB base. |
When a statically configured or BGP signaled segment routing policy is selected to be the active path for a (color, endpoint) combination, the corresponding path and its segment lists are programmed into the tunnel table of the router. The resulting tunnel entries can be used to resolve the following types of BGP routes:
For an unlabeled IPv4 BGP route to be resolved by an segment routing policy:
Suppose that under these conditions there is an IPv4 route with a color extended community (value C) and BGP next-hop address N. The order of resolution is as follows:
For an unlabeled IPv6 BGP route to be resolved by an segment routing policy:
Suppose that under these conditions there is an IPv6 route with a color extended community (value C) and BGP next-hop address N. The order of resolution is as follows:
For a label-unicast IPv4 BGP route to be resolved by a segment routing policy:
Suppose that under these conditions there is a label-IPv4 route with a color extended community (value C) and BGP next-hop address N. The order of resolution is as follows:
For a label-unicast IPv6 BGP route to be resolved by an segment routing policy:
Suppose that under these conditions there is a label-IPv6 route with a color extended community (value C) and BGP next-hop address N. The order of resolution is as follows: