#15 TCP AND UDP: THE NETWORKING SERIES

Sudarshan S
3 min readMar 8, 2022

Are you online? Of course you are! And that’s how you are reading this blog right now. Would you like to know how this is possible? This series is all about what it takes to be online and access internet!

Hey peeps, we know that for a successful transfer of packets, we need a destination IP address. But IP addresses only are not enough for successful packet transfer, there are some other protocols which come into play. Now it’s the correct time to learn about the “transport layer protocols” and the most common transport protocols. Let’s go!

Protocol Operations

A web server and a web client use specific protocols and standards in the process of information exchange to ensure that the messages are received and understood. The following are the various protocols at the four different levels of the TCP/IP model that are necessary to deliver a web page function.

  • Application Layer Protocol: Hypertext Transfer Protocol (HTTP) governs the way how the web server and web client interact. HTTP relies on the protocols to govern how the messages are transported between client and server.
  • Transport Layer Protocol: Transmission Control Protocol (TCP) is used to ensure that the packets are sent reliably, and any missing packets are resent.
  • Internetwork Layer Protocol: The most common internetwork layer protocol is Internet Protocol (IP).IP is responsible for taking the packets from TCP, assigning the logical address, and encapsulating them into packets for routing the destination host.
  • Network Access Layer: The specific protocol at the network access layer depends on the type of media and transmission methods used in the physical network.

TCP and UDP

In addition to the application protocols, all of the common internet services use Internet Protocol (IP) to address and route messages between source and destination. IP is concerned only with the addressing, structure and routing of packets. But IP does not specify how the delivery or transportation of the packets happen. The application decides which transport protocol to use. Transport protocol specify how to manage the transfer of messages between hosts. The most common transport protocols are “Transmission Control Protocol (TCP)” and “User Datagram Protocol (UDP)”.

TCP

The mechanism that ensure reliable delivery is the Transmission Control Protocol (TCP). An application uses TCP, when it requires acknowledgement that a message is delivered. TCP breaks the message into small pieces called segments. The segments are numbered in sequence and passed to IP process for assembly into packets. TCP keeps on tracking the number of segments that have been sent to a specific host. If the sender didn’t receive an acknowledgement, then it retransmits them.

UDP

This mechanism does not need an acknowledgement while transferring the information. Hence, in situations where TCP acknowledgement is not required, UDP can be used. And also TCP acknowledgement slows down information transfer in some cases. UDP is preferable with applications such as streaming audio and voice over IP (VoIP). An example for application that uses UDP is internet radio or G-meet [let’s be in trend ;)]. If some of the message is lost during the transmission, it is not retransmitted. If TCP were used instead of UDP here and the packets were lost and were resent, then it would stop for a while to receive them.

Another example to illustrate how UDP used is, how host resolves the domain names using DNS. DNS will use a UDP to resolve a name. It does not require the services of TCP because most DNS queries are resolved in one packet. And the DNS server also uses UDP to respond.

That’s about the transport layer protocols. I’ll catch you up in the next blog.

Until then, Stay connected!!

“Buy me a coffee” is a global platform where millions of people support creators and artists, financially.

--

--

Sudarshan S

Tech enthusiast | Developer | Machine learning | Data science | Cybersecurity