"Fitz" <(EMail Removed)> wrote in message
news:(EMail Removed)...
> On page 152 under "Lesson 3 Review", question 2 states:
>
> "Your company has registered the network ID 131.107.0.0, which uses the
> default subnet mask 255.255.0.0. You would like to create a custom subnet
> mask that allows you to divide that network into the maximum number of
> subnets that would allow you to have at least 20 hosts per subnet. What
> custom subnet mask would you use?"
>
> Question 2 Answer states:
>
> "To start with, you know you will have to borrow some bits from the host
> ID
> in the third and fourth octets. Any custom subnet mask with a value
> greater
> than 240 in the tourth octet will give you fewer than 20 hosts per subnet.
> Using 255.255.255.224 as a subnet mask will give you 4095 possible subnets
> with 31 hosts possible per subnet. It is also common practice to subtract
> 2
> addresses from the possible number of hosts to account fro host IDs that
> contain all zeros or all ones. Even with this margin, you still have 30
> possible hosts."
>
> I apologize for retyping all of this but my question is about the answer.
> Where do they get the number 4095 possible subnets? Is this a typo and if
> not, where is the 4095 coming from? I understand every other part of the
> question and answer except for that. Someone who knows please help.
> Thanks!
To get 20 hosts per subnet, you need 5 bits from the last octet. To find
the number of addresses, take 2 and raise it to the power of N where N = the
number of bits. Therefore 2^5 = 32. You cannot have a host with all zeros
(network address) or all ones (broadcast address), therefore you subtract
two, leaving you with 30 possible hosts on the subnet. Since the
requirement was to have at least 20 hosts, a 5 bit host ID satisfies this
requirement. (A 4 bit host ID would only allow for 14 hosts, which does not
meet the requirement of 20).
Since you are using 5 bits for the host ID, the remaining 11 bits are used
for the subnet ID. To find the number of subnets, take 2 and raise it to
the power of N where N = the number of bits. Therefore, 2^11 = 2048.
Therefore, your subnet mask is 255.255.255.224, and you have 2048 subnets
consisting of 30 hosts/subnet if you started with a class B address such as
131.107.0.0/16.
That's the way I see it.
John R
