Christmas Offer - Every Learner Must Check Out - Flat 88% OFF on All Access Pass
00
days
:
00
hours
:
00
minutes
:
00
seconds
PyNet Labs- Network Automation Specialists

What is Cisco Express Forwarding?

Author : PyNet Labs
Last Modified: January 29, 2024 
What is Cisco Express Forwarding Featured Image showing CEF working topology.

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 CEF in Networking?

CEF or Cisco Express Forwarding is a form of packet switching technology that uses the destination IP address of a packet to decide the next hop for forwarding.  It allows a router to do path lookup effectively. By building a unique searchable tree structure based on the IP routing table, CEF streamlines routing table lookup.

Unlike process switching, which includes the router’s CPU in each packet forwarding decision, CEF performs the route lookup in hardware, which reduces the CPU load and increases the throughput. Unlike fast switching, which caches the next hop records for information for often-used locations, CEF maintains a complete copy of the routing table in a FIB, which eliminates the need for cache maintenance and guarantees regular forwarding behavior.

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.

How does Cisco Express Forwarding works?

CEF works by following these steps:

A topology showing the working of CEF with the use of routers and its control plane and data plane
  • 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.

A topology showing the central CEF Mode using cisco 7500 series router running CEF connected to Cisco Catalyst Switches

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.

A topology showing distributed CEF Mode with the use of 3 line cards connected to route processor and working with GSR, Cisco 7200 and 7500 Series Routers

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. CEF load balancing can be per-destination or per-packet.

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.

Recent Blog Post

Leave a Reply

Your email address will not be published. Required fields are marked *

linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram