Você está na página 1de 2

Longest prefix match

From Wikipedia, the free encyclopedia

Longest prefix match (also called Maximum prefix length match) refers to an algorithm used by routers in Internet Protocol (IP) networking to select an entry from a routing table .[1] Because each entry in a routing table may specify a network, one destination address may match more than one routing table entry. The most specific table entry the one with the highest subnet mask is called the longest prefix match. It is called this because it is also the entry where the largest number of leading address bits in the table entry match those of the destination address. For example, consider this IPv4 routing table (CIDR notation is used):
1 9 2 . 1 6 8 . 2 0 . 1 6 / 2 8 1 9 2 . 1 6 8 . 0 . 0 / 1 6

When the address 1 9 2 . 1 6 8 . 2 0 . 1 9needs to be looked up, both entries in the routing table "match". That is, both entries contain the looked up address. In this case, the longest prefix of the candidate routes is 1 9 2 . 1 6 8 . 2 0 . 1 6 / 2 8 , since its subnet mask (/28) is higher than the other entry's mask (/16), making the route more specific. Routing tables often contain a default route, which has the shortest possible prefix match, to fall back on in case matches with all other entries fail.

See also
Network Search Engine: hardware accelerator used in routers for LPM lookups. Trie: prefix tree

References
1. ^ Computer Networks and Internets (5th ed.). 2008. p. 368. ISBN 978-0-13-606698-9.

Retrieved from "http://en.wikipedia.org/w/index.php?title=Longest_prefix_match&oldid=542581034" Categories: Routing protocols Internet architecture

This page was last modified on 7 March 2013 at 13:28. Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.

Você também pode gostar