OpenVPN / openvpn-build

OpenVPN Build
325 stars 239 forks source link

Bug Report: Heavy Performance Limitation with TAP Adapter in OpenVPN on Windows 7 #378

Closed Avnsx closed 1 year ago

Avnsx commented 1 year ago

Hello there,

I recently went through the changelog of OpenVPN and noticed your continued effort to support Windows 7 by updating the tap-windows drivers with new signatures in the latest versions of OpenVPN in 2023. I find this commitment commendable!

Personally, I am using OpenVPN on Windows 7 64-bit Professional Build 7601 SP 1 and have been encountering a persistent bug that hasn't been addressed for the past eight years. You can find a detailed explanation of the issue I & others have been facing at this link: https://community.openvpn.net/openvpn/ticket/603

Even though the TAP adapter has been updated to version 9.24 over the years, I'm still experiencing the exact same bug described in the aforementioned ticket, even with OpenVPN version 2.6.5 (and any prior version).

I understand that Windows 7 is an outdated operating system, and I don't want to come across as annoying. However, I was wondering if it might be possible to address this long-standing bug in one of the upcoming versions of OpenVPN. I would be immensely grateful and more than willing to assist in testing or any other way to contribute towards resolving this issue.

In my specific use case, the security of the connection is irrelevant. Therefore, I have spent several hours meticulously testing various OpenVPN settings in combination with a detailed speed test tool in hopes of resolving the TAP adapter issue. After extensive testing, the only configuration that seemed to improve the connection performance a little was setting proto udp along with these additional config options:

# these options help with the max connection speed limitation, without these I average 5 mb up/down
# with these options both spike up to 20 mb (my true internet connection is 110 down / 40 up)
sndbuf 8192
rcvbuf 8192

# greatly stabilizes connection speed consistency & jitter
# but doesn't fix random ping spikes up to 200 while continous use of the connection
allow-compression yes 
compress lz4
tun-mtu 1500

Here you can find my whole config file: https://pastebin.com/raw/TdK8N8sf Here's what I can see in the openvpn log during the unstable connection on windows 7: https://pastebin.com/raw/ahVCqs72

After thorough investigation, I am now completely confident that the problem I am encountering is directly linked to the compatibility of the TAP drivers with Windows 7, rather than being related to the VPN provider I am using. This conclusion is supported by the fact that I am only facing the issue when running Windows 7 within a virtual machine and tested with multiple VPN providers all resulting in the same bad connection. However, when I utilize the same OpenVPN version 2.6.5 on my host operating system, such as Windows 11 (or windows 10), I can fully utilize my network connection without any limitations. In this scenario, I am able to achieve the maximum download speed of 110 Mbps and upload speed of 40 Mbps, experiencing no mentionable jitter or ping lag whatsoever.

Thank you for any assistance you may provide in resolving this persistent bug.

Kind Regards Mika C.

Avnsx commented 1 year ago

Just additionally tested with the TUN adapter, it seems to also limit my connection to about 20 mbit up / down except my ping is constantly very low, I barely have any network jitter (even without having to use compression) and the connection seems very reliable.

Not sure what is going on though with both adapters limiting the max connection bandwith.

TinCanTech commented 1 year ago

I have just tested a Windows-7 client using TAP6, which Windows reports as version 9.24.6.601. My download speed is 3.2MB (Megabytes) per second. This is exactly the speed which I expect.

lstipakov commented 1 year ago

If you need a good performance I suggest to upgrade to at least Windows 10 20H1 and use dco-win driver. For Windows 7 you might want to try --windows-driver wintun.

cron2 commented 1 year ago

The TAP6 driver is known to be slow (and sensitive to delays, so the extra virtualization might make it extra-slow).

Since we have higher-performance equivalents nowadays - wintun for win7 and up, and DCO for 10 2H1 and up - we're not going to spend time in performance-tuning the TAP6 driver. If someone volunteers to do so, and sends reasonable patches, we'll be happy to review and merge - but this is not a priority item for the core team to work on.