IP Subnet Identifiers, Subnet Addresses and Host Addresses
(Page 2 of 2)
Subnet Address Formulas
Notice when looking at subnet addressing that when you substitute subnet IDs in sequence, a pattern becomes immediately visible. The first subnet address is always the address of the overall network, because the subnet ID is all zeroes. Then, the second subnet address in decimal form is found by adding a specific multiple of two to one of the octets. The third address is then found by adding this same number to the second address, and so on.
In fact, I realized that the decimal value of each subnet address can be expressed as a formula, based on the class of the original network and the number of bits being used for the subnet ID. For example, consider a Class B network with overall address of x.y.0.0 (it doesn't matter what x and y are for our purposes). Now, say we are using two bits for the subnet ID. We have four subnet addresses here:
So, the formula in this case for subnet #N is x.y.N*64.0. If we use five bits for a subnet, the formula is x.y.N*8.0; as we saw above, the subnet address for subnet #11 in network 18.104.22.168 is 22.214.171.124. I have shown the formulas for all of the combinations of subnet ID and host ID size in the subnetting summary tables. These formulas may seem a bit confusing at first, but they can be a real time-saver once you become more familiar with subnetting.
Once we know the subnet address for a particular subnet, assigning IP addresses is easy. We just plug in values into the remaining host ID bits. Of course, we skip the all-zeroes value, so the first host in the subnet has all zeroes for the host ID except for a one in the right-most bit position. Then the next host has all zeroes except for 10 at the end (two in decimal). We can do this all the way up to one less than the all-ones value. Again, we then convert each IP address from binary to decimal.
Some more examples would definitely help you understand much better how these addresses are determined. This requires us to deal with a large number of nitty-gritty details and lots of binary numbers. You can find exactly these details in the section on practical subnetting.
Home - Table Of Contents - Contact Us
The TCP/IP Guide (http://www.TCPIPGuide.com)
Version 3.0 - Version Date: September 20, 2005
© Copyright 2001-2005 Charles M. Kozierok. All Rights Reserved.
Not responsible for any loss resulting from the use of this site.