Latest

What is OSPF Loop-Free Alternate (LFA) Fast Reroute (FRR) ?

What is OSPF Loop-Free Alternate (LFA) Fast Reroute (FRR) ?

OSPF (Open Shortest Path First) is a routing protocol that establishes routing paths within a network. In an OSPF network, regions are used to organize logically related routers. Ideally, all areas should be physically connected to the backbone (Area 0), which serves as a centralized point for routing information.

⭐Related : Top OSPF Protocol Interview Questions and Answers
⭐Related : OSPF protocol : OSPF Packet Types

 What is OSPF Loop-Free Alternate (LFA) Fast Reroute (FRR) ?

OSPF Loop-Free Alternate (LFA) Fast Reroute (FRR) enables OSPF to quickly move (within 50 ms) to an alternate link when the main path fails. 

Without LFA FRR, OSPF have to re-run SPF to find a new path when the primary path fails. But with the use of OSPF Loop-Free Alternate (LFA) Fast Reroute (FRR), OSPF pre-computes a backup path and this backup path is installed in the routing table and forwarding table of the router.

So, When a failure is detected, the router immediately starts using the LFA path instead of having to recalculate a new route from scratch (which can take longer). OSPF achieves LFA by leveraging the fact that all routers in the same OSPF area share the same Link-State Database (LSDB). This allows a router to virtually become any other router in the area and calculate a backup path from that perspective.

There are two fundamental ways to calculate LFAs: per-link and per-prefix. Per-link LFA assigns the same backup next hop to all prefixes that share the same broken link. Per-prefix LFA allows for more specific choice of LFAs. LFA FRR is not always possible. In some network topologies, a loop-free alternate path might not exist.

 Configuration Example OSPF LFA FRR

Let's take an network topology showing R1 router is connected to R2, R3 and R4 router and the further R2, R3 and R4 routers are connected to R5 router. So there are three different paths to reach from R1 to R5.

OSPF Loop-Free Alternate (LFA) Fast Reroute (FRR)
Fig 1.1- OSPF LFA FRR

Verify the routing table of R1 for the prefix 1.1.1.0/24. According to the configured cost, R1 is using R2 20.20.20.2 as the next hop.

R1#sh ip route 1.1.1.0
Routing entry for 1.1.1.0/24
 Known via "ospf 1", distance 110, metric 13, type inter area
 * 20.20.20.2, 00:00:34 ago, via GigabitEthernet1
     Route metric is 13, traffic share count is 1
R1#
The next hop R2 20.20.20.2 is installed in the CEF forwarding table:

R1#sh ip cef 1.1.1.0
1.1.1.0/24
 nexthop 20.20.20.2 GigabitEthernet1
R1#

At this level without LFA, if R2 fails, R1 will re-perform SPF to construct a new path; however, because the prefix 1.1.1.0/24 was learned from another area, R1 will only run a partial search.

Now lets enable the fast-reroute command 

R1>enable
R1# configure terminal
R1(config)# router ospf 1
R1(config-router)#fast-reroute per-prefix enable area 0 prefix-priority low
R1(config-router)#exit
R1#

Verify that R1 selects R2 as the primary path and R3 as a backup path.

R1#sh ip route 1.1.1.0
Routing entry for 1.1.1.0/24
Known via "ospf 1", distance 110, metric 13, type inter area
Last update from 20.20.20.2 on GigabitEthernet1, 00:02:10 ago
Routing Descriptor Blocks:
 * 20.20.20.2, 00:02:10 ago, via GigabitEthernet1
     Route metric is 13, traffic share count is 1
     Repair Path: 30.30.30.2, via GigabitEthernet2
R1#

Now check the CEF forwarding table

R1#sh ip cef 1.1.1.0
1.1.1.0/24
   nexthop 20.20.20.2 GigabitEthernet1
   repair: attached-nexthop 30.30.30.2 GigabitEthernet2
R1#
Let's configure the fast-reroute keep-all-paths command.

R1>enable

R1# configure terminal

R1(config)# router ospf 1

R1(config-router)#fast-reroute keep-all-paths

R1(config-router)# exit

R1#

Lets Verify now 

R1#sh ip route 1.1.1.0
Routing entry for 1.1.1.0/24
Known via "ospf 1", distance 110, metric 13, type inter area
Last update from 20.20.20.2 on GigabitEthernet1, 00:02:10 ago
Routing Descriptor Blocks:
 * 20.20.20.2, 00:02:10 ago, via GigabitEthernet1
     Route metric is 13, traffic share count is 1
     Repair Path: 30.30.30.2, via GigabitEthernet2
R1#

Now check the CEF forwarding table

R1#sh ip cef 1.1.1.0
1.1.1.0/24
   nexthop 20.20.20.2 GigabitEthernet1
   repair: attached-nexthop 30.30.30.2 GigabitEthernet2
R1#
So now you see that the primary path is via the R2 router on the interface Gi1 and the backup path is through the R3 router on the interface Gi2. 

So if any how the R2 link is down, the R1 router makes R3 router as Primary path and R4 as Backup path for traffic to send to R5 router. 

 Important points to consider

  • OSPF achieves LFA by leveraging the fact that all routers in the same OSPF area share the same Link-State Database (LSDB). This allows a router to virtually become any other router in the area and calculate a backup path from that perspective.
  • There are two main methods for calculating LFAs: per-link and per-prefix. Per-link LFA assigns the same backup next hop to all prefixes that use the same failing link. Per-prefix LFA can be more specific in choosing LFAs.
  • LFA FRR is not always possible. In some network topologies, a loop-free alternate path might not exist.

Continue Reading...

Free Tools...