The application layer holds the protocols users interact with. DNS turns names into IP addresses, HTTP carries web requests and responses, and DHCP automatically hands out IP addresses to devices joining a network. These three power almost everything you do online.
DNS, HTTP, DHCP at a glance
DNS is the internet's phone book — it resolves a domain (example.com) to an IP. HTTP is the request/response protocol of the web, using methods (GET, POST...) and status codes (200, 404...). DHCP automatically assigns a device its IP, subnet mask, gateway and DNS server when it joins a network.
HTTP methods & status codes
| Item | Meaning |
|---|---|
| GET | retrieve data (no side effects) |
| POST | submit/create data |
| PUT / DELETE | update / remove a resource |
| 2xx | success (200 OK) |
| 3xx | redirect (301 moved) |
| 4xx | client error (404 not found) |
| 5xx | server error (500) |
⚡ The edge
- Status codes by first digit: 2xx success, 3xx redirect, 4xx your fault (client), 5xx server's fault. That single rule decodes most codes.
- HTTP is stateless — each request is independent; cookies, sessions and tokens are how applications add state on top.
Worked example
'What is the difference between GET and POST?'
- GET retrieves data and puts parameters in the URL; it should have no side effects and is cacheable/bookmarkable.
- POST submits data in the request body, is used to create/change state, and is not cached.
- So GET is for reading, POST is for writing — and sensitive data shouldn't ride in a GET URL.
Answer: GET reads data via the URL (safe, cacheable); POST sends data in the body to create/change state.
Worked example
'What is DNS and what happens on a lookup?'
- DNS maps human-readable domains to IP addresses.
- On a lookup, the resolver checks caches, then queries the root, the TLD (.com) server, and the authoritative server in turn.
- It returns the IP, which the browser then uses to open a connection — all usually in milliseconds.
Answer: DNS resolves a name to an IP by querying caches, then root -> TLD -> authoritative servers.
⚠ Watch out
- HTTP is stateless; state (login, cart) is added via cookies/sessions/tokens, not the protocol itself.
- A 404 is a client-side 'not found' (4xx); a 500 is a server error (5xx) — don't blame the wrong side.
- HTTPS is HTTP over TLS (encryption) — same methods, secured transport.