 Tom here from Orange Systems and a question that comes up a lot is why are my file transfers so slow over a VPN? Too long didn't watch. SMB protocol was not designed for high latency connections. Essentially server message block has gone through several versions and iterations and each one they've made some improvements but those improvements still don't escape the fact that it server message block protocol message block protocol that has a acknowledgement back and forth as the data transfers. Therefore any high latency causes a big slowdown. I want to demonstrate that really quickly with a file transfer test. We're going to do the first test with low latency and a second test with just a little bit of latency added that you may see over a standard VPN connection. For demonstration I'm going to be using Linux but this is all about the protocol. It's not about which operating system. Linux is just making it easier for me to display the statistics for the transfer. We're going to be moving a file to this particular SMB 3.0 mount. So 192.168.1.8 and it's mounted under mount demo. The first thing we actually want to do is ping this. So if we go ahead and go ping and we can see we're getting about quarter millisecond averages. So sometimes you're going to see a ping a little bit higher because I am routing it through a firewall and that's how we're going to introduce the latency. Also routing SMB through the firewall not the best idea in terms of looking for the best transfer speeds same rules apply. Once we add latency we add problems but right now we're on a low latency connection. Low averages right here for our latency on this and that's going to make the transfer relatively fast. I have a file that's about 2.7 gigs and we're going to use rsync to copy that file and see how long it takes to copy. So here's the rsync copying via AVRHI dash dash progress dash dash dash videos demo data to mount demo and it's transferring at about 113 megs a second here and takes less than about 21 22 seconds just under 30 seconds to get this file transferred across to where it needs to be. So we'll leave these statistics here and here we go. So an average of 108 megabytes a second and the file took 21 seconds to transfer. Now let's go ahead and introduce some latencies. We're going to split the screen here move it up leave that one set at the top and we're going to open up another ping command and it's at low latency and then I'm going to apply a limiter to add 30 seconds of latency. So it's still a reasonably fast connection but this is what you may see over a different VPN. Well now we're at about 29 30 milliseconds of latency. The only thing we're going to do now is do that same file transfer again that we just did. So first we got to remove our mount demo TrueNAS. All right. So we got rid of that. Let's go ahead and run that rsync again and by just doing this change we've now substantially slowed down the file transfer back to being server message block it's got to do these blocks back and forth to do confirmation. So we went from something that was taking 20 seconds to it's going to take about a minute to get this file all the way transferred over there and that's just with that little bit of latency we added. This is no packet loss the bandwidth remains the same we can even if we wanted to do an eye perf test between these systems and see that we still have full bandwidth there's a little delay added to the packets that delay is where the problem is. So it's still you know we're all the way down here to 31 if we move back up a little bit we were at 108 over here and as I said 21 seconds to transfer we're already over the 21 seconds now just when that small amount of latency in there. Now when you get VPNs of any type going there's always going to be those extra hops that are in between between where you are and the remote system. So matter if you're using something like tail scale wire guard or any other VPN protocol zero tier all the different ones I've covered on my channel they all have slight optimizations that may work slightly faster but the easiest way to check of whether or not you're going to have a slow transfer problem is to simply take the device you're connecting from and the server you're connecting to and ping it and see what that latency is once you get anything over the millisecond in is the demo here we're only adding 30 milliseconds there so still not a lot of latency something you may see common across there you can notice that the SMB protocol slows down substantially and you may find some articles from Microsoft about you know them revamping it to work over WAN this is the version revamped to work over WAN it used to be worse so hopefully this saves you some trouble before you bang your head trying to tune in or just a lot of settings to really find the fundamental problem being the SMB protocol just doesn't work over high latency connections this question comes up all the time that's why I made this video to hopefully save some people some trouble or have me simply reply with this video want to know why their VPN couldn't transfer a speed test really fast but can't do a simple file transfer with any real speed and thank you for making it all the way to the end of this video if you've enjoyed the content please give us a thumbs up if you would like to see more content from this channel hit the subscribe button and the bell icon if you'd like to hire a short project head over to laurancesystems.com and click the hires button right at the top to help this channel out in other ways there's a join button here for youtube and a patreon page where your support is greatly appreciated for deals discounts and offers check out our affiliate links in the description of all of our videos including a link to our shirt store where we have a wide variety of shirts that we sell and designs come out well randomly so check back frequently and finally our forums forums.laurancesystems.com is where you can have a more in-depth discussion about this video and other tech topics covered on this channel thanks again for watching and look forward to hearing from you