Computer Networking

Transport Layer

TCP VS UDP



Transport Layer
use the TCP or UDP protocols to provide its various services. When the data came from upper layers (i.e Application layer) to transport layer then Transport layer adds the TCP or UDP header along with data. This header adds the functionality.

Transmission Control Protocol (TCP)

The TCP stands for Transmission Control Protocol. If we want to achieve reliable communication between two computers then TCP is the best. For example,

  • Want to view a web page, need is there should be nothing missing on the page.
  • want to download a file, and need is a complete file, (i.e. nothing should be missing in file)

. in above cases ,TCP is best option. Size of TCP header is from 20 to 60 bytes.

Features in TCP

TCP header include the following mandatory features

  • Connection-Oriented Communication (i.e. dial up connection): It uses three way handshaking protocols. First send request for connection, second response from receiver that I am ready and in last sender sends the data.
  • Segmentation: it converts the incoming data (in bits) to bytes and then these bytes are gathered to make Segments.
  • Reliable delivery (in-order sequence without loss of data): when the connection is established then reliability of data comes into picture. It is more reliable then UDP where connection less communication takes place.
  • Full Duplex : both sender and receiver can send and receive the data at a time in TCP
  • Error Control (checksum method): it handles the error, node to node through checksum method
  • Piggybacking: it can sends both data and acknowledgment at time
  • Flow control: if the receiver buffer is full then it control the flow of data
  • Congestion Control: it also handles the traffic control in network device like router. Mean to say it control the overflow of data in the network

User Datagram Protocol  (UDP)

The UDP stands for User Datagram Protocol. Its working is also similar to the TCP. But The main difference is, the UDP is a connectionless protocol. It means there is no connection establishes in advance for communication. So, guarantee of data delivery is not achieved. It does not even care whether the data has been received or not at the receiver’s end. That’s why, it is also known as the “fire-and-forget” protocol. UDP is unreliable but faster than TCP. The size of the UDP header is 8 bytes.

TCP VS UDP Comparison

Comparison of TCP VS UDP in various aspects is given below

Parameter TCP UDP
Full Form TCP stands for Transmission control protocol UDP stands for User Datagram protocol
Tolerance of data TCP are the protocols which are used where the data lost is not tolerated. If some data is lost then that particular data is retransmitted.

Example: downloading, uploading etc.

TCP are the protocols which are used where the data lost is tolerated. If some data is lost then that particular data does not need to retransmit.

Example: Skype, live match etc.

Connection orientation TCP is Connection oriented. It means, some dedicated path is established and data always transferred in the form of “IN ORDER” UDP is Connection less. It means, No dedicated path is established and data can transfer in any order.
Reliability it has high reliability because of connection oriented. it has less reliability because of connection less
Error control Error control is mandatory in TCP Error control is optional in TCP
Header Size It has 20 to 60 byte Header size which increases the size of packet. So, it has More overhead as compare to UDP It has 8 byte Header size which reduces the size of packet as compare to TCP. So it has Less overhead
Transmission Speed Transmission speed of TCP is very low as compare to UDP, because of single dedicated transmission path and larger the size of TCP Header. Transmission speed of UDP is High as compare to UDP, because of multiple dedicated transmission path and smaller the size of UDP Header.
Flow control Flow control and congestion control are compulsory No Flow control and congestion control
Use It is mostly used in File transfer protocols (FTP), HTTP where loss of data is not tolerated. It is mostly used in Skype, DHCP, DNS, RIP where loss of data may tolerated

 

 

Help Other’s By Sharing…

Contact Us

Burewala, Vehari, Punjab, Pakistan

cstaleem1@gmail.com

Website: CStaleem.com

Pin It on Pinterest