# Subnetting 90.103.80.0/21 into 8 subnets with at least 250 hosts per subnet

I am studying subnetting and I am not sure if I've got the hang of fully. Here's a question I've answered with my answers posted below it. I am particularly unsure about Question 4. I'd appreciate some help from people with more experience in this area.

You have been allocated the IP address range 90.103.80/21 for use withing your own network. Suppose you want to be able to accomodate at least 8 subnets within this network and each subnet can accomdate at least 250 individual hosts. Given these constraints answer the following questions:

Questions

1. How many individual IP address are potentially available for use with the full /21 allocation, assuming there were no subnets created?
2. What is the dotted-decimal equivalent of a /21 netmask?
3. What subnet mask would be used to provide 8 subnets with at least 250 hosts per subnet as outlined above?
4. If we divide up the /21 allocation into 8 subnets, what is the IP address ranges and the broadcast address for the 1st subnet?
5. What would change if we instead decided to use 16 subnets?

1. We have 11 bits available for the host address so we have 2^11 - 2 = 2046 IP addresses available for use as the first and last addresses in the range are reserved for the subnet address and the broadcast address.
2. 255.255.248.0
3. If we take 3 bits from the host number to use as the subnet number that leaves us with 8 bits left for the host number. Which gives us 2^3 = 8 subnets with 2^8 - 2 = 254 hosts per subnet.
4. The IP address range of the first subnet is 90.103.80.1 - 90.103.81.254. The broadcast address is 90.103.81.254.
5. If we decided to use 16 subnets the number of hosts per subnet would be 126.

Have I got that right? Also, as a matter of interest what would be the broadcast address of the last (8th) subnet given the above information?

-
A simple program such as `ipcalc` would give you most answers right away. – BatchyX Mar 10 '13 at 18:18

As you already suspected it's answer 4 that's not correct. To see this it might be best to write the addresses down in binary notation.

The address range you have been given (90.103.80/21) comes down to:

``````01011010 01101111 01010xxx.xxxxxxxx
--------.--------.-----xxx.xxxxxxxx
``````

with "x"es marking the part that you are free to assign any combination of "0" and "1" to.

Taking 3 additional bits as the network part you're left with the following:

``````01011010 01101111 01010nnn.hhhhhhhh
--------.--------.-----xxx.xxxxxxxx
``````

With "n" marking the bits used for the network part and "h" marking the bits used for the host part.

Your networks will be thus using the combinations "000" "001" "010" "011" "100" "101" "110" and "111" to substitute the "nnn" part. Leaving (without network and broadcast adress) 254 hosts on each network with addresses distributed as follows:

``````01011010 01101111 01010nnn.hhhhhhhh

-- 1st network --------------------
000.00000000   network    90.103.80.0
000.00000001   1st host   90.103.80.1
...           ...
000.11111110   last host  90.103.80.254