cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
15383
Views
15
Helpful
28
Replies

recursive static route

AdamBudzinski
Level 1
Level 1

hello all,

when creating a static route the next hop can be identified by an IP address, exit interface, or both. depending on which one is used a following route type will be created:

  • Next-hop route - Only the next-hop IP address is specified.
  • Directly connected static route - Only the router exit interface is specified.
  • Fully specified static route - The next-hop IP address and exit interface are specified.

Now in an exercise they as me to :

Step 1: Configure recursive static routes on R1.

a. What is recursive static route?

b. Why does a recursive static route require two routing table lookups?

c. Configure a recursive static route to every network not directly connected to R1, including the WAN link between R2 and R3.

d. Test connectivity to the R2 LAN and ping the IP addresses of PC2 and PC3.

I know what is a recursive lookup - it will require more than one lookup before forwarding the packet. So if i create a static route pointing to the next-hop IP it will require another lookup to resolve the egress interface to send the packet, for example 172.16.1.1 via 192.168.1.1 >> 192.168.1.1 is directly connected, FastEthernet0/1 BUT according to CISCO Cisco Express Forwarding is eliminating recursive lookup because it maintains al information it needs in the FIB and adjacency table (so only one lookup is performed!). So why the hell they even bother me to configure it ? 

Looking forward to get to clarification ! 

Best Regards

Adam 

28 Replies 28

Hi Shaunak

Yes, it's just not something that ever really occurred to me before in terms of static routes with a next hop IP only.

If asked what a recursive route was I always thought of the case of a next hop IP that was not directly connected but obviously that is not always the case as proven in this thread.

You never stop learning and this thread is a good example of that and is one of the reasons I continue to participate in these forums.

Jon

Jon,

I second you on that, such is the beauty of this domain every day is a new day and there is so much to learn.

I'm glad I could add a minuscule amount of helpful information :).

Thanks,

Shaunak

Guys,

thank you for the comments but I think we still talk about different thinks or it's me unable to understand it. 

To make it more clear. CISCO is referencing to a scenario when prior to CEF a static route was created pointing to the next-hop IP address. The next-hop IP should be then resolvable to an egress interface with a second routing entry on the router. So they called it a recursive query because it had to make actually 2 routing table lookups to find out the exit interface. This changed with CEF (FIB + adjacency table ) I am more  than sure this does not require any explanation. 

So because CEF is ELIMINATING recursive lookups I'm asking you what the hell is a recursive static lookup. 

Again, quoting from official CISCO materials:

"Step 1: Configure a recursive static route.

With a recursive static route, the next-hop IP address is specified. Because only the next-hop IP is specified, the router must perform multiple lookups in the routing table before forwarding packets. To configure recursive static routes, use the following syntax:

Router(config)# ip route network-address subnet-mask ip-address"

The quoted sentence is denying what they write regarding CEF! On one page they say it eliminates recursive lookups but in the quoted sentence they say "Because only the next-hop IP is specified, the router must perform multiple lookups in the routing table before forwarding packets". 

It's another example where the study materials are not clear enough. 

Can anyone please at least confirm they UNDERSTAND what my problem is ?

Much appreciate further comments! 

BR

Adam 

Adam

Firstly we don't have access to your study materials so we can only respond to what you are telling us.

You are saying that prior to CEF the router had to do multiple lookups in the routing table to resolve the recursion but then seem to be saying that with CEF there was no longer a need to do this.

That is incorrect, there is still a need to do it, the difference being with CEF it is done when the FIB is built but the router still needs to resolve the recursion and this will be done by multiple lookups.

Because the recursion is resolved when the FIB is built the router does not need to do it again when forwarding the packets but that is only because CEF has done the work already.

Does this help or am I still not understanding the question ?

Jon

Jon,

from CISCO Network Academy Routing and Switch course:

"Note: CEF provides optimized lookup for efficient packet forwarding by using two main data structures stored in the data plane: a FIB (Forwarding Information Base), which is a copy of the routing table and an adjacency table that includes Layer 2 addressing information. The information combined in both of these tables work together so there is no recursive lookup needed for next-hop IP address lookups. In other words, a static route using a next-hop IP requires only a single lookup when CEF is enabled on the router."

So to confirm, you say with CEF prior to "insert" information in the FIB and adjacency table the router would first have to undergo a recursive lookup and that after the FIB / adj table are build it wouldn't require further recursive queries? If this is what you meant ? 

according to CISCO

"Cisco Express Forwarding (CEF) - CEF is the most recent and preferred Cisco IOS packet-forwarding mechanism. Like fast switching, CEF builds a Forwarding Information Base (FIB), and an adjacency table. However, the table entries are not packet-triggered like fast switching but change-triggered such as when something changes in the network topology. " 

BR

Adam

Yes, as far as I know, to build the FIB the router would have to resolve any recursive routes but because that is done when the FIB is built it does not require the router to do it for every packet it forwards using that route.

Jon

Thank you Jon. Can you please confirm also, so a static recursive route is a static route that:

- points to the next-hop IP address

- needs to be resolved in multiple lookups 

If you take a look at my very first post regarding this topic, CISCO materials says:

"

