Dynamic and Static IP Addresses 🌐

Dynamic IP Addresses: Flexibility for Clients πŸ–§

What Are Dynamic IPs?

Dynamic IPs are temporary addresses assigned to devices by an Internet Service Provider (ISP) using the Dynamic Host Configuration Protocol (DHCP). These addresses:

  • Change periodically based on availability.

  • Are shared among users in the same network.

  • Are sufficient for client-side internet activities, like accessing websites or apps.

The Practical Setup:

Consider a neighborhood in Kota, Rajasthan, with 20 Airtel users:

  • Instead of assigning each user a unique leased IP address, Airtel uses DHCP to dynamically allocate two public IPs to the neighborhood.

  • Users share these IPs, which change over time.

Why Dynamic IPs Work for Clients:

For everyday tasks like browsing Facebook or Instagram, dynamic IPs are enough. Here’s why:

  • Each request a client sends to a server includes its current IP address.

  • If the IP changes mid-session, the client simply resends the request with the new IP.

Handling Dropped Requests:

On the internet, dropped requests due to IP changes are expected. If a request fails:

  • The client retries using the new IP.

  • The server processes the new request without issue.

This system is both cost-efficient and scalable for ISPs and users.


Static IP Addresses: Stability for Servers 🏒

What Are Static IPs?

A static IP is a fixed address leased by an ISP for exclusive use by a customer. It remains constant and is essential for resources that need consistent accessibility, like:

  • Websites (e.g., Facebook, Delicious).

  • Cloud servers.

  • Online services require stable endpoints.

Why Servers Need Static IPs:

  1. Predictable Addressing: Users and systems can reliably connect to the same address.

  2. Uninterrupted Service: Frequent IP changes disrupt user access, similar to a shop changing its location daily.

  3. Networking Stability: Critical for DNS configuration, enabling domain names (e.g., www.delicious.com) to resolve to the correct IP.

The Cost Factor:

Static IPs are expensive because:

  • They require dedicated resources from the ISP.

  • They come with higher costs for maintenance and reliability.


Comparing Dynamic vs. Static IPs πŸ“Š

Feature
Dynamic IPs
Static IPs

Use Case

Clients (e.g., users browsing)

Servers (e.g., hosting services)

Allocation

Temporary, changes periodically

Fixed, constant

Cost

Low-cost

High-cost

Scalability

Shared among users

Dedicated for critical systems

Examples

ISP-assigned IPs for homes

IPs for websites and apps


Real-World Analogy: The Restaurant Example 🍴

Imagine you own a restaurant:

  • Dynamic Address: If you keep moving the restaurant daily, customers won’t find you, and your business will fail.

  • Static Address: Keeping the restaurant at a fixed location ensures customers know where to return.

For servers like Delicious, having a static IP is non-negotiable. It ensures users can reliably connect to their services without interruption.


Dynamic IPs for Everyday Users: A Cost-Effective Choice πŸ’Έ

For clients (like users accessing Instagram or Delicious):

  • Dynamic IPs suffice since they primarily send requests and receive responses.

  • ISPs dynamically allocate and recycle IPs among users, reducing costs.

For example:

  • If you’re using Airtel in Kota, your IP might change throughout the day.

  • This setup is more economical and practical for non-critical internet usage.


Why Servers Require Static IPs πŸ“Œ

Servers like Facebook, Instagram, or Delicious can’t afford to have dynamic IPs because:

  1. They need a consistent endpoint for users to access.

  2. Frequent IP changes would disrupt DNS mappings, making the service unreachable.

In technical terms:

  • A static IP is like a permanent shop address in the digital world.

  • A dynamic IP is like a temporary pop-up store that moves around.


Recap: Networking Essentials for High-Level Design

  1. Dynamic IPs: Ideal for clients performing transient activities like browsing or streaming.

  2. Static IPs: Essential for servers to maintain consistent and reliable access.

Understanding these concepts is foundational for designing scalable systems. Delicious, as it evolved, relied on these principles to transition from a dorm-room project to a globally accessible service.

Stay tuned as we continue exploring how to scale systems like Delicious into robust, high-level architectures. πŸš€

Last updated