All You Want To Know About The Transport Layer Of The TCP/IP Model (Brief Introduction)

Until now we have been looking into the important features of the Application layer and the different protocols used (FTP , SMTP, HTTP , etc). Now we will move into the next vital layer of the TCP/IP model i.e. the Transport Layer .

From now on we will explore the important functionalities of this layer (in the subsequent posts) . It is one of the core backbones of the internet model.

The transport layer is situated between the network and the application layer . Thus it takes services provided by the network layer and then provides services to the top layer (application layer).

 

All You Want To Know About The Transport Layer Of The TCP/IP Model (Brief Introduction)

The data link layer is basically responsible for the delivery of frames between two neighboring nodes over a link. This is called node-to-node delivery.

The network layer is mainly responsible for the delivery of datagrams between two hosts. This is called host-to-host delivery. Communication is on the Internet is not defined as the exchange of data between two nodes or between two hosts.

Real communication normally takes place between two processes (application programs). We need process-to-process delivery. Transport basically deals with the process to process delivery. Let us understand the duties of this layer first :

  • Flow Control
  • Error Control
  • Addressing
  • Connection Control
  • Packetizing

We will dig each of these functions in detail in the subsequent posts . Let us see a brief overview of these functions for now :

1. Flow Control and Error Control

The transport layer also can provide flow control. But this flow control is performed end to end and not across a single link . The transport layer can further provide error control as well.

But error control at the transport layer is performed end to end and not across a single link. Error correction is generally achieved by re-transmission of the packets discarded due to errors.

2.  Addressing

The client needs the address of the remote computer it wants to communicate with. Such a remote computer has a unique address so that it can be distinguished from all the other computers.

3. Connection Control

Transport layer provides two types of services , connectionless and connection-oriented  services. A connection-oriented transport layer protocol will establish a connection i.e. virtual path between sender and receiver. A connectionless transport protocol will treat each of the packets independently. There is no connection between them.

4. Packetizing

The transport layer creates packets with the help of encapsulation on the messages received from the application layer. This is a process of dividing a long message into smaller ones. These packets are then encapsulated into the data field of the transport layer packet. The headers containing source and destination addresses are then added.

Congestion Control and QoS (quality of service)

The congestion can take place in the data link, network, or transport layer. But the effect of congestion is generally enhanced in the transport layer. The transport layer enhances the QoS provided by the network layer.

Addressing in Transport Layer 

At the data link layer we need a MAC address, at the network layer we need to use an IP address. A datagram uses the destination IP address to deliver the datagram and uses the source IP address for the destination’s reply. 

At the transport layer, a transport layer address called a port number is required to be used to choose among multiple processes running on the destination host. 

The destination port number is required to make the packet delivery and the source port number is needed to return back the reply. The client program identifies itself with a port number that is chosen randomly. This number is called as ephemeral port number . 

The server process should also identify itself with a port number but this port number can not be chosen randomlyThe Internet uses universal port numbers for servers and these numbers are called as well known port numbers. Every client process knows the well-known port numbers of the pre-identified server process.

Basic difference between IP address and a Port number

The IP addresses and port numbers have altogether different roles in selecting the final destination of data. The destination IP address is used for defining a particular host among the millions of hosts (individual machines) in the world. 

After a particular host is selected, the port number is used for identifying one of the processes on this selected host.

The port numbers are divided into three ranges by IANA (International Assigned Number Authority). The ranges are as follows :

1. Well known ports (The ports from 0 to 1023 are known as well known ports. They are assigned as well as controlled by lANA)

2. Registered ports (The ports from 1024 to 49,151 are neither controlled nor assigned by lANA. We can only register them with lANA to avoid duplication)

3. Dynamic or private ports (The ports from 49,152 to 63,535 are known as dynamic ports and they are neither controlled nor registered. They can be used by any process)

The process to process delivery (transport layer communication) has to use two addresses, one is IP  address and the other is port number at each end to make a connection.

Hence a process to process delivery uses the combination of these two. The client socket address mainly defines the client process uniquely whereas the server socket address defines the server process uniquely. 

A transport layer protocol then requires the client socket address as well as the server socket address. These two addresses contain four pieces. The IP header contains the IP addresses while the UDP and TCP headers contain the port numbers.

Multiplexing and Demultiplexing in Transport Layer

The addressing mechanism allows multiplexing and demultiplexing taking place at the transport layer.

Multiplexing :

At the sending end, there are several processes that are interested in sending packets. But there is only one transport layer protocol (UDP or TCP). Thus it is a many processes-one transport layer protocol situation. Such a many-to-one relationship requires multiplexing. 

The protocol first accepts messages from different processes. These messages are separated from each other by their port numbers. Each process has a unique port number assigned to it. Then the transport layer adds a header and passes the packet to the network layer .

Demultiplexing :

At the receiving end, the relationship is one as to many. So we need a demultiplexer. First the transport layer receives datagram packets from the network layer. The transport layer then checks for errors and drops the header to obtain the messages and delivers them to the appropriate process based on the port number.

 

All You Want To Know About The Transport Layer Of The TCP/IP Model (Brief Introduction)

Connectionless vs Connection Oriented service in Transport Layer

The Connection-oriented services, as the name suggests establishes a dedicated connection between the users before data is exchanged. The establishment of connection may take place on the physical level or logical level and needs some kind of signalling.

 This type of connection establishment needs some form of resource reservation (such as bandwidth). After the connection establishment, the actual data transfer will take place. After the exchange of data, the connection is cleared or broken(terminated). The best-known example of a connection-oriented service is the telephone network.

Now, the Connectionless type of service does not require a connection to be established in order to exchange data. Instead, information is transferred by using independent data units.

Each data unit contains the complete destination address. This is analogous to the postal mailing service. This connectionless service can exchange data without setting an explicit communication path or connection. 

The packets are not numbered. They can get delayed, lost, or can arrive out of sequence. There is no acknowledgement, UDP is a connectionless protocol.

Concept of Reliability in Transport Layer

If the application layer program needs reliability then the reliable transport layer protocol is used which implements the flow and error control at the transport layer.

But this service will be slow and more complex. Some application layer programs do not need reliability because they have their own flow and error control mechanisms. Such programs use an unreliable service. 

UDP is connectionless and unreliable, but TCP is a connection-oriented and reliable protocol. Both these are transport layer protocols. The error control at the data link layer does not guarantee error control at the transport layer.

The network layer service on the Internet is unreliable. Hence reliability at the transport layer must be ensured independently. Therefore flow and error controls are implemented in TCP using the sliding window protocols. This is reliability assurance at the transport layer.

Last but not the least , the original TCP/IP protocol suite specifies two protocols for the transport layer i.e.  UDP and TCP (will be explained in the next post). We first see UDP, the simpler of the two, before discussing TCP .  So stay tuned.

Spread the Wisdom !!

Techie Aric

Aric is a tech enthusiast , who love to write about the tech related products and 'How To' blogs . IT Engineer by profession , right now working in the Automation field in a Software product company . The other hobbies includes singing , trekking and writing blogs .

Leave a Reply

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