<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Why is something so slow over a VPN connection?</title>
	<atom:link href="http://projectdream.org/wordpress/2007/03/20/why-is-something-so-slow-over-a-vpn-connection/feed/" rel="self" type="application/rss+xml" />
	<link>http://projectdream.org/wordpress/2007/03/20/why-is-something-so-slow-over-a-vpn-connection/</link>
	<description>The experiences of an SMB IT technician</description>
	<lastBuildDate>Mon, 16 Aug 2010 07:18:16 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Alexandre Gauthier</title>
		<link>http://projectdream.org/wordpress/2007/03/20/why-is-something-so-slow-over-a-vpn-connection/comment-page-1/#comment-4930</link>
		<dc:creator>Alexandre Gauthier</dc:creator>
		<pubDate>Thu, 01 Jul 2010 07:27:48 +0000</pubDate>
		<guid isPermaLink="false">http://projectdream.org/wordpress/2007/03/20/why-is-something-so-slow-over-a-vpn-connection/#comment-4930</guid>
		<description>Hi, just landed here while searching for a solution to a rather weird OpenVPN issue I have on Windows 7 x64, which has been driving me nuts. The answer is not in here, sadly, but since the OpenVPN documentation is uh... well, scarce, ever since they went commercial, I thought I might be able to shed some light on some questions raised in the comments so far. 

If you&#039;re using OpenVPN and are having terrible latency issues, I&#039;d suspect the transport.

OpenVPN can be configured to tunnel over TCP or UDP. In fact this also applies to any VPN solution that involves TCP as the transport layer. OpenVPS AS apparently defaults to TCP in the generated client configuration files, or at least in my case it did. Encapsulating TCP over TCP usually results in horrible performance the second some mild packet loss starts to occur -- or worse, was already occurring before you established a TCP connection through the VPN -- due to TCP&#039;s congestion control mechanisms. In fact this is most likely to occur whenever you really start to /use/ the VPN instead of just pinging hosts and going OH IT WORKS, MISSION ACCOMPLISHED. (I&#039;d hardly call 30 bytes in an icmp echo request a stress test).

Since the encapsulated TCP (your vpn link) and the transport TCP (your actual connection) are both blissfully unaware of each other, there may (and in fact almost always will) be some... well, dimorphism between them, in regard to control timers and retransmission rates.

It sort of creates a chain reaction where the moment your transport connection or some upstream router coughs a bit mid sentence or trips on its shoelace -- woops -- and starts dropping packets. TCP notices the sudden change in rate and increases its timeout values as to not suddenly sever the connection. Which is the entire point of TCP -- ensuring delivery at all costs.

Meanwhile the encapsulated TCP, who has no clue that it is being forced into a payload against its will, just notices a sudden eerie silence where its not receiving jack squat, since the transport TCP is waiting /longer/ than before to adapt to the packet loss. This results in the encapsulated TCP /also/ worrying about the well being of its ACKs and increasing its timeout values. However, it will most likely lower them slightly /less/ so than the transport TCP, because, after all, that connection was just established from its perspective, and it is unaware of the fact that your transport TCP has been downloading your mail for quite a while before you moved on to downloading all these files off the CIFS server at work. 

This effectively means that the encapsulated TCP layer will end up queuing retransmissions faster than the transport layer is willing to retransmit them, which makes the encapsulated layer increase its timeout values even more so every time, which results in everything stalling rather abruptly ever five seconds. It often just snowballs up from there and eventually results in you throwing your laptop against the wall.

Long story short -- if you&#039;re using TCP as a transport protocol for your VPN, switch over to UDP.
UDP is stateless, and does no error checking. It&#039;s like sending a postcard instead of a registered letter. But that doesn&#039;t matter, since the encapsulated TCP inside will take care of all that. This results in a tremendous performance boost.

Now, regarding the MTU (which as you probably know is the maximum length of a data unit a protocol can send in one shot, without fragmenting), default MTU for Ethernet is 1500. However you must account for the overhead encapsulation generates. VPNs most often send their transport packets with the do not fragment bit set, it makes things simpler for the encapsulated TCP, and prevents needless retransmission. This means that the MTU of your virtual interface must be smaller than the MTU of your ethernet card, to make room for the outer packet. In fact, optimally, it should be exactly

      Max Payload Size without headers - encryption overhead = target MTU.

*Most* VPNs account for this and set it dynamically. Depending on the OS and available system calls, they might use Path MTU Discovery to figure it out and enforce the DNF bit. However some misinformed firwall admins who think ICMP is dangerous sometimes disable that, which can result in horrors. That or you are running TCP/IP over some exotic layer 2 physical media, like carrier pigeon, firewire, CSU/DSU Serial or /some/ DSL lines and something is configured wrong. If you just went &quot;Ooooh&quot; and suddenly realized this explains why you couldn&#039;t reach /some/ sites, well, yes. Fix your MTU. You&#039;re not alone, we all went there once or twice. Less so today, because of PMTU. But as a general rule, if you can&#039;t send 1500 bytes with ping through your link, and all the computers are ethernet based, things will probably get ugly unless you configure it properly. 

So, often, tweaking the MTU values for the VPN interface and/or in the VPN itself (this is very software-dependent) can bring a tremendous performance boost as well. Larger MTU is more efficient -- but if your link is unreliable, a single bit that is wrong in a packet means the entire thing must be sent all over again. Packet loss also affects this for the same reason. In such cases, a lower MTU would bring out a better performance. 

The main problem usually lands when you start working with various ATM encapsulated transports (namely xDSL lines) that use various breeds of PPPoE, PPPoA or (rarely) something else entirely, which are all various layers of encapsulation (packets within datgrams within packets within frames within...) which all result in some overhead and a rather exotic looking MTU, often closer to 1400 than 1500 to account for the padding. Normally, good routers handle all of this automagically for machines behind NATs, but it still results in some overhead. If you add the VPN on top of that, it is often going to be slow -- which brings this blog post and the questions asked in the comments together.

Modern, non-crappy VPNs handle this dynamically with PMTU, to determine what&#039;s the maximum transmission unit they can send without it barfing all over the place, but if it&#039;s broken somehow, or your vpn doesn&#039;t do PMTU, and your weird ISP specific software PPPoE DSL link has a MTU of 1452 while the virtual interface is configured to do 1500, and your VPN defaults at 1300 to account for the overhead... well, you will encounter trouble.

As a test you might want to tweak these values and slowly increase them as high as they will go without breaking, or switch to a better VPN that does PMTU. That will clear most issues but it will most likely still result in less than stellar performance. You might just want to get a better link if it becomes a constant problem even with tweaking.

