Doubts about using UDP on my VPN

This forum is for general conversation and user-user networking.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
Dovakhan
OpenVpn Newbie
Posts: 3
Joined: Wed Nov 13, 2019 10:36 pm

Doubts about using UDP on my VPN

Post by Dovakhan » Wed Nov 13, 2019 10:53 pm

I've recently installed and configured a small VPN (with OpenVPN Community Edition) on my office. It's main functions would be to stream database data (server <--> clients) from an old database software (soon to be replaced by a MySQL solution, but it still needs to be around for a couple of years), and some certain office software (also database-based) that can run over a LAN even if it's not installed on the computer that executes it. So, of course, I'm worried about wanting reliability for my data.

So, I've been asking myself "Is it right for OpenVPN to default to UDP? Wouldn't it be better to run it over TCP? What if an UDP packet gets lost, or corrupted or something? UDP doesn't check or resends packages! Wouldn't that corrupt MY data on the databases of both of the software that I run over the VPN?". I've Googled a bit for answers, but I've found a bit of everything: from some saying that switching to TCP would be best, to people saying that OpenVPN works best over UDP, that the OpenVPN protocol itself takes care of error correction, package ordering and the likes, and that I shouldn't worry about it.

I'd appreciate some advice that would put my mind at peace at last. Thx in advance for your replies :)

Charles99
OpenVpn Newbie
Posts: 14
Joined: Thu Nov 14, 2019 2:40 pm

Re: Doubts about using UDP on my VPN

Post by Charles99 » Thu Nov 14, 2019 2:50 pm

TCP is, in general, the most commonly used connection protocol on the internet, as it offers error correction (and is therefore known as a ‘stateful protocol’).
UDP is referred to as a ‘stateless protocol’ as it performs no such error correction, simply receiving packets with no or retries. This makes it much faster, but less reliable.
TCP = reliable
UDP = fast
Which one you use, therefore, depends on whether reliability or speed is your primary concern, and, in general, UDP is better for streaming VoIP, and playing games online.

Hope this helps you!
Regards,
Charles

Dovakhan
OpenVpn Newbie
Posts: 3
Joined: Wed Nov 13, 2019 10:36 pm

Re: Doubts about using UDP on my VPN

Post by Dovakhan » Thu Nov 14, 2019 4:04 pm

No, it doesn't ¬¬ You just repeated what I already knew, which are merely the basic characteristics of TCP/UDP without having in mind the role that the OpenVPN protocol plays on it.

Regardless, I finally found some official word about it on which they recommend UDP and why they do it. I'll leave it here for future forumers:

https://openvpn.net/faq/why-does-openvp ... p-and-tcp/

https://openvpn.net/faq/what-is-tcp-meltdown/

Post Reply