Chapter recap
HTTP: request line + headers (+ body); status line + headers + body; TCP port 80; stateless with cookies. Methods GET, POST, HEAD, PUT, DELETE. Codes: 2xx success, 3xx redirection (301, 304), 4xx client error (404), 5xx server error. Page with base + N small objects: non-persistent 2(N + 1) RTT; k parallel 2 + 2⌈N/k⌉; persistent 2 + N; pipelined 3; add DNS time first.
Practice questions
- NAT · 2 marks
Base + 9 objects, RTT 10 ms, non-persistent with 3 parallel connections. Total ms?
Write your answer before opening the key.
- NAT · 1 mark
Base + 9 objects, RTT 10 ms, persistent with pipelining. Total ms?
Write your answer before opening the key.
- MCQ · 1 mark
Which method sends form data in the body?
- GET
- HEAD
- POST
- DELETE
- MCQ · 1 mark
A 404 status code means:
- moved permanently
- not found
- server error
- not modified
- MSQ · 1 mark
Which reduce page load time compared with non-persistent serial HTTP?
- Persistent connections
- Pipelining
- Parallel connections
- Disabling caching
- NAT · 2 marks
DNS 30 ms, RTT 20 ms, base + 5 objects, non-persistent serial. Total ms?
Write your answer before opening the key.
- MCQ · 1 mark
HTTP is called stateless because:
- it uses UDP
- the server keeps no memory of past requests
- it has no headers
- it cannot use cookies
- NAT · 2 marks
Base + 4 objects, RTT 50 ms, persistent without pipelining; each object (base too) takes 10 ms to transmit. Total ms?
Write your answer before opening the key.
Answer key
Try the questions first. Open when you are ready to check.
- 80 — 20 + 3 × 20 = 80.
- 30 — 3 RTT = 30.
- C — POST.
- A: GET puts parameters in the URL.
- B: Headers only.
- D: Removes an object.
- B — 4xx client error, not found.
- A: 301.
- C: 5xx.
- D: 304.
- ABC — All three save RTTs.
- D: Caching saves time; disabling it does not.
- 270 — 30 + 2 × 20 × 6 = 270.
- B — Definition.
- A: It uses TCP.
- C: It has headers.
- D: Cookies exist precisely because it is stateless.
- 350 — (100 + 10) + 4 × (50 + 10) = 110 + 240 = 350.