User Tools

Site Tools


umts_bonding

UMTS Bonding

What we want to achieve is primarily failure tolerance and secondarily a little increase in bandwidth. We'll use the following setup:

  • RASPBERRY PI Model B+ with 4 Huawei E161 UMTS sticks on the client end running some Linux
  • Some dedicated server preferrably a similar linux as the client on the server end

Software-wise, we'll use:

  • 'bonding' kernel module (mode=0, miimon=100)
  • 'tun' kernel module
  • vtund for easy IP tunneling with 'some' encryption
  • pppd for UMTS
  • a little iptables and routing
  • a lot of shell scripts to largely automate and glue all this together

The key point is having similar kernel versions on the server and the client end. Also, mixing Linux and for example NetBSD won't work. You can do the same with NetBSD tho.

Transport security is not our main focus tho we'll implement some encryption. To achive better security, vtun should be replaced by OpenVPN or similar.

Besides the RASPBERRY PI Model B+ and the UMTS sticks, you should consider the following items:

  • a _stable_ and powerful power supply
  • depending on the UMTS stick size, 4 15cm USB extension cords
  • 4 reasonably small UMTS antennas
  • a reasonably fast and big memory card (32GB Class 10 at least)
  • copper heat sinks
  • a stable case with outlets around the GPIO headers
  • a TTL-to-UART dongle and maybe another USB extension cord for it

Altogether the hardware cost on the client end is below 200EUR. The UMTS sticks can be bought off eBay for around 10EUR/piece. Any UMTS or LTE stick that works with linux is ok to use. Regarding maximum bandwidth available 'from the backplane', read this website. There is one USB bus for the four USB ports and one for the ethernet port. Given that we can push 100Mbit/s through the ethernet port and we only have one, the maximum bandwidth we can fullduplex should be around 30-50Mbit/s (taking USB overhead into account loosely). And it seems to be possible to overbook the second USB bus with 4 fast LTE links.

In the end, this will give us the ability to have a failure-tolerant UMTS bond which also provides for a little more speed, all that using a low-cost client-side hardware and standard linux software on both ends. The server hardware can be any mildly current dedicated linux machine which you can get for around 20EUR/month in most places. VPS machines work too if they let you use the tun/tap kernel modules.

Client side

I assume you have a fresh Raspbian install (details here) which was stripped off unnecessary packages by using these instructions: http://sirlagz.net/tag/raspbian-server-edition/.

To tune Raspbian to a minimum memory footprint i've closely followed this guide: https://extremeshok.com/1081/raspberry-pi-raspbian-tuning-optimising-optimizing-for-reduced-memory-usage/. I left out these steps: ZRAM, 512MB swapfile and enabling preload. Be careful with the overclocking. Better use the raspi-config commandline tool that comes with Raspbian and set the overclock settings to 'High' or 'Turbo' (also see http://www.raspberrypi.org/introducing-turbo-mode-up-to-50-more-performance-for-free/, your warranty is safe), that does the trick too.

Setting up the USB sticks

Setting up the UMTS connections

Setting up the bonding interface

Setting up vtund

Setting up dns, routing, etc

Server side

I assume you have a fresh Debian minimal install with all updates and the newest kernel. The more bandwidth you have here the better, but keep in mind that it should be at least twice the size of the sum of all UMTS connections. The easiest and most hassle-free way is renting some dedicated server from one of the many hosters available. See the next paragraph for information on using another RASPBERRY PI for the server side.

A word on RASPBERRY PI on the server side

If you for some reason use a RASPBERRY PI on this end too, you should also follow the optimization steps mentioned on top of the 'Client Side' paragraph. It does not have to be a model B+ tho (the client side requires this model because of the 4 USB ports and optimized power consumption), you can easily use a Model B Rev. 1 on this end.

There are a number of hosters that provide cheap or even free RASPBERRY PI housing (yes, housing) after quite some waiting time (usually around 3 months). The included traffic ranges from 100GB/month to 500GB/month, which should be fine for most applications. After all, UMTS traffic is shit expensive.

Setting up the bonding interface

Setting up vtund

Setting up ip forwarding and firewalling

Further considerations

Public IPv4 routing

The above setup uses NAT to establish IPv4 connectivity. Instead, use a small (/29 is enough) prefix and route public IP addresses to the client.

IPv6

If you rent a dedicated server, the chances are the provider will give a /64 prefix to you. Use this in a 'dualstack' kind of configuration. Optionally establish IPv6 connectivity via some tunnel provider.

Monitoring

Establish a nagios or at least collect statistics using rrdtool.

Webinterface

Establish a web interface on both ends to control and configure the connections.

Security

Replace vtun with OpenVPN or similar to achive stronger encryption.

Small LCD display

On the client, add a small 2-row LCD display to the RASPBERRY PI. Then use it display system status data, maybe paging through values with a button.

Provider diversity

The more different providers (up to 4, obviously) we can use in our setup, the more fault tolerance we should get.

Nice custom case

Fun idea: remember IT Crowd? See below LOL. Add the antennas on the outside, keep the USB sticks internal.

umts_bonding.txt · Last modified: 2015/01/06 22:07 by flo