What is the difference between the RIB and the FIB?
Show the answer
Say this first
The RIB is the routing table: the control plane's result, one best entry per prefix from all sources. The FIB is the forwarding copy built from it, with recursion already resolved and every entry pointing to an adjacency that holds the layer 2 rewrite. Protocols write to the RIB; packets only ever touch the FIB. On switches and big routers the FIB is programmed into the forwarding ASIC.
Go deeper
Three layers
- Protocol tables: OSPF database, EIGRP topology table, BGP table. Every path each protocol knows.
- RIB: the winners after metric and AD.
show ip route. - FIB and adjacency table: what forwarding uses.
show ip cef,show adjacency.
Where to look on each platform
| Layer | IOS-XE | Junos | Linux with FRR |
|---|---|---|---|
| Protocol | show ip ospf database, show ip bgp | show ospf database, show route receive-protocol bgp <peer> | vtysh -c "show ip bgp" |
| RIB | show ip route | show route | vtysh -c "show ip route" (zebra) |
| FIB | show ip cef | show route forwarding-table | ip route (the kernel table is the FIB) |
Why the split matters
- The control plane can churn without disturbing forwarding until the result changes.
- Hardware has limited FIB space. A full TCAM means routes exist in the RIB but cannot be programmed.
- RIB and FIB can disagree after bugs or programming failures. "It is in show ip route" does not prove the box forwards that way; check the FIB.
They will ask next
Is every RIB route in the FIB?
Normally yes, plus extra entries the RIB does not show: receive entries for the router's own addresses, host adjacencies for resolved neighbors, and drop entries for reserved ranges.
Traps
- Using RIB and FIB as two names for the same table.
How did you do?Book 3.5 Implementation