Monthly Archives: February 2013

Calculating IPv4 Subnets

To truly understand subnets it’s far easier to understand them from the perspective of the computer. Most people will be used to seeing a subnet written as, for example,, but decimal octets are purely for the readability of human eyes. Computers work with subnets on a binary level, and where a human sees, a computer sees 11111111111111111111111100000000.

So how does a subnet translate to network division? Well, every IP address has a network portion and a host portion, such as In this example — if a subnet of is used — 192.168.2 is the network and 128 is the host. The first question a computer asks itself is, “is the device I’m sending data to on the same network as me?”, and then proceeds to compare the destination IP address against its own IP address. If is sending data to, then it can see by comparing it to the subnet that they are both on the same network, and therefore the data only needs to be sent via the local network.

All of the 1′s in a subnet represent the network, and all of the 0′s represent the host; the computer aligns the subnet with the IP address to determine which numbers represent the network and which represents the host:


Continue reading