Question
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?
Official answer and solution
- Official answer
- A
- From
- Official GATE 2012 answer key
Solution
Subnet the given /20 address block into /21 (half) and /22 (quarter) non-overlapping prefixes.
-
The ISP owns
245.248.128.0/20. Total addresses = , spanning third octet 128 through 143 (). -
Half of the chunk allocated to Organization A:
- Half of is addresses, which requires a
/21mask. - The two valid /21 blocks are
245.248.128.0/21(third octet 128..135) and245.248.136.0/21(third octet 136..143).
- A quarter of the chunk allocated to Organization B:
- Quarter of is addresses, which requires a
/22mask. - The four valid /22 blocks are
245.248.128.0/22(128..131),245.248.132.0/22(132..135),245.248.136.0/22(136..139), and245.248.140.0/22(140..143).
- Non-overlapping condition:
- If Org A gets
245.248.136.0/21(136..143), Org B can validly get245.248.128.0/22(128..131). The two blocks are disjoint and both belong to the ISP chunk. - Option (B) assigns
245.248.128.0/21and245.248.128.0/22, which overlap directly. - Option (C) and (D) allocate incorrect prefix lengths to A and B.
- Therefore, Option (A) is the valid allocation.
A
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2012 Computer Science and Information Technology (CS)
- Question
- 34 of 65, printed as CS Q.34
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.