You might know that OpenVPN is the most secure VPN protocol.
But what about TCP and UDP?What are these terms and what do they mean?
TCP and UDP: Whats Common?
TCP and UDP arenetwork protocols that are used to send data packets.
These data packets are just bits of data that travel over the internet.
This data is transferred in the form of tiny packets.
They are also used to send the packets to the IP address of the recipient.
(An IP address is a special address that is assigned to each gear connected to the internet.)
Both TCP and UDP work on top of the IP (Internet Protocol).
This is why you might hear terms such as TCP/IP or UDP/IP.
Another protocol that can be used is ICMP (Internet Control Message Protocol).
However, since most connections rely on either TCP or UDP, well focus on these two.
Lets understand each of these protocols separately.
All About TCP
TCP is amore commonly used protocol than UDP.
Its a request to the server to send the data and information for the website.
In response, the server reciprocates by transmitting additional TCP data packets back.
In essence,TCP isnt a one-way communication.
TCP numbers the packets so the recipient can get them in order.
When the recipient gets a packet, it sends an acknowledgement to the sender.
TCP is serious about reliability.
The packets are checked for errors to double-check the request is fulfilled correctly.
TCP packets aretracked to ensure that no data is lost in between.
Packets are also checked for corruption.
However,it doesnt do any kind of error-checking.
To make it lightweight and easy, UDP lets go of the reliability factor.
With UDP, the sender sends the packets to the recipient.
The sender doesnt care if the recipient received them or not.It will continue sending the data packets.
Did you get all the packets?
Theres no way to know.
And you cannot get back any missing packets either.
This sounds like a terrible deal but theres a good thing about this communication itsfaster than TCP.
As you may have guessed, UDP is not used in connections where reliability is a big concern.
Its used only when speeds are more important than a few lost packets.
The packets that were missed in between are already useless now.
Theres no point in requesting them again.
Youll ignore this little glitch and continue playing as earlier.
This is better than the alternative TCP, where your game would freeze.
In online gaming, what matters is whats happening in real time.
You arent concerned about the missed packets anyway.
TCP and UDP: What are the differences?
This graph sums up the differences, but we go into detail for each section below.
Lets get into the details.
Here are some primary differences between them.
Connection
TCP is connection-oriented and UDP is connectionless.
This meansthat before sending TCP packets, a connection is established between the server and the client.
This process of setting up a connection is called TCP handshaking.
The stream of packets is then sent over this connection.
In UDP, there is no such connection.
Each packet is sent individually and directly from the sender to the receiver without a reliable data channel.
This helps the recipient arrange and stitch back the message together.
Speed
Since UDP doesnt have many requirements, it offers a faster connection.
Reliability
TCP has provisions for data packet sequencing, acknowledgements, error detection, and correction.
This makes ita reliable protocol.
On the other hand,UDP doesnt have sequencing or acknowledgements.
While UDP has error detection mechanism, it does nothing to correct the error.
The erroneous packets are simply discarded.
Header size
Since TCP has more details (sequence of the packet, error detection, acknowledgement field etc.
),the header of TCP packets is larger than that of UDP packets.
This makes each packet heavy.
This is why TCP connections are slower than UDP connections.
Error detection/correction
TCP has error detection and correction methods.
When a packet is found to be corrupted, TCP doesnt send an acknowledgement for it.
This prompts the sender to resend the packet.
This way, the complete message is delivered without errors.
In UDP, there is error detectionvia checksum but there is no error correction.
If a given packet is found to be erroneous, it is simply discarded.
Acknowledgement
When TCP packets are received by the recipient, it sends back an acknowledgement to the sender.
It will then proceed to resend the packets.
Transfer method
TCP sends out a stream of data packetswhile UDP packets are sent individually.
Data stream doesnt have a defined boundary but individual packets possess proper boundaries.
Congestion control
TCP has provisions for congestion or flow control.
Your IP address is used to identify your machine on the internet.
So your IP address is like the street address.
All apartments on that street will share the street address.
But each apartment has an apartment number as well.
This apartment number is the port.
Your IP address has a number of ports.
There can be 65,535 TCP and 65,535 UDP ports.
OpenVPN: TCP or UDP?
When you use OpenVPN, which protocol should you use it with?
When it comes to OpenVPN connections,both TCP and UDP perform well.
Both offer excellent privacy and security when you use the VPN.
To choose the right one,you must consider the program for which you want to use the VPN.
If you want a speedy connection and dont mind losing a few packets, you should select UDP.
Andif reliability is your main concern, go for TCP.
Keep in mind that both of them offer equal security from hackers and government surveillance.
Dont know what protocol to use?
We give you aquick summary here.
just, comment on how to improve this article.