This article may be too technical for most readers to understand. (March 2025) |

| Internet protocol suite |
|---|
| Application layer |
| Transport layer |
| Internet layer |
| Link layer |
In computer networking, the transport layer is an abstraction layer in a network protocol stack that provides communication services between applications. Depending on the protocol, these services may include connection-oriented communication, reliable and ordered delivery, flow control, congestion control, and the multiplexing of communication between applications.
The transport layer is defined in both the Internet protocol suite and the OSI model, although the functions assigned to it differ between the two architectures. In the OSI model, the transport layer is Layer 4 (L4). The layers of the Internet protocol suite are not formally numbered.
The principal transport protocols of the Internet protocol suite are the Transmission Control Protocol (TCP) and the User Datagram Protocol (UDP). TCP provides a connection-oriented, reliable byte stream service, while UDP provides a connectionless datagram service with fewer protocol mechanisms. Other transport protocols include the Stream Control Transmission Protocol (SCTP) and the Datagram Congestion Control Protocol (DCCP). Newer transport protocols, such as QUIC, may be implemented over UDP.
| OSI model by layer |
|---|
Transport layer services are conveyed to an application via a programming interface to the transport layer protocols. The services may include the following features:
In the Internet protocol suite, transport-layer protocols provide communication between application programs running on different hosts. TCP uses port numbers to identify application services and to multiplex distinct flows between hosts; UDP similarly defines source and destination port fields, with the destination port interpreted in the context of a particular Internet destination address. A socket address combines an Internet address with a transport-layer port; in TCP, a connection is identified by a pair of sockets.
TCP provides a connection-oriented, reliable, in-order byte-stream service. The application byte stream is carried over the network in TCP segments, each sent as an IP datagram; TCP reliability is based on sequence numbers, checksums, acknowledgments, and retransmission of lost or corrupted segments. TCP also includes flow-control mechanisms based on advertised windows, and TCP endpoints are required to implement basic congestion-control algorithms such as slow start, congestion avoidance, and exponential backoff of retransmission timeouts.
UDP provides a minimal, connectionless, message-oriented transport service. RFC 768 describes UDP as providing a procedure for application programs to send messages with a minimum of protocol mechanism, without guarantees of delivery or duplicate protection; applications that require ordered, reliable streams of data are directed to use TCP instead. RFC 8085 similarly describes UDP as a minimal, unreliable, best-effort message-passing transport, and notes that applications using UDP may need to implement additional mechanisms for reliability, congestion control, checksums, or other functions depending on their use case.
UDP is also commonly used for multicast and broadcast applications, but such uses complicate congestion control, flow control, and reliability because a sender may transmit to many receivers over heterogeneous paths. The IETF has defined reliable multicast frameworks and building blocks, so reliability is not impossible for multicast applications; rather, it is not provided by UDP itself and must be supplied by the application or by additional protocols.
The OSI connection-mode transport protocol specification defines five classes of transport protocol, designated class 0 (TP0) through class 4 (TP4). Class 0 provides no error recovery and was designed for use over network services that provide error-free connections, while class 4 includes error recovery and can operate over less reliable network services.
Due to protocol ossification, TCP and UDP have been described as 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. QUIC follows the latter approach: the QUIC specification defines it as a UDP-based transport protocol whose packets are carried in UDP datagrams, while QUIC itself provides connections, streams, reliable delivery, flow control, and congestion control.
This list shows some protocols that are commonly placed in the transport layers of the Internet protocol suite, the OSI protocol suite, NetWare's IPX/SPX, AppleTalk, and Fibre Channel.
| Feature | UDP | UDP-Lite | TCP | Multipath TCP | SCTP | DCCP | RUDP |
|---|---|---|---|---|---|---|---|
| Packet header size | 8 bytes | 8 bytes | 20–60 bytes | 50–90 bytes | 12 bytes | 12 or 16 bytes | 14+ bytes |
| Typical data-packet overhead | 8 bytes | 8 bytes | 20 bytes | ?? bytes | 44–48+ bytes | 12 or 16 bytes | 14 bytes |
| Transport-layer packet entity | Datagram | Datagram | Segment | Segment | Datagram | Datagram | Datagram |
| Connection-oriented | No | No | Yes | Yes | Yes | Yes | Yes |
| Reliable transport | No | No | Yes | Yes | Yes | No | Yes |
| Unreliable transport | Yes | Yes | No | No | Yes | Yes | Yes |
| Preserve message boundary | Yes | Yes | No | No | Yes | Yes | Yes |
| Delivery | Unordered | Unordered | Ordered | Ordered | Ordered / Unordered | Unordered | Unordered |
| Data checksum | Optional | Yes | Yes | Yes | Yes | Yes | Optional |
| Checksum size | 16 bits | 16 bits | 16 bits | 16 bits | 32 bits | 16 bits | 16 bits |
| Partial checksum | No | Yes | No | No | No | Yes | No |
| Path MTU | No | No | Yes | Yes | Yes | Yes | ? |
| Flow control | No | No | Yes | Yes | Yes | No | Yes |
| Congestion control | No | No | Yes | Yes | Yes | Yes | ? |
| Explicit Congestion Notification | No | No | Yes | Yes | Yes | Yes | ? |
| Multiple streams | No | No | No | No | Yes | No | No |
| Multi-homing | No | No | No | Yes | Yes | No | No |
| Bundling / Nagle | No | No | Yes | Yes | Yes | No | ? |
ISO/IEC 8073/ITU-T Recommendation X.224, "Information Technology - Open Systems Interconnection - Protocol for providing the connection-mode transport service", defines five classes of connection-mode transport protocols designated class 0 (TP0) to class 4 (TP4). Class 0 contains no error recovery and was designed for use on network layers that provide error-free connections. Class 4 is closest to TCP, although TCP contains functions, such as the graceful close, which OSI assigns to the session layer. All OSI connection-mode protocol classes provide expedited data and preservation of record boundaries. Detailed characteristics of the classes are shown in the following table:
| Service | TP0 | TP1 | TP2 | TP3 | TP4 |
|---|---|---|---|---|---|
| Connection-oriented network | Yes | Yes | Yes | Yes | Yes |
| Connectionless network | No | No | No | No | Yes |
| Concatenation and separation | No | Yes | Yes | Yes | Yes |
| Segmentation and reassembly | Yes | Yes | Yes | Yes | Yes |
| Error recovery | No | Yes | No | Yes | Yes |
| Reinitiate connection (if an excessive number of PDUs are unacknowledged) | No | Yes | No | Yes | No |
| Multiplexing and demultiplexing over a single virtual circuit | No | No | Yes | Yes | Yes |
| Explicit flow control | No | No | Yes | Yes | Yes |
| Retransmission on timeout | No | No | No | No | Yes |
| Reliable Transport Service | No | Yes | No | Yes | Yes |
There is also a connectionless transport protocol, specified by ISO/IEC 8602/ITU-T Recommendation X.234.
Unlike IPv4, the default behavior when UDP packets are originated by an IPv6 node is that the UDP checksum is not optional.