We need to start with the fundamentals of IP addressing. An IP address is made up of 32 bits, split into 4 octets (oct = 8, yes?). Some bits are reserved for identifying the network and the other bits are left to identify the host.
There are 3 main classes of IP address that we are concerned with.
Class A | Range 0 - 127 in the first octet (0 and 127 are reserved) |
Class B | Range 128 - 191 in the first octet |
Class C | Range 192 - 223 in the first octet |
Below shows you how, for each class, the address is split in terms of network (N) and host (H) portions.
NNNNNNNN | . | HHHHHHHH | . | HHHHHHHH | . | HHHHHHHH | Class A Address |
NNNNNNNN | . | NNNNNNNN | . | HHHHHHHH | . | HHHHHHHH | Class B Address |
NNNNNNNN | . | NNNNNNNN | . | NNNNNNNN | . | HHHHHHHH | Class C Address |
At each dot I like to think that there is a boundary, therefore there are boundaries after bits 8, 16, 24, and 32. This is an important concept to remember.
We will now look at typical questions that you may see on subnetting. More often than not they ask what a host range is for a specific address or which subnet a certain address is located on. I shall run through examples of each, for each class of IP address.
What subnet does 192.168.12.78/29 belong to?
You may wonder where to begin. Well to start with let's find the next boundary of this address.
Our mask is a /29. The next boundary is 32. So 32 - 29 = 3. Now 23 = 8 which gives us our block size.
We have borrowed from the last octet as the 29th bit is in the last octet. We start from zero and count up in our block size. Therefore it follows that the subnets are:-
192.168.12.0
192.168.12.8
192.168.12.16
192.168.12.24
192.168.12.32
192.168.12.40
192.168.12.48
192.168.12.56
192.168.12.64
192.168.12.72
192.168.12.80
.............etc
Our address is 192.168.12.78 so it must sit on the 192.168.12.72 subnet.
What subnet does 172.16.116.4/19 sit on?
Our mask is /19 and our next boundary is 24. Therefore 24 - 19 = 5. The block size is 25 = 32.
We have borrowed into the third octet as bit 19 is in the third octet so we count up our block size in that octet. The subnets are:-
172.16.0.0
172.16.32.0
172.16.64.0
172.16.96.0
172.16.128.0
172.16.160.0
.............etc
Our address is 172.16.116.4 so it must sit on the 172.16.96.0 subnet. Easy eh?
What subnet does 10.34.67.234/12 sit on?
Our mask is 12. Our next boundary is 16. Therefore 16 - 12 = 4. 24 = 16 which gives us our block size.
We have borrowed from the second octet as bit 12 sits in the second octet so we count up the block size in that octet. The subnets are:-
10.0.0.0
10.16.0.0
10.32.0.0
10.48.0.0
.............etc
Our address is 10.34.67.234 which must sit on the 10.32.0.0 subnet.
Hopefully the penny is starting to drop and you are slapping the side of your head realising that you were a fool to think it was hard. We will now change the type of question so that we have to give a particular host range of a subnet.
What is the valid host range of of the 4th subnet of 192.168.10.0/28?
Easy as pie! The block size is 16 since 32 - 28 = 4 and 24 = 16. We need to count up in the block size in the last octet as bit 28 is in the last octet.
192.168.10.0
192.168.10.16
192.168.10.32
192.168.10.48
192.168.10.64
.................etc
Therefore the 4th subnet is 192.168.10.48 and the host range must be 192.168.10.49 to 192.168.10.62, remembering that the subnet and broadcast address cannot be used.
What is the valid host range of the 1st subnet of 172.16.0.0/17?
/17 tells us that the block size is 224-17 = 27 = 128. We are borrowing in the 3rd octet as bit 17 is in the 3rd octet. Our subnets are:-
172.16.0.0
172.16.128.0
The first subnet is 172.16.0.0 and the valid host range is 172.16.0.1 to 172.16.127.254. You must remember not to include the subnet address (172.16.0.0) and the broadcast address (172.16.127.255).
What is the valid host range of the 7th subnet of address 10.0.0.0/14?
The block size is 4, from 16 - 14 = 2 then 22 = 4. We are borrowing in the second octet so count in the block size from 0 seven times to get the seventh subnet.
The seventh subnet is 10.24.0.0. Our valid host range must be 10.24.0.1 to 10.27.255.254 again remebering not to include our subnet (10.24.0.0) and the broadcast address (10.27.255.255).
What if they give me the subnet mask in dotted decimal?
If you're lucky and they give you a mask in dotted decimal format then you should have an even easier time. All you need again is your block size.
Let's say they have given a mask of 255.255.255.248 and you wish to know the block size. Here's the technique:
1. Starting from the left of the mask find which is the first octet to NOT have 255 in it.
2. Subtract the number in that octet from 256 to get your block size (e.g. above it is 256 - 248 = block size of 8).
3. Count up from zero in your block size in the octet identified in step 1 as you have learned above (the example above would be in the last octet).
Another example is a mask of 255.255.192.0 - you would simply count up in 256 - 192 = 64 in the third octet.
One more example is 255.224.0.0 - block size is 256 - 224 = 32 in the second octet.
What other questions may they ask?
You may find they ask for how many bits you need to borrow for a certain amount of subnets, the subnet mask needed for a certain number of hosts, or the number of hosts per subnet. THESE ARE ALL EASY TO CALCULATE! All you need to remember is that you borrow bits for subnets and reserve bits for hosts.
There are two simple formulas:
Number of subnets = 2n where n is the number of bits borrowed
Number of hosts = 2(32 - n) - 2 where n is the number of bits in your subnet mask
Let's think of some questions. How many bits do you need to borrow to accommodate 6 subnets? No matter what address you are given the maths is still the same. The formula is 6 = 2n so you must find n which in this case is 3 as n = 2 gives only 4 subnets and n = 3 gives 8 subnets. Simply add n to your mask for your new subnet mask. For example, if you had a /24 address and you wanted 8 subnets then your mask will be 24 + 3 = /27.
What subnet mask should you use if you wanted 60 hosts per subnet? The formula is 60 = 2(32 - n) - 2 so you must find n which is 26. This is easy to find as you know that 26 - 2 = 62 so simply subtract 6 from 32 to get the 26. Therefore your mask is /26.
Lastly the number of hosts per subnet. How many hosts per subnet in the address 172.16.0.0/23? You have a /23 address therefore you formula is x = 2(32 - 23) - 2 = 29 - 2 = 510.
Another typical question they may ask will be giving you an IP address and mask and asking how many subnets and hosts there are from that address, for example:
Question: How many subnets and hosts per subnet can you get from the network 172.30.0.0/28?
From this you only need two pieces of information:
1. The default subnet mask of the address class.
2. The subnet mask in the question
Using the example above we know that:
1. The default subnet mask is /16 as the address given is a class B address
2. The subnet mask in the question is /28
The number of subnets = 2 ^ (subnet_mask_in_question - default_subnet_mask)
The number of hosts = (2 ^ (32 - subnet_mask_in_question)) - 2
For our example question the number of subnets = 2 ^ (28 - 16) = 2 ^ 12 = 4096 subnets.
The number of hosts = (2 ^ (32 - 28)) - 2 = (2 ^ 4) - 2 = 14 hosts per subnet
Let's use another address: 192.168.1.0/29
We know that:
1. The default subnet mask is /24 as the address given is a class C address
2. The subnet mask in the question is /29
The number of subnets = 2 ^ (29 - 24) = 2 ^ 5 = 32 subnets.
The number of hosts = (2 ^ (32 - 29)) - 2 = (2 ^ 3) - 2 = 6 hosts per subnet
Finally, let's use another address: 10.1.1.0/24
We know that:
1. The default subnet mask is /8 as the address given is a class A address
2. The subnet mask in the question is /24
The number of subnets = 2 ^ (24 - 8) = 2 ^ 16 = 65536 subnets.
The number of hosts = (2 ^ (32 - 24)) - 2 = (2 ^ 8) - 2 = 254 hosts per subnet
Easy isn't it?
What now?
Now it's time to go and pick up those books again and go straight to the practice questions, completely by-passing any of their techniques. Use my method and you will be laughing!
If you are unsure that you have the correct answers why not download a subnet calculator to double-check your answers? There is a great one by 3Com and can be downloaded from here.
Happy subnetting!
Reposted from Wildcard Mask post:
ReplyDeleteGino Angelo wrote:
hello, i have just one question. why is it that on example What is the valid host range of the 7th subnet of address 10.0.0.0/14?
The Answer was : Our valid host range must be 10.24.0.1 to 10.27.255.254 again remebering not to include our subnet (10.24.0.0) and the broadcast address (10.27.255.255).
Ca you show to us the complete solution? is it correct that it should have? :
10.0.0.0
10.4.0.0
10.8.0.0
10.16.0.0
10.32.0.0
10.64.0.0
10.128.0.0
and the seventh subnet would be 10.128.0.0 not 10.24.0.0?
help pls. thanks!
Chris' Reply:
Hi Gino,
As it is a /14 address and the next boundary is a /16 our block size is 2^(16-14) = 2^2 = 4 (where ^ is "to the power of"). We are borrowing in the second octet so all we have to do is count up in 4's within that octet like so:
10.0.0.0
10.4.0.0
10.8.0.0
10.12.0.0
10.16.0.0
10.20.0.0
10.24.0.0
10.28.0.0
etc......
Our seventh subnet is 10.24.0.0 which has a broadcast address of 10.27.255.255 therefore our valid host range is 10.24.0.1 through to 10.27.255.254
Hi there
ReplyDeleteNice stuff on subnetting BUT i am not sure about block size formula used.
why are we using 2 power n or 256- non 255 octact value in subnet mask to workout bloack size?
Regards
Hi Chris,
ReplyDeleteThanks for the great article, it sure has made block sizes easier. Now can you help with using block sizes in a VLSM situation?
Thanks - TLAB
HIIIIII
ReplyDeleteThis was a nice article
I just wanted help in a problem
Needed usable subnets: 250
Network address: 101.0.0.0
I need to figure out the Custom Subnet Mask for this question...
Please help
Thanks
Hi all
ReplyDeleteFirst of all good work Chris , keep it coming.
Now the reason i am posting this comment or rather question is because i have a question which nobody has an answer for.I am preparing for CCNA and somebody asked me this question.Any help will be appreciated.
Question: What is the Binary ID of loopback's Network?
Answer: a)0
b)1
c)10101010
d)11111111
Now here is what i interpret from this question.I have to find the binary representation of network for the address 127.0.0.1 .
I am not sure if this question is correct but i am not sure what to do with this.
Thanks in advance
Hi Javi,
ReplyDeleteFirst of all thanks for your question.
This is how I see it being answered.
The loopback address is 127.0.0.1 which is a Class A address. The network portion of a Class A address is the first octet, in this case 127. The binary representation of 127 is 01111111. You may find text omitting the leading 0 so you may just have seven 1's.
Check out http://www.thecertificationhub.com/networkplus/networkplus_test_bank.htm as your question is also answered there.
HTH
Hey Chris thanks for the reply.I was not getting the question it seems so there is an issue with the answers.
ReplyDeleteOnce again keep up the good work.
Thanks so much for this article! I'm not yet studying for my CCNA but rather my XP (70-270) and was having a heck of a time trying to understand subnets. Thanks for taking the time and trying to teach others what you've learned!!
ReplyDeleteKristin
Hello Chris,
ReplyDeleteI am getting different answers on this question. The number of valid subnets for 200.1.1.0/26
If I use the next boundary 32 in the /26 question I get 64 but the answer is 4 because of the Class C address of /24. I am confused, please help?
Thanks,
BT
BUDDY said "Hello Chris,
ReplyDeleteI am getting different answers on this question. The number of valid subnets for 200.1.1.0/26
If I use the next boundary 32 in the /26 question I get 64 but the answer is 4 because of the Class C address of /24. I am confused, please help?"
64 is number of IP adress per subnet.
so 256/64 = 4 that's number of subnets
1st subnet 200.1.1.0
2nd 200.1.1.64
3rd 200.1.1.128
4th 200.1.1.192
Hi Buddy,
ReplyDeleteI would say that as it is a Class C network your default mask is /24. You have a /26 so you therefore have 2 ^ (26 - 24) subnets = 4. Your block size is 2 ^ (32 - 26) = 2 ^ 6 = 64. Your subnets are therefore at 0, 64, 128, and 192 in the last octet as you have correctly put.
HTH
Hi,
ReplyDeletejust wanna say that your article was great i was struggling with subnetting until I read this, very straight forward and easy to understand.
Cheers chris,
Regards,
Mohammed
Hi Chris,
ReplyDeleteI had such a confusion on subnetting that i couldnt follow, even after reading tons of books. Your method of subnetting is the best and have learnt in just a day. Thanks a lot.Keep up the good work.
Regards
Rakesh
Hi Chris,
ReplyDeleteFristly, I would like to thanks for your great article.
After going through .. some questions came into my mind..
if question is like below :
What subnet does
192.168.12.78/8
192.168.12.78/16
192.168.12.78/24
192.168.12.78/32
belong to?
now according to your method what would be boundaries ? and valid host range ?
I kindly request you to explain this with the example.
Awaiting your kind reply.
raj
Hi Raj,
ReplyDeleteYour examples aren't really subnets as your subnet masks fall on default class boundaries.
192.168.12.78/8 - a /8 is a Class A boundary so you would expect an address between 1.x.x.x and 126.x.x.x, for example, 10.1.1.1/8 is network 10.0.0.0 with valid host range of 10.0.0.1 through to 10.255.255.254 There are no subnets!
192.168.12.78/16 - a /16 is a Class B boundary so you would expect an address between 128.x.x.x and 191.x.x.x, for example 172.16.1.1/16 is network 172.16.0.0 with valid hostrange of 172.16.0.1 through to 172.16.255.254. There are no subnets!
192.168.12.78/24 - a /24 is a Class C boundary so you would expect an address between 192.x.x.x and 223.x.x.x. In your example the network is 192.168.12.0 with a valid host range of 192.168.12.1 through to 192.168.12.254. There are no subnets!
192.168.12.78/32 - a /32 is a special case where the subnet and host is the same, that is, in your example, 192.168.12.78 is both the subnet and the valid host range.
HTH,
Chris
i just want to say GOD bless you so very much
ReplyDeleteThx man!
ReplyDeleteExactly what I needed for my studies.
Very nice work :)
Hi Chris,
ReplyDelete1. Starting from the left of the mask find which is the first octet to NOT have 255 in it.
2. Subtract the number in that octet from 256 to get your block size (e.g. above it is 256 - 248 = block size of 8).
What if the mask is 255.255.255.0. 256-0 is 256. 256 is my block size?
Thanks for all the help with this subnetting stuff. I've learned more from reading this short article than in weeks of classroom explanation.
Hi Zeller,
ReplyDeleteWhen you sit on the boundary as with your example your block size is the full allocation of the next octet (i.e. 256 addresses of which 254 can be host addresses).
If you take 10.0.0.0/24 your subnet is 10.0.0.0 with host range from 10.0.0.1 to 10.0.0.254.
So yes, your block size is 256, in other words the entire octet.
HTH,
Chris
hi chris,
ReplyDeleteyour blog and the above article on subnetting are very useful for me. i never felt subnetting that easy until i read ur article.im expecting more articles like this from you.if possible please do post articles on subnet zero and vlsm. last but not least Thank you so much for all the articles in your blog.....
Chris
ReplyDeleteThanks a lot for this article. I've just started learning Subnetting for my CompTIA Network+ and this is a great read!
Tim
Dear Chris,
ReplyDeleteCan you help me to solve this question:
After dividing the network 172.25.0.0 into eight equal subnets, which three ip addresess could be destined in the third subnet if the command ip subnet-zero is used in the router. (Choose three)
a:172.25.78.243
b:172.25.98.16
c:172.25.72.0
d:172.25.94.255
Thank you.
Rgds,
Liza
Hi Liza,
ReplyDelete172.25.0.0 is divided into 8 subnets.
How many bits would we need to borrow to get 8 subnets? The answer is 3 as 2 ^ 3 = 8.
The default maks for the above address is /16 so we add the 3 bits we are borrowing to /16 to give us a /19 mask.
We know how to work out block sizes so in this example our next boundary is at 24. Our new mask is /19 so we subtract that from 24 to give us 5. Our block size is therefore 2 ^ 5 = 32.
We count up in the block size in the 3rd octet as the 19th bit is in the 3rd octet.
172.25.0.0/19 = 1st subnet
172.25.32.0/19 = 2nd subnet
172.25.64.0/19 = 3rd subnet
172.25.96.0/19 = 4th subnet
....etc
The host range of the 3rd subnet is 172.25.64.1 to 172.25.95.254
The possible answers given are:
a:172.25.78.243
b:172.25.98.16
c:172.25.72.0
d:172.25.94.255
I would therefore say that answers a, c, and d are correct.
Hope this helps and good luck with your studies!
Firstly - Your blog made subnetting easy (like it says on the tin)!
ReplyDeleteThat said I am having a few issues with questions where it asks for how many subnets and hosts for a given network. For example:
Question: How many subnets and hosts per subnet can you get from the network 172.30.0.0/28?
Answer: 4096 subnets and 14 hosts
Now I can get the 14 hosts bit but from reading your blog I'm thinking that the /28 means that we're only looking at the 4th octet so I'm thinking that as our range is 16 there must be 16 available subnets (16 x 16 = 256) but clearly I'm wrong.
I'm sure it has to do with the network being class B but where do I go from there?
Firstly - Your blog made subnetting easy (like it says on the tin)!
ReplyDeleteThat said I am having a few issues with questions where it asks for how many subnets and hosts for a given network. For example:
Question: How many subnets and hosts per subnet can you get from the network 172.30.0.0/28?
Answer: 4096 subnets and 14 hosts
Now I can get the 14 hosts bit but from reading your blog I'm thinking that the /28 means that we're only looking at the 4th octet so I'm thinking that as our range is 16 there must be 16 available subnets (16 x 16 = 256) but clearly I'm wrong.
I'm sure it has to do with the network being class B but where do I go from there?
Hi,
These sorts of questions are very simple. If I haven't covered these sorts of questions perhaps I should add that in here somehwere.
172.30.0.0/28
What can we tell from that address? The two very basic things we know is that it is a Class B address and that it has a /28 mask.
To calculate the number of subnets you use the following formula:
2 ^ (number_of_bits_in_mask - number_of_bits_in_default_mask)
So for this question the forumla is 2 ^ (28 - 16) = 2 ^ 12 = 4094 subnets.
To calculate the number of hosts you use the following formula:
(2 ^ (32 - number_of_bits_in_mask)) - 2
So for this question the number of hosts per subnet is:
(2 ^ (32 - 28)) - 2 = (2 ^ 4) - 2 = 14.
Hope this helps and good luck with your studies!
Great info... Cannot be easier to understand!! it's helped me a lot!! Greetings from Dominican Republic.
ReplyDeleteWhat is the valid host range of the 1st subnet of 172.16.0.0/17?
ReplyDelete/17 tells us that the block size is 224-17 = 27 = 128. We are borrowing in the 3rd octet as bit 17 is in the 3rd octet. Our subnets are:-
172.16.0.0
172.16.128.0
The first subnet is 172.16.0.0 and the valid host range is 172.16.0.1 to 172.16.127.254. You must remember not to include the subnet address (172.16.0.0) and the broadcast address (172.16.127.255).
In the above example, I am confused as to why the range is not 172.16.127.256 and why is it 172.16.127.254?
Thank you.
Chris, never mind my previous comment. I understand the concept but am not as smart as other people.
ReplyDeleteCan someone help me in solving this and explain it to me also?
ReplyDeleteHow many subnets and hosts per subnet can you get from 172.29.0.0 255.255.252.0?
I know I have to convert 255.255.252.0 into block size and I get 4 for that. Now what? Please explain Chris.
Thank you.
OMG !! I was banging my head with this subnetting !! Thanks a lot for the simple explanation !!
ReplyDeleteHi Chris,
ReplyDeleteI am really glad full to you that you wrote this article to make our lives easier :)
I am stuck with a special kind of question that you have not covered in your article..
The Question - You need 500 subnets, each with about 100 usable host addresses per subnet. What mask will you assign using a class B network address?
Please help me with this question as soon possible... Please
This is quite a simple question. Just ask yourself how many bits you would need to borrow in order to create 500 subnets. The answer is 9 as 2 ^ 9 = 512 which covers your requirements.
ReplyDeleteThe question them tells you to use a Class B address. You know that the default mask is /16 so you simply need to add 9 to that to get a mask of /25 or in dotted decimal format 255.255.255.128
Note that this leaves 7 bits available for hosts giving (2 ^ 7) - 2 hosts per subnet, in other words, 126.
Hope this helps.
Chris
Hi Chris,
ReplyDeleteThanks a ton for your time publishing this to us free.God bless you my friend. I got following problem, please help me.
---------------------------------
Question: Which subnet does host 172.31.56.247 255.255.255.240 belong to? Answer: 172.31.56.240
------------------------------
172.31.56.247
255.255.255.240
Block = 256 - 240 = 16
So
172.31.0.0
172.31.16.0
172.31.32.0
172.31.48.0
172.31.64.0
I was thinking 172.31.48.0 is the answer
Hi,
ReplyDeleteYou have to remember that you are subnetting in the fourth octet hence you should be counting up in your block size in the fourth octet.
172.31.56.0
172.31.56.16
172.31.56.32
............
172.31.56.224
172.31.56.240
Therefore 172.31.56.247 is on the 172.31.56.240 subnet
Hope this helps and good luck with your studies!
Hi Chris,
ReplyDeleteThanks again for your quick update regarding my question and your answer was really awesome. I spend too much money on Cisco Academy, but could not figure it out, how do subletting. All the i was so confused. I know i was also stupid didn't try that hard, some people even from cisco academy in my place did well, few of them was like me got lost on the way. I do believe many people stack on it, BUT ALL YOUR EFFORT, ONLY YOURS THAT MADE MY SELF CONFIDENT, whatever my position its only after reading your blog, thanks google, thank Chris.
--------------------------------
What is the broadcast address of the network 172.28.229.0 255.255.255.0?
Answer: 172.28.229.255
--------------------
I am not sure where to start here, how to find out the block size, sorry to disturb you again, hope you don't mind
Hi and I'm glad my post has helped you out :-)
ReplyDeleteYour question involves subnetting directly on a boundary. In your case you have a Class B address subnetted to the default mask of a Class C address (i.e. /24). In this case the Class B address behaves just as it would a Class C address with a default mask.
For example, let's take a Class C address with default mask:
192.168.1.0/24
You automatically know that the broadcast address is 192.168.1.255 as you have the whole of the final octet.
Take a Class B address of:
172.28.229.0/24
There is no difference except for the numbers of course. You still have the whole of the last octet to play with so the broadcast address must be 172.28.229.255
I hope you understand this. If not I'm more than happy to assist you further.
Good luck with your studies!
Chris
Thanks for your article. I have read the subnetting using cidr from tutorial computer
ReplyDeletecan you explain this article thanks
Hi Chris,
ReplyDeleteFirst off, thank you so much for this. It is a huge help in studying for my CCNA, as subnetting has been my biggest issue. I'm still a little weird on the types of questions like the following:
You have a network ID of 140.140.0.0 and need to break it down into a number of subnets. You need 600 host IDs per subnet, with the largest number of subnets available. Which of the following subnet masks should you use?
a)255.255.240.0
b)255.255.252.0
c)255.255.224.0
d)255.255.248.0
How best do I answer this? Instead of figuring out the numbers for each of the listed subnet masks?
Thank you,
Devin
Hi,
ReplyDelete600 hosts requires 10 bits as (2 ^ 10) - 2 = 1022 hosts.
If we subtract the 10 bits from the 32 bits that make up an IP address we have 22 bits. If we convert /22 into longhand we have 255.255.252.0 which is your answer.
HTH,
Chris
how many subnet and host for this network pls give your answer with calculation means show me the calculation you did to get answer.the network is 154.20.14.10/7
ReplyDeleteRegarding question: What is the valid host range of the 7th subnet of address 10.0.0.0/14?
ReplyDeleteI was wondering how the answer for the broadcast address is 10.27.255.255 and not 10.24.255.255
Please help me figure this out.
I am very impressed with this subnetting lesson. Thank you
Hi John,
ReplyDeleteThe block size in this question is 4 as your next boundary is 16 while your subnet mask is /14. If we subtract 14 from 16 we get 2. We then say 2 to the power of the 2 we just worked out which gives us 4.
As our mask is /14 we then can say that the 14th bit is in the second octet. We therefore count up in our block size in the 2nd octet.
Our first subnet is therefore:
10.0.0.0/14
And the 2nd subnet is:
10.4.0.0/14
3rd is:
10.8.0.0/14
etc
Until we come to the 7th octet which is 10.24.0.0/14
Our 8th octet is 10.28.0.0/14 so the broadcast address for the 7th subnet is one less than the 8th subnet so this must be 10.27.255.255
Hope this helps and good luck with your studies!
Hi chris ,Junaid here,
ReplyDeleteIve couple of questions which i couldn't understand ,am pasting the related paragraphs:
Let's think of some questions. How many bits do you need to borrow to accommodate 6 subnets? No matter what address you are given the maths is still the same. The formula is 6 = 2n so you must find n which in this case is 3 as n = 2 gives only 4 subnets and n = 3 gives 8 subnets. Simply add n to your mask for your new subnet mask. For example, if you had a /24 address and you wanted 8 subnets then your mask will be 24 + 3 = /27.
What subnet mask should you use if you wanted 60 hosts per subnet? The formula is 60 = 2(32 - n) - 2 so you must find n which is 26. This is easy to find as you know that 26 - 2 = 62 so simply subtract 6 from 32 to get the 26. Therefore your mask is /26.
1: in the 1st paragraph how can we calculate the value of n , please elaborate it for me.
2: In the 2nd paragraph how did you got the value of n =26??
please help me get over with it and the rest of things u described here are outstanding,
Thanx
Hi,
ReplyDeleteRemember that this is 2 to the power of n (2 ^ n) and not 2n as you seem to write it. Maybe that is where you are getting stuck?
great post, penny = dropped. i have been dreading subnetting as i am terrible at maths but this is perfect. Thanks.
ReplyDeleteHi Chris
ReplyDeletewow , you are fantastic , i never knew subnetting was so easy
Saurabh srivastava
ReplyDeleteALL FOR CLASS A
yes you tried very well but No way
because we know
For class a range (0-127.255.255.255)
but valid range (1-126.255.255.255)
it means (N.H.H.H) N=Network bits
H=Host bits
Ip address=(8.8.8.8)=8+8+8+8=32
so hence 8bits for Network and 24 bits for Host
but question is that
10.0.0.0/14 (by default for /8)
but /14 then network takes
[8(his default own)+6 (bit borrow)]
we know binary as
128.64.32.16.8.4.2.1
if we want binary of 32 then
0 .0 .1 . 0 .0.0.0
as that of on our section for/14
11111111.11111100.00000000.00000000
11111111.11111100.00000000.00000000
I'st .II'nd .III'rd .IV'th octet
now in the second octet
11111100 here like in binary each octet the power of
128.64.32.16.8.4.2.1
1 .1 .1 .1 .1.1.0.0
--------------.*.0.0
here last one form left as star power of binary 4 it mean block of 4 will be
then
10.0.0.0(first NID)
10.4.0.0
10.8.0.0
10.12.0.0
10.16.0.0
.
.
.
.
.
.
10.252.0.0
.
.
10.255.255.254
10.255.255.255 (last finally BID)
and number of subnet and number of host per subnet
subnet=2^n
here n is totel network bit borrow
host per subnet=(2^m)-2
here mis total left bit (Host)
in that
subnet=2^6=64 subnet
host per subnet=(2^18)-2
=262144-2=262142
thanks
Saurabh srivastava
ReplyDeleteALL FOR CLASS A
yes you tried very well but No way
because we know
For class a range (0-127.255.255.255)
but valid range (1-126.255.255.255)
it means (N.H.H.H) N=Network bits
H=Host bits
Ip address=(8.8.8.8)=8+8+8+8=32
so hence 8bits for Network and 24 bits for Host
but question is that
10.0.0.0/14 (by default for /8)
but /14 then network takes
[8(his default own)+6 (bit borrow)]
we know binary as
128.64.32.16.8.4.2.1
if we want binary of 32 then
0 .0 .1 . 0 .0.0.0
as that of on our section for/14
11111111.11111100.00000000.00000000
11111111.11111100.00000000.00000000
I'st .II'nd .III'rd .IV'th octet
now in the second octet
11111100 here like in binary each octet the power of
128.64.32.16.8.4.2.1
1 .1 .1 .1 .1.1.0.0
--------------.*.0.0
here last one form left as star power of binary 4 it mean block of 4 will be
then
10.0.0.0(first NID)
10.4.0.0
10.8.0.0
10.12.0.0
10.16.0.0
.
.
.
.
.
.
10.252.0.0
.
.
10.255.255.254
10.255.255.255 (last finally BID)
and number of subnet and number of host per subnet
subnet=2^n
here n is totel network bit borrow
host per subnet=(2^m)-2
here mis total left bit (Host)
in that
subnet=2^6=64 subnet
host per subnet=(2^18)-2
=262144-2=262142
ok thanks
This is the best tutorial on Subnet i have ever read. Thank you so much Chris! You made it so easy to understand...all of the other post and even cisco books have made it overly complicated and way too confusing!
ReplyDeleteFantastic tutorial! Makes subletting actually kind of fun. Thanks :)
ReplyDelete
ReplyDeletehi buddy, the explanation was really cool and simple,thanks for that.
i have a doubt, plz solve it.
suppose you have given a class B ip address 172.12.12.1. with default sub-net mask 255.255.0.0 and asked to create 3 networks and each network should have 3 hosts, then what will be the subnet mask,what are the different sub networks, what is the host range in each network
What happens if the mask is 16? Do I leave it at 16? Thanks for the help!
ReplyDeleteHi Jill,
ReplyDeleteYes, you leave it as a /16. Same as you would on all classful boundaries (i.e. /8, /16, and /24).
HTH,
Chris
Hello Chris, the way you explained this subnetting concept made a great help to my studies.
ReplyDeletei have a doubt.
Could you tell me what will be the subnet and host from
172.29.0.0 255.255.252.0
thank you..!!
what to do if the no of subnets is greater than 32.i have a question
ReplyDeleteAn organization is granted the block 130.56.0.0 in class B. The administrator wants to create 1024 subnets.
a. Find the subnet mask.
b. Find the number of addresses in each subnet.
Hi Chris,
ReplyDeleteThis is best subnetting method I've everseen.
There is one type of question I keep having wrong answer. Would you please step by step show me with your method for below problem.
"Enter the maximum number of valid subnets and hosts per subnet that you can get from the network 172.29.0.0 255.255.254.0"
Thanks a lot!
Hanson
Hi Chris,
ReplyDeleteWould you help me solve this problem below using your method.
Enter the maximum number of valid subnets and hosts per subnet that you can get from the network 172.17.0.0 255.255.254.0
Thanks,
Hanson
Hi Hanson,
ReplyDeleteSo for both of your questions you have a subnet mask of 255.255.254.0 which is equivalent to a /23. That means your block size is 2 to the power of (24 - 23) which equals 2 subnets. The number of hosts is therefore (2 to the power of (32 - 23)) - 2 = 510 hosts.
Your two subnets are effectively 172.17.0.0/23 and 172.17.128.0/23
HTH
wow after three classes on this i had become COMPLETELY overwhelmed by all the different techniques that we were being shown for subnetting but this is by far the best way of doing things (for me at least)
ReplyDeletethanks a lot for this man you`ve really saved the day
wow after three classes on this i had become COMPLETELY overwhelmed by all the different techniques that we were being shown for subnetting but this is by far the best way of doing things (for me at least)
ReplyDeletethanks a lot for this man you`ve really saved the day
Hi Chris,
ReplyDeleteThanks for the wonderful explanation. I now understand everything you mentioned except the following part:
What subnet mask should you use if you wanted 60 hosts per subnet? The formula is 60 = 2(32 - n) - 2 so you must find n which is 26. This is easy to find as you know that 26 - 2 = 62 so simply subtract 6 from 32 to get the 26. Therefore your mask is /26.
Is there another way to explain this, especially finding the value of n, I simply just dont get it.
HP
Hi
ReplyDeleteChris, almost after 10 year in this field i gave up on learning subnetting insted started using online calculators, nothing ever made sense to me
man just reading your artical only once made me feel like every thing falls int place
thanks ever so much
regards
Ansur
Hi
ReplyDeleteChris, almost after 10 year in this field i gave up on learning subnetting insted started using online calculators, nothing ever made sense to me
man just reading your artical only once made me feel like every thing falls int place
thanks ever so much
regards
Ansur
I was looking for help on understanding subnetting when I stumbled onto your site. This is much easier to grasp than any other method I have seen. I am sure I'll have some questions as I study this but your approach to explaining it is far more direct and to the point. Thanks for your commitment to helping those of us who are trying to learn. Aaron B.
ReplyDeleteHi Chris,
ReplyDeleteI ran across this problem and was confused on how i could figure it out. If it gives me the address in CIDR notation I can do it no problem.
Here is the problem:
How many subnets and hosts per subnet can you get from the network 192.168.130.0 255.255.255.128?
Thanks!
This is by far the best way to do any subnetting questions!!
ReplyDeleteThe only part I need help with now is how to find the CIDR prefix from a subnet mask and visa versa.
E.g. 255.255.128.0 is /17 but how do I work this out? Is there a formula?
Can anyone help please???
I have been reading TCP/IP Illustrated and trying the examples on a test network. I got stuck on subnet/supernet addressing. Your examples filled in the gaps. I was back on track in 5 minutes!
ReplyDeletehow do I find the nth subnet? For example I have the class B address 150.150.0.0/26 and want to find the 500th subnet?
ReplyDeleteBrilliant explanations by the way!
hello Chris
ReplyDeleteIf a host has address 10.251.128.10,
what is correct subnetmask? I cannot find a procedure in your blog.
Tom
Hi Tom,
ReplyDeleteImpossible to say. The default mask would be /8 or 255.0.0.0.
HTH,
Chris
Joe,
ReplyDeleteCIDR represents the number of 1s in the mask, or the binary conversion from decimal.
255.255.128.0 is 11111111.11111111.10000000.00000000
By counting the number of 1s, you have 17, /17.
The other way to look at it is from a binary chart.
Recalling boundaries, for each class, /8, /16, /24, for A, B, C, respectively. Subtract the given CIDR value from the default mask and remainder is as follows.
.128 /1
.192 /2
.224 /3
.240 /4
.248 /5
.252 /6
.254 /7
.255 /8
/23 is 255.255.254.0, 23-16=7, /7 is .254
/12 is 255.240.0.0, 12-8=4, /4 is .240
Hope that helps. :)
Dear Chris,
ReplyDeleteRefer Hanson's comment on 23 September 2013 at 21:24
"Enter the maximum number of valid subnets and hosts per subnet that you can get from the network 172.29.0.0 255.255.254.0"
The subnets have to be 172.29.0.0, 2.0, 4.0 so on so forth for a total of 2^7 (7 bits borrowed)=128 subnets.
Kindly correct if wrong.
I loved your subnetting technique. Do you have any other simplified stuff out there to share.
Hi,
ReplyDeleteGreat tutorial! Having been searching for a explanation of sunbathing for days and this by far the best.
Cheers
Hello Chris,
ReplyDeleteyou were quite right in your prediction - I did laugh while doing the subnetting exercises.
Thank you, man, you are great! :)
Cheers,
Svetoslav
Hi Chris,
ReplyDeleteyour prediction was quite right - I did laugh while doing the subnetting exercises!
Thank you, man, you are great! :)
Cheers,
Svetoslav
I have a problem with the following question.
ReplyDeleteAssuming a subnet mask of 255.255.224.0, which of the following would be valid host addresses?
A. 124.78.103.0
B. 125.67.32.0
C. 125.78.160.0
D. 126.78.48.0
E. 176.55.96.0
F. 186.211.100.0
The answers are A,D and F. I dont know how to get the answers. Plz help
Hi Kate. They have given you a subnet mask which gives you a block size of 32 in the third octet. Therefore the subnet address for that mask will be the following:
ReplyDeletea.b.0.0
a.b.32.0
a.b.64.0
a.b.96.0
a.b.128.0
a.b.160.0
a.b.192.0
a.b.224.0
Boundaries and Block size in the first section swung it for me. I keep getting these questions correct now, time after time - Thank you so much
ReplyDelete