The gauntlet — every row tested, every time, and the longest match wins
One router’s table, and a destination address. Every row gets the same test — destination AND mask, compared with the prefix — and then the matching rows are ranked by prefix length.
Destination
The forwarding table
Prefix
Mask
dest AND mask
Match?
Bits
Next hop
Iface
bitsarebits.com · CSE 316 — Data Communication & Networking · longest prefix match