OpenVPN is a popular open-source software package used for VPN connections. It relies on UDP and TCP protocols for transmitting data across secure VPN tunnels.
UDP and TCP are both transport-layer protocols, required for establishing temporary connections between two programs, computers, or servers.
With VPNs, you may have the choice between UDP and TCP. So which should you use? Both options provide advantages and disadvantages that you need to explore.
What Is the TCP?
Transmission Control Protocol (TCP) offers host-to-host communication. It provides a standard for sending packets of data between applications, such as a server hosting a website and your computer.
TCP works as a transport layer for the Internet Protocol (IP). When you visit a website, the server uses the HTTP protocol to send the HTML file and additional data to the client. The HTTP protocol uses TCP to establish the connection.
This protocol handles the connection and the sending of data packets. It also uses error correction to determine if the packets arrived correctly without bothering the host application.
The TCP checks for lost packets, out of order packets, and other transmission errors. If it detects any issues, the TCP layer asks the host to resend the packets.
While TCP ensures that data arrives correctly, it offers slower speeds compared to UDP.
What Is UDP?
User Datagram Protocol (UDP) provides an alternative to Transmission Control Protocol (TCP). These protocols work on top of the Internet Protocol (IP) so you may also see them listed as UDP/IP and TCP/IP.
While TCP uses host-to-host communication, UDP uses process-to-process communication. UDP sends datagrams instead of individual packets. It also skips the error correction used in TCP connections.
Without the error correction, UDP delivers faster transmissions. It experiences much lower bandwidth latency and overhead. UDP tends to be the preferred choice for applications that require faster speeds, such as voice communication, torrenting, video streaming, and gaming.
Which OpenVPN Protocol Is Right for You?
For most VPN users, UDP provides the best option for general use. The typical recommendation is to start with UDP. And if you experience issues with the connection, try the TCP protocol.
Some of the potential problems that may keep you from connecting to a VPN with UDP include:
- Countries or ISPs blocking UDP ports to prevent VPN connections
- Missing data packets causing the VPN connection to drop
- Slower Internet speeds causing dropped connections
Some countries have powerful firewalls to detect the use of VPNs. UDP often uses ports 500, 1194, or 4500. One way that they detect VPNs is through the UDP connection to one of these known ports.
Additionally, some ISPs monitor traffic for UDP connections. If your ISP detects UDP, they may cap your bandwidth.
TCP typically uses ports 1701, 1723, and 443. As HTTPS typically uses port 443, VPN users are more likely to successfully hide OpenVPN while using TCP.
Without the error correction, it is possible to lose multiple packets with UDP, especially with a slow Internet connection. When the UDP connection drops multiple packets, the VPN drops your UDP connection. This exposes your IP address and allows your ISP to view your activity.
TCP is more stable compared to UDP due to the error correction. You have less of a chance of experiencing a dropped connection, which is useful when you have intermittent Internet or slower speeds.
Other than these scenarios, UDP remains the preferred choice, especially for an activity that involves a lot of data. If you are streaming content, playing video games, or torrenting files with a P2P connection, UDP offers the speeds that you need.
Keep in mind that TCP is not terribly slow. You can still browse the web and may even download torrents at relatively decent speeds.
Choosing Between UDP and TCP
TCP offers better reliability and slower speeds. UDP offers faster speeds and less reliability for slower Internet connections.
When you first use a VPN service that utilizes OpenVPN, try UDP. It is the default connection and works best with OpenVPN. However, if you experience dropped connections or need to bypass a firewall, switch to a different UDP port.
Some countries and ISPs block these connections based on the port number. If you continue to experience issues, try switching to TCP.