IAE Academy

GATE 2020 CS Q.38: solution and answer

GATE 2020 · CSQ.38 · 2 marks · MCQ

An organization requires a range of IP addresses to assign one to each of its 1500 computers. The organization has approached an Internet Service Provider (ISP) for this task. The ISP uses CIDR and serves the requests from the available IP address space 202.61.0.0/17. The ISP wants to assign an address space to the organization which will minimize the number of routing entries in the ISP's router using route aggregation. Which of the following address spaces are potential candidates from which the ISP can allot any one to the organization?

I. 202.61.84.0/21
II. 202.61.104.0/21
III. 202.61.64.0/21
IV. 202.61.144.0/21

  1. (A)

    I and II only

  2. (B)

    II and III only

  3. (C)

    III and IV only

  4. (D)

    I and IV only

See the question in the paper

Answer and solution

ANSWER

Option B: only II (202.61.104.0/21) and III (202.61.64.0/21) can be allotted.

Official answer: BSource: Official answer key, GATE 2020 CS (IIT Delhi)

  1. Hosts needed: and , so 11 host bits are needed and the prefix length is . Every candidate is a /21, which matches (a /21 holds 2048 addresses, 2046 of them usable, enough for 1500 computers).

  2. The ISP's pool 202.61.0.0/17 has 17 network bits: the first two octets (16 bits) plus the top bit of the third octet, which is fixed at 0. The other 7 bits of the third octet and all of the fourth octet are free, so the pool spans 202.61.0.0 to 202.61.127.255, i.e. third octet to .

  3. To keep the ISP's routing table small by route aggregation, the allotted block must lie inside the ISP's /17, so that the ISP still advertises one /17 entry for it. The block must also be a valid /21 network address: a /21 leaves 3 bits of the third octet for hosts, so the third octet must be a multiple of .

  4. I. 202.61.84.0/21: , not a multiple of 8, so 202.61.84.0 is not a /21 network address (the /21 containing it starts at 202.61.80.0). Not valid.

  5. II. 202.61.104.0/21: and . Valid and inside the pool. It covers 202.61.104.0 to 202.61.111.255.

  6. III. 202.61.64.0/21: and . Valid and inside the pool. It covers 202.61.64.0 to 202.61.71.255.

  7. IV. 202.61.144.0/21: is a valid /21, but , so it lies outside 202.61.0.0/17 and is not part of the ISP's pool. Not available.

  8. Only II and III qualify: option B.

KEY IDEA

A block can be allotted from the ISP's pool only if it is a properly aligned /21 (third octet a multiple of 8) and lies inside 202.61.0.0/17 (third octet 0 to 127). Then it aggregates into the ISP's single /17 route.

WATCH OUT FOR

Checking only the range and accepting 202.61.84.0/21, which is not aligned to a /21 boundary (84 is not a multiple of 8). Or checking only alignment and accepting 202.61.144.0/21, which is aligned but outside the /17 pool (third octet 144 is at least 128).

From the GATE 2020 CS paper. Every question of this paper · Download the full paper · All 20 IPv4 questions, with notes

More IPv4 questions