TTR Networks

What is RIB?

Routing Information Base

The RIB (Routing Information Base) is a router's routing table: every route it has learned, from which it picks the best one for each destination prefix.

Routes arrive from many places: directly connected interfaces, static routes, and dynamic protocols such as OSPF and BGP. Each protocol first picks its own best route for a prefix, and then offers it to the RIB. If more than one protocol offers the same prefix, the RIB picks one using administrative distance, a ranking of how trustworthy each source is; lower wins. In FRR and on Cisco devices the defaults include 0 for connected, 1 for static, 20 for eBGP, 110 for OSPF and 200 for iBGP. The selected route is then programmed into the FIB, the forwarding table the data plane actually uses to move packets, whether that's the Linux kernel's routing table or a switch chip. The RIB only compares routes for exactly the same prefix; choosing between overlapping prefixes such as a /24 and a /16 happens at forwarding time, by longest-prefix match.

The word turns up in a few related forms. BGP describes its own tables as Adj-RIB-In (routes received from each neighbour), Loc-RIB (the routes it has selected) and Adj-RIB-Out (what it sends each neighbour), which is why a route can be received but not used. In FRR, the zebra daemon manages the RIB and show ip route displays it, marking which routes were selected and installed. A useful troubleshooting habit is to check each stage in turn: is the route in the protocol's table, did it win in the RIB, and did it reach the FIB? A route that loses on administrative distance, or whose next hop isn't reachable, stays out of the forwarding table. See also FRR and ECMP. The OSPF Fundamentals lesson shows OSPF routes making their way into the routing table.

Lessons that use RIB

  • BGP FundamentalsIntermediate · 75 min

    How the Border Gateway Protocol glues the internet together: autonomous systems, sessions, path attributes, best-path selection, iBGP scaling and a hands-on eBGP lab with real FRR configuration.

Related terms