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 01000101. To which interface will this datagram be forwarded using longest-prefix matching?

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

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




Solution


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

2. Since the address is 01001101, it will go to interface 1.

3. Since the address is 00011101, it will go to interface 6.



That's incorrect

That's correct

The answer was: 1

Question 1 of 3

The answer was: 1

Question 2 of 3

The answer was: 6

Question 3 of 3

Try Another Problem

We greatly appreciate the work of John Broderick (UMass '21) in helping to develop these interactive problems.

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