IP Math’s

by MD0MDI
1.2K views
IP Maths

Given the IP address of 142.168.45.79 / 255.255.255.240 is the IP address of 142.168.45.79 a valid address for a user on that network?

So what are we really interested in? this is easy, taking the address shown above and the subnet given we can tell that we are only interested in the last octet, this is because all of the subnet octets are 255 except the last one, therefore that is the only one that we are interested in, and this is 240.

So we now need to work out what is available on this subnet, so we will write out a table similar to the one below.

128192224240248252254255
1286432168421

The easiest way to remember this is that you always start the first column always with 128, so in the first column place 128, i.e.

128
128

Then concentrate on the second row only, for this just half the previous number, so that you end up with the following:

128192
1286432168421

Now to get the top row, just add 128 + 64 = 192.

128192224
1286432168421

then the next column will be 192 + 32 = 224, and so on, till you get the following table.

128192224240248252254255
1286432168421

Now we need to convert the Network address of 142.168.45.79 to binary, as above we know that we are only interested in the last octet so all we need to worry about here is the .79 part of the IP address.

So drawing a line under the above table, and only taking into account the second row of numbers, put a ‘1’ into the columns that you need to make up ’79’, for the .79 portion of the IP address, and ‘0’ in the columns that are not required.

This should look like the following table.

128192224240248252254255The Subnet
1286432168421The Network ID
01001111The Network ID

Now create a new row after this for the Subnet address, again we are only interested in the last octet which is ‘240’. For this tough you will need to place a ‘1’ in the column for the 240 and all the fields to the left of this, this will then look like the following table.

128192224240248252254255The Subnet
1286432168421The Network ID
01001111The Network ID
11110000The Subnet

Now you need to draw a line under this and using binary maths, which is very simple, we need to work out the ‘Network Address’, this address is not useable by users on the network, but lets us know what the address range is. For example a standard Class C address of 192.168.0.0 / 24 (IP address 192.168.0.0, Subnet Mask 255.255.255.0) would be explained as:

192.168.0.0The Network Address
192.168.0.255The Broadcast Address
192.168.0.1The First Available IP Address
192.168.0.254The Last Available IP Address

So now for the math’s bit. all that you need to remember is the following table.

0+0=0
0+1=0
1+0=0
1+1=1

So taking this into account you should now have a table that looks like this.

128192224240248252254255The Subnet
1286432168421The Network ID
01001111The Network ID
11110000The Subnet
01000000The Network Address

This tells us that the first network address is 64, or to be precise 142.168.45.64

Now we need to make the final calculation, this will give us the ‘Broadcast Address’, for this we will need to first add a new row under our last and call this ‘The Broadcast Address.

Now, we know that the IP address used is also on the subnet range of 255.55.255.240, and we know that we are only really interested in the last set of numbers, i.e. .240, and because of this we need to enter a ‘1’ in all of the boxes to the right of the 240 (The Subnet row), this should look like the following table.

128192224240248252254255The Subnet
1286432168421The Network ID
01001111The Network ID
11110000The Subnet
01000000The Network Address
1111The Broadcast Address

Now to finish this, using the same math’s that we did earlier, look at the remaining four empty boxes at there respective columns, work this out, and this should look like the following table.

128192224240248252254255The Subnet
1286432168421The Network ID
01001111The Network ID
11110000The Subnet
01000000The Network Address
1111The Broadcast Address

Finally we need to take these last two rows and convert them back to numerics thus.

010000000.64
010011110.79

So, after all this, what do we know?

We now the following:

142.168.45.64The Network Address
142.168.45.79The Broadcast Address
142.168.45.65The First Available IP Address
142.168.45.78The Last Available IP Address

Related Posts

Leave a Comment

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

free counters

error: Content is protected !!