,

Contents · OSI layers and TCP/IP


OSI 7-layer model

  1. Physical: bits, signaling, media.
  2. Data Link: frames, MAC, switches, VLANs (Ethernet, 802.1Q).
  3. Network: packets, routing, IP addressing (IPv4/IPv6).
  4. Transport: segments/datagrams, reliability (TCP, UDP).
  5. Session: dialogs, checkpoints (rarely distinct in practice).
  6. Presentation: encoding, TLS, compression.
  7. Application: HTTP, DNS, SMTP, etc.

TCP/IP 4-5 layer model

  • Link (Network Access): Ethernet, Wi‑Fi.
  • Internet: IP, ICMP, ARP/ND, routing.
  • Transport: TCP, UDP, QUIC (at app layer but transport semantics).
  • Application: HTTP(S), DNS, TLS, SSH, SMTP, etc.

Mapping OSI ⇄ TCP/IP

  • OSI 1–2 → TCP/IP Link
  • OSI 3 → Internet
  • OSI 4 → Transport
  • OSI 5–7 → Application

Encapsulation and PDU names

  • Application: data
  • Transport: segments (TCP) / datagrams (UDP)
  • Internet: packets (IP)
  • Link: frames (Ethernet)
  • Physical: bits
[App Data] → TCP hdr → IP hdr → Ethernet hdr/trailer → bits on wire

Key protocols by layer

  • Link: Ethernet, 802.11, PPPoE, VLANs, STP.
  • Internet: IPv4/IPv6, ICMPv4/v6, ARP, ND, NDP.
  • Transport: TCP (handshake, congestion control), UDP, QUIC.
  • Application: HTTP/1.1, HTTP/2, HTTP/3, TLS, DNS, SMTP.

Troubleshooting by layers

  • L1/2: link up, duplex/speed, errors (CRC), VLAN tagging.
  • L3: addressing, routes, TTL, fragmentation; ping/traceroute.
  • L4: ports, state, retransmits; netstat, ss, tcpdump.
  • L7: app headers, certs, HTTP status; curl, browser devtools.

Exercises

  1. Draw the encapsulation stack for an HTTPS request over Wi‑Fi and label PDUs.
  2. Capture a TCP handshake with a packet analyzer and annotate each flag/field.
  3. Map OSI layers to TCP/IP for three protocols (DNS, TLS, QUIC).
Models are maps, not the territory—but they’re invaluable for reasoning about networks and debugging issues.