CEF is a topology-driven technology and makes use of a FIB. The FIB is basically a mirror image of the IP routing table. When topological changes occur, the FIB is updated based on the updates in the IP routing table. The FIB maintains next-hop address information based on information provided by the protocol routing table. Because CEF maintains a one-to-one listing of routes in the IP routing table, the need for constant maintenance of FIB entries is eliminated because that function is provided by the Layer 3 routing protocol. CEF simply cheats and copies its work.
Updates to the CEF FIB are not packet-triggered. They are change-triggered. As the IP routing table converges, the CEF FIB is also updated. This update mechanism is dependent upon, but separate from, the algorithm used by the routing protocol for update maintenance whether the protocol is link-state or distance vector.
The FIB differs from a fast-switching cache in that it does not contain information regarding the egress interface and corresponding Layer 2 encapsulation information. CEF maintains an adjacency table for this purpose. Nodes are said to be adjacent if they are able to make contact across a single Layer 2 connection. Adjacencies are built at Layer 2 and linked to the FIB, thereby eliminating any need for ARP requests. As adjacencies are discovered, the adjacency table is updated along with pertinent information regarding the adjacent device.
Enabling CEF on Internet-facing devices is not a decision to be taken lightly if the Internet routing table is to be redistributed into that router, due to the sheer size of the job. The Internet routing table is well in excess of 200,000 routes and 24,000 autonomous systems at the time of this writing. The amount of processing and memory it takes to maintain the routing table is enormous.
On high-end routers, CEF can be run in distributed mode. This allows routers such as the Cisco 12000 GSR router to run independent CEF instances on each blade, thereby increasing the independence of the blade and reducing load on the central routing table and FIB. This provides a faster, more efficient switching environment.
Was this article helpful?