Applying longest-prefix IP routing
Routing Algorithms

Answer & solution
Official answer: A
Step through it (3 steps)
Approach: First find all matching network prefixes, then choose the most specific (longest) one.
The first two destination octets are 145.36, so the /16 E1 entry matches. The /17 E2 entry additionally requires the high bit of the third octet to be 1, meaning a third octet from 128 through 255. The destination’s third octet is 109, so that entry does not match.
The /18 E3 prefix fixes the first two bits of the third octet to 01, covering 64 through 127. Since 109 lies in that range, it matches. The /24 E4 entry requires third octet 255, so it does not match.
Among E1’s /16, E3’s /18 and the default, /18 is longest. Thus forward to E3, option A. Routing is not a first-listed-match decision, and a longer prefix is relevant only if it actually matches.




