Forum

Notifications
Clear all

RIB (Routing Information Base) Protocol Explained.

1 Posts
1 Users
0 Reactions
11 Views
 josh
(@josh)
Member Admin
Joined: 2 months ago
Posts: 510
Topic starter  

The RIB (Routing Information Base), often simply referred to as the Routing Table, is a fundamental component in a router (or any device performing Layer 3 routing functions, like a Layer 3 switch or a host’s operating system). It’s a central database where all routing protocols (like OSPF, EIGRP, BGP, RIP, static routes, directly connected routes, etc.) store the routing information they learn and calculate.

Think of the RIB as the router’s “brain” or “master map” of the network. It contains all the possible paths to various destination networks that the router knows about, along with associated metrics and administrative distances.

 

What’s in the RIB?

 

For each destination network the router knows how to reach, the RIB typically stores the following information:

  1. Destination Network/Prefix: The network address and subnet mask (e.g., 192.168.1.0/24, 10.0.0.0/8).

  2. Next-Hop IP Address: The IP address of the next router or device in the path to the destination network.

  3. Outgoing Interface: The local interface on the router through which the packet should be sent to reach the next hop.

  4. Metric/Cost: A numerical value that represents the “cost” or “preference” of this particular path as determined by the routing protocol that learned it. Different protocols use different metrics (e.g., hop count for RIP, cost for OSPF, composite metric for EIGRP).

  5. Administrative Distance (AD): A vendor-specific (primarily Cisco, but widely adopted concept) value that indicates the trustworthiness or preference of a routing source. Lower AD values are preferred. For example:

    • Directly Connected: 0

    • Static Route: 1

    • eBGP: 20

    • EIGRP (internal): 90

    • OSPF: 110

    • RIP: 120

    • iBGP: 200

    • If a router learns about the same destination network from multiple routing protocols, it will always choose the path learned from the protocol with the lowest Administrative Distance.

  6. Protocol Source: Which routing protocol (or method) learned this route (e.g., OSPF, BGP, Static, Connected).

  7. Route Status: Whether the route is currently active, potentially active, or unreachable.

 

How the RIB is Populated and Used:

 

  1. Directly Connected Networks: Routes to networks directly connected to the router’s active interfaces are immediately added to the RIB. These routes have the lowest Administrative Distance (typically 0).

  2. Static Routes: Manually configured routes by an administrator are added to the RIB. These typically have a very low Administrative Distance (e.g., 1).

  3. Dynamic Routing Protocols:

    • Each dynamic routing protocol (OSPF, EIGRP, RIP, BGP) runs its own algorithms and maintains its own internal databases (e.g., OSPF’s Link-State Database, EIGRP’s Topology Table).

    • These protocols then “offer” their best calculated paths to the RIB.

    • The RIB, upon receiving multiple offers for the same destination, uses a two-step process to determine the ultimate best path:

      • Administrative Distance (AD): First, it compares the ADs. The route with the lowest AD wins.

      • Metric: If multiple routes from the same routing protocol are offered (or if the ADs are tied, which is rare for different protocols), the RIB then compares their metrics. The route with the lowest metric wins.

  4. Forwarding Information Base (FIB) / IP Routing Table:

    • Once the RIB has determined the absolute best path to each destination, it then installs these selected routes into the Forwarding Information Base (FIB), also often referred to simply as the “IP Routing Table” that is visible with commands like show ip route on Cisco devices, or ip route show on Linux.

    • The FIB is an optimized subset of the RIB, designed for high-speed packet forwarding. It usually contains only the single best path (or equal-cost multiple paths) to each destination and is often pre-compiled for fast lookup by the router’s forwarding plane (hardware or software).

 

Importance of the RIB:

 

  • Central Repository: It acts as the central repository for all learned routing information, allowing routers to maintain a comprehensive view of the network topology.

  • Route Selection: It’s responsible for the critical decision of selecting the single best path when multiple paths to the same destination are known from different sources or protocols.

  • Packet Forwarding (indirectly): While the FIB is used for actual packet forwarding, the RIB is the master database that populates the FIB.

  • Network Stability: A robust RIB management process ensures stable and efficient routing decisions across complex networks.

 

Commands to View the RIB:

 

On Cisco IOS/NX-OS and similar networking devices, the command to view the RIB (which is effectively the routing table used for forwarding) is:

  • show ip route (for IPv4)

  • show ipv6 route (for IPv6)

These commands display the routes that have been deemed the “best” by the router’s selection process and are ready for packet forwarding.

In summary, the RIB is the comprehensive, logical database where a router stores all routing knowledge, applies its route selection logic based on Administrative Distance and Metric, and then feeds the resulting best paths to the FIB for efficient packet forwarding.


   
Quote
Share: