CS FundamentalsVery hardGATE CS (PYQ pattern)

A router uses longest-prefix match with the table: 0.0.0.0/0 → e0; 172.16.0.0/12 → e1; 172.16.64.0/18 → e2; 172.16.80.0/20 → e3; 172.16.80.128/25 → e1; 172.20.0.0/14 → e2. Eight packets have destinations 172.16.80.200, 172.16.81.5, 172.16.100.1, 172.17.0.9, 172.21.255.1, 172.24.0.1, 8.8.8.8 and 172.16.64.7. How many of them leave through e1?

  1. A. 3
  2. B. 4
  3. C. 2
  4. D. 5

Correct answer: A. 3

Interfaces chosen, in order: ['e1', 'e3', 'e2', 'e1', 'e2', 'e1', 'e0', 'e2']. The /12 covers 172.16.0.0 to 172.31.255.255, so addresses not caught by a longer prefix go to e1; the /25 also maps to e1 although a /20 contains it.

More Computer Networks questions

Exams that ask this topic