Cisco IOS Switching Services Configuration�Guide, Release�12.2
Configuring Cisco Express Forwarding
Downloads: This chapterpdf (PDF - 229.0KB) | Feedback

Configuring Cisco Express Forwarding

Table Of Contents

Configuring Cisco Express Forwarding

Configuring CEF

Enabling CEF or dCEF

Configuring Load Balancing for CEF

Configuring per-Destination Load Balancing

Configuring per-Packet Load Balancing

Selecting a Load Balancing Algorithm

Configuring Network Accounting for CEF

Enabling Network Accounting for CEF

Enabling a Backbone Router to Collect Traffic Matrix Statistics (TMS) Data

Using the NDA for TMS Data Collection

Verifying Network Accounting Information

Configuring Distributed Tunnel Switching for CEF

Configuring the Network Services Engine

Configuring the PXF Processor

Verifying the PXF Processor

Troubleshooting the PXF Processor

Monitoring the PXF Processor

Configuring Virtual Profile Switching for CEF

Verifying Virtual Profile Interfaces

Verifying CEF

Troubleshooting Tips

Enabling CEF Consistency Checkers

Displaying CEF Table Inconsistencies

Clearing CEF Table Inconsistencies

IP CEF Nonrecursive Accounting Example


Configuring Cisco Express Forwarding


This chapter describes the required and optional tasks for configuring Cisco Express Forwarding (CEF) and distributed CEF (dCEF).

For a complete description of the commands in this chapter, refer to the the Cisco IOS Switching Services Command Reference. To locate documentation of other commands that appear in this chapter, use the command reference master index or search online.

To identify the hardware platform or software image information associated with a feature, use the Feature Navigator on Cisco.com to search for information about the feature or refer to the software release notes for a specific release. For more information, see the section "Identifying Supported Platforms" in the chapter "Using Cisco IOS Software."

Configuring CEF

To configure CEF, perform the tasks described in the following sections. The task in the first section is required; the tasks in the remaining sections are optional.

Enabling CEF or dCEF (Required)

Configuring Load Balancing for CEF (Optional)

Configuring Network Accounting for CEF (Optional)

Configuring Distributed Tunnel Switching for CEF (Optional)

Configuring the Network Services Engine (Optional)

Configuring Virtual Profile Switching for CEF (Optional)

Verifying CEF (Optional)

Troubleshooting Tips (Optional)

For an example configuration of IP CEF non-recursive accounting, refer to the "IP CEF Nonrecursive Accounting Example" section.

Enabling CEF or dCEF

Enable CEF when your router has interface processors that do not support dCEF.

To enable CEF, use the following command in global configuration mode:

Command
Purpose

Router(config)# ip cef

Enables standard CEF operation.


Enable dCEF when you want your line cards to perform express forwarding so that the route processor (RP) can handle routing protocols or switch packets from legacy interface processors.


Note On the Cisco 12000 series Internet router, dCEF is enabled by default. The command to enable dCEF is not available. Also, the configuration file does not indicate that dCEF is enabled on the router.


To enable or disable dCEF operation, use one of the following commands in global configuration mode as needed:

Command
Purpose

Router(config)# ip cef distributed

Enables dCEF operation.

Router(config)# no ip cef distributed

Disables dCEF operation.


When you enable CEF or dCEF globally, all interfaces that support CEF are enabled by default. If you want to turn off CEF or dCEF on a particular interface, you can do so.

To disable CEF or dCEF on an interface, use the following command in interface configuration mode:

Command
Purpose

Router(config-if)# no ip route-cache cef

Disables CEF operation on the interface.


When you disable CEF or dCEF, Cisco IOS software switches packets received on the interface using the next fastest switching path. In the case of dCEF, the next fastest switching path is CEF on the RP.

If you have disabled CEF or dCEF operation on an interface and want to reenable it, you can do so by using the ip route-cache cef command in interface configuration mode.


Note On the Cisco 12000 series, you must not disable dCEF on an interface.


Configuring Load Balancing for CEF

CEF load balancing is based on a combination of source and destination packet information; it allows you to optimize resources by distributing traffic over multiple paths for transferring data to a destination.

You can configure load balancing on a per-destination or per-packet basis. Load balancing decisions are made on the outbound interface and so load balancing must be configured on the outbound interface.

Load distortions may occur across multiple routers when the same load balancing algorithm is used on every router. You can resolve these distortions by selecting a specific load balancing algorithm based on your network environment.

To configure and fine-tune load balancing for CEF, perform the optional tasks described in the following sections:

Configuring per-Destination Load Balancing (Optional)

Configuring per-Packet Load Balancing (Optional)

Selecting a Load Balancing Algorithm (Optional)

Configuring per-Destination Load Balancing

