×

Method for longest prefix matching in a content addressable memory

  • US 6,237,061 B1
  • Filed: 01/05/1999
  • Issued: 05/22/2001
  • Est. Priority Date: 01/05/1999
  • Status: Expired due to Fees
First Claim
Patent Images

1. A method of determining which of a plurality of CIDR addresses stored in a ternary content addressable memory (CAM) has a longest matching prefix with a comparand of said ternary CAM, each of said CIDR addresses having first and second address fields of varying lengths and having a prefix value indicative of a number of bits in said first address field, said ternary CAM having a plurality of CAM words and a corresponding plurality of mask words, said method comprising the steps of:

  • loading said plurality of CIDR addresses into respective ones of said plurality of CAM words in a predetermined order such that increasing numerical CAM word addresses correspond to CIDR addresses having decreasing prefix values;

    for each CIDR address loaded in the previous step, setting bit values of said corresponding mask word according to said prefix of said CIDR address such that bits of said second address field of each CIDR address are individually masked by said corresponding mask word; and

    comparing said comparand to said respective first address fields of said plurality of CIDR addresses in a single compare operation.

View all claims
  • 11 Assignments
Timeline View
Assignment View
    ×
    ×