4.3.8 · D5Computer Networks

Question bank — IPv4 — address format, classes, subnetting, CIDR notation

1,531 words7 min readBack to topic

Before we begin, one shared vocabulary so no term sneaks in undefined:


True or false — justify

A larger prefix number /n means a larger network
False. More network bits leaves fewer host bits, so the network is smaller. A /30 holds 2 usable hosts; a /8 holds millions.
A /31 network has zero usable hosts because
In classic counting yes, but RFC 3021 allows /31 on point-to-point links where both addresses are usable — there's no need for a broadcast when only two ends exist.
Every IPv4 address belongs to some class A–E
True by the leading-bit rule, but under CIDR the class is ignored — routing uses the prefix you write, not the historic class.
The mask 255.255.255.0 and the notation /24 describe the same split
True. Twenty-four consecutive ones is 11111111.11111111.11111111.00000000, which reads as 255.255.255.0. They are two spellings of one boundary.
192.168.1.255/24 is a normal host you can assign to a laptop
False. With host bits all ones it is the broadcast address of 192.168.1.0/24, reserved to reach every host — never assigned to a single machine.
10.0.0.0/8 addresses can appear as source IPs on the public Internet
False. 10.0.0.0/8 is private (RFC 1918); routers drop it publicly. It must be translated to a public address first.
A device with 169.254.5.9 has a working DHCP-assigned address
False. 169.254.0.0/16 is link-local (APIPA), self-assigned precisely because DHCP failed — it only reaches the local link.
Two /24 networks can always be merged into one /23
False. They aggregate only if they are adjacent and aligned — the /23 boundary requires the first /24's third octet to be even (e.g. .0 and .1, not .1 and .2).
The loopback 127.0.0.1 is a real network interface reachable by other computers
False. All of 127.0.0.0/8 is loopback — traffic never leaves the host. Only the local machine sees it.

Spot the error

"I subnetted /24 into /26 and got usable hosts per subnet."
Error: forgot the minus 2. Six host bits give 64 patterns, but network (all-zeros) and broadcast (all-ones) are reserved ⇒ 62 usable.
"For 4 subnets I borrowed 1 host bit since 4 is small."
Error: 1 bit gives only subnets. You need bits. Each borrowed bit doubles the subnet count.
"My subnet's network address is 192.168.1.40/26."
Error: for /26 the block size is 64, so network addresses must be multiples of 64 in the last octet: .0, .64, .128, .192. 40 isn't a boundary; the network is .0.
"Class C always gives 254 hosts, so I can't make a smaller network."
Error: that's classful thinking. CIDR is classless — you can carve a /24 into /30s (2 hosts each) or /29s (6 hosts each) freely.
"255.255.255.255 is a valid network address for some subnet."
Error: it is the limited broadcast address, reserved to reach everything on the local segment. It cannot name a network or a host.
"To convert 168 I stopped at 10100000 since that's close enough."
Error: . Conversion must be exact: . See Binary and Positional Number Systems.
"172.15.0.0 is a private address since it's near 172.16."
Error: the private range is 172.16.0.0/12, meaning 172.16172.31 only. 172.15.x.x is public — "near" doesn't count, the prefix boundary does.
"A /26 has more IP addresses to give out than a /24."
Error: /26 has 26 network bits (6 host bits, 62 hosts); /24 has 8 host bits (254 hosts). Bigger prefix = smaller address pool.

Why questions

Why do we subtract 2 when counting usable hosts, but not when counting subnets?
Hosts lose the all-zeros (network) and all-ones (broadcast) patterns — those name the network, not machines. Subnets have no such reserved patterns; all combinations are legitimate subnets.
Why does CIDR shrink routing tables compared to classful routing?
Adjacent networks sharing a common prefix collapse into one route (aggregation/supernetting). One /23 entry replaces two /24 entries, so routers store far fewer lines.
Why split an address into network and host parts at all?
So routers store routes to networks (thousands), not to every device (billions). They match only the network part — smaller tables, faster lookups.
Why did classful addressing waste so much space?
Sizes were fixed with huge gaps: Class C = 254 hosts, Class B = 65k, nothing between. An org needing 2000 hosts grabbed a whole Class B, stranding ~63k addresses.
Why is the block size and not just ?
is the total host count; the block size is that count expressed within the single octet the mask breaks. When many host bits spill past one octet you measure spacing in the breaking octet only.
Why does IPv6 exist if IPv4 already has ~4.3 billion addresses?
ran out under global demand even with subnetting and NAT. IPv6 uses 128 bits (), effectively unlimited.
Why can a router pick /24 over /16 for the same destination?
Longest-prefix match: the most specific (longest) matching prefix wins, because it describes the destination more precisely than a broader route.

Edge cases

What is the "network" and "broadcast" of a /32?
A /32 has zero host bits, so the single address is both its own network and broadcast — it names exactly one host (used for host routes).
How many usable hosts does a /30 give, and what is it used for?
usable hosts — exactly right for a point-to-point link between two routers, one address per end.
Is 0.0.0.0/0 a valid route, and what does it mean?
Yes — with zero network bits it matches every address. It is the default route ("send anything I don't otherwise know how to reach here").
What happens to the host count as ?
Host bits , so usable hosts formally, i.e. the "minus 2" formula breaks down. /31 and /32 are the special cases handled by their own rules.
Does the first octet 127 belong to Class A by the leading-bit rule?
By leading bit 0 it looks Class A, but 127.0.0.0/8 is carved out entirely for loopback — a reserved exception, not usable as a normal Class A network.
Can the network address of one subnet equal the broadcast of the previous one?
No — they differ by 1. For /26: .63 is broadcast of the .0 block; .64 is the next network. Consecutive but never equal.

Recall One-line self-test before you leave
  • Bigger /n ⇒ bigger or smaller network? :::- Smaller — more network bits, fewer host bits.
  • Why "minus 2" for hosts but not subnets? :::- Hosts lose network + broadcast patterns; subnets reserve nothing.
  • 172.15.0.0 private? :::- No — private is 172.16172.31 only.
  • 0.0.0.0/0 means? :::- Default route, matches everything.