OSI Model & TCP/IP
To design distributed systems, we must understand how data travels across the network. The OSI Model and the TCP/IP suite provide the framework for this communication.
1. The OSI Model
The Open Systems Interconnection (OSI) model is a conceptual framework that standardizes the functions of a communication system into seven abstraction layers.
- Layer 7: Application: Where users interact (HTTP, FTP, SMTP).
- Layer 6: Presentation: Data translation, encryption, and compression.
- Layer 5: Session: Establishing and managing connections between applications.
- Layer 4: Transport: End-to-end communication, reliability, and flow control (TCP, UDP).
- Layer 3: Network: Routing packets based on IP addresses.
- Layer 2: Data Link: Transferring data between adjacent nodes (Ethernet, MAC addresses).
- Layer 1: Physical: The physical medium (cables, radio waves, bits).
2. The TCP/IP Suite
While the OSI model is great for learning, the internet actually runs on the TCP/IP suite, which collapses the layers into four:
- Application Layer: Combines OSI layers 5-7.
- Transport Layer: Identical to OSI layer 4. Handles ports and reliability.
- Internet Layer: Identical to OSI layer 3. Handles IP addressing.
- Network Access Layer: Combines OSI layers 1-2.
3. Key Protocols in System Design
- TCP (Transmission Control Protocol): Connection-oriented, reliable, guarantees order. Used for HTTP, Databases, SSH.
- UDP (User Datagram Protocol): Connectionless, unreliable (best-effort), fast. Used for Video streaming, Gaming, DNS.
- IP (Internet Protocol): The routing layer for all internet traffic.
Knowledge Check
Question 1 of 3
Q1Single choice
Which OSI layer is responsible for routing packets between different networks?