Configuring a Load-Balancing Scheme

This module contains information about Cisco Express Forwarding and describes the tasks for configuring a load-balancing scheme for Cisco Express Forwarding traffic. Load-balancing allows you to optimize resources by distributing traffic over multiple paths.

Cisco Express Forwarding 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

Your software release may not support all the features documented in this module. For the latest caveats and feature information, see Bug Search Tool and the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the feature information table at the end of this module.

Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/​go/​cfn. An account on Cisco.com is not required.

Prerequisites for a Load-Balancing Scheme

  • Cisco Express Forwarding or distributed Cisco Express Forwarding 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 a Load-Balancing Scheme

You must globally configure load balancing on Cisco 12000 Series Router 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.

Currently, tunnel QoS is not supported in load balancing scenario. Tunnel QoS may not work when there are two or more next-hops for the tunnel destination in CEF, because the system will not be able to locate the correct if_number to build the queue.

Information About a Load-Balancing Scheme

Cisco Platform Support for Central CEF and dCEF

Cisco Express Forwarding is enabled by default on most Cisco platforms running Cisco IOS software Release 12.0 or later. When Cisco Express Forwarding is enabled on a router, the Route Processor (RP) performs the express forwarding.

To find out if Cisco Express Forwarding is enabled on your platform, enter the show ip cefcommand. If Cisco Express Forwarding is enabled, you receive output that looks like this:

Router# show ip cef 
Prefix              Next Hop            Interface
[...]
10.2.61.8/24        192.168.100.1       FastEthernet1/0/0
                    192.168.101.1       FastEthernet6/1
[...]

If Cisco Express Forwarding is not enabled on your platform, the output for the show ip cefcommand looks like this:

Router# show ip cef
%CEF not running

Distributed Cisco Express Forwarding is enabled by default on the Catalyst 6500 series switch, the Cisco 7500 series router, and the Cisco 12000 series router. When distributed Cisco Express Forwarding is enabled on your platform, the line cards perform the express forwarding.

If Cisco Express Forwarding is not enabled on your platform, use the ip cefcommand to enable (central) Cisco Express Forwarding or the ip cef distributed command to enable distributed Cisco Express Forwarding.

CEF Load-Balancing Overview

Cisco Express Forwarding 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

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 Cisco Express Forwarding. To use per-destination load balancing, you do not perform any additional tasks once Cisco Express Forwarding 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 Cisco 12000 series router are configured by default to perform per-destination load balancing.


Per-Packet Load Balancing

Cisco Express Forwarding 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.


Note


Although per-packet load balancing is intended for use on the majority of Cisco IOS routers, it is not supported on the Cisco ASR 1000 (and higher) Series Aggregation Services Router. Also, per-packet load balancing can result in out-of-sequence (OOS) packet delivery errors on some routers, which can cause applications such as VoIP to malfunction. Therefore, per-packet load balancing is not recommended. For more information, see the release notes and caveats for your platform and software release.


Load-Balancing Algorithms

The following load-balancing algorithms are provided for use with Cisco Express Forwarding traffic. You select a load-balancing algorithm with the ip cef load-sharing algorithm command.

  • Original algorithm--The original Cisco Express Forwarding 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.

GTP-U TEID-Based ECMP Load-Balancing Algorithm for Cisco IOS XE Software

GPRS Tunneling Protocol (GTP) is mainly used to deliver mobile data on wireless networks via the Cisco ASR 1000 Series Aggregation Services Routers as the core router. When two routers carrying GTP traffic are connected with equal-cost multi-path (ECMP) routing between them, you can use the show ip cef exact-route source - ip address [src-port port number] destination-ip address[ dest-port port number] [ gtp-teid teid] command in the User EXEC mode or the Privileged EXEC mode to verify the interface selected for load balancing.

To achieve load balancing, the Cisco ASR 1000 Series Aggregation Services Routers use a 4-tuple source IP address, destination IP address, L4 source and destination port (if traffic is TCP or UDP), and fields from the packet. However, for GTP traffic, the presence of limited number of unique values for these fields restricts the equal distribution of traffic load on the tunnel. To avoid polarization for GTP traffic in load balancing, a tunnel endpoint identifier (TEID) in the GTP header is used instead of the UDP port number. Because TEID is unique per tunnel, traffic can be evenly load balanced across ECMPs. This feature allows you to look inside the GTP header and balance the traffic over ECMP on a per subscriber basis.

