{"id":169342,"date":"2026-06-21T12:01:28","date_gmt":"2026-06-21T09:01:28","guid":{"rendered":"https:\/\/computingforgeeks.com\/?p=169342"},"modified":"2026-06-21T12:01:28","modified_gmt":"2026-06-21T09:01:28","slug":"cisco-router-packet-forwarding-explained","status":"publish","type":"post","link":"https:\/\/computingforgeeks.com\/cisco-router-packet-forwarding-explained\/","title":{"rendered":"How a Cisco Router Forwards a Packet (CEF, FIB, and Adjacency)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">A packet arrives on one interface and leaves on another, and everything a router does happens in the microseconds between those two events. The <a href=\"https:\/\/computingforgeeks.com\/cisco-ip-routing-table-explained\/\">routing table<\/a> tells you the map, but it does not tell you what the router does the instant a frame lands. Plenty of candidates picture the router scanning <code>show ip route<\/code> top to bottom for every packet. A modern Cisco router does not work that way at all.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This guide walks the real packet forwarding machinery: the two planes a router runs, the forwarding table that Cisco Express Forwarding (CEF) builds, the adjacency table that stores the Layer 2 rewrite, and finally one packet followed from arrival to wire. Every screen below is real output from a two-router lab, not a sketch. If you want the protocol-level overview of how routes are chosen in the first place, the <a href=\"https:\/\/computingforgeeks.com\/what-is-ip-routing-and-routing-protocols-in-networking\/\">IP routing and routing protocols<\/a> guide covers that side.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Ran this on two Cisco IOS 15.2 routers in GNS3 in June 2026; every CEF, adjacency, and ARP line below is real device output.<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The two planes: one decides, one forwards<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A router splits its work into two jobs. The <strong>control plane<\/strong> runs the routing protocols, talks to neighbors, and builds the routing table. It is the slow, thoughtful brain that decides which path is best. The <strong>data plane<\/strong> is the muscle: it moves packets out interfaces as fast as the hardware allows, and it does not want to wait on the brain for every single frame.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">CEF is the bridge between them. The control plane settles on the best route per destination, then CEF distills that into a compact forwarding table the data plane can read at line rate. The lab below is two routers, R1 and R2, joined on a <code>10.0.12.0\/30<\/code> link running OSPF, with R1 holding a couple of loopbacks and a static route so its tables have something interesting to show.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1460\" height=\"560\" src=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-packet-forwarding-topology.png\" alt=\"Two-router topology showing R1 forwarding a packet to next hop 10.0.12.2 out Gi0\/0\" class=\"wp-image-169336\" title=\"\" srcset=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-packet-forwarding-topology.png 1460w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-packet-forwarding-topology-300x115.png 300w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-packet-forwarding-topology-1024x393.png 1024w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-packet-forwarding-topology-768x295.png 768w\" sizes=\"auto, (max-width: 1460px) 100vw, 1460px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">To prove the path actually forwards before dissecting how, a ping from R1&#8217;s <code>172.16.1.1<\/code> loopback to R2&#8217;s <code>192.168.20.1<\/code> stands in for a host behind R1 reaching a network behind R2:<\/p>\n\n\n\n<pre class=\"wp-block-code code\"><code>ping 192.168.20.1 source 172.16.1.1<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">All five replies come back, so the forwarding path is live end to end:<\/p>\n\n\n\n<pre class=\"wp-block-code code\"><code>Type escape sequence to abort.\nSending 5, 100-byte ICMP Echos to 192.168.20.1, timeout is 2 seconds:\nPacket sent with a source address of 172.16.1.1\n!!!!!\nSuccess rate is 100 percent (5\/5), round-trip min\/avg\/max = 20\/20\/24 ms<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">RIB vs FIB: the table you read vs the table that forwards<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The routing table you inspect with <code>show ip route<\/code> is the Routing Information Base, the RIB. It is the control plane&#8217;s conclusion: the single best route per prefix, with the source, administrative distance, and metric attached. The data plane does not forward from the RIB directly. CEF copies it into the Forwarding Information Base, the FIB, where every prefix is already resolved down to a next hop and an exit interface. View the FIB with <code>show ip cef<\/code>:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"2200\" height=\"1198\" src=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-show-ip-cef-fib.png\" alt=\"show ip cef output listing the FIB with receive, attached, next-hop and drop entries\" class=\"wp-image-169338\" title=\"\" srcset=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-show-ip-cef-fib.png 2200w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-show-ip-cef-fib-300x163.png 300w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-show-ip-cef-fib-1024x558.png 1024w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-show-ip-cef-fib-768x418.png 768w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-show-ip-cef-fib-1536x836.png 1536w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-show-ip-cef-fib-2048x1115.png 2048w\" sizes=\"auto, (max-width: 2200px) 100vw, 2200px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Read it as a flat lookup table. Each prefix maps straight to what the data plane needs. <code>192.168.20.0\/24<\/code> and <code>2.2.2.2\/32<\/code> point at <code>10.0.12.2<\/code> on <code>GigabitEthernet0\/0<\/code>: those came from OSPF. The static route&#8217;s <code>198.51.100.0\/24<\/code> resolves to the same next hop and interface. The other entry types matter just as much, and they are worth memorizing because they appear on every router.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>FIB entry<\/th><th>What it means<\/th><\/tr><\/thead><tbody><tr><td><code>receive<\/code><\/td><td>Destined to the router itself (its own interface IPs, plus the network and broadcast of its subnets). Punted to the control plane, not forwarded.<\/td><\/tr><tr><td><code>attached<\/code><\/td><td>A directly connected network. The router reaches hosts in it directly rather than through a next-hop router.<\/td><\/tr><tr><td><code>10.0.12.2 Gi0\/0<\/code><\/td><td>A route: forward toward this next hop, out this interface.<\/td><\/tr><tr><td><code>drop<\/code><\/td><td>A reserved or martian range (<code>0.0.0.0\/8<\/code>, <code>127.0.0.0\/8<\/code>, <code>224.0.0.0\/4<\/code>) that is silently discarded.<\/td><\/tr><tr><td><code>no route<\/code><\/td><td>Nothing matches. Here <code>0.0.0.0\/0<\/code> shows it because this router has no default route configured.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The whole lab runs on a clean GNS3 canvas, two c7200 routers cabled Gi0\/0 to Gi0\/0, so anyone can rebuild it and reproduce these exact tables:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1100\" height=\"480\" src=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-packet-forwarding-gns3.png\" alt=\"GNS3 canvas with R1 and R2 connected on Gi0\/0 for the CEF forwarding lab\" class=\"wp-image-169337\" title=\"\" srcset=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-packet-forwarding-gns3.png 1100w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-packet-forwarding-gns3-300x131.png 300w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-packet-forwarding-gns3-1024x447.png 1024w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-packet-forwarding-gns3-768x335.png 768w\" sizes=\"auto, (max-width: 1100px) 100vw, 1100px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">The adjacency table: the Layer 2 header the router pushes<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Knowing the next hop is half the job. To put the packet on an Ethernet link, the router needs the exact frame header to wrap around it: a destination MAC, a source MAC, and an EtherType. CEF keeps that ready-made header in the <strong>adjacency table<\/strong>, one entry per next hop, so it never has to build the frame from scratch per packet. <code>show adjacency ... detail<\/code> prints the literal bytes, and <code>show ip arp<\/code> reveals where they came from:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"2200\" height=\"874\" src=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-show-adjacency-arp-rewrite.png\" alt=\"Adjacency detail showing the Encap length 14 rewrite string decoded against the ARP table\" class=\"wp-image-169339\" title=\"\" srcset=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-show-adjacency-arp-rewrite.png 2200w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-show-adjacency-arp-rewrite-300x119.png 300w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-show-adjacency-arp-rewrite-1024x407.png 1024w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-show-adjacency-arp-rewrite-768x305.png 768w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-show-adjacency-arp-rewrite-1536x610.png 1536w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-show-adjacency-arp-rewrite-2048x814.png 2048w\" sizes=\"auto, (max-width: 2200px) 100vw, 2200px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The line <code>Encap length 14<\/code> is the size of an Ethernet header: 6 bytes of destination MAC, 6 of source MAC, 2 of EtherType. The rewrite string right below it, <code>CA0220620008CA01204600080800<\/code>, is those 14 bytes verbatim. Split it and every piece maps to something you can confirm in the ARP table:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Bytes (hex)<\/th><th>Field<\/th><th>Value<\/th><\/tr><\/thead><tbody><tr><td><code>CA0220620008<\/code><\/td><td>Destination MAC<\/td><td><code>ca02.2062.0008<\/code>, R2&#8217;s Gi0\/0 (the next hop, <code>10.0.12.2<\/code> in ARP)<\/td><\/tr><tr><td><code>CA0120460008<\/code><\/td><td>Source MAC<\/td><td><code>ca01.2046.0008<\/code>, R1&#8217;s own Gi0\/0 (<code>10.0.12.1<\/code> in ARP)<\/td><\/tr><tr><td><code>0800<\/code><\/td><td>EtherType<\/td><td>IPv4<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">That is the entire reason ARP matters to routing: the next hop&#8217;s MAC, learned by ARP, becomes the destination MAC in this rewrite. The trailing <code>ARP<\/code> in the adjacency output names exactly how the entry was resolved. The Layer 3 addressing that the <a href=\"https:\/\/computingforgeeks.com\/ipv4-addressing-explained\/\">IPv4 addressing<\/a> rules describe stays untouched; only this Layer 2 wrapper changes hop to hop.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The packet forwarding decision, start to finish<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Put the pieces together and a single forwarded packet runs through five steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>Longest-prefix match.<\/strong> The destination IP is matched against the FIB, and the most specific entry wins.<\/li><li><strong>Next hop and interface.<\/strong> That entry yields the next hop IP and the exit interface.<\/li><li><strong>Layer 2 rewrite.<\/strong> The adjacency table supplies the destination and source MAC for the new frame.<\/li><li><strong>TTL and checksum.<\/strong> The router decrements the IP TTL by one and recomputes the header checksum.<\/li><li><strong>Send.<\/strong> The packet, in its new Layer 2 frame, goes out the exit interface.<\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">You can watch the lookup resolve for a single destination. <code>show ip route 192.168.20.0<\/code> shows the RIB&#8217;s reasoning, and <code>show ip cef<\/code> for a host inside that prefix shows the resolved forwarding result the data plane uses:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"2200\" height=\"736\" src=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-cef-recursion-lookup.png\" alt=\"Per-destination CEF lookup and routing entry showing recursion resolved to the next hop and interface\" class=\"wp-image-169340\" title=\"\" srcset=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-cef-recursion-lookup.png 2200w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-cef-recursion-lookup-300x100.png 300w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-cef-recursion-lookup-1024x343.png 1024w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-cef-recursion-lookup-768x257.png 768w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-cef-recursion-lookup-1536x514.png 1536w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/cisco-cef-recursion-lookup-2048x685.png 2048w\" sizes=\"auto, (max-width: 2200px) 100vw, 2200px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The routing entry reports <code>Known via \"ospf 1\", distance 110, metric 2<\/code> via <code>10.0.12.2<\/code>, the control plane&#8217;s decision. The CEF lookup for <code>192.168.20.1<\/code> collapses all of that into one line: <code>nexthop 10.0.12.2 GigabitEthernet0\/0<\/code>. Longest-prefix match is what decides forwarding here. A packet for <code>192.168.20.55<\/code> matches <code>192.168.20.0\/24<\/code> over any broader entry because it is the most specific, regardless of administrative distance or metric.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Recursion: a static route via a next-hop IP<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">R1&#8217;s <a href=\"https:\/\/computingforgeeks.com\/cisco-ipv4-static-routes-configuration\/\">static route<\/a> to <code>198.51.100.0\/24<\/code> points at the next-hop IP <code>10.0.12.2<\/code>, not at an exit interface. On its own that is incomplete: to send a frame, the router still needs an interface and a destination MAC. So it performs a <strong>recursive lookup<\/strong>, finding the route to <code>10.0.12.2<\/code> (directly connected on Gi0\/0) and borrowing its interface and adjacency. CEF does this resolution once, ahead of time, which is why <code>show ip cef 198.51.100.1<\/code> already reads <code>nexthop 10.0.12.2 GigabitEthernet0\/0<\/code> with no recursion left to do at forwarding time.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is also the gap between CEF and the old process-switching model. Process switching had the CPU examine and look up each packet the slow way. CEF builds the complete FIB and adjacency table in advance, so even the first packet to a new destination is forwarded fast and the CPU stays out of the per-packet path. CEF is enabled by default on modern routers, which is why these tables are simply there to read.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Practice on your own lab<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Paste-ready R1 and R2 configurations for this exact topology are in the <a href=\"https:\/\/github.com\/c4geeks\/ccna-labs\/tree\/main\/packet-forwarding\" target=\"_blank\" rel=\"noreferrer noopener\">ccna-labs repository<\/a>. Build the two routers, load the configs, then run <code>show ip cef<\/code>, <code>show adjacency detail<\/code>, and <code>show ip arp<\/code> and trace the rewrite string back to the ARP table yourself. When you are comfortable, the <a href=\"https:\/\/computingforgeeks.com\/quickly-prepare-for-ccna-200-301-exam\/\">CCNA 200-301 study roadmap<\/a> maps where this fits in Domain 3, and the <a href=\"https:\/\/computingforgeeks.com\/network-devices-routers-switches-firewalls-explained\/\">network devices<\/a> guide places the router among the rest of the gear.<\/p>\n\n\n<div class=\"cfg-quiz\" data-quiz=\"{\n  &quot;id&quot;: &quot;packet-forwarding&quot;,\n  &quot;title&quot;: &quot;How a Cisco router forwards a packet (CEF) quiz&quot;,\n  &quot;objective&quot;: &quot;3.1 Forwarding: CEF, FIB, and the adjacency table&quot;,\n  &quot;intro&quot;: &quot;Ten questions on what a Cisco router actually does with each packet: the control and data planes, the FIB that CEF builds, the adjacency table that holds the Layer 2 rewrite, and what changes on the wire at every hop. Every answer is doc-checked or verified on a two-router lab.&quot;,\n  &quot;questions&quot;: [\n    {&quot;q&quot;: &quot;Which part of the router builds the routing table, and which part forwards packets?&quot;, &quot;options&quot;: [&quot;The data plane builds the table; the control plane forwards&quot;, &quot;The control plane builds the table (RIB); the data plane forwards using the FIB&quot;, &quot;Both are the same process&quot;, &quot;The CPU forwards every packet individually&quot;], &quot;answer&quot;: 1, &quot;explanation&quot;: &quot;The control plane runs routing protocols and builds the routing table (RIB). The data plane moves packets as fast as possible. CEF builds a forwarding table (FIB) from the RIB so the data plane never has to wait on the control plane.&quot;, &quot;validated&quot;: &quot;doc&quot;},\n    {&quot;q&quot;: &quot;Which command shows the FIB (the forwarding table CEF builds), as opposed to the routing table?&quot;, &quot;options&quot;: [&quot;show ip route&quot;, &quot;show ip cef&quot;, &quot;show ip protocols&quot;, &quot;show running-config&quot;], &quot;answer&quot;: 1, &quot;explanation&quot;: &quot;show ip route is the RIB (the routing table). show ip cef is the FIB: one pre-resolved entry per prefix with the next hop and exit interface already worked out. The data plane forwards from the FIB.&quot;, &quot;validated&quot;: &quot;lab&quot;},\n    {&quot;type&quot;: &quot;match&quot;, &quot;q&quot;: &quot;Match each show ip cef entry to what it means.&quot;, &quot;pairs&quot;: [{&quot;left&quot;: &quot;receive&quot;, &quot;right&quot;: &quot;Destined to the router itself (its own IPs)&quot;}, {&quot;left&quot;: &quot;attached&quot;, &quot;right&quot;: &quot;A directly connected network&quot;}, {&quot;left&quot;: &quot;10.0.12.2  Gi0\/0&quot;, &quot;right&quot;: &quot;Forward toward this next hop and interface&quot;}, {&quot;left&quot;: &quot;drop&quot;, &quot;right&quot;: &quot;Reserved or martian range, discarded&quot;}], &quot;explanation&quot;: &quot;In show ip cef, receive entries are the router&#039;s own addresses (punted to the control plane), attached entries are directly connected networks, a next-hop IP plus interface is a route to forward toward, and drop entries are martians\/reserved ranges like 127.0.0.0\/8 and 224.0.0.0\/4.&quot;, &quot;validated&quot;: &quot;lab&quot;},\n    {&quot;q&quot;: &quot;What does the adjacency table (show adjacency detail) hold for each next hop?&quot;, &quot;options&quot;: [&quot;The full routing table&quot;, &quot;The complete Layer 2 frame header to push: destination MAC, source MAC, and EtherType&quot;, &quot;The OSPF cost&quot;, &quot;A list of VLANs&quot;], &quot;answer&quot;: 1, &quot;explanation&quot;: &quot;The adjacency table holds the Layer 2 rewrite for each next hop: the destination MAC (the next hop), the source MAC (the router&#039;s exit interface), and the EtherType. For Ethernet next hops it is resolved from ARP.&quot;, &quot;validated&quot;: &quot;lab&quot;},\n    {&quot;type&quot;: &quot;numeric&quot;, &quot;q&quot;: &quot;The adjacency shows &#039;Encap length 14&#039;. How many bytes is that Ethernet rewrite header?&quot;, &quot;answer&quot;: &quot;14&quot;, &quot;hint&quot;: &quot;6 + 6 + 2.&quot;, &quot;placeholder&quot;: &quot;e.g. 18&quot;, &quot;explanation&quot;: &quot;An Ethernet header is 14 bytes: 6 for the destination MAC, 6 for the source MAC, and 2 for the EtherType (0800 for IPv4). The rewrite string CA0220620008CA01204600080800 is exactly those 14 bytes.&quot;, &quot;validated&quot;: &quot;lab&quot;},\n    {&quot;q&quot;: &quot;As a router forwards a packet to the next hop, what does it rewrite?&quot;, &quot;options&quot;: [&quot;The source and destination IP addresses&quot;, &quot;The Layer 2 header: a new source MAC (its exit interface) and destination MAC (the next hop)&quot;, &quot;Nothing, it forwards the frame unchanged&quot;, &quot;The TCP port numbers&quot;], &quot;answer&quot;: 1, &quot;explanation&quot;: &quot;At each hop the router rewrites the Layer 2 header (new source MAC = its exit interface, new destination MAC = the next hop). The Layer 3 source and destination IPs stay the same (NAT aside). That is the core of routing.&quot;, &quot;validated&quot;: &quot;doc&quot;},\n    {&quot;q&quot;: &quot;What does a router do to the IP TTL at every hop?&quot;, &quot;options&quot;: [&quot;Increases it by one&quot;, &quot;Leaves it unchanged&quot;, &quot;Decrements it by one; at zero it drops the packet and returns ICMP time-exceeded&quot;, &quot;Sets it to 255&quot;], &quot;answer&quot;: 2, &quot;explanation&quot;: &quot;Each router decrements the TTL by one and recomputes the header checksum. When the TTL reaches zero the packet is dropped and an ICMP time-exceeded is sent back. That behavior is what makes traceroute work.&quot;, &quot;validated&quot;: &quot;doc&quot;},\n    {&quot;q&quot;: &quot;A packet is destined to 192.168.20.55. The FIB has 192.168.20.0\/24 via 10.0.12.2 and 0.0.0.0\/0. Which entry forwards it?&quot;, &quot;options&quot;: [&quot;0.0.0.0\/0, because it matches everything&quot;, &quot;192.168.20.0\/24, because it is the most specific (longest-prefix) match&quot;, &quot;Neither, the host is not listed&quot;, &quot;Both, load-balanced&quot;], &quot;answer&quot;: 1, &quot;explanation&quot;: &quot;Forwarding uses longest-prefix match: the most specific matching entry wins. 192.168.20.0\/24 is more specific than the default route, so it forwards the packet; the default is used only when nothing more specific matches.&quot;, &quot;validated&quot;: &quot;lab&quot;},\n    {&quot;q&quot;: &quot;A static route points at a next-hop IP (not an exit interface). What does the router need to forward toward it?&quot;, &quot;options&quot;: [&quot;Nothing extra&quot;, &quot;A recursive lookup to find the route to that next hop and its exit interface&quot;, &quot;A second static route for every host&quot;, &quot;STP to converge first&quot;], &quot;answer&quot;: 1, &quot;explanation&quot;: &quot;A static route to a next-hop IP needs a recursive lookup: find the route to the next hop, then use its exit interface. CEF resolves the recursion once, in advance, and stores the final next-hop and interface in the FIB.&quot;, &quot;validated&quot;: &quot;lab&quot;},\n    {&quot;q&quot;: &quot;On a modern Cisco router, how is CEF switching used compared with process switching?&quot;, &quot;options&quot;: [&quot;Process switching is the default and faster&quot;, &quot;CEF is enabled by default; it forwards from a pre-built FIB, keeping the CPU out of the per-packet path&quot;, &quot;You must enable CEF for every interface manually&quot;, &quot;CEF only works for IPv6&quot;], &quot;answer&quot;: 1, &quot;explanation&quot;: &quot;CEF is on by default. It pre-builds the complete FIB and adjacency table, so even the first packet is forwarded fast and the CPU is not in the per-packet path. Process switching (the CPU examining each packet) is the slow fallback CEF replaces.&quot;, &quot;validated&quot;: &quot;doc&quot;}\n  ]\n}\n\" data-quiz-count=\"10\"><div class=\"cfg-quiz-loading\">Loading quiz...<\/div><\/div>\n\n\n<div class=\"cfg-fc\" data-fc=\"{\n  &quot;id&quot;: &quot;packet-forwarding&quot;,\n  &quot;title&quot;: &quot;Cisco Packet Forwarding (CEF) Flashcards&quot;,\n  &quot;objective&quot;: &quot;3.1 Forwarding: CEF, FIB, and the adjacency table&quot;,\n  &quot;intro&quot;: &quot;The forwarding facts worth knowing cold: control plane versus data plane, the RIB and the FIB, the adjacency table and the Layer 2 rewrite, longest-prefix match, and what changes on the wire at every hop. Tap a card to flip it, then mark whether you knew it.&quot;,\n  &quot;cards&quot;: [\n    {&quot;front&quot;: &quot;Control plane vs data plane&quot;, &quot;back&quot;: &quot;Control plane = routing protocols + the routing table (the slow brain that decides paths). Data plane = the part that actually moves packets as fast as possible. CEF makes the data plane fast.&quot;},\n    {&quot;front&quot;: &quot;RIB vs FIB&quot;, &quot;back&quot;: &quot;RIB = the routing table (show ip route), built by the control plane. FIB = the forwarding table (show ip cef) that CEF builds from the RIB, one pre-resolved entry per prefix with the next hop and exit interface ready to go.&quot;},\n    {&quot;front&quot;: &quot;Which command shows the FIB?&quot;, &quot;back&quot;: &quot;show ip cef. show ip route is the RIB; show ip cef is what the data plane actually forwards from.&quot;},\n    {&quot;front&quot;: &quot;What is the adjacency table?&quot;, &quot;back&quot;: &quot;show adjacency [intf] detail. For each next hop it holds the complete Layer 2 frame header to push: destination MAC, source MAC, and EtherType. For Ethernet it is resolved from ARP.&quot;},\n    {&quot;front&quot;: &quot;Decode the rewrite string CA0220620008CA01204600080800&quot;, &quot;back&quot;: &quot;14 bytes: CA02.2062.0008 = destination MAC (the next hop, R2), CA01.2046.0008 = source MAC (the router&#039;s own interface), 0800 = EtherType (IPv4). That is exactly 6 + 6 + 2 = Encap length 14.&quot;},\n    {&quot;front&quot;: &quot;The forwarding decision, step by step&quot;, &quot;back&quot;: &quot;1) longest-prefix match the destination in the FIB, 2) get the next hop + exit interface, 3) pull the L2 rewrite from the adjacency table, 4) decrement the TTL and recompute the checksum, 5) rewrite the L2 header and send it out the exit interface.&quot;},\n    {&quot;front&quot;: &quot;What gets rewritten as a packet crosses a router?&quot;, &quot;back&quot;: &quot;The Layer 2 header: new source MAC (the router&#039;s exit interface), new destination MAC (the next hop). The Layer 3 source and destination IPs do NOT change (NAT aside).&quot;},\n    {&quot;front&quot;: &quot;What happens to the TTL at each hop?&quot;, &quot;back&quot;: &quot;The router decrements it by one and recomputes the IPv4 header checksum. At zero the packet is dropped and an ICMP time-exceeded is returned. That is what makes traceroute work.&quot;},\n    {&quot;front&quot;: &quot;CEF entry: receive&quot;, &quot;back&quot;: &quot;The destination is the router itself (its own interface IPs, plus the network\/broadcast of its subnets). These are punted to the control plane, not forwarded.&quot;},\n    {&quot;front&quot;: &quot;CEF entry: attached&quot;, &quot;back&quot;: &quot;A directly connected network. The router reaches hosts in it directly (gleaning the host MAC via ARP) rather than through a next-hop router.&quot;},\n    {&quot;front&quot;: &quot;CEF entry: drop \/ no route&quot;, &quot;back&quot;: &quot;drop = a reserved or martian range (0.0.0.0\/8, 127.0.0.0\/8, 224.0.0.0\/4) that is discarded. 0.0.0.0\/0 &#039;no route&#039; means there is no default route configured.&quot;},\n    {&quot;front&quot;: &quot;What is a glean adjacency?&quot;, &quot;back&quot;: &quot;When the network is directly attached but the specific host&#039;s MAC is not yet known, CEF uses a glean adjacency to trigger ARP for that host, then completes the rewrite.&quot;},\n    {&quot;front&quot;: &quot;Longest-prefix match&quot;, &quot;back&quot;: &quot;When forwarding, the router picks the MOST specific FIB entry that matches the destination, regardless of administrative distance or metric. The default route is used only when nothing more specific matches.&quot;},\n    {&quot;front&quot;: &quot;Recursive lookup&quot;, &quot;back&quot;: &quot;A static route to a next-hop IP (not an exit interface) needs a second lookup to find the route to that next hop and its interface. CEF resolves the recursion once, in advance, into the FIB.&quot;},\n    {&quot;front&quot;: &quot;Process switching vs CEF&quot;, &quot;back&quot;: &quot;Process switching = the CPU examines each packet the slow way. CEF pre-builds the full FIB + adjacency table, so even the first packet is fast and the CPU is out of the per-packet path. CEF is on by default.&quot;},\n    {&quot;front&quot;: &quot;How does the adjacency get its destination MAC?&quot;, &quot;back&quot;: &quot;From ARP. show ip arp maps the next-hop IP to its MAC; that MAC becomes the destination in the adjacency rewrite. Confirm it by matching the rewrite string against the ARP table.&quot;}\n  ]\n}\n\" data-fc-anki=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/ccna-packet-forwarding-flashcards.apkg\"><div class=\"cfg-fc-loading\">Loading flashcards...<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">What changes and what stays the same as a packet crosses a router<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The cleanest way to hold all of this in your head is to track what a router rewrites and what it leaves alone. The Layer 2 header is rebuilt at every hop: the source MAC becomes the router&#8217;s exit interface, the destination MAC becomes the next hop&#8217;s interface, both pulled from the adjacency table. The Layer 3 source and destination IP addresses do not change as the packet crosses the router. The TTL drops by one each hop, and when it reaches zero the packet is dropped and an ICMP time-exceeded is returned, which is precisely the mechanism traceroute relies on. Keep that split straight, the IPs ride through while the MACs and the TTL change, and the routing table, the FIB, and the adjacency table all stop being three mysteries and become three views of the same forwarding decision.<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>A packet arrives on one interface and leaves on another, and everything a router does happens in the microseconds between those two events. The routing table tells you the map, but it does not tell you what the router does the instant a frame lands. Plenty of candidates picture the router scanning show ip route &#8230; <a title=\"How a Cisco Router Forwards a Packet (CEF, FIB, and Adjacency)\" class=\"read-more\" href=\"https:\/\/computingforgeeks.com\/cisco-router-packet-forwarding-explained\/\" aria-label=\"Read more about How a Cisco Router Forwards a Packet (CEF, FIB, and Adjacency)\">Read more<\/a><\/p>\n","protected":false},"author":3,"featured_media":169341,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[299,55],"tags":[524,525],"cfg_series":[39888],"class_list":["post-169342","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-how-to","category-networking","tag-ccna","tag-cisco","cfg_series-ccna-200-301"],"_links":{"self":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/169342","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/comments?post=169342"}],"version-history":[{"count":1,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/169342\/revisions"}],"predecessor-version":[{"id":169345,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/169342\/revisions\/169345"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/media\/169341"}],"wp:attachment":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/media?parent=169342"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/categories?post=169342"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/tags?post=169342"},{"taxonomy":"cfg_series","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/cfg_series?post=169342"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}