Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation

Example: Optimizing Route Reconvergence by Enabling Indirect Next Hops on the Packet Forwarding Engine

This example shows how to use indirect next hops to promote faster network convergence (for example, in BGP networks) by decreasing the number of forwarding table changes required when a change in the network topology occurs.

Requirements

No special configuration beyond device initialization is required before configuring this example.

Overview

In this example, several devices are connected over unequal-cost paths. From Device R1 to Device R2, the path through Device R3 has a higher IGP metric than the path through Device R4. Device R1 has an internal BGP connection to Device R2. Device R0 injects multiple routes into the network, and Device R1 advertises those routes to Device R2. Because Device R2 is not directly connected to Device R1, Device R2’s forwarding table contains indirect next hops. An interior gateway protocol, in this case OSPF, is running on the internal links among Devices R1, R2, R3, and R4. Each router is advertising its loopback interface IPv4 address.

On Device R2, the indirect-next-hop statement enables Junos OS to maintain the indirect next hop to forwarding next-hop binding on the Packet Forwarding Engine forwarding table. As a result, fewer route to forwarding next-hop bindings need to be updated, which improves the route convergence time if a path fails.

Figure 1 shows the sample network.

Figure 1: Sample Topology for Indirect Next Hops

The CLI Quick Configuration section shows the full configuration on all of the devices in Figure 1. Otherwise, the example focuses on Device R0, Device R1, and Device R2.

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

set interfaces fe-1/2/0 unit 1 family inet address 10.0.0.1/30set interfaces lo0 unit 1 family inet address 1.1.0.1/32set interfaces lo0 unit 1 family inet address 1.1.0.2/32set interfaces lo0 unit 1 family inet address 1.1.0.3/32set interfaces lo0 unit 1 family inet address 1.1.0.4/32set interfaces lo0 unit 1 family inet address 1.1.0.5/32set interfaces lo0 unit 1 family inet address 1.1.0.6/32set interfaces lo0 unit 1 family inet address 1.1.0.7/32set interfaces lo0 unit 1 family inet address 1.1.0.8/32set interfaces lo0 unit 1 family inet address 1.1.0.9/32set routing-options static route 0.0.0.0/0 next-hop 10.0.0.2

Device R1

set interfaces fe-1/2/0 unit 2 family inet address 10.0.0.2/30set interfaces fe-1/2/1 unit 5 family inet address 10.0.0.5/30set interfaces fe-1/2/2 unit 9 family inet address 10.0.0.9/30set interfaces lo0 unit 2 family inet address 1.1.1.1/32set protocols bgp export send-localset protocols bgp export send-staticset protocols bgp group int type internalset protocols bgp group int local-address 1.1.1.1set protocols bgp group int neighbor 2.2.2.2set protocols ospf area 0.0.0.0 interface fe-1/2/1.5set protocols ospf area 0.0.0.0 interface fe-1/2/2.9set protocols ospf area 0.0.0.0 interface lo0.2set policy-options policy-statement send-local from protocol localset policy-options policy-statement send-local from protocol directset policy-options policy-statement send-local then acceptset policy-options policy-statement send-static from protocol staticset policy-options policy-statement send-static then acceptset routing-options static route 1.1.0.2/32 next-hop 10.0.0.1set routing-options static route 1.1.0.1/32 next-hop 10.0.0.1set routing-options static route 1.1.0.3/32 next-hop 10.0.0.1set routing-options static route 1.1.0.4/32 next-hop 10.0.0.1set routing-options static route 1.1.0.5/32 next-hop 10.0.0.1set routing-options static route 1.1.0.6/32 next-hop 10.0.0.1set routing-options static route 1.1.0.7/32 next-hop 10.0.0.1set routing-options static route 1.1.0.8/32 next-hop 10.0.0.1set routing-options static route 1.1.0.9/32 next-hop 10.0.0.1set routing-options autonomous-system 65500

Device R2

set interfaces fe-1/2/0 unit 14 family inet address 10.0.0.14/30set interfaces fe-1/2/1 unit 18 family inet address 10.0.0.18/30set interfaces fe-1/2/2 unit 21 family inetset interfaces lo0 unit 3 family inet address 2.2.2.2/32set protocols bgp export send-localset protocols bgp group int type internalset protocols bgp group int local-address 2.2.2.2set protocols bgp group int family inet unicastset protocols bgp group int family inet-vpn unicastset protocols bgp group int neighbor 1.1.1.1set protocols ospf area 0.0.0.0 interface fe-1/2/0.14set protocols ospf area 0.0.0.0 interface fe-1/2/1.18set protocols ospf area 0.0.0.0 interface lo0.3set policy-options policy-statement send-local from protocol localset policy-options policy-statement send-local from protocol directset policy-options policy-statement send-local then acceptset routing-options autonomous-system 65500set routing-options forwarding-table indirect-next-hop

Device R3

set interfaces fe-1/2/0 unit 6 family inet address 10.0.0.6/30set interfaces fe-1/2/1 unit 13 family inet address 10.0.0.13/30set interfaces lo0 unit 4 family inet address 3.3.3.3/32set protocols ospf area 0.0.0.0 interface fe-1/2/0.6 metric 5000set protocols ospf area 0.0.0.0 interface fe-1/2/1.13 metric 5000set protocols ospf area 0.0.0.0 interface lo0.4

Device R4

set interfaces fe-1/2/0 unit 10 family inet address 10.0.0.10/30set interfaces fe-1/2/1 unit 17 family inet address 10.0.0.17/30set interfaces lo0 unit 5 family inet address 4.4.4.4/32set protocols ospf area 0.0.0.0 interface fe-1/2/0.10set protocols ospf area 0.0.0.0 interface fe-1/2/1.17set protocols ospf area 0.0.0.0 interface lo0.5

Device R5

set interfaces fe-1/2/0 unit 22 family inet address 10.0.0.22/30set interfaces lo0 unit 6 family inet address 5.5.5.5/32

Configuring Device R0

Step-by-Step Procedure

The following example requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the CLI User Guide.

To configure Device R0:

  1. Configure the interfaces, including multiple routes that can be injected into the network for demonstration purposes.
    [edit interfaces]user@R0# set interfaces fe-1/2/0 unit 1 family inet address 10.0.0.1/30
    user@R0# set interfaces lo0 unit 1 family inet address 1.1.0.1/32user@R0# set interfaces lo0 unit 1 family inet address 1.1.0.2/32user@R0# set interfaces lo0 unit 1 family inet address 1.1.0.3/32user@R0# set interfaces lo0 unit 1 family inet address 1.1.0.4/32user@R0# set interfaces lo0 unit 1 family inet address 1.1.0.5/32user@R0# set interfaces lo0 unit 1 family inet address 1.1.0.6/32user@R0# set interfaces lo0 unit 1 family inet address 1.1.0.7/32user@R0# set interfaces lo0 unit 1 family inet address 1.1.0.8/32user@R0# set interfaces lo0 unit 1 family inet address 1.1.0.9/32
  2. Configure a static default route for network reachability.

    [edit routing-options]user@R0# set routing-options static route 0.0.0.0/0 next-hop 10.0.0.2
  3. If you are done configuring the device, commit the configuration.

    [edit]user@R0# commit

Configuring Device R1

Step-by-Step Procedure

The following example requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the CLI User Guide.

