Skip to main content

Network Fundamentals and OSI Model

IP Addressing and Subnetting

0:00
LearnStep 1/3

Deep Dive into IP Addressing

At the heart of network routing lies the IP address. For senior engineers, moving beyond simple IP assignment to understanding subnetting efficiency is crucial, especially in cloud infrastructure (AWS VPC, Kubernetes networking).

IPv4 and Classful vs. CIDR

Originally, IPv4 addresses were divided into Classes (A, B, C, D, E). This was inefficient. CIDR (Classless Inter-Domain Routing) replaced this, allowing flexible subnet masking.

CIDR notation uses a suffix (e.g., /24) to indicate the number of bits used for the network portion of the address. The remaining bits are for hosts.

  • /24: 255.255.255.0 (256 IPs, 254 usable)
  • /20: 255.255.240.0 (4,096 IPs)
  • /32: Single host IP

Subnet Calculation Logic

To find the Network ID, perform a bitwise AND between the IP address and the Subnet Mask.

bash

Private vs. Public IPs (RFC 1918)

To conserve public IPv4 space, private ranges are used internally and translated via NAT.

  • 10.0.0.0 - 10.255.255.255 (10.0.0.0/8)
  • 172.16.0.0 - 172.31.255.255 (172.16.0.0/12)
  • 192.168.0.0 - 192.168.255.255 (192.168.0.0/16)

IPv6: The Future

IPv6 uses 128-bit addresses represented in hexadecimal. It solves address exhaustion and simplifies header processing.