Cisco fast forward (CEF) Application

Source: Internet
Author: User

Cisco Express Forwarding (CEF) is an advanced layer-3 IP address exchange technology. What are the advantages of CEF? This blog will detail how to better use CEF.

CEF can be used anywhere in the network, especially in the exchange of enterprise backbone networks. In addition, the CEF can optimize the performance and scalability of a network with large-scale and dynamic data streams such as the Internet. In the network core, the CEF on the backbone router provides high performance and scalability to deal with the increasing and steady growth of network traffic. CEF is a distributed switching mechanism that linearly changes with the number of interfaces and the bandwidth in the routers.

I. Advantages of CEF

CEF can optimize network performance and scalability through large-scale dynamic communication. Its advantages are as follows.

1. Improve vro Efficiency

Compared with conventional fast exchange routes, CEF can use a small amount of memory capacity to forward data packets, which can save more CPU resources, this allows the processor to be dedicated to layer-3 services, such as improving service quality (QoS) and encryption.

2. excellent scalability

When the distributed CEF mode is enabled, each CEF Line Card maintains the same copy as the Forwarding Information Base (FIB) and the adjacent table, it provides complete exchange capabilities independently.

3. Improve Network Performance

In a large-scale dynamic network, CEF can provide better consistency and stability of exchange. In a dynamic network, a change in the route will result in frequent failure of fast exchange of cache entries. The possible result of these changes is that the data needs to be exchanged through the route table, instead of using the route-based high-speed cache for fast exchange. Because the FIB query table contains the known routes in all routing tables, you do not need to maintain the high-speed routing cache, or use the fast switching and process switching scheme. CEF can exchange data streams more effectively than typical high-speed cache technologies.

---- Although CEF is an advanced IP exchange technology that supports many communication media, it does not support all communication methods, currently, CEF supports ATM/AAL5snap, ATM/AAL5mux, ATM/AAL5nlpid, frame relay, Ethernet, FDDI, PPP, HDLC, and tunnel.

Ii. components used for CEF operation

To implement the CEF switching function, CEF forwards the information stored in the routing high-speed cache in the conventional router to several data structures specially designed for CEF. To effectively forward data packets, this data structure must be able to optimize queries. The two main components of CEF are as follows.

1. forwarding information library

CEF uses the forwarding information library (FIB) for IP address-based destination prefix exchange decisions. In terms of concept, FIB is similar to a route table or information database. It maintains an image of the forwarding information contained in an IP route table. When the route or topology in the network changes, the IP route table is updated, and these changes are also reflected in FIB. FIB maintains the address information of the next network segment based on the information in the IP route table.

Because there is a one-to-one relationship between FIB entries and route table entries, FIB contains all known routes, so there is no need to maintain the route cache, the previous switching paths (such as fast switching and optimal switching) must maintain the high-speed routing cache.

2. Adjacency Table)

If the network nodes in the network can pass through the link layer and reach each other through only one network segment, they are adjacent. In addition to FIB, CEF uses the adjacent table to provide addressing information for the second layer. The adjacent table maintains the next CIDR block for all FIB entries. When a vro discovers an adjacent link, it is added to the adjacent table. Each time an adjacent entry is generated, CEF will pre-calculate a link layer header for the adjacent node, the header information is stored in the adjacent table. When a route is determined, it will point to the next network segment and the corresponding adjacent entries, and then it will be used for encapsulation when the packet is switched to CEF.

Iii. CEF Operation Mode

There are two operation modes for CEF: centralized CEF mode and distributed CEF mode. You can enable CEF in any of these modes. You can only use one mode at a time, but not all Cisco routers support the two modes, you must check the product information used to determine whether it supports the centralized or distributed CEF mode. For example, the distributed CEF mode is not supported on Cisco 7200 series routers.

1. Centralized CEF Mode

When the centralized CEF mode is enabled, the FIB and the adjacent table of the CEF reside in the routing processor, and the routing processor performs fast forwarding, as shown in figure 1. For CEF switching, the CEF mode can be used when the line card is unavailable or when the required functions are incompatible with the distributed CEF switching.

2. Scattered CEF Mode

When distributed CEF (dCEF) is enabled, the line card (such as the VIP line card or GSR Line Card) maintains the same copy as the FIB and the adjacent table. The line is stuck between the port adapters for fast forwarding, so that the exchange operation does not require the participation of RSP. DCEF uses an Inter Process Communication (IPC) mechanism to ensure the synchronization of FIB and the adjacent table on the Route Processor and line card, as shown in figure 2.

Iv. Application of CEF

CEF improves the performance of a Cisco router and optimizes route switching, but its usage is not complex. You only need to configure to enable or disable CEF/dCEF to achieve fast Cisco forwarding. Of course, to better use the CEF, You need to configure it further, such as the Server Load balancer function. For other common CEF commands, see the appendix.

1. enable or disable CEF

If your Cisco router has an interface processor that supports CEF, you can enable CEF. To enable or disable CEF, use the following command in global configuration mode.

