Skip navigation
Cisco Learning Home > Certifications > Routing & Switching (CCNA) > Discussions

_Communities

This Question is Answered 1 Correct Answer available (4 pts)
40212 Views 8 Replies Latest reply: Sep 30, 2010 3:10 PM by Sakthi RSS

Currently Being Moderated

How to find the total number of subnets available for one subnet mask.

Sep 28, 2010 5:45 PM

Sakthi 8 posts since
Feb 1, 2010

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 ?

  • Keith Barker - CCIE RS/Security, CISSP 5,351 posts since
    Jul 3, 2009

     

    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:

     

    000

    001

    010

    011

    100

    101

    110

    111

     

    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.

     

    Best wishes,

     

    Keith

  • Martin 13,075 posts since
    Jan 16, 2009

    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

  • Martin 13,075 posts since
    Jan 16, 2009

    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 172.168.5.139 = 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.

  • Scott Morris - CCDE/4xCCIE/2xJNCIE 8,396 posts since
    Oct 7, 2008

    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.

     

    HTH,

     

    Scott

  • Wendell Odom 342 posts since
    Jun 19, 2008

    Sakthi,

    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.

     

    Wendell

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)