03-31-2025 07:13 AM - edited 03-31-2025 09:58 AM
Understanding Cisco Express Forwarding (CEF) Architecture
Cisco Express Forwarding
FIB and Adjacency Tables
CEF Operation
CAM and TCAM Tables
Cisco Express Forwarding (CEF):
Forwarding Information Base:
Adjacency Table:
Cisco Express Forwarding can be enabled in one of these two modes:
Central Cisco Express Forwarding mode: When central Cisco Express Forwarding mode is enabled, the Cisco Express Forwarding FIB and adjacency tables reside on the route processor, and the route processor performs the express forwarding.
Distributed Cisco Express Forwarding mode: When distributed Cisco Express Forwarding is enabled, line cards in a chassis-based switch maintain identical copies of the FIB and adjacency tables.
You can use central Cisco Express Forwarding mode when line cards are not available for Cisco Express Forwarding switching or when you need to use features not compatible with distributed Cisco Express Forwarding switching.
Cisco Express Forwarding Operations:
The process involves these five main steps:
Step-1: An IP datagram is placed into the input buffers on the receiving line card (ingress line card), and the Layer 2/Layer 3 forwarding engine accesses the Layer 2 and Layer 3 information in the packet and sends it to the forwarding processor. The forwarding processor determines that the packet contains routing information. The forwarding processor sends the pointer to the RP virtual output queue (VOQ) and indicates that the packet in buffer memory must be sent to the RP.
Step-2: The line card issues a request to the clock and scheduler card. The scheduler card issues a grant, and the packet is sent across the switching fabric to the RP.
Step-3: The RP processes the routing information. The processor on the RP updates the network routing table. The processor generates the IP packets that carry the link-state information and the internal update for the FIB tables. Additionally, the RP calculates all the recursive routes that occur when support is provided for both an interior protocol and external gateway protocols. The calculated recursive route information is sent to the FIBs on each line card.
Step-4: The RP sends out internal updates to FIB tables on all line cards and includes those located on the RP. The FIB updates to the line cards are monitored and throttled if needed. The RP has a copy of each line card FIB table, so if a new line card is inserted into the chassis, the RP downloads the latest forwarding information to the new card once that card becomes active.
Steps-5: The RP is notified from the line cards whenever a new neighbor router is connected to the router. The processor on the line card sends a packet to the RP that contains the new Layer 2 information. The RP uses this Layer 2 information to update the adjacency table located on the RP and on the line cards. Each line card adds this Layer 2 information to each packet as the packet is sent from the router. A copy of the adjacency table is maintained on the RP for initialization purposes.
Once the line cards have enough forwarding information to determine the path through the switching fabric (for instance, the destination of the next hop), the router is ready to forward packets.
The following steps outline the simple and fast forwarding technique used by the router:
The advantage of this simple forwarding process is that most data transmission tasks can be done in ASICs and allows the router to operate at high rates. Also, data packets are never sent to the RP.
To Verify CEF
MLS# show ip cef
% CEF is not running
To Enable CEF
MLS(config)# ip cef
To Disable CEF
MLS(config)# no ip cef
To Verify Adjacency Table
For example, If we have multiple paths from source to destination then you will find multiple next-hops in the cef table. If we're doing layer 3 load balancing, that means we could actually have multiple next-hops that we might want to use. And while that may be a little bit slower, this hardware switching would adversely affect layer 3 load balancing.
So we may want to disable cef on interfaces where we are doing layer 3 load balancing. In order to disable cef on an interface, we would have to go into that interface.
Introduction to CAM & TCAM TABLES:
Content Addressable Memory (CAM) Table:
How CAM Works ?
Ternary Content Addressable Memory (TCAM) Table:
Thank you very much..!
Very informative and Thanks for sharing!
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: