lzo compression support for tinc

Teemu Kiviniemi teemuki at iki.fi
Tue May 6 17:54:39 CEST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I've added lzo compression support for tinc 1.0pre8. Lzo is a very fast 
compressor (see  http://www.oberhumer.com/opensource/lzo/).

I've implemented it by using two new compression levels. Compression level 10 
is for fast compression using lzo1x-1 algorithm. Compression level 11 is for 
slow compression using lzo1x-999 algorithm. 

Both lzo algorithms compress worse than zlib. Lzo1x-1 compressor is very fast, 
but lzo1x-999 is even slower than zlib. Lzo1x-999 is included because lzo 
decompression is always very fast. If the cpu on the sender side is very fast 
and the cpu on the receiver side is very slow, lzo1x-999 is a good choice.

I've tested the patch and everything seems to work well. I haven't tested the 
included autoconf patch myself. I've just added -llzo to the LIBS -line in 
src/Makefile by hand after ./configure.

Some benchmarks...

I ran tinc between two slow Pentium-MMX 200MHz computers running Linux 2.4.18. 
They had a direct 2.3Mbps link between them. Tinc was running in switch mode. 
Blowfish encryption and sha1 hmac was used. Throughput was determined by 
transferring files from a web server on remote end with wget. The cpu loads 
are rough estimates from top.

Uncompressed speed:

Direct connection (without tinc): 235kB/sec
Uncompressed (comp. level 0): 215kB/sec (~50%/50% cpu load on sender/receiver)

A compressed .zip file:

lzo1x-1 (level 10): 214kB/sec (70%/50% cpu load)
lzo1x-999 (level 11): 80kB/sec (100%/33%)
zlib (level 1): 85kB/sec (100%/70%)

Data from /dev/zero:

lzo1x-1: 483kB/sec (92%/89%)
lzo1x-999: 152kB/sec (100%/55%)
zlib: 92kB/sec (100%/67%)

Large .html:

lzo1x-1: 380kB/sec (95%/82%)
lzo1x-999: 106kB/sec (100%/41%)
zlib: 88kB/sec (100%/67%)

Files from /usr/bin:

lzo1x-1: 330kB/sec (90%/74%)
lzo1x-999: 96kB/sec (100%/39%)
zlib: 76kB/sec (100%/72%)

An mpeg video:

lzo1x-1: 250kB/sec (80%/61%)
lzo1x-999: 83kB/sec (100%/37%)
zlib: 84kB/sec (100%/65%)

Lzo1x-1 is much faster than the fastest zlib compression. Great for slow 
tunnel-gateways.

Teemu
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+t9q/q0EylM9fq6oRAmG0AJ9FdfcFDX9p2QRYaDuvyFOxJx0wRACfW0RH
k/HFvg/Ctay5ap2Q2rKsCAs=
=rMX2
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tinc-lzo-autoconf.diff
Type: text/x-diff
Size: 1443 bytes
Desc: not available
Url : http://brouwer.uvt.nl/pipermail/tinc-devel/attachments/20030506/a003b255/tinc-lzo-autoconf.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tinc-lzo-src.diff
Type: text/x-diff
Size: 5957 bytes
Desc: not available
Url : http://brouwer.uvt.nl/pipermail/tinc-devel/attachments/20030506/a003b255/tinc-lzo-src.bin


More information about the Tinc-devel mailing list