Cisco Tips & Tricks

May 4, 2006

Load Balancing

Filed under: IP Routing, ospf — ciscotips @ 9:13 pm

Load balancing has always been a trivial issuse for many Cisco engineers.There has never been a shortcut for a load balancing.

If you are running OSPF, don’t try any method of load balancing. A simple tip out here is that OSPF will do equal cost lad balancing by default so if you want to load balance between two links, simply make there cost equal. use ip ospf cost command in interface mode.

The IGRP and EIGRP routing processes also support unequal cost load-balancing. You can use the variance command with IGRP and EIGRP to accomplish unequal cost load-balancing.

You can usually use the show ip route command to find equal cost routes. For example, below is the show ip route command output to a particular subnet that has multiple routes. Notice there are two routing descriptor blocks. Each block is one route. There is also an asterisk (*) next to one of the block entries. This corresponds to the active route that is used for new traffic. The term ‘new traffic’ corresponds to a single packet or an entire flow to a destination, depending on the type of switching configured.

For process-switching—load balancing is on a per-packet basis and the asterisk (*) points to the interface over which the next packet is sent.

For fast-switching—load balancing is on a per-destination basis and the asterisk (*) points to the interface over which the next destination-based flow is sent.

The position of the asterisk (*) keeps rotating among the equal cost paths each time a packet/flow is served.

M2515-B# show ip route 1.0.0.0
Routing entry for 1.0.0.0/8
Known via “rip”, distance 120, metric 1
Redistributing via rip
Advertised by rip (self originated)
Last update from 192.168.75.7 on Serial1, 00:00:00 ago
Routing Descriptor Blocks:
* 192.168.57.7, from 192.168.57.7, 00:00:18 ago, via Serial0
Route metric is 1, traffic share count is 1
192.168.75.7, from 192.168.75.7, 00:00:00 ago, via Serial1
Route metric is 1, traffic share count is 1

Per-Destination and Per-Packet Load Balancing
You can set load-balancing to work per-destination or per-packet. Per-destination load balancing means the router distributes the packets based on the destination address. Given two paths to the same network, all packets for destination1 on that network go over the first path, all packets for destination2 on that network go over the second path, and so on. This preserves packet order, with potential unequal usage of the links. If one host receives the majority of the traffic all packets use one link, which leaves bandwidth on other links unused. A larger number of destination addresses leads to more equally used links. To achieve more equally used links use IOS software to build a route-cache entry for every destination address, instead of every destination network, as is the case when only a single path exists. Therefore traffic for different hosts on the same destination network can use different paths. The downside of this approach is that for core backbone routers carrying traffic for thousands of destination hosts, memory and processing requirements for maintaining the cache become very demanding.

Per-packet load-balancing means that the router sends one packet for destination1 over the first path, the second packet for (the same) destination1 over the second path, and so on. Per-packet load balancing guarantees equal load across all links. However, there is potential that the packets may arrive out of order at the destination because differential delay may exist within the network. In Cisco IOS software, except the release 11.1CC, per packet load balancing does disable the forwarding acceleration by a route cache, because the route cache information includes the outgoing interface. For per-packet load balancing, the forwarding process determines the outgoing interface for each packet by looking up the route table and picking the least used interface. This ensures equal utilization of the links, but is a processor intensive task and impacts the overall forwarding performance. This form of per-packet load balancing is not well suited for higher speed interfaces.

Per-destination or per-packet load-balancing depends on the type of switching scheme used for IP packets. By default, on most Cisco routers, fast switching is enabled under interfaces. This is a demand caching scheme that does per-destination load-balancing. To set per-packet load-balancing, enable process switching (or disable fast switching), use these commands:

Router# config t
Router(config)# interface Ethernet 0
Router(config-if)# no ip route-cache
Router(config-if)# ^Z
Now the router CPU looks at every single packet and load balances on the number of routes in the routing table for the destination. This can crash a low-end router because the CPU must do all the processing. To re-enable fast switching, use these commands:

Router# config t
Router(config)# interface Ethernet 0
Router(config-if)# ip route-cache
Router(config-if)# ^Z
Newer switching schemes such as Cisco Express Forwarding (CEF) allow you to do per-packet and per-destination load-balancing more quickly. However, it does imply that you have the extra resources to deal with maintaining CEF entries and adjacencies.

When you work with CEF, you could ask: Who does the load balancing, CEF or the routing protocol used? The way in which CEF works is that CEF does the switching of the packet based on the routing table which is being populated by the routing protocols such as EIGRP. In short, CEF performs the load-balancing once the routing protocol table is calculated.

Advertisements

7 Comments »

  1. in complet articel is good

    Comment by serwow — January 25, 2007 @ 7:29 am

  2. I’ve got a router with 2 links (unequal costs) to the dest net. Eigrp Runnig.
    Both routes are in the RT. with one traffic share count of 66 & the other 11.
    in any case(configuration of per packet /destiniation) only one link will be used.
    CEF is working.
    What do you think???
    Any ideas.
    My appreciations for the reply…..

    Comment by Seroj Hakopian — March 22, 2007 @ 8:25 pm

  3. I Have 2 links one of 2Mbps and other of 512 Kbps. Every time my 2 Mbps link shows 100% utilisation while 512 Kbps link is hardly used. I am using BGP as routing protocol. Please suggest me what I can do to maitain load balancing on both the links.

    Comment by Venkatesh — April 9, 2007 @ 10:36 am

  4. Follow these guidelines and you will build that new home with little, or no, problems. kitchen s
    tore
    can help…

    Comment by kagtraupsfuts — November 19, 2007 @ 9:24 am

  5. I have got 2 multilink configured of total 8 mbps, Out of this we will be surrendering 4 mb and we will take 4 mb ethernet, so can anyone suggest the solution for load balancing between two different media using eigrp

    Comment by Navin Keswani — December 3, 2007 @ 10:42 am

  6. thnx a lot

    Comment by vitthal patil — July 20, 2009 @ 9:28 am

  7. Além disso, não é executável para os indivíduos para passar o
    speed em academias e clubes de saúde por causa de seus compromissos
    profissionais. Portanto, é a sua preferência em
    primeiro lugar para obter uma solução simples e conveniente que é benevolente o suficiente para cumprir
    o seu finalidade sem afetar suas programações. Em tais condições,
    zilch poderia ser melhor do que Fort Max Diet.

    Comment by fort max Diet funciona — June 6, 2013 @ 12:06 am


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: