Cisco Router Per-destination Load Balancing
Load balancing across multiple routes on a Cisco router
The previous article discussed per-packet load balancing on Cisco Routers. In this article we will discuss per-destination load balancing.
Consider the routing table below:
Codes: | L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP |
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area | |
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 | |
E1 - OSPF external type 1, E2 - OSPF external type 2 | |
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 | |
ia - IS-IS inter area, * - candidate default, U - per-user static route | |
o - ODR, P - periodic downloaded static route | |
Gateway of last resort is not set | |
10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks | ||
C | 10.0.0.0/24 is directly connected, GigabitEthernet0/1 | |
L | 10.0.0.1/32 is directly connected, GigabitEthernet0/1 | |
C | 10.0.2.0/24 is directly connected, GigabitEthernet0/0 | |
L | 10.0.2.1/32 is directly connected, GigabitEthernet0/0 | |
S | 10.20.0.0/24 [1/0] via 10.0.0.2 | |
S | 10.20.0.0/24 [1/0] via 10.0.0.3 | |
S | 10.20.0.0/24 [1/0] via 10.0.2.2 |
There are 2 connected routes and 3 static routes installed in the routing table. All 3 static routes are for the destination network 10.20.0.0/24. When the router receives an IP packet addressed to 10.20.0.10 how does it decide where to forward that packet?
Per-destination load balancing
With per-destination load balancing, the router makes a forwarding decision based on the destination IP address of an IP packet. Once it chooses a route for a particular destination IP address, the router will forward all subsequent packets addressed to the same host to the same next hop address.
We can illustrate what happens with an example. When the router receives a packet for 10.20.0.5, it decides to forward the packet to 10.0.0.2. All subsequent packets addressed to 10.20.0.5 will be forwarded to 10.0.0.2.
The router now receives a packet for 10.20.0.6. The router will now choose a new path to 10.20.0.0/24 for this packet. Suppose it chooses 10.0.0.3. All subsequent packets addressed to 10.20.0.6 will be forwarded to 10.0.0.3.
This process continues - the first time that the router has to choose a path for a particular destination host, the router will choose the path based on link usage. Once this choice has been made, all subsequent packets addressed to this host will be forwarded along the same path.
Configuring per-destination load balancing
Per-destination load balancing is the default load-balancing mode on Cisco routers. If an interface has previously been configured for per-packet load sharing, it can be configured for per-destination load balancing using one of the following 2 commands:
no ip load-sharing per-packet
OR
ip load-sharing per-destination
Either of the above commands will configure the interface to perform per-destination load balancing.
Advantages of per-destination load balancing
Per-destination load balancing is a deterministic load balancing mechanism. This means that packets addressed to a particular host will always follow the same path. As a result, packets should arrive at the destination in the same order that they were sent (in the absence of packet loss due to network congestion issues).
Disadvantages of per-destination load balancing
The primary drawback of per-destination load balancing is the possibility of uneven distribution of traffic. There is no guarantee that all available paths to a destination network will be used equally. If a large number of packets are destined for the same host (for e.g. a web application server), the link used for that host will be used more than the other available links.
Enhancements to per-destination load balancing
Source and destination based load balancing
In order to achieve a more even distribution of traffic across available links, without having to resort to per-packet load balancing, some enhancements have been made to the per-destination load balancing algorith.
Instead of basing a forwarding decision simply on the destination IP Address, the combination of source and destination address are used. All packets from a specific source host to a specific destination host goes over the same path. Traffic designated for the same destination host (such as a server), but originating from different source devices should travel over different paths, thereby ensuring a more even distribution of traffic.
Route Installation and Route Selection on Cisco routers is covered extensively in Course 4 - Static Routes on this website.
Want to test your networking skills with hands-on configuration and troubleshooting questions? Try out the Workshops section of this website here: Workshops (Login required).
Read how to use the device simulators on this website here: Workshops - General Instructions