Protocols
Saved & recent

TCP vs UDP

TCPUDP
DefinitionA 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 shapeA stream of bytes. Applications define their own message boundaries.Separate datagrams. Each datagram has its own boundary.
Ordering and lossDelivers 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 setupOrdinary connections begin with a three-way handshake.UDP has no transport-level connection handshake.
Application responsibilitiesChoose message framing and handle connection failure.Choose any required recovery, ordering, and congestion-management behavior, often through a higher-level protocol such as QUIC.
Further reading

View in the full Protocols collection