To configure Device R1:

  1. Configure the interfaces, including multiple routes that can be injected into the network for demonstration purposes.
    [edit interfaces]user@R1# set interfaces fe-1/2/0 unit 2 family inet address 10.0.0.2/30user@R1# set interfaces fe-1/2/1 unit 5 family inet address 10.0.0.5/30user@R1# set interfaces fe-1/2/2 unit 9 family inet address 10.0.0.9/30
    user@R1# set interfaces lo0 unit 2 family inet address 1.1.1.1/32
  2. Configure BGP.

    [edit routing-options]user@R1# set protocols bgp export send-localuser@R1# set protocols bgp export send-staticuser@R1# set protocols bgp group int type internaluser@R1# set protocols bgp group int local-address 1.1.1.1user@R1# set protocols bgp group int neighbor 2.2.2.2
  3. Configure OSPF.
    [edit protocols]user@R1# set protocols ospf area 0.0.0.0 interface fe-1/2/1.5user@R1# set protocols ospf area 0.0.0.0 interface fe-1/2/2.9user@R1# set protocols ospf area 0.0.0.0 interface lo0.2
  4. Configure the routing policies.
    user@R1# set policy-options policy-statement send-local from protocol localuser@R1# set policy-options policy-statement send-local from protocol directuser@R1# set policy-options policy-statement send-local then accept
    user@R1# set policy-options policy-statement send-static from protocol staticuser@R1# set policy-options policy-statement send-static then accept
  5. Configure a set of static routes to the set of interfaces configured on Device R0.
    user@R1# set routing-options static route 1.1.0.2/32 next-hop 10.0.0.1user@R1# set routing-options static route 1.1.0.1/32 next-hop 10.0.0.1user@R1# set routing-options static route 1.1.0.3/32 next-hop 10.0.0.1user@R1# set routing-options static route 1.1.0.4/32 next-hop 10.0.0.1user@R1# set routing-options static route 1.1.0.5/32 next-hop 10.0.0.1user@R1# set routing-options static route 1.1.0.6/32 next-hop 10.0.0.1user@R1# set routing-options static route 1.1.0.7/32 next-hop 10.0.0.1user@R1# set routing-options static route 1.1.0.8/32 next-hop 10.0.0.1user@R1# set routing-options static route 1.1.0.9/32 next-hop 10.0.0.1
  6. Configure the autonomous system (AS) identifier.
    user@R1# set routing-options autonomous-system 65500
  7. If you are done configuring the device, commit the configuration.

    [edit]user@R1# commit

Configuring Device R2

Step-by-Step Procedure

The following example requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the CLI User Guide.

To configure Device R2:

  1. Configure the interfaces, including multiple routes that can be injected into the network for demonstration purposes.
    [edit interfaces]user@R2# set interfaces fe-1/2/0 unit 14 family inet address 10.0.0.14/30user@R2# set interfaces fe-1/2/1 unit 18 family inet address 10.0.0.18/30user@R2# set interfaces fe-1/2/2 unit 21 family inet address 10.0.0.21/30;
    user@R2# set interfaces lo0 unit 3 family inet address 2.2.2.2/32
  2. Configure BGP.

    [edit routing-options]user@R2# set protocols bgp export send-localuser@R2# set protocols bgp group int type internaluser@R2# set protocols bgp group int local-address 2.2.2.2user@R2# set protocols bgp group int family inet unicastuser@R2# set protocols bgp group int family inet-vpn unicastuser@R2# set protocols bgp group int neighbor 1.1.1.1
  3. Configure OSPF.
    [edit protocols]user@R2# set protocols ospf area 0.0.0.0 interface fe-1/2/0.14user@R2# set protocols ospf area 0.0.0.0 interface fe-1/2/1.18user@R2# set protocols ospf area 0.0.0.0 interface lo0.3
  4. Configure the routing policies.
    user@R2# set policy-options policy-statement send-local from protocol localuser@R2# set policy-options policy-statement send-local from protocol directuser@R2# set policy-options policy-statement send-local then accept
  5. Configure the AS identifier.
    user@R2# set routing-options autonomous-system 65500
  6. Enable indirect next hops in the forwarding plane.
    user@R2# set routing-options forwarding-table indirect-next-hop
  7. If you are done configuring the device, commit the configuration.

    [edit]user@R2# commit

Results

Confirm your configuration by issuing the show interfaces, show protocols, show policy-options, and show routing-options commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

Device R0

user@R0# show interfaces
fe-1/2/0 {unit 1 {family inet {address 10.0.0.1/30;}}}
lo0 {unit 1 {family inet {address 1.1.0.1/32;address 1.1.0.2/32;address 1.1.0.3/32;address 1.1.0.4/32;address 1.1.0.5/32;address 1.1.0.6/32;address 1.1.0.7/32;address 1.1.0.8/32;address 1.1.0.9/32;}}}
user@R0# show routing-options
static {route 0.0.0.0/0 next-hop 10.0.0.2;}

Device R1

user@R1# show interfaces
fe-1/2/0 {unit 2 {family inet {address 10.0.0.2/30;}}}
fe-1/2/1 {unit 5 {family inet {address 10.0.0.5/30;}}}
fe-1/2/2 {unit 9 {family inet {address 10.0.0.9/30;}}}
lo0 {unit 2 {family inet {address 1.1.1.1/32;}}}
user@R1# show protocols
bgp {export [ send-local send-static ];group int {type internal;local-address 1.1.1.1;neighbor 2.2.2.2;}}
ospf {area 0.0.0.0 {interface fe-1/2/1.5;interface fe-1/2/2.9;interface lo0.2;}}
user@R1# show policy-options
policy-statement send-local {from protocol [ local direct ];then accept;}
policy-statement send-static {from protocol static;then accept;}
user@R1# show routing-options
static {route 1.1.0.2/32 next-hop 10.0.0.1;route 1.1.0.1/32 next-hop 10.0.0.1;route 1.1.0.3/32 next-hop 10.0.0.1;route 1.1.0.4/32 next-hop 10.0.0.1;route 1.1.0.5/32 next-hop 10.0.0.1;route 1.1.0.6/32 next-hop 10.0.0.1;route 1.1.0.7/32 next-hop 10.0.0.1;route 1.1.0.8/32 next-hop 10.0.0.1;route 1.1.0.9/32 next-hop 10.0.0.1;}
autonomous-system 65500;

Device R2

user@R2# show interfaces
fe-1/2/0 {unit 14 {family inet {address 10.0.0.14/30;}}}
fe-1/2/1 {unit 18 {family inet {address 10.0.0.18/30;}}}
fe-1/2/2 {unit 21 {family inet {address 10.0.0.21/30}}}
lo0 {unit 3 {family inet {address 2.2.2.2/32;}}}
user@R2# show protocols
bgp {export send-local;group int {type internal;local-address 2.2.2.2;family inet {unicast;}family inet-vpn {unicast;}neighbor 1.1.1.1;}}
ospf {area 0.0.0.0 {interface fe-1/2/0.14;interface fe-1/2/1.18;interface lo0.3;}}
user@R2# show policy-options
policy-statement send-local {from protocol [ local direct ];then accept;}
user@R2# show routing-optionsautonomous-system 65500;
forwarding-table {indirect-next-hop;}

Configure Device R3, Device R4, and Device R5, as shown in CLI Quick Configuration.

Verification

Confirm that the configuration is working properly.

Verifying That the Routes Have the Expected Indirect-Next-Hop Flag

Purpose

Make sure that Device R2 is configured to maintain the indirect next hop to forwarding next-hop binding on the Packet Forwarding Engine forwarding table.

Action

user@R2> show krt indirect-next-hop
Indirect Nexthop:
Index: 262143 Protocol next-hop address: 1.1.1.1
  RIB Table: inet.0              
  Policy Version: 0                     References: 4
  Locks: 2                              0x9290488
  Flags: 0x1
  Ref RIB Table: unknown
        Next hop: 10.0.0.17 via fe-1/2/1.18
Indirect Nexthop:
Index: 262142 Protocol next-hop address: 10.0.0.1
  RIB Table: inet.0              
  Policy Version: 0                     References: 9
  Locks: 2                              0x9290570
  Flags: 0x1
  Ref RIB Table: unknown
        Next hop: 10.0.0.17 via fe-1/2/1.18

Meaning

The 0x1 flag in the output indicates that Device R2 is configured to maintain the indirect next hop to forwarding next-hop binding on the Packet Forwarding Engine forwarding table. When the indirect-next-hop statement is deleted or deactivated, this flag changes to 0x0.

Note: The show krt indirect-next-hop command is hidden and is therefore undocumented. The show krt indirect-next-hop command is shown here because this is the only command that verifies the indirect next-hop feature. The best verification method is, of course, monitoring network performance during reconvergence after a path failure.

Published: 2013-07-23

Published: 2013-07-23