Longest Prefix Match

This product was added to computer science because of the content, defects on the quality assurance side of the editor. This is done to bring the quality of the articles from the computer science subject area to an acceptable level. Help us to eliminate the substantive shortcomings of this article and take part you in the discussion! ( )

Longest Prefix Match is a simple procedure in the field of network. It 's about how a router finds the most efficient way a maximum possible match the destination address with an IP address stored in its internal routing table. It is assumed that the network is just as divided into address spaces that such a routing algorithm can be used wisely.

In general: A router maintains a routing table with internal network addresses and network masks and associated therewith interface to forward a received packet can. The best matching destination address is then made ​​several matching entries one with the longest matching netmask.

Example

As a simple example, the following is given:

A router contains a " routing table " with multiple IP address templates and the associated therewith interfaces. There will be a packet is received with the destination address 117.64.32.78, must therefore be taken best possible choice for forwarding the packet. In its routing table are three network address templates. Although it to the network 117.64.32.0/24 ( Interface 1 ) matches, the packet is forwarded but only via the interface, which has a maximum according to the destination address, in this case, the interface address of the interface 2 to 3, the package fits the other hand, not so that the subnet mask of this entry is irrelevant.

Simplified IPv4 " routing table " of a router in CIDR notation: 117.64.32.0/24 > Interface 1 117.64.32.64/26 > Interface 2 117.64.32.128/26 > Interface 3 Received packet with the IPv4 address: 117.64.32.78 Forwarding the packet over: interface 2

Swell

RFC 1519, Section 4.1

  • Computer Networks
528262
de