Layer 4 — Transport

TCP, UDP, ports, handshakes, flow control, and how data is reliably (or not) delivered end to end.

TCP — Reliable Delivery at the Transport Layer

TCP

How TCP establishes connections, guarantees delivery order, controls flow, and tears down sessions — and what all of that looks like on the wire.

layer4tcptransporthandshakereliabilityrfc9293

UDP — Fast, Stateless Transport

UDP

How UDP delivers datagrams without connection setup, acknowledgment, or ordering — why this simplicity makes it the right choice for real-time applications, DNS, and any protocol that builds its own reliability layer.

layer4udpdatagramstatelessdnsvoiprfc768

TCP vs UDP — Choosing the Right Transport

TCP-VS-UDP

A direct comparison of TCP and UDP across reliability, latency, overhead, and real-world application fit — and when the right answer is neither, and you should build on UDP with a custom protocol like QUIC.

layer4tcpudpcomparisontransportquiclatencyreliability

Ports & Sockets — Multiplexing Transport Connections

PORTS-SOCKETS

How port numbers identify services and distinguish connections on the same IP address, what a socket is and how the 5-tuple uniquely identifies every TCP connection, and the difference between well-known, registered, and ephemeral port ranges.

layer4portssocketsephemeralwell-known-ports5-tuplemultiplexingrfc6335

RTP — Real-Time Transport Protocol

RTP

How RTP carries real-time audio and video over UDP, what the RTP header provides for jitter compensation and payload identification, and how RTCP provides feedback and synchronization between media streams.

layer4rtprtcpvoipstreamingjittertimestamprfc3550