Switching - CEF Adjacency Table
In the context of Cisco Express Forwarding (CEF), an adjacency table (or adjacency database) is a data structure used to store information about the directly connected next-hop IP addresses. It complements the Forwarding Information Base (FIB), which stores the IP routing information. The adjacency table ensures that Layer 2 (Data Link Layer) information such as MAC addresses and ARP tables are readily available for CEF to perform efficient packet forwarding.
In the context of Cisco Express Forwarding (CEF), an adjacency table (or adjacency database) is a data structure used to store information about the directly connected next-hop IP addresses. It complements the Forwarding Information Base (FIB), which stores the IP routing information. The adjacency table ensures that Layer 2 (Data Link Layer) information is readily available for CEF to perform efficient packet forwarding.
Key Points of the Adjacency Table in CEF:
-
Relationship with FIB:
- While the FIB contains the routes and next-hop IP addresses, the adjacency table contains the detailed information required to forward packets to these next-hop addresses. Together, the FIB and adjacency table enable fast and efficient packet forwarding.
-
Content:
- Each entry in the adjacency table includes:
- Next-hop IP address.
- MAC address of the next-hop device.
- The output interface.
- Layer 2 encapsulation information.
- Each entry in the adjacency table includes:
-
Efficiency:
- By pre-computing the Layer 2 forwarding information and storing it in the adjacency table, CEF can forward packets with minimal processing per packet. This reduces the load on the router's CPU and improves forwarding performance.
-
Populating the Table:
- The adjacency table is populated through various means, such as Address Resolution Protocol (ARP) for IPv4 or Neighbor Discovery Protocol (NDP) for IPv6. When a next-hop IP address is determined by the FIB, the router looks up the corresponding Layer 2 address and stores this mapping in the adjacency table.
-
CEF Switching:
- During the packet forwarding process, CEF uses the FIB to determine the next-hop IP address and then uses the adjacency table to find the corresponding Layer 2 information. This two-step lookup process ensures quick and efficient packet forwarding.
Example:
Consider a packet destined for a remote network. The CEF process would work as follows:
- The FIB is consulted to find the next-hop IP address based on the destination IP address of the packet.
- The adjacency table is then used to find the Layer 2 information (like MAC address) corresponding to this next-hop IP address.
- The packet is encapsulated with the appropriate Layer 2 header and forwarded out the correct interface.
Summary:
The adjacency table is an essential component of CEF, providing the necessary Layer 2 information to forward packets quickly and efficiently. It works in tandem with the FIB to enable high-performance, scalable packet forwarding on Cisco routers.
Links:
https://forum.networklessons.com/t/cef-adjacency/576/13?u=lagapidis
https://networklessons.com/switching/cef-cisco-express-forwarding