Adapted from Mastering System Design from Basics to Cracking Interviews (Udemy) — https://www.udemy.com/course/mastering-system-design-from-basics-to-cracking-interviews/
Why Networking Matters in System Design?
Key areas where networking plays a crucial role:
- Communication: Ensuring smooth data transfer between clients, servers, and databases.
- Load Balancing: Distributing traffic efficiently to prevent overload on a single server.
- Security: Protecting data from unauthorized access and cyber threats.
- Efficiency: Optimizing network performance to reduce latency.
Introduction to IP Addresses
IP (Internet Protocol) addresses are unique numerical labels assigned to devices on a network. They enable communication across the internet.
IPv4 vs IPv6
- IPv4: 32-bit format (e.g.,
192.168.1.1). Limited to ~4.3 billion addresses. - IPv6: Designed for IoT, mobile networks, and future scalability (340 undecillion addresses).
An example IPv4 address (32-bit) shown beside a much longer IPv6 address (128-bit).
Private vs. Public IPs
- Public IPs: Assigned by ISPs, used to communicate over the global internet. Unique worldwide.
- Private IPs: Used within local networks (LANs). Cannot be accessed directly from the internet.
Why Do We Need Private IPs?
- Conserve Public IPs: Allows millions of devices to share a few public IPs.
- Security: Private IPs are not routable over the internet.
- NAT (Network Address Translation): Enables multiple devices in a private network to share a single public IP.
A NAT router translates a private device's request to a public IP on the way out and maps the response back on the way in.
The Role of IPs in System Design
IP addresses are foundational to building robust architectures:
- Scalability: Multi-region and cloud-based deployments.
- Anycast IPs: Directing users to the nearest healthy server.
- VPC Networking: Isolating microservices using internal private IPs.
Traffic from the public internet enters a Virtual Private Cloud holding Service A and Service B through an internet gateway.