Introduction
There are
two transport layer protocols: TCP and UDP. TCP – Transmission control
Protocol and UDP – User Datagram Protocol. In this post, we will discuss
difference between TCP and UDP.
Overview of TCP
There are
two transport layer protocols: TCP and UDP. TCP – Transmission control
Protocol and UDP – User Datagram Protocol. In this post, we will discuss
about TCP.
TCP
provides a connection-oriented. TCP provides process to process communication
through the port number. TCP provides reliable services; it means sender can
know that each packet reached at destination through the acknowledgement from
receiver. TCP provides flow control, error control and congestion control. TCP
does not support multicasting and broadcasting. It supports unicasting. The
unit of information passed by TCP to IP is called segment. TCP maintains a
checksum on its header and data. TCP must discard duplicate data. When TCP
transmits data between sender and receiver, it performs 3 phases. Which is as
follow.
Connection
Establishment – TCP uses 3-way handshaking technique to established a connection
between sender and receiver. This phase involves SYN, ACK and Window size.
Data
Transfer – In this phase, sender sends a data to destination.
Connection
Termination – When all the data transferred from sender to receiver, then sender
sends FIN packet to receiver to terminate the connection.
Need of TCP:
TCP is
used when transfer small amount data in secure manner. TCP protocol assurances
the integrity of data sent across the network. High-level protocols that need
to transmit data all use TCP protocol.
Overview of UDP
UDP
stands for User Datagram Protocol. UDP is a simple, datagram-oriented transport
layer protocol. UDP has been designed to transfer data packet over internet.
UDP is connectionless protocol provides no reliability or flow control
mechanisms. It also has no error recovery procedures. Several application layer’s
protocols such as TFTP and the RPC use UDP. UDP makes use of the port concept
to direct datagrams to the proper upper-layer applications. UDP serves as a simple application interface
to the IP.
Need of
UDP:
TCP
proves to be an overhead for certain kinds of applications. The Connection
Establishment Phase, Connection Termination Phase etc of TCP are
time consuming. To avoid this overhead, certain applications which require fast
speed and less overhead use UDP. UDP is used, where acknowledgement uses
significant bandwidth along with original data packet.
Difference between TCP and UDP
No. |
TCP |
UDP |
1 |
TCP is
connection oriented. |
UDP is connectionless. |
2 |
TCP
connection is byte stream. |
UDP
connection is message stream. |
3 |
TCP does
not support multicasting and broadcasting. |
UDP supports
broadcasting. |
4 |
It
provides error control and flow control. |
It
does not provide flow control and error control. |
5 |
TCP
supports full duplex transmission. |
UDP does
not support full duplex transmission. |
6 |
TCP
is reliable. |
UDP
is unreliable. |
7 |
TCP packet
is called segment. |
UDP packet
is called user datagram. |
No comments:
Post a Comment