Skip to content
EduVerse

TCP

In depth

Protocol / format

Also known as: Transmission Control Protocol

Reliable transport protocol that guarantees data arrives complete and in the right order.

TCP, explained

Written by EduVerse

What it is

TCP (Transmission Control Protocol) is one of the core transport protocols of the internet. Before sending data it opens a connection with a three-way handshake, then numbers the data, waits for acknowledgements and resends anything that gets lost. The receiving program gets an unbroken stream of bytes in the original order.

Why teams use it

Networks drop, delay and reorder packets all the time. TCP hides that mess, so a web page, a database query or a file download arrives complete and in order without your code doing anything special. The price is some extra delay for the handshake and retries, which is why some real-time traffic uses UDP instead.

An example from work

Your app can’t reach its database and the log says “connect ECONNREFUSED 127.0.0.1:5432”. That’s a TCP-level error: nothing is listening on that port, so the connection attempt was refused. Usually PostgreSQL isn’t running yet, or it runs in a Docker container whose port you didn’t publish.

Our own explanation, not a quote from the book.

In the book

Sentences from The Software Realm, Decoded that mention TCP, exactly as printed.

    1 more passages about TCP in the full book

    Read every conversation where TCP comes up, with the interactive slides and demos.

    See the book

    Where it fits

    Reliable data transfer (HTTP, databases, file transfer)

    Coverage in the book

    In depth

    Covered in depth: multiple pages with explanations, examples and simulations.

    Appears in