Skip to main content

Classful and classless addressing

Short answer

Classful addressing divides IPv4 into fixed classes A-E with rigid network/host boundaries, causing address waste. Classless (CIDR) uses variable prefix lengths (/n) allowing any block size, enabling VLSM and route aggregation to reduce routing tables and conserve addresses. Example: 192.168.8.0/22 provides 1024 addresses with mask 255.255.252.0.

What is classful and classless address?

Classful addressing

In classful IPv4 addressing the 32-bit address space is divided into five fixed classes (A to E). The network part (netid) and host part (hostid) have a fixed boundary by class, identified by the leading bits.

ClassFirst bitsFirst octetNetid / HostidDefault maskHosts per network
A01 to 1268 / 24255.0.0.016,777,214
B10128 to 19116 / 16255.255.0.065,534
C110192 to 22324 / 8255.255.255.0254
D1110224 to 239Multicast
E1111240 to 255Reserved

Problem: it is wasteful. A company needing 500 hosts gets a class B (65,534 hosts) and the rest are wasted, so the address space was soon exhausted.

Classless addressing (CIDR)

In classless addressing (Classless Inter-Domain Routing), the classes are ignored. A block of addresses of any size (power of 2) is given, and the prefix length is written as /n: for example 192.168.8.0/22 (1,024 addresses, 192.168.8.0 to 192.168.11.255). The mask can be any length from /0 to /32, so the network/host boundary can be anywhere.

  • Block size is 2^(32 − n); the first address must be divisible by the block size.
  • Allows VLSM and route aggregation (supernetting), which reduces routing table size.
  • Saves addresses: 500 hosts needs a /23 (512 addresses).

✓ Answer checked by Claude Opus 5.5 (high effort)

All Computer Networks and Security chapter 4 questions →