Flexible Algorithm

Flexible algorithm

A flexible algorithm is a customizable IGP routing method that:

  • enables operators to define path computation constraints based on specific metrics and link properties.

  • allows confining the path to a particular logical plane in networks with multiple planes.

  • supports user-defined meanings and intent for routing behaviors within a network.

A flexible algorithm filters or confines the IGP topology to meet specific transport characteristics or policies, rather than just computing a default shortest path to all destinations. Crosswork Network Controller enables visualization of network subsets that provide a specific set of transport characteristics. This visualization helps you deploy, maintain, and verify that the flexible algorithm’s intended behavior is realized in your network.

For example:

  • You can use a flexible algorithm to improve service availability.

  • You can define disjoint logical topologies to enhance network resiliency against failures.

  • You can verify that two flexible algorithm topologies have no shared nodes or links, ensuring complete disjointness.

  • If common nodes or link exist, you can identify them and update configurations to better meet your network goals.

Supported Flexible Algorithm metrics and constraints

The Crosswork Network Controller supports a limited set of metrics and constraints compared to those available in Cisco IOS XR. If you configure the Flexible Algorithm with unsupported metrics and constraints, the feature operates as expected on the routers. However, the SR policy path and topology visualization in the Crosswork Network Controller UI may be inaccurate.

Metrics

The Crosswork Network Controller supports these metrics:

  • IGP metric

  • ASLA traffic engineering default: required, or the link is pruned.

  • ASLA min unidirectional link delay: required, or the link is pruned.

Constraints

In Application-Specific Link Attribute (ASLA), Crosswork Network Controller supports these constraints:

  • include-any

  • include-all

  • exclude

  • exclude srlg: Links belonging to specified Shared Risk Link Groups (SRLGs) can be excluded from Flexible Algorithm topology calculations and visualization.

Configure flexible algorithm affinities

Crosswork Network Controller does not automatically collect flexible algorithm affinity names from devices. For consistency with flexible algorithm affinity names, you can define affinities in Crosswork Network Controller with the same names and bit positions that are used on the device. This helps maintain consistency and improve visualization.


Note


  • The affinity bit position ranges from 0–255 allowing more granular affinity definitions.

  • If an affinity mapping is not defined in the UI, the affinity name will appear as "UNKNOWN".

  • Crosswork Network Controller sends the bit information to the SR-PCE only during provisioning.


On devices, affinity maps are configured by setting bits for each affinity name. The following example shows the flexible algorithm affinity configuration (affinity-map) on a device:

router isis CORE
                is-type level-2-only
                net 49.0001.0000.0000.0002.00
                log adjacency changes
                affinity-map b33 bit-position 33
                affinity-map red bit-position 1
                affinity-map blue bit-position 5
                flex-algo 128
                priority 228
                advertise-definition
                affinity exclude-any blue indigo violet black
                ! 

See SR configuration documentation for your specific device to view descriptions and supported configuration commands (for example, Segment Routing Configuration Guide for Cisco ASR 9000 Series Routers).

To add flexible algorithm affinities in Crosswork Network Controller, complete these steps:

Procedure


Step 1

Choose Administration > Settings > Traffic engineering > Affinity > Flex-Algo affinities.

Step 2

Click + Create to add a new affinity mapping.

Step 3

Enter the name and the bit position corresponding to the device configuration.

Step 4

Click Save to save the mapping.

Step 5

To view all flexible algorithm affinities for a link, see View flexible algorithm details.


Visualize flexible algorithm topologies

Crosswork Network Controller allows you to visualize flexible algorithm nodes and links on the topology map. You can view nodes and links that have been manually configured or dynamically provisioned using the UI.


Note


To apply a flexible algorithm constraint when dynamically provisioning an SR-MPLS policy, see Create dynamic SR-MPLS policies based on optimization intent.


Before you begin

Configure flexible algorithms in your network. Refer to the SR flexible algorithm configuration documentation for your specific device to view descriptions and supported configuration commands (for example, see the Segment Routing Configuration Guide for Cisco NCS 540 Series Routers).


Note


Visualization of flexible algorithms is not possible if the same flexible algorithm ID is used across different domains.


Procedure


Step 1

Choose Services & Traffic Engineering > Traffic Engineering.

Step 2

On the topology map, click Display Preferences icon .

Step 3

Click Flex Algo.

Step 4

From the drop-down list, select up to two flexible algorithm IDs.

Step 5

View the flexible algorithm types and confirm that your selections are correct. Note the color assignments for each flexible algorithm.

Step 6

(Optional) Select Show selected Flex Algo topology only to isolate the flexible algorithms on the topology map. When you enable this option, SR policy selection is disabled.

  1. Select Show Flex Algo A+B links only to display links and nodes that participate in both flexible algorithms.

Step 7

After making changes to flexible algorithm selections, click Apply to display the updated topology map.

Figure 1. Flexible algorithm on map

Flexible algorithm on map

Note

 

If a selected flexible algorithm is defined with criteria, but no link and node combinations match those criteria (for example, an affinity to include all nodes or links with the color blue), the topology map appears blank. When a selected flexible algorithm is not configured on a node or link, the topology map shows the default blue color for that link or node.

