TCP vs UDP

TCP stands for Transmission Control Protocol, which is the most common transmission protocol nowadays and it works for reliable connection. UDP, on the other hand, stands for User Datagram Protocol, which works for unreliable connection. This does not mean that UDP is bad, but there is no error checking. This blog will explain the different between TCP and UDP and how they work:

 

  • TCP: Is a connection session between the client (sending computer) and the server (receiving computer). First, the client is going to establish a connecting with the server and says “I want to establish a session with you”; then the server replies to the client with a confirmation and says “I am ready – send me some data”. So, the client starts to send some data sets (e.g. data set 1, data set 2, data set 3 & data set 4). Let’s say for example that data set 3 has not been delivered and disappeared. Meanwhile, the server side confirms that the server has received “data set 1, data set 2 & data set 4”. After a timeout period, the client side will realised that the server side has not received data set 3, since there is no confirmation about it. Thus, the client side will send the data set 3 again to the server side; and the server side will send a confirmation says “data set 3 has been received”.
  • UDP: Is also a connection session between the client (sending computer) and the server (receiving computer). In UDP, the client starts sending data set to the server side; and does not establish a connection (e.g. data set 1, data set 2, data set 3 & data set 4). The client side will keep sending all the data set until, even if one data set is missing. There is not built in mechanism in the UDP to resend/respond to any lost packets.

 

 Advantage

 Disadvantage

TCP

More reliable

Slow

UDP

Fast

Unreliable

 

The attached file explains the TCP and UDP communication between the client and server in a simple graphical interface (tcp-vs-udp).

In conclusion, UDP is good for video conference, because we do not care if one data set get lost. However, TCP is good when you care about all the data set and (unlink UDP). For example, web pages because you cannot be able to render the page, if one data set is missing.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s