Subnetting Question Help

Blang008Blang008 Member Posts: 61 ■■□□□□□□□□
I've followed the "Subnetting Made Easy" thread and THANK YOU! This has made it so much easier for me to understand. I do have a question though. Is their an easier/faster way to find the answer to questions like the one below other than just counting up in the block size?


Question: How many subnets and hosts per subnet can you get from the network 172.29.0.0/21?


Answer: 32 subnets and 2046 hosts

Comments

  • AlceoAlceo Member Posts: 80 ■■□□□□□□□□
    For the hosts we have 32-21 = 11 bits -> 2^11 = 2048 (-2 = 2046).
    Fot the subnets we have 21-16= 5 bits -> 2^5 = 32
  • Blang008Blang008 Member Posts: 61 ■■□□□□□□□□
    Alceo wrote: »
    For the hosts we have 32-21 = 11 bits -> 2^11 = 2048 (-2 = 2046).
    Fot the subnets we have 21-16= 5 bits -> 2^5 = 32


    Thanks. Can you explain so I can better understand the concept?
  • rjon17469rjon17469 Member Posts: 52 ■■■□□□□□□□
    172.29.0.0 falls into the class B category of addresses, meaning it has a /16 mask. The given subnet is a /21, meaning there are 21-16=5 bits allowed for subneting. 2^5=32 available subnets.

    Then there are 11 bits remaining of the 32-bit IPv4 address, which are available for hosts. 2^11=2048 possible addresses. 2 need to be removed, one for the network definition (the first address) and another for the broadcast address (the last address), giving 2046 possible host addresses.
  • GDainesGDaines Member Posts: 273 ■■■□□□□□□□
    rjon17469 wrote: »
    172.29.0.0 falls into the class B category of addresses, meaning it has a /16 mask. The given subnet is a /21, meaning there are 21-16=5 bits allowed for subneting. 2^5=32 available subnets.

    Then there are 11 bits remaining of the 32-bit IPv4 address, which are available for hosts. 2^11=2048 possible addresses. 2 need to be removed, one for the network definition (the first address) and another for the broadcast address (the last address), giving 2046 possible host addresses.

    I need to practice on a few questions to see if this is really as quick and easy as Alceo and yourself just made it seem, but let's see if I've got the idea:.

    So had it been a 10.x.x.x class A address (/8 mask) with the same given subnet of /21 it would have calculated as follows?

    21-8=13 bits for subnetting, or 2^13=8192 subnets
    32-21=11 host bits so 2^11=2048 -2 (network/broadcast) = 2046 available host addresses

    And this time a 192.x.x.x class C address (/24) with a given subnet of /26 would be calculated as follows?

    26-24=2 bits for subnetting, or 2^2=4 subnets
    32-26=6 host bits so 2^6=64 -2 (network/broadcast) = 62 available host addresses
  • rjon17469rjon17469 Member Posts: 52 ■■■□□□□□□□
    GDaines wrote: »
    So had it been a 10.x.x.x class A address (/8 mask) with the same given subnet of /21 it would have calculated as follows?

    21-8=13 bits for subnetting, or 2^13=8192 subnets
    32-21=11 host bits so 2^11=2048 -2 (network/broadcast) = 2046 available host addresses

    And this time a 192.x.x.x class C address (/24) with a given subnet of /26 would be calculated as follows?

    26-24=2 bits for subnetting, or 2^2=4 subnets
    32-26=6 host bits so 2^6=64 -2 (network/broadcast) = 62 available host addresses

    Exactly!
  • Blang008Blang008 Member Posts: 61 ■■□□□□□□□□
    Blang008 wrote: »
    Thanks. Can you explain so I can better understand the concept?

    Thanks! That helps a lot! One last question...What's the best way to reverse engineer like for the question below?

    Question: You are designing a subnet mask for the 172.17.0.0 network. You want 200 subnets with up to 250 hosts on each subnet. What subnet mask should you use?
  • rjon17469rjon17469 Member Posts: 52 ■■■□□□□□□□
    Blang008 wrote: »
    Thanks! That helps a lot! One last question...What's the best way to reverse engineer like for the question below?

    Question: You are designing a subnet mask for the 172.17.0.0 network. You want 200 subnets with up to 250 hosts on each subnet. What subnet mask should you use?

    You do the exact same process, just in reverse.

    250 hosts + 2 extra addresses (network definition and broadcast address) = 252 addresses needed per subnet. Next boundary is 2^8=256 addresses. Anything smaller than 2^8 wouldn't have enough addresses. Similarly for number of subnets, for 200 subnets the next boundary is 2^8=256 subnets. So that's a minimum of 8 bits needed for the host portion of the address and a minimum of 8 bits needed for the subnet portion of the address.

    Finally, 172.17.0.0 falls into the class B range, meaning normally it would be a /16 network, with the remaining 16 bits available for subnets and hosts. So you take the 16 bits from the class B range (which is the meaning of the /16), add the 8 bits needed for the subnet, and you get a /24, or 255.255.255.0. The host calculation is just for verification, to ensure that when you add the host bits in you don't exceed the 32 bits available in IPv4 addressing. In this case, the 24+8 host bits equals 32, so we're good.

    This topic is good to understand, however once you get past the exam you won't use it very much. With the shortage of public IPv4 addresses, practically everything (especially new) is using VLSM, and every modern routing protocol has been updated to support (and most of the time assume) VLSM. It sounds like you have the hang of it though!
Sign In or Register to comment.