๐
What every developer should know about TCP
On this page
The Transmission Control Protocol is one of the main protocols of the Internet protocol suite.
Handshake
Before a client can start sending data to a server, it needs to perform a handshake for TCP and another one for TLS.
TCP uses a three-way handshake to create a new connection.
- The sender picks a randomly generated sequence number โxโ and sends a SYN packet to the receiver.
- The receiver increments โx,โ chooses a randomly generated sequence number โyโ and sends back a SYN/ACK packet.
- The sender increments both sequence numbers and replies with an ACK packet and the first bytes of application data.

Flow Control
Flow control is a backoff mechanism implemented to prevent the sender from overwhelming the receiver.
The receiver stores incoming TCP packets waiting to be processed by the application into a receive buffer.
