How it works
Before any data moves, TCP opens a connection with a three-way handshake (SYN, SYN-ACK, ACK). It then numbers every byte, waits for acknowledgements, resends whatever goes missing and slows down when the network is congested. The app on each end simply sees a clean, ordered stream of data.
Web pages over HTTP/1.1 and HTTP/2, email, SSH and database connections all run on TCP. The price of reliability is delay: a single lost packet holds up everything behind it until it is resent (head-of-line blocking). That is why video calls and online games use UDP instead, and why HTTP/3 moved to QUIC, which rebuilds reliability on top of UDP.
TCP vs the alternatives
Related terms
More in Networking
Network basics