TCP vs UDP : Difference Between TCP and UDP

TCP:- Transmission control protocol

UDP:- User datagram protocol

TCP (Transmission control protocol)

TCP is a connection-oriented internet protocol, which means that once a connection is established, data can be sent bidirectional. It is specifically designed as a model to offer highly reliable and end-to-end byte stream over the unreliable internetwork. It is one of the most widely used internet protocol. TCP helps us to create a virtual network when multiple computer networks are connected.

Features of TCP

  • Duplex: TCP allows data transfer in both directions.
  • Reliability: TCP is the most reliable data transfer medium. In order to provide reliability, It recovers data from Network layer if data is damaged, duplicated, lost. It provides error-checking and recovery mechanism and ensures that the data reaches its destination in the same order it was sent.
  • Connection: TCP offers end-to-end byte stream between Client and Server

UDP (User datagram protocol)

UDP is a connectionless Internet protocol, which means that no connection establishes prior to communication. It is used for broadcast and multicast type of network transmission. It does not guarantee the delivery of data packets. It does not even care whether the data has been received on the receiver’s end or not. UDP is also known as fire and forgot protocol.

TCP vs UDP (Difference Between TCP and UDP)

 

TCPUDP
It is a connection-oriented internet protocol.It is a connectionless Internet protocol
TCP is highly reliable as it guarantees the delivery of data to the destination.UDP is not reliable compared to TCP as it doesn’t guarantee the delivery of data to the destination.
It is slower than UDPIt is faster and more efficient than TCP
It doesn’t support BroadcastingIt supports Broadcasting
The TCP connection is a byte stream.UDP connection is message stream.
The size of TCP is 20-60 bytes (Variable).The size of the UDP is 8 bytes. (Fixed)
It performs error checking by using a checksum.

When the data is corrected, then the data is retransmitted to the receiver.

It does not perform any error checking, and also does not resend the lost data packets.
It is used by FTP, HTTPs, HTTP, Telnet and SMTPIt is used by TFTP, SNMP, DNS, RIP, VoIP and DHCP