- The below diagram traces the path taken by a packet as it travels over the ppp-over-ssh tunnel.
- The TCP/IP/Ethernet layers adds known amount of header/trailer which are trivial to find out. Hence, I will not
explain them here. I will concentrate only on the overhead added by the SLIP interface and VPND below.
- To find out the overhead added by SLIP, one can read the following paragraph from
RFC1055:
The SLIP protocol defines two special characters: END and ESC. END is 0xc0
and ESC is 0xdb not to be confused with the ASCII ESCape character; for the
purposes of this discussion, ESC will indicate the SLIP ESC character. To send a packet, a
SLIP host simply starts sending the data in the packet. If a data byte is the same code as END
character, a two byte sequence of ESC and 0xdb is sent instead. If it
the same as an ESC character, an two byte sequence of ESC and 0xdd is sent
instead. When the last byte in the packet has been sent, an END character is then transmitted.
Thus at a minimum, the SLIP protocol adds 2 bytes of overhead.
- A quick lool at the function datasend in crypto.c of the source tree for vpnd, reveals
the packet format:
m-byte MAC (message authentication code); e.g. SHA1 (20B), MD5 (16B), ripemd-160 (20B), CRC (2B)
2-byte Payload length
n1-byte payload;
If you use the basic-master-key-file, then the MAC is just a 2 byte CRC. On the other hand, the
extended-master-key-file allows one to use SHA1, MD5 and ripemd-160.
NOTE: No padding bytes are reqiured here, even if blowfish is a block cipher, as Cipher Feedback or
CFB mode is used, which essentially converts a block cipher to stream-cipher.
- Asuming no compression is used by SLIP (using noslip option) or vpnd (using nocompress option),
we conducted a series of experiments. The results can be accessed
here.
Thus we can say that with basic-master-key-file the average overhead is 102 bytes, while
with extended-master-key-file + HMAC the overhead is 120 Bytes.
- The input data for this experiment was totally random, using ASCII values from decimal 32 to 125.
An example of such data is shown below:
seq_no: 0
Y%*i%|\NU]\Dw-5jOba4Q@D8`?5t#"iBFna^M1OF)t?6++f)m6ZIR:aOY3EvO1Tu!7UhI&0R6O%\uked#BIpvGARZfd+3;
"Olq9Q3J@J5E(,2m,5KVA^}bLse2 4gcVI}C\ccB4*J[VTg(;YIyr.Gg/Z#C]Y)OBs{AXYU}&2Ut6w1+CG kn#zdA?D6H/
U&$lGwG9vgeg]7a+C@R]-\z)]=b=nGLEMQ31dtJ\^K_Wc\b(|Pe+I{N(;3EEtqjC^9nD/:)"|aeZ_)s2n ['i}\8D#.7)k2B\Vl2su4q
This data was generated using
modudpgen, a synonym for Modified UDP generator and
sniffed using ethereal.
- As a result of this, the SLIP protocol layer could not add any extra escape sequences within the data.
However the IP header did have some charaters (2) that needed to be escaped, which increased the size of the
slip frame by 4 bytes in all our experiments. Thus if the input frame was 128 bytes, the Slip frame would be
(128 + 2(start + end flags) + 2(escape characters)) = 132 Bytes.
Now if the basic-master-key-file method was used using 2 byte CRC and 2 byte length, then
the vpnd outputs a packet of (132 + 4 =) 136 bytes. Add to this the 66 bytes of TCP/IP/ethernet header
and you will get a frame of 202 bytes on the wire, as confirmed by the results.