Table of contents
1.
Introduction
2.
TCP (Transmission Control Protocol)
3.
UDP (User Datagram Protocol)
4.
Frequently Asked Questions
4.1.
What is trace routing?
4.2.
What is the use of BOOTP and DHCP? 
4.3.
Why is data transmission necessary?
5.
Conclusion
Last Updated: Mar 27, 2024

Transport layer protocols

Author Urwashi Priya
1 upvote
Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

In a computer network, a sender and a receiver exist to exchange data via some connection. Some protocols ensure that the receiver understands the data sent by the sender. Many functionalities, namely error control, flow control, encryption/decryption, etc., are used in this two-way communication. These functionalities are grouped in a standardized model, the OSI (Open System Interconnect). This model is divided into various layers, as given below.

OSI Model

In this blog, we will discuss Transport layer protocols, the 4th layer of the OSI model. This layer provides communication services between the computers connected to the network. The main aim of this layer is process-to-process delivery or end-to-end delivery, as it transfers packets or messages from one process to another. The transport layer mainly consists of two protocols: TCP and UDP. We will be discussing both of them.

TCP (Transmission Control Protocol)

TCP Header

Every segment of TCP has a header. TCP is an end-to-end protocol. It supports multiplexing and Demultiplexing for identification because of the presence of the source port and destination port. The transmission control protocol(TCP) is a connection-oriented protocol, meaning that resources, including buffers, bandwidth, and CPU, are reserved.

The sequence number, a 32-bit field, is a byte number. TCP, being byte stream protocol, every byte sent is to be counted, and each one of them is labeled by a number. The sequence number field consists of the first byte of the sequence.

The acknowledgment number consists of the sequence number of the byte expected next.

The header length field consists of the size of the header.

SYN flag, also called a synchronisation flag, is used to synchronise the sequence numbers, and the ACK flag, also called an acknowledgment flag, indicates whether the acknowledge field is used or not. The FIN flag, also called the finish flag, terminates the connection.

The PSH flag, also called the push flag, is used to say TCP not to buffer the message and send the data immediately, even if the message is less than the maximum segment size.

The URG flag, also called the urgent flag, is used to prioritise. The urgent pointer indicates what part of the data is urgent. The RST flag, also called the reset flag, is used when something is wrong and we want to restart it.

The window size denotes the total size of the buffer. The checksum is used to check corruption in data packets.

The window size denotes the total size of the buffer. The checksum is used to check corruption in data packets.

UDP (User Datagram Protocol)

A user datagram protocol(UDP) is a connectionless protocol and does not guarantee reliability as in the case of Transmission control protocol.

Need for UDP:

  • If the application needs one request, one reply. Such applications are: DNS( Domain Name Server), BOOTP, DHCP, etc
  • In broadcasting and multicasting operation.
  • The application which requires speed over reliability. For example, online multimedia games.
UDP Header

Here source port and destination port is used to send and receive packets. Length denotes the total length of the UDP header and data.

UDP has the following options:

  • Tracerouting 
  • Record route
  • Time Stamp
  • ICMP error - destination unreachable, source quench.

If the file size is small, and does not need reliability, we use UDP.

Until now, I assume you must have a basic idea about Transport layer protocols.

Frequently Asked Questions

What is trace routing?

This command-line utility shows the route data packets take to travel across the internet. The user datagram protocol provides this option. Traceroute can help to find bottleneck problems.

What is the use of BOOTP and DHCP? 

BOOTP also called a bootstrap protocol, and DHCP, also called dynamic host configuration protocol, are used to obtain an IP address from a server by a client. DHCP has more options and flexibility. BOOT P has errors as it uses manual configuration, whereas DHCP does everything using autoconfiguration.

Why is data transmission necessary?

Data transmission is essential because an enormous amount of data and many complex tasks are to be performed. So if we don’t understand the concept behind this, we cannot figure out the best performance, causing a system lag.

 Also See - Locked based protocol in DBMS 

Conclusion

This article taught us about various Transport layer protocols. We discussed individually about TCP, UDP, their header, each field’s use and their need.

We hope you could easily take away all critical and conceptual techniques by walking over the given examples. 

You can refer to our Guided Path on Coding Ninjas Studio to upskill yourself in Data Structures and AlgorithmsCompetitive ProgrammingJavaScriptSQLSystem Design, and many more!

If you want to test your competency in coding, you may check out the Mock Test Series and participate in the Contests organized on Coding Ninjas Studio! But if you have just started your learning process and are looking for questions asked by tech giants like Amazon, Microsoft, Uber, etc; you must look at the Problems, Interview Experiences, and Interview Bundle for placement preparations.

Nevertheless, you may consider our Courses to give your career an edge over others!

Do upvote our blog to help other ninjas grow. 

Happy Coding!    

 

Live masterclass