Transport protocols run over the best-effort IP layer to provide a mechanism for applications to communicate with each other without directly interacting with the IP layer.
...
It’s important to note that the use of ports is crucial in the transport layer. Certainly, there can be multiple types of processes that may run on a single host at a particular time. In general, a single IP address is assigned to a host. A sender host sends the data to the receiver host with a port number. Furthermore, the receiver host can identify the port and will route the data to a specific process.
The services of Transport Layer
This layer is responsible for delivering the messages, not only from a host to another host but also from a specific process of a host to a specific process of another host.
End to end delivery
Reliability : in-order delivery, no loss of data, control of dta duplication
Flow control : prevent the overhead of data on the receiver host
...
Error control : use checksum bits, sender host generates a checksum using algo and receiver host decodes the checksum so it can detect the corrupted packets.
...
Multiplexing/Demultiplexing : It also facilitates the efficient use of the network by using multiplexing. There might be a case that multiple processes from the sender host need to send packets, but there is only one transport layer at a time. In this layer, a protocol accepts data from the different processes, differentiated by their assigned port, and adds them in the header.
On the receiver’s host, to process the incoming data, we need to perform demultiplexing. Here, the transport layer differentiates all the data and sends them to their respective processes according to their port addresses:
...