The GTP-U TEID-Based ECMP Load-Balancing Algorithm feature adds support for:

  • GTP with IPv4 and IPv6 transport header on physical interface

  • GTP traffic over the Traffic Engineering (TE) tunnel, which supports load balancing between different TE tunnels

  • GTPv1-U with UDP port 2152

  • Up to 8 ECMP paths

Restrictions for GTP-U TEID-Based ECMP Load-Balancing Algorithm

The following restrictions apply to the GTP-U TEID-Based ECMP Load-Balancing Algorithm feature:

  • GTPv0 is not supported to avoid extra performance impact.

  • GTP-C and GTP over L2VPN are not supported.

Enabling the GTP-U TEID Load-Balancing Algorithm

Use the ip cef load-sharing algorithm include-ports source destination gtp command to enable the GTP-U TEID load-balancing algorithm for IPv4.

Use the ipv6 cef load-sharing algorithm include-ports source destination gtp command to enable the GTP-U TEID load-balancing algorithm for IPv6.

Use the show ip cef exact-route source - ip address [src-port port number] destination-ip address [dest-port port number] [ gtp-teid teid] command to display the exact route of GTP-U TEID for IPv4.

Use the show ipv6 cef exact-route source-ip address [src-port port number] destination-ip address [dest-port port number] [gtp-teid teid] command to display the exact route of GTP-U TEID for IPv6.

How to Configure a Load-Balancing Scheme

Enabling or Disabling Per-Destination Load Balancing

Perform this task to enable or disable Cisco Express Forwarding 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.    Do one of the following:

    • interface type slot / port
    • interface type slot / port-adapter / port

    4.    [no] ip load-sharing per-destination

    5.    end


DETAILED STEPS
     Command or ActionPurpose
    Step 1 enable


    Example:
    Router> enable
     

    Enables privileged EXEC mode.

    • Enter your password if prompted.

     
    Step 2 configure terminal


    Example:
    Router# configure terminal
     

    Enters global configuration mode.

     
    Step 3Do one of the following:
    • interface type slot / port
    • interface type slot / port-adapter / port


    Example:
    Router(config)# interface ethernet 1/1


    Example:
    or 


    Example:
    Router(config)# interface fastethernet 1/0/0
     

    Configures an interface type and enters interface configuration mode.

    • The type argument specifies the type of interface to be configured.

    • The slot argument specifies the slot number. Refer to the appropriate hardware manual for slot and port information.

    • The port argument specifies the port number. Refer to the appropriate hardware manual for slot and port information.

    • The port-adapterargument specifies the port adapter number. Refer to the appropriate hardware manual for information about port adapter compatibility.

    Note   

    The slashes after the slotargument and port-adapterargument are required.

     
    Step 4 [no] ip load-sharing per-destination

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

    Enables per-destination load balancing for Cisco Express Forwarding on the interface.

    Note   

    The no ip load-sharing command disables load balancing for Cisco Express Forwarding on the interface.

     
    Step 5 end


    Example:
    Router(config-if)# end
     

    Exits to privileged EXEC mode.

     

    Configuring Per-Packet Load Balancing

    Perform the following task to configure Cisco Express Forwarding per-packet load balancing.

    SUMMARY STEPS

      1.    enable

      2.    configure terminal

      3.    Do one of the following:

      • interface type slot / port
      • interface type slot / port-adapter / port

      4.    ip load-sharing per-packet

      5.    end


    DETAILED STEPS
       Command or ActionPurpose
      Step 1 enable


      Example:
      Router> enable
       

      Enables privileged EXEC mode.

      • Enter your password if prompted.

       
      Step 2 configure terminal


      Example:
      Router# configure terminal
       

      Enters global configuration mode.

       
      Step 3Do one of the following:
      • interface type slot / port
      • interface type slot / port-adapter / port


      Example:
      Router(config)# interface ethernet 1/1


      Example:
      or 


      Example:
      Router(config)# interface fastethernet 1/0/0
       

      Configures an interface type and enters interface configuration mode.

      • The type argument specifies the type of interface to be configured.

      • The slotargument specifies the slot number. Refer to the appropriate hardware manual for slot and port information.

      • The port argument specifies the port number. Refer to the appropriate hardware manual for slot and port information.

      • The port-adapterargument specifies the port adapter number. Refer to the appropriate hardware manual for information about port adapters.

      Note   

      The slashes after the slotargument and port-adapterargument are required.

       
      Step 4 ip load-sharing per-packet


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

      Enables per-packet load balancing for Cisco Express Forwarding on the interface.

       
      Step 5 end


      Example:
      Router(config-if)# end
       

      Exits to privileged EXEC mode.

       

      Selecting a Tunnel Load-Balancing Algorithm

      Perform the following task to select a tunnel load-balancing algorithm for Cisco Express Forwarding 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
         Command or ActionPurpose
        Step 1 enable


        Example:
        Router> enable
         

        Enables privileged EXEC mode.

        • Enter your password if prompted.

         
        Step 2 configure terminal


        Example:
        Router# configure terminal
         

        Enters global configuration mode.

         
        Step 3 ip cef load-sharing algorithm {original | tunnel [id] | universal [id] | include-ports {source[id]| [destination] [id] | source[id] destination [id]}}


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

        Selects a Cisco Express Forwarding load-balancing algorithm.

        • The original keyword sets the load-balancing algorithm to the original algorithm, based on a source and destination hash.

        • The tunnel keyword sets the load-balancing algorithm to one that can be used in tunnel environments or in environments where there are only a few IP source and destination address pairs.

        • The id argument is a fixed identifier.

        • The universal keyword sets the load-balancing algorithm to one that uses a source and destination and an ID hash.

        • The include-ports source keywords set the load-balancing algorithm to one that uses the source port.

        • The include-ports destination keywords set the load-balancing algorithm to one that uses the destination port.

        • The include-ports source destinationkeywords set the load-balancing algorithm to one that uses both source and destination ports.

         
        Step 4 end


        Example:
        Router(config)# end
         

        Exits to privileged EXEC mode.

         

        Selecting an Include-Ports Layer 4 Load-Balancing Algorithm

        Perform the following task to select an include-ports load-balancing algorithm for Cisco Express Forwarding 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.

        Before You Begin

        Your system must be using an image that supports Cisco Express Forwarding in Cisco IOS Release 12.4(11)T or a later release.


        Note


        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
           Command or ActionPurpose
          Step 1 enable


          Example:
          Router> enable
           

          Enables privileged EXEC mode.

          • Enter your password if prompted.

           
          Step 2 configure terminal


          Example:
          Router# configure terminal
           

          Enters global configuration mode.

           
          Step 3 ip cef load-sharing algorithm {original | tunnel [id] | universal [id] include-ports {source[id] | [destination] [id] | source[id] destination [id]}}


          Example:
          Router(config)# ip cef load-sharing algorithm include-ports source destination
           

          Selects a Cisco Express Forwarding load-balancing algorithm.

          • The original keyword sets the load-balancing algorithm to the original algorithm, based on a source and destination hash.

          • The tunnel keyword sets the load-balancing algorithm to one that can be used in tunnel environments or in environments where there are only a few IP source and destination address pairs.

          • The id argument is a fixed identifier.

          • The universal keyword sets the load-balancing algorithm to one that uses a source and destination and an ID hash.

          • The include-ports source keyword sets the load-balancing algorithm to one that uses the source port.

          • The include-ports destination keyword sets the load-balancing algorithm to one that uses the destination port.

          • The include-ports source destination keyword sets the load-balancing algorithm to one that uses the source and destination ports.

           
          Step 4 end


          Example:
          Router(config)# end
           

          Exits to privileged mode.

           

          Configuration Examples for a Load-Balancing Scheme

          Example Enabling or Disabling Per-Destination Load Balancing

          Per-destination load balancing is enabled by default when you enable Cisco Express Forwarding. 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-destination
           end

          Example Configuring Per-Packet Load Balancing

          The following example shows how to configure per-packet load balancing for Cisco Express Forwarding:

          configure terminal
          !
          interface ethernet 1/1
           ip load-sharing per-packet
           end
          

          If 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.

          Example Selecting a Tunnel Load-Balancing Algorithm

          The following example shows how to select a tunnel load-balancing algorithm for Cisco Express Forwarding:

          configure terminal
          !
          ip cef load-sharing algorithm tunnel
          end
          

          The following example shows how to disable the tunnel load-balancing algorithm:

          configure terminal
          !
          no ip cef load-sharing algorithm tunnel
          end

          Example Selecting an Include-Ports Layer 4 Load-Balancing Algorithm

          The following example shows how to select an include-ports Layer 4 load-balancing algorithm for Cisco Express Forwarding traffic:

          configure terminal
          !
          ip cef load-sharing algorithm include-ports source
          end
          

          This 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
          end

          Additional References

          Related Documents

          Related Topic

          Document Title

          Cisco IOS commands

          Cisco IOS Master Commands List, All Releases

          IP switching commands: complete command syntax, command modes, command history, defaults, usage guidelines, and examples.

          Cisco IOS IP Switching Command Reference

          Overview of the Cisco Express Forwarding feature

          Cisco Express Forwarding Overview

          Tasks for verifying basic Cisco Express Forwarding and distributed Cisco Express Forwarding operation

          Configuring Basic Cisco Express Forwarding for Improved Performance, Scalability, and Resiliency in Dynamic Networks

          Tasks for enabling or disabling Cisco Express Forwarding or distributed Cisco Express Forwarding

          Enabling or Disabling Cisco Express Forwarding or Distributed Cisco Express Forwarding to Customize Switching and Forwarding for Dynamic Network

          Tasks for configuring Cisco Express Forwarding consistency checkers

          Configuring Cisco Express Forwarding Consistency Checkers for Route Processors and Line Cards

          Tasks for configuring epochs for Cisco Express Forwarding tables

          Configuring Epochs to Clear and Rebuild Cisco Express Forwarding and Adjacency Tables

          Tasks for configuring and verifying Cisco Express Forwarding network accounting

          Configuring Cisco Express Forwarding Network Accounting

          Tasks for customizing the display of recorded Cisco Express Forwarding events

          Customizing the Display of Recorded Cisco Express Forwarding Events

          Explanation of and troubleshooting information for the Cisco IOS software implementation of Layer 3 load balancing across multiple parallel links when Cisco Express Forwarding is used

          Troubleshooting Load Balancing Over Parallel Links Using Cisco Express Forwarding

          Standards

          Standard

          Title

          No new or modified standards are supported by this feature, and support for existing standards has not been modified by this feature.

          --

          MIBs

          MIB

          MIBs Link

          No new or modified MIBs are supported by this feature, and support for existing MIBs has not been modified by this feature.

          To locate and download MIBs for selected platforms, Cisco IOS releases, and feature sets, use Cisco MIB Locator found at the following URL:

          http:/​/​www.cisco.com/​go/​mibs

          RFCs

          RFC

          Title

          No new or modified RFCs are supported by this feature, and support for existing RFCs has not been modified by this feature.

          --

          Technical Assistance

          Description

          Link

          The Cisco Support and Documentation website provides online resources to download documentation, software, and tools. Use these resources to install and configure the software and to troubleshoot and resolve technical issues with Cisco products and technologies. Access to most tools on the Cisco Support and Documentation website requires a Cisco.com user ID and password.

          http:/​/​www.cisco.com/​cisco/​web/​support/​index.html

          Feature Information for a Load-Balancing Scheme

          The following table provides release information about the feature or features described in this module. This table lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature.

          Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/​go/​cfn. An account on Cisco.com is not required.
          Table 1 Feature Information for Configuring a Load-Balancing Scheme for Cisco Express Forwarding Traffic

          Feature Name

          Releases

          Feature Configuration Information

          Cisco Express Forwarding Support for Layer 4 Port-Based Load Balancing

          12.4(11)T

          This feature allows Cisco Express Forwarding (CEF) to include Layer 4 port information in the decision for load sharing on paths.

          In 12.4(11)T, this feature was introduced.

          The following commands were modified by this feature: ip cef load-sharing algorithm and show ip cef exact-route.

          GTP-U TEID-Based ECMP Load-Balancing Algorithm for Cisco IOS XE Software

          Cisco IOS XE Release 3.10S

          This feature allows CEF to use the GPRS Tunneling Protocol Tunnel Endpoint Identifier (GTP TEID) load-balancing algorithm.

          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.

          Cisco Express Forwarding --A Layer 3 switching technology. Cisco Express Forwarding can also refer to central Cisco Express Forwarding mode, one of two modes of Cisco Express Forwarding operation. Cisco Express Forwarding enables a Route Processor to perform express forwarding. Distributed Cisco Express Forwarding is the other mode of Cisco Express Forwarding operation.

          distributed Cisco Express Forwarding --A mode of Cisco Express Forwarding 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 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 Cisco Express Forwarding 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.