Now that we’ve explain the Why for subnetting, let’s look at the how.
I believe the best way to do the Subnetting is to use the binary method
with some of the extra shortcuts that I’m gonna show you in following slides.
The binary method ensures that you can subnet any scenario
thrown at you and extra shortcuts make it quicker and easier to do the subnetting.
It’s important to understand that subnetting involves stealing or
taking bits away from the host portion of address and then allocating those
stolen bits if you like to the network portion of a new address
so we are taking bits away from the host portion and allocating those bits to the
network portion to allow us to create multiple or new subnet out of a single subnet.
There are 2 important rules that you need to remember
when asked for the number of hosts use the formula, host equals 2 to the n - 2
I’ve already demonstrated that formula in the previous slide
but it’s important to remember that when looking for hosts use this formula
2 to the n - 2, and note please that you count the host bits from right to left
so we'll gonna be stealing bits from the host portion allocating those bits
to the network portion but to work out the number of hosts that can be supported on
the subnet you count the number of bits from the right hand side to
the left hand side, When asked to work out the subnets for a specific
number of networks or subnets, use the formula 2 to the n and you count the network
bits from the left hand side to the right hand side.
A lot of people get really confused by this.
Please remember the formula for host is 2 to the n - 2
The reason why we deduct 2 is that an address needs to be allocated for the subnet
and another address has to be allocated for the broadcast address.
So you lost 2 addresses or remaining addresses can be used
as addresses applied to hosts.
When working out the number of networks, you do not subtract 2
you are working out networks or subnets rather than host addresses
so you do not deduct 2 from the formula.
Also remember when as for host you count from the right to the left
when ask for network you count from the left to the right.
If you don’t follow this procedure you’re answers will be wrong.
Now this is another shortcut table that I would write down
before starting my exam to save on time.
In the real world we obviously have calculators to help us but in the exam
there are no calculators so you’ve got a work it out in your head.
In tables like this will save you a lot of time and effort
2 to the power of 1 equals 2, 2 to the power of 2 equals 4
2 to the power of 3 equals 8, 2 to the power of 4 equals 16
2 to the power of 5 equals 32 and so forth and so on
until we get to 2 to the power of 10 which equals 1024.
Now you might not able to work this out quite comfortably but for a sanity check
I would suggest that you write it down before starting your exam.
Ok here's an example, let say ABC limited has been allocated
the subnet of 10.1.1.0/24 for a small office in London
Paul the networkadministrator needs to split this subnet into smaller subnets
where ach subnets support 14 host or machines.
He asked you to help him because he is not quite sure how to do subnetting.
So that will be an example of a scenario that we need to solve.
The first thing you need to decide is which formula you will gonna use.
2 the power of n or 2 to the power of n - 2, now because the question is asking
for the number of hosts or machines in this example.
we use the formula 2 to the n - 2 and we also remember
to count from the right hand side to the left hand side.
So in step 2 we need to work out how many bits are required to cover
the number of host in this example or networks in other example.
So we have been ask to support 14 host or 14 machines as seen here in the question.
To work out the number of bits that are required you can refer back to this
table so 2 to the power of 4 equals 16.
Now remember, we are using the formula 2 to the n - 2 because we have been asked
for hosts, so 2 to the power of 4 - 2 equals 16 - 2 which gives us a result of 14
So 4 binary bits will allow us to support 14 hosts per subnet.
So we now know that we need to steal 4 bits
from the host portion of the address and allocate that for the
network portion to create multiple subnets each which support 14 hosts.
So in step 3 what you need to do is convert the host portion
of the original network into binary.
We were given network 10.1.1.0/24 or it could be written as 10.1.1.0
with the mask of 255.255.255.0, now the first 3 octets is network and the last
octet is host base on that subnet mask, please refer to the IP addressing section
of this course if your not sure how to determine
which part of the address is network and which part is host.
So we are only gonna convert the host portion of the address into binary.
For speed and efficiency purposes there is no need to convert
the network portion of the address into binary
so our address will look as follows: 10.1.1.8 binary 0's
So the host portion is 8 bits and we only need 4 bits
in the host portion to support 14 hosts.
So counting from the right hand side we count 4 binary bits which takes us
to this point and we can draw a line down to differentiate between
the subnet portion and the host portion, please note a line
can also be drawn to the right of the network portion, this was
the original subnet that we were given so we cannot manipulate this portion.
We can only manipulate the host portion and allocate part of the host portion
to the subnet and part of the host portion to the new host portion.
So we are only giving 4 bits to the host portion and the remaining 4 bits
have been stolen and allocated to the subnet portion.
Think "S" in subnet equals "S" in stolen
so 4 bit’s have been allocated to the subnet portion.
The next step is to work out the new subnet mask.
To work out the subnet mask you count the number of bits
that are network or subnet ignoring the host bits.
So from the left hand side we gonna count the number of bits in the network portion
of the address and the number of bits in the subnet portion of the address.
Please note, these spaces are only there for clarity
and not normally there as part of an address.
Now remember an octet is 8 bits.
So the first octet 10 is 8 bits, the second octet which is 1 is 8 bits in length
the 3rd octet which is also 1 is also 8 bits in length
and the number of bits that we've allocated to subnet is 4.
So we have 8 in the first octet, plus 8 in the second octet
plus 8 in the third octet, plus the 4 bits allocated to subnet in the fourth octet
which gives you a total of 28 bits. So the subnet mask is 28 bits in length.
Now you could also do this backwards, the number of bits allocated
to the host portion is 4 bits, copy address and so an IPv4 address is 32 bits
in length less 4 bits gives you 28 bits for the network portion or subnet portion.
So the last step now is to work out the various subnets.
Please remember that the network portion is 10.1.1
the subnet portion is 4 bits in length and the host portion is 4 bits in length.
And we’ve drawn a line after the network portion and the line after the host portion.
The subnet mask is 28 bits in length which we've worked out from the previous step.
So the first network is equal to 10.1.1 and we fill the subnet portion with 0's
and the host portion is always filled with 0's.
So the first network is 10.1.1.0/28 or if you convert that back to dotted decimal
notation 10.1.1.0 with the mask of 255.255.255.240 now to work out
that various subnets you go through the various binary combination
for the subnet portion of the address, so as you've seen in the first network
we set the subnet portion to all 0's.
To get the second network we set the subnet portion to all 0's
except for the last bit which we set to 1.
So the second network or subnet is 10.1.1. and if you convert this octet
back in to decimal notation it's 16, so 10.1.1.16/28, just to remind you
this is a single octet even though there are lines drawn here
the green and the red portion are part of the same octet.
so we’ve got 3 binary 0's followed by binary 1 followed by 4 binary 0's.
And if you convert that binary value into decimal value it's 16.
So the 2nd network is 10.1.1.16/28
or it can be written as follows in dotted decimal notation. 9:23 -9:27
So the next combination would be 0010 which equates to 32.
Now I won't bother doing more than said the first two or three,
because you will notice the sequence here, it goes from 0 to 16 to 32
so we are going in multiple of 16, so the next one would be 48
and you’d be able to continue all the way to the last subnet.
So I will do the first 3 or 4 and then the last 1.
For the last 1 you’ll fill the subnet portion with binary 1s
so that equals to 10.1.1.240/28 or 10.1.1.240 255.255.255.240
and that’s how you work out all the subnets from the original question.
So how many host are supported in the subnet?
We'll use the formula 2 to the n - 2, and there are 4 binary bits.
So 2 to the power of 4 equals 16 minus 2 equals 14 and we’ve already seen that.
So 14 hosts are supported on every subnet.
How many subnets have we created?
We originally had 1 subnet but we’ve now broken it up into multiple subnets
the number of bits in the subnet portion is 4 and the formula to work out
the number of networks or subnet is 2 to the power of n
so 2 to the power of 4 equals 16.
We have taken 1 subnet supporting 254 hosts
and change that into 16 subnets each supporting 14 hosts.