UDP vs TCP VPN: Which Protocol Is Better to Use?
Both UDP and TCP are transport protocols, i.e. ways of sending data over the Internet. UDP is best for activities with some degree of tolerance for errors, like streaming, video calls, or gaming. Meanwhile, TCP is essential for error-free data transfers, such as browsing, instant messaging, email, and so on. We suggest trying UDP over TCP when connected to a VPN, and switching to the latter if there are any issues.
UDP vs TCP VPN Overview
Here is a comparison between UDP and TCP for quick reference.
- Faster, but with more errors
- May send data in wrong order
- Uses less data
- Best for streaming, online gaming, video calls
- Prone to network congestion and overwhelming receiving device with data
- Easily blocked by firewalls and government censorship
- More vulnerable to DDoS and other attacks on its own (VPNs remove these risks)
- More reliable at the cost of speed
- Data is sent in the right order
- Higher data usage
- Best for email, texting, downloads, torrents
- Has congestion and flow control mechanisms to prevent such issues
- Excellent at bypassing VPN blocks (e.g. in China, Russia)
- Slightly more secure due to various checks during data transfer
Can’t find that movie your friend recommended the other day due to pesky regional blocks on Netflix? The simple solution is to get a VPN app for streaming and connect to a server in a different country. Now you can unblock all sorts of content exclusive to that region. Just one small problem – should you use OpenVPN UDP or TCP for streaming? What about other activities such as gaming, or video calls?
No worries – by the end of this article you’ll know exactly when to use your VPN with TCP or UDP. We’ll walk you through all the differences, pros, and cons of each protocol.
What is UDP?
The User Datagram Protocol (or UDP) is a method of sending data packets over the Internet. UDP focuses on delivering data as fast as possible, without checking for errors.
Think of it as a one-way transmission, like on TV or the radio. The news anchor won’t stop just to make sure you’ve caught everything they said.
To make things faster, UDP lacks many of the “quality control” functions of TCP. Rather than describing any UDP features in particular, it’s easier to define by what it doesn’t do:
- Connectionless protocol – no need to establish a connection between your device and the server. That also means that the server will not bother asking whether your device is ready for the sudden influx of data.
- No packet sequencing – data is sent in bulk and may be dropped or arrive in the wrong order. This may lead to errors such as choppy video or “rubberbanding” in online games. Now you know why your teammates seem to teleport back and forth in CS:GO.
- Limited error correction – aside from a checksum to avoid data corruption, packets aren’t checked for errors or re-sent.
- Lack of congestion or flow control – it’s easy for the receiving device to be overwhelmed by the UDP data stream.
New protocols can be built on top of UDP to take advantage of its speed while dealing with some shortcomings of TCP. Google’s QUIC protocol does exactly that, and the Internet Engineering Task Force (IETF) standardized it in 2021. All Google mobile apps use QUIC, as well as Uber and most of Facebook (plus Instagram).
One cool feature of QUIC is that it allows users to change between networks (e.g. mobile to Wi-Fi) without dropping the connection. Fairly similar to IKEv2, one of the better protocols for VPNs out there – especially for mobile users.
Pros of UDP
Readers might be confused about why anyone would use UDP if it’s more error-prone than TCP. Well, here are the pros of UDP vs TCP:
- Faster for video streaming and gaming – a few frame drops won’t matter as long as the video or game carries on.
- Better for video calls and other real-time applications, despite possible quality drops
- Lower data usage, as UDP headers don’t contain as many details as TCP, and lost packets aren’t re-sent
- Usable for DNS requests and Internet-of-Things (IoT) devices, like Amazon Echo, Google Home, and various sensors
- When using OpenVPN UDP vs TCP, you can avoid a TCP meltdown (more details here).
On a related note, many of the disadvantages of UDP are usually solved at the application level. Take online video games, for example. The game devs may implement their own method of packet sequencing (e.g. timecodes, timestamps) or use AI to make gameplay smoother.
Similarly, video and voice chat programs use codecs to optimize how your computer or smartphone reads its data streams. All of these additions make the job easier on the rather barebones UDP protocol.
Cons of UDP
We’ve previously discussed the lack of packet sequencing, error checking, and congestion or flow control in UDP. Here are some more UDP cons you should know about:
- More vulnerable to data injection attacks, as packets aren’t sent in order or verified. This risk is eliminated when you use a VPN with OpenVPN UDP (or other protocols).
- Bad for when data integrity is a must, such as web browsing, email, instant messaging, or sending files.
- Can be easily blocked in countries like China and others that restrict VPN usage. In the battle of OpenVPN UDP vs TCP, the latter is the clear winner for bypassing VPN blocks.
Interestingly enough, OpenVPN and many VPN providers recommend using UDP vs TCP to prevent a TCP meltdown. As Internet traffic already uses TCP for the most part, adding another TCP layer on top of that can lead to conflicts and delay data transfers.
What is TCP?
Unlike UDP, the Transmission Control Protocol (or TCP) forgoes speed in favor of data consistency. Data packets are sent in order, with frequent checks so nothing is lost in transit.
It’s easier to understand if you think about TCP communication as a phone call. The people talking can simply ask for something to be repeated if they couldn’t hear clearly the first time.
Naturally, that’s the simplified version. As mentioned, TCP performs these checks every step of the way. So that phone call will take longer than usual due to the constant back-and-forth between receiver and server.
To reiterate, these are the features exclusive to TCP:
- Connection management – a connection is established between your device and the server it communicates with. This allows the sender and receiver to “discuss the terms” of the data transmission process, and maintain them throughout.
- Packet sequencing – TCP sends data in a specific order, so the final product arrives as intended. Your emails or messages on Discord are sent exactly as you wrote them, without missing words or scrambled text.
- Error correction – TCP includes a checksum (much like UDP). Aside from that, TCP also has acknowledgment and retransmission mechanisms. In other words, your device tells the server “Yes, I got that bit of info.” If the transfer fails, that data is re-sent.
- Congestion and flow control – the sender controls how much data is transferred to avoid network congestion. Meanwhile, the receiver can tell the sender how much traffic flow it can handle, so it’s not overwhelmed.
While it may seem like TCP is better than UDP at a first glance, these correction methods make it impractical for real-time applications. Online games, video calls, and live streams would grind to a halt while the server checks everything for errors.
Still, it’s interesting to note that streaming sites like Netflix and Amazon Prime Video use TCP instead of UDP. And funnily enough, it’s because of these control mechanisms. Not only can they deliver HD and 4K video without quality drops, but it helps avoid network congestion. Plus it allows the services to monitor bandwidth usage and adapt video quality on the fly.
Pros of TCP
TCP is a protocol that focuses on maintaining stable connections. Here are the pros of TCP vs UDP for VPN apps and other services.
- More reliable for data transfers, such as web browsing, email, texting, torrenting, and downloads or uploads in general
- Multiple error checks to ensure data is received fully intact
- No risk of overwhelming the receiving device with an influx of data
- Less vulnerable to data injection, DDoS, and other cyber attacks due to checking each data packet
- May improve stability on unreliable networks. Users also report better speeds while torrenting with OpenVPN TCP.
- Using OpenVPN TCP vs UDP makes the VPN hard to block on firewalls or in censorship-heavy countries. Not without literally breaking the Internet, at least.
Cons of TCP
Its focus on reliability can also work against the protocol. These are the cons of TCP:
- Slower than UDP in general due to the constant back-and-forth required for TCP transfers
- Higher data usage, as TCP headers include more details about each data packet. That, and unreceived packets are re-sent to ensure full data integrity.
- Unsuitable for real-time applications like video games, live streams, online meetings, and so on
- When using OpenVPN TCP vs UDP, a TCP meltdown may occur and cause delays in data transfers.
What are the Differences Between TCP and UDP?
The key differences between TCP and UDP lie in how they handle data transfers.
TCP Is More Reliable, But Slower Than UDP
TCP has multiple checks that ensure data integrity, but also make it slower than UDP. On the opposite end, UDP is faster as data is sent in bulk without error-checking.
UDP Is More Data-Efficient
Due to TCP headers containing more info about data packets, the protocol also eats up more data than UDP. Not only that, but TCP also re-sends packets lost in transit, which also affects overall data usage.
TCP Is Best for Bypassing VPN Blocks and Censorship
TCP works on ports 80 and 443, the same ports used for HTTP and HTTPS traffic. This makes it handier for bypassing censorship and firewalls, as it can’t be blocked without also affecting most of the Internet. When deciding between using a VPN with TCP or UDP in China and similar territories, you should stick with TCP.
Should I Use UDP or TCP?
Whether you use UDP or TCP for VPN clients or other apps depends on your needs as a user.
Most VPN clients are UDP-enabled by default to avoid conflicts between two TCP layers while browsing the Internet. UDP is also great for streaming, gaming, and online meetings especially. Plus you can still use TCP apps and web services within the VPN’s UDP tunnel.
In the end, we recommend using OpenVPN UDP (or WireGuard-type protocols that use UDP). Switch to TCP if you experience problems with the former or have an unreliable connection. It’s also the preferred method of bypassing firewalls and government-imposed censorship.
UDP vs TCP FAQs
These are the most common questions we’ve seen people ask when comparing UDP and TCP.
When Do People Need UDP and TCP?
It’s best to have both protocols available for different situations. For example, ISPs may sometimes rate limit transfer speeds for UDP traffic, making TCP the better choice. Experiment with the two protocols while using a VPN to find the option that works for you.
Is OpenVPN TCP or UDP?
You can use OpenVPN with either TCP or UDP from your VPN’s settings. In the NordVPN app, go to Settings (the cog wheel button) > Auto-connect and select the VPN protocol from the drop-down list.
Is UDP safer than TCP?
UDP is more vulnerable to data injection, port scanning, and denial-of-service attacks than TCP. That’s because TCP checks for errors and that data packets are sent in the proper order.
Such risks aren’t present in a VPN with TCP or UDP as the apps are designed with security in mind.
Is TCP or UDP Better for Streaming?
In general, UDP is considered better for video streaming. The only downside is that you may experience choppy video or quality dips since the protocol doesn’t check for packet loss. Still better than TCP, which would cause the stream to stop until all video data is properly received.
That said, if you regularly experience poor connectivity, it may be worth trying TCP to see if things improve.
Do Video Calls Use TCP or UDP?
Video calls usually establish the initial connection with TCP, then use UDP for video and audio streaming. The latter keeps the stream going, even if there are dips in quality.
As you can see, both TCP and UDP have their uses, whether it’s for OpenVPN clients or other apps. Thankfully, VPNs make it easy to switch between the two without much of a hassle. And as mentioned, it’s fairly common for your VPN to come with UDP enabled by default.
If you’re still unsure about which one you should use, it’s best to stick to the provider’s settings. You can also ask us directly in the comments below, and we’ll be glad to clear things up.