TTR Networks

What is FIB?

Forwarding Information Base

The FIB (Forwarding Information Base) is the table a router actually uses to forward packets, built from the best routes chosen in its routing table.

A router learns routes from many sources: connected interfaces, static routes, OSPF, BGP and so on. All of these are collected in the RIB (Routing Information Base), which can hold several candidate routes for the same prefix. The router picks the best one for each prefix, usually by administrative distance and then the protocol's own metric, and installs only that winner, or several for ECMP, in the FIB. Each FIB entry holds only what forwarding needs: the prefix, the next hop and the outgoing interface, often with the layer-2 rewrite information ready to use. When a packet arrives, the router does a longest-prefix match against the FIB, with no protocol logic involved.

Separating the two lets the control plane (routing protocols, best-path selection) run on a general-purpose CPU while forwarding happens somewhere much faster. On hardware routers and layer 3 switches the FIB is programmed into the forwarding chips, whose memory is limited, so the number of routes a device can hold in hardware matters when taking a full internet table. On Linux, the kernel's routing table is the FIB, and routing daemons such as FRR install their best routes into it; in FRR's show ip route, a * marks routes installed in the FIB. A useful habit when troubleshooting is to check both: a route can be present in BGP or the RIB but inactive, and therefore never reach the FIB, so traffic doesn't follow it. The BGP on loopbacks lesson shows exactly that: routes that arrive but are never installed.

Lessons that use FIB

  • Route reflectors on VyOSIntermediate · 30 min

    Replace an iBGP full mesh with route reflectors: see iBGP refuse to pass routes on, turn on reflection, read ORIGINATOR_ID and CLUSTER_LIST, confirm the reflector stays out of the forwarding path, and survive taking one reflector down.

Related terms