12-26-2013 01:50 AM - edited 03-07-2019 05:14 PM
Hii Team,
I really don't understand what is the difference between CEF table and routing table as both are showing the same next-hop-address.
Please help
Regards,
Sanjib Pradhan
Solved! Go to Solution.
12-26-2013 04:51 AM
The Routing Information Base (RIB) is control plane and is assembled by routing protocols that find the best path and then they compete to install into the global RIB. Static routes can also be used of course.
The Forwarding Information Base (FIB) is data plane and is what is used when looking how to forward packets. Cisco uses CEF for this and as Rolf mentioned it is very efficient by doing mtrie lookup and having adjacency information cached.
Generally CPU based platforms will have their routing table in RAM while hardware based platforms will have their routes in TCAM.
See this session from ciscolive365.com with Pete Lumbis (CCIE/CCDE) for more information:
BRKARC-2350 - IOS Routing Internals (2013 Orlando)
https://www.ciscolive.com/online/connect/sessionDetail.ww?SESSION_ID=7668&backBtn=true
You need a free login to access the slides/video.
Daniel Dib
CCIE #37149
Please rate helpful posts.
12-26-2013 05:42 AM
Sanjib
Just to give you an example of where they might not be the same. If you use a recursive next hop in the routing table then you would see different next hops. So lets say you had these routes in your routing table -
192.168.5.0 255.255.255.0 192.168.6.1
192.168.6.0 255.255.255.0 192.168.7.1
the above is a recursive lookup ie. the router does not have a directly connected interface in the 192.168.6.x subnet so to route a packet to 192.168.5.x it needs to do a further lookup for the 192.168.6.x subnet.
If you did a "sh ip route 192.168.5.0 255.255.255.0" the routing table would show 192.168.6.1 as the next hop.
If you did a "sh ip cef 192.168.5.0 255.255.255.0" the CEF table would show 192.168.7.1 as the next hop because it has resolved the recursive lookup and put in the actual next hop to be used.
Jon
12-26-2013 02:09 AM
Hi Sanjib ,
I hope you dont mind going through this Discussion....
12-26-2013 02:45 AM
Sanjib,
you're correct: The next-hop information should be the same.
But in CEF the lookup is much more efficient, as it doesn't have to find a best (longest) match in the routing table, but contains pre-computed exact matches plus the encapsulation information needed for forwarding (from the ARP table) for every destination in it's data-structures.
Link: How to Choose the Best Router Switching Path for Your Network
HTH
Rolf
12-26-2013 04:51 AM
The Routing Information Base (RIB) is control plane and is assembled by routing protocols that find the best path and then they compete to install into the global RIB. Static routes can also be used of course.
The Forwarding Information Base (FIB) is data plane and is what is used when looking how to forward packets. Cisco uses CEF for this and as Rolf mentioned it is very efficient by doing mtrie lookup and having adjacency information cached.
Generally CPU based platforms will have their routing table in RAM while hardware based platforms will have their routes in TCAM.
See this session from ciscolive365.com with Pete Lumbis (CCIE/CCDE) for more information:
BRKARC-2350 - IOS Routing Internals (2013 Orlando)
https://www.ciscolive.com/online/connect/sessionDetail.ww?SESSION_ID=7668&backBtn=true
You need a free login to access the slides/video.
Daniel Dib
CCIE #37149
Please rate helpful posts.
03-29-2018 05:30 AM
Thank you all, for the explanation.
12-26-2013 05:42 AM
Sanjib
Just to give you an example of where they might not be the same. If you use a recursive next hop in the routing table then you would see different next hops. So lets say you had these routes in your routing table -
192.168.5.0 255.255.255.0 192.168.6.1
192.168.6.0 255.255.255.0 192.168.7.1
the above is a recursive lookup ie. the router does not have a directly connected interface in the 192.168.6.x subnet so to route a packet to 192.168.5.x it needs to do a further lookup for the 192.168.6.x subnet.
If you did a "sh ip route 192.168.5.0 255.255.255.0" the routing table would show 192.168.6.1 as the next hop.
If you did a "sh ip cef 192.168.5.0 255.255.255.0" the CEF table would show 192.168.7.1 as the next hop because it has resolved the recursive lookup and put in the actual next hop to be used.
Jon
12-26-2013 09:26 AM
That's a good example Jon!
Daniel Dib
CCIE #37149
Please rate helpful posts.
12-26-2013 09:38 PM
Dear Jon,
Really appriciated........
Regards,
Sanjib
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