TCP/IP Model
Context & Purpose
The TCP/IP Model (Internet Protocol Suite) is the practical implementation of networking. Unlike OSI which is a reference model, TCP/IP is the actual stack of protocols that powers the modern Internet. It prioritizes connectivity and robustness over strict theoretical layers.
Mechanism / Architecture
It condenses networking into 4 Pragmatic Layers.
Layer Breakdown
-
Network Access (Link Layer):
- Corresponds to OSI L1 (Physical) + L2 (Data Link).
- Handles placing TCP/IP packets on the network medium.
- Protocols: Ethernet, Wi-Fi (802.11), ARP.
-
Internet:
- Corresponds to OSI L3 (Network).
- Handles logical addressing and routing across multiple networks.
- Protocols: IP (IPv4, IPv6), ICMP (Ping).
-
Transport:
- Corresponds to OSI L4 (Transport).
- Handles host-to-host communication and flow control.
- Protocols: TCP (Reliable), UDP (Fast/Unreliable).
-
Application:
- Corresponds to OSI L5 (Session) + L6 (Presentation) + L7 (Application).
- Handles process-to-process communication.
- Protocols: HTTP, DNS, SSH, SMTP.
Analysis & Trade-offs
Pros
- Proven Scale: It scales to the size of the global internet.
- Robustness: Designed to survive high loss and dynamic routing changes (originally for DARPA).
- Loose Coupling: Does not enforce strict presentation/session handling, leaving that to the application developer.
Cons
- Security: Originally designed without built-in security (IPSec and SSL/TLS were added later).
- Complexity: The boundaries between layers can be blurry in implementation (e.g., where does SSL sit? Technically App layer, but behaves like Transport).
Real-world Usage
- Kernel Space: The Transport and Internet layers live in the OS Kernel (Linux Networking Stack).
- User Space: The Application layer lives in your code (Node.js, Go, Python).
- Hardware: The Network Access layer lives in the Network Interface Card (NIC) and Driver.
Interview Check
- Why do we use TCP/IP instead of OSI?
- OSI is too complex and prescriptive. TCP/IP won the "Protocol War" because it was bundled with UNIX and was simpler to implement.
- Where does the Linux Kernel fit in?
- The Kernel handles L2 (Internet) and L3 (Transport). Your app handles L4 (Application).
- Is ARP part of L2 (Internet) or L1 (Link)?
- In TCP/IP, ARP is strictly the glue between Layer 2 (Internet/IP) and Layer 1 (Link/MAC), but it lives in the Link Layer.