| TCP | UDP |
|---|
| Definition | A connection-oriented transport providing an ordered byte stream with loss detection and retransmission. | A datagram transport that preserves message boundaries without providing delivery or ordering guarantees. |
|---|
| Data shape | A stream of bytes. Applications define their own message boundaries. | Separate datagrams. Each datagram has its own boundary. |
|---|
| Ordering and loss | Delivers stream bytes in order and retransmits lost data; a connection can still fail. | Datagrams may be lost, duplicated, or arrive out of order. UDP does not repair these events. |
|---|
| Connection setup | Ordinary connections begin with a three-way handshake. | UDP has no transport-level connection handshake. |
|---|
| Application responsibilities | Choose message framing and handle connection failure. | Choose any required recovery, ordering, and congestion-management behavior, often through a higher-level protocol such as QUIC. |
|---|
View in the full Protocols collection