Introduction of IP CEF command and analysis of CEF technology

Source: Internet
Author: User
In order to enable CEF on the routing processor card, the IP CEF command is used in global configuration mode. To disable CEF, use the "no" format for this command.
IP CEF < distributed>
No IP CEF < distributed>

Syntactic description
Distributed (optional) enable the DCEF operation. Spread the CEF information to the line card. The line card performs a quick forwarding.


Default condition




Platform default values
The Cisco 7000 series equipped with RSP7000 does not have CEF enabled.
CEF is not enabled in the Cisco 7200 series.
Cisco 7500 Series enables CEF.
Cisco 12000 Series GSR enables DCEF.


Command mode
Global configuration mode.
Operating points
This command was first seen in the Cisco IOS 11.1CC version.
This command is not available in the Cisco 12000 Series GSR because the router family is only used in DCEF mode.
CEF is the Advanced layer 3rd (Layer 3) IP switching technology. CEF can optimize the performance and scalability of some networks. These networks have dynamic, structured data communication patterns, such as those associated with web-based applications and interactive operations.




The basic function of traditional routers is routing calculation and packet forwarding, usually based on shared memory architecture, mining and centralized CPU, that is, a single CPU (or multiple CPUs, connected to a router cluster) control the shared bus, connected to multiple interface cards, the interface card contains a simple queue structure, and CPU communication, Packet forwarding is implemented through a shared bus. With the rapid development of the Internet and the constant emergence of a large number of new service requirements, in order to improve the packet forwarding rate and the performance of the system, it is necessary to improve the design architecture of the traditional router and switching equipment, and add some new design schemes to improve the system performance. CEF (Cisco Express FORWARDING,CISCO Express Exchange) technology is a new routing switching scheme offered by Cisco, which has good exchange performance, enhanced switching architecture and high packet forwarding rate. The GSR1200 series Gigabit switching router with CEF technology has a qualitative change in architecture, Routing and interface card performance, especially suitable for the core layer of the ISP network with large traffic, and also widely used in the backbone of high-speed enterprise network. In this paper, the CEF Express Exchange technology is introduced and analyzed.
  
    


A simple review of router switching algorithm
  
1. Process Exchange
  
The original Cisco router uses centralized CPU packet switching, all packets pass through the shared bus to the CPU, lookup by the routing table, CRC, and then pass the packet to the appropriate circuit card via the shared bus.
  
2. Fast Exchange
  
IP packets that arrive at a particular destination address typically cause packet flow, which means that after swapping packets to a specific destination, the other is likely to arrive soon. By building the cache for the most recent swap target, you can reduce the number of times the packet finds the same target in the full routing table, the "one route, then the swap" approach called fast switching, which greatly improves the packet forwarding rate of routers and thus becomes the default exchange mechanism on the Cisco router platform. It is important to note, however, that the IP routing table changes must be cached to be invalid, and that the advantages of routing caching will be greatly limited in the context of changing routing conditions.
  
3. Autonomous Exchange
  
The characteristic of autonomous exchange is that some switching functions are unloaded from the CPU. In effect, the routing cache is moved from the CPU to the secondary Exchange processor, and the receiving packet on the line card first completes the lookup of the local route cache target in the swap processor and interrupts the CPU Execution routing table lookup if the lookup fails. In this case, Cisco renamed the CPU that periodically calculates the route as the routing processor and renamed the secondary Exchange processor the swap processor. Autonomous switching on the CISCO 7000-series Router allows for further performance improvements such as throughput.
  
4. Distributed Exchange
  
With the introduction of VIP (Versatile Interface Processor, Universal interface Processor) card, the switching system of routers is gradually developing to the equivalent multiprocessor structure. Each VIP card contains RISC processor, maintains the newest copy of Fast Exchange cache produced by the routing switch processor, and can realize the function of routing exchange independently, and completes two types of exchange at high speed--the exchange of local VIP and the exchange between VIP.
  
5.CEF Express Exchange
  
As mentioned earlier, fast-switching caching mechanisms do not scale well in high-speed dynamic routing environments such as the Internet (often with network topology changes, routing changes, routing shocks, and so on), and routing changes result in cache invalidation, and rebuilding caching (that is, performing process switching) Process) in the calculation of the cost is very large; at the same time, with the rapid development of Internet and its business, all kinds of applications and interactive services based on Web have increased the number of real-time data streams with many communication times and short communication time, the fast-switching cache content is changing, and the burden of rebuilding cache is increasing, This results in lower router performance. CEF Express Exchange Technology is aimed at the above deficiencies and design proposed.
  
The basic principle of CEF Express Exchange
  
1.CEF Parts
  
CEF is an advanced third-tier switching technology, designed primarily for high-performance, highly scalable, third-tier IP backbone Exchange. To optimize packet forwarding routing lookup mechanisms, CEF defines two main components: the forwarding information base (forwarding information base) and the Adjacency table (adjacency table).
  
A forwarding Information library (FIB) is a lookup table in which a router determines a target exchange, and there is a one by one correspondence between the FIB entry and the IP routing table entry, that is, FIB is a mirror image of the routing information contained in the IP routing table. Because FIB contains all the necessary routing information, you do not need to maintain the routing cache anymore. When the network topology or routing changes, the IP routing table is updated and the content of the fib changes.
  
The CEF uses the adjacency table to provide the information required for the MAC layer rewriting of the packet. Each item in the FIB points to a next jump relay segment in the adjacent table. If the neighboring nodes can be forwarded to each other through the data link layer, these nodes are listed in the adjacency table.
  
