Introduction
You might have heard of CEF if you are working closely with network switches and routers. Cisco Express Forwarding or CEF is an advanced layer 3 switching technology that is used particularly in large networks or the Internet in order to enhance the overall performance of the network. CEF is a kind of feature that allows a router to quickly and successfully find a route by using a special type of database referred to as the Forwarding Information Base (FIB) and an adjacency table. In this blog, we will explain what CEF in networking is, its brief history, how it works, its components, and its benefits and drawbacks.
Before getting into more details, let’s first understand what CEF really is.
What is Cisco Express Forwarding (CEF) in Networking?
Cisco Express Forwarding (CEF) is a Layer 3 IP switching technology. Cisco developed this system to handle fast IP packet forwarding. It operates at the network layer of the OSI model. CEF has been the standard switching method on Cisco devices since the 1990s. Most modern Cisco routers and switches enable it automatically. The system works with ASICs and network processing units for high throughput.
CEF uses two key data structures stored in memory. The Forwarding Information Base (FIB) contains all IP routing entries. The Adjacency Table stores Layer 2 rewrite information for next-hop addresses.
This technology eliminates the need for route lookups on each packet. Traditional routing checks the routing table every time. CEF pre-builds forwarding decisions. This speeds up the entire process significantly.
Network administrators benefit from reduced CPU usage. CEF handles more traffic with less processing overhead. It supports multiple path load balancing, too. This distributes packets across available links efficiently.
Technology adapts to network changes quickly. When topology updates occur, CEF rebuilds its tables accordingly.
Now that we have an understanding of CEF in networking. Let’s move on to the history of CEF.
History of Cisco Express Forwarding
When CEF was not developed, process switching and fast switching were the two mechanisms utilized by Cisco routers to switch packets.
The initial technique, i.e., process switching, included the router’s CPU looking up the routing table for each packet and forwarding it to the interface. This was called process switching. For big networks with several destinations, process switching was slow and CPU-intensive.
After that, there were some improvements, and fast switching was introduced. In order to store the routing information for previously routed packets, fast switching uses a cache. Fast switching enhanced throughput and decreased CPU burden, but it was not without its drawbacks. For instance, policy-based routing, quality of service, and multicast routing were not supported by fast switching.
In order to overcome the drawbacks of fast switching and offer improved performance and scalability, CEF was launched in the middle of the 1990s. Without using the CPU, CEF switched packets using a pre-built FIB and adjacency table. All the functionalities that fast switching did not offer were also supported by CEF.
We have discussed the history of CEF and how it comes into action to overcome the limitations. Let’s now understand the components of CEF.
Components of Cisco Express Forwarding
The main components of CEF are:
FIB (Forward Information Base)
The FIB is a data structure that carries all of the forwarding records for each destination within the routing table. The FIB entries include the destination prefix, the subsequent hop address, the outgoing interface, and any extra information along with Quality of Service (QoS) or MPLS labels. The FIB is saved inside the memory of the router and updated by way of the routing protocols each time there is any change within the network topology.
The FIB is created and maintained by using the router’s CPU based on the IP routing table. The FIB is also distributed to all line cards or interfaces that are supported by CEF in order to perform the route lookup locally.
Adjacency Table
The adjacency table is a data structure that contains the layer 2 information for every subsequent hop inside the FIB. The adjacency table entries include the next hop address, the layer 2 header, and any additional information along with QoS or MPLS labels. The Adjacency Table is saved inside the memory of the router and updated by way of ARP or different Layer 2 protocols each time there is a change within the Layer 2 information. The adjacency table is also distributed to all line cards or interfaces that are supported by CEF in order to append the correct layer 2 headers to each packet before forwarding it.
Now, we have a basic understanding of the components of CEF. Let’s move on to the working of CEF.
CEF Basic Packet Flow
CEF switching follows a specific sequence of steps when processing packets through network devices. These are:
- Packet Arrival: The Network interface reads incoming packets from the cable and stores data in a buffer memory called the RX ring for processing.
- Processor Notification: The Interface sends an interrupt signal to the main processor, telling it that a new packet needs switching attention right away.
- Route Lookup Process: Device searches the FIB table using the destination IP address to find the longest matching route entry available.
- Path Selection: If lookup works, the system picks the FIB path and uses the pointer to find the correct adjacency table entry data.
- Header Modification: Router updates the Layer 2 header information using encapsulation details stored in the adjacency table for the next hop.
- Output Queue Placement: Modified packet gets placed into the proper output queue for transmission through the correct outbound network interface.
- Final Transmission: Successfully processed packet moves to TX ring on outbound interface, ready for network delivery to next device.
How does Cisco Express Forwarding works?
CEF works by following these steps:

