All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ramin Dousti <ramin@cannon.eng.us.uu.net>
To: Javier Govea <jgovea@magma.ca>
Cc: Ramin Dousti <ramin@cannon.eng.us.uu.net>,
	Daniel Chemko <dchemko@smgtec.com>,
	netfilter@lists.netfilter.org
Subject: Re: Round Robin Load Balancing
Date: Fri, 18 Jul 2003 00:57:24 -0400	[thread overview]
Message-ID: <20030718045724.GA32199@cannon.eng.us.uu.net> (raw)
In-Reply-To: <200307172029.h6HKTVCw013209@webmail2.magma.ca>

Try to add a "load balanced" default route distributed among these 4 ppp
interfaces.  Something like this:

ip route add default scope global ["equalize"] nexthop dev ppp0 weight 1 \
	                                       nexthop dev ppp2 weight 1 \
	                                       nexthop dev ppp3 weight 1 \
	                                       nexthop dev ppp4 weight 1

You can even do per packet routing ("equalize" keyword should do)
which is not recommended while combining with nat. However, I don't
know whether conntrack/nat in netfilter plays well with this or not.
But even if not, you still can use the "nat" capability of iproute2 itself.

Let us know if it worked.

Ramin

On Thu, Jul 17, 2003 at 04:29:31PM -0400, Javier Govea wrote:

> I undesrtand what you mean about perfect load balancing (i'm not actually looking for a
> perfect load balancer) I have two examples below, but first i will responde some of the
> questions.
> 
> > Do these two ppp accounts belong to the same ISP? 
> Yes. I have four accounts, all of them with the same ISP
> >Does the ISP drop forign src?
> ?????
> > Is the gateway doing nat? 
> Yes, im using iptables to setup the nat
> > Do you have any preference on one of the ppp's than the other? 
> No
> >Can you bond (mppp)?
> I haven't tried multilink ppp...i will look into this...
> 
> > You could also setup something like BGP to allow multiple routes to....
> I don't know if this would be the best approach. I already tried to setup BGP and OSPF 
> routes using zebra (http://zebra.org) and i never made it work....
> I found a tool called EQLPlus (http://www.cwareco.com/download/eqlplus.html) but i was
> never able to compile it. Has anybody has tried eqlplus before???????
> 
> > If one user makes a request out of line X then the return packet HAS to come back      
>  > through line X. So, if one guy sends a huge request taking minutes to fulfill, he / she
> > will tie up the line until the job is finished
> 
> Absolutely. I can live with that, but here is my problem. I have 4 ppp links on my router
> (which is doing nat). Then if in a host, located in my LAN which connected to my router, i
> open four browsers and each browser is pointing to the same site then i'm expepecting each
> web page to be requested and returned in a different link. But that doesn't happen. Some
> times it does happen but most of the time i get three of the responses on one link, one in
> another and the other two links do nothing. Sometimes i get 2,1,1,0 ....
> 
> I did another test...i have website with has in its main web page has only 4 images
> (differnt images but all of them of exactely the same size). if i point my browser to that
> site, then i'm believe the browser is sending four http requests (one for each image),
> well i would expect one image on each link....but again sometimes i get the four images on
> the same link...some times i get 2 images in one link...
> 
> So, i don't want a perfect load balancer but i would like to fix the problems on my two
> examples... i thought about implementing a round robin algorithm for load balancing where
> my first request goes on my first available link, the second one on the second available
> link and so on....this idea fixes my problems in my two previous examples, but i'm open to
> suggestions....
> 
> any tips, pointer, ideas are all welcome...
> 
> cheers...
> X
> 
> 
> 
> > Absolutely. Perfect load balancing needs to be coordinated on _all_ the
> > endpoints of the links involved. In this case, 4 endpoints.
> > 
> > For a regular load balancing (which is going to be the case here)
> > we still have lots of unknown variables. Do these two ppp
> > accounts belong to the same ISP? Does the ISP drop forign src?
> > Is the gateway doing nat? Do you have any preference on one of
> > the ppp's than the other? Can you bond (mppp)? And so on.
> > But a fun project, though, for someone who has time...
> > 
> > Ramin
> > 
> > On Tue, Jul 15, 2003 at 12:44:40PM -0700, Daniel Chemko wrote:
> > 
> > > Because of the nature of your setup, you cannot have a perfect equal
> > > load balance setup. This is because you cannot control the inbound flow
> > > of data. If one user makes a request out of line X then the return
> > > packet HAS to come back through line X. So, if one guy sends a huge
> > > request taking minutes to fulfill, he / she will tie up the line until
> > > the job is finished. The load balancer should be smart enough to not
> > > send any more requests to that line, but you are still seeing the line
> > > being monopolized by this single connection, hence it is not balanced
> > > over all lines equally.
> > > 
> > > In order to have fair balancing of all lines, I think you need to set up
> > > a deal with your ISP to load balance on their end as well.
> > > 
> > > You could also setup something like BGP to allow multiple routes to the
> > > same return address, but I am not familiar enough with BGP to be much
> > > help in this area. In all likelihood, you are better off with your
> > > current solution or maybe the ISP solution if it is supported by them
> > > (more money usually).
> > > 
> > > 
> > > 
> > > -----Original Message-----
> > > From: Javier Govea [mailto:jgovea@magma.ca] 
> > > Sent: Tuesday, July 15, 2003 12:34 PM
> > > To: netfilter@lists.netfilter.org
> > > Subject: Round Robin Load Balancing 
> > > 
> > > Hi,
> > > 
> > > I'm trying to do some load balancing with four ppp connections. Here is
> > > what i have: a LAN
> > > connected to a redhat box which has four ppp interfaces. All the boxes
> > > in the LAN are
> > > accesing internet through the ppp interfaces in the redhat box. I'm
> > > using iproute2, in my
> > > redhat box, to setup the the four ppp interfaces as my default out going
> > > route (as
> > > described in LART <a
> href='http://lartc.org/howto/index.html'>http://lartc.org/howto/index.html</a>) and I'm using
> > > iptables to masquerade
> > > all the traffic comming from the LAN. 
> > > 
> > > My setup is working fine, ie. my LAN can access the net throught the
> > > four ppp interfaces.
> > > My problem is that i don't know how is the load balancing working. Some
> > > times one of the
> > > ppp interfaces is used more than the others (and that is my problem).
> > > According to LART
> > > the routes are cached, can someone go a bit into more details in this
> > > caching thing??? how
> > > does it work?  which particular files in the kernel are doing this?  
> > > 
> > > I would like to implement a simple round robing algorithm (with no
> > > caching) for doing the
> > > laod balancing. That is first connection established gose through ppp0,
> > > the second
> > > connection on ppp1 and so on. 
> > > 
> > > I could hack iproute2 and/or iptables, but i'm not sure about which
> > > particular files i
> > > should hack in order to implement this round robin algorithm. I actually
> > > don't know if
> > > what i want makes any sense
> > > 
> > > Any ideas or pointers are all very well appreaciated.
> > > Thanx to all
> > > X
> > > 
> > > 
> > 


  reply	other threads:[~2003-07-18  4:57 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-17 20:29 Round Robin Load Balancing Javier Govea
2003-07-18  4:57 ` Ramin Dousti [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-11-18  8:47 Vivek Kashyap
2003-08-17 16:38 Javier Govea
2003-08-11 11:00 George Vieira
2003-08-10 22:30 George Vieira
2003-08-11  7:25 ` Ramin Dousti
2003-08-10 19:15 Javier Govea
2003-08-10 19:07 Javier Govea
2003-07-31 14:48 Javier Govea
2003-07-31 20:02 ` Ramin Dousti
2003-07-29 15:50 Daniel Chemko
2003-07-29 15:38 Javier Govea
2003-07-28 21:14 Javier Govea
2003-07-27 18:46 Daniel Chemko
2003-07-27 17:40 Javier Govea
2003-07-27 18:51 ` Chris Wilson
2003-07-26 18:21 Javier Govea
2003-07-27  0:30 ` Ramin Dousti
2003-07-27  6:49 ` Daniel Chemko
2003-07-26 18:07 Javier Govea
2003-07-24  0:58 Javier Govea
2003-07-24  0:31 Javier Govea
2003-07-24  1:03 ` Ramin Dousti
2003-07-17 22:52 George Vieira
2003-07-17 22:36 Daniel Chemko
2003-07-15 19:44 Daniel Chemko
2003-07-15 20:54 ` Ramin Dousti
2003-07-15 19:33 Javier Govea

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030718045724.GA32199@cannon.eng.us.uu.net \
    --to=ramin@cannon.eng.us.uu.net \
    --cc=dchemko@smgtec.com \
    --cc=jgovea@magma.ca \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.