when creating a static route the next hop can be identified by an IP address, exit interface, or both. depending on which one is used a following route type will be created:

  • Next-hop route - Only the next-hop IP address is specified.
  • Directly connected static route - Only the router exit interface is specified.
  • Fully specified static route - The next-hop IP address and exit interface are specified."

So in other words a static recursive lookup = next-hop route, right ? 

BR

Adam

and also I think that creating a static recursive route pointing to the next-hop IP would make sense for multi access networks. 

for point-to-point networks i think it wouldn't make any difference either i point to the exit interface or next-hop ip because there's no l3 to l2 mapping , correct ? 

Adam,

That's correct for point to point serial networks but in multiaccess environments it's advisable not to point a route through the interface.

A recursive next-hop can be configured over any underlying architecture like serial links or multiaccess ethernet environments.

Regarding CEF it's correct that for a next-hop IP route is resolved like a normal route even though internally the next-hop IP is matched against all the directly connected routes to find out the exit interface.

If you refer the outputs I posted earlier--

R1(config)#do sh ip cef 1.1.1.1 detail
1.1.1.1/32, epoch 0
recursive via 172.16.1.1
recursive via 192.168.1.2
attached to Ethernet0/0

CEF displays that there is recursion occurring for this route.

"However, the table entries are not packet-triggered like fast switching but change-triggered such as when something changes in the network topology. " 

Due to the advent of CEF the router need not compute the recursion again and again on a per packet basis like fast switching (packet triggered since fast switching creates a cache on a per packet basis rather per destination basis) but whenever there is a transition in the RIB or the CAM table then the FIB and adjacency table is also need to be refreshed.

Thanks,

Shaunak

Ok guys,

 

I think I can summarize it now in few words.

First a little background on packet-forwarding mechanisms. Routers support 3 types:

 

  • Process switching – an older packet forwarding mechanism. Each single packet is processed by the CPU to match the destination address with an entry in the routing table, and next determines the exit interface and forwards the packet.

 

  • Fast switching – uses a fast-switching cache to store next-hop information. When a packet arrives the CPU searches for a match in the fast-switching cache, if it’s not there the packet is process-switched and forwarded to the exit interface. The routing/flow information is also stored next in the fast-switching cache, so if another packet going to the same destination arrives on an interface, the next-hop information in the cache is re-used without CPU intervention.

 

  • CEF (CISCO Express Forwarding) – CEF builds a FIB and an adjacency table. This table entries are NOT PACKET TRIGGERED (like in case of fast switching – see point number 2). The FIB ( Forwarding Information Base) contains PRE-COMPUTED reverse lookups. Next hop information for routes including the interface and Layer 2 information).

 

 

 

So in each case when we point a static route to the next-hop IP we will need more than 1 lookup to a)determine the path b) to determine the exit interface. But with CEF it’s not triggered by packet that arrive on the interface. So even though it’s still considered a recursive route  no recursive lookups takes place because of how CEF (FIB + adjacency table works).

 

 

Please feel free to correct me if I’m wrong.

 

Best Regards

 

Adam

 

 

 

 

Hi Adam,

Affirmative, what you mentioned is correct.

I hope it's a bit clearer now.

Thanks,

Shaunak

Adam

Just posted a response above while you were posting this.

As you can see a static route using only a next hop IP is always recursive, the amount of recursion depends on whether the next hop IP is directly connected or not.

And yes CEF does all this when it builds the FIB so there is no need to do it for each packet.

Jon

Adam

If in doubt test :)

R1 (192.168.4.1/30) -> (192.168.4.2/30) R2 (192.168.4.5/30) -> (192.168.4.6/30) R3 (loopback 3 - 192.168.3.1/32)

EIGRP is running between the routers but 192.168.3.1 is not advertised in EIGRP.

Both static routes in the two tests were added to R1 -

1) "ip route 192.168.3.1 255.255.255.255 192.168.4.2"

then a "sh ip cef 192.168.3.1 detail" -

R1#sh ip cef 192.168.3.1 detail                                                
192.168.3.1/32, epoch 0                                                        
  recursive via 192.168.4.2                                                    
    attached to Ethernet0/3  

you can see that it is showing as a recursive route

2) remove the first static and replace with -

"ip route 192.168.3.1 255.255.255.255 192.168.4.6"

again run a "sh ip cef 192.168.3.1 detail" -

R1#sh ip cef 192.168.3.1 detail                                                
192.168.3.1/32, epoch 0                                                        
  recursive via 192.168.4.6                                                    
    recursive via 192.168.4.4/30                                               
      nexthop 192.168.4.2 Ethernet0/3      

again a recursive route although this time because the next hop IP is not directly connected a second level of recursion is needed ie. first to find a route to 192.168.4.6 which returns a next hop IP of 192.168.4.2 and then it is in effect the same as the first example.

So a recursive static route is indeed one that only uses the next hop IP whether or not that next hop IP is in a directly connected subnet.

Jon

I would add that the first paragraph in your last post suggests a recursive lookup is not needed because of the way the tables work together which is not quite the same thing as I am saying.

I think if the static route refers to a next hop IP in a directly connected network then that paragraph may make more sense but if it refers to a next hop IP not directly connected then the router would have to resolve the recursion as it builds the FIB.

Jon

Review Cisco Networking for a $25 gift card