/
๐Ÿ“

What every developer should know about TCP

https://robertovitillo.com/what-every-developer-should-know-about-tcp/
webprogramming
On this page
  • Handshake
  • Flow Control

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.

Edit this page
logo
Code-related notes and snippets