writemem.co.uk

Go Configure!

What is a RIB and a FIB?

3 min read
rack-of-rib

What is a RIB?

A RIB (Routing Information Base) is a database where routes and route metadata is stored by a routing protocol – allowing the routing protocol to select a ‘best’ path to a given destination. 

Each protocol has its own separate RIB that contains data relevant only to it. For example, the BGP routing protocol uses AS_PATH length as one factor in deciding the best path, so its RIB contains a field to record this; whereas OSPF’s RIB does not. 

Where does the routing table fit in?

The routing table can be thought of as a master RIB, where all of the routes from different routing protocols are whittled down to the best of the best in a hunger games-esque showdown.

Here’s a quick video overview of administrative distance showing how the routing table selection occurs when there are two protocols competing to be the best path to a destination. The values given are for Cisco devices, other vendors may have alternative admin distance values.

What is Administrative Distance?

You can read further on the topic of AD here or check out my Administrative Distance Cheat Sheet should you wish to know more.

What is a FIB?

A FIB’s (Forwarding Information Base) purpose in life is to pick up a packet, look at the destination, and quickly send it out of the relevant local interface towards its next hop. It is essentially a copy of the successful routes from the IP routing table implemented in optimised hardware. 

To learn more about how the FIB works with CEF (Cisco Express Forwarding) please see “CEF – A simple guide”.

The RIB bone’s connected to the FIB bone.

The elements that we’ve discussed so far are all linked together, there is a flow from one database to another.

The best paths from EIGRP’s RIB and the best paths from BGP’s RIB are passed into the routing table RIB. Where competing paths exist from multiple routing protocols then Administrative Distance (AD) as a tiebreaker – lower is better.The winning paths are then passed to the FIB to be used for forwarding packets on to the next-hop router. The same process has also happened on the next router and the next one, until the packet reaches its destination.

Here is the flow logic in diagram form for your viewing pleasure:

Summary

In this article we have looked into the purpose of a RIB and FIB. We’ve looked at some of their differences, and how they work together to produce a single path decision output based on many path inputs – and the role that Administrative Distance has to play in this process.