7 layers

HTTP

  • Uses a request-response model
  • Client makes requests to servers for resources like pages or API data
  • Server sends back responses with status codes like 200 OK, 404 Not Found, 500 Internal Server Error
  • Requested data is returned in the response body
  • POST, GET, PUT, DELETE (CRUD)

HTTPS

  • Builds on HTTP by adding encryption through Transport Layer Security (TLS)
  • TLS allows the browser and server to establish an encrypted connection to keep data confidential as it travels over the public internet
  • Traffic is scrambled, so intercepting it is meaningless
  • TLS also identifies server identify, preventing man-in-the-middle attacks
  • Overall, TLS provides encryption, security and authentication

HTTP/3

  • Improves speed and security by fixing performance issues with previous versions
  • Uses QUIC, built on UDP rather than TCP, optimises performance without TCP overhead
    • QUIC minimises lag when switching networks on a smartphone
    • Eliminated head-of-line blocking, where one lost packet stalls stream behind it, where other streams do not wait for the stalled one
    • Speeds up initial connection setup by combining cryptography and transport handshakes into one action, skipping round trips for servers they have already connected to before (equivalent to TCP + TLS)
    • Encrypts at the transport layer by default, all connection data is encrypted, not just the application payload, even metadata like packet number

Web Socket

  • Full duplex bi-directional communication on a single TCP connection, upgrade from HTTP
  • Enables seamless real-time collaboration and live data streams
  • Initial WebSocket handshake reuses the existing TCP connection, then messages can flow freely in both directions with minimal framing
  • Supports sending small messages instantly with very low overhead, ideal for chat, gaming or real time updates
  • Encryption via TLS is supported for security

TCP

  • Has reliable transmission, ordered data delivery and congestion control to smoothly exchange messages and keep real-time connections stable
  • Prioritises delivery over speed through error checking, transmission control and ordered data delivery
  • Adapts to network conditions with flow control and retransmissions

UDP

  • Less overhead compared to TCP, but lacks reliability, so HTTP/3 adds checks to prevent corruption (useful for gaming, voice, IOT and streaming)
  • Focuses on speed an reliability with very lightweight error checking and no handshakes
  • Can be corrupted by dropped packets
    • But combining with application-layer integrity checks balances speed and reliability

SMTP

  • Standard for transferring email messages between mail servers

FTP

  • Allows efficient uploading and downloading of files between hosts
  • Remains ubiquitous for file-based workflows