A packet with the destination address arrives at a router whose routing table is shown. Which interface will the packet be forwarded to?
View worked solution
Answer: A
To determine which interface the packet will be forwarded to, we apply the Longest Prefix Match (LPM) algorithm. We compare the destination IP address with each subnet entry in the routing table:
-
Subnet (Interface ):
The first 16 bits of the destination IP () match the subnet prefix.
Match: Yes (Prefix length = 16). -
Subnet (Interface ):
The third octet of the destination is . The third octet of the subnet is .
For a mask, the first bit of the third octet must match. Here, .
Match: No. -
Subnet (Interface ):
The third octet of the destination is . The third octet of the subnet is .
For a mask, the first 2 bits of the third octet must match. Since both start with , they match.
Match: Yes (Prefix length = 18). -
Subnet (Interface ):
The third octet of the destination () does not match the subnet ().
Match: No.
Comparing the matching prefixes, the longest prefix match is corresponding to interface .
Free practice · Your answers on this page are not saved.
