A router receives a packet destined for 172.20.5.9. Using pure classful rules, how does it decide where the network portion ends?
It reads a subnet mask carried inside the packet header.
It inspects the leading bits of the first octet, finds it is Class B, and applies /16.
It always splits the address exactly in half at 16 bits regardless of class.
It counts the number of dots in the dotted-decimal notation.
Why does a Class C network provide 254 usable hosts rather than 256?
Two addresses are reserved by the ISP for billing purposes.
The all-zeros host value names the network and the all-ones host value is the broadcast address.
The router and the default gateway each consume one silent address.
Class C simply has a hardware limit of 254 devices per switch.
An organization needs about 4,000 hosts on one network. Under strict classful rules, which single class must it be assigned?
Class C, because a few of them can be combined automatically.
Class A, because only Class A supports thousands of hosts.
Class B, because a single Class C holds only 254 hosts and the next size up is Class B.
Class D, because it is the multicast class sized for large groups.
What fundamentally distinguishes Class D and Class E from Classes A, B, and C?
D and E have larger default masks than A, B, and C.
D and E are not split into network/host portions and are never assigned to individual hosts.
D and E use IPv6 addressing while A, B, and C use IPv4.
D and E are only used by home routers, while A, B, and C are used by ISPs.
A live video stream is sent once and delivered only to the hosts that chose to join a 224.x.x.x group. Which delivery model and class is this?
Broadcast, using Class B.
Unicast, using Class A.
Multicast, using Class D.
Anycast, using Class E.
The Five Address Classes
Key Points
- The class of an IPv4 address is fixed by the leading bits of the first octet: 0 = A, 10 = B, 110 = C, 1110 = D, 1111 = E.
- The class dictates a fixed default mask that sets the network/host boundary: Class A = /8 (255.0.0.0), Class B = /16 (255.255.0.0), Class C = /24 (255.255.255.0).
- Only Classes A, B, and C were assigned to hosts. Class D (224–239) is multicast; Class E (240–255) is experimental.
- Usable hosts always equal 2^(host bits) − 2, because the all-zeros host is the network address and the all-ones host is the broadcast address.
- The assignable Class A range stops at 126 (not 127) because 127.0.0.0/8 was carved out for loopback.
An IPv4 address is 32 bits, written as four decimal octets like 192.168.1.10. The classful model split those bits into a network portion and a host portion, and the location of that split was decided entirely by the leading bits of the first octet. A router could therefore classify any address just by inspecting its high-order bits.
| Class | Leading bits | First-octet range | Meaning |
| A | 0 | 1–126 | Large networks |
| B | 10 | 128–191 | Medium networks |
| C | 110 | 192–223 | Small networks |
| D | 1110 | 224–239 | Multicast |
| E | 1111 | 240–255 | Experimental/reserved |
Figure 3.1: Leading-bit decision tree for IPv4 classes A–E
graph TD
Start["First bit of the address"]
Start -->|"0"| A["Class A: 1–126 (large networks)"]
Start -->|"1"| B1["Second bit?"]
B1 -->|"0"| B["Class B: 128–191 (medium networks)"]
B1 -->|"1"| C1["Third bit?"]
C1 -->|"0"| C["Class C: 192–223 (small networks)"]
C1 -->|"1"| D1["Fourth bit?"]
D1 -->|"0"| D["Class D: 224–239 (multicast)"]
D1 -->|"1"| E["Class E: 240–255 (experimental)"]
Classes A, B, and C were the assignable classes. Each carves the 32 bits differently, and each "minus 2" in the host count reflects the network address (all-zeros host) and the directed broadcast address (all-ones host), neither of which can be given to a real device.
Figure 3.2: Network/host split of the 32-bit address per assignable class
graph LR
subgraph "Class A (/8)"
A1["Network
8 bits"] --- A2["Host — 24 bits"]
end
subgraph "Class B (/16)"
B1["Network — 16 bits"] --- B2["Host — 16 bits"]
end
subgraph "Class C (/24)"
C1["Network — 24 bits"] --- C2["Host
8 bits"]
end
| Class | Default mask | CIDR | Net / host bits | # of networks | Hosts per network |
| A | 255.0.0.0 | /8 | 8 / 24 | 126 | 16,777,214 |
| B | 255.255.0.0 | /16 | 16 / 16 | 16,384 | 65,534 |
| C | 255.255.255.0 | /24 | 24 / 8 | 2,097,152 | 254 |
Worked example. Take 172.16.40.5. The first octet, 172, falls between 128 and 191, so it is Class B, default mask 255.255.0.0 (/16). The first 16 bits (172.16) are the network and the last 16 (40.5) are the host. For 200.1.2.3, the first octet 200 lands in 192–223, so it is Class C, default mask 255.255.255.0 (/24), network 200.1.2.0, host 3.
Class D and Class E are never assigned to hosts and are not split into network/host portions. Class D (224.0.0.0/4) is reserved for multicast: a single stream sent to a group address reaches every host that joined the group, without the sender copying it per recipient. Think of unicast as a phone call, broadcast as shouting in a room, and multicast as a subscription newsletter written once. Class E (240.0.0.0/4) is reserved for research and experimental use, with 255.255.255.255 carved out separately as the limited broadcast address.
Visual animation — coming soon
A router receives a packet destined for 172.20.5.9. Using pure classful rules, how does it decide where the network portion ends?
It reads a subnet mask carried inside the packet header.
It inspects the leading bits of the first octet, finds it is Class B, and applies /16.
It always splits the address exactly in half at 16 bits regardless of class.
It counts the number of dots in the dotted-decimal notation.
Why does a Class C network provide 254 usable hosts rather than 256?
Two addresses are reserved by the ISP for billing purposes.
The all-zeros host value names the network and the all-ones host value is the broadcast address.
The router and the default gateway each consume one silent address.
Class C simply has a hardware limit of 254 devices per switch.
An organization needs about 4,000 hosts on one network. Under strict classful rules, which single class must it be assigned?
Class C, because a few of them can be combined automatically.
Class A, because only Class A supports thousands of hosts.
Class B, because a single Class C holds only 254 hosts and the next size up is Class B.
Class D, because it is the multicast class sized for large groups.
What fundamentally distinguishes Class D and Class E from Classes A, B, and C?
D and E have larger default masks than A, B, and C.
D and E are not split into network/host portions and are never assigned to individual hosts.
D and E use IPv6 addressing while A, B, and C use IPv4.
D and E are only used by home routers, while A, B, and C are used by ISPs.
A live video stream is sent once and delivered only to the hosts that chose to join a 224.x.x.x group. Which delivery model and class is this?
Broadcast, using Class B.
Unicast, using Class A.
Multicast, using Class D.
Anycast, using Class E.
Two different companies both use 10.0.0.5 inside their networks and nothing breaks on the public Internet. Why is that possible?
10.0.0.0/8 is an RFC 1918 private range that is never routed on the public Internet, so it can be reused anywhere.
IANA assigns 10.0.0.5 to only one company at a time and rotates it.
The addresses are actually IPv6, which allows duplicates.
Each company registered the address separately with its ISP.
A developer runs a web server and tests it by browsing to 127.0.0.1. What happens to that traffic?
It is broadcast to every device on the local subnet.
It loops back inside the machine and never leaves the host.
It is forwarded to the default gateway and out to the Internet.
It is sent to the DHCP server for auto-configuration.
A laptop set to use DHCP suddenly shows the address 169.254.12.44. What is the most likely explanation?
The laptop was manually assigned a public static IP.
No DHCP server could be reached, so the host self-assigned an APIPA link-local address.
The laptop joined a multicast group and adopted its address.
The ISP placed the laptop behind Carrier-Grade NAT.
A textbook author wants an example IP that is guaranteed never to collide with a real routable host. Which address is the correct choice?
8.8.8.8, because it is easy to remember.
192.0.2.10, because it is in the RFC 5737 documentation range (TEST-NET-1).
127.0.0.1, because loopback is reserved for examples.
255.255.255.255, because broadcast addresses are unassigned.
Which statement correctly contrasts the 100.64.0.0/10 CGNAT block with the RFC 1918 private ranges?
Both are identical; 100.64.0.0/10 is just a fourth RFC 1918 range.
100.64.0.0/10 is public routable space, while RFC 1918 ranges are not.
100.64.0.0/10 gives ISPs shared space for Carrier-Grade NAT that avoids colliding with the customer's own RFC 1918 addresses.
100.64.0.0/10 is used only for loopback, unlike RFC 1918.
Special and Reserved Ranges
Key Points
- The three RFC 1918 private ranges —
10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 — are non-routable and freely reusable inside any private network.
127.0.0.0/8 is loopback: traffic never leaves the host. 127.0.0.1 is the standard "localhost" address.
169.254.0.0/16 (APIPA, RFC 3927) is self-assigned when DHCP fails — a strong sign of a DHCP problem.
- Documentation ranges (RFC 5737):
192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24 exist so examples never collide with real space.
100.64.0.0/10 (RFC 6598) is CGNAT shared space, distinct from RFC 1918 so it does not collide with customers' private addresses.
Not every address in the 32-bit space is up for grabs. Certain blocks are permanently reserved for special jobs, and you will meet them constantly in real work.
The most important set is RFC 1918 (1996), which reserves three private blocks for use inside private networks. Because they never appear on the public Internet, any organization can reuse them freely — which is why your home router hands out 192.168.x.x addresses. A device with an RFC 1918 address must use NAT to reach the public Internet. Think of these like internal room numbers: thousands of buildings all have a "Room 101," and that is fine because the number only means something inside the building.
| Range | CIDR | Total addresses | Legacy equivalent |
| 10.0.0.0 – 10.255.255.255 | 10.0.0.0/8 | 16,777,216 | one Class A |
| 172.16.0.0 – 172.31.255.255 | 172.16.0.0/12 | 1,048,576 | sixteen Class B |
| 192.168.0.0 – 192.168.255.255 | 192.168.0.0/16 | 65,536 | 256 Class C |
The entire block 127.0.0.0/8 is reserved for loopback: any packet sent there loops back to the sending host and never leaves the machine. 127.0.0.1 is universally "localhost." This reservation is also why assignable Class A stops at 126 — the 127 block was already claimed. Meanwhile 169.254.0.0/16 is APIPA / link-local: a host set for DHCP that can find no server auto-assigns itself an address here so it can at least talk on the local link. Seeing a 169.254.x.x address is a strong hint that DHCP failed.
Finally, the documentation ranges (RFC 5737) — 192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24 — let manuals use realistic addresses that will never collide with real space, and 100.64.0.0/10 (RFC 6598) gives ISPs shared space for Carrier-Grade NAT without colliding with customers' RFC 1918 addresses.
| Range | Purpose | Defining RFC |
| 0.0.0.0/8 | "This host / this network"; 0.0.0.0 as wildcard | RFC 1122 |
| 10.0.0.0/8 | Private (RFC 1918) | RFC 1918 |
| 100.64.0.0/10 | CGNAT shared address space | RFC 6598 |
| 127.0.0.0/8 | Loopback (localhost = 127.0.0.1) | RFC 1122 |
| 169.254.0.0/16 | Link-local / APIPA | RFC 3927 |
| 172.16.0.0/12 | Private (RFC 1918) | RFC 1918 |
| 192.0.2.0/24 | Documentation (TEST-NET-1) | RFC 5737 |
| 192.168.0.0/16 | Private (RFC 1918) | RFC 1918 |
| 198.51.100.0/24 | Documentation (TEST-NET-2) | RFC 5737 |
| 203.0.113.0/24 | Documentation (TEST-NET-3) | RFC 5737 |
| 224.0.0.0/4 | Multicast (former Class D) | RFC 5771 / 1112 |
| 240.0.0.0/4 | Reserved/experimental (former Class E) | RFC 1112 |
| 255.255.255.255/32 | Limited (local) broadcast | — |
Two different companies both use 10.0.0.5 inside their networks and nothing breaks on the public Internet. Why is that possible?
10.0.0.0/8 is an RFC 1918 private range that is never routed on the public Internet, so it can be reused anywhere.
IANA assigns 10.0.0.5 to only one company at a time and rotates it.
The addresses are actually IPv6, which allows duplicates.
Each company registered the address separately with its ISP.
A developer runs a web server and tests it by browsing to 127.0.0.1. What happens to that traffic?
It is broadcast to every device on the local subnet.
It loops back inside the machine and never leaves the host.
It is forwarded to the default gateway and out to the Internet.
It is sent to the DHCP server for auto-configuration.
A laptop set to use DHCP suddenly shows the address 169.254.12.44. What is the most likely explanation?
The laptop was manually assigned a public static IP.
No DHCP server could be reached, so the host self-assigned an APIPA link-local address.
The laptop joined a multicast group and adopted its address.
The ISP placed the laptop behind Carrier-Grade NAT.
A textbook author wants an example IP that is guaranteed never to collide with a real routable host. Which address is the correct choice?
8.8.8.8, because it is easy to remember.
192.0.2.10, because it is in the RFC 5737 documentation range (TEST-NET-1).
127.0.0.1, because loopback is reserved for examples.
255.255.255.255, because broadcast addresses are unassigned.
Which statement correctly contrasts the 100.64.0.0/10 CGNAT block with the RFC 1918 private ranges?
Both are identical; 100.64.0.0/10 is just a fourth RFC 1918 range.
100.64.0.0/10 is public routable space, while RFC 1918 ranges are not.
100.64.0.0/10 gives ISPs shared space for Carrier-Grade NAT that avoids colliding with the customer's own RFC 1918 addresses.
100.64.0.0/10 is used only for loopback, unlike RFC 1918.
What was the root cause of the classful model's inefficiency?
Routers were too slow to compute subnet masks in the 1990s.
It offered only three coarse, fixed sizes (254, 65,534, 16.7M hosts), none of which matched typical organizations.
It reserved too many addresses for multicast and experimentation.
IPv4 addresses were only 16 bits long at the time.
An organization needs 2,000 hosts. Under classful rules it is given a full Class B. Why is this wasteful?
A Class B holds 65,534 hosts, so roughly 63,000 addresses are locked away and unusable by anyone else.
Class B addresses cost more money than the organization can afford.
Class B networks are slower than Class C networks.
A Class B can only be split into exactly two subnets.
To avoid wasting a Class B, an organization is instead given many separate Class C blocks. What new problem does this create at Internet scale?
Class C blocks cannot be connected to Class B networks.
Each Class C must be advertised as its own route, ballooning backbone routing tables toward router memory limits.
Class C addresses are always private and cannot reach the Internet.
Multiple Class C blocks automatically merge into a Class A.
How does CIDR's core idea directly fix the sizing gap?
It doubles the size of every class so more hosts fit.
It abandons fixed A/B/C boundaries and lets the network/host split fall at any bit, so a /21 can be issued for ~2,000 hosts.
It converts all IPv4 addresses to IPv6 immediately.
It forces every organization to use only Class C blocks.
The four networks 192.168.0.0/24 through 192.168.3.0/24 are summarized into a single 192.168.0.0/22. Which classful problem does this technique address, and what is it called?
Address waste, via VLSM.
Routing-table explosion, via route aggregation (supernetting).
Class B exhaustion, via multicast.
Loopback conflicts, via NAT.
Why Classful Failed
Key Points
- Classful offered only three sizes — 254, 65,534, and 16.7 million hosts — and none matched a typical organization.
- An org needing ~2,000 hosts had to take a full Class B and waste roughly 63,000 addresses, accelerating IPv4 exhaustion.
- Class B was the only "reasonable" size, so it was consumed rapidly and headed toward exhaustion.
- Working around the gap with many Class C blocks caused routing-table explosion, since each block was a separate route.
- CIDR (RFC 1519, 1993) fixed this with arbitrary prefix lengths for right-sized allocations and route aggregation; VLSM added variable subnet sizes within one network.
The classful model was easy for routers to parse, but it had a fatal flaw: only three coarse, fixed sizes. Class C held 254 hosts (too small for most), Class B held 65,534 (usually far too large), and Class A held 16.7 million (astronomical). There was nothing in between. An organization needing 2,000 hosts could not use a Class C, so it took an entire Class B and wasted roughly 63,000 addresses — locked away from everyone else. It is like a shoe store stocking only child size 1, adult size 9, and clown size 30: a size-11 foot must take the size 30.
This granularity problem cascaded. Because Class B was the only reasonable size for medium and large organizations, everyone reached for it, driving Class B toward exhaustion. The natural workaround — handing out many stitched-together Class C blocks — created a second crisis: each Class C had to be advertised as its own route, so backbone routing tables exploded toward the memory limits of the routers themselves.
Figure 3.3: The classful lose-lose dilemma
flowchart TD
Need["Organization needs ~2,000 hosts (no matching class size)"]
Need --> OptB["Option A: assign one Class B (65,534 hosts)"]
Need --> OptC["Option B: assign many Class C blocks"]
OptB --> Waste["Wastes ~63,000 addresses
→ accelerates IPv4 exhaustion"]
OptC --> Routes["Each block = a separate route"]
Routes --> Explosion["Backbone routing tables explode
→ exceed router memory"]
Visual animation — coming soon
The solution, introduced in 1993 and formalized in RFC 1519, was CIDR — Classless Inter-Domain Routing. CIDR abandons the rigid A/B/C boundaries and lets the network/host split fall at any bit position, expressed as a prefix length like /20 or /27. This delivered two decisive benefits:
- Right-sized allocations. The org needing 2,000 hosts gets a /21 (2,046 usable hosts) instead of a full /16 — cutting waste from ~63,000 addresses to a few dozen.
- Route aggregation (supernetting). Contiguous prefixes summarize into one entry:
192.168.0.0/24 through 192.168.3.0/24 collapse into a single 192.168.0.0/22, slowing routing-table growth.
Working alongside CIDR is VLSM (Variable-Length Subnet Masking), which lets a single network be subdivided into subnets of different sizes — a user LAN gets a /24 while a point-to-point WAN link gets a tiny /30 — instead of forcing one fixed mask everywhere.
Figure 3.4: How CIDR and VLSM answer the classful failures
flowchart LR
Classful["Classful model
(fixed A/B/C sizes)"] --> CIDR["CIDR (RFC 1519, 1993)
arbitrary prefix lengths"]
CIDR --> Right["Right-sized allocations
(e.g. /21 for ~2,000 hosts)"]
CIDR --> Agg["Route aggregation / supernetting
(four /24 → one /22)"]
CIDR --> VLSM["VLSM
variable subnet sizes within one network"]
Right --> Fix1["Fixes address waste"]
Agg --> Fix2["Fixes routing-table explosion"]
VLSM --> Fix3["Fixes intra-domain waste (e.g. /30 WAN links)"]
What was the root cause of the classful model's inefficiency?
Routers were too slow to compute subnet masks in the 1990s.
It offered only three coarse, fixed sizes (254, 65,534, 16.7M hosts), none of which matched typical organizations.
It reserved too many addresses for multicast and experimentation.
IPv4 addresses were only 16 bits long at the time.
An organization needs 2,000 hosts. Under classful rules it is given a full Class B. Why is this wasteful?
A Class B holds 65,534 hosts, so roughly 63,000 addresses are locked away and unusable by anyone else.
Class B addresses cost more money than the organization can afford.
Class B networks are slower than Class C networks.
A Class B can only be split into exactly two subnets.
To avoid wasting a Class B, an organization is instead given many separate Class C blocks. What new problem does this create at Internet scale?
Class C blocks cannot be connected to Class B networks.
Each Class C must be advertised as its own route, ballooning backbone routing tables toward router memory limits.
Class C addresses are always private and cannot reach the Internet.
Multiple Class C blocks automatically merge into a Class A.
How does CIDR's core idea directly fix the sizing gap?
It doubles the size of every class so more hosts fit.
It abandons fixed A/B/C boundaries and lets the network/host split fall at any bit, so a /21 can be issued for ~2,000 hosts.
It converts all IPv4 addresses to IPv6 immediately.
It forces every organization to use only Class C blocks.
The four networks 192.168.0.0/24 through 192.168.3.0/24 are summarized into a single 192.168.0.0/22. Which classful problem does this technique address, and what is it called?
Address waste, via VLSM.
Routing-table explosion, via route aggregation (supernetting).
Class B exhaustion, via multicast.
Loopback conflicts, via NAT.