Segment Routing Policy Active Path Selection

An SR Policy is used to instantiate an ordered list of segments. SR policy is identified with tuple; Head-end, color and End-point. The Head-end is the node where the policy is implemented. It may be an IPv4 or IPv6 address. The End-point indicates the destination of the policy. The endpoint is specified as an IPv4 or IPv6 address. And the color is a 32-bit numerical value. Color can also be advertised in the BGP updates inside and Extended Color Community.

In one SR Policy you may have one or more candidate paths. An SR Policy will have one single path entry in the data plane which will be selected between candidate paths. This is going to be the Active Path of an SR Policy. A path is selected for an SR Policy when the path is valid and its preference is the best among all the candidate paths.

Firs requirement to be an active path, path must be valid.

There is 3 ways of SR Policy implementation; It can be configured from CLI, it can be configured on a PCE Server and distributed to router via PCEP, or it can be configured on any router and distributed using BGP. In one SR policy you may have one or more of these implementation methods. There is no restriction to have path information learned from an external component and configured locally at the same time. But it is obvious that, if there are multiple paths inside an SR Policy, there will be an active path selection process.

This active path selection process will be done initially and will be executed again after a change; like new path learning, active path losing, validity of one or more path changing etc.

The first criteria of active path selection is Preference of path. Highest preference value is selected and I think this is the best practice. If you can plan and configure different preference values for candidate paths with an order which you would like to use, that would work great. In that case there is no meaning of how you implemented the SR Policy paths, via CLI or BGP or PCEP. And also note that, in any case we don’t care about if the path is explicitly configured or dynamically calculated.

Assume that all the links have same IGP Cost, name of SR Policy is VIP and color is RED.

SR Policy VIP, 192.1.1.1, Red, 192.1.1.6

            Candidate Path 1, Preference 10, SID List: 16002, 16004, 16006 

            Candidate Path 2, Preference 20, SID List: 16003, 16005, 16006 à Active Path

Assume that all the links have same IGP and TE Metric assigned according to topology, name of SR Policy is DYNAMIC and color is RED.

SR Policy DYNAMIC, 192.1.1.1, Red, 192.1.1.6

            Candidate Path 1, Preference 10, Explicit Path SID List: 16003, 16005, 16006

            Candidate Path 2, Preference 20, Lowest IGP Metric à Active Path

(Note that, according to current drafts, default preference value is 100)

In case you have multiple paths with same preference value, following active path selection process will be executed.

1.         Higher value of Protocol-Origin is selected.

2.         Lower value of originator will be selected.

3.         Higher value of discriminator will be selected

(In the new version of draft RFC, there is also one more option between Protocol-Origin and Originator which is Specification via configuration.)

Protocol Origins are like administrative distance of routing protocols. There are pre-defined numbers and you can always change these values with configuration. For now, PCEP has “10”, BGP has “20” and CLI has “30” of protocol origin value. By default the head-end router will select the one that is configured on CLI. But if you think it is better option to use for example paths learned via PCEP is better, you can increase its protocol origin value. Value can be defined up to 255.

Originator identifies the node which provisioned or signalled the candidate path on the head-end. It is expressed with AS number and Node-address and it is 160 bit.  

The Discriminator is a 32 bit value associated with a candidate path and uniquely identifies the path inside an SR Policy. For PCEP and CLI configuration, discriminator value is 0 by default. It is better you configure it. When distributing SR Policies via BGP, the route distinguisher value will be used as discriminator.

According to topology and path definitions, we have different paths with different sources. It is not a good practice but all of the paths have the same preference value. The rule is CLI>BGP>PCEP with the default protocol origin values. That is because the green path will be chosen as an active path.

Let’s assume we have lost the link between A5 and A6.

Normally we could say, the path learned via BGP will be selected. But the first rule is, the path must be valid. And if we lose the path between A5 and A6, the path learned by BGP will be invalid and the last one will be chosen. That is the path learned via PCEP from PCE Server.

About: fabricplane