IPv4 Addressing (2): Classful in Depth
Now that you can read an address, this lesson supplies the exact numbers: how many networks and hosts each class allows, why two addresses per network are always lost, and why the whole classful system had to be replaced.
The canonical classful facts
These numbers come straight from the classful structure defined in RFC 791. They are not estimates; they are fixed facts, and the exam expects the exact figures. Learn this table as a unit.
| Class | Prefix / mask | Networks | Hosts per network | Host bits |
|---|---|---|---|---|
| A | /8 · 255.0.0.0 | 126 | 16,777,214 | 24 |
| B | /16 · 255.255.0.0 | 16,384 | 65,534 | 16 |
| C | /24 · 255.255.255.0 | 2,097,152 | 254 | 8 |
How the network counts are derived
The first few bits of the address are fixed by the class, so the number of network bits is what remains of the default prefix after those fixed bits:
- Class A — the first bit is 0, leaving 7 bits of network identifier:
27 = 128. Two are special: network
0.0.0.0/8(the “this network” address) and network127.0.0.0/8(loopback). That leaves 126 assignable Class A networks. - Class B — the first two bits are
10, leaving 14 network bits: 214 = 16,384 networks. - Class C — the first three bits are
110, leaving 21 network bits: 221 = 2,097,152 networks.
0.0.0.0/8) is reserved and 127.0.0.0/8 is loopback. 128 − 2 =
126. This is also why the first-octet Class A range is 1–126.The loopback block
The entire network 127.0.0.0/8 is reserved for loopback. A packet sent
to any address in this block never leaves the host — it is handed back up the local stack. The
most common member is 127.0.0.1, the standard loopback address. Pinging
ping 127.0.0.1 (the name localhost usually resolves to it) tests whether the
host’s own TCP/IP stack is working, with no dependence on a cable, switch, or router.
ping 127.0.0.1 fails, the problem is inside the host (its IP stack or NIC driver),
not the network. If it succeeds but you cannot reach another host, the local stack is fine and the
fault lies out on the network.127.0.0.0/8 block is loopback, not just 127.0.0.1.
A question may show 127.1.1.1 or 127.200.5.9 — these are loopback too.
Loopback is not routable.Host counts: the 2h − 2 rule
In a classful network, the number of addresses available for hosts depends on how many host bits remain. A Class A network has 24 host bits, Class B has 16, and Class C has 8. In theory that gives 2h addresses — but two of them cannot be assigned to a host:
- The network address, where all host bits are
0. - The broadcast address, where all host bits are
1.
| Class | Host bits (h) | 2h | Usable = 2h − 2 |
|---|---|---|---|
| A | 24 | 16,777,216 | 16,777,214 |
| B | 16 | 65,536 | 65,534 |
| C | 8 | 256 | 254 |
Network and broadcast addresses
Within any network, two of the addresses are reserved:
- The network address has all host bits set to
0. It names the network itself and is never assigned to a device. For192.168.1.0/24, that is192.168.1.0. - The broadcast address has all host bits set to
1. A packet sent to it is delivered to every host in that network. For192.168.1.0/24, that is192.168.1.255.
Every other address in the range (from .1 to .254 in a /24) is a usable
host address. This is exactly the 254 figure for a Class C network.
Unicast, broadcast, multicast
IPv4 supports three ways of addressing a packet to its receivers:
| Type | Sent to | Range / example |
|---|---|---|
| Unicast | Exactly one host | Classes A, B, C (e.g. 192.168.1.10) |
| Broadcast | All hosts in the local network | The network’s all-ones address (e.g. 192.168.1.255) |
| Multicast | A selected group that joined the group | Class D, 224.0.0.0 – 239.255.255.255 |
Unicast is one-to-one: a web request from your PC to a server. Broadcast is one-to-all-here: an ARP request asking “who has this IP?” uses the broadcast address, and every host in the subnet receives it. Multicast is one-to-many-select: only devices that have joined the group process the packet — used for streaming video, routing-protocol updates, and service discovery.
192.168.1.255 is only seen inside 192.168.1.0/24. Multicast, by contrast, can be
forwarded between networks when routers are multicast-enabled.Why classful is wasteful
Classful addressing forces every organisation into one of exactly three sizes, and both ends of the scale waste addresses badly:
- Too big. A company needing 400 hosts must take a Class B (/16) with 65,534 usable addresses. It uses 400 and wastes more than 65,000 — a whole /16 consumed by one site.
- Too small. A company needing 300 hosts cannot fit in a Class C (only 254 usable) and is forced up to a Class B, again wasting tens of thousands.
- No flexibility. There is no way to carve a large block into right-sized pieces under classful rules, so the address space runs out faster than necessary.
The fix came in two stages. First, subnetting lets you borrow bits from the host
portion to divide one classful network into smaller, right-sized subnetworks. Later,
CIDR (Classless Inter-Domain Routing) removed the classes entirely, allowing any prefix
length — /25, /26, /30, and so on. Together they are why we
can size networks precisely instead of choosing between 254 and 65,534 addresses. Subnetting is the
subject of Week 7; this lesson is the classful baseline you need before you start
borrowing bits.
Key terms
| Term | Meaning |
|---|---|
| Classful addressing | The original IPv4 scheme with fixed Classes A, B, C (and D, E) and default masks. |
| Network address | The address with all host bits 0; it names the network and is not assigned. |
| Broadcast address | The address with all host bits 1; a packet to it reaches every host in the network. |
| Loopback | The 127.0.0.0/8 block, used to test a host’s own IP stack (127.0.0.1). |
| Unicast | Traffic addressed to a single host. |
| Broadcast | Traffic addressed to all hosts in the local network; not forwarded by routers. |
| Multicast | Traffic addressed to a group (Class D) that hosts join to receive. |
| CIDR | Classless Inter-Domain Routing; allows any prefix length and removed the classes. |
Review
Check what you have learned with these review questions.
Sources & references
- Postel, J. RFC 791: Internet Protocol (1981), Section 3.2 (address classes and reserved network numbers). rfc-editor.org/rfc/rfc791.
- Braden, R. RFC 1122: Requirements for Internet Hosts — Communication Layers (1989), Section 3.2.1.3 (address formats and classes). rfc-editor.org/rfc/rfc1122.
- Rekhter, Y. et al. RFC 1918: Address Allocation for Private Internets (1996). rfc-editor.org/rfc/rfc1918.
- Cisco. CCNA (200-301) Exam Topics, IP Connectivity / IPv4 addressing. cisco.com.
Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.