Roadmap › Networking & Hosting — How a Website Works, End to End › Module: Network Foundations
Lessons in this course (12)
1. OSI and TCP/IP models — layers of a network
Basic★ Must knowLesson 1 of 12
| OSI layer | TCP/IP layer | What it does | Examples |
|---|---|---|---|
| 7 Application | Application | Data your app understands | HTTP, HTTPS, DNS, SMTP, FTP, SSH |
| 6 Presentation | Application | Encoding, encryption, compression | TLS, UTF-8, gzip |
| 5 Session | Application | Sessions between apps | (handled by TLS/HTTP today) |
| 4 Transport | Transport | End-to-end delivery between ports | TCP, UDP, QUIC |
| 3 Network | Internet | Addressing and routing between networks | IP (v4/v6), ICMP (ping), routers |
| 2 Data link | Link | Delivery on the local network (frames, MAC addresses) | Ethernet, Wi-Fi, switches, ARP |
| 1 Physical | Link | Bits on the wire/air | Cables, fibre, radio |
Encapsulation: your HTTP request is wrapped in a TCP segment (adds ports), then an IP packet (adds IP addresses), then an Ethernet/Wi-Fi frame (adds MAC addresses). Each router unwraps to layer 3, decides the next hop, and wraps again. The receiver unwraps in reverse order.
text
[ Ethernet header | IP header (src/dst IP) | TCP header (src/dst port) | HTTP: GET /orders ... | trailer ]Interview tip: Asked "which layer?": a switch works at layer 2 (MAC), a router at layer 3 (IP), a load balancer at layer 4 (TCP/UDP) or layer 7 (HTTP — can route by URL/header), a firewall at 3–4 (WAF at 7).