Table Of Contents
Configuring a Load-Balancing Scheme for CEF Traffic
Prerequisites for Configuring a Load-Balancing Scheme for CEF Traffic
Restrictions for Configuring a Load-Balancing Scheme for CEF Traffic
Information About Configuring a Load-Balancing Scheme for CEF Traffic
Cisco Platform Support for Central CEF and dCEF
Per-Destination Load Balancing for CEF Traffic
Per-Packet Load Balancing for CEF Traffic
Load-Balancing Algorithms for CEF Traffic
How to Configure a Load-Balancing Scheme for CEF Traffic
Enabling or Disabling CEF Per-Destination Load Balancing
Configuring CEF Per-Packet Load Balancing
Selecting a CEF Load-Balancing Algorithm
Selecting a Tunnel Load-Balancing Algorithm for CEF Traffic
Selecting an Include-Ports Layer 4 Load-Balancing Algorithm for CEF Traffic
Configuration Examples for Configuring a Load-Balancing Scheme for CEF Traffic
Enabling or Disabling CEF Per-Destination Load Balancing: Example
Configuring CEF Per-Packet Load Balancing: Example
Selecting a CEF Load-Balancing Algorithm: Example
Selecting a Tunnel Load-Balancing Algorithm for CEF Traffic: Example
Selecting an Include-Ports Layer 4 Load-Balancing Algorithm for CEF Traffic: Example
Feature Information for Configuring a Load-Balancing Scheme for CEF Traffic
Configuring a Load-Balancing Scheme for CEF Traffic
First Published: May 2, 2005Last Updated: November 17, 2005This module contains information about Cisco Express Forwarding (CEF) and describes the required and optional tasks for configuring a load-balancing scheme for CEF traffic. Load-balancing allows you to optimize resources by distributing traffic over multiple paths.
CEF is an advanced Layer 3 IP switching technology. It optimizes network performance and scalability for all kinds of networks: those that carry small amounts of traffic and those that carry large amounts of traffic in complex patterns, such as the Internet and networks characterized by intensive web-based applications or interactive sessions.
Finding Feature Information in This Module
Your Cisco IOS software release may not support all of the features documented in this module. To reach links to specific feature documentation in this module and to see a list of the releases in which each feature is supported, use the "Feature Information for Configuring a Load-Balancing Scheme for CEF Traffic" section.
Finding Support Information for Platforms and Cisco IOS Software Images
Use Cisco Feature Navigator to find information about platform support and Cisco IOS software image support. Access Cisco Feature Navigator at http://www.cisco.com/go/fn. You must have an account on Cisco.com. If you do not have an account or have forgotten your username or password, click Cancel at the login dialog box and follow the instructions that appear.
Contents
•Prerequisites for Configuring a Load-Balancing Scheme for CEF Traffic
•Restrictions for Configuring a Load-Balancing Scheme for CEF Traffic
•Information About Configuring a Load-Balancing Scheme for CEF Traffic
•How to Configure a Load-Balancing Scheme for CEF Traffic
•Configuration Examples for Configuring a Load-Balancing Scheme for CEF Traffic
•Feature Information for Configuring a Load-Balancing Scheme for CEF Traffic
Prerequisites for Configuring a Load-Balancing Scheme for CEF Traffic
•CEF or distributed CEF (dCEF) must be enabled on your switch or router.
•If you enable per-packet load balancing for traffic going to a particular destination, all interfaces that can forward traffic to that destination must be enabled for per-packet load balancing.
Restrictions for Configuring a Load-Balancing Scheme for CEF Traffic
You must globally configure load balancing on Gigabit Switch Router (GSR) E2 line cards in the same way: either in per-destination or per-packet mode. It is not possible (as in other Cisco IOS software-based platforms) to configure some packet prefixes in per-destination mode and others in per-packet mode.
Information About Configuring a Load-Balancing Scheme for CEF Traffic
Before configuring a load-balancing scheme for CEF traffic, you should understand the following concepts:
•Cisco Platform Support for Central CEF and dCEF
•Per-Destination Load Balancing for CEF Traffic
•Per-Packet Load Balancing for CEF Traffic
•Load-Balancing Algorithms for CEF Traffic
For links to information about other CEF and dCEF features that you can configure, see the "Additional References" section.
Cisco Platform Support for Central CEF and dCEF
CEF is enabled by default on most Cisco platforms running Cisco IOS software Release 12.0 or later. When CEF is enabled on a router, the Route Processor (RP) performs the express forwarding.
To find out if CEF is enabled on your platform, enter the show ip cef command. If CEF is enabled, you receive output that looks like this:
Router# show ip cefPrefix Next Hop Interface[...]10.2.61.8/24 192.168.100.1 FastEthernet1/0/0192.168.101.1 FastEthernet6/1[...]If CEF is not enabled on your platform, the output for the show ip cef command looks like this:
Router# show ip cef%CEF not runningDistributed CEF (dCEF) is enabled by default on the Catalyst 6500 series switch, the Cisco 7500 series router, and the GSR. When dCEF is enabled on your platform, the line cards perform the express forwarding.
If CEF is not enabled on your platform, use the ip cef command to enable (central) CEF or the ip cef distributed command to enable dCEF.
CEF Load-Balancing Overview
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.
You can configure load balancing on a per-destination or per-packet basis. Because load-balancing decisions are made on the outbound interface, load balancing must be configured on the outbound interface.
Per-Destination Load Balancing for CEF Traffic
Per-destination load balancing allows the router to use multiple paths to achieve load sharing across multiple source-destination host pairs. Packets for a given source-destination host pair are guaranteed to take the same path, even if multiple paths are available. Traffic streams destined for different pairs tend to take different paths.
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 CEF is enabled. Per-destination 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 host pairs increases.
You can use per-destination load balancing to ensure that packets for a given host pair arrive in order. All packets intended for a certain host pair are routed over the same link (or links).
Typically, you disable per-destination load balancing when you want to enable per-packet load balancing.
Note The Cisco 10000 series router and the GSR are configured by default to perform per-destination load balancing.
Per-Packet Load Balancing for CEF Traffic
Per-packet load balancing allows the router to send successive data packets over different 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 that the traffic is balanced over multiple links.
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 can therefore introduce reordering of packets. This type of load balancing is 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 overloads 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.
Load-Balancing Algorithms for CEF Traffic
The following load-balancing algorithms are provided for use with CEF traffic. You select a load-balancing algorithm with the ip cef load-sharing algorithm command.
•Original algorithm—The original CEF load-balancing algorithm produces distortions in load sharing across multiple routers because the same algorithm was used on every router. Depending on your network environment, you should select either the universal algorithm (default) or the tunnel algorithm instead.
•Universal algorithm—The universal load-balancing algorithm allows each router on the network to make a different load sharing decision for each source-destination address pair, which resolves load-sharing imbalances. The router is set to perform universal load sharing by default.
•Tunnel algorithm—The tunnel algorithm is designed to balance the per-packet load when only a few source and destination pairs are involved.
•Include-ports algorithm—The include-ports algorithm allows you to use the Layer 4 source and destination ports as part of the load-balancing decision. This method benefits traffic streams running over equal cost paths that are not load shared because the majority of the traffic is between peer addresses that use different port numbers, such as Real-Time Protocol (RTP) streams. The include-ports algorithm is available in Cisco IOS Release 12.4(11)T and later releases.
How to Configure a Load-Balancing Scheme for CEF Traffic
Perform the following tasks to configure and fine-tune load balancing for CEF:
•Enabling or Disabling CEF Per-Destination Load Balancing (optional)
•Configuring CEF Per-Packet Load Balancing (optional)
•Selecting a CEF Load-Balancing Algorithm (optional)
Enabling or Disabling CEF Per-Destination Load Balancing
Perform this task to enable or disable CEF per-destination load balancing.
Typically, you disable per-destination load balancing when you want to enable per-packet load balancing.
SUMMARY STEPS
1. enable
2. configure terminal
3. interface type slot/port or interface type slot/port-adapter/port
4. [no] ip cef load-sharing [per-packet] [per-destination]
5. end
DETAILED STEPS
Configuring CEF Per-Packet Load Balancing
Perform the following task to configure CEF per-packet load balancing.
SUMMARY STEPS
1. enable
2. configure terminal
3. interface type slot/port or interface type slot/port-adapter/port
4. [no] ip load-sharing [per-packet] [per-destination]
5. end
DETAILED STEPS
Selecting a CEF Load-Balancing Algorithm
Perform one of the following tasks to select a CEF load-balancing algorithm.
•Selecting a Tunnel Load-Balancing Algorithm for CEF Traffic
•Selecting an Include-Ports Layer 4 Load-Balancing Algorithm for CEF Traffic
The router is set to perform universal load sharing by default.
Selecting a Tunnel Load-Balancing Algorithm for CEF Traffic
Perform the following task to select a tunnel load-balancing algorithm for CEF traffic. Select the tunnel algorithm when your network environment contains only a few source and destination pairs.
SUMMARY STEPS
1. enable
2. configure terminal
3. ip cef load-sharing algorithm {original | tunnel [id] | universal [id] | include-ports {source [id] | [destination] [id] | source [id] destination [id]}}
4. end
DETAILED STEPS
Selecting an Include-Ports Layer 4 Load-Balancing Algorithm for CEF Traffic
Perform the following task to select an include-ports load-balancing algorithm for CEF traffic. Select the include-port algorithm when your network environment contains traffic running over equal-cost paths that is not load shared because the majority of the traffic is between peer addresses with different port numbers, such as RTP streams.
Prerequisites
Your system must be using an image that supports Cisco Express Forwarding in Cisco IOS Release 12.4(11)T or a later release.
Restrictions
The Layer 4 load-balancing algorithm applies to software switched packets.
For platforms that switch traffic using a hardware forwarding engine, the hardware load-balancing decision might be different from the software load-balancing decision for the same traffic stream. You might want to override the configured algorithm.
SUMMARY STEPS
1. enable
2. configure terminal
3. ip cef load-sharing algorithm {original | tunnel [id] | universal [id] | | include-ports {source [id] | [destination] [id] | source [id] destination [id]}}
4. end
DETAILED STEPS
Configuration Examples for Configuring a Load-Balancing Scheme for CEF Traffic
This section provides the following examples for configuring a load-balancing scheme for CEF traffic:
•Enabling or Disabling CEF Per-Destination Load Balancing: Example
•Configuring CEF Per-Packet Load Balancing: Example
•Selecting a CEF Load-Balancing Algorithm: Example
Enabling or Disabling CEF Per-Destination Load Balancing: Example
Per-destination load balancing is enabled by default when you enable CEF. Typically, you disable per-destination load balancing when you want to enable per-packet load balancing. The following example shows how to disable per-destination load balancing:
configure terminal!
interface ethernet 1/1
no ip load-sharing per-destinationendConfiguring CEF Per-Packet Load Balancing: Example
The following example shows how to configure per-packet load balancing for CEF:
configure terminal!interface ethernet 1/1
ip load-sharing per-packetendIf you want to enable per-packet load balancing for traffic intended for a particular destination, all interfaces that can forward traffic to that destination must be enabled for per-packet load-balancing.
Selecting a CEF Load-Balancing Algorithm: Example
The router is set to perform universal load balancing by default.
The following examples show how to select a different CEF load-balancing algorithm:
•Selecting a Tunnel Load-Balancing Algorithm for CEF Traffic: Example
•Selecting an Include-Ports Layer 4 Load-Balancing Algorithm for CEF Traffic: Example
Selecting a Tunnel Load-Balancing Algorithm for CEF Traffic: Example
The following example shows how to select a tunnel load-balancing algorithm for CEF:
configure terminal!ip cef load-sharing algorithm tunnel
endThe following example shows how to disable the tunnel load-balancing algorithm:
configure terminal!no ip cef load-sharing algorithm tunnel
endSelecting an Include-Ports Layer 4 Load-Balancing Algorithm for CEF Traffic: Example
The following example shows how to select an include-ports Layer 4 load-balancing algorithm for CEF traffic:
configure terminal!ip cef load-sharing algorithm include-ports source
endThis example sets up load sharing that includes the source port in the load-balancing decision.
To disable the include-ports Layer 4 load-balancing algorithm and return to the default universal mode, enter the following commands:
configure terminal!no ip cef load-sharing algorithm
endAdditional References
The following sections provide references related to configuring a load-balancing scheme for CEF traffic.
Related Documents
Related Topic Document TitleCommands for configuring and managing Cisco Express Forwarding
Cisco IOS IP Switching Command Reference, Release 12.4T
List of the features documented in the Cisco Express Forwarding modules
"Cisco Express Forwarding Features Roadmap" module in the Cisco IOS IP Switching Configuration Guide, Release 12.4
Overview of the Cisco Express Forwarding feature
"Cisco Express Forwarding Overview" module in the Cisco IOS IP Switching Configuration Guide, Release 12.4
Tasks for verifying basic CEF and dCEF operation
"Configuring Basic CEF for Improved Performance, Scalability, and Resiliency in Dynamic Networks" module in the Cisco IOS IP Switching Configuration Guide, Release 12.4
Tasks for enabling or disabling CEF or dCEF
"Enabling or Disabling CEF or dCEF to Customize Switching/Forwarding for Dynamic Networks" module in the Cisco IOS IP Switching Configuration Guide, Release 12.4
Tasks for configuring CEF consistency checkers
"Configuring CEF Consistency Checkers for Route Processors and Line Cards" module in the Cisco IOS IP Switching Configuration Guide, Release 12.4
Tasks for configuring epochs for CEF tables
"Configuring Epochs to Clear and Rebuild CEF and Adjacency Tables" module in the Cisco IOS IP Switching Configuration Guide, Release 12.4
Tasks for configuring and verifying CEF network accounting
"Configuring CEF Network Accounting" module in the Cisco IOS IP Switching Configuration Guide, Release 12.4
Tasks for customizing the display of recorded CEF events
"Customizing the Display of Recorded CEF Events" module in the Cisco IOS IP Switching Configuration Guide, Release 12.4
Explanation of and troubleshooting information for the Cisco IOS software implementation of Layer 3 load balancing across multiple parallel links when CEF is used
Troubleshooting Load Balancing Over Parallel Links Using Cisco Express Forwarding
Standards
Standards TitleNo new or modified standards are supported by this feature, and support for existing standards has not been modified by this feature.
—
MIBs
RFCs
RFCs TitleNo new or modified RFCs are supported by this feature, and support for existing RFCs has not been modified by this feature.
—
Technical Assistance
Feature Information for Configuring a Load-Balancing Scheme for CEF Traffic
Table 1 lists the features in this module and provides links to specific configuration information. Only features that were introduced or modified in Cisco IOS Release 12.2(1) or a later release appear in the table.
Not all commands may be available in your Cisco IOS software release. For details on when support for a specific command was introduced, see the command reference documentation.
For information on a feature in this technology that is not documented here, see the "Cisco Express Forwarding Features Roadmap" module.
Cisco IOS software images are specific to a Cisco IOS software release, a feature set, and a platform. Use Cisco Feature Navigator to find information about platform support and Cisco IOS software image support. Access Cisco Feature Navigator at http://www.cisco.com/go/fn. You must have an account on Cisco.com. If you do not have an account or have forgotten your username or password, click Cancel at the login dialog box and follow the instructions that appear.
Note Table 1 lists only the Cisco IOS software release that introduced support for a given feature in a given Cisco IOS software release train. Unless noted otherwise, subsequent releases of that Cisco IOS software release train also support that feature.
Table 1 Feature Information for Configuring a Load-Balancing Scheme for CEF Traffic
Feature Name Releases Feature Configuration InformationCEF Support for Layer 4 Port-Based Load Balancing
12.4(11)T
This feature allows Cisco Express Forwarding to include Layer 4 port information in the decision for load sharing on equal cost paths.
In 12.4(11)T, this feature was introduced.
The following sections provide information about this feature:
•Load-Balancing Algorithms for CEF Traffic
•Selecting a CEF Load-Balancing Algorithm
The following commands were modified by this feature: ip cef load-sharing algorithm and show ip cef exact-route.
Glossary
adjacency—A relationship formed between selected neighboring routers and end nodes for the purpose of exchanging routing information. Adjacency is based upon the use of a common media segment by the routers and nodes involved.
CEF—Cisco Express Forwarding. A Layer 3 switching technology. CEF can also refer to central CEF mode, one of two modes of CEF operation. CEF enables a Route Processor to perform express forwarding. Distributed CEF (dCEF) is the other mode of CEF operation.
dCEF—distributed Cisco Express Forwarding. A mode of CEF operation in which line cards (such as Versatile Interface Processor [VIP] line cards) maintain identical copies of the forwarding information base (FIB) and adjacency tables. The line cards perform the express forwarding between port adapters; this relieves the Route Switch Processor of involvement in the switching operation.
FIB—forwarding information base. A component of Cisco Express Forwarding (CEF) that is conceptually similar to a routing table or information base. The router uses the FIB lookup table to make destination-based switching decisions during CEF operation. The router maintains a mirror image of the forwarding information in an IP routing table.
LSP—label switched path. A sequence of hops (Router 0...Router n). A packet travels from R0 to Rn by means of label switching mechanisms. An LSP can be chosen dynamically, based on normal routing mechanisms, or you can configure the LSP manually.
prefix—The network address portion of an IP address. A prefix is specified by a network and mask and is generally represented in the format network/mask. The mask indicates which bits are the network bits. For example, 1.0.0.0/16 means that the first 16 bits of the IP address are masked, making them the network bits. The remaining bits are the host bits. In this example, the network number is 10.0.
RIB—Routing Information Base. A central repository of routes that contains Layer 3 reachability information and destination IP addresses or prefixes. The RIB is also known as the routing table.
Note See the Internetworking Terms and Acronyms for terms not included in this glossary.
Any Internet Protocol (IP) addresses used in this document are not intended to be actual addresses. Any examples, command display output, and figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses in illustrative content is unintentional and coincidental.
© 2006 Cisco Systems, Inc. All rights reserved.