OSI Model
Seven layers, responsibilities, protocols at each layer
The OSI (Open Systems Interconnection) model is a 7-layer conceptual framework standardising how network protocols interoperate. Layers 1–4 are transport-oriented (physical delivery, framing, routing, reliable transport); layers 5–7 are application-oriented (session management, data representation, and user-facing protocols). In practice, the TCP/IP model collapses layers 5–7 into a single Application layer, but the OSI model remains the universal vocabulary for diagnosing network faults and designing protocol stacks.
Key Points
- Layer 1 (Physical): transmits raw bits over physical medium — cables (Cat6, fibre), radio (Wi-Fi 802.11ax), signal encoding (NRZ, Manchester); bandwidth and attenuation are physical-layer concerns.
- Layer 2 (Data Link): MAC addressing, framing, and error detection (CRC); Ethernet (802.3), Wi-Fi (802.11), PPP; switches and bridges operate at L2; VLANs (802.1Q) are L2 segmentation.
- Layer 3 (Network): logical addressing (IPv4/IPv6), routing (OSPF, BGP, EIGRP), and fragmentation; routers and L3 switches operate here; ICMP (ping, traceroute) lives at L3.
- Layer 4 (Transport): end-to-end delivery, multiplexing via ports (0–65535), error recovery; TCP (connection-oriented, reliable) and UDP (connectionless, low-latency) are the two primary protocols.
- Layer 5 (Session): establishes, maintains, and terminates logical sessions; NetBIOS, RPC, and SQL sessions; rarely implemented as a distinct layer in modern protocol stacks.
- Layer 6 (Presentation): data format translation, encryption (TLS operates here conceptually), compression (gzip, JPEG, MPEG); ensures sender's data format is readable by the receiver.
- Layer 7 (Application): user-facing protocols — HTTP/S, DNS, SMTP, FTP, IMAP, SNMP, gRPC; firewalls operating at L7 can inspect HTTP paths and headers (WAF operates at L7).
- Troubleshooting strategy: work from L1 upward — check physical link (L1) → MAC address table (L2) → routing table (L3) → port/firewall (L4) → application error (L7).
OSI model: 7 layers with responsibilities and representative protocols; L4 (Transport) and L3 (Network) highlighted as most architecturally significant
Real-World Example
AWS Network Firewall operates at L3/L4 (stateful packet inspection) while AWS WAF operates at L7 (HTTP header/body inspection) — combining both is necessary for defence-in-depth against network and application-layer attacks.