The transport layer ensures that messages are delivered in the order in which they are sent and that there is no loss or duplication.
The size and complexity of a transport protocol depends on the type of service available from the network and data-link layers. For a reliable network layer or data-link layer with virtual-circuit capability, such as the LLC layer of NetBEUI, the transport layer is required only to pass the data through to the next layer. If the network layer or data-link layer is unreliable or supports only datagrams, like the IP layer of TCP/IP and the IPX layer of IPX/SPX do, the transport layer includes sequencing and acknowledgment, and associated error detection and recovery.
Functions of the transport layer include the following:
Accepting messages from the layer above and, if necessary, splitting them into segments.
Providing reliable, end-to-end message delivery with acknowledgments.
Instructing the transmitting computer not to transmit when no reception buffers are available.
Multiplexing several process-to-process message streams or sessions onto one logical link and tracking which messages belong to which sessions.
The transport layer can accept large messages, but there are strict size limits imposed by the layers at the network level and lower. Consequently, the transport layer must break up the messages into smaller units, called segments , and attach a header to each frame.
If the lower layers do not maintain sequence, the transport header must contain sequence information, which enables the transport layer on the receiving end to present data in the correct sequence to the next higher layer.
Unlike the lower layers that have protocols that are concerned with connecting to immediately adjacent nodes or computers, the transport layer and the layers above it are true source-to-destination layers, also known as end-to-end layers. These upper layers are not concerned with the details of the underlying communications facility. Software for these layers communicates with similar software on the destination computer by using message headers and control messages.