Skip to content
Official PYQ · 2015

GATE CS 2015 Set 2 Q41 — Fragmentation and IP Addressing, IPv4, CIDR

Explain with AI

Consider the following routing table at an IP router:
Network NoNet MaskNext Hop128.96.170.0255.255.254.0Interface 0128.96.168.0255.255.254.0Interface 1128.96.166.0255.255.254.0R2128.96.164.0255.255.252.0R30.0.0.0DefaultR4\begin{array}{|l|l|l|} \hline \textbf{Network No} & \textbf{Net Mask} & \textbf{Next Hop} \\ \hline \text{128.96.170.0} & \text{255.255.254.0} & \text{Interface $0$} \\ \hline\text{128.96.168.0} & \text{255.255.254.0} & \text{Interface $1$} \\ \hline\text{128.96.166.0} & \text{255.255.254.0} & \text{R$2$}\\ \hline \text{128.96.164.0} & \text{255.255.252.0} & \text{R$3$}\\ \hline \text{0.0.0.0} & \text{Default} & \text{R$4$}\\ \hline \end{array}
For each IP address in Group I Identify the correct choice of the next hop from Group II using the entries from the routing table above.
Group IGroup IIi) 128.96.171.92a) Interface 0ii) 128.96.167.151b) Interface 1iii) 128.96.163.151c) R2iv) 128.96.164.121d) R3e) R4\begin{array}{|ll|ll|} \hline & \textbf{Group I} & \textbf{Group II} \\ \hline &\text{i) 128.96.171.92} & \text{a) Interface 0} \\ \hline &\text{ii) 128.96.167.151} & \text{b) Interface 1} \\ \hline &\text{iii) 128.96.163.151} & \text{c) R$2$}\\ \hline &\text{iv) 128.96.164.121} & \text{d) R$3$}\\ \hline &\text{} & \text{e) R$4$}\\ \hline \end{array}

Choose one option
View worked solution

Answer: A

To determine the next hop for each IP address, we perform a bitwise AND operation between the destination IP address and the subnet masks in the routing table, looking for a match. If multiple matches occur, the longest prefix match is selected. If no match occurs, the default route is used.

  • i) 128.96.171.92:
    • Applying mask 255.255.254.0: 171 AND 254=170171 \text{ AND } 254 = 170 (in binary: 101010112 AND 111111102=101010102=17010101011_2 \text{ AND } 11111110_2 = 10101010_2 = 170).
    • This matches the network 128.96.170.0.
    • Next Hop: Interface 0 (a).
  • ii) 128.96.167.151:
    • Applying mask 255.255.254.0: 167 AND 254=166167 \text{ AND } 254 = 166 (in binary: 101001112 AND 111111102=101001102=16610100111_2 \text{ AND } 11111110_2 = 10100110_2 = 166).
    • This matches the network 128.96.166.0.
    • Next Hop: R2 (c).
  • iii) 128.96.163.151:
    • Applying mask 255.255.254.0: 163 AND 254=162163 \text{ AND } 254 = 162 (No match).
    • Applying mask 255.255.252.0: 163 AND 252=160163 \text{ AND } 252 = 160 (No match).
    • Since there is no match, it falls back to the default route.
    • Next Hop: R4 (e).
  • iv) 128.96.164.121:
    • Applying mask 255.255.252.0: 164 AND 252=164164 \text{ AND } 252 = 164 (in binary: 101001002 AND 111111002=101001002=16410100100_2 \text{ AND } 11111100_2 = 10100100_2 = 164).
    • This matches the network 128.96.164.0.
    • Next Hop: R3 (d).

Thus, the correct mapping is i-a, ii-c, iii-e, iv-d.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Fragmentation and IP Addressing, IPv4, CIDR questions