Chapter 2: The OSI Model and TCP/IP Model
Practice Questions and Lab Exercises
- Name the 7 OSI layers with one protocol and one device for each.
- What is the PDU at the transport, network and data link layers?
- Compare TCP and UDP. Why does DNS normally use UDP but SSH uses TCP?
- Draw the OSI vs TCP/IP mapping diagram and write four differences.
- At which layer does a switch operate? A router? An AWS Application Load Balancer? A Security Group?
- Explain step by step what happens when you enter
https://www.amazon.inin a browser. - Lab: Run
curl -v https://www.example.com -o /dev/nulland identify in the output: the resolved IP, the TCP connect, the TLS handshake and the HTTP status code. - Lab: Run
dig www.google.comandtraceroute 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.