| Class | First octet | Default mask | Hosts per network | Use |
|---|---|---|---|---|
| A | 1-126 | 255.0.0.0 (/8) | about 16.7 million | Very large networks |
| B | 128-191 | 255.255.0.0 (/16) | 65,534 | Medium networks |
| C | 192-223 | 255.255.255.0 (/24) | 254 | Small networks |
| D | 224-239 | - | - | Multicast |
| E | 240-255 | - | - | Experimental |
127.0.0.0/8 is loopback (127.0.0.1 refers to the local machine).
Classful addressing was replaced by CIDR in 1993. Today the prefix length (for example /24), not the class, decides the size of a network.
What "classful" meant
In the early Internet, the first few bits of an address fixed the mask. If the first octet was 1–126 the mask was always /8; if 128–191 it was /16; if 192–223 it was /24. That wasted huge numbers of addresses: a company that needed 300 hosts was often given a whole Class B (65,534 usable hosts).
Why you still learn the classes
Modern routing uses CIDR (see 4.4): the prefix length can be any value, not only /8, /16 or /24. But exams and day-to-day work still use class ranges to recognise address types at a glance:
10.x.x.xlooks like a Class A private range.172.16–172.31looks like Class B private.192.168.x.xlooks like Class C private.224.x.x.xis multicast (Class D).127.x.x.xis loopback: packets to127.0.0.1never leave the local machine (useful to test that the IP stack is alive).
Common mistake: assuming that 192.168.1.50 must use mask 255.255.255.0. Today the mask is whatever the network designer chose (/25, /26 and so on). Always look at the mask or prefix, not only the first octet.
Remember
- Classful addressing is historic; CIDR decides size today.
- Class ranges are still useful for recognising private, loopback and multicast addresses.
127.0.0.1always means "this computer".