In: Categories » Computers and technology » Networks » Cisco Express Forwarding
Cisco Express Forwarding (CEF) is a packet forwarding or switching method that Cisco IOS uses. It is the latest IP switching method developed in Cisco IOS, and it is the default packet forwarding method being used now. CEF is needed in Multiprotocol Label Switching networks, which is why this article devotes an article to it. This article explains the basics of CEF so that you can understand its role in Multiprotocol Label Switching networks.
Overview of Cisco IOS Switching Methods
The basic function of a router is to move packets through the network. For a router to forward packets, it needs to look up the destination address of the packet in a table and decide which route to use to switch or forward the packet. Each protocol that the router can forward packets for must have a separate forwarding table. Such protocols might include DECnet, Internetwork Packet Exchange (IPX), AppleTalk, IP, and Multiprotocol Label Switching. Packets can be forwarded through the router in three basic ways: process switching, interrupt switching, or through an application-specific integrated circuit (ASIC). In process switching, a special Cisco IOS process that is scheduled to run when the router receives packets is what performs the switching of packets. A Cisco IOS process does not perform the switching of packets in Interrupt mode. Rather, when packets arrive to the router, the interface processor interrupts the central CPU and asks it to switch the packet according to a route cache or switching table. That cache or table can be built in several ways. Fast switching and CEF switching build such a cache or table. Finally, the router can program the switching table into an ASIC so that the packets can be switched in hardware. Several Cisco platforms can program the CEF table into ASICs.
Process Switching
Process switching is the slowest of all switching methods. When switching a packet through the router, a Cisco IOS process copies the packet to the CPU memory and looks up the destination IP address in the IP routing table. Based on the outcome of this lookup, the process switches out the packet on a particular interface after it does some housekeeping on the IP header. This housekeeping includes the lowering of the Time To Live (TTL) field and the recalculation of the cyclic redundancy check (CRC) of the IP header. The central CPU of the router always looks at the packet; no other intelligent hardware decides how the packet is forwarded. The opposite to process switching is the switching of packets in Interrupt mode, in which the central CPU might be involved, but the switching decision is performed within the interrupt context, not by a dedicated Cisco IOS process.
Fast Switching
Fast switching is a switching method that builds an on-demand forwarding table. The first packet for a destination that arrives is process switched. The switching of the first packet by the central CPU gives the CPU the opportunity to build a cache. This cache is called the IP fast switching route cache and is used by the interrupt code to switch subsequent packets for the same destination. This cache is not permanent. Some timers govern the fast switching route cache, and from time to time, some entries are deleted, freeing memory. As long as packets are switched for certain destinations, these destinations remain in the route cache. However, if for some time, no more packets for a certain destination are switched, the entry for that destination in the route cache is deleted. With fast switching, a change in the routing table has an intrusive effect: If a prefix changes in the routing table, the entry in the fast switching cache is invalidated, and the first packet for a destination has to be process-switched again to build the new entry in the route cache. Each IP prefix entry in the route cache has an outgoing interface, next hop, and Layer 2 rewrite field. This Layer 2 rewrite (or MAC rewrite) is the information that the router needs to change in the Layer 2 frame header when the frame is rebuilt so that it can be sent on the outgoing interface. The command to enable fast switching on the interface is ip route-cache. CEF Switching
A compelling reason for a new and better switching method was that the fast switching cache was only built on demand. Therefore, to fast-switch packets, the first packet to a destination had to be process-switched, which is inherently time consuming, especially on routers that have a huge number of potential destinations, such as routers with the Internet routing table. To avoid this, a pre-built switching table was needed. Out of the need of such a pre-built switching table, CEF was born. In short, the switching table is no longer built on demand, but it is built in advance. As such, each prefix in the routing table has an entry in the CEF switching table at the same time. Only when the routing table changes does the CEF switching table change. However, in some cases, the other switching methods might still be needed. One example of this is packets that have IP options. If an IP packet has IP options trailing the IP header, the packet is process–switched. That is because the treatment of IP options is not straightforward and cannot be done easily in Interrupt mode or in hardware and is thus handled by the central CPU.
Why Is CEF Needed in Multiprotocol Label Switching Networks?
Concerning Multiprotocol Label Switching, CEF is special for a certain reason; otherwise, this article would not explicitly cover it. Labeled packets that enter the router are switched according to the label forwarding information base (LFIB) on the router. IP packets that enter the router are switched according to the CEF table on the router. Regardless of whether the packet is switched according to the LFIB. The Adjacency Table
The adjacency table is the CEF component that is responsible for the MAC or Layer 2 rewrite. When routers and hosts are adjacent, they learn about each other by some means. They can discover each other dynamically or by means of configuration. If routers are adjacent across a point-to-point connection, they discover each other trivially. However, on a multiaccess medium such as Ethernet, it is necessary for the routers to use a dynamic mechanism to discover each other. This mechanism is ARP, which maps Layer 2 (for example, Ethernet MAC) addresses to IP addresses. Because routers usually run routing protocols among each other, the ARP table is built with the MAC addresses of the connecting routers on the Ethernet interfaces. If the interface is Frame Relay or Asynchronous Transfer Mode, it can be point-to-point or multipoint. In the first case, only one adjacency exists per interface; in the second case, multiple adjacencies can exist per interface. The adjacency table holds one adjacency or Layer 2 rewrite structure per router that is connected to that multipoint interface.
This adjacency can be built from information learned from Address Resolution Protocol (ARP), Asynchronous Transfer Mode, or Frame Relay map statements, and inverse ARP on Asynchronous Transfer Mode or Frame Relay. Although the FIB decides where to forward the packet, the Layer 2 rewrite of the frame is done with the information found in the adjacency table. The Layer 2 rewrite string contains the new Layer 2 header that is used on the forwarded frame. For Ethernet, this is the new destination and source MAC address and the Ethertype (the protocol number for the Layer 3 payload). For PPP, the Layer 2 header is the complete PPP header, including the Layer 3 protocol ID.
Distributed CEF (DCEF)
One of the main advantages of CEF is that it can be used in a distributed manner. Some Cisco routers use a central CPU without any form of decentralized or distributed intelligence. An example of such a router is the 7200 series router. CEF in this platform can only use the central CPU and as such can forward traffic by the CPU or in interrupt mode. Other hardware—such as the 7500 or GSR 12000 series router—has distributed intelligence and CPUs. Therefore, the router can distribute the burden of forwarding traffic through CEF by using the distributed CPUs to forward traffic without interrupting the central CPU. To achieve the distributed forwarding, both the CEF and adjacency table have to be distributed to these distributed CPUs. For the 7500 series router, the distributed intelligence is present on a Versatile Interface Processor (VIP), and for the GSR 12000 series router, the distributed intelligence is present on the line cards. CEF Switching Packets in Hardware
To achieve high rate packet forwarding, the router can use ASICs on the boards or line cards. These ASICs are specially built chips that can forward packets at the highest rate. To have the ASICs forward the packets per the routing table, the router distills the CEF table into the ASIC so that it is correctly programmed to forward the packets. Example 6-5 shows the Packet Switching ASIC. The router can also distribute the LFIB and load it into ASICs. The command to see the LFIB in the ASIC is show tag-switching hardware-tag.
legal notice
Our website is not responsible for the information contained by this article. Web-articles is a free articles resource.
Suggestion: If you need fresh, daily updated content for your website, feel free to use our service. Click here for more information.
Useful tools and features
related articles
For every IGP IP prefix in its IP routing table, each Label Switch Router creates a local binding that is, it binds a label to the IPv4 prefix. The Label Switch Router then distributes this binding to all its Label Distribution Protocol neighbors. These received bindings become remote bindings. The neighbors then store these remote and local bindings in a special table, the label information base (LIB). Each Label Switch Router has only one local binding per prefix, at least when the label space is per platform. If the l...
2. Label Switched Path
A label switched path (LSR) is a sequence of Label Switch Routers that switch a labeled packet through an Multiprotocol Label Switching network or part of an Multiprotocol Label Switching network. Basically, the Label Switch Routers is the path through the Multiprotocol Label Switching network or a part of it that packets take. The first Label Switch Router of an Label Switch Routers is the ingress Label Switch Router for that Label Switch Routers, whereas the last Label Switch Router of the Label Switch Routers is the egress...
3. Label Switch Routers Control Modes
Label Switch Routers can create a local binding for a Forwarding Equivalence Class in two ways: Independent Label Switch Routers Control mode Ordered Label Switch Routers Control mode The Label Switch Router can create a local binding for a Forwarding Equivalence Class independently from the other Label Switch Routers. This is called Independent Label Switch Routers Control mode. In this control mode, each Label Switch Router creates a local binding for a particular Forward...
4. How Multiprotocol Label Switching Works
When the Multiprotocol Label Switching Label Distribution Protocol-IGP synchronization is active for an interface, the IGP announces that link with maximum metric until the synchronization is achieved, or until the Label Distribution Protocol session is running across that interface. The maximum link metric for OSPF is 65536 (hex 0xFFFF). No path through the interface where Label Distribution Protocol is down is used unless it is the only path. (No other paths have a better metric.) After the Label Distribution Protocol ...
5. Multiprotocol Label Switching and Asynchronous Transfer Mode Architecture
Asynchronous Transfer Mode is a connection-oriented protocol that the ITU-T developed. It is connection-oriented because virtual circuits are signaled that carry the Asynchronous Transfer Mode traffic. The Asynchronous Transfer Mode traffic consists of fixedsized cells of 53 bytes. Of those 53 bytes, 5 are the cell header and 48 are the cell data. The success of Asynchronous Transfer Mode was predominantly in the WAN network. Many vendors built Asynchronous Transfer Mode switches that could set up virtual circuits in the ...
6. Label Advertisement
The IGP and Label Distribution Protocol on the Asynchronous Transfer Mode Label Switch Routers cannot run directly over the Asynchronous Transfer Mode interface and establish a neighborship. A control VC is needed for the IGP and Label Distribution Protocol to run on between two adjacent Asynchronous Transfer Mode Label Switch Routers. When the IGP adjacency is built, the IGP can exchange IP prefixes which are put in the routing table. After Label Distribution Protocol forms a session across the control VC, it can exchange ...
7. Load Balancing in CEF
CEF allows for load balancing or load sharing of traffic among multiple outgoing links. CEF needs multiple outgoing links as next hops in the routing table to perform load balancing. The command maximum-paths specifies how many paths or next hops are allowed per prefix in the routing table for the specific routing protocol. For instance, if you configure maximum-path 2 under the routing protocol Open Shortest Path First (OSPF), only two OSPF paths per prefix are allowed in the routing...
8. Multiprotocol Label Switching Virtual Private Network
Multiprotocol Label Switching Virtual Private Network, or Multiprotocol Label Switching Virtual Private Networks, is the most popular and widespread implementation of Multiprotocol Label Switching technology. Its popularity has grown exponentially since it was invented, and it is still growing steadily. Although most service providers have implemented it as a replacement for the Frame Relay and Asynchronous Transfer Mode services that were popular before it, Multiprotocol Label Switching Virtual Private Network is now see...
9. Virtual Private LAN Service
Virtual Private LAN Service (VPLS) emulates a LAN segment across the Multiprotocol Label Switching backbone across pseudowires or virtual circuits. VPLS creates one or more LANs for each customer who is using the service from the service provider. Each LAN, of course, is completely separate from the other emulated LAN segments—hence the “P” for “Private” in VPLS. When the customer with different Ethernet sites connects to an Multiprotocol Label Switching backbone where VPLS is deployed, it a...
