Usable Subnets Explanation

cardinalphincardinalphin Registered Users Posts: 2 ■□□□□□□□□□
Good morning,

I'm having a hard time understanding the answer to the following question:
You have an IP of 156.233.42.56 with a subnet mask of 7 bits. How many hosts and subnets are possible assuming that subnet 0 is not used?

126 subnets and 510 hosts

128 subnets and 512 hosts

510 subnets and 126 hosts
I know the correct answer is 126 subnets and 510 hosts. I believe I understand the 510 hosts. I don't fully understand the 126 subnets. Why do we subtract 2 when we're not enabling subnet zero instead of just 1? I feel like everything I've learned previously indicates we calculate subnets as 2^^n where n indicates the number of bits borrowed for the subnet. I get what the answer is, just don't understand the why.

Thanks in advance!

Comments

  • gespensterngespenstern Member Posts: 1,243 ■■■■■■■■□□
    510 hosts is the right answer, that's for sure. There are 512 IPs for 32 (overall IPv4 bits) - 16 (Class B by definition) - 7 = 9 bits for hosts, which is 2^9=512 IPs, out of which the first one is the network ID address and the last one is the broadcast address, therefore 512-2=510.

    Regarding subnets... It should be 2^7 which is 128, subtract the subnet 0 then we get 127.

    The only explanation I have is they meant both "subnet zero" and "subnet all-ones", but forgot to mention the second in the question. Subnet zero is not all-ones subnet, but at some point the internet treated them the same -- it was not allowed/discouraged to use BOTH.

    Overall, just a little rant, Cisco is so tiring with their hanging on this stupidity which is classful addressing and routing that is not in use for >20 years. Who cares? We are about to forget IPv4 altogether but rest assured long after IPv6 gets implemented in >99% networks Cisco will be teaching a full-on classful IPv4 addressing. My ass...
  • cardinalphincardinalphin Registered Users Posts: 2 ■□□□□□□□□□
    Thanks for the clarification. That is exactly the information I was hoping to get. I'm just getting started in my CCNA prepwork and I don't recall coming across the subnet all 1's yet.

    If anyone strolls across this thread later, Cisco has a page explaining this:
    https://www.cisco.com/c/en/us/support/docs/ip/dynamic-address-allocation-resolution/13711-40.html

    Thanks again for your help!
  • gespensterngespenstern Member Posts: 1,243 ■■■■■■■■□□
    Good luck with your CCNA! As usual, I recommend to use the ICND1 + ICND2 route to the goal because of too much info. Wendell Odom, for example, has 2 insanely thick books of ~600 pages each and it's really hard, considering how much one has to memorize, to retain everything from them by the exam time.
  • SeadgsSeadgs Registered Users Posts: 2 ■□□□□□□□□□
    Thanks for the clarification. That is exactly the information I was hoping to get. I'm just getting started in my CCNA prepwork and I don't recall coming across the subnet all 1's yet.

    If anyone strolls across this thread later, Cisco has a page explaining this:
    https://www.cisco.com/c/en/us/support/docs/ip/dynamic-address-allocation-resolution/13711-40.html

    Thanks again for your help!

    Here's a tip to get faster as well...

    simply write out the binary conversion table for the last octet when figuring out your subnet mask etc... : 128 64 32 16 8 4 2 1

    Cover up the 1 and boom there is your 2^(bits) table. Continue on as needed.
  • AvgITGeekAvgITGeek Member Posts: 342 ■■■■□□□□□□
    I always remember:
    128 192 224 240 248 252 254 255 as subnets
    128 64 32 16 8 4 2 1 as block size
    You will need to adjust for number of hosts and subnets based on the class of network unless VLSM is in play.
    I highly recommend you see what is happening in binary. Sometimes that is the quickest way for me to find the network address based on a host address and subnet mask.
  • williebwillieb Member Posts: 108 ■■■□□□□□□□
    Great replies...


    Here's my logical thinking when getting a question like this on an exam. I've written it out for explanation but a lot of it can be done in your head after plenty of practice, or by writing down only the 2^n line:


    This is a class B so the default subnet mask is /16 or 255.255.0.0 or 11111111.11111111.00000000.00000000


    It's stating you have an additional 7 bits used for the network. This leaves 9 bits for hosts.


    So this is /23 or 255.255.252.0 or 11111111.11111111.11111110.00000000


    Looking at the 3rd and 4th octet of the SM in binary, which is where the subnetting is taking place:





    Total Host bits = 9 = 2^9 = 512-2 not usable = 510 usable Hosts
    Total Net bits = 7 = 2^7 = 128-1 subnet 0 = 127 Nets


    Thinking logically to eliminate wrong answers, the last answer is obviously incorrect based on our answer above.


    The question doesn't mention to remove the 2 non usable hosts, so hosts could be 512 or 510


    The 2 choices for total subnets are 126 and 128. It said to assume subnet 0 is not used. For 128 it is used so that eliminates that answer.


    This leaves one answer which is the one I would choose.


    126 subnets and 510 hosts
    [X] CCENT ICND1 100-105
    [X] CCNA ICND2 200-105
    [X] CCNP ROUTE 300-101
    [X] CCNP SWITCH 300-115
    [X] CCNP TSHOOT 300-135
    [ ] CCDP ARCH 300-320
Sign In or Register to comment.