- CEF maintains two data structures in the router’s memory: the Forwarding Information Base (FIB) and the Adjacency Table. The FIB contains information about the best next hop for each destination network, while the Adjacency Table contains information about the Layer 2 headers and interfaces for each next hop.
- When CEF is activated on a router, the FIB and adjacency table are comprised of the IP routing table and the ARP cache, respectively.
- The router extracts the destination IP address from the packet header when a packet reaches the router interface, then searches the FIB for the excellent matched path and its next-hop address.
- The router then consults the Adjacency Table to find the corresponding Layer 2 header and interface for the next hop. The router adds the Layer 2 header to the packet and forwards it to the appropriate interface.
- The packet is forwarded to the next-hop interface along with the layer 2 header by means of the router after appropriately encapsulating the packet.
- The router continues similar processes for every incoming packet until it reaches its final destination.
Cisco Express Forwarding Modes
CEF can operate in one of two modes: central or distributed.
Central CEF Mode
In central CEF mode, all packets are routed by the router’s CPU, which also contains the FIB and adjacency database. When line cards or interfaces do not support CEF or when some features conflict with distributed CEF mode, central CEF mode may be employed.

Even while central CEF mode does not offer all of CEF’s advantages, it is still quicker than process switching or fast switching.
Distributed CEF Mode
The FIB and adjacency table are distributed to all line cards or interfaces that support CEF when using distributed CEF mode, and all packets are routed locally by the line cards or interfaces.

Since it reduces CPU burden and boosts throughput, distributed CEF mode offers the highest performance and scalability for CEF. Additionally available in distributed CEF mode are functions like load balancing, QoS, NetFlow, and MPLS.
CEF Load Balancing
CEF can perform load balancing across multiple paths to the same destination. This feature helps distribute network traffic evenly across available routes. Load balancing improves bandwidth usage and prevents single-path congestion. Network administrators configure load balancing to match their traffic requirements.
CEF load balancing can be per-destination or per-packet. The choice between per-destination and per-packet methods depends on application needs and network design goals.
Per-Destination
All packets in a flow are transmitted over the same path when using per-destination load balancing, preserving packet order but perhaps underutilizing bandwidth.
Per-Packet
Per-packet load balancing is an optional mode for CEF. In this mode, CEF alternates each packet across the available paths in a round-robin fashion. Per-packet load balancing provides a more even distribution of traffic across the paths, but it also introduces the possibility of out-of-order delivery, which can affect some applications such as TCP.
Let’s now discuss the advantages and disadvantages of CEF.
Advantages of Cisco Express Forwarding
CEF offers various advantages, some of these are:
- Faster packet forwarding – CEF eliminates the need for CPU-intensive routing table lookups for each packet by using pre-computed FIB and Adjacency Table entries.
- Lower CPU utilization – By assigning the majority of the packet-switching activities to hardware or line cards, CEF lowers the CPU stress.
- Higher scalability – Large routing tables and complicated topologies may be handled by CEF without affecting performance or stability.
Disadvantages of Cisco Express Forwarding
Apart from all the advantages, CEF has some disadvantages also. Some of these are:
- Higher Memory Consumption – CEF requires more memory to store the FIB and the Adjacency Table, which can be a problem for a few platforms or configurations.
- Increased Complexity – CEF introduces more components and modes that could make troubleshooting and debugging extra hard.
- Potential Inconsistency – CEF can reason for inconsistency among the FIB and the routing desk or among the Adjacency Table and the ARP cache if there is a delay or failure in updating the tables.
These are the advantages and Disadvantages of Cisco Express Forwarding.
Frequently Asked Questions
Q1. What does Cisco Express Forwarding do?
A proprietary type of scalable switching called Cisco Express Forwarding (CEF) switching was created to address the issues related to demand caching. The information that is typically saved in a route cache is divided over different data structures when CEF switching is used.
Q2. What is the difference between fast switching and Cisco Express Forwarding?
Fast switching and Cisco Express Forwarding are both cache-based packet-switching methods. Fast switching relies on a demand-based cache that is built by process switching. Cisco Express Forwarding uses a pre-built cache that contains both Layer 2 and Layer 3 information for faster and more efficient switching.
Q3. What are the two main components of Cisco Express Forwarding?
Two main components of Cisco Express Forwarding are:
- FIB (Forward Information Base)
- Adjacency Table
Q4. Which Cisco Express Forwarding mechanism?
Cisco Express Forwarding (CEF) is a packet-switching technique that optimizes the performance and scalability of network routers. CEF uses two main mechanisms to forward packets: the Forwarding Information Base (FIB) and the Adjacency Table.
Conclusion
Cisco Express Forwarding is a packet-switching technique that enables routers to forward packets faster and more efficiently. In this blog, CEF explained in detail, its history, how it comes into action, and how it assists in eliminating the limitations that other switching types had before. We also have explained the functioning of CEF along with its different modes. Various advantages and disadvantages of using CEF have also been explained.