Once the system finds the adjacency relationship, it writes it to the adjacency table, and the adjacency sequence is generated at any time. Each time an adjacent entry is generated, a link layer header information is calculated beforehand for that adjacency node, and the link layer header information is stored in the adjacency table, and when the route is decided, it points to the next network segment and the corresponding adjacency entry. The packet is then encapsulated when it is CEF exchanged. To view information about the adjacency list, you can use the Cisco IOS command: Show adjacency/show adjacency detail. When we look at the adjacency table information, we find the following two main types of adjacency: Host adjacency and point to point. The Host adjacency type is usually displayed as an IP address that represents the next-hop IP address, and the point to point type is displayed as "Dot 2point", which means that it is a point-to-point circuit. In addition, there are some other special types, such as null adjacency, Glean adjacency, and so on, and no longer repeat.
  
2.CEF operation mode
  
There are two modes of CEF: centralized and distributed. The centralized system allows a routing module to run the Express Exchange, where the FIB and adjacency tables reside in the routing module, and the centralized CEF switching mode can be used when the line card is unavailable or does not have the function of dispersing CEF switching.
  
Distributed (generally recorded as DCEF) allows routers to run the Express switching function of multiple line cards (VIP), provided that the line is a VIP line card or a GSR line card. The central routing processor completes the functions of system Management/Routing and forwarding calculation, and distributes the CEF table to a single line card; each line card maintains the same copy of a fib and adjacency table. The line card performs a quick forwarding between the port adapters so that the swap operation does not require the participation of the routing switch module. DCEF uses an "internal process communication" mechanism to ensure the synchronization of FIB and adjacency tables between routing processors and interface cards.
  
Cisco 12000 Series Routers only run DCEF mode, which performs the swap function by the line card. In other routers, you can mix various types of interface cards in the same router, and if an interface card that does not support CEF receives a packet, the packet is forwarded to the routing processor for processing, or the packet is forwarded to the next network segment processing.
  
CEF is globally active on the router, enabling/disabling CEF;CEF and fast switching mode on each interface (or the VIP's Backplane) can also run simultaneously, but is not recommended because it consumes a large amount of system maintenance resources.
  
Comparison of CEF and fast Exchange
  
Similar to fast swapping, CEF uses its own data structure (rather than a routing table) to perform a swap operation. Fast switching to exchange packets by generating and locating the route cache. This route caches the packet, the cache entry (including destination IP address, output interface, MAC address header information, etc.) is the first packet arrival, the entire routing table to perform the longest matching lookup algorithm to obtain the next hop IP address, Then look for the ARP cache to obtain the second layer of MAC address information, and write to the route cache, after which the packet will be based on the cached entries have been generated directly rewrite the MAC header information to complete the swap operation.
  
CEF packets are exchanged through FIB and adjacency tables, however, the FIB and adjacency tables are generated and timed to be updated by the CPU according to the routing table before the arrival of the packet, so the first packet to the router is not required to perform the process of finding the routing table, and the new Mac letterhead and Lou are obtained directly from the FIB and adjacency tables, Can be exchanged, and for routers with large-capacity routing tables, the way in which the interchange lookup entries are established can effectively improve exchange performance.
  
Implementation of load balancing based on CEF
  
When there are multiple paths to the IP address of a destination, each path has a metric value that reflects its cost, and the routing protocol obtains the shortest metric value of the path to the destination at which the packet arrives at the destination. The purpose of load balancing is to allocate traffic to multiple paths, which optimizes the use of resources. The CEF Express Exchange supports two types of load balancing--the load balance configured by destination and load balancing by packet configuration.
  
1. Configure load Balancing at destination
  
The basic principle is: for a given pair of source/destination IP underground, even if more than one path is available, the packet can be guaranteed to take the same path, the data flow to the different source/destination IP address is inclined to take a different path. By using a destination load-balancing approach, you can ensure that packets to a source/destination IP address pair arrive in a certain order. When CEF is enabled, the load balancing configured by destination is enabled by default.
  
2. Configure load Balancing by packet
  
The basic principle is: using the Rotary method to determine which path each packet to reach the destination. This load balancing method enables routers to send packets continuously on a path, that is, to ensure that the path is in good condition, but packets for a source/destination IP address pair may take a different path, causing the destination to reorder the packets. This type of load balancing is not appropriate for some types of data streaming (such as VoIP data streams). Of course, if there is a large amount of data flow between a source/destination IP address pair, with parallel link routing, if load-balancing at destination will overload a link, while other links have little data flow, it is reasonable to load-balance by packet.
  
V. Summary
  
CEF is a high-speed switching mode designed specifically for high-performance, highly scalable IP backbone networks. From the above we can see that in large-scale dynamic IP networks, CEF is able to provide unprecedented exchange consistency and stability. It can effectively compensate for the frequent failure of fast-swapping cache entry, and the DCEF distributed Exchange can make each circuit card exchange completely and provide more superior performance; CEF is less memory-intensive than fast-switched route cache, and can provide load balancing, network accounting and other functions. With the help of CEF Express Exchange technology and some other revolutionary innovation technology, Cisco's GSR router has made great success in the world, which plays a very important role in the construction of Internet infrastructure in China.


-------------------------------------------------------------------


Real MPLS is also based on CEF,


The basic MPLS's role is that MPLS can improve data transfer speed while increasing network throughput because MPLS uses tags to transfer data to select path speeds faster than using the longest matching IP route.


Setting basic MPLS is fairly straightforward and requires only a few of the following commands




1. Start CEF or IP distribute in router CEF


Router (config) # IP CEF distributed or using the IP CEF command




2. Start tag distribution in Rotuer


Router (config) # tag-switching advertise-tags




3. Use MPLS on the interface (use this command for interfaces connecting between backbone LSR)


Router (config) # interface E0/1
Router (config-if) # tag-switching IP


4, specify the use of that label protocol, the standard protocol is LDP,TDP is Cisco private


Router (config) # MPLS lable Protocol LDP

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.