(1) Enable standard CEF Mode

The command is as follows:

Ip cef

(2) Standard CEF mode prohibited

The command is as follows:

No ip cef

2. enable or disable dCEF

DCEF is enabled when you want your line card to perform fast forwarding, so that the routing processor can process the routing protocol. To enable or disable dCEF operations, use the following command in global configuration mode.

(1) Enable dCEF Mode

The command is as follows:

Ip cef distributed

(2) Disable dCEF Mode

The command is as follows:

No ip cef distributed

When you enable CEF or dCEF in global mode, all interfaces that support CEF are enabled by default.

3. enable or disable CEF/dCEF on a specific interface

Sometimes, a function is configured on an interface, and CEF or dCEF does not support this function. In this case, you may need to disable CEF or dCEF on this specific interface. For example, Policy Routing and CEF cannot be used together. You may want an interface to support policy routing, while other interfaces to support CEF. In this case, you can enable CEF in global mode, and disable CEF on the Interface on which the policy route is to be configured. In this way, quick Forwarding is enabled on all interfaces except that. To disable CEF or dCEF on an interface, you can use the following command in Interface Configuration Mode:

No ip route-cache cef

When CEF or dCEF is disabled, Cisco IOS automatically uses the next fastest switching path to exchange data packets. For dCEF, the next fastest switching path is the CEF on the Route Processor. If you disable the CEF or dCEF operation on an interface and want to enable it again, you can use the following command in Interface Configuration Mode:

Ip route_cache cef

---- DCEF is enabled by default on Cisco 12000 series routers. There is no command to enable dCEF. In addition, dCEF is enabled on the vro, and do not disable dCEF on the Cisco 12000 series router interfaces.

4. Configure the load balancing function for the CEF

Server Load balancer depends on the combination of source and destination data packets. To transfer data to a destination, Cisco can allocate data to multiple paths to optimize resource usage. You can configure Server Load balancer in units of destination or data packets. The server Load balancer decision-making mechanism should be made on the Data departure interface, which is divided into the following two methods.

(1) configure Server Load balancer by destination

After the Server Load balancer function is configured by destination, the vro uses multiple routes to balance the load. For a source/destination host, data packet forwarding uses the same path, even if multiple paths are available, in this way, different paths can be used for data packets arriving at different destinations. When CEF is enabled, the Server Load balancer configuration by destination is enabled by default. In most cases, this load balancing method is used. When configuring Server Load balancer by destination, it depends on the statistical distribution information of the data stream. Therefore, the load balancing becomes more effective as the number of source/destination pairs increases. You can use a Server Load balancer (SLB) method to ensure that data packets are sent to a specified source/destination host in a certain order.

After CEF is enabled, Server Load balancer by destination is enabled by default. To use Server Load balancer by destination, you do not need to perform any other operations.

To disable Server Load balancer by destination, use the following command in Interface Configuration Mode:

No ip load-sharing per-destination

(2) configure Server Load balancer by data packets

Load Balancing by data packets allows the router to send data packets continuously in the path without considering the specific host or user situation. This load balancing mechanism uses a rotation method to determine which path each data packet uses to reach the destination. This mechanism ensures load balancing on multiple connections, and helps ensure that the path of any single source/destination pair will not become overloaded. If a large amount of data through parallel links is targeted at a single source/destination host pair, load balancing by destination will overload the link, however, there are few data streams on other links. When load balancing is enabled by data packets, you can use different paths to reach the same busy destination.

Load Balancing by data packets makes the path usage reasonable. However, the direct consequence of this mechanism is that data packets of a given source/destination host pair may arrive in different paths, so that data packets must be reordered at the destination end, for this reason, this type of Server Load balancer may not be suitable for some types of data streams. For example, IP address-based voice transmission requires that data packets arrive at the destination in sequence.

To enable Load Balancing by data packets, use the following command in Interface Configuration Mode:

Ip load-sharing (per-packet)

Of course, to enable Load Balancing by data packets for a specific destination, you must enable Load Balancing by data packets on all interfaces that can forward data packets to this destination.

5. Configure the network accounting function for CEF

You may need to collect statistics to better understand and use the CEF mode feature in the network. For example, you may want to collect such information: the number of data packets and the number of segments exchanged to a destination, or the number of data packets exchanged by a destination. To collect network accounting information for CEF, you can use the following command in global configuration mode.

(1) start to collect the number of data packets and number of nodes that are quickly forwarded to a destination.

The command is as follows:

Ip cef accounting per-prefix

(2) start to collect the number of packets forwarded quickly through a specific destination

The command is as follows:

Ip cef accounting non-recursive

After you enable the network accounting function for the CEF, collect accounting information in the corresponding Route Processor. When you enable the network accounting function for dCEF, it collects information on the online road card.

You can view collected accounting information. In EXEC mode, run the following command:

Show ip cef

The accounting information details the situation of data packets forwarded by the router, so that you can understand the load of the router and decide how to optimize the configuration of the router to maximize the performance of the router.

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.