Here’s one more example using the binary method
and after this I’m gonna show you the quick method.
If a PC had an address of 172.16.129.1/17 or 172.16.129.1 255.255.128.0
you would once again need to work out where the subnet and host portions are split.
In this example /17 means that 17 bits of the 32 bits IP address
are used for network or subnet and the remaining 15 bits
are used as the host portion of the address.
So 172.16.129.1/17 means that the split takes place in the 3rd octet.
The reason why once again is the first octet is 8 bits in size, the second octet
is 8 bits in size so that gives us 16 bits, 17 bits in the network or subnet
means that the split between subnet and host is in the 3rd octet.
So once again you need to convert the 3rd and 4th octet into binary.
There’s no need to convert the 1st 2 octet as they are part of the network
or subnet portion of the address.
You only need to convert the host portion of the address into binary.
So in binary 1 followed by 6 binary 0's followed by 1 equals 129 in decimal,
7 0's followed by binary 1 is the binary equivalent of 1 in decimal.
Once again refer to the binary section of this course if you're not sure
how to convert decimal into binary and vice versa.
So once again 172.16.1 is the network or subnet portion of the address
and the remaining bits of the host portion of the address.
So to work out the network or subnet portion of the address
you need to fill the host portion of an address with binary 0's.
So this green portion of the address needs to be filled with 0's and that will give
us the subnet which is 172.16.1, that binary 1 is part of the network address
followed by 7 0's, followed by 8 0's.
So in the 3rd octet we have 1 binary 1 followed by 7 binary 0's
which give us the equivalent decimal value of 128, the 4th octet is filled
with binary 0's which will give us the equivalent decimal value of 0.
So the subnet that this host 172.16.129.1 resides on is 172.16.128.0
To work out the first host in the same subnet, you need to fill the host portion
with binary 0's except for the last bit which is set to binary 1.
and that would give you 172.16.128.1
To work out the last host, you fill the host portion of the address with binary 1s
except for the last bit which is set to binary 0
so that would give you 172.16.255.254
Now just to make sure that you understand this, notice the 3rd octet is filled
with binary 1's, there is a single red binary 1 followed by 7 green binary 1's.
That however is the single octet, so there are 8 binary 1's
which gives you a value of 255.
The 4th octet is filled with 7 binary 1's, followed by binary 0
which gives you a decimal equivalent of 254.
To work out the broadcast address, fill the host portion
of the address with binary 1's, so that would give you 172.16
8 binary 1's in the 3rd octet which is 255 and 8 binary 1's on the 4th octet
which is 255 so the broadcast address is 172.16.255.255
So in summary, host 172.16.129.1 is on subnet 172.16.128.0
The first host in the subnet is 172.16.128.1, the last host
in the subnet is 172.16.255.254 and the broadcast address is 172.16.255.255
I hope those 3 examples have helped you learn the binary method to work out the
subnet, 1st host, last host and broadcast address when
presented with an IP address of a host and its subnet mask
Now that we’ve seen the binary method, let me show ou the quick method
which allows you very quickly to work out the answer to question like; what subnet
is this host on, what is the broadcast address, what is the first host
and last host in the same subnets as this specific host.
This method is reliant in you remembering tables and methods
rather than relying on binary.
So the first table to remember is the following; the values at the top of this
table like 128, 64 and so forth are the decimal equivalents for the binary values
such as 1 followed by 7 binary 0's is equal to 128, 3 binary 0's followed
by binary 1 followed by 4 binary 0's is equal to 16.
You should be quite comfortable to write out this table
from memory before attempting any subnetting question.
So remember it's 128 64 32 16 8 4 2 and 1
in the IP addressing section of this course I explained those values
in a lot of detail and explain how you get to those specific values.
So I’m not gonna cover it again here.
To work out the values in the second line of this table, just take 256 less
the top value which will give you the second value.
So 256 minus 128 gives you 128
256 minus 64 gives you 192 and so forth and so on,
as an example 256 minus 32 gives you 224, 256 minus 1 gives you 255
so you only need to remember the top values and then it’s very simple
to work out the values in the second line.
A lot of people just memorize the entire table for speed and efficiency
but once again write this table out before attempting any binary question.
So if you were given a host address of 172.16.35.123/20 or the decimal
equivalent 255.255.240.0 the first thing you need to work out is, why is the
subnet mask is not equal to 255 and secondly make a note of that octet,
in other words that the network and host portion both reside within that octet,
with the subnet mask is not equal to 255
So in this example, once again we have an address 172.16.35.123
and the subnet mask is 255.255.240.0, so in the 3rd octet
the subnet mask is not equal to 255 but is equal to a value of 240.
That means that in this octet there is a split
between the subnet and the host portions.
So the 1st 2 octets are network or subnet the last octet is host
but in the third octet there is a split between subnet and host.
Step 2 is to subtract that subnet mask value that is now 255 from 256.
So 256 less 240 would give you 16, what 16 tells us is that network are
incrementing in values of 16, so the first network would be 0
second one 16, third one 32, fourth one is 48 and so forth and so on.
The 16 lets us now the increment of the networks.
Now the table I showed you in step 1 will allow you very quickly and easily
to work this out, so in the third octet we have a value of 240,
so 256 less 240 gives you 16.
So remember in the 3rd octet the subnet mask was 240, 256 less 240 gives us 16
notice in the IP address the 3rd octet value is 35
so part of 35 is network and part of 35 is host.
So in step 3 we worked out where 35 fits
in the range of networks worked out in step 2
Now in step 2 we worked out that 256 less 240 is 16
so our networks are in multiples of 16.
So just start at 0 and go until you pass the value in the question.
So as an example, the first network would be 0 in the 3rd octet,
the 2nd network would be 16 on the 3rd octet
the 3rd one would be 32 and the 4th one would be 48.
So 35 sits somewhere between 32 and 48 and thus
we know that 172.16.35.123 is on network 172.16.32.0
The way you work that out is to leave the network portion of the address the same.
In other words, this blue portion the first 2 octets remains the same,
the subnet or host octet that lies between 32 and 48 as per our calculation
in step 3 gets rounded down to the nearest value.
so 35 is between 32 and 48, and rounding 35 down we get 32.
So the 3rd octet is equivalent to 32.
Lastly the host portion of the address is just set to 0.
So you now know that 172.16.35.123 is on network 172.16
because the blue portion or network portion remains the same
35 is rounded down to 32 because the subnet host portion lies
between 32 and 48 and the host portion is just set to 0, in other words 172.16.32.0
It's as simple as that to work out the subnet that our hosts resides on.