SR-TE Flex-Algo w/ Affinity
Load sr-te.flex-algo.init.cfg
Configure flex algo 128 to use the IGP path but exclude RED links. Configure the R3-R5 link as color RED. Traffic from CE101 to CE107 should then take the path R1-R3-R9-R5-R7.
Answer
Explanation
When using link affinity in a flex-algo definition, you must define the affinity and assign affinities to interfaces under the IGP. This is true even if you configured the same affinity under segment-routing traffic-eng.
To start, all routers will define the flex algo and its constraint (avoid RED links). All routers must define the bit mapping for affinity name “RED.”
All routers will advertise the flex algo definition. The bit mapping is 0 index-based, so bit 1 maps to 0x2. The flex algo definition advertisement says to exclude this admin group.
Next, we must define the affinity on R3 and R5 under the IGP.
We must define this under the IGP because the affinity must be advertised as part of an application specific link attribute. The affinity must be linked to the flex-algo application. It is different from the general MPLS-TE link affinity.
As before, we define the ODN policy on R1, and advertise the additional prefix SID for this flex algo on R7.
We’ll now color routes from R7:
R1 instantiates the ODN policy, which uses a single label:
A traceroute from CE101 to CE107 confirms the path is correct:
Last updated