cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
19161
Views
21
Helpful
1
Replies

What is the recursive routing

MrBeginner
Spotlight
Spotlight

Hi All,

Let me know what is the recursive routing. What is the purpose for recursive routing. Let me know what is pros and cons ?

I am reading below links but i still confuse ?

Please explain .

https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/iproute_pi/configuration/15-s/iri-15-s-book/iri-rec-stat-route.html

1 Accepted Solution

Accepted Solutions

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello MrBeginner,

recursive routing occurs when a route either static route or dynamically learned has a next-hop that is not directly connected to the local router.

In this case the local router in order to understand what is the outgoing interface and how to build the packet needs to perform a second lookup in the routing table to resolve the route's next-hop.

This second lookup in the routing table is called recursion.

 

There are two meaningful cases of route recursion :

BGP can trigger recursion for resolving the BGP next-hop attribute. This happens because in iBGP the BGP next-hop attribute of an eBGP route is left unchanged during prefix propagation in iBGP.

For BGP it is important that a route to the BGP next-hop exists otherwise the prefix cannot be installed in the IP routing table.

 

The second case of recursion occurs with static routes:

We usually configure static routes with an IP next-hop that is a directly connected device that can be resolved by ARP or other L3 to L2 resolution methods (inverse ARP on Frame Relay no special mechanism is required for point to point sync serial interfaces).

However, in IOS it is possible to configure a static route that uses an IP next-hop that is not directly connected.

For example a static route for a prefix can use a next-hop that is the loopback address of another router.

Again doing so triggers a second route lookup to find how to reach the specified next-hop.

At the end the packet is sent in the same way like a packet would be sent if the final destination would be the specified next-hop.

This is the other aspect of recursion.

For example if four equal cost multipath exists to reach the Loopback0 2.2.2.2 of R2, R1 can use  a static route like

ip route 10.200.121.0 255.255.255.0 2.2.2.2

By recursion four possible paths exist and one is chosen using source IP address and destination address as input for the CEF hash algorythm.

 

The document that you have provided refers to a third use case of recursive static routes in VRF Virtual Routing Forwarding context.

in the context of VRFs recursive static routes are not installed by default an appropriate command is needed to accept them

The command has also a variant that allows to specify a route-map so that recursive static routes will be installed in the specified VRF only for those routes that are a match for the invoked route-map

ip route static install-routes-recurse-via-nexthop vrf vrf1

 The othe version is:

 

ip route static install-routes-recurse-via-nexthop  [vrf  vrf-name] [route-map  map-name] 

 

Recursive static routing in VRF is needed in cases like the scenario presented in the document to create specific host routes to be sent to the SDN edge device on the left.

The CE router is actually a multi VRF CE = VRF lite and interacts with the service Edge device in a VRF.

 

Edit:

BGP recursion for BGP next-hop is widely used and needed.

Recursive static routes are used only in very special cases and should be avoided also in global routing table.

They can be used as temporary fix for routing issues related to protocol redistribution.

The same in VRF context: recursive static routes should be used only when necessary like in the described scenario to create more specific routes to pass to a device.

 

Hope to help

Giuseppe

 

View solution in original post

1 Reply 1

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello MrBeginner,

recursive routing occurs when a route either static route or dynamically learned has a next-hop that is not directly connected to the local router.

In this case the local router in order to understand what is the outgoing interface and how to build the packet needs to perform a second lookup in the routing table to resolve the route's next-hop.

This second lookup in the routing table is called recursion.

 

There are two meaningful cases of route recursion :

BGP can trigger recursion for resolving the BGP next-hop attribute. This happens because in iBGP the BGP next-hop attribute of an eBGP route is left unchanged during prefix propagation in iBGP.

For BGP it is important that a route to the BGP next-hop exists otherwise the prefix cannot be installed in the IP routing table.

 

The second case of recursion occurs with static routes:

We usually configure static routes with an IP next-hop that is a directly connected device that can be resolved by ARP or other L3 to L2 resolution methods (inverse ARP on Frame Relay no special mechanism is required for point to point sync serial interfaces).

However, in IOS it is possible to configure a static route that uses an IP next-hop that is not directly connected.

For example a static route for a prefix can use a next-hop that is the loopback address of another router.

Again doing so triggers a second route lookup to find how to reach the specified next-hop.

At the end the packet is sent in the same way like a packet would be sent if the final destination would be the specified next-hop.

This is the other aspect of recursion.

For example if four equal cost multipath exists to reach the Loopback0 2.2.2.2 of R2, R1 can use  a static route like

ip route 10.200.121.0 255.255.255.0 2.2.2.2

By recursion four possible paths exist and one is chosen using source IP address and destination address as input for the CEF hash algorythm.

 

The document that you have provided refers to a third use case of recursive static routes in VRF Virtual Routing Forwarding context.

in the context of VRFs recursive static routes are not installed by default an appropriate command is needed to accept them

The command has also a variant that allows to specify a route-map so that recursive static routes will be installed in the specified VRF only for those routes that are a match for the invoked route-map

ip route static install-routes-recurse-via-nexthop vrf vrf1

 The othe version is:

 

ip route static install-routes-recurse-via-nexthop  [vrf  vrf-name] [route-map  map-name] 

 

Recursive static routing in VRF is needed in cases like the scenario presented in the document to create specific host routes to be sent to the SDN edge device on the left.

The CE router is actually a multi VRF CE = VRF lite and interacts with the service Edge device in a VRF.

 

Edit:

BGP recursion for BGP next-hop is widely used and needed.

Recursive static routes are used only in very special cases and should be avoided also in global routing table.

They can be used as temporary fix for routing issues related to protocol redistribution.

The same in VRF context: recursive static routes should be used only when necessary like in the described scenario to create more specific routes to pass to a device.

 

Hope to help

Giuseppe

 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card