IP Forwarding and Longest Prefix Match

Select the most specific matching route and show how binary prefix structure supports a forwarding lookup.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. A prefix describes a set of destinations
  2. Forwarding applies choices already computed by routing

A prefix describes a set of destinations

An IPv4 prefix of length \(k\) matches all addresses sharing its first \(k\) bits. For documentation address \(192.0.2.80\), routes for \(192.0.2.0/24\), \(192.0.2.64/26\), and the default all match. The /26 is longest and takes precedence in this comparison. The rule lets a more specific route override its aggregate without requiring every covered address to have a separate entry.

Forwarding applies choices already computed by routing

A prefix trie can walk address bits while remembering the deepest entry carrying a usable action. Real forwarding structures also account for update rates and memory. Multiple routes with the same prefix need a separate policy to select or share next hops. Link-state routing computes paths within a routing domain. Interdomain routing can choose a path based on policy before it becomes a forwarding entry.[1]

References

  1. Larry Peterson and Bruce Davie, Computer Networks: A Systems Approach ↩