Skip to contentSkip to conversation

Nice work on the DCO kernel module - Just had some quick questions about it

Openvpn-devel Jon Chiappetta 2 participants 2 messages Aug 17, 2025 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]...

#1 lore raw

I just wanted to post here and say nice job on making the DCO module. I was able to compile it and insmod it and I think OpenVPN auto picked it up even running in TCP mode I believe. I wanted to confirm, does this DCO module work with TCP mode or is it UDP client/server protocol only? Also, I'm not very smart and I am unable to understand kernel-level C code as it is very abstract and generalized but I was trying to see what read/write buffer sizes it uses if I had a TUN MTU of 1500 bytes?
In normal C, you can see the tun read / socket write / socket read / tun write calls and you can see the exact buffer sizes being used but in this case I cannot see how much data is being read from TUN per call and how much data is being written to the TCP socket per call? I tried reading through the code in github but it was a bit tough for my limited knowledge unfortunately :/ I always wished I knew more about reading/writing kernel level C code but I never had the chance or time to really get into it over the years.

I performed a speed test with it also but I could only get the same speed as my modified OpenVPN setup (~650Mbps over WiFi [email protected]...) so I think there is some other limiting factor elsewhere in my network setup. I don't have a wired client, only a U7-Pro and I am running the VPN client in the middle of my network on a Linux VM on a Mac Mini but it ran pretty smoothly and nicely assuming it was indeed working correctly.

cd ovpn-dco-master/
vim ./drivers/net/ovpn-dco/udp.c #CONFIG_IPV6 -> #ifdef CONFIG_IPV6_NO make
cp -fv ./drivers/net/ovpn-dco/ovpn-dco-v2.ko ../
modprobe udp_tunnel
insmod /root/dco/ovpn-dco-v2.ko

Thanks again,
Jon C

#2 lore raw

Hi,

Quoted 3 lines · Jon Chiappetta via Openvpn-devel

able to compile it and insmod it and I think OpenVPN auto picked it up even running in TCP mode I believe. I wanted to confirm, does this DCO module work with TCP mode or is it UDP client/server protocol only?

Linux and Windows DCO support TCP mode, FreeBSD DCO does not.

If you select options that are incompatible with DCO (like, "compress", or "tcp" on FreeBSD) OpenVPN will log that and fall back to userland.

Quoted 4 lines

Also, I'm not
very smart and I am unable to understand kernel-level C code as it is very abstract and generalized but I was trying to see what read/write buffer sizes it uses if I had a TUN MTU of 1500 bytes?

In Kernel, there is no real "read/write" involved. There is a packet coming in as part of a data structure, this gets processed, and the data structure handed onwards. So it always deals with "one full packet at a time".

[..]

Quoted 6 lines

I performed a speed test with it also but I could only get the same speed as my modified OpenVPN setup (~650Mbps over WiFi [email protected]...) so I think there is some other limiting factor elsewhere in my network setup. I don't have a wired client, only a U7-Pro and I am running the VPN client in the middle of my network on a Linux VM on a Mac Mini but it ran pretty smoothly and nicely assuming it was indeed working correctly.

Performance measurement is tough, especially with DCO involved, as you end up measuring something else. Like "how fast can the 'iperf' program go?" (if you see 100% CPU usage by 'iperf', you know that OpenVPN is not the limiting factor), or "how fast is your browser" with the online speed tests.

Quoted 6 lines

cd ovpn-dco-master/
vim ./drivers/net/ovpn-dco/udp.c #CONFIG_IPV6 -> #ifdef CONFIG_IPV6_NO make
cp -fv ./drivers/net/ovpn-dco/ovpn-dco-v2.ko ../
modprobe udp_tunnel
insmod /root/dco/ovpn-dco-v2.ko

... this is not really what you want, though. It's the old module which has been overhauled about 10 times before it was accepted into 6.16 upstream kernel. So you might hit limitations in the kernel module.

The old module only works with OpenVPN 2.6, while the new module only works with 2.7 (as of this writing, 2.7_alpha3, but "git master" will also work).

gert

Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             [email protected]...