The transport layer is responsible for delivering data to the appropriate application process on the host computers. This involves
statistical multiplexing of data from different application processes, i.e., forming data segments, and adding source and destination port numbers in the header of each transport layer data segment. Together with the source and destination IP address, the port numbers constitute a
network socket, i.e., an identification address of the process-to-process communication. In the OSI model, this function is supported by the
session layer. Some transport layer protocols, for example TCP, but not UDP, support
virtual circuits, i.e., provide
connection-oriented communication over an underlying packet-oriented
datagram network. A byte stream is delivered while hiding the packet mode communication for the application processes. This involves connection establishment, dividing of the data stream into packets called segments, segment numbering and reordering of out-of-order data. Finally, some transport layer protocols, for example TCP, but not UDP, provide end-to-end reliable communication, i.e.,
error recovery by means of
error detecting code and
automatic repeat request (ARQ) protocol. The ARQ protocol also provides
flow control, which may be combined with
congestion avoidance. UDP is a very simple protocol and does not provide virtual circuits, nor reliable communication, delegating these functions to the
application program. UDP packets are called
datagrams, rather than segments. TCP is used for many protocols, including
HTTP web browsing and email transfer. UDP may be used for
multicasting and
broadcasting, since retransmissions are not possible to a large number of hosts. UDP typically gives higher
throughput and shorter latency and is therefore often used for real-time multimedia communication, where packet loss occasionally can be accepted, for example, IP-TV and IP-telephony, and for online computer games. Many non-IP-based networks, such as
X.25,
Frame Relay and
ATM, implement connection-oriented communication at the network or data link layer rather than the transport layer. In X.25, in telephone network modems and in wireless communication systems, reliable node-to-node communication is implemented at lower protocol layers. The OSI connection-mode transport layer protocol specification defines five classes of transport protocols:
TP0, providing the least error recovery, to
TP4, which is designed for less reliable networks. Due to
protocol ossification, TCP and UDP are the only widely used transport protocols on the Internet. To avoid
middlebox intolerance, new transport protocols may mimic the
wire image of a tolerated protocol, or
be encapsulated in UDP, accepting some overhead (e.g., due to outer checksums made redundant by inner integrity checks).
QUIC takes the latter approach, rebuilding reliable stream transport on top of UDP. ==Protocols==