cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
11791
Views
29
Helpful
7
Replies

Difference between Cef table and Routing Table

Sanjib Pradhan
Level 1
Level 1

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
Level 7
Level 7

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
Hall of Fame
Hall of Fame

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
Level 1
Level 1

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
Level 7
Level 7

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.

Thank you all, for the explanation. 

Jon Marshall
Hall of Fame
Hall of Fame

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

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

Getting Started

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:

Review Cisco Networking products for a $25 gift card