Course contentsShow
← Computer Science
Lesson 1462 of 2,87234. Internet Protocol SuiteFree lesson

Network Classes and CIDR Notation

Learning traditional Class A/B/C networks and modern Classless Inter-Domain Routing (CIDR) slash notation.

Network Classes and CIDR Notation

What you'll learn: How traditional IPv4 address classes divided the address space and how modern CIDR notation provides flexible subnet sizing.


The Old Way: Classful Networks

Originally, IPv4 addresses were divided into fixed classes based on their first few bits:

  • Class A (0.0.0.0 - 127.255.255.255): First bit = 0, gave organizations 16.7 million addresses (8 network bits, 24 host bits)
  • Class B (128.0.0.0 - 191.255.255.255): First bits = 10, gave 65,536 addresses (16 network bits, 16 host bits)
  • Class C (192.0.0.0 - 223.255.255.255): First bits = 110, gave only 254 addresses (24 network bits, 8 host bits)

The problem? This was too rigid. A company needing 300 addresses had to waste a Class B with 65,000+ addresses, causing rapid IPv4 address exhaustion.

The Modern Solution: CIDR

Classless Inter-Domain Routing (CIDR) introduced flexible subnet masks using slash notation:

  • 192.168.1.0/24 means the first 24 bits are the network portion
  • 10.0.0.0/8 means the first 8 bits are the network portion
  • 172.16.50.0/22 means the first 22 bits are the network portion

Think of it like street addresses: the network portion is your neighborhood, and the remaining bits identify individual houses. CIDR lets you size the "neighborhood" exactly to your needs.

The number after the slash tells you how many addresses you have: 2^(32 - prefix) total addresses (minus 2 for network/broadcast).

  • /24 = 2^8 = 256 addresses (254 usable)
  • /22 = 2^10 = 1,024 addresses (1,022 usable)
  • /30 = 2^2 = 4 addresses (2 usable, perfect for point-to-point links)

CIDR eliminated wasteful class boundaries and enabled efficient address allocation at any granularity.

Key Takeaway: While traditional Class A/B/C networks used fixed boundaries, CIDR notation (/prefix) provides flexible, efficient subnet sizing by allowing any number of network bits, preventing IPv4 address waste.