How to find the total number of subnets available for one subnet mask.
For example, take this subnet mask: 255.255.255.224 and IP address as 192.168.5.139, ICND1 boook shows that there are 6 subnet for the given subnet mask, ranging from 192.168.5.32 to 192.168.5.192 , how 6 ? what to consider in ?
The default mask for the class C address of 192.x.x.x is 255.255.255.0
The mask in the example is 255.255.255.224 (using 3 extra bits for subnetting, above and beyond the default).
2^3 is 8 combinations:
In the old days, we couldn't use the all 000 or all 111 combination for subnetting, so the formula was 2^extra bits used for custom subnetting, or 2^3 in our example, -2 (for the 2 that used to not be able to be used), which would leave 6.
Today, current IOS has the ability to use the 000 and 111 option with an option called subnet zero, and so on current IOS there would be 8 possible subnets, not just 6.
The possible subnets would be 192.168.5.0/27
the next subnet would jump by 32, to 192.168.5.32/27,
and they would continue to increase by 32 until the subnet of 192.168.5.224/27 was reached, for a total of 8 subnets.
Classless formula is 2^s (rwo to the power of s) where s is number of subnet bits used to subnet. Sometimes (in the past) you had to remove 2 from result, classful method. those remove 2 are called subnet zero and broadcast. Claslless is defualt method so your book is old or it is exemple of clasfull method.
anyway now you hhave to do conversion (in you head). Memorize this
128 = 1
192 = 2
224 = 3
240 = 4
248 = 5
252 = 6
254 = 7
255 = 8
so for class C address with 255.255.255.224 =3 bits = 2^3rd power = 8 bits available for network portion.
8-3=5 bits are left for host portion.
to figure out host portion, you always use 2 ^ h - 2 (h is #of host bits)
30 IPs for hosts
Forgot to add that default classes matter in number of subnetting bits.
255.255.255.224 and IP address as 192.168.5.139 = class C so from 24, you have left only 3 bits (for 224) BUT
255.255.255.224 and IP address as 22.214.171.124 = Class B so from 16, you have left 8 + 3 = 11 and 2048 subnets
for Class A, 8 bits are default, you have left 8+8+3 = 19 bits, 2 ^19 = big number
In subnetting do not touch default mask bits; 8 for Class A; 16 for class B; 24 for Class C.
Personally, I like three letters, they seem to make the math easier.
Your 32 bit IP address will consist of "n" bits (network, set by the class of address you are in), "s" bits set by the actual mask given to you, and "h" bits which are everything else leftover.
So you have 192.168.5.139 which is a class C address, so I have 24 "n" bits. Your mask is 255.255.255.224 (/27) which 27 - 24 means I have three "s" bits. And therefore 5 "h" bits (also telling us that 32-27 = 5, whichever way you like to think).
The key to this question is those "s" bits. 2^3 (3 "s" bits) = 8 matches.
TODAY, your answer will be 8. In ancient times (when RFC 1149 was based in reality), everyone feared the "0" subnet. So we'd take off the all-0's and all-1's subnets which would leave you 6. But ever since the Industrial Revolution (or someplace near there in New Jersey), we haven't had to worry about that as "ip subnet-zero" is a default command in pretty much any IOS that is currently supported by Cisco.
How old is the publishing date on the book you are looking at?
As for calculating your network numbers, I find it easiest to go back to my "h" bits. I had 5 of those here. 2^5 = 32. So every 32'nd number is my new network. 0, 32, 64, 96, 128, 160, 192, and 224.
Thank you for the explaination,Scott.
Yeah the book also says that we use 0s and 1s for subnetwork address and broadcast address. But in the table, for the given subnet mask,(255.255.255.224), it has listed 6 subnet ID only. It didnt include the 192.168.5.0 and 192.168.5.224, thats y I got confused, that how they have included 6 subnetworks alone. It does tell that we do use 0s for subnetwork addresses and 1s for broadcast address.
I purchased this ICND1 & ICND2 books this year, by Jully from cisco press.
My book has got, copy right - 2008 , and printing by jan 2010.
do u think, my book has got anything wrong or it is old ? bcoz Im planning to give my ICND1 exam next month.
The book with 2008 copyright is the right book - CCNA, ICND1, and ICND2 last revised August 2007, and these were also published that same month, with some weird legal thing making the copyright notice say 2008. Cisco's not revised the three exams related to CCNA since then, so the editions haven't changed. (Generally, whatever the product, watch for the exam number on the longer title - when Cisco revises the CCNA exams, they change the exam numbers.)
Also, on your original question, for more background, take a look at book pages 360-361 in particular, and 384-388. The first set of pages details the two "special" subnets (zero and broadcast), and discusses when on the exams you'd consider avoiding them or not. But when in doubt, use all. I don't see that specific example you used in either the book or the practice appendix, so I'm guessing it came from a question on the C question database. If that's the case, the question may have listed one of the telltales that mean "avoid these 2 subnets" when answering the question. EG, if might have said that RIPv1 was used.
Thank you for the information, Wendell.
I didnt pick that question from anywhere, that was my own doubt. I was thinking on my own that, how to determine the total number of subnets within one subnet mask.Currently I am learning the stuff, will start my exam preparation later.
Thank you for your suggestions too.