- The modern and most preferred Cisco iOS
switching process that's in use on iOS equipment
is called Cisco Express Forwarding, or CEF.
Most of our modern iOS devices
use CEF as the default method.
CEF stores information in a route-cache
for optimized lookup and more efficient packet handling.
Some of the benefits of CEF include improved performance.
This is much less CPU-intensive than older methods,
meaning that more processing power
can be dedicated to other layer 3 services.
Things like encryption and quality of service.
Also, there's more scalability
through a mode called distributed CEF or dCEF.
When distributed CEF is enabled,
each line card maintains an identical copy
of the routing table and the line card is simply
the hardware module that provides the network interfaces.
Allowing the line card to handle forwarding themselves
relieves the load on the main processor.
CEF introduces two new mechanisms:
the CEF Forwarding Information Base, or FIB,
and the CEF Adjacency Table.
The Forwarding Information Base
is conceptually similar to a routing table
in that it maintains an identical copy
of the packet forwarding information
that would be found in the IP routing table.
Each time the routing table is updated with new information,
the FIB is also updated.
So very simply, the FIB contains lists
of all of the known next hop destinations.
By using the FIB, it's not necessary to involve
the processor for route lookup information.
The FIB is also a much more efficient lookup structure,
able to look up routes much more quickly
than using the routing table.
The Adjacency Table very simply
contains information about directly connected devices.
Any device that can be reached
with a single hop across a link layer
is considered to be an adjacency
and its layer 2 next hop address
would be maintained in the Adjacency Table.
Here, we're connected to a router.
And if I want to view the Forwarding Information Base
that's used by Cisco CEF, on this router
I can use the command "show ip cef."
I've got a fairly simple topology here
but there are some things I would like to point out.
We can see that listed is the next hop address,
as well as the associated outgoing interface
that's going to be used for that next hop address.
We also see that some of these networks are listed as
being attached, for example the 10.1.1.0/24 network
that's listed as attached.
This means that the 10.1.1.0 network, in this case,
is directly attached to the Gig 0/1 interface.
We see that it's listed as the outgoing interface.
Also note the next hop assignment, "receive."
Some of these are listed as "receive." For example,
198.51.100.1/32.
So this is a specific IP address
because we see a 32-bit mask
and this is an IP address on one of the router's interfaces,
specifically on Gig 0/2.
So traffic destined for the router itself,
at this IP address, is going to use this interface
and it's going to be identified with that "receive" label.
Let me break out of this command output
and if we want to see the Adjacency Table,
we can say "show adjacency"
and I'll say "detail" to do that.
Now, this is going to contain information about
how to reach a specific adjacency or a specific device
that's directly connected to the router
and here you can see some of those specific networks
that are reachable by going out of a particular interface.
We see the 198.51.100.2,
we see .6, and up here we see a 10.1.1.2
so we see all of those listed.
And underneath the interface listing,
we see those are on Gig 1, 2, and 3.
So these are all of our adjacencies
that are found on this specific device.
One more thing to mention when using CEF
is something called punting.
So if a packet can't be processed by CEF for some reason,
it is punted to the next-fastest switching method
and that preferred order in iOS
would first be distributed CEF, that we mentioned earlier,
then normal CEF, and then fast switching,
and finally process switching is the last resort.
Now, some of the things that might cause
a punt condition would include
maybe the CEF lookup process fails.
Maybe it can't find a valid entry
in the Forwarding Information Base.
Or maybe there's a particular layer 2
encapsulation that's not supported by CEF.
And also, very commonly you'll see
fragmented packets in a network.
Those are always going to be processed
by the router, so they'll be punted down to
the process switching mechanism.
And those are just to name a few instances
where we would see punting happen.
So that's an overview of Cisco Express Forwarding
and how CEF uses Forwarding Information Bases
and Adjacency Tables to more efficiently
control our traffic.