LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-25-2013, 01:32 AM   #1
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
ssh over OpenVPN network: compression questions


A doubt ...

When running ssh over an OpenVPN network does it make sense to compress both?

The OpenVPN network carries several types of traffic, not just ssh, so presumably its best to have OpenVPN configured for compression in case the upper level packets are not compressed.

ssh packets' payloads are encrypted so are random so cannot be compressed. Presumably ssh compresses raw data and so reduces the amount of encrypted data to be transmitted. The same reasoning would apply to any encrypted data.

If my understanding is correct, it would follow that both OpenVPN and ssh should be set to compress to minimise the size of what is sent over the wire.
 
Old 03-25-2013, 04:41 PM   #2
Pearlseattle
Member
 
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 999

Rep: Reputation: 142Reputation: 142
Interesting! I would agree with you.
OpenVPN trying to recompress the ssh-packets would be an overhead as you stated, but maybe the compression performed by ssh would give overall more benefits than the overhead.

But as usual, there are a lot of variables involved: maybe when OpenVPN tries to re-compress the ssh-traffic the ssh-packets grow in size a lot (similar to zipping a zip-file), or the HW of your source/target server (used to compress/uncompress the traffic) is just too slow compared to the bandwidth you have, or the type of traffic handled by your ssh is not ideal (e.g. from what I saw now ssh does not achieve the same compression ratio for both single chars and strings), or the network you use has a high latency, etc... .

So, probably the only way to be sure about it would be to test a real-world scenario... .

Cheers
 
Old 03-26-2013, 04:18 AM   #3
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,294
Blog Entries: 3

Rep: Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719
A test may be the best way to find out. ssh can be set to compress data using -C, but even the man page warns that on fast networks that may actually slow things down.
 
Old 03-27-2013, 01:28 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578

Original Poster
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Thanks Pearlseattle and Turbocapitalist

I had hoped that a Gedankenexperiment would be enough and a practical test could be avoided!

If I find time to test I will update this thread. Meanwhile I will compress both because our end-to-end OpenVPN network is not fast and increasing the size of small packets (say a single character typed during an interactive ssh logon) would not be a problem.
 
Old 03-30-2013, 02:39 PM   #5
Pearlseattle
Member
 
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 999

Rep: Reputation: 142Reputation: 142
Addendum:
btw, no clue about openvpn (never used it), but at least with ssh if you're using (especially on the side which performs the compression) a recent intel cpu, then you can tell ssh to use one of the algorithms that use the hw-acceleration of your cpu. Did some tests a few months ago and my transfer rate doubled (if i can remember correctly).
will check during the next days what was the exact option i used (as usual I thought "I'll write it down", but of course I didn't).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] xz compression questions NightSky Slackware 3 06-12-2010 09:52 PM
OpenVPN questions Galaxy_Stranger Linux - Software 3 09-13-2009 01:32 PM
Slax with SquashFS-4 new compression algorithm and layered compression ratios? lincaptainhenryjbrown Linux - Software 2 06-19-2009 05:29 PM
Enable compression levels on openVPN Buddhike G Linux - Software 0 02-14-2008 02:44 AM
noob openvpn questions babag Linux - Networking 5 07-10-2006 11:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration