Load-Sharing on the SAME router

Load-balance-1router-2Assume you have either of the following setups. A single router (R3) with multiple links, either to the same upstream router (R2) or to 2 different upstream routers(R2+R4). And you want to load-share traffic across both links outbound (direction from left to right). Obviously the routing table needs multiple outgoing links as next-hops to perform the desired balancing. The command maximum-paths specifies how many paths or next hops are allowed per prefix in the routing table for a specific routing protocol, else default behavior dictates only the best route from each routing protocol which are candidate for insertion into the routing table.

Since the links terminate on the same router (R3) you have the following options:

  1. Per-Destination Load-Sharing using Fast Switching
  2. Per-Source-Destination Load-Sharing using CEF
  3. Per-Packet Load-Balancing using Process Switching
  4. Per-Packet Load-Balancing using CEF

You need to be aware that IOS makes switching decisions based on the configuration of the inbound interface first. If CEF is configured on an inbound interface, the packets will be CEF switched regardless of the configuration on the outbound interface. CEF is ONLY used if  enabled on the inbound interface. If CEF is not configured on the inbound interface, the configuration of the exit interface determines the switching method. The following table illustrates the different behaviors:

Inbound Configuration Outbound Configuration Switching Method Used
CEF Process CEF
Fast Fast Fast
Fast CEF Fast
Fast Process Process
Process Process Process
Process CEF Fast
Process Fast Fast

Refer to the following article, for more info about the Switching Types and how to enable each.

Continue reading “Load-Sharing on the SAME router”


Understanding CEF

What is CEF?

Definition from Cisco.com :

Cisco Express Forwarding (CEF) is advanced, Layer 3 IP switching technology. CEF optimizes network performance and scalability for networks with large and dynamic traffic patterns, such as the Internet, on networks characterized by intensive Web-based applications, or interactive sessions.

To understand this better, one has to understand why and how CEF came about.  With Cisco IOS  there are different Switching Methods, that define how packets are forwarded through a router. The first method, which happens to be the oldest and slowest is Process-Switching. Alternatively when  packets arrive, the interface processor can interrupt the central CPU and asks it to switch the packet according to a route cache or switching table. That cache or table can be built in several ways, the two of interest here are Fast-Switching and CEF.

Continue reading “Understanding CEF”