The GATE Grind

GATE 2015 CS (CS2) – Question 36

Computer Networks · IPv4: Addressing, CIDR, Fragmentation and NAT · 2 marks · Multiple choice

An IP router has these routes:

NetworkMaskNext hop
128.96.170.0255.255.254.0Interface 0
128.96.168.0255.255.254.0Interface 1
128.96.166.0255.255.254.0R2
128.96.164.0255.255.252.0R3
Default—R4

For i:128.96.171.92, ii:128.96.167.151, iii:128.96.163.151, iv:128.96.165.121, choose their next hops. Let a=Interface 0,b=Interface 1,c=R2,d=R3,e=R4.

  1. i–a,ii–c,iii–e,iv–d
  2. i–a,ii–d,iii–b,iv–e
  3. i–b,ii–c,iii–d,iv–e
  4. i–b,ii–c,iii–e,iv–d

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (A) i–a,ii–c,iii–e,iv–d

Explanation

Apply longest-prefix matching. The /23 route at 170 covers 170–171, so i→a. The /23 at 166 covers 166–167 and overrides the broader /22 at 164, so ii→c. No listed prefix covers 163, hence iii→e. Address 165 lies in the 164–167 /22 but outside 166/23, hence iv→d. Thus A.

More IPv4: Addressing, CIDR, Fragmentation and NAT questions

All IPv4: Addressing, CIDR, Fragmentation and NAT questions →