Step 8

Click Save View to save the topology view and flexible algorithm selections.


View flexible algorithm details

Before you begin

Flexible algorithm considerations

  • Application-Specific Link Attribute (ASLA) is supported on PCC and core routers that are Cisco IOS XR 7.4.1 or later versions.

  • Crosswork Network Controller only supports strict ASLA handling for flexible algorithm topologies.

  • For flexible algorithms defined with Traffic Engineering (TE) or Delay metric types, only nodes advertising OSPF or IS-IS ASLA TE and ASLA Delay link metrics will be included in the corresponding flexible algorithm topology.

To view device or link flex algorithm details, complete these steps:

Procedure


Step 1

Choose Services & Traffic Engineering > Traffic Engineering.

Step 2

View device flexible algorithm details.

  1. On the topology map, click on a device.

  2. In the Device details page, choose Traffic engineering > Flex Algo. Then, select the Flexible Algorithm for which you would like to view details.

    The Elected definition displays all metrics and constraints defined for this flexible algorithm.

    Figure 2. Flex Algo device details

    Flex Algo device details

Step 3

To view whether a link is part of a flexible algorithm topology:

  1. On the topology map, click on a link.

  2. In the Link details page, click the Traffic engineering tab.

    • If the link is part of a flexible algorithm topology, the FA topologies row shows the flexible algorithm(s) to which the source and destination devices belongs.

    • If SRLG exclusion constraints are defined for a flexible algorithm and the link is a member, the FA SRLGs row displays the configured SRLG values for the source and destination devices.

    Figure 3. Flex Algo link details

    Flex Algo link details

Configure and visualize flexible algorithm SRLG exclusion

Flexible algorithms can be configured to exclude groups of links that share common risks, known as Shared Risk Link Groups (SRLGs). This allows operators to prune links from the flexible algorithm topology based on shared risk attributes, ensuring that paths avoid common failure points and enhance network resiliency. When you set an SRLG exclusion for a flexible algorithm, the excluded SRLGs are automatically filtered out from the topology visualization and routing calculations. This helps operators plan alternate, protected paths and avoid risks tied to certain links.


Note


This feature is supported on all devices running Cisco IOS XR software version 25.1.1 or later.


To configure flexible algorithm SRLG exclusion:

Procedure


Step 1

Configure SRLGs on your devices. Create a group to identify specific SRLG and give a unique value. By associating an interface with an SRLG, you can apply policies or constraints based on these groups.

Note

 

The SRLG value is displayed only for IPv4 links and is not shown for IPv6 links.

Example:

Cisco IOS XR - SRLG definition
srlg
 interface GigabitEthernet0/0/0/4
  name groupA
 !
 name groupA  !! user-defined group names to identify specific SRLG
  value 900 !! user-assigned numerical identifiers for the SRLG groups
 !
 name groupB
  value 800
 !

Step 2

Configure the flexible algorithm definition with the SRLG exclusion constraint on your devices.

Example:

Cisco IOS XR - ISIS routing configuration
router isis CORE
 address-family ipv4 unicast
  advertise application flex-algo link-attributes srlg
 !
 flex-algo 129
  priority 129
  srlg exclude-any groupB
  advertise-definition
 !

This configuration advertises the relevant link and SRLG attributes via IS-IS, so other routers can also compute consistent, SRLG-aware paths. It ensures that for Flex-Algo 129, any links that are part of groupB are excluded from path computation and routing.

Note

 
  • Ensure the flexible algorithm priority is set higher than 128 (for example, 129 in the example) for the exclude SRLG configuration to be correctly reflected and applied.

  • The advertise application flex-algo link-attributes srlg configuration command is not required for OSPF routing protocol.

Step 3

Crosswork Network Controller automatically discovers these SRLG exclusion constraints from the network. The flexible algorithm for the device then reflects the exclusion. To view these details:

  1. Choose Services & Traffic Engineering > Traffic Engineering.

  2. On the topology map, click on a device. In the Device details page, choose Traffic engineering > Flex Algo.

    Algo129 displays Exclude SRLG as an elected definition.

    Figure 4. Flex Algo device details with SRLG exclusion
    Flex Algo device details with SRLG exclusion

Step 4

To view whether a link is part of a flexible algorithm topology:

  1. On the topology map, click on a link.

  2. In the Link details page, click the Traffic engineering tab. If the link is a member, the FA SRLGs row displays the configured SRLG values for the source and destination devices.

    Figure 5. Flex Algo link details with FA SRLGs
    Flex Algo link details with FA SRLGs

Step 5

To visualize the flexible algorithm topology with SRLG exclusions:

  1. On the topology map, click Display Preferences icon and then click Flex Algo.

  2. From the drop-down list, select the flexible algorithm ID (for example, 129) to filter and click Apply.

    The updated topology map displays the flexible algorithm path. Links that were excluded due to SRLG constraints are marked differently to indicate their exclusion from this specific topology.

    Figure 6. Flexible algorithm on map with excluded link
    Flexible algorithm on map with excluded link