Skip to content
Official PYQ · 2023

GATE CS 2023 Q55 — Fragmentation and IP Addressing, IPv4, CIDR

Explain with AI
The forwarding table of a router is shown below.
Subnet NumberSubnet MaskInterface ID200.150.0.0255.255.0.01200.150.64.0255.255.224.02200.150.68.0255.255.255.03200.150.68.64255.255.255.2244Default0\begin{array}{|l|l|c|} \hline \textbf{Subnet Number} & \textbf{Subnet Mask} & \textbf{Interface ID} \\ \hline 200.150 .0 .0 & 255.255 .0 .0 & 1 \\ \hline 200.150 .64 .0 & 255.255 .224 .0 & 2 \\ \hline 200.150 .68 .0 & 255.255 .255 .0 & 3 \\ \hline 200.150 .68 .64 & 255.255 .255 .224 & 4 \\ \hline \text{Default} & & 0 \\ \hline \end{array}
A packet addressed to a destination address 200.150.68.118200.150 .68 .118 arrives at the router. It will be forwarded to the interface with ID\text{ID} __________.
View worked solution

Answer: 3

To determine the forwarding interface, we apply the Longest Prefix Match (LPM) rule. We perform a bitwise AND between the destination IP address 200.150.68.118200.150.68.118 and each subnet mask to see which entries match.

  1. Interface 1: Mask 255.255.0.0255.255.0.0 (/16)
    200.150.68.118 AND 255.255.0.0=200.150.0.0200.150.68.118 \text{ AND } 255.255.0.0 = 200.150.0.0 (Match)
  2. Interface 2: Mask 255.255.224.0255.255.224.0 (/19)
    68 in binary=01000100268 \text{ in binary} = 01000100_2 and 224 in binary=111000002224 \text{ in binary} = 11100000_2.
    68 AND 224=6468 \text{ AND } 224 = 64.
    200.150.68.118 AND 255.255.224.0=200.150.64.0200.150.68.118 \text{ AND } 255.255.224.0 = 200.150.64.0 (Match)
  3. Interface 3: Mask 255.255.255.0255.255.255.0 (/24)
    200.150.68.118 AND 255.255.255.0=200.150.68.0200.150.68.118 \text{ AND } 255.255.255.0 = 200.150.68.0 (Match)
  4. Interface 4: Mask 255.255.255.224255.255.255.224 (/27)
    118 in binary=011101102118 \text{ in binary} = 01110110_2 and 224 in binary=111000002224 \text{ in binary} = 11100000_2.
    118 AND 224=96118 \text{ AND } 224 = 96.
    200.150.68.118 AND 255.255.255.224=200.150.68.96≠200.150.68.64200.150.68.118 \text{ AND } 255.255.255.224 = 200.150.68.96 \neq 200.150.68.64 (No Match)

Comparing the matching prefixes, the longest mask is 255.255.255.0255.255.255.0 (/24) corresponding to Interface 3.

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

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