02-07-2014 12:49 PM - edited 03-04-2019 10:17 PM
Hello!
I am busting my head over here with what is right. When I was taught static IP routing, they introduced me to the concept of the next hop. At that time, I wasn't even sure about subnetting right(I had to learn fast). So here is my question.
How do we define next-hop?
Is it the same as gateway?
I attached a picture with a situation that is confusing me.
If I want to add a static route so that my router R1 can access the .4.0 network, do I enter the next hop to be 192.168.3.2 or 192.168.2.2?
This is bothering me because, I am reading some quality materials and everybody is assigning the next-hop to be 192.168.2.2.
What is bothering me even more is that I simulated this in CPT and I set the static table to be first one (with next - hop being 192.168.3.2) and it works!
I can ping the network .4.0 from .1.0.
Can somebody please explain why is this possible?
Thanks!
Solved! Go to Solution.
02-07-2014 06:12 PM
It is certainly valid but using a recursive next hop is not the common way to do it. You would ordinarily use the directly connected next hop and there is rarely a reason not to do this.
So i wouldn't say it's not correct just that it is the exception rather than the norm.
You most often see the recursive next hop used with PBR (Policy Based Routing) where it can can provide load sharing over multiple links. I don't want to confuse the whole issue with going into PBR but if you want an example just let me know
One other thing to note. With a recursive next hop you will see this on the router -
1) a "sh ip route subnet
2) a "sh ip cef subnet
this is because a router will populate it's RIB (Routing Information Base) with connected routes, static routes and routes learnt from dynamic routing protocols. The RIB is in effect the IP routing table. It will then, if running CEF, build a FIB (Forwarding Information Base) which stores the destination prefix together with the next hop IP (it stores other information as well but it's not relevant to this). The FIB is used to actually forward data through the router (or L3 switch).
When the FIB is being built the router resolves the recursive route to get the real next hop and it is this next hop that is installed in the FIB. So to actually forward packets the router does not need to do a second lookup each time, it simply looks in it's FIB and gets the next hop from that.
Hope that makes sense.
Jon
02-07-2014 01:54 PM
Hi,
This is possible because of recursive lookup:
to get to 4.0 the next-hop is 3.2 and to get to 3.2(as it is not directly connected) the router does a second routing lookup and finds out it must go to 2.2 then it must find the outgoing interface to get to 2.2 and do a L2 rewrite to send the frame.
Regards
Alain
Don't forget to rate helpful posts.
02-07-2014 01:58 PM
Thats what I thought!
So it looks how to get to that hop through the routing table.
Is this valid?
Is this the correct way?
02-07-2014 06:12 PM
It is certainly valid but using a recursive next hop is not the common way to do it. You would ordinarily use the directly connected next hop and there is rarely a reason not to do this.
So i wouldn't say it's not correct just that it is the exception rather than the norm.
You most often see the recursive next hop used with PBR (Policy Based Routing) where it can can provide load sharing over multiple links. I don't want to confuse the whole issue with going into PBR but if you want an example just let me know
One other thing to note. With a recursive next hop you will see this on the router -
1) a "sh ip route subnet
2) a "sh ip cef subnet
this is because a router will populate it's RIB (Routing Information Base) with connected routes, static routes and routes learnt from dynamic routing protocols. The RIB is in effect the IP routing table. It will then, if running CEF, build a FIB (Forwarding Information Base) which stores the destination prefix together with the next hop IP (it stores other information as well but it's not relevant to this). The FIB is used to actually forward data through the router (or L3 switch).
When the FIB is being built the router resolves the recursive route to get the real next hop and it is this next hop that is installed in the FIB. So to actually forward packets the router does not need to do a second lookup each time, it simply looks in it's FIB and gets the next hop from that.
Hope that makes sense.
Jon
02-08-2014 03:11 AM
I understand. But this RIB, CEF and FIB is quite new to me. I would like to look this up. Do you have a book suggestion or something?
I did not know that these mechanisms occur when router looks for routes. So basically he will look my route through this mechanism, find at which interface it has to send the packet and send it? He will not do this recursion lookup over and over again, but just once?
This makes sense because when I tried to ping the PC in the .4.0 network and at first timed out. Then I waited for like 5-10 secs and then ping came through.
I wouldn't mind having this example with PBR but if its too much trouble, just reference me to a link or a book name. I don't mind spending money on a good book.
Thank you !
02-08-2014 04:27 AM
Hi,
For CEF: http://www.ciscopress.com/store/cisco-express-forwarding-9781587052361
For PBR:https://supportforums.cisco.com/docs/DOC-1634
Regards
Alain
Don't forget to rate helpful posts.
02-08-2014 04:42 AM
Thank you guys!
You have been more than helpful.
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: