How to figure out this type of subnet problem?

Admiral AkmirAdmiral Akmir Member Posts: 40 ■■□□□□□□□□
So, I've gotten better at subnetting and block sizes, but what throws me for a loop is questions like this...

[h=2]What subnet mask would you use for the 172.16.0.0 network, such that you can get 2850 subnets and 10 hosts per subnet?[/h]
Does it matter which way I go? Host side or subnet side? It seems easier for me to think of it from host perspective. 10 hosts is a block size of 16, so the mask would be 255.255.255.240. Problem is when I count it out in my head it doesn't seem to fit. The default subnet mask is 255.255.0.0, I've borrowed an additional 12 bits to reach the block size of 16

255.255...1 2 4 8 16 32 64 128 | 256 512 1024 2048.

Wouldn't that give me a block size of 2048 for the subnet mask? It doesn't meet the requirement. I must be thinking of this the wrong way.

Comments

  • OfWolfAndManOfWolfAndMan Member Posts: 923 ■■■■□□□□□□
    A /28 would give you 14 hosts per subnet and 4096 subnets. The context of this question is inappropriate, as these EXACT numbers are not feasible. If it said at least 2850 subnets, then it would be appropriate.
    :study:Reading: Lab Books, Ansible Documentation, Python Cookbook 2018 Goals: More Ansible/Python work for Automation, IPSpace Automation Course [X], Build Jenkins Framework for Network Automation []
  • OfWolfAndManOfWolfAndMan Member Posts: 923 ■■■■□□□□□□
    I apologize for not explaining myself. Firstly, you will assess this is a class B network, therefore there are 16 bits available. In this situation however, I would start with finding the right CIDR by figuring out how many bits to allocate for at least 10 hosts. Going by increment of two, the numbers for it would be 2,4,8,16 (That's four bits from the right, which is 11111111.11111111.11111111.11110000. Therefore, the appropriate bits would be 32-4= 28 = 255.255.255.240). Don't forget that when calculating hosts you have to subtract 2 (One for the Net ID and one for the broadcast), so 16 is actually 14 hosts total. Range for the first subnet would be 172.16.0.0 - 172.16.0.15 (.0 for Net ID and .15 for broadcast).
    :study:Reading: Lab Books, Ansible Documentation, Python Cookbook 2018 Goals: More Ansible/Python work for Automation, IPSpace Automation Course [X], Build Jenkins Framework for Network Automation []
  • Admiral AkmirAdmiral Akmir Member Posts: 40 ■■□□□□□□□□
    I apologize for not explaining myself. Firstly, you will assess this is a class B network, therefore there are 16 bits available. In this situation however, I would start with finding the right CIDR by figuring out how many bits to allocate for at least 10 hosts. Going by increment of two, the numbers for it would be 2,4,8,16 (That's four bits from the right, which is 11111111.11111111.11111111.11110000. Therefore, the appropriate bits would be 32-4= 28 = 255.255.255.240). Don't forget that when calculating hosts you have to subtract 2 (One for the Net ID and one for the broadcast), so 16 is actually 14 hosts total. Range for the first subnet would be 172.16.0.0 - 172.16.0.15 (.0 for Net ID and .15 for broadcast).

    Thanks for the reply, I figured out my mistake while I was at work. I think I was confusing number of bits, with place values. For example, from the right most bit I count 1, 2, 4, 8, 16... That's five spaces, so I think I need five bits, but 2^5 is 32, which is one block size too large for what was needed, so I was always off in my calculations.
  • OfWolfAndManOfWolfAndMan Member Posts: 923 ■■■■□□□□□□
    Yes I see your mistake. Since it increments of 2, you start at 2, not 1
    :study:Reading: Lab Books, Ansible Documentation, Python Cookbook 2018 Goals: More Ansible/Python work for Automation, IPSpace Automation Course [X], Build Jenkins Framework for Network Automation []
Sign In or Register to comment.