Traffic Load sharing

Hi all,

I have a Cisco Router with two interfaces and I want the router to send the packets alternately on each interface.

That means when I do a e.g. ping, the first packet has to be sent on int eth0, the second on ser0, the third on eth0 and so on.

I know that this is possible, I saw that on a setup for a university project.

How do I configure that ?

Cheers, Fr=E9d=E9ric-Philippe Metz

Reply to
frederic.metz
Loading thread data ...

Load balancing (routing-wise) is only accomplished with a routing protocol (that supports load sharing) that knows about the same destination via two routes that have the same metric. In short, if you have two routers with DS3s to a remote destination, and both routers are advertising the remote network to the core, with the same routing protocol, and with the same metric, then load sharing will work presuming you are using a protocol like RIPv2, OSPF, etc. Static routing will not support load-balancing.

In short, ensure that you have two routes to the destination, both of which have a remote router that is in the same protocol/autonomous system and the metric of the routes are the same.

Lastly, if this is some kind of solution for load balancing internet circuits, you have other things to consider since the traffic back in will not be load balanced unless you have a single provider and work through their options for such a configuration. Additionally, you need to be careful with asynchronous routing if the traffic takes one path over and a different path back. While theoretically this should not be a problem, firewalls and other appliances can affect this traffic and do some funny things. CEF is also capable of load sharing, but still depends on a lower level protocol.

formatting link
formatting link

Reply to
Trendkill

For some applications, the timing differences between the routes could break the application.

Also, sending packets via alternating interfaces can lead to different packet fragments going different routes, and thus fragments arriving "out of order". You can end up with fragments discarded unless you are specifically using a protocol (such as PPP) that does fragment reassembly -- but PPP can lead to quite high CPU loads.

Even without fragmentation, you can easily end up with TCP packets arriving out of order. If Selective ACK (SACK) is not turned on, alternate packets may be discarded, with the discarded packet NAK'd and so retransmitted by the source, with a complete round-trip latency to resynchronize. The throughput result can end up much much much worse than if you had used only a single interface.

Because of factors such as these, sending alternate packets to alternating interfaces is seldom as effective as load distribution based upon the source and destination IP address (e.g., send through interface 0 if the bitwise "xor" of the last bits of the source and destination addresses is 0, send to interface 1 if the xor is 1.) Algorithms such as these more closely approach flow-based path distribution rather than per-packet load distribution. *If* the IP addresses involved in your flows tend towards having uniform random distribution of the data, flow-based distribution is more effective and still shares the costs. But if it happens that the bulk of your data is transferred between two consistant IP addresses (e.g., backing up a server to a remote tape library) then you need to be more careful with how you route the flows. "Policy-based routing" can assist in this. I also seem to recall reading that some IOS routers have the ability to do flow-based routing by examining the TCP ports as well as the IP addresses, but I have a stuffed head at the moment so I'm not certain of this.

Reply to
Walter Roberson

Ignoring the question of WHY you would want to do this... To achieve alternating paths, you need to enable per packet load balancing (either by process switching or enabling CEF per packet) and have both exit paths see the same routing "cost" to the destination (via tweaking of routing protocols or configuration of static routes).

Assuming this is a training exercise, the details of either are left as an exercise for the student. If this is a production application, I highly recommend you get some professional help, because this sure does not sound like an application where per packet load balancing makes sense.

Good luck and have fun!

Reply to
Vincent C Jones

Thanks,

I'll try that and yes, it is an exercise for students. In theory, it is quite clear what I want the machine to do. But I have only basic knowledge of configuring it on the router.

If the Router only knows 2 Routes to a destination network (via static conf or via routing protocol), that would help for what I want, isn't it ? Because the RIB has the information for both routes but the calculated FIB has only one entry for that net, right ?

So the key is this process switching thing or/and Cisco express forwarding, right ?

Thanks for help.

Cheers, Fr=E9d=E9ric-Philippe Metz

Reply to
frederic.metz

See, for one,

formatting link

Reply to
Walter Roberson

Cabling-Design.com Forums website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.