cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
479
Views
3
Helpful
4
Replies

What exactly is a CEF adjacency?

Mitrixsen
Level 1
Level 1

I've read that there can be several CEF adjacencies from NetworkLessons.com.

Mitrixsen_0-1717952491245.png

I am a little confused. What does adjacency mean in this context? So far I know that there's an adjacency table which stores the L2 - L3 mappings and the pre-built Ethernet header. I also know that the adjacency table grabs this information from the ARP cache.

Because of that, I imagine an adjacency as a layer 2 to layer 3 mapping, just like with ARP. Yet we seem to be talking about routes here? So does adjacency mean something else in this context? Even the show commands display the CEF table.

Mitrixsen_1-1717952564733.png

Thank you in advance.

David

 

 

 

 

4 Replies 4

M02@rt37
VIP
VIP

Hello @Mitrixsen 

In the context of networking, particularly with CEF, an adjacency refers to the association between a next-hop IP address and its corresponding L2 address, necessary for packet forwarding. This adjacency is stored in the adjacency table, which is crucial for efficient packet forwarding by precomputing the L2 to L3 mappings, akin to ARP but integrated into the CEF architecture. The CEF architecture consists of two primary components: the FIB, derived from the IP routing table and used for quick lookups to determine the next hop for each IP packet, and the adjacency table, which stores the necessary L2 next-hop information, including MAC addresses and interface details. The adjacency table ensures that once the next-hop IP address is determined using the FIB, the corresponding L2 information is readily available, allowing the router to attach a pre-built Ethernet header to the packet and forward it efficiently. This integration speeds up the packet forwarding process because the L3 to L2 mapping has already been resolved. When using commands like show ip cef, you see the CEF FIB table with IP prefixes and next-hop information, while show adjacency displays the L2 next-hop details, highlighting the critical role of adjacencies in ensuring high-performance and seamless network operations by bridging the L3 routing decisions with L2 forwarding details.

 

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

Don't believe I can explain better than M02@rt37 has in their reply, but some information from various Cisco sources might help, so . . .

"Adjacency table - Nodes in the network are said to be adjacent if they can reach each other with a single hop across a link layer. In addition to the FIB, CEF uses adjacency tables to append Layer 2 addressing information. The adjacency table maintains Layer 2 next-hop addresses for all FIB entries."

"Adjacency table —Two nodes in the network are considered adjacent if they can reach each other using a single hop across a link layer. For example, when a packet arrives at one of the router's interfaces, the router strips off the data-link layer framing and passes the enclosed packet to the network layer. At the network layer, the destination address of the packet is examined. If the destination address is not an address of the router's interface or the all hosts broadcast address, then the packet must be routed."

"Check CEF Adjacency

In a similar way, you can further check the CEF adjacency table for all the Layer 2 information about the adjacent prefixes.

In order to check CEF adjacency on the control plane:"

Ramblin Tech
Spotlight
Spotlight

As you are asking questions about IOS forwarding internals, you might take a look at the Cisco Press book Cisco Express Forwarding by Stringfield, White, and McKee. It is available directly from Cisco Press, as a Kindle book from Amazon, and to O'reilly subscribers. Some parts are a bit dated (it is from 2007), but many of the concepts still apply to the IOS-XE IOSd process. Chapter 2 is dedicated to explaining how CEF functions.

In today's world of hardware forwarding (ie, NPUs), "CEF" largely takes place inside an ASIC with the searching for the Longest Prefix Matching taking place in a TCAM search which yields pointers to tables in static RAM (TCAM and SRAM being on-die with the NPU for performance). The Cisco NOS (XE/XR/NXOS) programs/configures the NPU to perform the CEF functions that originally took place in software with classic IOS. Of course, Cisco still sells CPU-based routers, albeit running on XE rather than cIOS; the CEF description in the book will be most directly applicable to those routers, though NPU-based routers perform the same CEF functions with different underlying implementation mechanisms.

 

 

Disclaimer: I am long in CSCO

"In today's world of hardware forwarding (ie, NPUs), "CEF" largely takes place inside an ASIC . . ."

BTW, what Jim is describing, has been fairly common in L3 switches or the higher end "routers" for some time.  What we're seeing is this hardware being used more commonly in mid-level "routers".  The distinction between a "L3 switch" and "router" continues to blur.  (BTW, within the Cisco line up, technology could produce a combined "L3 switch/router" but "marketing" comes into play too.  [I always found interesting the 6500 L3 switch vs. the 7600 router, which could use identical supervisor cards and/or some identical line cards, and even, for a while, ran a common .bin IOS image, but they were "different"; don't you know.])

Review Cisco Networking for a $25 gift card