×

Longest prefix match lookup using hash function

  • US 7,089,240 B2
  • Filed: 06/29/2004
  • Issued: 08/08/2006
  • Est. Priority Date: 04/06/2000
  • Status: Expired due to Fees
First Claim
Patent Images

1. A method for determining a longest prefix match for a variable length search key by a computer processing device, comprising the acts of:

  • reading an internet protocol (IP) destination address;

    reading a virtual private network (VPN) number;

    performing a hash on the N most significant bits of the IP destination address and the VPN number, and concatenating the remaining least significant bits of the IP destination address to the result of the hash operation to form an input key;

    using the hashed portion of the input key as an index into a table representing a plurality of root nodes of search trees wherein each non-empty entry in the table contains a pointer to a next branch in the search free or a leaf;

    determining if the pointer in a non-empty table entry points to a leaf or a next branch of the corresponding search tree;

    use a next-bit-to-test field in the entry to find a distinguishing bit position in the search key, and determine if that bit is a one or a zero;

    responsive to the state of the identified distinguishing bit, reading either the first half or second half of the next branch contents if the pointer points to a next brunch of the corresponding search free;

    storing intermediate leaf pointers and corresponding prefix length as determined by distinguishing bit position;

    reading a leaf pattern when the leaf of a corresponding search tree is reached and comparing the leaf pattern with the input key to determine if the leaf pattern matches the input key;

    if leaf pattern matches, identifying the leaf as the longest prefix match;

    if leaf pattern does not match, identifying previously stored leaf pointer with distinguishing bit greater than least significant bit of mismatch as the longest prefix match; and

    returning the Longest prefix match found for the input key to a requesting application.

View all claims
  • 1 Assignment
Timeline View
Assignment View
    ×
    ×