Connected: An Internet Encyclopedia
Nested Prefixes

Up: Connected: An Internet Encyclopedia
Up: Programmed Instruction Course
Up: Subnetting and CIDR
Prev: A Real Example (cont)
Next: Tricks of the Trade

Nested Prefixes As the last example demonstrated, a single IP address can be matched by multiple address prefixes of different lengths. Likewise, a single address prefix can be matched by other address prefixes. More precisely, all the addresses matched by an address prefix can be matched by other, shorter prefixes.

Recall that 208.130.29.33 was matched by both 208.130.28/22 and 208.128/11. In fact, all the addresses matched by 208.130.28/22 are also matched by 208.128/11. As the diagram shows, everything matching 208.130.28/22 must agree with it in the first 22 bits. Likewise, everything matching 208.128/11 must agree with it in the first 11 bits. Since the first 11 bits of the two prefixes are the same, everything matching the longer one (22 bits) will by necessity match the shorter one as well. The converse is not true - the longer prefix does not match everything the shorter prefix does, since the middle 11 bits could be anything to match the shorter prefix, but must follow an exact pattern to match the longer one.

If a shorter prefix matches everything a longer prefix does, we say that the shorter prefix contains the longer one, and that the longer prefix extends, or is an extension of, the shorter one. Since longer prefixes, with larger prefix length numbers, match fewer IP addresses, I will try to avoid using the confusing terms larger or smaller, and instead use longer and shorter when referring to IP address prefixes.


Next: Tricks of the Trade

Connected: An Internet Encyclopedia
Nested Prefixes