High Availability Tunnel

HATunnel is small application that establishes network tunnel with packet-level redundancy.
It is designed to allow working on very unreliable wireless connections, with a lot of dropped packets.
HATunnel is sending each packet multiple times to make correct delivery more probable.
Simple math says that if you have network connection that drops 20% of packets (quite unusable without hatunnel):

Of course real world is not so simple. In reality by sending more packets you can crowd the air - making packet loss higher. Surprisingly my own tests achieved much better results than simple theory :) That may be caused by (configurable) time-dispersion of duplicate sending in hatunel and specific nature of wireless packet losing.

To use hatunel you need kernel with TUN support. You also need working pthreads library.

compilation:
gcc hatun.c -lpthread -lrt -o hatunel

usage:
./hatunel listenaddress listenport remoteaddress remoteport numberof_duplicates timedispersion

NOTICE:
hatunel is used by nobody currently so it’s not finished. It’s basically one big memory leak. If you are using it - please tell me - I’ll make it better.

downloads: