Bosse_B
Posts: 631
Joined: Thu Jan 30, 2014 9:53 am

How to properly check transfer speed over OpenVPN?

Sat Nov 18, 2017 4:23 pm

I have set up an RPi3 as an OpenVPN server and placed it in Austin Texas behind a 150/150 Mbit/s fiber connection.
While traveling back home to Sweden I tested the performance by running the OOKLA Speedtest App on my Samsung Galaxy S7 phone as follows:
1) When I was connected to United's WiFi in the Austin Airport
Speedtest reported:
80/79 MBit/s when not using VPN
36/46 MBit/s through OpenVPN
So this indicated a pretty good performance for the RPi3 VPN.

2) Now when I am back in Sweden and the phone is connected to my 250/100 Mbit/s fiber system I get this:
Speedtest reported:
350/141 MBit/s when not using VPN (= my local fiber connection)
8/7 MBit/s through OpenVPN....
A pretty dismal figure via VPN given the speed of my Internet connection.
I noted that in the Speedtest window the test server was set to Tele2 in Kista (which is located in Sweden) in both cases!

This brings up my suspicion that some information about the speedtest operation can leak outside of the VPN tunnel and therefore it tries to use a very remote server for its testing? The idea with a VPN tunnel is to cloak the location of the user system to be at the location of the VPN server and this seems not to work in this case. It should use a server located in Texas for the test which it did when I was at the Austin Airport.

Hence my question about how to best test the actual VPN speed in a situation like this?
Is there some other way than utilizing the transfer speed tests available on the Internet?
Bo Berglund
Sweden

Heater
Posts: 8095
Joined: Tue Jul 17, 2012 3:02 pm

Re: How to properly check transfer speed over OpenVPN?

Sat Nov 18, 2017 4:57 pm

How about the obvious things?

Just copy a big file from your local machine to a target machine through your VPN and see how long it takes. And vice-versa.

Or use netcat to move a lot of bytes from /dev/urandom from remote to local and vice-versa.

Bosse_B
Posts: 631
Joined: Thu Jan 30, 2014 9:53 am

Re: How to properly check transfer speed over OpenVPN?

Sat Nov 18, 2017 5:29 pm

Heater wrote:
Sat Nov 18, 2017 4:57 pm
How about the obvious things?
Just copy a big file from your local machine to a target machine through your VPN and see how long it takes. And vice-versa.
It is not at all easy to move a file like you describe when working on a phone...
If I move a large file to the RPi3 OpenVPN server then it will be speed limited by the SDCard on the Pi....
Or use netcat to move a lot of bytes from /dev/urandom from remote to local and vice-versa.
This I do not understand.
Could you be a little more specific?
Does this get arounf the SDcard write speed limitation?
I would like to know the capacity of the RPi3 OpenVPN system to relay data rather than find out the write speed the RPi3 is capable of.
Bo Berglund
Sweden

Bosse_B
Posts: 631
Joined: Thu Jan 30, 2014 9:53 am

Re: How to properly check transfer speed over OpenVPN?

Sun Nov 19, 2017 10:44 am

Today I did the following tests:
1) Speed reference
I connected to my web hosting service using FileZilla on my Win7 PC at home.
This means that I am accessing the server in Stockholm from a fiber connection in the Stockholm area.
Downloaded a 320 MB zipfile from my webserver at 25 Mbytes/s (some 200 Mbit/s)

2) OpenVPN tests

2.1 Traffic through VPN tunnel
Now I connected a VPN tunnel to my OpenVPN server in Austin TX.
Using the same Filezilla on my PC as above I downloaded the same zipfile again, but now the speed dropped to about 0.5 Mbytes/s a drop by factor 50.
Now the ftp traffic passes the Atlantic Ocean twice (one time via the VPN tunnel).

2.2 No FTP traffic through VPN tunnel
Next I connected a Remote Desktop session via the OpenVPN tunnel to a Windows 2016 Server on the remote network.
Then I used FileZilla on that computer to download again the same file but now to the remote computer.
Now the ftp traffic only passes the Atlantic Ocean once (from Stockholm to Austin). No VPN tunnel involved with FTP.

This time I reached about 0.6-0.7 Mbytes/s, the difference from the previous test is probably because the data did not pass the VPN tunnel.
In this test I assume that all download traffic was between the website server and the computer in Austin, nothing passing through the VPN tunnel except screen updates for the desktop.

What happened?
This really indicates that there is a considerable drop in speed when talking to a server in Sweden from Texas even though the Inernet interface in Austin is said to be capable of 150/150 Mbit/s...

Could there be fiber connections in the USA, which have speed ratings that only apply when accessing local resources in the immediate vicinity of the fiber connection? Say, only giving this speed towards locations in Texas?

I would never have thought this to be the case until I did these tests...

When I download installation packages from Microsoft, VMWare and Embarcadero I see transfer speeds compatible with my own fiber connection so I guess that the Atlantic transfers are not really the issue here. Could it be a scam from the ISP supplier in Austin?

And any suggestions on how I can really check the performance of an RPi3 hosted OpenVPN server?
Right now it looks like my only indicator is the test I did using my phone at Austin Airport via the WiFi there where I saw about 35-45 Mbit/s transfers...
Bo Berglund
Sweden

Heater
Posts: 8095
Joined: Tue Jul 17, 2012 3:02 pm

Re: How to properly check transfer speed over OpenVPN?

Sun Nov 19, 2017 12:04 pm

What are we trying to measure the speed of here? The VPN, the ISPs, the transatlantic connection, the cellular network to your phone, the speed of reading writing files to SD at each end? Or perhaps the whole chain end to end?

netcat can be used to set up TCP/IP connections. Data received can be thrown into the device /dev/null. This eliminates any speed limitations of writing actual files thus allowing raw network speed to be measured.

For example at one end we run a TCP/IP listener:

netcat -l 8000 > /dev/null

This will listen on port 8000 for any incoming connections and throw any received bytes away.

Meanwhile at the other end we can make a TCP/IP connection:

netcat a.b.c.f 8000 < /dev/urandom

This will connected to our listener on address a.b.c.d and start sending it random bytes from /dev/urandom. urandom is a fast source of bytes, no reading from slow files or whatever.

Whist all that is going on we can check the speed by looking at the output of /sbin/ifconfig which will show transmitted and received bytes.

There are many blogs about using netcat around. For example:

https://www.g-loaded.eu/2006/11/06/netc ... -examples/

Check also the net can man page.


I have no idea about your ISP in Texas. Only that network connectivity in the USA is terrible. Even in the middle of Silicon Valley (Mountain View) during the summer our internet connection was slow and unreliable. Their cellular connectivity is even worse. Compared to Northern Europe it's positively prehistoric.

epoch1970
Posts: 1153
Joined: Thu May 05, 2016 9:33 am

Re: How to properly check transfer speed over OpenVPN?

Sun Nov 19, 2017 12:42 pm

Not all interconnections are equal, you may be unlucky. If you "traceroute" between your Stockholm office and the router in Austin you should see how many hops there are on the way and get a hint at where is bottleneck is.

I think speedtest.net is a good way to get the general picture by comparing downloads from various servers in the geographical area you're interested in. Perhaps you want to run speedtest on the Austin server via remote desktop and see how that bit of the Internet is connected to the rest of it.
If performance to continental Europe is always poor, try to ask a colleague to test the same destinations from his own Internet connection at home, results can differ from ISP to ISP.

This Internet thing is a mess. We need Pi-OnLine :)
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Bosse_B
Posts: 631
Joined: Thu Jan 30, 2014 9:53 am

Re: How to properly check transfer speed over OpenVPN?

Sun Nov 19, 2017 2:01 pm

epoch1970 wrote:
Sun Nov 19, 2017 12:42 pm
Not all interconnections are equal, you may be unlucky. If you "traceroute" between your Stockholm office and the router in Austin you should see how many hops there are on the way and get a hint at where is bottleneck is.
This is what I get:

Code: Select all

  1    <1 ms    <1 ms    <1 ms  asus-main [192.168.119.1]
  2    <1 ms    <1 ms    <1 ms  gw4.A176.priv.bahnhof.se [85.24.202.1]
  3     1 ms     1 ms     1 ms  zitius-stockholm-A176-gw.bahnhof.net [85.24.152.6]
  4     1 ms     1 ms     1 ms  sto-cr1.sto-cr3.bahnhof.net [46.59.112.163]
  5     1 ms     1 ms     1 ms  s-b5-link.telia.net [62.115.35.122]
  6     2 ms     1 ms     1 ms  s-bb4-link.telia.net [62.115.114.164]
  7    10 ms    10 ms    10 ms  kbn-bb4-link.telia.net [62.115.120.58]
  8   101 ms   101 ms   100 ms  nyk-bb4-link.telia.net [80.91.254.91]
  9   100 ms   101 ms   100 ms  nyk-b5-link.telia.net [80.91.254.14]
 10    97 ms    99 ms    99 ms  192.205.34.53
 11   149 ms   151 ms   147 ms  cr2.n54ny.ip.att.net [12.122.130.110]
 12   149 ms   150 ms   150 ms  cr2.wswdc.ip.att.net [12.122.28.42]
 13   143 ms   143 ms   142 ms  cr1.attga.ip.att.net [12.122.2.29]
 14   140 ms   138 ms   138 ms  cr2.dlstx.ip.att.net [12.122.2.110]
 15   148 ms   150 ms   151 ms  cr81.auttx.ip.att.net [12.122.100.118]
 16   137 ms   137 ms   137 ms  ggr1.dlstx.ip.att.net [12.122.139.189]
 17   147 ms   147 ms   147 ms  12.246.67.162
 18     *        *        *     Request timed out
