Introduction
Access Server 2.12 and newer supports OpenVPN Data Channel Offload (DCO). You can benefit from performance improvements when you enable DCO for your VPN server and clients.
This document describes what DCO is, how it works, and how you can enable it.
What is OpenVPN DCO?
OpenVPN DCO changes how Access Server handles the data flowing through the VPN tunnel. With DCO, the data channel encryption and decryption are offloaded to kernel space, letting the kernel do the work instead of dealing with it in user space. This saves on copy operations from kernel to user space and back and uses multi-threading.
OpenVPN DCO is a loadable kernel module that can optionally be installed and used with the Access Server.
To understand the change, here's how the OpenVPN protocol handles data without implementing DCO. This process is called context-switching:
- Data packets arrive in the kernel space.
- OpenVPN copies the packets to the user space.
- OpenVPN decrypts and encrypts packets in the user space.
- OpenVPN copies those packets back to the kernel space.
- The data packets then get sent to their destination.
In contrast, DCO has a more efficient process:
- Data packets arrive in the kernel space.
- OpenVPN DCO processes the packets in the kernel space.
- The data packets then get sent to their destination.
For default Access Server installations without DCO, the OpenVPN daemons run in user space. To use multiple CPU cores, Access Server must manage multiple OpenVPN daemons with load-balanced connections.
The solution to improving performance? Moving the data channel handling to the kernel space, where it can be handled more efficiently and with multi-threading: OpenVPN Data Channel Offload (DCO).
Note: While DCO on only one side can increase performance, both Access Server and the client software should use DCO to achieve optimal improvement.
How to enable DCO on Access Server
You can see whether DCO is enabled on Access Server from the Status Overview on the Admin Web UI. The Kernel data channel offloading shows inactive or active and whether the kernel module is loaded on the server.
Use compatible servers and clients
The following requirements must be met to deploy and use DCO on OpenVPN Access Server.
Supported Access Server version:
- 2.12.0 and newer
Supported platforms:
- Debian 11
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
- Ubuntu 20.04 LTS (x86_64 and ARM64 architectures)
- Ubuntu 22.04 LTS (x86_64 and ARM64 architectures)
Compatible clients:
- OpenVPN2 based clients that use OpenVPN 2.4 or newer (OpenVPN 2.3 and older are not supported)
- OpenVPN3 based clients such as OpenVPN Connect v3 and OpenVPN3 Linux client
DCO support on client side
The client does not need to use DCO to connect to a server that uses DCO. With only one side doing DCO there is already a performance benefit. However, it is best if both sides use it. The following clients are capable of using DCO on the client side, although it will have to be enabled separately in the client.
Clients with DCO capability:
- OpenVPN3 Connect for Windows (as of 3.4.0).
- OpenVPN3 Linux client (check with the community documentation for the supported Linux operating systems).
- OpenVPN 2.6.0 or newer (check with the community documentation for the supported Linux operating systems).
- OpenVPN GUI community client for Windows (refer to community downloads).
Install DCO from the console
Follow these steps to install DCO on your Access Server server based on your Linux OS. Ensure your server has an officially supported kernel. We don't test or support DCO on custom-compiled kernels and can't guarantee it works for your situation.
The steps below are for systems where your OS installs the latest kernel when available.
If you have a system that requires staying on one specific kernel version, refer to the information about your use case in the troubleshooting section.
Tip: After installing the DCO module, you can see it's installed on your server from the Admin Web UI Status Overview page — check the row for kernel data channel offloading. The field displays the ovpn-dco version.
Ubuntu/Debian
- Connect to your server's console and obtain root privileges.
- Update and upgrade the operating system (recommended):
apt update
apt upgrade - Reboot the OS:
reboot
- Upgrade Access Server to 2.12.0 or newer or do a fresh install of 2.12.0 with the install commands in the Access Server portal. (Refer to our detailed instructions for updating Access Server, if helpful.)
- Install the DCO module:
apt install openvpn-dco-dkms
Due to the many different environments for our customers' deployments, if you encounter issues installing DCO with these steps, refer to our troubleshooting tips. We provide information about possible dependencies you may need to address.
Red Hat Linux Enterprise
- Install the Extra Packages for Enterprise Linux (EPEL) repository.
- Update and upgrade the OS (choose the command appropriate for your RHEL version):
yum upgrade
oryum update
- Reboot the OS.
- Upgrade Access Server to 2.12.0 or newer or do a fresh install of 2.12.0 with the install commands in the Access Server portal. (Refer to our detailed instructions for updating Access Server, if helpful.)
- Install the DCO module:
yum install kmod-ovpn-dco
Enable OpenVPN DCO in Admin Web UI
After installing the DCO kernel module, you can enable DCO in Access Server's Admin Web UI.
- Sign in to the Admin Web UI.
- Click Configuration > Advanced VPN.
- Click Prefer kernel Openvpn data channel offloading if available (ovpn-dco) to set data channel offloading to Yes.
- Click Save Settings and Update Running Server.
- Access Server now displays a message on the Status Overview page that the ovpn-dco module is active.
Set VPN tunnel MTU (optional)
Access Server has a maximum transmission unit (MTU) that was previously a background setting. With DCO, we provided a way for you to adjust it as needed.
We recommend setting the VPN tunnel MTU to 1420 when you enable DCO:
- Sign in to the Admin Web UI.
- Click Configuration > Advanced VPN.
- Enter '1420' as the value in the field, VPN tunnel MTU.
- Click Save Settings and Update Running Server.
Note: For VPN tunnel MTU: the minimum allowable value is 576, and the maximum is 65536.
Verify OpenVPN DCO is now in use (optional):
From the Admin Web UI:
- Click Status > Status Overview.
- Under Kernel data channel offloading, the status displays as active and lists the ovpn-dco version.
From the command line interface:
- Connect to your server's console and obtain root privileges.
- Run this command to verify ovpn-dco is in use:
ip -details link show
- Note the interfaces that start with as0; you'll see these include ovpn-dco in the output.
Note about Access Server with Secure Boot
Suppose you've enabled secure boot on the system running your Access Server. In that case, it will fail to boot correctly if you install the DCO loadable kernel module without adding its signature to the secure boot system.
Ensure you do one of two things:
- Either add the module's signature so it can verify it and boot securely.
- Or disable secure boot.
This situation will improve in the future as DCO is under review for inclusion in the Linux kernel itself. Once it is part of the Linux kernel, a separate loadable kernel module won't be required.
Troubleshooting
Refer to the subsections below to troubleshoot DCO issues.
DCO doesn't load
The Access Server status page states, "ovpn-dco module is available but inactive." When you encounter this message, step through the installation again to ensure you have all the necessary pieces. This message means that DCO didn't load. Refer to these troubleshooting tips to resolve it, or send us a support ticket.
Linux headers not installed
DCO requires the latest Linux kernel headers. Follow these steps to install the headers and set them to install with updates automatically. Refer to the next troubleshooting section if you need to stay with a specific kernel header.
- Check the current kernel version for your OS:
uname -r
- Our example output was
5.15.0-75-generic
. In place of "generic" you may see "cloud," "aws," and others, which you enter in your install command.
- Our example output was
- Install the latest kernel header:
install linux-headers-[generic/aws/cloud/etc]
- For our example, we enter the command
install linux-headers-generic
. Take note of your kernel uname to enter the correct kernel header package name.
- For our example, we enter the command
- Mark the headers to install automatically:
apt-mark auto linux-headers-generic
With DCO installed and the kernel headers set to automatically install, running apt update and apt upgrade will always give you the latest kernel and headers, keeping DCO working.
DCO with an OS that stays on a specific kernel version
Follow these steps for installing DCO on a Linux OS where you want to stay on a specific kernel version:
- Follow the steps above to install openvpn-dco.
- Check your current kernel type (our example uses 5.15.0-1025-aws kernel):
uname -r
- The results display your kernel information such as this:
5.15.0-1025-aws
- Install the necessary kernel headers for your kernel:
apt install linux-headers-5.19.0-1025-aws
- If you upgrade your kernel, ensure you install the needed kernel headers for the new kernel.
EFI variables not found
During installation, you may receive the message, "EFI variables are not supported on this system. /sys/firmware/efi/efivars not found, aborting." Access Server may not display ovpn-dco available on the Status Overview without EFI variables. Resolve this by installing efivar:
apt-get install efivar
Advanced VPN directives
If you encounter errors or can't verify that DCO is running, check for any advanced VPN directives:
- Sign in to the Admin Web UI.
- Click Configuration > Advanced VPN.
- Scroll down to Additional OpenVPN Config Directives (Advanced).
- If you have any server or client config directives, review them one by one. You may need to remove them for DCO to work correctly.
Legacy OpenVPN features
If you want to enable DCO with an older Access Server configuration, be aware that certain legacy features aren't compatible with DCO. Specifically, if your configuration supports any of the below features, refer to the following subsections for details.
Legacy features that aren't DCO-compatible:
- Compression.
- Legacy data ciphers.
- Bridging.
- Legacy DHCP options.
Compression
We deprecated support for compression due to the Voracle vulnerability. Access Server 2.6.1 and newer disables compression during upgrades, so this should be fine unless you specifically re-enabled compression.
If you enable DCO, Access Server turns compression off forcibly as it's not and won't be implemented.
Legacy data ciphers
Blowfish and other CBC-type ciphers are not supported. DCO only supports AEAD ciphers such as AES-256-GCM, AES-128-GCM, and ChaCha20-Poly1305.
Access Server 2.5 and newer implements AES-256-CBC by default with an automatic upgrade to AES-256-GCM.
For clients, OpenVPN 2.4 and newer uses AES-256-CBC with an automatic upgrade to AES-256-GCM. OpenVPN3-based clients can also do this. However, if you support OpenVPN 2.3 and older clients, you may need to maintain support for CBC-type ciphers and can't use DCO.
Bridging
Access Server bridging functionality is deprecated. While it can still be used (without DCO, we don't fully support it. Since DCO is new, we didn't implement bridging functionality there. It may be implemented in the future.
Legacy DHCP options
Some options can be passed using the DHCP options mechanism present in the TAP Windows driver that are not implemented in the DCO for Windows driver. An example of this is Netbios over TCP/IP, as this is a legacy option that will be phased out.