Per-destination load balancing is enabled by default when you enable CEF. To use per-destination load balancing, you do not perform any additional tasks once you enable CEF.

Per-destination load balancing allows the router to use multiple paths to achieve load sharing. Packets for a given source-destination host pair are guaranteed to take the same path, even if multiple paths are available. Traffic destined for different pairs tend to take different paths. Per-destination load balancing is enabled by default when you enable CEF, and is the load balancing method of choice for most situations.

Because per-destination load balancing depends on the statistical distribution of traffic, load sharing becomes more effective as the number of source-destination pairs increase.

You can use per-destination load balancing to ensure that packets for a given host pair arrive in order. All packets for a certain host pair are routed over the same link (or links).

Disabling per-Destination Load Balancing

Typically, you would disable per-destination load balancing when you want to enable per-packet load balancing.

To disable per-destination load balancing, use the following command in interface configuration mode:

Command
Purpose

Router(config-if)# no ip load-sharing per-destination

Disables per-destination load balancing.


Configuring per-Packet Load Balancing

Per-packet load balancing allows the router to send successive data packets over paths without regard to individual hosts or user sessions. It uses the round-robin method to determine which path each packet takes to the destination. Per-packet load balancing ensures balancing over multiple links.


Note Per-packet load balancing via CEF is not supported on Engine 2 Gigabit Switch Router (GSR) line cards (LCs).


Path utilization with per-packet load balancing is good for single path destinations, but packets for a given source-destination host pair might take different paths. Per-packet load balancing could introduce reordering of packets. This type of load balancing would be inappropriate for certain types of data traffic (such as voice traffic over IP) that depend on packets arriving at the destination in sequence.

Use per-packet load balancing to help ensure that a path for a single source-destination host pair does not get overloaded. If the bulk of the data passing through parallel links is for a single pair, per-destination load balancing will overload a single link while other links have very little traffic. Enabling per-packet load balancing allows you to use alternate paths to the same busy destination.

To enable per-packet load balancing, use the following command in interface configuration mode:

Command
Purpose

Router(config-if)# ip load-sharing per-packet

Enables per-packet load balancing.



Note If you want to enable per-packet load balancing to a particular destination, all interfaces that can forward traffic to the destination must be enabled for per-packet load balancing.


Selecting a Load Balancing Algorithm

The router is set to perform universal load sharing by default. In universal load sharing, each router on the network can make a different load sharing decision for each source and destination address pair; thereby, resolving load sharing distortions. For example, the tunnel algorithm is designed to balance the per-packet load when only a few source and destination pairs are involved.

To select a load balancing algorithm, use one of the following commands in global configuration mode:

Command
Purpose

Router(config)# ip cef load-sharing algorithm original

Sets the load sharing algorithm to the original based on a source and destination hash.

Router(config)# ip cef load-sharing algorithm tunnel id

Sets the load sharing algorithm for use in tunnel environments or in environments where there are only a few IP source and destination address pairs.

Router(config)# ip cef load-sharing algorithm universal id

Sets the load sharing algorithm to the universal algorithm that uses a source and destination, and ID hash.


Configuring Network Accounting for CEF

You might want to collect statistics to better understand CEF patterns in your network. For example, you might want to collect information such as the number of packets and bytes switched to a destination or the number of packets switched through a destination.

To configure network accounting for CEF, perform the optional tasks described in the following sections:

Enabling Network Accounting for CEF (Optional)

Enabling a Backbone Router to Collect Traffic Matrix Statistics (TMS) Data (Optional)

Verifying Network Accounting Information (Optional)

Enabling Network Accounting for CEF

To collect network accounting information for CEF, use one of the following commands in global configuration mode as needed:

Command
Purpose

Router(config)# ip cef accounting per-prefix

Enables the collection of the number of packets and bytes express forwarded to a destination IP address (or prefix).

Router(config)# ip cef accounting non-recursive

Enables the collection of the number of packets express forwarded through a destination IP address.


When you enable network accounting for CEF from global configuration mode, accounting information is collected on the RP.

When you enable network accounting for dCEF from global configuration mode, accounting information grouped by IP prefix (recursive or nonrecursive) is not sent to the RP, but is collected on the line card.

To verify the statistics, use the show cef linecard command in privileged EXEC mode.

Enabling a Backbone Router to Collect Traffic Matrix Statistics (TMS) Data

The procedure for enabling a backbone router to collect TMS data includes enabling nonrecursive accounting and setting the interfaces on the router to collect internal or external traffic matrix statistics. The internal and external settings are used only for TMS collection. The interfaces are set to internal by default.


Note Make sure you set the incoming interfaces (not the outgoing ones) to collect internal and external traffic.


You can perform these tasks either through the command-line interface or through the Network Data Analyzer (NDA). The following sections explain each procedure.

To enable a backbone router to collect TMS data and separate internal and external traffic, use the following commands beginning in global configuration mode:

 
Command
Purpose

Step 1 

Router(config)# ip cef

Enables CEF on the router.

Step 2 

Router(config)# ip cef 
accounting non-recursive

Enables nonrecursive accounting on the router.

Step 3 

Router(config)# interface 
type number

Specifies the interface on the backbone router that you intend to configure.

Step 4 

Router(config-if)# ip cef 
accounting non-recursive 
external

or

Router(config-if)# ip cef 
accounting non-recursive 
internal

Sets the specified incoming interface so that it can collect traffic entering the backbone router from external sources.

Sets the specified incoming interface so that it can collect internal traffic in the backbone router.

You can repeat Steps 3 and 4 for each incoming interface that you want to configure for TMS.

Using the NDA for TMS Data Collection

Use the NDA to enable TMS data collection and set the incoming interfaces on the backbone router to collect internal and external traffic. For specific instructions, refer to the Network Data Analyzer Installation and User Guide.

Enabling the NDA for TMS Data Collection

To enable TMS data collection, you must create a TMS collection and specify the following information:

The name of the collection

The router from which you want to collect TMS data

How often and how long to collect TMS data

The window for enabling the collection of TMS data is similar to the one shown in Figure 15.

Figure 15 Setting the NDA Traffic Matrix Statistics Control Window

Setting Internal and External Interfaces on the Router

The NDA Traffic Matrix Statistics Control window allows you to set the interfaces on the backbone router to collect internal and external packets and bytes as shown in Figure 16. By default, all interfaces are set to internal. Set the internal and external interfaces and click Apply. When the NDA asks if you want to enable CEF, click Yes.

Figure 16 Setting the NDA Configuration Window

Verifying Network Accounting Information

To view collected accounting information, use the following command in EXEC mode:

Command
Purpose

Router# show ip cef

Displays the collected accounting information.


Configuring Distributed Tunnel Switching for CEF

CEF supports distributed tunnel switching, such as GRE tunnels. Distributed tunnel switching is enabled automatically when you enable CEF or dCEF. You do not perform any additional tasks to enable distributed tunnel switching once you enable CEF or dCEF.

Configuring the Network Services Engine

The Network Services Engine (NSE) or Parallel eXpress Forwarding (PXF) processor is turned on by default. If it is ever disabled, you must enable it to take advantage of IP packet switching and feature acceleration.


Note Before enabling the PXF processor, you must have IP routing and IP CEF switching turned on.


To configure the NSE, perform the tasks described in the following sections. The task in the first section is required; the tasks in the remaining sections are optional:

Configuring the PXF Processor (Required)

Verifying the PXF Processor (Optional)

Troubleshooting the PXF Processor (Optional)

Monitoring the PXF Processor (Optional)

Configuring the PXF Processor

To enable the PXF processor, use the following command in global configuration mode:

Command
Purpose
Router(config)# [no] ip pxf

Enables PXF processing.


Verifying the PXF Processor

Enter the show pxf accounting command to view all the supported interfaces.

Router# show pxf accounting ?

  ATM           ATM interface
  Ethernet      IEEE 802.3
  FastEthernet  FastEthernet IEEE 802.3
  Hssi          High Speed Serial Interface
  Null          Null interface
  POS           Packet over Sonet
  Serial        Serial
  summary       PXF summary statistics

Troubleshooting the PXF Processor

Use the workarounds listed in Table 10 if you encounter an error message.

Table 10 PXF Error Messages

Error Message
Workaround

WARNING:PXF Exception:mac_xid=0x10000

*** IHB watchdog timer expired

6d16h:%PXF-2-EXCEPTION:pxf exception on pxf tmc.

Enter the show pxf crash EXEC command to obtain more information.

PXF processor hang and error message:

WARNING:PXF Exception:mac_xid=0x8

*** External Memory Column 3 exception, type = 20

This error message indicates that the PXF processor has been left in HALT state. During bootup, the PXF processor is in error state and cannot be brought up. To work around this problem, reload the router.

PXF processor crash and error message:

00:49:37:Fatal pxf interrupt, int_reg=0x80, int_mask=0xFFFF, config=0x1FF4000

00:49:37:-Traceback= 6055B9CC 60530D10

This message indicates that the PXF processor encountered a serious error and crashed. To work around this problem, reload the router.


Monitoring the PXF Processor

To monitor PXF processors, use the following commands in privileged EXEC mode:

Command
Purpose
Router# show pxf accounting

Displays PXF switching statistics for all interfaces.

Router# show pxf accounting ethernet

Displays PXF switching statistics for Ethernet interfaces.

Router# show pxf accounting null

Displays PXF switching statistics for NULL interfaces.

Router# show pxf accounting pos

Displays PXF switching statistics for packet OC-3 interfaces.

Router# show pxf accounting serial

Displays PXF switching statistics for serial interfaces.

Router# show pxf accounting summary

Displays a summary of PXF switching statistics.

Router# show pxf crash

Displays PXF crash information.

Router# show pxf feature cef

Displays PXF routing feature tables for CEF.

Router# show pxf feature nat

Displays PXF routing tables for NAT.

Router# show pxf interface

Displays a summary of the interfaces in the router and the PXF features and capabilities that are enabled on these interfaces.


Configuring Virtual Profile Switching for CEF

CEF supports virtual profile switching. Virtual profile switching is enabled automatically when you enable CEF. You do not perform any additional tasks to enable virtual profile switching once you enable CEF.

Verifying Virtual Profile Interfaces

To monitor and maintain virtual profile interfaces, use the following commands in privileged EXEC mode as needed:

Command
Purpose

Router# show adjacency detail

Displays CEF adjacency table information.

Router# show ip cef

Displays entries in the FIB that are unresolved or displays a summary of the FIB.

Router# show ip interfaces virtual-access number

Displays network-layer IP information about a specified virtual access interface.


Verifying CEF

To verify CEF-related information, use the following commands in privileged EXEC mode:

Command
Purpose
Router# show cef

Displays which packets the line cards dropped or displays which packets were not express forwarded.

Router# show cef interface

Displays CEF-related interface information.

Router# show cef linecard

Displays CEF-related interface information by line card.

Router# show ip cef adjacency

Displays CEF recursive and direct prefixes resolved through an adjacency.

Router# show ip cef events

Displays all recorded CEF FIB and adjacency events.

Router# show ip cef exact-route

Displays the exact route for a source-destination IP address pair.

Router# show ip cef traffic 
prefix-length

Displays CEF traffic statistics.


Troubleshooting Tips

CEF uses routing information that is retrieved from the Routing Information Base (RIB), Route Processor (RP), and the line card (LC) databases to perform express forwarding. As updates occur to these databases, inconsistencies may result due to the asynchronous nature of the distribution mechanism for these databases.

If you find a database inconsistency, such as an IP prefix missing from a line card or an RP; you can investigate and resolve these instances by referencing the CEF system error messages that occur and by issuing CEF debug and show commands.

For CEF consistency checker system error messages, refer to the System Error Messages for 12.2T in the "New Features in Release 12.2T" area of Cisco.com.

Enabling CEF Consistency Checkers

To enable CEF consistency checkers, use the following command in global configuration mode:

Command
Purpose
Router(config)# ip cef table 
consistency-check

Enables CEF table consistency checker types and parameters.


You can enable the following CEF consistency checker types:

Lc-detect — Active line card checker to detect missing prefixes.

Scan-lc — Passive scan checker of tables on a line card.

Scan-rib — Passive scan checker of tables on an RP against the RIB.

Scan-rp — Passive scan checker of tables on an RP.

Displaying CEF Table Inconsistencies

To display CEF table inconsistency records found by the lc-detect, scan-rp, scan-rib, and scan-lc detection mechanisms, use the following command in privileged EXEC mode:

Command
Purpose
Router# show ip cef inconsistency

Displays CEF IP prefix inconsistencies.


Clearing CEF Table Inconsistencies

To clear CEF table inconsistencies, use the following commands in privileged EXEC mode:

Command
Purpose
Router# clear ip cef inconsistency

Clears CEF inconsistency statistics and records found by the CEF consistency checkers.

Router# clear cef linecard

Clears CEF information from linecards.


IP CEF Nonrecursive Accounting Example

The following example shows how to enable routers to collect internal and external packets and bytes that travel through the backbone routers. Figure 17 shows the sample backbone configuration.

Figure 17 Sample Backbone Configuration

Router A Configuration

Router(config)# ip cef
Router(config)# ip cef accounting non-recursive
Router(config)# interface e1/0
Router(config-if)# ip cef accounting non-recursive external

Router B Configuration: e1/1

Router(config)# ip cef
Router(config)# ip cef accounting non-recursive
Router(config)# interface e1/1

Router(config-if)# ip cef accounting non-recursive external

Router B Configuration: e1/0

Router(config)# interface e1/0
Router(config-if)# ip cef accounting non-recursive internal

Router C Configuration: e1/1:

Router(config)# ip cef
Router(config)# ip cef accounting non-recursive
Router(config)# interface e1/1

Router(config-if)# ip cef accounting non-recursive internal

Router C Configuration: e1/0

Router(config)# interface e1/0
Router(config-if)# ip cef accounting non-recursive external

Router D Configuration

Router(config)# ip cef
Router(config)# ip cef accounting non-recursive
Router(config)# interface e1/1

Router(config-if)# ip cef accounting non-recursive external