Kamis, 28 Mei 2009

How to Configure Load Balancing in a Cisco Router

When would you need this: When you are using a dynamic routing protocol, and have more than one path to destination networks.

The first fact to be set is that ALL router platforms support load balancing. And in a short description, load balancing is the operation in which the router forwards packets in different routes to the same destination. This happens when there is more than one entry in the routing table for the same destination network.

There are two types of load balancing:

1. Multiple entries to the same destination with equal metrics.

In this situation, protocols like RIP, RIPv2, IGRP, EIGRP, and OSPF automatically does the operation and no configuration is needed.

2. Multiple entries to the same destination with different metrics.

With a complex metric calculation, like IGRP and EIGRP, it is rare to get metrics to be equal to the same destination for different paths. In this case, configuration is needed.

You can configure something called ‘variance’. The variance value, determines the percentage that you are willing tolerate in choosing a secondary path. If the value of the variance is chosen to be 1, this means that only the paths with equal best metric will be used. And a value of 1.2, for example, means that the best path as well as the paths with a metric up to 1.2 of best path’s metric will be used.

A numerical example is,

For a variance of 1.3

If the best path’s metric is 1000, paths of metric in the range of 1000 to 1300 will be used. And remember that we are talking about multiple paths to the same destination.

And one more important note, we are talking about paths derived from the same routing protocol, i.e, paths with the same administrative distance.

The configuration of unequal path load balancing for IGRP and EIGRP is done with a single command:

Router(config-router)#variance X

Where X represent the value of the variance that you want to use.

Per-Packet and Per-Destination Load Balancing

There are two types of load balancing; Per-Packet and Per-Destination. In the Per-Packet load balancing, packets going to the same destination are sent over different paths. This way, you will guarantee that all paths to the destination network are being used. But using this method causes great amount of load on the routers’ resources and low-end routers may crash. Also, the packets may arrive out of order because of different network latencies in different paths.

Using the Per-Destination load balancing, packets going to one destination pass through one path. This way, you will lower the load on the router. But the different paths will not be utilized to the best.

To activate Per-Destination load balancing, issue the following command on the interface that you want to use this method of load balancing,

Router(config-if)#ip route-cache

And to activate Per-Packet load balancing use,

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

Newer switching schemes such as Cisco Express Forwarding (CEF) allow you to do per-packet and per-destination load-balancing more quickly. However, this method requires some extra resources to deal with maintaining CEF entries and adjacencies.

Tidak ada komentar: