cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
Join Customer Connection to register!
9040
Views
14
Helpful
7
Replies
Sanjib Pradhan
Beginner

Difference between Cef table and Routing Table

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

2 ACCEPTED SOLUTIONS

Accepted Solutions
daniel.dib
Rising star

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.

Daniel Dib
CCIE #37149
CCDE #20160011

Please rate helpful posts.

View solution in original post

Jon Marshall
VIP Community Legend

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

View solution in original post

7 REPLIES 7
Milan Rai
Beginner

Hi Sanjib ,

I hope you dont mind going through this Discussion....

https://learningnetwork.cisco.com/message/13315#13315

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

daniel.dib
Rising star

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.

Daniel Dib
CCIE #37149
CCDE #20160011

Please rate helpful posts.

View solution in original post

Thank you all, for the explanation. 

Jon Marshall
VIP Community Legend

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

View solution in original post

That's a good example Jon!

Daniel Dib
CCIE #37149

Please rate helpful posts.

Daniel Dib
CCIE #37149
CCDE #20160011

Please rate helpful posts.

Dear Jon,

Really appriciated........

Regards,

Sanjib