How to figure what subnet mask to use?

JockVSJockJockVSJock Member Posts: 1,118
From subnetting.org

Q: Question: You need to divide the 172.24.0.0 network into 600 subnets with 50 hosts per subnet. What subnet mask should you use?

A: 255.255.255.192 (/26)


I understand how to get the subnet, however for the subnet mask, I'm not sure where to begin.

I'm also aware of the following table listed below, however for the sake of the problem, need to know how to manually figure this out.
Subnet Mask                  Addresses Wildcard
/32       255.255.255.255 1              0.0.0.0
/31       255.255.255.254 2              0.0.0.1
/30       255.255.255.252 4              0.0.0.3
/29       255.255.255.248 8              0.0.0.7
/28       255.255.255.240 16            0.0.0.15
/27       255.255.255.224 32            0.0.0.31
/26       255.255.255.192 64            0.0.0.63
/25       255.255.255.128 128           0.0.0.127
/24       255.255.255.0    256           0.0.0.255
/23       255.255.254.0    512           0.0.1.255
/22       255.255.252.0    1,024         0.0.3.255
/21       255.255.248.0    2,048        0.0.7.255
/20       255.255.240.0    4,096        0.0.15.255
/19       255.255.224.0    8,192        0.0.31.255
/18       255.255.192.0    16,384       0.0.63.255
/17       255.255.128.0     32,768       0.0.127.255
/16       255.255.0.0        65,536       0.0.255.255
/15       255.254.0.0        131,072      0.1.255.255
/14       255.252.0.0        262,144      0.3.255.255
/13       255.248.0.0        524,288      0.7.255.255
/12       255.240.0.0        1,048,576   0.15.255.255
/11       255.224.0.0        2,097,152   0.31.255.255
/10       255.192.0.0        4,194,304   0.63.255.255
/9        255.128.0.0         8,388,608 0.127.255.255
/8        255.0.0.0           16,777,216 0.255.255.255
/7        254.0.0.0           33,554,432 1.255.255.255
/6        252.0.0.0           67,108,864 3.255.255.255
/5        248.0.0.0         134,217,728 7.255.255.255
/4        240.0.0.0         268,435,456 15.255.255.255
/3        224.0.0.0         536,870,912 31.255.255.255
/2        192.0.0.0       1,073,741,824 63.255.255.255
/1        128.0.0.0      2,147,483,648 127.255.255.255
/0        0.0.0.0          4,294,967,296 255.255.255.255

***Freedom of Speech, Just Watch What You Say*** Example, Beware of CompTIA Certs (Deleted From Google Cached)

"Its easier to deceive the masses then to convince the masses that they have been deceived."
-unknown

Comments

  • pham0329pham0329 Member Posts: 556
    To find out how many subnets/host you can get with a particular mask, you use 2^x, where x is the number of bits you're going to borrow.

    In your problem, you need 600 subnets, and your starting point is 172.24.0.0, which is a class B address (/16). The magic number for me is 7, as in 2^7 = 128. This means that if I were to borrow 7 host bits, I would be able to subnet that 172.24.0.0 address into 128 subnets. However, since we need 600, you would just keep going.

    2^8 = 256 (not enough)
    2^9 = 512 ((not enough)
    2^10 = 1024 (bingo!)

    With 10 bits, you can make 1024 subnets with the 172.24.0.0/16 network, which satisfy the 1st requirement. The 2nd requirement is that each subnet require 50 hosts.

    If we borrowed 10 bits for the network address, that leaves us with 6 bits for the hosts (16+10 = 26. 32-26=6). Using the same formula, 2^6 = 64. 64 - 2 (subnet address and broadcast address) leaves us with 62 usable adress per subnet, which satisfy the 2nd requirements as well.
  • drkatdrkat Banned Posts: 703
  • JockVSJockJockVSJock Member Posts: 1,118
    pham0329 wrote: »

    If we borrowed 10 bits for the network address, that leaves us with 6 bits for the hosts (16+10 = 26. 32-26=6). Using the same formula, 2^6 = 64. 64 - 2 (subnet address and broadcast address) leaves us with 62 usable adress per subnet, which satisfy the 2nd requirements as well.

    Please help me understand the process of finding the number of host.

    Right now I'm working the following problem from subnettingquestions.com

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


    I think I have the subnet part answered. Basically you use the powers of 2 to get the number.

    In this case, we need 100 subnets, so 2^7 will work since it gives us 128.

    As for the number of hosts, I don't understand where the 10 bits are coming from.


    EDIT: Ok, I think I get it. The 16 is is coming from the default subnet mask or /16

    16 - 7 (from the subnet part of the question) = 9
    32 (original bits) - 9 = 23

    23 or 255.255.254.0
    ***Freedom of Speech, Just Watch What You Say*** Example, Beware of CompTIA Certs (Deleted From Google Cached)

    "Its easier to deceive the masses then to convince the masses that they have been deceived."
    -unknown
  • pham0329pham0329 Member Posts: 556
    JockVSJock wrote: »

    EDIT: Ok, I think I get it. The 16 is is coming from the default subnet mask or /16

    16 - 7 (from the subnet part of the question) = 9
    32 (original bits) - 9 = 23

    23 or 255.255.254.0

    Yup, you got it! The only thing is, your math probably makes sense to you, but shouldn't it be 16 (default) + 7 (the bits we borrowed) = 23 bits for subnet.

    Then 32 (total bits) - 23 (network bits) = 9 host bits?
Sign In or Register to comment.