This question already has an answer here:
This problem comes from Tannanebaum's CN book and the full description of it is as follows:
A large number of consecutive IP addresses are available starting at 18.104.22.168. Suppose that four organizations, A, B, C, and D, request 4000, 2000, 4000, and 8000 addresses, respectively, and in that order. For each of these, give the first IP address assigned, the last IP address assigned, and the mask in the w.x.y.z/s notation.
The answer given is as follows:
To start with, all the requests are rounded up to a power of two. The starting address, ending address, and mask are as follows: A: 22.214.171.124 – 126.96.36.199 written as 188.8.131.52/20 B: 184.108.40.206 – 220.127.116.11 written as 18.104.22.168/21 C: 22.214.171.124 – 126.96.36.199 written as 188.8.131.52/20 D: 184.108.40.206 – 220.127.116.11 written as 18.104.22.168/19
With my understanding of subnetting, this answer doesn't make sense.
If my understanding is correct to find the number of bits for the host log 2 of 2000 = 11 bits for the host. In other words we need to reserve 11 bits in total to identify the host.
The mask would be 11111111.11111111.11111|000.00000 = 255.255.248.0.
The first address is in the case that we leave all of the host bits as 0s:
In that case we get: 22.214.171.124 To find end address all host bits need to be 1s:
198.16.(5 bits reserved)111, 111111111 Then we get: 198.16.10001111.11111111 = 126.96.36.199 Which is a wrong answer.
The right answer is: 188.8.131.52 – 184.108.40.206 written as 220.127.116.11/21.
Where did I go wrong and how is that answer computed?