IP addressing & subnetting · Lesson 2 of 9 · 3 min read
Classful addressing
The five classes
Before 1993, the first bits of an address fixed its class and therefore its network size:
| Class | Leading bits | First octet | Default mask | Networks | Hosts per network | Use |
|---|---|---|---|---|---|---|
| A | 0 |
1–126 | 255.0.0.0 (/8) | 126 | 16,777,214 | Very large networks |
| B | 10 |
128–191 | 255.255.0.0 (/16) | 16,384 | 65,534 | Medium |
| C | 110 |
192–223 | 255.255.255.0 (/24) | ~2 million | 254 | Small |
| D | 1110 |
224–239 | — | — | — | Multicast |
| E | 1111 |
240–255 | — | — | — | Experimental/reserved |
- 127.x.x.x is excluded from Class A: it's loopback (
127.0.0.1= this host). That's why Class A is listed as 1–126. - 0.x.x.x means "this network" (0.0.0.0 = any address / unspecified; as a route, 0.0.0.0/0 = default route).
- The class boundary is easy to remember by first octet: A < 128, B < 192, C < 224, D < 240.
Enlarge diagram
Swipe sideways to see all of it, or tap to open it full screen.
Why classes were abandoned
Class sizes were wildly mismatched with real needs: an organisation needing 500 addresses got a Class B (65,534) and wasted 99%, or several Class Cs that bloated routing tables. CIDR — Classless Inter-Domain Routing (1993) replaced classes: any prefix length can be used (/22, /27...), and contiguous blocks can be aggregated into one route. Today classes survive as vocabulary, in some old tools' default masks, and in interview questions — they explain why 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 look the way they do.