Episode 1 — Fundamentals / 1.3 — Internet Protocols
1.3 — Exercise Questions: Internet Protocols (TCP & UDP)
Practice questions for all five subtopics in Section 1.3. Mix of short-answer, diagrams, and hands-on checks. Try each without looking back at the lesson files first.
How to use this material (instructions)
- Read lessons in order —
README.md, then1.3.a→1.3.e. - Answer closed-book first — only reopen a lesson after you have written something.
- Hands-on — use
nc,curl -v, or packet captures where suggested (optional but high value). - Redo misses — retry wrong items the next day (spaced repetition).
- Interview prep — pair with
1.3-Interview-Questions.mdfor polished wording.
1.3.a — What is TCP? (Q1–Q6)
Q1. In one sentence, what problem does TCP solve that raw IP does not?
Q2. List four properties of TCP (e.g. connection-oriented, …) and give a one-line explanation for each.
Q3. Why does TCP use sequence numbers and acknowledgments?
Q4. What is flow control vs congestion control (one paragraph each)?
Q5. Name three real applications that should use TCP and explain why.
Q6. True/False (justify): “TCP guarantees your message arrives within 100ms.”
1.3.b — Three-Way Handshake (Q7–Q12)
Q7. Draw SYN → SYN-ACK → ACK with arrows and label who sends each segment.
Q8. Why is the handshake three steps instead of two?
Q9. What is an Initial Sequence Number (ISN) and why is randomness useful?
Q10. What happens if the SYN is lost? What happens if the final ACK is lost?
Q11. Describe a SYN flood attack in plain English and name one mitigation.
Q12. Contrast connection establishment with connection teardown (how many steps each, roughly).
1.3.c — What is UDP? (Q13–Q18)
Q13. Define connectionless in the context of UDP.
Q14. Why is UDP often chosen for real-time voice even though packets can be lost?
Q15. How large is a UDP header (minimum), and what fields does it contain?
Q16. Give two advantages and two disadvantages of UDP vs TCP.
Q17. Scenario: You are designing a sensor that sends a temperature reading every second. Could UDP be reasonable? Why?
Q18. Why can UDP-based protocols be abused for amplification attacks (high level)?
1.3.d — How UDP “connects” (Q19–Q24)
Q19. Explain why it is misleading to say UDP “establishes a connection” the same way TCP does.
Q20. What does the OS do if a UDP datagram arrives on a port with no listening socket?
Q21. Why does DNS often use UDP for small queries?
Q22. When might DNS fall back to TCP?
Q23. What is UDP hole punching (one paragraph) and why is it used?
Q24. Why might NAT break naive UDP long-lived sessions without heartbeats?
1.3.e — TCP vs UDP (Q25–Q32)
Q25. Fill a comparison table: reliability, ordering, handshake, header size, typical use cases.
Q26. What is head-of-line blocking in TCP, and how does it relate to HTTP/2 on TCP?
Q27. Why does HTTP/3 (QUIC) use UDP instead of inventing “TCP v2”?
Q28. Can UDP be made reliable? If yes, where does reliability appear (protocol vs application)?
Q29. When would you pick TCP for an internal microservice call? When might gRPC over HTTP/2 still be TCP-based?
Q30. Exercise: List the transport protocol used by: classic HTTPS, HTTP/3, DNS (typical small query), SSH.
Q31. Explain multiplexing in HTTP/2 and why TCP loss can still hurt all streams.
Q32. Write a two-minute spoken explanation of TCP vs UDP for a non-technical friend (outline bullets only).
Practical / hands-on (Q33–Q36)
Q33. Hands-on: Run curl -v https://example.com and identify: TCP connection, TLS handshake markers, HTTP response status line.
Q34. Hands-on: Use dig example.com (or nslookup) and note whether responses mention truncation / TCP fallback (if visible in your tool output).
Q35. Hands-on (optional): Capture a few packets in Wireshark while loading a site; point to one TCP SYN and one ACK.
Q36. Reflection: Which topic (1.3.a–e) felt hardest? Write 3 bullet “fix-up” notes to revisit tomorrow.
Answer hints (short)
| Q | Hint |
|---|---|
| Q1 | IP is best-effort; TCP adds reliability + ordering + congestion/flow control. |
| Q8 | Third ACK confirms both sides received each other’s ISN (prevents half-open ambiguity). |
| Q13 | No handshake state; independent datagrams. |
| Q19 | UDP sends datagrams; “connection” is an app-level pattern if used. |
| Q26 | Lost TCP segment delays all streams sharing that TCP connection in classic models. |
| Q27 | QUIC builds stream-level reliability on UDP; avoids TCP’s cross-stream HOL blocking. |
← Back to 1.3 — Internet Protocols (README)