Search code examples
networkstream

Calculation of the number of hosts per subnet in Class B network


If a class B network on the Internet has a subnet mask of 255.255.248.0, what is the maximum number of hosts per subnet? (A) 1022 (B) 1023 (C) 2046 (D) 2047

Can anybody pls tell me the logic of how this problem can be solved?


Solution

  • I think a picture of the mask would help... given your example, the bits for the mask 255.255.248.0 would be:

    11111111 11111111 11111000 00000000
    

    Which would leave 11 bits for host addressing, hence 2 ^ 11, or 2048. That said, I was unaware until I read a little more on wikipedia that the usage of the zero subnet or all-ones subnet was discouraged initially. So the answer will depend on whether you are reserving those addresses or not.