CIPEX: CIPE + Data Compression
==============================

Introduction
============
CIPEX adds data compression to version 1.5.4 of the CIPE encrypted 
tunnel software for protocol levels 3 (ptp) and 4 (ethernet).
Data is compressed/expanded using the MiniLZO package version 1.08.

Performance:
============
The data compression ratio depends on de type of file. Transfer of a file with 
only spaces will achieve a 3.8x higher transfer rate, while a compressed 
archive file cannot be compressed further and is transferred at the normal
speed. 
On average, you can expect that file transfers of non-compressed files to be
a factor 1.5 .. 2.5x faster.


1. Configuring the sources
==========================
The following additional options are available

--disable-mlzo      Disables the compression code. Generates a standard cipcb 
                    or cipdb kernelmodule and the ciped-cb or ciped-db program.
--enable-rh71       Enables special handling for Red Hat 7.1 2.4.2 kernels. 
		    Requires also the option --with-mkvers=2,4,2
--with-mkvers=x,y,z Overrides the minimum kernel version restriction. Without 
		    this options, the compression code is disabled voor kernel 
		    versions < 2.4.7.

Use the option --disable-debug to exclude the debug code.
Use the option --denable-protocol=4 to create the ethernet interface version.

For example:
    ./configure --disable-debug --enable-protocolversion=4 --disable-pkcipe

Note: 
You need the kernel sources to be configured exactly the same way as they 
were when the kernel was built. 
Copy the correct .config file and Makefile into the Linux source directory 
and run 'make oldconfig'. 
Use the same compiler as used to build your kernel. When the kernel sources 
or compiler differ, very unpredictable behaviour can be expected and often 
kernel crashes.

See also: ERRORS.FAQ

2. Building the kernelmodule and driver program:
    make
and install, if successful:
    make install
[Don't be alarmed by an error message about the texinfo file.]

Next, load the module
    modprobe cixdb (...or cixcb...)

Check your log files for error and informational messages.

NOTE: a set of 5 build scripts is provided. See the file BUILDSCRIPTS
      for details.

3. Configuration and startup files
==================================
Now adapt your options file: replace cipdb by cixdb (or cipcb by cixcb)
When compression is disabled, Cipex is compatible with the standard cipe 
version. Use the option nocomp to disable the compression.  

Options
=======
The following additional config options are available:
nocomp	Disables the data compression of outgoing packets. Incoming compressed
        packets will still be expanded, when received.
minsizecomp Specifies the minimum size for packets to be compressed. Default
        is 768 bytes. Smaller packets are sent uncompressed. 
	Compressing small packets will result in higher latency and no speed 
	advantage.

In your startup and shutdown files, replace:
    ciped-cb by cixed-cb
    cipcbX   by cixcbX
    ciped-db by cixed-db
    cipdbX   by cixdbX 
    Where X is the interface number 0,1,2.., e.g. cipdb0, cipcb2


4. Interface Statistics
=======================
The kernel module writes it's statistics in the logfile when an interface 
goes down. This information includes nr. of packets compressed/uncompressed,
the total number of bytes for each category and the compression ratio achieved.
In addition the up-time elapsed is shown in seconds and broken down in days, 
hours, minutes and seconds.

Example:
cixdb0: CipeX vers. 1.5.4-1.00 statistics:
cixdb0: RX uncompr. packets :            4 <-a: the number of packets not compressed (too small)
cixdb0: RX uncompr. bytes   :          795 <-b: total number of bytes of a.
cixdb0: RX compr. packets   :            0 <-c: number of packets compressed received
cixdb0: RX compr. raw bytes :            0 <-d: total bytes after expansion of b.
cixdb0: RX compr. rx bytes  :            0 <-e: total bytes compressed, befor expansion of b.
cixdb0: RX compression ratio:         1.00 <- compression ratio for packets c: d/e
cixdb0: RX total rx bytes   :          795 <-f: total bytes a+e before expansion
cixdb0: RX total raw bytes  :          795 <-g: total bytes a+d after expansion
cixdb0: RX compression total:         1.00 <- compression ratio for all packets: g/f
cixdb0: TX uncompr. packets :            5 <-h: the number of packets not compressed (too small)
cixdb0: TX uncompr. bytes   :          749 <-i: total number of bytes of h.
cixdb0: TX compr. packets   :         1000 <-j: number of compressed packets transmitted
cixdb0: TX compr. raw bytes :      1442000 <-k: total bytes before compression of j.
cixdb0: TX compr. tx bytes  :       319999 <-l: total bytes after compression of j.
cixdb0: TX compression ratio:         4.50 <- compression ratio for j: k/l.
cixdb0: TX total rx bytes   :       320748 <-m: total bytes i+l after compression.
cixdb0: TX total raw bytes  :      1442749 <-n: total bytes i+k before comprression.
cixdb0: TX compression total:         4.49 <- compression ratio for all packet sent n/m.
cixdb0: TX min. packet size :          400 <- Minimum size: only larger packets are compressed.
cixdb0:0000001013=   0 d,  0 h, 16 m, 53 s <- elapsed time.
