How HTTP works
HTTP is the protocol of the web: the client asks for a resource and the server answers with a status code, headers and usually a body. Each exchange is one request and one response.
Layer: Application (OSI layer 7) · Port: 80 (HTTPS: 443) · Transport: TCP · Format: Text (headers + optional body) · Standard: RFC 9110, RFC 9112
HTTP packet flow
- DNS Client → DNS Resolver: Standard query A www.example.com
- DNS DNS Resolver → Client: Standard query response A 203.0.113.10
- TCP Client → Web Server: 52344 → 80 [SYN] Seq=0
- TCP Web Server → Client: 80 → 52344 [SYN, ACK] Seq=0 Ack=1
- TCP Client → Web Server: 52344 → 80 [ACK] Seq=1 Ack=1
- HTTP Client → Web Server: GET / HTTP/1.1 Host: www.example.com
- HTTP Web Server → Client: HTTP/1.1 200 OK (text/html), 9 segments
Other protocols: WebSocket · QUIC · SMTP · IMAP · POP3 · FTP · SMB · WebRTC · SIP · RTSP · RTMP · MQTT · Modbus · PPPoE