GATE | GATE-CS-2014-(Set-3) | Question 65

Classless Inter-domain Routing (CIDR) receives a packet with address The router’s routing table has the following entries:

Prefix           Output Interface Identifier              3              5              2              1

The identifier of the output interface on which this packet will be forwarded is ______.
(A) 1
(B) 2
(C) 3
(D) 5

Answer: (A)

Explanation: In this question, we need to find out Netmask for each entry and BITWISE AND with given packet address, whichever equals the Netid, is the ans. Ex. 1st entry in table: its MASK is first 12 bits of network(they are all 1) and remaining 20 bits of host(they are all 0). so MASK is AND = Last entry is MASK—> AND = Two ans coming interfaces 1,3.

Longest Prefix Matching is used to decide among two. When one destination address matches more than one forwarding table entry. The most specific of the matching table entries is used as the interface.

The interface 1 has the longest matching prefix with the input IP address. Therefore 1 is chosen.

Quiz of this Question

My Personal Notes arrow_drop_up