Cisco Express Forwarding or CEF is advanced, Layer 3 IP switching technology. CEF optimizes network performance and scalability for networks with large and dynamic traffic patterns, such as the Internet, on networks characterized by intensive Web-based applications, or interactive sessions. CEF plays a critical role in implementations such as MPLS and others. It’s ability to reduce CPU load by fast switch between VLANS greatly improves overall performance.
Evolution
- Process Switching
- Fast Switching
- Cisco Express Forwarding
MLS
Multilayer Switching or MLS is the process by which a Switch can forward or operate beyond simply Layer 2. The term Layer 3 switching refers to the use of the Layer 3 routing or destination address. Layer 3 address can be configured on a Layer 3 capable Switch in one of two ways. On the VLAN or the Port itself. Cisco often refers to a VLAN with a Layer 3 address as a Switched Virtual Interface or SVI.
Layer 3 Switching Interfaces
- Layer 3 VLAN’s or SVI’s
- Layer 3 Routed Port’s
Key Terms
- The Forwarding Information Base or FIB Table
- The Adjacency Table
- CEF builds the FIB or Forwarding Information Base
- In the case of MPLS CEF builds the LFIB or Label Forwarding Information Base
- Punting to the CPU
Whenever I hear the term Layer 3 switching one of the first things that comes to mind is CEF. The concept behind Layer 3 switching can be major point of confusion for many that have never configured it or simply don’t understand how it works.This may be due in part to a lack of understanding with regards to what has to occur in order to forward Layer 2 frame or Layer 3 packet between VLAN’s. There are always valid and necessary reasons for tagging Layer 2 frames and trunking them up to the Router, but there are just as many reason not to.
Fast Switching
- The CPU is involved in the overall process
- The route is looked up via the routing table
- The data-link to from the packet for the interface is retrieved via ARP cache
- The retrieved route and data-link information is entered into the Fast cache
- A packet to the same destination is checked via the Fast cache first
CEF Switching
In the case of Layer 3 Switching there is no need for dynamic routing protocols such as RIP, EIGRP, OSPF, or BGP.
The Forwarding Information Base or FIB
CEF uses the FIB to make IP destination prefix-based switching decisions. The FIB is similar to the routing table. It maintains a mirror image of the forwarding information contained in the layer 3 routing table. When routing or topology changes occur in the network, the IP routing table is updated, and those changes are reflected in the FIB.
Events that would trigger an update to the FIB
- The addition of a new route in the Routing Table
- The removal of a route from the Routing Table
- The addition of a static route in the Routing Table
The Adjacency Table
Hosts 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 prepend Layer 2 addressing information. The adjacency table maintains Layer 2 next-hop addresses for all FIB entries.
Punting
The term punt or punting is used to describe the action by which CEF sends a packet “down” or “up” to the next fast switching level. For example: If a Layer 3 address can not be determined via the Forwarding Information Base or FIB CEF will punt the process up to the Layer 3 routing engine which in turn will have to be re-cursed to the interfaces which is a much slower process.
Enabling Cisco Express Forwarding on a Switch is quite simple in most cases.
SW1#configure terminal
SW1(config)#ip cef
SW1(config)#ip routing
SW1(config)#exit
SW1#
Lets take a look at a host route from VLAN 21 with an IP address of 172.17.71.200.
SW1#show ip cef adjacency vlan 21 172.17.71.200
172.17.71.200/32
attached to Vlan21
SW1#
SW1#show ip cef adjacency vlan 21 172.17.71.200
172.17.71.200/32
attached to Vlan21
SW1#
SW1#show ip cef vlan 21
172.17.71.0/24
attached to Vlan21
172.17.71.2/32
attached to Vlan21
172.17.71.10/32
attached to Vlan21
172.17.71.25/32
attached to Vlan21
172.17.71.50/32
attached to Vlan21
172.17.71.52/32
attached to Vlan21
172.17.71.56/32
attached to Vlan21
172.17.71.58/32
attached to Vlan21
172.17.71.59/32
SW1#
Lets take a look at prefixes that have been punted to the Layer 3 Routing Engine.
SW1#show ip cef adjacency punt detail
IPv4 CEF is enabled for distributed and running
VRF Default:
516 prefixes (516/0 fwd/non-fwd)
Default network 0.0.0.0/0
Table id 0
Database epoch: 5 (516 entries at this epoch)
SW1#