NetBSD-Users archive

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

Re: Connection Link Aggregation

On Wed, 25 Apr 2012 19:42:54 -0400
Al Zick <> wrote:

> Hello Gerard,
> On Apr 17, 2012, at 6:58 PM, Gerard Lally wrote:
> > On Tue, 17 Apr 2012 14:34:37 -0400
> > Al Zick <> wrote:
> >
> >> Hi,
> >>
> >> We have very poor connectivity in our office. We have a satellite
> >> connection, but it is usually either very slow or simply does not
> >> work at all. DSL, ISDN, T1, and cable are not available and even cell
> >> phones don't work very well here. We are willing to invest in more
> >> phone lines and modems. I was wondering if the following setup is
> >> doable. I want to connect 4 to 8 modems to a machine running NetBSD
> >> and then bind them and set the machine as a gateway/router for the
> >> rest of our network. Can I bond them in such a way to achieve
> >> transfer rates of 224k or higher? Also, will this effect latency? I
> >> would really like less latency than what satellite offers.
> >>
> >> Thanks,
> >> Al
> >
> >
> > With pf you can do round-robin routing on multiple WAN interfaces. You
> > won't get transfer rates equalling the aggregate of all your lines but
> > you will not have one line (FTP download, for example) tying up your
> > bandwidth. So if you have two 56k lines and round-robin routing sends
> > your FTP download out over the first channel then you will still  
> > have a
> > 56k line free for other work.
> So, will this give me 112k then?

Yes and no.

Round-robin routing just assigns the next available channel. If you have
a 512k/128k satellite link and a 56k dial-up link, and pf randomly
assigns the satellite link to someone on your LAN watching Youtube, then
you're likely to be stuck with the 56k for your downloads. Even if you
are the only person using a computer on the LAN, round-robin routing
will still randomly assign a channel and won't aggregate the speed of
the two.

HOWEVER, there is a caveat. You can aggregate the speed of your links
for downloading by using a multithreaded download manager like aria2.
Because aria2 can open separate threads pf round-robin routing will
assign the first thread to one WAN link and the other thread to the
second link.

The following command, for example, opens two threads to an FTP server:
the first thread will use your satellite link and the second your
dial-up link, giving you an aggregate of 512k + 56k = 568k down *if*
nobody else is on the LAN.

$ aria2c -x2

If someone else is using the LAN it might give you instead something
like 256k + 56k = 312k, or 512k + 28k = 540k, depending on how the WAN
channels have been randomly assigned at the time.

The following command will do the same, except that it will download
from two separate sources:

$ aria2c -x2 http://a/f.iso ftp://b/f.iso

If you decide to purchase multiple WAN links you should consider using
packet queueing in your pf firewall as well, especially if one of the
links is satellite. A simple PRIQ scheme will suffice to have DNS and
ACK packets put into a priority queue. Another thing to consider is to
use pf to route all your DNS over the link with the lowest latency.

I can give you some help setting this up but I am by no means an expert.
However, I do have it working successfully in one or two places. Even
though in normal use (without aria2) it does not give you a download
speed equal to the aggregate of all your links, it does mean none of
your links get saturated by one user commandeering the line for
him/herself. And with aria2 coupled with pf queueing and intelligent
firewall rules you can maximise your speed nicely even for normal web

Home | Main Index | Thread Index | Old Index