I hope this at least helped someone, somehow. Now back to trying to figure out why I get horrible latency (&gt;500ms) on OpenVPN over TCP on a 30 megabits link to a 10 megabits link /but only in Windows 7/. Everything else works fine and I&#039;m grasping at straws. I&#039;ll pester the local admin at this one workplace to switch to UDP but it still doesn&#039;t _explain_ it, and it will bug be forever. Urgh.</description>
		<content:encoded><![CDATA[<p>Hi, just landed here while searching for a solution to a rather weird OpenVPN issue I have on Windows 7 x64, which has been driving me nuts. The answer is not in here, sadly, but since the OpenVPN documentation is uh&#8230; well, scarce, ever since they went commercial, I thought I might be able to shed some light on some questions raised in the comments so far. </p>
<p>If you&#8217;re using OpenVPN and are having terrible latency issues, I&#8217;d suspect the transport.</p>
<p>OpenVPN can be configured to tunnel over TCP or UDP. In fact this also applies to any VPN solution that involves TCP as the transport layer. OpenVPS AS apparently defaults to TCP in the generated client configuration files, or at least in my case it did. Encapsulating TCP over TCP usually results in horrible performance the second some mild packet loss starts to occur &#8212; or worse, was already occurring before you established a TCP connection through the VPN &#8212; due to TCP&#8217;s congestion control mechanisms. In fact this is most likely to occur whenever you really start to /use/ the VPN instead of just pinging hosts and going OH IT WORKS, MISSION ACCOMPLISHED. (I&#8217;d hardly call 30 bytes in an icmp echo request a stress test).</p>
<p>Since the encapsulated TCP (your vpn link) and the transport TCP (your actual connection) are both blissfully unaware of each other, there may (and in fact almost always will) be some&#8230; well, dimorphism between them, in regard to control timers and retransmission rates.</p>
<p>It sort of creates a chain reaction where the moment your transport connection or some upstream router coughs a bit mid sentence or trips on its shoelace &#8212; woops &#8212; and starts dropping packets. TCP notices the sudden change in rate and increases its timeout values as to not suddenly sever the connection. Which is the entire point of TCP &#8212; ensuring delivery at all costs.</p>
<p>Meanwhile the encapsulated TCP, who has no clue that it is being forced into a payload against its will, just notices a sudden eerie silence where its not receiving jack squat, since the transport TCP is waiting /longer/ than before to adapt to the packet loss. This results in the encapsulated TCP /also/ worrying about the well being of its ACKs and increasing its timeout values. However, it will most likely lower them slightly /less/ so than the transport TCP, because, after all, that connection was just established from its perspective, and it is unaware of the fact that your transport TCP has been downloading your mail for quite a while before you moved on to downloading all these files off the CIFS server at work. </p>
<p>This effectively means that the encapsulated TCP layer will end up queuing retransmissions faster than the transport layer is willing to retransmit them, which makes the encapsulated layer increase its timeout values even more so every time, which results in everything stalling rather abruptly ever five seconds. It often just snowballs up from there and eventually results in you throwing your laptop against the wall.</p>
<p>Long story short &#8212; if you&#8217;re using TCP as a transport protocol for your VPN, switch over to UDP.<br />
UDP is stateless, and does no error checking. It&#8217;s like sending a postcard instead of a registered letter. But that doesn&#8217;t matter, since the encapsulated TCP inside will take care of all that. This results in a tremendous performance boost.</p>
<p>Now, regarding the MTU (which as you probably know is the maximum length of a data unit a protocol can send in one shot, without fragmenting), default MTU for Ethernet is 1500. However you must account for the overhead encapsulation generates. VPNs most often send their transport packets with the do not fragment bit set, it makes things simpler for the encapsulated TCP, and prevents needless retransmission. This means that the MTU of your virtual interface must be smaller than the MTU of your ethernet card, to make room for the outer packet. In fact, optimally, it should be exactly</p>
<p>      Max Payload Size without headers &#8211; encryption overhead = target MTU.</p>
<p>*Most* VPNs account for this and set it dynamically. Depending on the OS and available system calls, they might use Path MTU Discovery to figure it out and enforce the DNF bit. However some misinformed firwall admins who think ICMP is dangerous sometimes disable that, which can result in horrors. That or you are running TCP/IP over some exotic layer 2 physical media, like carrier pigeon, firewire, CSU/DSU Serial or /some/ DSL lines and something is configured wrong. If you just went &#8220;Ooooh&#8221; and suddenly realized this explains why you couldn&#8217;t reach /some/ sites, well, yes. Fix your MTU. You&#8217;re not alone, we all went there once or twice. Less so today, because of PMTU. But as a general rule, if you can&#8217;t send 1500 bytes with ping through your link, and all the computers are ethernet based, things will probably get ugly unless you configure it properly. </p>
<p>So, often, tweaking the MTU values for the VPN interface and/or in the VPN itself (this is very software-dependent) can bring a tremendous performance boost as well. Larger MTU is more efficient &#8212; but if your link is unreliable, a single bit that is wrong in a packet means the entire thing must be sent all over again. Packet loss also affects this for the same reason. In such cases, a lower MTU would bring out a better performance. </p>
<p>The main problem usually lands when you start working with various ATM encapsulated transports (namely xDSL lines) that use various breeds of PPPoE, PPPoA or (rarely) something else entirely, which are all various layers of encapsulation (packets within datgrams within packets within frames within&#8230;) which all result in some overhead and a rather exotic looking MTU, often closer to 1400 than 1500 to account for the padding. Normally, good routers handle all of this automagically for machines behind NATs, but it still results in some overhead. If you add the VPN on top of that, it is often going to be slow &#8212; which brings this blog post and the questions asked in the comments together.</p>
<p>Modern, non-crappy VPNs handle this dynamically with PMTU, to determine what&#8217;s the maximum transmission unit they can send without it barfing all over the place, but if it&#8217;s broken somehow, or your vpn doesn&#8217;t do PMTU, and your weird ISP specific software PPPoE DSL link has a MTU of 1452 while the virtual interface is configured to do 1500, and your VPN defaults at 1300 to account for the overhead&#8230; well, you will encounter trouble.</p>
<p>As a test you might want to tweak these values and slowly increase them as high as they will go without breaking, or switch to a better VPN that does PMTU. That will clear most issues but it will most likely still result in less than stellar performance. You might just want to get a better link if it becomes a constant problem even with tweaking.</p>
<p>I hope this at least helped someone, somehow. Now back to trying to figure out why I get horrible latency (&gt;500ms) on OpenVPN over TCP on a 30 megabits link to a 10 megabits link /but only in Windows 7/. Everything else works fine and I&#8217;m grasping at straws. I&#8217;ll pester the local admin at this one workplace to switch to UDP but it still doesn&#8217;t _explain_ it, and it will bug be forever. Urgh.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: VPN Latency</title>
		<link>http://projectdream.org/wordpress/2007/03/20/why-is-something-so-slow-over-a-vpn-connection/comment-page-1/#comment-4809</link>
		<dc:creator>VPN Latency</dc:creator>
		<pubDate>Sun, 11 Apr 2010 02:17:40 +0000</pubDate>
		<guid isPermaLink="false">http://projectdream.org/wordpress/2007/03/20/why-is-something-so-slow-over-a-vpn-connection/#comment-4809</guid>
		<description>[...] Originally Posted by nico34   can anybody help me, or give me the gonfiguration to reduce my vpn latency, we are testing our new vpn connection and the latency gets up to 1000 to 2000 everytime we try to transfer files! I really need your help    Does that help? http://projectdream.org/wordpress/20...pn-connection/ [...]</description>
		<content:encoded><![CDATA[<p>[...] Originally Posted by nico34   can anybody help me, or give me the gonfiguration to reduce my vpn latency, we are testing our new vpn connection and the latency gets up to 1000 to 2000 everytime we try to transfer files! I really need your help    Does that help? <a href="http://projectdream.org/wordpress/20...pn-connection/" rel="nofollow">http://projectdream.org/wordpress/20&#8230;pn-connection/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Kamungu</title>
		<link>http://projectdream.org/wordpress/2007/03/20/why-is-something-so-slow-over-a-vpn-connection/comment-page-1/#comment-4513</link>
		<dc:creator>Jeff Kamungu</dc:creator>
		<pubDate>Tue, 08 Dec 2009 13:19:34 +0000</pubDate>
		<guid isPermaLink="false">http://projectdream.org/wordpress/2007/03/20/why-is-something-so-slow-over-a-vpn-connection/#comment-4513</guid>
		<description>hi,
according to my internet provider am on a corporate line with a minimum speed of 64kbps.can vpn work properly with such a speed?</description>
		<content:encoded><![CDATA[<p>hi,<br />
according to my internet provider am on a corporate line with a minimum speed of 64kbps.can vpn work properly with such a speed?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon Bannister</title>
		<link>http://projectdream.org/wordpress/2007/03/20/why-is-something-so-slow-over-a-vpn-connection/comment-page-1/#comment-4460</link>
		<dc:creator>Simon Bannister</dc:creator>
		<pubDate>Tue, 17 Nov 2009 15:36:32 +0000</pubDate>
		<guid isPermaLink="false">http://projectdream.org/wordpress/2007/03/20/why-is-something-so-slow-over-a-vpn-connection/#comment-4460</guid>
		<description>Can you explain a little more about the MTU issue as well. Tried pinging and did not get a response but in normal operation I did. 

Thanks in advance. 

S.</description>
		<content:encoded><![CDATA[<p>Can you explain a little more about the MTU issue as well. Tried pinging and did not get a response but in normal operation I did. </p>
<p>Thanks in advance. </p>
<p>S.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://projectdream.org/wordpress/2007/03/20/why-is-something-so-slow-over-a-vpn-connection/comment-page-1/#comment-3200</link>
		<dc:creator>John</dc:creator>
		<pubDate>Fri, 09 Jan 2009 12:18:46 +0000</pubDate>
		<guid isPermaLink="false">http://projectdream.org/wordpress/2007/03/20/why-is-something-so-slow-over-a-vpn-connection/#comment-3200</guid>
		<description>We&#039;ve got remote offices and 500ms ping can ruin remote applications.  The first thing I realized when troubleshooting a particular case was that his upload speed was 125kbps which is really impossible for any corporate vpn with M$ products.  

Please elaborate on how MTU can improve vpn service?  I&#039;m using openvpn as an alternative but I&#039;m not really sure if the problem is in the vpn software or the actual connection (could a particular router hardware vpn brand improve performance?)</description>
		<content:encoded><![CDATA[<p>We&#8217;ve got remote offices and 500ms ping can ruin remote applications.  The first thing I realized when troubleshooting a particular case was that his upload speed was 125kbps which is really impossible for any corporate vpn with M$ products.  </p>
<p>Please elaborate on how MTU can improve vpn service?  I&#8217;m using openvpn as an alternative but I&#8217;m not really sure if the problem is in the vpn software or the actual connection (could a particular router hardware vpn brand improve performance?)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pravin</title>
		<link>http://projectdream.org/wordpress/2007/03/20/why-is-something-so-slow-over-a-vpn-connection/comment-page-1/#comment-2343</link>
		<dc:creator>Pravin</dc:creator>
		<pubDate>Fri, 06 Jun 2008 07:16:58 +0000</pubDate>
		<guid isPermaLink="false">http://projectdream.org/wordpress/2007/03/20/why-is-something-so-slow-over-a-vpn-connection/#comment-2343</guid>
		<description>Hi,

I&#039;m an IT manager of a small company in Mauritius and we are connecting via VPN to a company in Belgium. The company has asked to installed Oracle and also a GIS software. We are using an ADSL 1MB (UTM) and ping gives 500ms, is that normal because we are having a lot of trouble working, PC freezing, Oracle timeout.

Thx for your help.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I&#8217;m an IT manager of a small company in Mauritius and we are connecting via VPN to a company in Belgium. The company has asked to installed Oracle and also a GIS software. We are using an ADSL 1MB (UTM) and ping gives 500ms, is that normal because we are having a lot of trouble working, PC freezing, Oracle timeout.</p>
<p>Thx for your help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>http://projectdream.org/wordpress/2007/03/20/why-is-something-so-slow-over-a-vpn-connection/comment-page-1/#comment-1562</link>
		<dc:creator>James</dc:creator>
		<pubDate>Wed, 10 Oct 2007 13:07:32 +0000</pubDate>
		<guid isPermaLink="false">http://projectdream.org/wordpress/2007/03/20/why-is-something-so-slow-over-a-vpn-connection/#comment-1562</guid>
		<description>Hi, thank your for the information. 
Can you say a little more about MTU issue ? I understand what is MTU but I don&#039;t understand how I can modify the MTU when I&#039;m on VPN over UMTS.
thx</description>
		<content:encoded><![CDATA[<p>Hi, thank your for the information.<br />
Can you say a little more about MTU issue ? I understand what is MTU but I don&#8217;t understand how I can modify the MTU when I&#8217;m on VPN over UMTS.<br />
thx</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lukas Beeler</title>
		<link>http://projectdream.org/wordpress/2007/03/20/why-is-something-so-slow-over-a-vpn-connection/comment-page-1/#comment-1009</link>
		<dc:creator>Lukas Beeler</dc:creator>
		<pubDate>Sat, 26 May 2007 06:45:23 +0000</pubDate>
		<guid isPermaLink="false">http://projectdream.org/wordpress/2007/03/20/why-is-something-so-slow-over-a-vpn-connection/#comment-1009</guid>
		<description>We have no customers with superSDSL or VDSL links, so i can only comment on SDSL.

SDSL seems to be a bit faster, and if both SDSL links belong to the same ISP, latency is around 30ms. This is a lot better than ADSL, and even fat client applications should work with that. 

But this could be just for those links (Line Length, Equipment, Backbone are all factors here), i really lack enough input there because we don&#039;t have many customers with SDSL links.</description>
		<content:encoded><![CDATA[<p>We have no customers with superSDSL or VDSL links, so i can only comment on SDSL.</p>
<p>SDSL seems to be a bit faster, and if both SDSL links belong to the same ISP, latency is around 30ms. This is a lot better than ADSL, and even fat client applications should work with that. </p>
<p>But this could be just for those links (Line Length, Equipment, Backbone are all factors here), i really lack enough input there because we don&#8217;t have many customers with SDSL links.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jakob Magun</title>
		<link>http://projectdream.org/wordpress/2007/03/20/why-is-something-so-slow-over-a-vpn-connection/comment-page-1/#comment-1008</link>
		<dc:creator>Jakob Magun</dc:creator>
		<pubDate>Sat, 26 May 2007 06:37:45 +0000</pubDate>
		<guid isPermaLink="false">http://projectdream.org/wordpress/2007/03/20/why-is-something-so-slow-over-a-vpn-connection/#comment-1008</guid>
		<description>Can you comment on the latency of SDSL, superSDSL compared do ADSL, VSDL? We currently thinking on moving from ADSL to VDSL or SDSL. Our main application used over the will be a VPN.</description>
		<content:encoded><![CDATA[<p>Can you comment on the latency of SDSL, superSDSL compared do ADSL, VSDL? We currently thinking on moving from ADSL to VDSL or SDSL. Our main application used over the will be a VPN.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lukas Beeler</title>
		<link>http://projectdream.org/wordpress/2007/03/20/why-is-something-so-slow-over-a-vpn-connection/comment-page-1/#comment-336</link>
		<dc:creator>Lukas Beeler</dc:creator>
		<pubDate>Thu, 22 Mar 2007 06:47:15 +0000</pubDate>
		<guid isPermaLink="false">http://projectdream.org/wordpress/2007/03/20/why-is-something-so-slow-over-a-vpn-connection/#comment-336</guid>
		<description>They are ADSL/ADSL or ADSL/UMTS roundtrip values - not ADSL-Well Connected site.

They also assume a connection which is already in use, not an empty one.</description>
		<content:encoded><![CDATA[<p>They are ADSL/ADSL or ADSL/UMTS roundtrip values &#8211; not ADSL-Well Connected site.</p>
<p>They also assume a connection which is already in use, not an empty one.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ihsan Dogan</title>
		<link>http://projectdream.org/wordpress/2007/03/20/why-is-something-so-slow-over-a-vpn-connection/comment-page-1/#comment-334</link>
		<dc:creator>Ihsan Dogan</dc:creator>
		<pubDate>Wed, 21 Mar 2007 20:09:30 +0000</pubDate>
		<guid isPermaLink="false">http://projectdream.org/wordpress/2007/03/20/why-is-something-so-slow-over-a-vpn-connection/#comment-334</guid>
		<description>I&#039;ve got over ADSL a latency of 40ms and over UMTS 200-400ms (depends on the signal quality). How do you get to thos values?</description>
		<content:encoded><![CDATA[<p>I&#8217;ve got over ADSL a latency of 40ms and over UMTS 200-400ms (depends on the signal quality). How do you get to thos values?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
