Pages

amazon2

Saturday, 7 May 2011

UNEQUAL COST LOAD BALANCING WITH STATIC ROUTES


Unequal load-sharing with static routes is almost impossible as there is no configuration command to assign non-default traffic share count to a static route. For example, if you configure two default routes, one pointing to a low-speed interface and another one pointing to a high-speed interface, there is no mechanism to force majority of the traffic onto the high-speed link (IOS ignores interface bandwidth when calculating load sharing ratios).
You can, howerer, use a workaround: if you configure multiple routes for the same prefix pointing to the same interface, that interface will attract proportionally more outbound traffic.
For example, let's assume you have two point-to-point serial subinterfaces, one three times as fast as the other:
interface Serial0/0/0.100 point-to-point
 bandwidth 1000
 ip address 172.16.1.1 255.255.255.252
!
interface Serial0/0/0.200 point-to-point
 ip address 172.16.1.5 255.255.255.252
 bandwidth 3000
To shift more traffic onto Serial0/0/0.200,
you can create two default routes pointing to the second interface, one pointing to the interface itself, the other one to the next-hop router:
ip route 0.0.0.0 0.0.0.0 Serial0/0/0.100
ip route 0.0.0.0 0.0.0.0 Serial0/0/0.200
ip route 0.0.0.0 0.0.0.0 172.16.1.6
This setup will give you a 1:2 sharing ratio. To shift even more traffic to the higher-speed interface, one has to get more creative
  • Create a bogus host route for a bogus next-hop pointing to the actual next-hop router (and make sure you don't advertise the bogus route into your routing protocols).
  • Configure yet another static route pointing to the bogus next-hop. Due to recursive lookup done by Cisco IOS, the bogus next-hop will be resolved into the actual next-hop IP address.
In our example, you could use:
ip route 10.255.255.1 255.255.255.255 172.16.1.6
ip route 0.0.0.0 0.0.0.0 10.255.255.1
The results are as expected: the traffic split is the desired 1:3 ratio
a1#show ip route 0.0.0.0 0.0.0.0
Routing entry for 0.0.0.0 0.0.0.0, supernet
  Known via "static", distance 1, metric 0 (connected), candidate default path
  Routing Descriptor Blocks:
    172.16.1.6
      Route metric is 0, traffic share count is 1
    10.255.255.1
      Route metric is 0, traffic share count is 1
  * directly connected, via Serial0/0/0.100
      Route metric is 0, traffic share count is 1
    directly connected, via Serial0/0/0.200
      Route metric is 0, traffic share count is 1

a1#show ip cef 0.0.0.0 0.0.0.0 internal
0.0.0.0/0, version 43, epoch 0, attached, per-destination sharing
0 packets, 0 bytes
  via 172.16.1.6, 0 dependencies, recursive
    traffic share 1
    valid adjacency
  via 10.255.255.1, 0 dependencies, recursive
    traffic share 1
    valid adjacency
  via Serial0/0/0.100, 0 dependencies
    traffic share 1
    valid adjacency
  via Serial0/0/0.200, 0 dependencies
    traffic share 1
    valid adjacency

  0 packets, 0 bytes switched through the prefix
  tmstats: external 0 packets, 0 bytes
           internal 0 packets, 0 bytes
  Load distribution: 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 (refcount 1)

  Hash  OK  Interface                 Address         Packets
  1     Y   Serial0/0/0.200           point2point           0
  2     Y   Serial0/0/0.200           point2point           0
  3     Y   Serial0/0/0.100           point2point           0
  4     Y   Serial0/0/0.200           point2point           0
  5     Y   Serial0/0/0.200           point2point           0
  6     Y   Serial0/0/0.200           point2point           0
  7     Y   Serial0/0/0.100           point2point           0
  8     Y   Serial0/0/0.200           point2point           0
  9     Y   Serial0/0/0.200           point2point           0
  10    Y   Serial0/0/0.200           point2point           0
  11    Y   Serial0/0/0.100           point2point           0
  12    Y   Serial0/0/0.200           point2point           0
  13    Y   Serial0/0/0.200           point2point           0
  14    Y   Serial0/0/0.200           point2point           0
  15    Y   Serial0/0/0.100           point2point           0
  16    Y   Serial0/0/0.200           point2point           0

No comments:

Post a Comment

amazon4