ADSL Routing Solution in Detail

My previous posts on my ADSL setup have generated a great deal of interest, so I’m now adding a detailed writeup on how to set up this system.
First, here is a reference diagram of how everything fits together:

Bear in mind that you could replace any part of the system with something comparable. E.g. the RTA1320 could be replaced wtih any ADSL router that supports half-bridge mode, and the WRT54GL could be replaced with a dedicated PC runing Smoothwall or some other full-blown firewall package.

Continue reading “ADSL Routing Solution in Detail”

Router Addendum: Dynalink RTA1320

I forgot to mention the other piece of my epic ADSL Bittorrent setup: my modem.

I use a weeny little Dynalink RTA1320.  At first glance it probably looks a bit small and pathetic, but don’t be fooled.  It has a full-blown ADSL2+ compatible modem in it, and quite a nice router system, but I’m cold and hard and don’t care about the router system.  I only care that it supports PPP half bridge mode.

I’m gonna get a bit nerdy on you here.  Most sane countries use PPPoE (Point to Point Protocol over Ethernet) to authenticate their ADSL clients, meaning any device that can carry an ethernet signal can carry the encapsulated authentication packets.  Good idea.  This means you can set up an ADSL modem in raw bridge mode, and have your router pass the authentication information down the wire.  The modem only has to deal with modeming (modulating and demodulating)* the ADSL signal.

In silly old New Zealand, we use PPPoA (the A is for ATM, which is does not stand for Automated Teller Machine).  I believe this is because large parts of our backend infrastructure are, ummm, crap.  This causes issues because the modem has to setup the PPP connection (because routers without modems can’t talk ATM), and in most cases this means modems also have to be routers, and combined modem-routers are almost universally shite.

Enter our saviour: PPP half bridge mode.  If I understand correctly (and the chances of that are relatively low), then the modem/router running in PPP half bridge mode acts as follows:

  1. The modem sets up the PPPoA connection using the authentication information you give it.
  2. It then it grabs the MAC address from the internal connection (in my case the ‘internet’ port of the WRT54GL) and exposes it to the intertr0n. 
  3. Any packets received on that MAC address are forwarded without further consideration to the internal connection. 

So once the connection is established, the ‘true’ router effectively sees all the internet traffic, and the crappy modem-router doesn’t have to do any hard work dealing with NAT or firewalling.  Sweet!

So in summary, Ben’s recipe for ADSL Bittorrent successTM:

  • Dynalink RTA1320 in half-bridge mode
  • Linksys WRT54GL running DD-WRT, with config changes to NAT behaviour

*So why isn’t it a moddem then?  Eh?

[tags]bittorrent, networking, personal[/tags]

Linksys WRT54GL Router

Update: Also check out my full ADSL setup over at this link.

I’m picky. I’ve been battling to get the best possible setup for my home internet connection for quite some time. I do a lot of gaming, and even more P2P (mainly via Bittorrent).

My search for the ultimate router started when had a problem where my basic ADSL router would die with perfect regularity if I left a torrent running overnight. After some research, I came to the understanding that Bittorrent asks a lot of a router. By design Bittorrent opens a heap of connections, and also hops around between connections very frequently, dropping and adding new ones all the time. Without going into the gory details of Network Address Translation (NAT), I can say that Bittorrent tends to load up router NAT tables pretty heavily.

So I went searching, and came across this page at Tom’s Networking. “Great!” I though, “here’s the clearest indication of P2P performance of different routers”. And off I went to order a Netgear Rangemax 240. It even sounded fast. However, following a few nights and days of testing, the Netgear was sent back for refund. Basically with Bittorrent running, I could browse two or three websites, and the fourth site would simply not respond. The DNS would resolve, but the connection would timeout. Crazy thing is that I could still browse the original two or three websites with no issues. I can only presume the NAT table system was dying horribly.

After further research, I read of some users who were having great success running customised firmware on Linksys routers. The price of the Linksys WRT54GL (the ‘L’ suffix stands for ‘Linux’, meaning these particular models support custom firmware), was so good that I figured I couldn’t go wrong at least trying it. I grabbed the router and uploaded a copy of the DD-WRT firmware. There are other custom firmware options, but it seems DD-WRT offers the simplest interface.

The first thing I changed was the NAT table settings, increasing the table size from the default 512 to 4096, and dropping the NAT timeout from 3600 seconds to 90. In English this basically tells the router “store heaps of connection details, but discard them pretty sharpish if you don’t need them anymore”, which is exactly the behaviour we want with Bittorrent and other P2P apps.

The result? Bittorrent downloads are consistently 50-100kBps faster than I’ve ever had them, and web browsing is still possible with torrents running (well, unless of course our third-world internet is congested). The router is also as stable as a rock, and the custom firmware offers so many tweaking options that I can’t imagine it being unable to deal with anything thrown at it. Heck if you want to sell WiFi access to your neighbours it appears to only take a couple of clicks!