Tuesday 31 January 2017

RIB Vs FIB

RIB (or routing table) and FIB (or forwarding table) are two different tables within an IP networking platform.  They share common information but perform two distinctly different purposes.  They also each have a different degree of resource capacity to perform their respective roles.


Routing Information Base (RIB):
The Routing Information Base RIB is where all IP Routing information is stored. It is not specific to any routing protocol, rather a repository where all the routing protocols place all of their routes. Routes are inserted into the RIB whenever a routing protocol running on the router learns a new route. When a destination becomes unreachable, the route is first marked unusable and later removed from the RIB as per the specifications of the routing protocol they were learned from.
It is important to note that the RIB is NOT used for forwarding IP datagrams, nor is it advertised to the rest of the networks to which the router is attached. In summary it has:
·        All routes that are learnt via dynamic routing protocols
·        All directly attached networks, and
·        Any additional configured routes such as static routes

NOTE:Ideally, we should be using RIB to forward IP packets, but not possible due to the fact that some entries in routing table (static routes and BGP routes) could have next hops that are not directly connected. In order to find the next-hop the router has to perform recursive lookups to find the outgoing interface.
For Example look into the link mentioned at the end of this page.
Forwarding Information Base (FIB):
Forwarding Information Base (FIB) is used to make IP destination prefix-based switching decisions. FIB contains the interface identifier and next hop information for each reachable destination network prefix. The FIB is conceptually similar to a routing table. It maintains a mirror image of the forwarding information contained in the IP routing table.
When IP routes are copied from routing table to FIB, their next hops are resolved, outgoing interfaces are computed and multiple entries are created when the next-hop resolution results in multiple paths to the same destination.
The number of entries within a forwarding information base is one of the key elements that may influence the forwarding performance of a router. Generally, the more entries within the forwarding information base, the longer it could take to find the longest matching network prefix within the forwarding information base. But due to very fast ASIC based forwarding this is almost equal to line speed now.
It is useful to know the maximum forwarding information base size for a router as it will be an indicator of the ability of the router to function within the given application space, and whether the router will be able to handle projected network growth. It is not very common for vendors to explicitly mention the FIB size in data-sheets.
It takes time for a router to construct its forwarding information base. A router needs to process received routing packets, build the routing information database, select the best paths, build the forwarding information base and then distribute the forwarding information base or a subset thereof to the interface line-cards to off-load the routing process from the router CPU to interface line-cards.  This entire process can take several minutes with very large forwarding information bases.
As mentioned in RFC 3222.This architecture of having RIB and FIB separates the Control Plane function of the routing table from the Forwarding Plane function of the forwarding table. This separation of control and forwarding provides uninterrupted performance. Therefore, next time you evaluate a router or a layer3 switch then do check the size of routing table as well as FIB table.
For More Detailed Reading refer to the below 2 links :

1 comment:

Note: only a member of this blog may post a comment.