Interactive end-of-chapter exercises


Longest Prefix Matching

Consider a datagram network using 8-bit host addresses.
Suppose a router uses longest-prefix matching, and has the following forwarding table:



Question List


1. Suppose a datagram arrives at the router, with destination address 10000100. To which interface will this datagram be forwarded using longest-prefix matching?

2. Suppose a datagram arrives at the router, with destination address 10101011. To which interface will this datagram be forwarded using longest-prefix matching?

3. Suppose a datagram arrives at the router, with destination address 10101111. To which interface will this datagram be forwarded using longest-prefix matching?




Solution


1. Since the address is 10000100, it will go to interface 6.

2. Since the address is 10101011, it will go to interface 5.

3. Since the address is 10101111, it will go to interface 5.



That's incorrect

That's correct

The answer was: 6

Question 1 of 3

The answer was: 5

Question 2 of 3

The answer was: 5

Question 3 of 3

Try Another Problem

We’d appreciate your leave us feedback on this networking tutor.

We gratefully acknowledge the programming and problem design work of John Broderick (UMass '21), which has really helped to substantially improve this site. The networking tutor was designed and implemented by Hashim Zia and Shayan Ahmad from New York University Abu Dhabi.

Copyright © 2010-2025 J.F. Kurose, K.W. Ross
Comments welcome and appreciated: kurose@cs.umass.edu