// TREATISE OBJECTIVES
- 1. Understand the TCP/IP model: how it is structured across four functional layers.
- 2. Understand why it exists: its parallel evolution alongside OSI and adoption as the Internet's production standard.
- 3. Identify and map layers: pinpoint which OSI layers fold into each TCP/IP tier.
- 4. Diagnostic application: apply a layer-by-layer inspection framework to audit live applications and infrastructure.
OSI Model (7 Layers) vs. TCP/IP Stack (4 Layers)
The OSI model was conceived by ISO as a comprehensive formal standard defining every theoretical phase of network interconnection. By contrast, the TCP/IP stack (originating under DARPA) followed a pragmatic, implementation-first engineering philosophy anchored in running code.
| Dimension | OSI Model | TCP/IP Stack |
|---|---|---|
| Layer Count | 7 hierarchical layers | 4 functional layers |
| Historical Origin | ISO (formal theoretical reference) | DARPA / ARPANET (operational implementation) |
| Current Role | Pedagogical taxonomy and conceptual diagnostics | The live protocol suite powering the Internet |
| Upper Layers | Separate Layers 7 (Application), 6 (Presentation), and 5 (Session) | Consolidated into a single Application Layer |
| Transport Layer | Layer 4 (Transport) | Layer 3 (Transport) — Same functional scope |
| Routing Layer | Layer 3 (Network) | Layer 2 (Internet) — Logical addressing & routing |
| Lower Layers | Separate Layers 2 (Data Link) and 1 (Physical) | Consolidated into the Network Access Layer |
Layer 4 · Application
Interacts directly with user software and exposes network services to applications. Rather than delegating syntactic formatting or session control to separate operating system layers, TCP/IP delegates those concerns to the application protocol and user-space libraries.
Consolidates OSI Layers 5 through 7 (Session, Presentation, and Application) into one integrated tier. Data encoding, compression, encryption, and dialogue control live inside the application protocol itself.
Key Application Layer Protocols:
| Protocol | Technical Role | Operational Detail |
|---|---|---|
| HTTP / HTTPS | Web pages & APIs | Hypertext transfer. HTTPS wraps HTTP inside an encrypted TLS/SSL session (port 443) ensuring confidentiality and integrity. |
| DNS | Resolves names to IPs | Domain Name System (port 53). Hierarchical distributed directory translating domain names into routable IP addresses. |
| FTP | File transfer | File Transfer Protocol (ports 20 and 21). Handles bidirectional file exchange with separate control-command and data channels. |
| SMTP | Email relay | Simple Mail Transfer Protocol (ports 25, 587, 465). Standard protocol for routing and dispatching electronic mail between mail transfer agents. |
| SSH | Secure remote shell | Secure Shell (port 22 / custom ports). Cryptographic protocol for remote administration, command execution, and encrypted tunnelling. |
Layer 3 · Transport
Delivers end-to-end host process communication: regulates errors, ordering, and transmission pace. Multiplexes concurrent processes using IP-address and port-number pairs so services share the same physical host without collision.
Corresponds directly to OSI Layer 4 (Transport); no layer consolidation occurs—only the layer numbering differs.
Reliable: acknowledges delivery of every byte stream.
Establishes state via a three-way handshake (SYN, SYN-ACK, ACK), enforces ordered delivery using sequence numbers, and triggers retransmission on packet loss.
Fast: connectionless, no ordering overhead.
Transmits datagrams without session setup or ACKs, avoiding handshake latency and congestion back-off for real-time media, gaming, and DNS lookups.
Layer 2 · Internet
Routes packets logically across interconnected networks and chooses forwarding paths. As the architectural waist of the stack, it decouples applications from underlying hardware links and enables global internetworking.
Maps directly to OSI Layer 3 (Network): identical logical addressing and routing role under a different name.
Internet Layer Protocols:
| Protocol | Technical Role | Network Behaviour |
|---|---|---|
| IP (IPv4 / IPv6) | Identifies each host | Assigns a hierarchical logical address to each interface. Operates connectionlessly with best-effort delivery, fragmenting packets when exceeding link MTU. |
| ICMP | Errors & diagnostics (ping) | Internet Control Message Protocol. Signals unreachable destinations, TTL expiry, and link errors, and supports latency probing via Echo Request/Reply. |
| IPsec | Security & encryption | Security suite (AH and ESP) authenticating and encrypting IP packets directly at the network layer for transparent site-to-site VPN tunnels. |
Layer 1 · Network Access
Interfaces with physical media and transmits signals across links. Defines how IP datagrams are framed for modulation onto copper electrical pulses, fibre-optic light beams, or wireless radio waves.
Combines OSI Layers 1 and 2 (Physical and Data Link) into one unified tier without separating media-access framing from physical signalling hardware.
Wired network: IEEE 802.3 standard for frame switching over twisted-pair copper or optical fibre.
Wireless network: IEEE 802.11 standard for RF transmission across 2.4 GHz, 5 GHz, and 6 GHz spectrum bands.
Local device identity: 48-bit hardware identifier burned into network interfaces for local-segment frame delivery.
Layer-by-Layer Audit & Investigation Framework
Structured methodology for auditing production web applications and mapping every request against the network stack:
Determine the software architecture pattern: traditional client-server, peer-to-peer, or distributed microservices; identify REST APIs, gRPC over HTTP/2, or WebSockets.
Verify which transport protocol governs traffic and why: transactional byte integrity (TCP) vs. low-latency real-time streaming or QUIC over UDP.
Inspect IPv4/IPv6 packet routing, evaluate ICMP diagnostic telemetry policies, and verify IPsec encrypted tunnels for perimeter links.
Map physical placement: where workloads run (dedicated servers, cloud regions, CDN edge nodes) and how transit providers (Tier 1/2) carry requests to users.
Trace physical propagation media: subsea cables, single-mode terrestrial fibre backbones, rack-level Ethernet switching, and last-mile wireless links (Wi-Fi/cellular).
Trace the full Round-Trip Time (RTT) of a request: from user event in client code through downward encapsulation, Internet routing, backend execution, and response decapsulation.
