RIB = is not used for forwarding and it’s derived from the control plane. Every protocol such as OSPF, EIGRP, & BGP all have their own RIB and select their best candidates to put them into the global RIB (Routing Table).
FIB = is used for forwarding and it’s derived from the RIB and adjacency tables. It basically pre-poplulates all the information needed to do the actual forwarding which includes Layer 2 reach-ability information for the next-hop addresses in the RIB.
To view the tables: RIB – show ip route FIB – show ip cef, show adjacency
To view specific protocol RIBs: OSPF – show ip ospf rib EIGRP – sh ip eigrp topology BGP – show ip bgp
Routing Information Base (RIB)
The Routing Information Base RIB is the location in which all IP Routing information is stored. The RIB is not specific to any routing protocol, rather, it is the 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. A Cisco router’s RIB will contain filtered routes; however, these will never make it to the “Forwarding Information Base”, which contains yet a different set of routes.
Forwarding Information Base (FIB)
Cisco routers build a Forwarding Information Base (FIB) which contains all the routes that could potentially be advertised to all neighboring routers within the next set of announcements. This is also the same set of routes used to forward IP datagrams. On Cisco routers with a distributed forwarding architecture and which have Distributed Cisco Express Forwarding (DCEF) enabled, a copy of the FIB will be ‘compiled’ and downloaded to the applicable line-cards or modules. This offloads a large portion of the routing load from the main CPU and increases the overall traffic load that can be sustained by the router.