MEPX
Chapter 4 of 10All chapters

Chapter 4 of 10

TCP and UDP

Two ways to send data.

The trade

TCP sets up a connection, numbers the packets, resends what is lost and delivers in order. UDP just sends, with no guarantees and far less overhead.

  • Web pages, email and file transfer use TCP because completeness matters.
  • Video calls and games prefer UDP, because a late packet is worse than a missing one.

Ports

A port number says which program on the machine the traffic belongs to. HTTPS is 443, HTTP is 80, SSH is 22, and a firewall usually works by allowing or blocking these.