What's the difference between a RIB and FIB?

Describing two important routing tables and the difference between them.

What's the difference between a RIB and FIB?
Photo by José Martín Ramírez Carrasco / Unsplash
💡
This is part of a new on-going series in networking foundations. Check the networking 101 article tag index from time to time for more content.

Today's topic is a quick geeky one 🤓. Let's dive into more details about routing (specifically route tables). For the purpose of this article, I'll use Fortinet firewalls as an example but keep in mind that the overarching principals here apply to other vendors and routers as well.

FortiGate firewalls store routing information in two places (tables): a Routing Information Base (RIB) and a Forwarding Information Base (FIB). These sound similar (and they are) but they also have some important differences:

  • Routing Information Base (RIB)
    • Think of this as basically the "brain" or "blueprint" of all routing knowledge on the FortiGate. It's where all of discovered routes are stored, regardless of whether they are currently the best or active paths.
    • The purpose of the RIB is to build and maintain a complete view of the network topology.
    • Logically speaking, the RIB functions in the "control plane" of the FortiGate. It's managed by the FortiGate's CPU and is where the complex calculations and decisions about routing paths are made.
    • Important detail: The RIB does not directly forward packets.
  • Forwarding Information Base (FIB)
    • The FIB is a simplified, optimized version of the RIB. It only contains the best, active routes needed for actual packet forwarding.
    • Information in the FIB is derived from information in the RIB.
    • The FIB lives in the "data plane" (sometimes called the forwarding plane) of the FortiGate. This is often offloaded to specialized hardware (ASICs or NPUs) for super fast lookups and forwarding without involving the main CPU for individual packets.

Think of it this way: The RIB is where FortiGate decides the best way to reach a destination. The FIB is the optimized table it uses to send packets.

For more details and information, check out the following resources:

FortiGate - Viewing FIB/RIB routing information in CLI
how to view routing information. Scope FortiGate Routing. Solution View routing information on FortiGate CLI. All IP routing protocols submit the best routes for each destination to the routing table.The routing table manager then determines which route for a particular destination is t…
Routing in FortiGate (route-lookup-process)
how FortiGate performs route lookup and selects the outgoing interface. Scope FortiGate.Solution By design and by default FortiGate performs two routing lookups for any session: One on the first packet sent by the originator.Another one on the first reply packet coming from the responder. No mor…
What is a routing table?
A simple explanation of routing tables.