Router packet processing covers three core switching methods—process switching, fast switching, and Cisco Express Forwarding (CEF)—that determine how efficiently a router forwards traffic through its data plane and CPU.
Router Packet Processing
We're going to take a technical look at how packets come into the router and how the router processes those packets. We're going to take a deep dive into three different ways that a router can process this information: how it uses process switching, how it uses fast switching, and how it uses Cisco Express Forwarding, or CEF, to be able to process these packets faster.
Right here we are going to be processing a packet. The packet is going to come in on an interface, the router is going to process it, and then it's going to go out, and it's going to look a little differently.
As this packet comes in, it has certain information in it. First of all it has the payload — that's the information that it's trying to get sent from one location to the next. Then it has directions on how it's going to get there — or not necessarily directions, actually more of an address, an address of where it's going. It comes in the form of an IP address. That's what a packet has that gives the router information on how it's going to be sent along the way. And then it has this data link layer. For instance, if this is coming up through an Ethernet, then it's going to have a destination MAC address and a source MAC address — although if it's Point-to-Point Protocol or HDLC, we know that that address looks quite a bit different.
So if this is a MAC address that's coming across — let's say this is coming in on the ethernet and there's a MAC address in this data link layer — the first thing that the router is going to do is see if that data link layer right there has the MAC address destined for the interface it's coming in on. Essentially it's going to say, does this belong to me, is this being sent to me? Once it determines that yes, this is being sent to me, it no longer needs this information. It does use the trailer to do a check to make sure that the data is correct, but then it gets rid of that trailer as well.
Now it knows that it's been destined for this router, so then it takes a look at the IP address information. It takes a look at that IP information and looks it up on the router table, and then from the router table it will determine what the next hop is and what exit interface it needs to go out. When it does that, then it will reassemble that data link layer information with a new trailer. Depending on what the new technology is, that could look quite a bit different — so if this is a Point-to-Point Protocol, we know that that data link layer looks a lot different than what it does in an Ethernet.
So that is the data processing that happens on these routers, but what equipment on the router, where does this all take place? This is inside the router. First of all, the router has a backplane to it. The backplane, or the data plane, is kind of like the motherboard, really. Information comes in on this through some sort of interface, and then the data plane will figure out what it needs to do with it. A lot of times what that means is it needs to go up through the CPU and get processed by the CPU to figure out where it's going, and then gets put back on the data plane to be sent out some sort of egress interface. So it comes in on an ingress interface, gets processed by the data plane and sent to the CPU, and then gets sent out.
However, the data plane is capable of doing some processing. It is capable of doing some switching; it is capable of taking this packet and doing some processing with the packet. It's not as in-depth as the CPU can do — it's not a full processor — but it can do some jobs that the processor can do. The advantage to the data plane is that the data plane can speed up the process, whereas if it has to go to the CPU, that's going to slow down the process. So there are a couple of ways that this interplay can happen between what gets processed on the data plane and what gets processed on the CPU.
With process switching, pretty much it all happens on the CPU. The packet comes in, the data plane sends it to the CPU, the CPU references the routing table to see where it's supposed to go, tells the data plane where it's supposed to go, and that packet gets sent along its way.
There's a way to speed this up, and that is with fast switching. Fast switching is the method where it comes in on this data plane and it gets sent to the CPU, the CPU does look at the routing table and then tells the data plane where it's supposed to go, and it's sent along the way — but as it does this, it will actually cache that information. It's called the fast forward cache.
So now the data plane has the information it needs. As a second packet comes into the data plane, it does not need to send it to the CPU. It will first of all look at the fast forward cache; if it's not in the fast forward cache, then it'll have to send it to the CPU, but if the information is in the fast forward cache, then it can send it directly out, bypassing the CPU and speeding up this whole process. So that's fast switching: it uses a fast forward cache to be able to accelerate the speed of forwarding these packets.
A step faster is Cisco Express Forwarding. We still have a routing table, we still have a CPU for certain processes, but the data plane gets loaded with some information on it. It gets loaded with this FIB and adjacency plane — FIB is a forward information base — and with adjacency tables. So then, when the packet comes in, it actually never has to go through the CPU. This FIB and adjacency table is pre-populated, so that way it can bypass the CPU altogether and send the data along its way. This is the fastest method out of all of them.
We talked about how routers will process these packets, and we talked about three different methods that it can use to speed up the processing. The standard actually is just the process switching, but you can use fast switching or Cisco Express Forwarding to be able to accelerate how fast it processes these packets.
TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.
Explore free tools and programs →