Transport Layer

In this tutorial, you will learn the basic concepts of Transport Layer. After reading this tutorial, you will learn about the services provided by the transport layer to the upper layer and the responsibilities of the transport layer.

Contents:

  1. Purpose of Transport Layer
  2. Services Provided to the Upper Layers
  3. Responsibilities of Transport Layer
  4. Process-to-Process Delivery
  5. Tracking Individual Conversations
  6. Segmentation and Reassemble
  7. Reliable and Unreliable Communication
  8. Error Control and Flow Control

Purpose of Transport Layer

The transport layer receives the data generated at the application layer. Its main objective is process-to-process delivery. The logical communication between the sender’s applications and the receiver’s applications is the responsibility of the transport layer.

The figure below describes the transport layer.

Transport Layer
  • As shown in the figure, the transport layer is the link between the application layer and the network layer. It transfers data as segments between applications running on devices in the network.
  • Basically, the transport layer does not know the destination device, the type of media used for communication, the path taken by the router to send the packet, congestion, size of the network, etc.
  • Generally, TCP and UDP are the main protocols of the transport layer.

Services Provided to the Upper Layers

The transport layer communicates with the network layer and uses the services provided by the network layer to achieve efficient, reliable, and cost-effective data transmission service. This work is done by the transport entity, which is software or hardware.

advertisement
advertisement

The diagram below explains the relationship between network, transport, and application layer.

Relation Between Network, Transport, and Application Layer
  • As shown in the figure, the network layer, transport layer, and application layer are communicating.
  • Transport layer services are mostly similar to network layer services. But the network layer mostly runs on the routers, and the transport layer runs entirely on the end-users machines.
  • Here, the network layer and the transport layer are different because users have no real control over the network layer, so they cannot solve poor service by adding better-performing routers or doing more error handling.
  • The upper three layers of the OSI model are the transport service users and the bottom 4 layers are the transport service providers.

Responsibilities of Transport Layer

The transport layer provides operations to the application program so that the user can access the services of the transport layer. Generally, the transport layer transports data from the source machine’s process to the process of the receiver machine with the desired level of reliability. The transmission is independent of the physical network.

The transport layer has the following responsibilities:

  • Process-to-process delivery
  • Tracking Individual Conversions
  • Segmentation and Reassemble
  • Reliable and Unreliable Communication
  • Error Control and Flow Control

Process-to-Process Delivery

There are many ways to achieve process-to-process communication, but the client/server paradigm is the most commonly used technology.

  • A local host wants services from a remote host. Here we are assuming localhost as client and remote host as a server.
  • Localhost wants to get day and time details from a remote machine, so localhost and remote need the DateTime client process and the DateTime server process running on the localhost and remote host, respectively.
  • For communication between localhost and remote host, we should define localhost, local process, remote host, and remote process in the transport layer. After defining them, we need an address to deliver the message.
  • In the transport layer, we have the port address, which is used to identify the process running on the machine.
  • The port address helps the transport layer to choose a process among multiple processes running on the destination device.
  • In the client/server paradigm, the destination port address is used for delivery and the source port address is used for receiving the reply from the receiver.

The diagram below illustrates how port addresses are used in process-to-process delivery.

how port addresses are used in process-to-process delivery
  • As shown in the figure, the daytime client machine uses the temporary port number 51,000, and the daytime server machine uses the well-known permanent port address 13.
  • The client sends the request to the server and in response, the server sends the day and time information because the well-known port number is set to 13, which is used for DateTime service.

Tracking Individual Conversations

In the transport layer, the data that flows from the sender process to the receiver process is known as conversation. The conversion is tracked separately by the transport layer.

advertisement
  • The Transport Layer maintains and tracks multiple conversations over the network.
  • On the host machine, multiple processes are running and communicating across the network simultaneously.
  • Different types of networks can handle different sizes of packets. They have limits on the amount of data that can be included in a packet. Therefore, larger data is divided into smaller pieces, known as segments, so that the transport layer can manage them easily.
  • Since the transport layer is tracking the segment information if a segment loss occurs the transport layer can resend that segment to the destination.
  • The network layer’s IP protocol has no mechanism to track packet information, so it communicates with the transport layer and uses the transport protocol to track and manage packet information.

