layers: add benchmarks
routing: match routes by longest prefix

Routes are sorted by prefix length (longest first) so that the longest prefix is
matched first.