Subnetting · Lesson 5 of 7

CIDR

0 / 5 checkpoints answered

Full screen ↗

Classless Inter-Domain Routing represents an address range with a prefix length instead of relying on historical address classes. CIDR supports variable-sized allocations, subnetting, and route aggregation for IPv4 and IPv6.

Reading Prefix Notation

In 10.42.3.17/24, the first 24 bits are the network prefix and eight bits remain for positions within the range. The canonical network is 10.42.3.0/24; the supplied host address can still be written with the prefix when configuring an interface.

CheckWhat does /24 specify in an IPv4 CIDR value?

Calculating Range Size

IPv4 prefix /23 leaves nine host bits and therefore covers 2^9 = 512 total addresses. The aligned prefix 123.12.24.0/23 spans:

first: 123.12.24.0
last:  123.12.25.255

In traditional broadcast use, the first is the network address and the last the directed broadcast. Do not apply the “minus two” usable-host shortcut blindly to /31 point-to-point or /32 host routes.

CheckHow many total IPv4 addresses does a /23 contain?

Checking Alignment

A prefix must begin on its binary boundary. A /23 advances in blocks of two in the third octet when earlier octets are fixed, so 123.12.24.0/23 is aligned but 123.12.25.0/23 canonicalizes to the same 123.12.24.0/23 range.

CheckWhat is the canonical /23 network containing 123.12.25.0?

Aggregating Routes

CIDR can advertise one aggregate for several contiguous, equally sized, correctly aligned prefixes. For example, 192.0.2.0/25 and 192.0.2.128/25 combine into 192.0.2.0/24. Aggregation is safe only when the advertising router can correctly reach the complete aggregate or has policy to prevent loops and black holes.

CheckWhich aggregate covers both halves of 192.0.2.0/24?

Longest-Prefix Routing

When routes overlap, forwarding normally selects the eligible route with the longest matching prefix. A /24 route is more specific than a covering /16, while a default route /0 matches only when no more-specific eligible route wins.

CheckFor destination 10.42.3.8, which eligible route is more specific?

Summary

You can now use CIDR notation for both address ranges and route selection.

  1. Interpret the slash value as a leading prefix-bit count.
  2. Calculate total range size from remaining bits.
  3. Canonicalize a prefix to its aligned network boundary.
  4. Aggregate only contiguous aligned ranges with valid reachability.
  5. Prefer the longest eligible prefix during route lookup.