Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Configuring Segment Routing Microloop Avoidance in OSPFv2 Networks

Overview

Microloops are packet forwarding loops that occur in the network following network change events such as link down, link up, or metric change. When a network change event occurs, different routers update their forwarding states at different times. This can lead to packets getting looped between upstream and downstream routers for a transient period, resulting in packet loss, jitter, and out-of-order packets. Microloops can consume the available bandwidth of the links, which impacts the efficient transmission of useful packets.

Microloop avoidance can prevent forwarding of looping packets. The segment routing microloop avoidance detects if microloops are possible following a topology change. When a network change event is detected, the routes are programmed to take the post-convergence path, that uses a combination of node and adjacency SIDs. This ensures the routers that might not yet have converged do not loop the packets causing microloops. This behavior lasts for a configurable delay. Once the delay timer expires, routes are programmed normally by using node-SID of the destinations.

Requirements

This example uses the following hardware and software components:

  • Eight MX Series routers.

  • Junos OS Release 22.1R1 or later.

Topology

In Figure 1 device R0 and device R7 are the ingress and egress routers that support devices CE1 and CE2. The devices R1, R2, R3, R4, R5, and R6 comprise an IPv4 only provider core network. All the devices belong to the same autonomous system. OSPFv2 is the interior gateway protocol in the core configured to support microloop avoidance. In this example the device R2 is configured as an IPv4 route reflector with IBGP peering sessions to both R0 and R7. No other routers speak BGP in this example. The Device R6 has the firewall filter configured to detect packets with microloops if any following a link down event.

Figure 1: Microloop Avoidance Topology Network topology diagram for AS 65000 with routers R0 to R7 and customer edge devices CE1 and CE2. Shows IP addresses, subnet info, and point-to-point links for network design and troubleshooting.

Configuration

CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.

Device R0

Device R1

Device R2

Device R3

Device R4

Device R5

Device R6

Device R7

Configuring Device R0

Step-by-Step Procedure

To configure segment routing microloop avoidance path in an OSPFv2 network, perform the following steps on the R0 device:

  1. Configure the device interfaces to enable IP and MPLS transport.

  2. Configure the loopback interface (lo0) addresses that is used as router ID for OSPF sessions.

  3. Configure the router ID and autonomous system (AS) number to propagate routing information within a set of routing devices that belong to the same AS.

  4. Define a policy to load balance packets and apply the per-packet policy to enable load balancing of traffic.

  5. Configure R0 to advertise the loopback address. The prefix-segment index option sets the base label for each router's loopback. In this example the base index is set to reflect| the router number. As a result, R0 uses 1000.

  6. Configure MPLS on all interfaces excluding the management interface. Also enable traffic engineering.

  7. Configure the MPLS label range to assign static labels for the links.

  8. Configure BGP peering between R0 and the route reflector R2. Configure the unicast network layer reachability information (NRLI) to allocate a unique label for each prefix on the devices.

  9. Configure TI-LFA to enable protection against link and node failures. SR using TI-LFA provides faster restoration of network connectivity by routing the traffic instantly to a backup or an alternate path if the primary path fails or becomes unavailable.

  10. Configure backup shortest path first (SPF) attributes such as maximum equal-cost multipath (ECMP) as 8 and maximum number of labels as 5 for TI-LFA for the OSPFv2 protocol.

  11. Configure prefix segment attributes, the start label and the index range for segment routing global blocks (SRGBs) in SPRING for the OSPFv2 protocol.

  12. Configure the loopback interface as passive to ensure the protocols do not run over the loopback interface and that the loopback interface is advertised correctly throughout the network.

  13. Configure OSPF area 0 on the point-to-point interface of the device R0.

  14. Configure the computation and installation of a backup path that follows the post-convergence path on the given area and interface for the OSPFv2 protocol. Also enable node-link protection on the these interfaces that follow post-convergence path.

  15. Configure microloop avoidance that temporarily installs a post-convergence path for routes potentially affected by microloops and specify a delay time period of 60000 milliseconds for the OSPFv2 protocol. The temporary path reverts to the node SIDs of the destination after the delay timer expires.

Results

Check the results of the configuration:

Verification

Confirm that the configuration is working properly.

The following section explains microloop avoidance for a link down event.

Verify Connectivity Between R0 and R7 Before the Link is Disabled Between R0 and R1

Purpose

Verify that the Device R0 can reach the destinations on Device R7.

Action

From operational mode, run the ping command on the device R0.

Meaning

These results confirm that the device R0 can reach device R7 in the OSPFv2 network.

Verify Disabling the Link Between R0 and R1

Purpose

To verify disabling the link between R0 and R1 on the device R0

Action

From configuration mode, run the disable interface command on the device R0

To verify the link is disabled, from operational mode, run the show interfaces command on the device R0

Meaning

The output indicates the physical link between R0 and R1 is disabled and is administratively down.

Verify Microloop-avoidance Path Installed for the Destination After the Link is Disabled

Purpose

Verify microloop-avoidance path installed for the destination routes R7 from R0 when the link is disabled between R0 and R1 by verifying routes in the inet.3 table and route label details in the mpls.0 table.

Action

From operational mode, run the show route table inet.3 command on the device R0.

From operational mode, run the show route label label value protocol ospf extensive command on the device R0.

Meaning

The output indicates that when the link between R0 and R1 goes down, the microloop-avoidance path is installed for R7 from R0 through R4 until the delay timer expires.

Verify Packets With Microloops

Purpose

Verify packets with microloops by using firewall counter information

Action

From operational mode, run the show firewall command on the device R6.

Meaning

The output displays the mplsfilter configured on the device R6 to display microloops if there are any. The value 0 indicates there are no packets with microloops.

Verify Microloop-avoidance Path Changes to Post-convergence- path After the Delay Timer Expires

Purpose

Verify microloop-avoidance path installed for the destination routes R7 from R0 changes to post-convergence-path after the delay timer 60000 ms expires.

Action

From operational mode, run the show route table inet.3 command on the device R0.

From operational mode, run the show route label label value protocol ospf extensive command on the device R0.

Meaning

The output indicates that the microloop-avoidance path is changed to post-convergence-path after the delay timer expires.

Verify Connectivity Between R0 and R7

Purpose

Verify that the Device R0 can reach the destinations on Device R7.

Action

From operational mode, run the ping command on the device R0.

Meaning

These results confirm that the device R0 can reach device R7 in the OSPFv2 network and that the traffic flows with 0% packet loss in case of link down because of the microloop-avoidance path configured.

Verify the Path Changes to Microloop-avoidance Path After the Link is Enabled

Purpose

Verify the path changes to microloop-avoidance path for the destination when the link is enabled between R0 and R1.

Action

From operational mode, run the show route table inet.3 command on the device R0.

From operational mode, run the show route label label value protocol ospf extensive command on the device R0.

Meaning

The output displays the routes to the destination R7 from R0 which includes microloop-avoidance path and the post-convergence path after the link is enabled between R0 and R7.