Re: Compression with ssh tunneling



Todd H. wrote:
David Gempton <davidg@ttc4it_dot_co_dot_nz> writes:


Has anyone done compression testing with ssh tunnels ?

I was looking at it the other day and it looked like the compression
options have no effect when you try and use them on a tunnel.

Here was the test:

# ssh -L222:localhost:22 root@server


How fast is the link to the server?


Then with this tunnel in place I used scp to transfer a file

# scp -P222 root@localhost:/tmp/file1 .


Another factor that'll skew results: what's in the file, and what's
the entropy of it? This will determine how compressible that data
stream is likely to be.

To normalize that out, create a 10 megabyte file of nothing but 0's
and repeat the test.

dd if=/dev/zero of=/tmp/blah bs=512 count=20480

Then use /tmp/blah as the file to transfer. If compression is working
it should go very quickly, non compressed should go quite slowly.
Over a relatively slow lin kthat is.



If I put the compression on the scp command instead of the tunnel
there was a major speed increase.


That's a useful datapoint.


Is this likely to be because the binary network traffic generated by
scp is not very compressable or is it that compression on tunnels does
not work ??


Not sure. Another way to test is to use netcat on the tunnel, to
eliminate scp's functionality from the equation.

On the remote host, set up a listener remote$ nc -l -p YY > /tmp/blahfoo
(where YY is a port other than 22 lest ya kill sshd first)


Then, with the tunnel from local 222 to remote YY
local$ cat /tmp/blah | nc 127.0.0.1 222


When you see remote /tmp/blahfoo hit 10MB, stop the timer. Hit Ctrl-c
on local as well to kill the nc client connection

Compare this with and without using the tunnel and you'll have another
useful datapoint.


I also did some tests with using VNC over a tunnel and also found that
there was no visible speed increase when compression was used on the
tunnel.


VNC has various compression algorithms it supports as well that'd skew
the reliability of using it as a known test.


Thanks Todd,

I was going to use FTP for the testing but "nc" looks like a much cleaner way of doing it.

I really appreciate the time you've taken to help with this.

I'll post the full set of speeds and feeds when I have re-run the tests.

Regards
Dave Gempton.
.



Relevant Pages

  • Re: Compression with ssh tunneling
    ... I was looking at it the other day and it looked like the compression ... options have no effect when you try and use them on a tunnel. ... with the tunnel from local 222 to remote YY ... Hit Ctrl-c ...
    (comp.security.ssh)
  • Compression with ssh tunneling
    ... Has anyone done compression testing with ssh tunnels? ... I was looking at it the other day and it looked like the compression options have no effect when you try and use them on a tunnel. ... Then with this tunnel in place I used scp to transfer a file ...
    (comp.security.ssh)
  • Re: forward a tcp stream through rs232
    ... TCP/IP protocol on the serial line. ... but the overhead of a "complete TCP/IP protocol" ... compression, ... endpoints of the tunnel). ...
    (freebsd-net)
  • Re: X terminal hardware
    ... X tunnelled through SSH *without* compression, ... through LBX through SSH *with* compression. ... should offer an option to tunnel through SSH when logging in. ...
    (uk.comp.os.linux)
  • Re: [SLE] remote X vrs VNC
    ... > Hans Witvliet wrote: ... > I know LBX, and I tested it, as well as ssh with compression ... argument now makes the ssh tunnel setup a little quicker. ...
    (SuSE)