Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

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
Silver

Difference between Cef table and Routing Table

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 Please rate helpful posts.
Hall of Fame Super Blue

Re: Difference between Cef table and Routing Table

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

6 REPLIES
New Member

Difference between Cef table and Routing Table

Hi Sanjib ,

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

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

Re: Difference between Cef table and Routing Table

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

Silver

Difference between Cef table and Routing Table

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 Please rate helpful posts.
Hall of Fame Super Blue

Re: Difference between Cef table and Routing Table

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

Silver

Difference between Cef table and Routing Table

That's a good example Jon!

Daniel Dib
CCIE #37149

Please rate helpful posts.

Daniel Dib CCIE #37149 Please rate helpful posts.
New Member

Difference between Cef table and Routing Table

Dear Jon,

Really appriciated........

Regards,

Sanjib

1774
Views
9
Helpful
6
Replies
CreatePlease login to create content