RE: Unequal Multipath Routing?

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Torsten Luettgert wrote:
> On Mi, 2006-06-28 at 16:35 +0100, Andrew Lyon wrote:
>> Back to my original question then,  is there anything in 2.6 or a
>> patch for 
>> 2.4 that could be used to do that? (4:3 ratio split of outgoing
>> packets over two interfaces/gateways).
> 
> If you aren't afraid of patching & compiling kernels, there is one
> solution. It's a bit ugly, but works (we sell "bundled" DSL lines
> using this method).  

"bundled" dsl is exactly what this is.

> The basic idea is to use the iptables ROUTE target to make exemptions
> from the default gw. 
> 
> It works like this:
> 
> First make a kernel with the netfilter random and ROUTE targets (can
> be obtained from patch-o-matic-ng, but they are removed from the
> current HEAD - you'd have to check out an older revision, or I could
> send you my copies which work with 2.6.16 and 2.6.17).   

I will get our box upgraded to a 2.6 kernel and give it a try, there is one
feature in 2.4 that we need at the moment but I think I found a 2.6 solution
for that a few days ago.

> Then, point the default route to the bigger pipe, and add an iptables
> rule like this: 
> 
> iptables -t mangle -A POSTROUTING -o (interface of default route) \
>   -m random --average 43 \
>   -j ROUTE --gw (ip of other gateway)

Makes sense.

> I only tried this with different interfaces for different upstreams,
> but thinking about it, it should also work if they are on the same
> interface.  
> 
> 43% is about 3/7, so about 3/7 of your packets would use the slower
> line. Next thing to worry about would be the downstream :) 

Our isp does the downstream already (its 50/50 but our lines are same speed
download), we have a /30 on each line (one ip for router, one for gateway
linux box), and a /28 which is routed down both lines, and ipv6 too, our isp
is very innovative, they built their own l2pp router which does all this and
more.... A&A www.aaisp.net.uk 

> Some remarks:
> - If you can make the downstream work the same way, you have true
>   packet-based bundling, so single connections will also experience
>   the full bandwidth. Depending on how the downstream is configured,
>   different things can happen (only one line used, downstream
>   bundled per-connection, downstream is 50/50 instead 43/57).
> - if the lines have different latencies, packets can arrive
>   in different order, so e.g. VoIP won't be pleasure
> - connecting to the modems from your box will need some more rules
>   (packets would also be sent to the modem you're not talking to)
> - I'm not 100% sure the random match options are right, I used the
>   nth match for lines of equal sizes (so it's round-robin), not
>   random. One could also use a cascade of nth matches to make
>   it round-robin 4:3 (abababa abababa ...)


I've already run into the out of order packets problem, pptpd supports this
but it seems to be a little buggy at reassembling packets, basically it
doesn't work so I had to move our vpn onto the /30 ips which are not bonded,
I used round robin dns to load balance our vpn clients across both lines,
crude but better than nothing!

Thanks for your help

Andy

/*JOSEDV001TAG/*
_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux