Difference between Transport Layer and Network Layer
Overview
The network layer and transport layer are two of the seven layers of the OSI model. The network layer is the third layer of the OSI model which provides communication between hosts of different networks. The transport layer is the fourth layer of the OSI model which is responsible for the process to process delivery of data. The network layer divides the data received from the transport layer in the form of packets. The main aim of the transport layer is to maintain order so that the data must be received in the same sequence as it was sent by the sender. The various protocols used in the network layer are IPv4, IPv6, ICMP (Internet Control Message Protocol), etc. The various devices used in this layer are Routers, Brouters, etc. The various protocols used in the transport layer are TCP (Transmission Control Protocol), UDP (User Datagram Protocol), etc. The various devices used in this layer are Segments, Load Balancers, etc.
Introduction to Transport Layer
Before learning about the difference between transport layer and network layer, let us first learn about computer networks and the OSI model in brief.
A computer network is a set of devices (computers) connected to exchange information and resources such as files etc. The main goals of computer networks are:
- Resource sharing (such as software sharing, program sharing, etc.)
- High Reliability (if one network link fails another can transfer the data).
- Cost Reduction (we can buy only required services from cloud services like GCloud, AWS, Azure, etc.).
- Communication (acts as a communication medium between sender and receiver).
- Load Sharing (a program may run on multiple machines).
The OSI model stands for Open Systems Interconnection model. The OSI model is also known as the ISO-OSI model as it was developed by ISO (International Organization for Standardization). It is a conceptual reference model that describes the entire flow of information from one computer to the other computer. The OSI model is a 7-layered model so it is also known as a 7-layered architecture model. The basic idea behind the layered architecture is to divide the design into smaller pieces. To reduce the design complexity, most networks are organized in a series of layers. The network layer and transport layer are two of the seven layers of the OSI model.
Now, let us discuss the transport layer briefly so that we can get a better understanding of the topic i.e. difference between transport layer and network layer.
The transport layer is the fourth layer of the OSI model which is responsible for the process to process delivery of data. The main aim of the transport layer is to maintain the order so that the data must be received in the same sequence as it was sent by the sender. The transport layer provides two types of services namely - connection-oriented and connection-less.
The functions provided by the transport layer are as follows:
- The transport layer maintains the order of data.
- It receives the data from the upper layer and converts it into smaller parts known as segments.
- One of the major tasks of the transport layer is to add the port addressing (addition of a port number to the header of the data). The port number is added so that the data can be sent to the respective process only.
- The transport layer on the receiver's end reassembles the segments to form the actual data.
- The transport layer also deals with flow control and error control.
Refer to the image below to see the basic transmission of data and working of the transport layer.
The various protocols used in this layer are:
- TCP (Transmission Control Protocol),
- UDP (User Datagram Protocol), etc.
The various devices used in this layer are:
- Segments,
- Load Balancers, etc.
Introduction to Network Layer
The network layer is the third layer of the OSI model which provides communication between hosts of different networks. The network layer divides the data received from the transport layer in the form of packets. The network layer provides two ways of communication namely - connection-oriented and connection-less.
Note:
- In connection-oriented communication, a communication session is established before any useful data can be transferred.
- In connection-less communication, the data can be transferred without establishing any connection.
The functions provided by the network layer are as follows:
- Logical Addressing: The network layer adds the logical address i.e. IP address (Internet Protocol address) if the packet crosses the network boundary. It helps in the proper identification of devices on the network. Hence, the network layer adds the source and destination address to the header of the packet.
- Routing: Routing simply means determining the best (optimal) path out of multiple paths from the source to the destination. So the network layer must choose the best routing path for the data to travel.
- If many devices are connected on the same router then there is a change of packet drop due as a router may not be able to handle all the requests. So, the network layer controls the congestion on the network as well.
Refer to the image below to see the basic transmission of data and the working of the network layer.
The various protocols used in this layer are:
- IPv4 (Internet Protocol version 4),
- IPv6 (Internet Protocol version 6),
- ICMP (Internet Control Message Protocol) etc.
The various devices used in this layer are:
- Routers,
- Brouters, etc.
Note: The network layer does not guarantee the delivery of packets to the destination. There is no reliability guarantee as well.
Relation between Transport and Network Layer
Before learning the difference between transport layer and network layer, let us understand how both these layers are interrelated.
As we know the layers of the OSI model are interrelated and the data is transferred from one form to the other among the seven layers. The transport layer is located just above the network layer. The network being the third layer takes the data from the transport layer (i.e. fourth layer) and adds the network layer header (as discussed above) to it. After adding the network layer header, the data gets forwarded to the data link layer.
Note:- The transport layer, as well as the network layer, provides two types of services namely - connection-oriented and connection-less.
Difference between Transport Layer and Network Layer
After discussing the transport layer, network layer, and their relation. Let us now discuss some of the differences between transport layer and network layer.
Transport Layer | Network Layer |
---|---|
The transport layer is the fourth layer of the OSI model. | The network layer is the third layer of the OSI model. |
The transport layer mainly deals with logical communication between the processes running on different hosts. | The network mainly deals with logical communication between the hosts present on the same or different network. |
The transport layer focuses on the process to process the delivery of data. | The network layer provides communication between hosts of different networks. |
The transport layer receives the data from the upper layer and converts it into smaller parts known as segments. | The network layer divides the data received from the transport layer in the form of packets. |
The transport layer performs the port addressing i.e. the addition of a port number to the header of the data. | The network layer adds the logical address i.e. IP address (Internet Protocol address) if the packet crosses the network boundary. |
The transport layer maintains the order of data. | The network layer does not focus on maintaining the order of the data packets |
The transport layer deals with the process-to-process communication or port-to-port communication. | The network layer deals with host-to-host communication. |
The various protocols used in the transport layer are TCP (Transmission Control Protocol), UDP (User Datagram Protocol), etc. | The various protocols used in the network layer are IPv4, IPv6, ICMP (Internet Control Message Protocol), etc. |
The various devices used in the transport are Segments, Load Balancers, etc. | The various devices used in the network layer are Routers, Brouters, etc. |
Conclusion
- The network layer is the third layer of the OSI model which provides communication between hosts of different networks.
- The transport layer is the fourth layer of the OSI model which is responsible for the process to process delivery of data.
- The network layer divides the data received from the transport layer in the form of packets. The network layer provides two ways of communication namely - connection-oriented and connection-less.
- The main aim of the transport layer is to maintain the order so that the data must be received in the same sequence as it was sent by the sender. The transport layer also provides two types of services namely - connection-oriented and connection-less.
- The transport layer deals with the process-to-process communication or the port-to-port communication. On the other hand, the network layer deals with host-to-host communication.
- The transport layer performs the port addressing i.e. the addition of a port number to the header of the data. On the other hand, the network layer adds the logical address i.e. IP address (Internet Protocol address) if the packet crosses the network boundary.
- The various protocols used in the network layer are IPv4, IPv6, ICMP (Internet Control Message Protocol), etc. The various devices used in this layer are Routers, Brouters, etc.
- The various protocols used in the transport layer are TCP (Transmission Control Protocol), UDP (User Datagram Protocol), etc. The various devices used in this layer are Segments, Load Balancers, etc.