In computer networking it the transport layer is where sessions are exchanged between hosts. This layer resides between the application layer and network layer the transport layer is a central piece of the layered architecture. It has the critical role of providing communication services directly to the application processes running on different hosts. A transport layer protocol provides logical communication between application processes running on different hosts. Figure illustrates the relationship of the network transport and application layers and the notation of logical communication. Transport layer protocols are implemented in the end systems but not in network routers. On the sending side the transport layer converts the messages receives from a sending application process into smaller chunks and adding a transport layer header to each chunk to create the transport layer segment. The transport layer then passes the segment to the network layer at sending end system where the segment is encapsulate d within a network layer packet a datagram and sent to the destination . it is important to note that network routes act only on the network layer segment encapsulated with the datagram. On the receiving side the network layer extracts the transport layer segment from the datagram and passes the segment up to the transport layer the transport layer then processes the received segment making available the data in the segment making available the data in the segment to the receiving application. The network layer doesn't generally guarantee that packets of data will arrive in the same order that they were sent but often this is a desirable feature so the transport layer is provided with the simplest way of doing this is to give each packet a number and allow the receiver to recorder the packet . the transport layer provides some other services like byte orientation flow control reliable data and ports.
The byte orientation services provides rather than dealing with things on a packet by packet basis. The transport layer may add be ability to view communication just as a stream of bytes. This is nice to deal with than random packet sizes however it rarely matches the communication model which will normally be a sequence of message of use defined sizes.
The amount of memory on a computer limited and without flow control a larger computer might flood a computer with so much information that it can't hold it all before dealing with it. Nowadays this is not a big issue as memory is cheap while bandwidth is comparatively expensive but in earlier time it was more important.
Reliable data packets may be lost in routers switches bridges and hosts due to network congestion when the packet queers are filled and the network nodes have to delete packets. Packets may be lost of corrupted in Ethernet due to interference and noise since Ethernet doesn't retransmit corrupted packets. Packets may be delivered in the wrong order by an underlying network some transport layer protocol for e, g, TCP can fix all these problems by means of error detection code for e, g, checks acknowledgment message, automatic repeat request and segment numbering of course error free is impossible but it possible to substantially reduce the numbers of undeleted error.
Ports are essentially ways to address multiple entities in the same location. For e ,g, the first line of a postal address is a kind of port and distinguishes between different occupants of the same house. computer applications will listen to each use for information on their own ports i ,e one can use more than one network based applications at the same time.
Transport layer lies just above the network layer in protocol stack whereas a transport layer protocol provides logical communication between running on different hosts a network layer provides logical communication between hosts.
More than one transport layer protocols may be available to network applications. For example the internet has two protocols transmission control protocol and user datagram protocol each of there protocols provides a different set of transport layer services to the invoking application.
The ultimate goal of the transport layer is provide efficient reliable and cost effective services to its users normally processes in the application layer. To achieve this goal the transport layer make use of the services provided by the network layer.