I think speedtest.net is a good way to get the general picture by comparing downloads from various servers in the geographical area you're interested in. Perhaps you want to run speedtest on the Austin server via remote desktop and see how that bit of the Internet is connected to the rest of it.
I hooked up to 3 different servers on the Austin office via RDP, then ran speedtest.net through Chrome on them:
Server 1 (old W2003 server): 140/40 towards 3 different servers in Austin and Huntsville.
Server 2 (W2012 file server): 110/130 against two servers in Austin and Huntsville.
Server 3 (W2016 new server): 40-45/80-100 against the same servers
So each generation Windows servers seem to go slower and slower...
All are virtual machines in the same VMWare infrastructure box.
If performance to continental Europe is always poor, try to ask a colleague to test the same destinations from his own Internet connection at home, results can differ from ISP to ISP.
This Internet thing is a mess. We need Pi-OnLine :)
I could not force speedtest to use a server in Europe, so could not test this.

I guess there is no way to really test the performance of the RPi3 OpenVPN in such a situation as is evident in the USA.
And I did not know that the Internet connections in USA could be this bad....
Bo Berglund
Sweden

epoch1970
Posts: 1153
Joined: Thu May 05, 2016 9:33 am

Re: How to properly check transfer speed over OpenVPN?

Sun Nov 19, 2017 4:54 pm

I ran traceroute against 12.246.67.162 from my site (Orange network, Paris FR), things started jolly well with 5ms latency around Paris. Then I got dismal results when hoping into opentransit.net.

Code: Select all

 5  ae41-0.niidf102.Aubervilliers.francetelecom.net (193.252.159.46) [*]  5.541 ms  4.875 ms
 6  193.252.137.10 (193.252.137.10) [*]  10.998 ms  3.121 ms  3.051 ms
 7  tengige0-8-0-4.ashtr2.ashburnva.opentransit.net (193.251.129.61) [AS5511]  90.741 ms
 8  192.205.36.129 (192.205.36.129) [*]  88.447 ms  88.506 ms  88.383 ms
 9  cr1.wswdc.ip.att.net (12.122.113.38) [AS7018]  129.728 ms  129.788 ms  130.739 ms
10  cr2.sl9mo.ip.att.net (12.122.18.29) [AS7018]  133.833 ms  133.731 ms  133.681 ms
Opentransit belongs to Orange and operates in Ashburn, VA. Might belong to Orange, might be a "10 gigE" router, nevertheless latency jumps to 90ms (another test showed 600ms!) at that point. Then entrance over AT&T territory increases latency even more.

It looks like Telia doesn't fare better, it's fine up to Copenhagen (kbn-bb4-link.telia.net) and the trip to New-York City (nyk-bb4-link.telia.net) is costly. Interconnection with AT&T might be a bit dodgy too.
I guess there is no way to really test the performance of the RPi3 OpenVPN in such a situation as is evident in the USA.
If you want to test the max speed of OVPN on a Pi, run a tunnel over a LAN. (And you should see 30-40 mbps through the tunnel.)

Bosse_B
Posts: 631
Joined: Thu Jan 30, 2014 9:53 am

Re: How to properly check transfer speed over OpenVPN?

Sun Nov 19, 2017 11:39 pm

Made some more tests....
I did a number of tests from Stockholm using various available speed testing tools, and what I found is that my speed is super (260/120) for the servers I could select in the northern Europe region (Sweden, Finland, Estonia).
Also testing against Atlanta, Georgia and Stanford, CA gave good results (230/95).
So the Atlantic traverse is not an issue here.

But I could not select any test server in Texas, let alone Austin, so I guess the test companies are hiding the low speed connection between the Austin area and the rest of the world....
If you want to test the max speed of OVPN on a Pi, run a tunnel over a LAN. (And you should see 30-40 mbps through the tunnel.)
Doing the local LAN OpenVPN test requires me to set up another RPi3 with the same configuration as the one in Austin, which will take some time.
And then I don't really understand how it would work...
My PC is on my LAN as is the RPi3. If I try to connect my PC to OpenVPN on my RPi3 then how would that work out?
If I change the OVPN file for the connection to use a local IP address as server, then would I not get a "short circuit" in my LAN?
Bo Berglund
Sweden

Bosse_B
Posts: 631
Joined: Thu Jan 30, 2014 9:53 am

Re: How to properly check transfer speed over OpenVPN?

Mon Nov 20, 2017 9:23 am

I hooked up an old TP-Link router on another fiber connection and connected my phone to that.
Then I tested throughput using a copy of the Austin RPi3 set up here on my home LAN.
Result is that I get about 55/59 MBit/s for these tests with OpenVPN connected and 65/70 without VPN.
So it seems like the RPi3 OpenVPN server is capable of handling about 50-60 Mbit/s traffic.

Pretty good for such a small unit.
Bo Berglund
Sweden

Return to “Networking and servers”

Who is online

Users browsing this forum: noah233 and 18 guests