08-22-2019 06:07 PM
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 .
Solved! Go to Solution.
08-22-2019 10:08 PM - last edited on 12-22-2022 03:24 AM by Translator
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
08-22-2019 10:08 PM - last edited on 12-22-2022 03:24 AM by Translator
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide