Giuseppe Larosa Sat, 01/24/2009 - 01:19
User Badges:
  • Super Silver, 17500 points or more
  • Hall of Fame,

    Founding Member

Hello Kaustubh,

a recursive lookup happens when a second search in the routing table has to be done.

A typical example is given by BGP that provides a BGP next hop.

The BGP next hop is reported in the routing table but it is not always the real next hop for the local router.

Let's make an example:

We have two routers with iBGP in AS 65000 that use their loopbacks 0 to setup an iBGP session

int loop0

ip address

router ospf 10

network area 0

network area 0

router bgp 65000

neigh remote-as 65000

neigh update-source loopback0

Now let's suppose R2 advertise in BGP net

the BGP information and the routing will say B [200/0] via

actually the meaning of above is :

packets for net follow the same path as ip address

the router to be able to forward packets need to do a second lookup (a recursion) to find out how to forward packets:

a sh ip route in this case tells

O [110/2] via

and is the ip address of R2 on the LAN segment between them

an entry for exists in the ARP table that points to R2 f0/0 MAC address.

So R1 can build a forwarding table for prefix that says :

rewrite packet putting it in an ethernet frame with source MAC R1 f0/0 and Dest= R2 f/0 MAC address.

if instead the prefix was advertised in OSPF the routing table would have been:

O [110/2] via

in this case a second lookup in routing table is not needed because is already the real next-hop.

This BGP mechanism is actually a great advantage:

on this capability of telling a BGP next hop are based for the example the forwarding of MPLS L3 VPN packets:

for devices in the middle the packets are treated as destinated to the loopback or a remote PE. (MPLS employs a two labels stack for this)

Hope to help


sarahr202 Sun, 01/25/2009 - 23:02
User Badges:
  • Bronze, 100 points or more

Hi Kaustubh!

"recursive lookup - Method of consulting the routing table to locate the actual physical next hop for a route when the supplied next hop is not directly connected."

let take an example to understand it

let say we have router with following routing table:


c is directly connected s0

Suppose the router receives a packet destined to

Now router look at the destination ( in the Ip header.

It checks its routing table and find the following entry:

s [1/0] via

Router determines that in order to forward this packet to its destination, it must find out out how to reach next hop

Router again consults the routing table ,this time to find the match for

Router finds an entry" directly connected s0"

Now the router will forward the packet , having found how to reach next hop (

This is called recursive look up

If you still need help, just ask


This Discussion