The best journeys in life are those that answer questions you never thought to ask.

  • Overview
  • Flex algo definition via a ISIS flooding
  • How Flex Algo works?
  • Advantages of Flex Algo
  • Drawbacks of using Flex Algo

Check the video for Network Segmentation at the  bottom of the blog

The Interior Gateway Protocol (IGP) computed path is often chosen based on the shortest IGP metric. These routes frequently, though,
are accompanied with traffic-engineered paths. These traffic designed pathways are employed purposefully or arbitrarily to satisfy particular
network needs. These traffic planned paths are made possible using RSVP TE or SR TE. Source routing using a specified set of metrics and constraints is
used in both techniques.

"Good day, everyone. I'm Saby, and I'll give a brief introduction to the flex algorithm and how it's used in segment routing.
I'use ISIS as the underlay protocols with MPLS SR in a lab to showcase this concept.

Flex Algo provides a mechanism for IGP to compute constraint based path across a domain using extension to ISIS and OSPF to advertise TLV containing one or
more flex algo definitions.
Generally FAD associate with a numeric value and identifier a set of metrics amd constraints that should be used to calcualte the best path along with
constrained topology.
When it used with SR-MPLS one or more prefix SID can be associated with flex algo identifier, there by providing the level of Traffic engineering
without any associated control plane overhead or additional label stack imposition.
This is the biggest difference betweeen SRTE and Flex Algo
Flex Algo actually enhances the routing protocol itself to create forwarding entries based on algo definition.
Flex Algo leverage all the SRTE benefits, such as TiLFA, ODN, Auto Steering and colouring etc.So the classic SFP technology used for shortest path calculation is reffered to as algo 0.
In addition to algo 0, we can add additional new flex algo's as well.
Flex algo create a network slice topology
This also create virtual network node may or may not particapate in flex algo, allowing subtopologies to be created.

How flex Algo works ?

We need to have a seperate prefix SID defined in the router and each prefix SID is related to the Algo
The default Algo : Algo 0 which is default IGP to find based on the best path with the IGP metric and by default every nodes participate in the default
algo 0

What we do with the flex algo we create a flexible parallel algo in the routing protocol itself and associate another prefix SID.

Just think like assigning two loopbacks in a routing protocol.
But in case of Flex Algo we have one one loopback associated with different Prefix SID.
Each nodes advertise it algo capability, either with algo zero where every nodes participating in, or additional algo that is defined for flex algo will
advertise using the IGP
These entries are installed in the FIB

- Algo 0 IGP metric
- Algo 128 Min latency metric
Flex algo definition learned from a central entity via a ISIS flooding
A new TLV Flex Algo Definition (FAD) which tells all the devices in the flex algo as to what the definition is the flex algo is.

A:admin@R1# show router ISIS database R1.00-00 level 1 detail | match "Router Cap" post-lines 11
Router Cap : 192.0.2.1, D:0, S:0
TE Node Cap : B E M P
SR Cap: IPv4 MPLS-IPv6
SRGB Base:12000, Range:8000
SR Alg: metric based SPF, 128
Node MSD Cap: BMI : 12 ERLD : 15
FAD Sub-Tlv:
Flex-Algorithm : 128
Metric-Type : delay
Calculation-Type : 0
Priority : 100
Flags: M


Metric type currently used is delayed.
Calculation Type : This contains the value 0-127 identifying the IGP algorithm type such as shortest path a
One of more Sub TLV fields may be present to specify colours that are used to include or exclude links during the Flex Algo path computation.
These are encoded using exculding Admin Group, Include Admin groups, include-all admin groups and exclude SRLG sub-Tlv
Flag M : prefix metrix is defined and when set it indicates that the flex algo prefim metric (FAPM) sub-tlv must be advertise with the prefix.
The flex algoo can be defined 128-255 metric type latency.
Advertise Definition :
- Allows that router to advertise Algo 128 and the metric type is 128.
Node which are participating in flex algo there is a consistent definition of algo.
Flex Algo :
Flex Algo provides a mechanism for IGP to compute constraint based path across a domain using extension ISIS or OSPF to advertise TLV
containing one or more FAD (Flexible Algo Definition)

Every IGP nodes which configured with one additional prefix SID associated with the flex algo (128)
As a result IGP continously delivers two different ways to reach every node.
A shortest path according to the IGP metric (Prefix SID with Algo 0 of the destination node
A shortest path according to delay metric (Prefix SID based on Flex Algo 128) of the destination nodes.

Flex Algo is an intrinsic component of the SR TE architecture : it leverages the automated steering component to automatically steer service traffic into
Flex Algo Prefix SID, upon ODN automated instantiation of an inter domain SR-TE policy, the SR pce leverages any per IGP domain flex algo prefix SID that
provides the required path.
All the link have a static unidirectional delay value of 10ms
these static or dynamic values are advertised into ISIS and floods
ISIS will flood every other router in the topology with this delay injection in the link between R2-R4
Flex Algo 128 therefore recomputes a path to move back to the low latency route.

Advantage of Flex Algo :
A important benefit of the Flex Algo sollution is that no additional addressed need to be configured.
The same prefix can be associated with multiple Prefix SID of multiple algo.

Drawbacks of using Flex Algo :
The drawback of using flex algo of course, is that traffic engineering constraints are limited to using links that belong to a certain set of admin group
Also there are no flexibility in the sense that all tunnels will satisfy that exact same set of traffic engineering constraints

Check the video for Network Segmentation right bellow