Multithreaded TCP Proxy Tunnel

July 28th, 2009

Sometime back I posted a guide in the HOWTO section on load balancing across multiple ISP connections. This is great in certain instances but certainly doesn’t replace line bonding.

With torrent traffic for example, it works great. The various peer connections should be established equally over the various ISPs and you really can utilize the bandwidth of multiple uplinks. A single connection however can only ever be established over one ISP, and this is the biggest limitation for the following reasons:

1) A single HTTP, POP3, SMTP, FTP, etc connection for example will only be established over one ISP whilst the other remains idle.
2) Incoming connections can only come in over one ISP depending on the IP accessed.

I’m sure there are further situations that might suffer limitations due to the setup.

The best way around this that i could think of was creating a multithreaded tcp proxy. The software consists of a proxy client and proxy server. I would run the proxy client on the local end, and the server on some remote machine. The client and the server will create a number of TCP connections between them which should hopefully be split across the ISPs equally, and reassembled by the proxy server at the other end.

The limitations of this though are that the entire session will be limited to the speed of the slowest link, and any of the links failing will cause the tunnel to become corrupted and fail.

C code and an update to come shortly.

The Linux Robot – In hindsight

July 8th, 2009

Having written 3 major programs for the robot:

1. Move about randomly avoiding objects using proximity sensors as well as stall detection. The stall detection is simple in so far as it’s just a detection of a current spike during continuous motion a certain percentage threshold above existing current consumption.
2. Move randomly to a bass beat of music.
3. Follow a light. The logic for this is simply to rotate all wheels in the direction of which of the photoresistors shows the lowest resistance until they are both equal +/- 5%. When this occurs, assume you are looking straight at it, and move forward until they are no longer equal. Then readjust using turning logic and continue. It works surprisingly well!

What would I do differently next time around?
Read the rest of this entry »