Ravindra BagaleCourses & study guides

Chapter 2: The OSI Model and TCP/IP Model

Practice Questions and Lab Exercises

  1. Name the 7 OSI layers with one protocol and one device for each.
  2. What is the PDU at the transport, network and data link layers?
  3. Compare TCP and UDP. Why does DNS normally use UDP but SSH uses TCP?
  4. Draw the OSI vs TCP/IP mapping diagram and write four differences.
  5. At which layer does a switch operate? A router? An AWS Application Load Balancer? A Security Group?
  6. Explain step by step what happens when you enter https://www.amazon.in in a browser.
  7. Lab: Run curl -v https://www.example.com -o /dev/null and identify in the output: the resolved IP, the TCP connect, the TLS handshake and the HTTP status code.
  8. Lab: Run dig www.google.com and traceroute 8.8.8.8. Note the number of hops.

Quick Revision

  • OSI 7 layers: Physical (bits), Data Link (frames, MAC, switch), Network (packets, IP, router), Transport (segments, TCP/UDP, ports), Session, Presentation (TLS, encoding), Application (HTTP, DNS, SSH).
  • TCP/IP 4 layers: Network Access, Internet, Transport, Application.
  • Encapsulation adds headers going down; decapsulation removes them going up.
  • TCP = reliable, 3-way handshake; UDP = fast, connectionless.
  • Opening a website: DNS → TCP handshake → TLS → HTTP request → server/app/DB → response → render.