14.04.2009 15:25

GPRS on GNU/Linux

I still use GPRS often as WiFi coverage is not always good in the suburbs around my city. I have a basic SonyEricsson mobile phone that doubles as a GPRS modem for my laptop. I wrote about the quality service T-Com provides and GPRS is no exception; I pay 3$ per 10MB of traffic. Using Opera Mini on your phone maybe you could stretch that trough the month but otherwise it's the amount of traffic I generate in an hour of browsing and reading e-mail... so what could I do to save bandwidth?

First let's cover the basics. Once you connect your phone with an USB cable besides standard USB core modules you will also need cdc-acm and ppp-generic modules. For a PPP dialer you can use wvdial or KPPP (provided by KDE). I use wvdial which is set up like this:

; wvdial configuration
;   /etc/wvdial.conf
;
; T-Com Web'n'Walk
[Dialer wnw]
baud = 115200
Modem = /dev/ttyACM0
Dial Command = ATD
Carrier Check = no
Init = at+cgdcont=1,"IP","web.htgprs"
Phone = *99***1#
Username = none
Password = none
You can initiate a connection with:
# wvdial wnw
Once connected I could barely open a few pages (not to mention that the general connection speed is pathetic) so I started thinking about saving bandwidth. The first thing I setup was SSH as a SOCKS proxy, with compression enabled. Further I considered adding a HTTP caching proxy to my home router such as Privoxy which has great filtering capabilities, so I could strip not only ads but maybe even all images and further modify and twist the traffic... I can't be the first person thinking about these issues yet all web searches came up empty. Or, they did until I found the Toonel service this winter. Their client routes all your traffic trough their servers while compressing it, and additionally they run a caching proxy. Their client is cross-platform and it works for a number of protocols, seems to be exactly the solution I was thinking of...

But I passed because I imagine they don't encrypt the traffic and SSH as a SOCKS proxy proved to be a good enough solution. Once wvdial is connected I initiate an ssh connection to some server:
$ ssh -C -D 40000 somehost.tld
I then have a SOCKS proxy running on localhost port 40000 which many applications directly support (Firefox, Gajim...) and tsocks can be used for apps that don't. Argument "-C" enables compression and it saves me some bandwidth in the long run. I know many people tweaked network settings of Firefox (or use Fasterfox) to gain speed, but you might consider a more conservative set of rules when using GPRS because it could backfire on you.


Written by anrxc | Permalink | Filed under main