Stuff/IPv4 Class C Subnetting

From juliano.info

Jump to: navigation, search
Figure 1: IPv4 subnetworks from /24 to /26 (click to enlarge).
Figure 2: Subnetworks from /26 to hosts (click to enlarge).

If you are a network administrator, you may have already faced a situation where you needed to explain someone the principles of subnetworks of IPv4 addresses. It is not immediately obvious to most people why any numerically continuous range of IP addresses are not continuous in the point-of-view of IPv4 subnetting, that is in fact a binary tree. I made the following graphs in order to show all the possible subnetworks of a IPv4 Class C address range.

A Class C (/24) subnetwork provides 256 host addresses, what would make a very large graph. Instead, the representation of the Class C is segmented in four /26 subnetworks for easier visualization. This segmentation is shown in Figure 1.

All four /26 subnetworks are shown superimposed in Figure 2, being each /26 subnetwork represented in a different color. Each inner node represents a subnetwork, from the bigger ones (in the center) to the smaller ones (on the periphery). Leafs are host addresses. Numbers represent the least significant octet of the IPv4 address (i.e. "ddd" in "aaa.bbb.ccc.ddd"). Subnetworks of prefix /31 are intentionally left unrepresented, since they are mostly useless in practice.

IPv4 addresses are continuous if, and only if, they constitute a whole branch in the graph. For example, consider the 192.168.1.0/24 network. The range 192.168.1.90 .. 192.168.1.97 is not continuous since the addresses are in multiple different branches of the graph, while the range 192.168.1.93 .. 192.168.1.103 is continuous (subnetwork 192.168.1.93/29).

Images

PDF files for these images.

Source

Source code used to generate these images. Available under the terms of the General Public License version 3.

Views