What's the difference between a RIB and FIB?
Describing two important routing tables and the difference between them.
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: