Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Class C Network: How Its 24-Bit Prefix Shaped IPv4

· 6 min read · Home Networking

In this article
  1. Background: The Classful Addressing System
  2. How the 24-Bit Prefix Works
  3. Why 254 Hosts? The Reserved Addresses
  4. How the 24-Bit Prefix Shaped IPv4 Allocation
  5. Common Misconceptions and Mistakes
  6. Comparison: Class C vs. CIDR and Modern Subnetting
  7. Alternatives and Evolution
  8. Frequently Asked Questions

Class C networks, defined by a 24-bit network prefix, were the workhorse of early IPv4, providing up to 254 usable host addresses per network. This structure directly shaped how organizations, ISPs, and even modern subnetting (CIDR) approach address allocation today. The 24-bit prefix is the reason you see so many IP addresses starting with 192.168.x.x and why the /24 notation is still the default mental model for a “small office” subnet.

Background: The Classful Addressing System

When IPv4 was designed in the early 1980s (RFC 791, 1981), the address space was divided into fixed classes based on the leading bits of the 32-bit address. The classes were:

  • Class A: 0.0.0.0 to 127.255.255.255, with an 8-bit network prefix, allowing 16,777,216 addresses per network (but only 126 usable networks).
  • Class B: 128.0.0.0 to 191.255.255.255, with a 16-bit prefix, giving 65,536 addresses per network.
  • Class C: 192.0.0.0 to 223.255.255.255, with a 24-bit prefix, giving 256 addresses per network.
  • Class D (multicast) and Class E (reserved) followed.

The class was determined by the first bits: Class A started with 0, Class B with 10, Class C with 110. This meant that the first octet (the first 8 bits) of a Class C address always fell between 192 and 223. The 24-bit prefix meant that the first three octets identified the network, and only the last octet (8 bits) identified the host. That gave 2^8 = 256 possible addresses, but the all-zeros host (network address) and all-ones host (broadcast) were reserved, leaving 254 usable hosts.

How the 24-Bit Prefix Works

In IPv4, an IP address is a 32-bit binary number, usually written as four decimal octets (e.g., 192.168.1.0). The network prefix is the number of bits that are fixed for the network portion. For Class C, that prefix is 24 bits, meaning the first 24 bits (three octets) are the network identifier, and the remaining 8 bits are the host identifier.

For example, the address 192.168.1.0 with a /24 prefix means:

  • Network portion: 192.168.1 (binary: 11000000.10101000.00000001)
  • Host portion: the last octet, from 0 to 255

The subnet mask for a /24 is 255.255.255.0. In binary, that is 24 ones followed by 8 zeros. When you perform a bitwise AND between the IP address and the subnet mask, you get the network address. For 192.168.1.0, the network address is 192.168.1.0. The broadcast address is 192.168.1.255, and usable host addresses are 192.168.1.1 to 192.168.1.254.

Why 254 Hosts? The Reserved Addresses

Out of the 256 addresses in a /24, two are always reserved:

  • Network address: the first address (e.g., 192.168.1.0) – used to identify the network itself.
  • Broadcast address: the last address (e.g., 192.168.1.255) – used to send packets to all hosts on the network.

That leaves 254 assignable addresses. This is why you often see “/24” equated with “254 hosts.” In practice, you might also lose one address to the default gateway (router), leaving 253 for devices, but that is not a formal reservation.

How the 24-Bit Prefix Shaped IPv4 Allocation

The Class C structure had a profound effect on how IPv4 addresses were handed out:

  • Small organizations could get a single Class C block, which was enough for a small office or a department.
  • ISPs would allocate multiple Class C blocks to larger customers, but this led to routing table bloat because each block was advertised separately.
  • Private addressing (RFC 1918) reserved the 192.168.0.0/16 range (which is 256 Class C networks) for internal use, which is why almost every home router uses 192.168.1.0/24 or 192.168.0.0/24.
  • Subnetting became a way to split a Class C into smaller chunks, but the fixed 24-bit boundary made it inefficient for networks that needed, say, 100 addresses – they still had to take a whole /24.

This inefficiency was a major driver for the development of Classless Inter-Domain Routing (CIDR) in 1993 (RFC 1518/1519). CIDR allowed prefixes of any length, not just 8, 16, or 24. So a network needing 100 addresses could get a /25 (128 addresses, 126 usable) instead of wasting a whole /24.

Common Misconceptions and Mistakes

One common misconception is that a /24 always equals “254 hosts,” but that is only true if you are using the entire subnet. If you subnet a /24 into smaller pieces, each sub-subnet has its own network and broadcast addresses. Another mistake is confusing the network address with the broadcast address – the network address is the first, the broadcast is the last. Also, some people think the 0 and 255 addresses are always unusable, but that is only true for a /24. In a /25, the usable hosts are 1-126 and 129-254, not 0-255.

Another common error is mixing up the decimal and binary forms. For example, 192.168.1.0/24 is not the same as 192.168.1.0/25 – the latter has a different subnet mask and a different range of usable addresses.

Comparison: Class C vs. CIDR and Modern Subnetting

Today, the classful system is obsolete, but the 24-bit prefix lives on as the most common CIDR prefix. When you see a network like 10.0.0.0/24, it is technically a Class A private address, but the /24 prefix is what matters. The class of the address no longer dictates the prefix length; you can have a /24 on any address.

In practice, the 24-bit prefix is often used as the default for small networks because it provides a good balance: enough addresses for a small office, and the subnet mask 255.255.255.0 is easy to remember. Larger networks might use /16 or /8, but those are less common in modern design because they waste addresses.

Alternatives and Evolution

The 24-bit prefix was not the only option; Class B (16-bit) and Class A (8-bit) existed for larger networks. However, the classful system was rigid. CIDR replaced it, allowing variable-length subnet masks (VLSM) and supernetting (combining multiple Class C blocks into a larger block). For example, a company might get a /22 (which is four /24s) to have 1022 usable addresses.

IPv6, the successor to IPv4, uses 128-bit addresses and does away with classes entirely. But the concept of a “network prefix” remains, just with much larger numbers. The 24-bit prefix is a relic, but its influence is still felt in how we think about subnet sizes.

Frequently Asked Questions

Why is the default subnet mask for a Class C network 255.255.255.0?

Because the 24-bit prefix means the first 24 bits are the network portion. In decimal, 24 bits of ones is 255.255.255, and the remaining 8 bits are zeros, giving 0. So the mask is 255.255.255.0.

How many usable IP addresses are in a /24 subnet?

254. The total is 256, but the network address (first) and broadcast address (last) are reserved. If you also reserve the gateway, you have 253 for devices, but that is not a formal rule.

Can I use 192.168.1.0 as a host address?

No, that is the network address, used to identify the subnet itself. It cannot be assigned to a device. Similarly, 192.168.1.255 is the broadcast address and cannot be used.

What is the difference between Class C and /24?

Class C is a historical classification based on the first octet (192-223) and always used a /24 prefix. /24 is a CIDR notation that can be applied to any address, regardless of class. So a /24 is not necessarily Class C; it is just a prefix length.

Why do home routers use 192.168.1.0/24?

Because 192.168.0.0/16 is a private range reserved for local use (RFC 1918). The /24 is a convenient size for a home network, and the 192.168.1.x pattern is easy to remember. It is not mandatory; you can use 10.0.0.0/24 or 172.16.0.0/24 as well.

Can I subnet a /24 into smaller networks?

Yes, you can borrow bits from the host portion. For example, a /25 gives two subnets of 126 usable hosts each, a /26 gives four subnets of 62 hosts, and so on. Each subnet has its own network and broadcast addresses.