Okay, let's briefly review the 2.3.b TCP/IP Model. You don't need exhaustive detail for a system design interview, but understanding the layers and the roles of TCP and UDP is important context.
-
Purpose: The TCP/IP model is a conceptual framework that standardizes how network communication occurs by dividing the process into abstraction layers. It's the foundational protocol suite for the internet.
-
The Layers (Common 4-Layer Model):
-
Application Layer:
- Role: Provides network services directly to user applications. This is where protocols that applications use reside.
- Protocols: HTTP, HTTPS, FTP, SMTP (email), DNS, etc.
- Focus: Application-specific data exchange.
-
Transport Layer:
- Role: Handles end-to-end communication, data segmentation, reliability, and flow control between applications on different hosts.
- Key Protocols:
- TCP (Transmission Control Protocol):
- Connection-Oriented: Establishes a connection via a three-way handshake (SYN, SYN-ACK, ACK) before data transfer.
- Reliable & Ordered: Guarantees that data arrives in order and without errors (using acknowledgements and retransmissions).
- Flow Control: Manages transmission rate to prevent overwhelming the receiver.
- Use Cases: Web Browse (HTTP/HTTPS), email (SMTP), file transfer (FTP) - anywhere reliability is crucial.
- UDP (User Datagram Protocol):
- Connectionless: No handshake; just sends packets ("datagrams").
- Unreliable & Unordered: No guarantees about delivery or order. Packets might be lost or arrive out of sequence.
- Faster & Lower Overhead: Less protocol overhead compared to TCP.
- Use Cases: Streaming video/audio, online gaming, DNS lookups - where speed is preferred over perfect reliability, or where occasional loss is acceptable/handled by the application.
- TCP (Transmission Control Protocol):
- Focus: Process-to-process communication.
-
Internet Layer (or Network Layer):
- Role: Responsible for logical addressing (IP addresses) and routing packets across different networks to their final destination.
- Key Protocol: IP (Internet Protocol) (IPv4 and IPv6).
- Devices: Routers operate primarily at this layer.
- Focus: Packet forwarding and inter-network routing.
-
Link Layer (or Network Interface / Data Link Layer):
- Role: Handles the physical transmission of data over a specific network medium (e.g., Ethernet cable, Wi-Fi). Deals with physical addressing (MAC addresses) within a local network segment.
- Protocols: Ethernet, Wi-Fi (802.11).
- Devices: Switches operate primarily at this layer.
- Focus: Communication between adjacent nodes on the same network.
-
-
Key Takeaways for System Design:
- The choice between TCP (reliability) and UDP (speed/low overhead) at the Transport Layer depends on the application's needs.
- Higher-level protocols like HTTP rely on the underlying transport (usually TCP) and internet (IP) layers to function.
- Understanding layers helps conceptualize where different components (like load balancers - often operating at Layer 4 or Layer 7) fit in.
Advertisement