Segmentation and Reassemble

In the transport layer, the data is in a segment format. It receives basic user data from the application layer and converts it into segments. If the data is large, the transport layer divides the data into smaller segments, making it easier to manage and transfer them.

The below diagram explains the segmentation and reassembling of data.

segmentation and reassembling of data
  • As shown in the figure, the transport layer receives data from the application layer and divides it into smaller segments, and adds headers.
  • Each segment gets a sequence number. Now, the segments will be sent to the destination machine.
  • As the destination machine receives the segments, it arranges the segments in sequence and combines them using header information to form the original message.
  • Joining the segments together and forming the original message is known as reassembling of data.
  • The data will then be sent to the application layer.
  • Here, the purpose of the sequence number is to avoid duplication. If a segment is lost during transmission, the sender checks the sequence number and resends the lost packet.

Reliable and Unreliable Communication

The transport layer provides two types of communication, reliable and unreliable. Reliable communications are slow and complex, while unreliable communications are faster and not overly complicated.

advertisement
  • If the user wants to use reliable communication, the transport layer provides reliable transport protocols by implementing flow and error control.
  • If the user has its own flow and error control mechanism or wants fast data transmission, the transport layer provides unreliable protocols, as the user does not require reliability.
  • In reliable communication, the in-order delivery of messages is guaranteed, whereas, in unreliable communication, there is no guarantee that the messages will reach the destination safely.
  • Generally, TCP protocol is used for reliable communication, and UDP protocol is used for unreliable communication in the transport layer.
  • Unreliable communication is fast because it does not track data information, while reliable communication is slow because it manages and tracks data information.
  • Flow and error control is also present in the data link layer, then why do we need the transport layer? Because in the data link layer, the reliability is between the end-devices, whereas in the transport layer, the reliability is between the processes.
  • The network layer has a best-effort distribution mechanism, so it uses unreliable communication. But to implement the reliability at the network layer, we need to implement the reliability at the transport layer.
  • To control flow and error during reliable communication, the sliding window protocol is used.

Error Control and Flow Control

Error control and flow control mechanisms provide reliability over a network. The error control mechanism is used to check whether the sent data has successfully reached the destination. The flow control mechanism manages the flow of data sent to the network.

  • The transport layer uses an error control mechanism to protect the segment during transmission. This is an end-to-end check.
  • Most TCP connections have a bandwidth-delay product, which is much larger than a single segment of the transport layer.
  • Buffers are needed on the sender and receiver sides to hold the segment. The sender buffer has transmitted as well as rejected segments. Buffers are needed because segments can be lost during transmission and need to be retransmitted.
  • If the segment sent by the sender is lost during transmission, there is no loss on the network, as the sender is ready to resend the lost segments. The sender continuously retransmits the lost segment until it receives an acknowledgment from the receiver.
  • The size of the buffer varies according to the type of traffic carried by the connection.

Key Points to Remember

Here is the list of key points we need to remember about “Transport Layer”.

  • The logical communication between the sender’s applications and the receiver’s applications is the responsibility of the transport layer. Its main objective is process-to-process delivery.
  • The transport layer communicates with the network layer and uses the services provided by the network layer to achieve efficient, reliable, and cost-effective data transmission service.
  • The transport layer has the following responsibilities.
    • Process-to-process delivery
    • Tracking Individual Conversions
    • Segmentation and Reassemble
    • Reliable and Unreliable Communication
    • Error Control and Flow Control
  • The port address helps the transport layer to choose a process among multiple processes running on the destination device.
  • In the transport layer, the data that flows from the sender process to the receiver process is known as conversation. The conversion is tracked separately by the transport layer.
  • The transport layer provides two types of communication, reliable and unreliable. Reliable communications are slow and complex, while unreliable communications are faster and not overly complicated.
  • The error control mechanism is used to check whether the sent data has successfully reached the destination. The flow control mechanism manages the flow of data sent to the network.

If you find any mistake above, kindly email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.