Bond two Internet connections of varying quality

I live in a remote part of the country, Internet-wise. I utilize a satellite based Internet, but it’s having many problems during peak traffic times.

I have researched a bit and found Ubuntu Bonding. If I build a Linux PC and connect my satellite Internet to the NIC, and a Netgear Aircard for 3G/4G, would Ubuntu Bonding allow me to use these two connections in various states of quality? Should I be added a squid cache too? Or is that a solution for a different problem?

I want to use a RaspberryPi, but it lacks Gigabit Ethernet and might slow down the overall experience. Will likely use an old PC.

Asked By: Erik


I will try my best to address several questions, as you are talking about different subjects, and the broadness and entangling of the themes involved is more complex than it appears to be at the surface.

We can easily identify a couple of problems:

  • Slow peak time traffic: I will try to address several points here. About your setup, your biggest problem is latency. If you are having bigger problems at peak times your provider may be overselling [too much].

  • Speed: I also have dealt with satellites, and the bigger problem is latency [and rainy days].

I will address the hardware first as it is easier and we will be done about it.

About the raspberry if seems the 100Mbps should be enough for your current needs. However, take that with the aggregated traffic of upstream and downstream of both providers, the pratical limit of an interface being 70-80%, the potential of the rpi not being able to use it to the full max, and some more internal traffic at home, and indeed I also agree it is potentially wiser to have a server with gigabit ports.

I am using here a Lamobo R1 as router server, 5 gigabit ports with a SATA disk. The internal wifi is of no use, too cheap and too unstable. [80 USD]. Or if you are willing to go with an USB ethernet, the Banana Pro is an interesting alternative. (if you are reading this after the 2nd quarter of 2016, there will be already very interesting 64-bit ARM based SBC products out there that will supersede this 32-bit ARMs)

As alternative, you can buy a TP-LINK router Archer C7 v2.0 and install openwrt. AC wifi, 5 gigabit ports. [the Archer C7 is still good value for money at 100USD with 5 gigabit ports and AC wifi ]

There is an interesting project, the Turris Omnia, also for after mid-2016.

Since we are talking about the hardware, about the OS. Archer C7 v2.0 (and the Turris Omnia) support dd-wrt (Linux), and the Lamobo R1 and Banana Pro support Linux. I have tested many alternatives in the Lamobo over more than a month and the best I could find was armbian Bananian from Sinovoip (the manufacturer) does not seems stable, and the armbian guys have been doing an excellent work adapting Debian for several SBCs (except Raspberry ironically – though they might do it soon).

About bonding, bonding will work but won’t aggregate the overall bandwidth with two different providers, but only separate transmissions. (e.g. 2 20Mbps won’t give you 40Mbps). Nonetheless, even with bonding you will still have to deal with slow connections, timeouts and retransmissions. Only time will tell if it worth the trouble. Or put it in another way, aggregating providers/interfaces is often used for having more bandwidth than solving latency problems.

As for backup, you are right. Bonding for aggregating or as an active backup. I would try using it for backup actually. This can be done as per this link:

Nonetheless, latency is your biggest problem. If the 3G provider allows to transmit to the Internet IP addresses that do not belong to them, I would create iptables/NAT rules to send the upstream data with the address space you have from the satellite via 3G, and receive the downstream via satellite. This alone can reduce your latency in almost half of the time, at least theoretically. The added advantage, is that normally if not using bittorrent, the upstream usage is tipically 1/3 or 1/4 of the downstream usage.

In case the 3G upstream being not enough for your needs, it would be always advantageous to send there your DNS and HTTPS upstream traffic.

Again about latency; I know it sounds a bit counterintuitive, I do advise you getting a commercial (IPsec) VPN provider. The bandwidth can get slightly smaller, however, IPsec works with UDP and you won’t be so much dependent on the mechanisms of TCP.

A squid cache on your side won’t do you much good. However, a VPN and/or squid cache remotely in a friend/site/vendor with less latency will help you a lot. I do not know whether it is worth a VPN+proxy, it is a matter of testing it.

Answered By: Rui F Ribeiro