GATE / CS ARCHIVE

GATE CSE 2014 SET 3 / QUESTION 26

GATE CSE 2014 Set 3 Q26

Computer Networks · Routing Algorithms · Full GATE CSE 2014 Set 3 paper

GATE 2014 Set 3, Q26 2 marks · NAT
Report issue

Routing Algorithms

Question 26, GATE 2014: A CIDR router receives destination 131.23.151.76. Its prefix→interface table is 131.16.0.0/12→3; 131.28.0.0/14→5; 131.19.0.0/16→2; 131.22.0.0/15→1. Which output interface is selected?
Tap to enlarge
Answer & solution

Official answer: 1

Step through it (3 steps)

Step 1: Compare prefixes rather than numerical closeness. With the first octet fixed at 131, /12 covers second octets 16…31, so it matches 23. The /14 entry covers 28…31 and does not match; /16 requires exactly 19 and does not match. Step 2: The /15 entry fixes the top seven bits of the second octet, covering 22 and 23, so it matches. Step 3: CIDR chooses the longest matching prefix, /15 rather than /12. Its output interface is 1.

Original paper, page 58 · Answer key