TCP and UDP – Everything you need to know – 2023

The OSI Model defines the flow of the network traffic between the source and destination. If the traffic is initiated by a user using an Application, It will go to different layers including the Transport layer. The transport layer of the OSI Model is responsible for the end-to-end delivery of the data from source to destination either using TCP or UDP.

In this article, we will discuss the differences between the Transmission Control Protocol and the User Datagram protocol.

tcp-vs-udp

Transmission Control Protocol (TCP)

TCP stands for Transmission Control Protocol. It is one of the transport layer protocols. TCP protocol number is 6.

TCP protocol works on Layer 4 of the OSI (Open System Interconnection) model. This is the most widely used protocol in the network. TCP stands just before to IP header. In simple terms, whenever a data packet is encapsulated at layer 7 i.e. Application Layer, then it will first come to the Transport layer, where TCP Header is added to the original data packet. After adding this header (i.e. TCP Header), this data is called a Segment.

Recommended:  Computer Networks - LAN | WAN | MAN | PAN - Explained in Detail 2023

Before any transmission, TCP first establishes a reliable connection between both sender and receiver using the “Three Way-Handshake“. After that, the data transfer is started between them. Therefore, this protocol is also known as the Connection-Oriented protocol.

TCP guarantees the recipient will receive the data. Each time, whenever data bits, are transmitted from one end to another end, an acknowledgment message is sent to the sender. The next data bits or packets are only sent if the source device properly receives acknowledged messages. Therefore, this protocol is known as the Reliable Protocol.

TCP can check errors present in Packets. If there are any errors present in the data packet, TCP simply discards that packet and requests the sender to send error-free data packets.

However, due to the overload of delivery and acknowledgment messages, the transmission speed is slow in comparison to UDP (User Datagram Protocol).

Protocols which use TCP : HTTP, HTTPS, FTP, Telnet, SSH.

User Datagram Protocol (UDP)

User Datagram Protocol (UDP) is another transport layer protocol. The UDP protocol number is 17.

Recommended:  DORA Process in DHCP - Explained in detail

User Datagram Protocol (UDP) is an unreliable transport layer protocol, which has no guarantees whether the recipient will receive the data or not.  UDP doesn’t have any connection establishment process like the Three-Way Handshake in TCP protocol. Therefore, this protocol is also known as a connectionless protocol.

UDP gives a high transmission speed between the sender and receiver. Therefore, it is used in high-speed deserving applications like Live Broadcasts and Telephonic conversations. As UDP doesn’t have an error checking and correction mechanism, therefore, UDP is suitable for purposes where error checking and correction are either not necessary or are performed in the application itself.

Protocol which use UDP : DHCP, DNS.

Common between TCP and UDP

Although, TCP and UDP are different protocols they have some similarities. Both, TCP and UDP protocols work on the Transport Layer of the OSI Reference Model. The Data from the Application layer first interacts either with TCP or with UDP. TCP or UDP encapsulate their headers on this data to form a segment and then send this to the IP protocol.

Recommended:  TCP/IP Model - Explained 4 Layers of TCP/IP Model in detail

Related Articles

References

Summary

TCP and UDP, both protocols are widely used in network communication. TCP is a connection-oriented, reliable but slow protocol. UDP is a fast, unreliable, and connectionless protocol. Both protocols have their advantages and disadvantages. Some application layer protocols use TCP and some protocols use UDP.

Did you find this guide helpful? Please, comment your views in comment box.

Leave a Reply

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