• Networking
  • Programming
  • DBMS
  • Operating System
  • Internet
  • Hardware
  • Software

Tech Differences

Know the Technical Differences

Difference Between TCP and UDP

TCP and UDPTCP and UDP are the transport layer protocols that are responsible to provide end-to-end communication. However, TCP is a connection-oriented protocol whereas, UDP is a connection-less protocol. Do you know why we require these protocols?

Well, the layer 3 protocol that works on the IP is usually connectionless, unacknowledgeable and unreliable. Thus, these protocols don’t provide the guaranteed delivery of data. So, there was a need for a protocol that would resolve the problems like congestion, error, and flow control.

Although, designers also thought to build these abilities directly into the IP. But all these features come at the cost of time and bandwidth. So, the designers came up with the protocols TCP and UPD that provide congestion, error, and flow control.

Among these protocols, UDP is a simple protocol. It only sends packets between the applications present on different hosts. However, TCP is a complex protocol that provides more features such as:

  • Establishing connection
  • Provides reliability with retransmission
  • Flow, congestion and error control

Let’s discuss TCP and UDP protocols in detail and also the differences between them.

Content: TCP Vs UDP

  1. Comparison Chart
  2. What is TCP?
    • Functions of TCP
    • TCP Protocols List
  3. What is UDP?
    • Functions of UDP
    • UDP Protocols List
  4. Key Differences
  5. Conclusion

Comparison Chart

Basis for ComparisonTCPUDP
Meaning
TCP establishes a connection between the computers before transmitting the dataUDP sends the data directly to the destination computer without checking whether the system is ready to receive or not
Expands toTransmission Control ProtocolUser Datagram Protocol
Connection TypeConnection Oriented
Connection Less
SpeedSlowFast
ReliabilityHighly ReliableUnreliable
Header Size 20 Bytes
8 Bytes
AcknowledgementIt takes acknowledgement of data and has the ability to retransmit if the user requests.It neither takes acknowledgement, nor it retransmits the lost data.
Protocol connection setupConnection-oriented, the connection must be established prior to transmissionConnectionless, data is sent without setup
Data interface to the applicationStream-basedMessage-based
RetransmissionsDelivery of all data is managedNot performed
Features provided to manage the flow of dataFlow control using sliding window protocolNone
OverheadsLow but greater than the UDPVery low
Data quantity suitabilitySmall to moderate amounts of dataSmall to enormous amounts of the data
Implemented overApplications where reliable transmission of data matters.Application where data delivery speed matters.
Applications and protocolsFTP, Telnet, SMTP, IMAP etcetera.DNS, BOOTP, DHCP, TFTP etcetera.

What is TCP?

Transmission Control Protocol (TCP) is a transport layer protocol of the TCP/ IP model. It is a connection-oriented protocol. So, the protocol first establishes a connection between source and destination. Further, the source and destination start communicating over this established path.
Transmission Control Protocol

TCP implements a three-way handshake protocol. It also facilitates flow control, error control and congestion control. This makes the TCP highly reliable.

TCP ensures that the data sent from the source reaches the destination in the correct order. If in case, data received is not in the proper format, then TCP retransmits the data.

TCP uses a sliding window system for transmission. It helps in detecting acknowledged transmission. It also automatically retransmits the data that failed to receive.

Functions performed by TCP

  • Addressing/multiplexing
    TCP ports determine higher-layer application processes. The higher layer mainly multiplexes the data received from the various processes. Further, it sends the multiplexed data with the help of the underlying network layer protocol.
  • Establishing, managing and terminating connections
    Devices on different networks that want to communicate have to follow a group of procedures to set up a connection between them. Through this connection, the data can travel from one device to other. TCP protocol further manages the established connection. When communication gets finished, the protocol terminates this connection.
  • Handling and packaging data
    TCP protocol receives the data from higher layers and packs it into the message to send it to the destination TCP software further. The software residing at the receiving end unpackages the data and supplies it to the application on the destination machine.
  • Transferring data
    The packaged data is transferred to the TCP process running on the other devices by following the layering principle.
  • Providing reliability and transmission quality services
    TCP provides the services that permit an application to consider the protocol a reliable medium of transferring the data.
  • Providing flow control and congestion avoidance features
    The protocol controls the flow of the data between the two devices and deals with congestion.

TCP Protocols

  • HTTP(Hypertext Transfer Protocol)
  • HTTPS(Hypertext Transfer Protocol Secure)
  • FTP(File Transfer Protocol)
  • SMTP(Simple Mail Transfer Protocol), etc.

What is UDP?

UDP or User Datagram Protocol is a connectionless protocol of the transport layer of the TCP/IP Model. It neither establishes a connection nor checks whether the destination computer is ready to receive or not. The protocol simply sends the data to the destination computer.

However, it transfers the data at a faster rate as compared to TCP. The protocol is comparatively less reliable. Therefore, used for transmitting data such as audio and video files.

UDP neither guarantees the delivery of data nor does it retransmits the lost packets. It is just a wrapper protocol that facilitates the application in accessing the IP.

Functions performed by UDP

The main task of a UDP is to take data from the higher-layer protocols and position it in UDP messages. These messages are then moved to the IP for transmission. It follows some specific steps to transmit the data which as discussed below.

  • Higher-Layer Data Transfer
    At first, the message is sent to the UDP software by an application.
  • UDP Message Encapsulation
    The message is encapsulated into the data field of the packet. The headers of the UDP message along with the source port field and destination port field, are added. It also computes the checksum value.
  • Transfer message to IP
    At last, the UDP message is transferred to the IP for transmission.

User Datagram ProtocolSimilarly, when the destination end receives the message, this whole process gets reversed.

UDP Protocols

  • BOOTP(Bootstrap Protocol),
  • DHCP(Dynamic Host Configuration Protocol),
  • DNS(Domain Name Server),
  • TFTP(Trivial File Transfer Protocol), etc.

Key Differences Between TCP and UDP

  1. TCP is Connection-oriented whereas, UDP is a connectionless protocol.
  2. TCP is highly reliable for transferring useful data as it takes the acknowledgement of information sent. Also, resends the lost packets if any. Whereas in the case of UDP if the packet is lost it won’t request for retransmission and the destination computer receives corrupt data. So, UDP is an unreliable protocol.
  3. TCP is slower as compared to UDP since TCP establishes the connection before transmitting data, and ensures the proper delivery of packets. On the other hand, UDP does not acknowledge whether the data transmitted is received or not.
  4. The header size of UDP is 8 bytes, and that of TCP is more than double. TCP header size is 20 bytes since, and the TCP header contains options, padding, checksum, flags, data offset, acknowledgement number, sequence number, source and destination ports, etc.
  5. Both TCP and UDP can check for errors, but only TCP can correct the error since it has both congestion and flow control.

Conclusion

Both TCP and UDP have their advantages and disadvantages. UDP is faster, simpler and efficient and hence generally used for sending audio, and video files. TCP, on the other hand, is robust, reliable and guarantees the delivery of packets in the same order.

Hence, we conclude that both TCP and UDP are essential for data transmission.

Related Differences:

  1. Difference Between TCP/IP and OSI Model
  2. Difference Between Stop-and-Wait Protocol and Sliding Window Protocol
  3. Difference Between Flow Control and Congestion Control
  4. Difference Between Flow Control and Error Control
  5. Difference Between Connection-oriented and Connection-less Services

Comments

  1. Shikha says

    October 1, 2019 at 7:02 pm

    Very elaborative information…..

    Reply
  2. s.manikanta says

    October 31, 2019 at 12:52 pm

    I have learned the differences, thanks.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Top 10 Differences

  • Difference Between OLTP and OLAP
  • Difference Between while and do-while Loop
  • Difference Between Guided and Unguided Media
  • Difference Between Preemptive and Non-Preemptive Scheduling in OS
  • Difference Between LAN, MAN and WAN
  • Difference Between if-else and switch
  • Difference Between dispose() and finalize() in C#
  • Difference Between for and while loop
  • Difference Between View and Materialized View
  • Difference Between Server-side Scripting and Client-side Scripting

Recent Addition

  • Difference Between Java and Python
  • Difference Between PHP and HTML
  • Difference Between GPS and GNSS 
  • Difference Between Virtualization and Containerization
  • Difference Between Storage and Memory

Categories

  • Artificial Intelligence
  • DBMS
  • Hardware
  • Internet
  • Networking
  • Operating System
  • Programming
  • Software

Copyright © 2025 · Tech Differences · Contact Us · About Us · Privacy