Every web request travels through multiple layers of protocols. Understanding this makes you a better developer and helps you debug network issues.
When you type https://techpaths.dev and press Enter, a lot happens in under 200ms:
The internet is built on layers. Each layer has a specific job and talks to the layers above and below it.
As a developer, you mostly work with the top two layers — Application and Transport.
Every device on the internet has an IP address — a unique identifier.
IPv4: 192.168.1.1 (32-bit, ~4 billion addresses)
IPv6: 2001:db8::1 (128-bit, virtually unlimited)
IP handles routing — getting packets from source to destination across multiple networks. Each router along the path forwards the packet closer to the destination.
TCP provides reliable, ordered delivery of data.
Client → Server: SYN (I want to connect)
Server → Client: SYN-ACK (OK, I'm ready)
Client → Server: ACK (Great, let's go)
| TCP | UDP | |
|---|---|---|
| Reliability | Guaranteed delivery | Best effort |
| Order | Ordered | Unordered |
| Speed | Slower (overhead) | Faster |
| Use case | HTTP, email, file transfer | Video streaming, gaming, DNS |
UDP is used when speed matters more than reliability — a dropped video frame is better than waiting for retransmission.
HTTP is the language browsers and servers use to communicate. It runs on top of TCP.
GET /blog/cap-theorem HTTP/1.1
Host: techpaths.dev
Accept: text/html
Cookie: session=abc123
User-Agent: Mozilla/5.0HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 12345
Cache-Control: max-age=3600
<!DOCTYPE html>
<html>...| Method | Purpose | Body |
|---|---|---|
| GET | Retrieve data | No |
| POST | Create data | Yes |
| PUT | Replace data | Yes |
| PATCH | Update data | Yes |
| DELETE | Delete data | No |
| Range | Meaning | Examples |
|---|---|---|
| 2xx | Success | 200 OK, 201 Created |
| 3xx | Redirect | 301 Moved, 304 Not Modified |
| 4xx | Client error | 400 Bad Request, 401 Unauthorized, 404 Not Found |
| 5xx | Server error | 500 Internal Error, 503 Service Unavailable |
HTTPS adds encryption via TLS (Transport Layer Security).
Why HTTPS matters:
HTTP/2 is now standard. HTTP/3 is being adopted — Cloudflare and Google support it.
DNS translates domain names to IP addresses. We covered this in depth in the DNS article — the key points:
| Hop | Typical latency |
|---|---|
| Same machine | ~0.1ms |
| Same data center | ~0.5ms |
| Same city | ~1-5ms |
| Same country | ~10-30ms |
| Cross-continent | ~100-200ms |
This is why CDNs exist — serve content from the nearest edge node to minimize hops.