-1

An Internet Service Provider (ISP) has the following chunk of CIDR-based IP addresses available with it: 245.248.128.0/20. The ISP wants to give half of this chunk of addresses to Organization A, and a quarter to Organization B, while retaining the remaining with itself. Which of the following is a valid allocation of addresses to A and B?

Options are :

  1. 245.248.136.0/21 and 245.248.128.0/22
  2. 245.248.128.0/21 and 245.248.128.0/22
  3. 245.248.132.0/22 and 245.248.132.0/21
  4. 245.248.136.0/24 and 245.248.132.0/21

My attempt:

Given address is :

245.248.128.0/20 = 11110101.11111000.1000 0000.00000000

so, we have last 12 bits for hosts . Now if we give half hosts to Organization A , (now we have only last 11 bits for hosts).possible address for Organization A .i.e.,

245.248.128.0/21 = 11110101.11111000.10000 000.00000000

and also ,

245.248.136.0/21 = 11110101.11111000.10001 000.00000000

and a quarter to Organization B ,i.e. ,

245.248.128.0/22 = 11110101.11111000.100000 00.00000000

Now , we have remaining last 10 bits for hosts.

Hence , both option (1) and (2) are matches.

Why option (2) is wrong ?

Can you explain it in a formal way, please?


This question from competitive exam GATE (see-Q-no.-34) and answer key is given by GATE is option (1) (see-set-A-Q-no.-34) .

  • It seems like you're missing something obvious about the point of having network addresses in the first place: If the ISP assigns 245.248.128.0/21 to Organization A and 245.248.128.0/22 to Organization B, and the ISP receives a packet addressed to 245.248.128.1, who should they send it to? =) – rakslice Oct 2 '15 at 8:05
  • @rakslice: AFAIK the most specific route would be chosen, no? – user1686 Oct 2 '15 at 8:07
  • overlapping, rt ? – ً ً Oct 2 '15 at 8:07
2

Option 2 is wrong since the first mask includes all addresses from the second one; it is a superset. (Notice that the bit prefixes match.) This means that some of the addresses will be given to both organizations. You can't really tell Org A to "use this address range – except this address, and that one, and that…"

Specifically, 245.248.128.0/21 starts at 245.248.128.0 and ends at 245.248.135.255.
Meanwhile, 245.248.128.0/22 starts at 245.248.128.0 and ends at 245.248.131.255.
So you can see that Org B would be using addresses from Org A's space.

Not the answer you're looking for? Browse other questions tagged or ask your own question.