Skip to content
Addressing and routing

· 4 min read

IPv4 address classes explained

Before 1993, every IPv4 address belonged to a class that decided its network size. The scheme is obsolete, but the terms survive in exams, old documentation and default subnet masks. This is what the classes were and why they were dropped.

On this page

What the classes were#

In the original design of IPv4 (RFC 791) the size of a network was read from the first few bits of its addresses. There were three sizes for ordinary networks, one range for multicast and one held back. Routers did not need to be told where the network part ended: the first bits said so. This is classful addressing.

The five classes
ClassFirst bitsFirst octetDefault maskNetworksHosts per network
A01 to 126255.0.0.0 (/8)12616,777,214
B10128 to 191255.255.0.0 (/16)16,38465,534
C110192 to 223255.255.255.0 (/24)2,097,152254
D1110224 to 239Not applicableMulticast groupsNot applicable
E1111240 to 255Not applicableReservedNot applicable

First octet 0 is "this network" and 127 is loopback, which is why class A stops at 126. Two host addresses in each network are unusable: the all-zeros network address and the all-ones broadcast address.

Reading the class from an address takes seconds. 10.4.7.9 starts with 0 in binary (10 is 00001010), so it is class A. 172.16.3.1 starts 10 (172 is 10101100): class B. 192.168.1.1 starts 110 (192 is 11000000): class C. 224.0.0.251, used by mDNS, starts 1110: class D, multicast.

Why the system was dropped#

Three sizes turned out to be far too few. A class C, 254 hosts, was too small for most organisations, and a class B, 65,534 hosts, was far too large for many. An organisation with 500 machines had to take a whole class B and waste over 99% of it. Meanwhile, the number of separate networks grew until routing tables were straining the hardware of the early 1990s.

  • Addresses were wasted in fixed-size chunks. A class A held 16.7 million addresses, and there were only 126 of them.
  • Routing tables grew. Every class C was a separate route, and there were over two million possible ones.
  • Subnetting was a patch. It let one class block be split internally, but the outside world still saw the fixed classes.

The fix was Classless Inter-Domain Routing, CIDR, introduced in 1993 and now specified in RFC 4632. It drops the classes and lets any prefix length from /0 to /32 mark the split between network and host, so a network can have 500 hosts and get a /23 with 510 usable addresses. It also lets a provider announce many small blocks as one route. See CIDR and subnetting.

The private ranges, in class terms#

The three private blocks reserved by RFC 1918 line up with the old classes, which is the reason they have the sizes they do. Reading them in class terms explains the notation you still meet in router menus.

RFC 1918 blocks as classful networks
BlockIn class termsWritten today
10.0.0.0 to 10.255.255.255One class A network10.0.0.0/8
172.16.0.0 to 172.31.255.255Sixteen class B networks in a row172.16.0.0/12
192.168.0.0 to 192.168.255.255256 class C networks in a row192.168.0.0/16

Sixteen class B networks is the same thing as a /12: four bits of the second octet are free to vary. See public vs private IP addresses for how these ranges are used.

That is also why a home router almost always hands out 192.168.1.x addresses with a mask of 255.255.255.0. The block is a class C, and the mask is the default a class C would have had. Nothing in the address forces the /24, only habit and default settings.

Where the classes still show up#

  • Exams and textbooks. Many networking certifications still ask you to identify a class.
  • Default subnet masks. Some older operating system dialogs and tools suggest 255.255.255.0 for a 192.168.x.x address because it was a class C.
  • Language. "Class A" and "class C" survive as shorthand for "a /8" and "a /24", and 10.0.0.0/8 is still sometimes called "the class A private block".
  • Multicast. The class D range, 224.0.0.0/4, is still exactly what it was, and is where multicast addresses live.

Common questions#

Which class is 192.168.1.1?

Class C by the old scheme, because it starts 110. In current practice it is a private address, usually in a /24. The private ranges are listed in their own guide.

Is class E usable?

Not on the public internet. It is reserved and most software refuses to use it.

How many usable hosts does a /24 have?

254. The 256 addresses less the network address and the broadcast address. The subnet calculator works this out for any prefix.

Try it on your own connection

Sources and further reading

Keep reading

Published by My IP Address