Forwarding and longest prefix match

A router looks up each packet's destination in a table of prefixes and sends it out the link of the longest prefix that matches, so a specific route such as `10.1.2.0/24` overrides a broad one such as `10.0.0.0/8`, and `0.0.0.0/0` is the default route that matches everything.

From Computer Networks and Security.