Supported Platforms
Examples: Configuring Loop-Free Alternate Routes for OSPF
- Loop-Free Alternate Routes for OSPF Overview
- Configuring Link Protection for OSPF
- Configuring Node-Link Protection for OSPF
- Excluding an OSPF Interface as a Backup for a Protected Interface
- Configuring Backup SPF Options for Protected OSPF Interfaces
- Configuring RSVP Label-Switched Paths as Backup Paths for OSPF
Loop-Free Alternate Routes for OSPF Overview
Support for OSPF loop-free alternate routes essentially adds IP fast-reroute capability for OSPF. Junos OS precomputes loop-free backup routes for all OSPF routes. These backup routes are preinstalled in the Packet Forwarding Engine, which performs a local repair and implements the backup path when the link for a primary next hop for a particular route is no longer available. With local repair, the Packet Forwarding Engine can correct a path failure before it receives precomputed paths from the Routing Engine. Local repair reduces the amount of time needed to reroute traffic to less than 50 milliseconds. In contrast, global repair can take up to 800 milliseconds to compute a new route. Local repair enables traffic to continue to be routed using a backup path until global repair is able to calculate a new route.
A loop-free path is one that does not forward traffic back through the routing device to reach a given destination. That is, a neighbor whose shortest path first to the destination traverses the routing device that is not used as a backup route to that destination. To determine loop-free alternate paths for OSPF routes, Junos OS runs shortest-path-first (SPF) calculations on each one-hop neighbor. You can enable support for alternate loop-free routes on any OSPF interface. Because it is common practice to enable LDP on an interface for which OSPF is already enabled, this feature also provides support for LDP label-switched paths (LSPs.)
![]() | Note: If you enable support for alternate loop-free routes on an interface configured for both LDP and OSPF, you can use the traceroute command to trace the active path to the primary next hop. |
The level of backup coverage available through OSPF routes depends on the actual network topology and is typically less than 100 percent for all destinations on any given routing device. You can extend backup coverage to include RSVP LSP paths.
Junos OS provides two mechanisms for route redundancy for OSPF through alternate loop-free routes:
- Link protection—Offers per-link traffic protection. Use link protection when you assume that only a single link might become unavailable but that the neighboring node on the primary path would still be available through another interface.
- Node-link protection—Establishes an alternate path through a different routing device altogether. Use node-link protection when you assume that access to a node is lost when a link is no longer available. As a result, Junos OS calculates a backup path that avoids the primary next-hop routing device.
When you enable link protection or node-link protection on an OSPF interface, Junos OS creates an alternate path to the primary next hop for all destination routes that traverse a protected interface.
Configuring Link Protection for OSPF
You can configure link protection for any interface for which OSPF is enabled. When you enable link protection, Junos OS creates an alternate path to the primary next hop for all destination routes that traverse a protected interface. Use link protection when you assume that only a single link might become unavailable but that the neighboring node would still be available through another interface.
Link protection is supported on:
- OSPFv2 and OSPFv3 interfaces
- OSPFv3 unicast realms
- OSPFv2 unicast topologies, except for multicast topologies
- All routing instances supported by OSPFv2 and OSPFv3
- Logical systems
To configure link protection for an OSPF interface:
- Include the link-protection statement at the [edit protocols (ospf | ospf3) area area-id interface interface-name] hierarchy level.
![]() | Best Practice: When you configure link protection for OSPF, you must also configure a per-packet load-balancing routing policy to ensure that the routing protocol process installs all the next hops for a given route in the routing table. |
In the following example, the OSPF interface so-0/0/0.0 in area 0.0.0.0 is configured for link protection. If a link for a destination route that traverses this interface becomes unavailable, Junos OS creates a loop-free backup path through another interface on the neighboring node, thus avoiding the link that is no longer available.
Configuring Node-Link Protection for OSPF
You can configure node-link protection on any interface for which OSPF is enabled. Node-link protection establishes an alternative path through a different routing device altogether for all destination routes that traverse a protected interface. Node-link protection assumes that the entire routing device, or node, has failed. Junos OS therefore calculates a backup path that avoids the primary next-hop routing device.
Node-link protection is supported on:
- OSPFv2 and OSPFv3 interfaces
- OSPFv3 unicast realms
- OSPFv2 unicast topologies
- All routing instances supported by OSPFv2 and OSPFv3
- Logical systems
To configure node-link protection for an OSPF interface:
- Include the node-link-protection statement at the [edit protocols (ospf | ospf3) area area-id interface interface-name] hierarchy level.
![]() | Best Practice: You must also configure a per-packet load-balancing routing policy to ensure that the routing protocol process installs all the next hops for a given route in the routing table. |
In the following example, the OSPF interface so-0/0/0.0 in area 0.0.0.0 is configured for node-link protection. If a link for a destination route that traverses this interface becomes unavailable, Junos OS creates a loop-free backup path through a different routing device altogether, thus avoiding the primary next-hop routing device.
Excluding an OSPF Interface as a Backup for a Protected Interface
By default, all OSPF interfaces that belong to the default instance or to a specific routing instance are eligible as a backup interface for interfaces configured with link-protection or node-link protection. You can specify that any OSPF interface be excluded from functioning as a backup interface to protected interfaces.
To exclude an OSPF interface as a backup interface for a protected interface:
- Include the no-eligible-backup statement at the [edit protocols (ospf | ospf3) area area-id interface interface-name] hierarchy level.
In the following example, interface so-0/0/0.0 has been configured to prohibit backup traffic for traffic destined for a protected interface. This means that if a neighboring next-hop path or node for a protected interface fails, interface so-0/0/0.0 cannot be used to transmit traffic to a backup path.
Configuring Backup SPF Options for Protected OSPF Interfaces
By default, if at least one OSPF interface is configured for link-protection or node-link protection, Junos OS calculates backup next hops for all the topologies in an OSPF instance. You can configure the following backup shortest-path-first (SPF) options to override the default behavior:
- Disable the calculation of backup next hops for an OSPF instance or a specific topology in an instance.
- Prevent the installation of backup next hops in the routing table or the forwarding table for an OSPF instance or a specific topology in an instance.
- Limit the calculation of backup next hops to a subset of paths as defined in RFC 5286, Basic Specification for IP Fast Reroute: Loop-Free Alternates.
You can disable the backup SPF algorithm for an OSPF instance or specific topology in an instance. Doing so prevents the calculation of backup next hops for that OSPF instance or topology.
To disable the calculation of backup next hops for an OSPF instance or topology:
- Include the disable statement at the [edit protocols (ospf | ospf3) backup-spf-options] or [edit protocols ospf backup-spf-options topology topology-name] hierarchy level.
In the following example, the calculation of backup next hops is disabled for the OSPF topology voice:
You can configure the routing device to prevent the installation of backup next hops in the routing table or the forwarding table for an OSPF instance, or a specific topology in an OSPF instance. The SPF algorithm continues to calculate backup next hops, but they are not installed.
To prevent the routing device from installing backup next hops in the routing table or the forwarding table:
- Include the no-install statement at the [edit protocols (ospf | ospf3) backup-spf-options] or the [edit protocols ospf topology topology-name] hierarchy level.
In the following example, backup next hops for the OSPF topology voice are not installed in the routing table or forwarding table. Any calculated backup next hops for other OSPF instances or topologies continue to be installed.
You can limit the calculation of backup next hops to downstream paths, as defined in RFC 5286. You can specify for Junos OS to use only downstream paths as backup next hops for protected interfaces for an OSPF instance or a specific topology in an OSPF instance. In a downstream path, the distance from the backup neighbor to the destination must be smaller than the distance from the calculating routing device to the destination. Using only downstream paths as loop-free alternate paths for protected interfaces ensures that these paths do not result in microloops. However, you might experience less than optimal backup coverage for your network.
To limit the calculation of backup next hops to downstream paths:
- Include the downstream-paths-only statement at the [edit protocols (ospf | ospf3) backup-spf-options] or [edit protocols ospf backup-spf-options topology topology-name] hierarchy level.
In the following example, only downstream paths are calculated as backup next hops for the topology voice:
Configuring RSVP Label-Switched Paths as Backup Paths for OSPF
When configuring an OSPF interface for link protection or node-link protection, relying on the shortest-path-first (SPF) calculation of backup paths for one-hop neighbors might result in less than 100 percent backup coverage for a specific network topology. You can enhance coverage of OSPF and LDP label-switched-paths (LSPs) by configuring RSVP LSPs as backup paths.
When configuring an LSP, you must specify the IP address of the egress router.
![]() | Note: RSVP LSPs can be used as backup paths only for the default topology for OSPFv2 and not for a configured topology. Additionally, RSVP LSP cannot be used a backup paths for non-default instances for OSPFv2 or OSPFv3. |
To configure a specific RSVP LSP as a backup path:
- Include the backup statement at the [edit protocols mpls labeled-switched-path lsp-name] hierarchy level.
- Specify the address of the egress router by including the to ip-address statement at the [edit protocols mpls label-switched-path] hierarchy level.
In the following example, the RSVP LSP f-to-g is configured as a backup LSP for protected OSPF interfaces. The egress router is configured with the IP address 192.168.1.4.