WO2003003250A1 - Range content-addressable memory - Google Patents

Range content-addressable memory Download PDF

Info

Publication number
WO2003003250A1
WO2003003250A1 PCT/IL2001/000595 IL0100595W WO03003250A1 WO 2003003250 A1 WO2003003250 A1 WO 2003003250A1 IL 0100595 W IL0100595 W IL 0100595W WO 03003250 A1 WO03003250 A1 WO 03003250A1
Authority
WO
WIPO (PCT)
Prior art keywords
range
boundary
value
associative
input
Prior art date
Application number
PCT/IL2001/000595
Other languages
French (fr)
Inventor
Moshe Stark
Original Assignee
Hywire Ltd.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hywire Ltd. filed Critical Hywire Ltd.
Priority to PCT/IL2001/000595 priority Critical patent/WO2003003250A1/en
Publication of WO2003003250A1 publication Critical patent/WO2003003250A1/en

Links

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C15/00Digital stores in which information comprising one or more characteristic parts is written into the store and in which information is read-out by searching for one or more of these characteristic parts, i.e. associative or content-addressed stores
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/90335Query processing
    • G06F16/90339Query processing by using parallel associative memories or content-addressable memories

Definitions

  • the present invention relates to the field of Content Addressable Memory (CAM). More particularly, the invention relates to a method and apparatus for storing associative ranges containing keys and data associated with said ranges, in the form of a lookup table, in which a searched associative key found within a range is used to extract the associated data.
  • CAM Content Addressable Memory
  • CAM devices are specially designed for storing information in the form of a lookup table.
  • CAM structures allow a direct and fast search of data items, which is based on an associative key.
  • Software implementations of such data structures are usually slow for real time applications, especially in view of the great advances in recent years in data transmission rates.
  • CAM comprises storage of key words, and a separate storage for associated data items. For each of the stored key words, there is a corresponding associated data item. Therefore, the structure and operation of CAMs differs from those of conventional memory devices, such as RAM, wherein each data item is addressed by utilizing a unique address.
  • data items are fetched from the CAM device by submitting a key value. The key words storage is then searched to determine if a matching key word is stored inside the CAM. If there is a key-matching entry found in the CAM, a 'match' indication is issued, and the corresponding associated data (i.e., the data item associated with the key) is output from the CAM.
  • the Internet routers maintain a list of Internet Protocol (IP) Destination Addresses (IPDAs), and their associated interfaces (e.g., port numbers) through which the router should forward the received packet.
  • IP Internet Protocol
  • IPDAs Internet Protocol Destination Addresses
  • This list is-utilized to determine the best route for a packet of information received by the router to reach its destination. More particularly, said list of IPDAs and the interfaces is organized in the form of a lookup table.
  • the key word associated with each IPDA is the router interface of the destined network node (i.e., the next routing point, to which the received packet is destined).
  • Each IPDA is a unique 32-bit entity, usually represented in the form of four octets (sequences of eight bits, e.g., 192.30.50.0), comprising address information of the destined node within that network.
  • IP network classification method utilizing five basic Classes for any network on the Internet, turned out to be very expansive in terms of IPDA address space consumption, and in terms of the routing table size, required for forwarding lookups. As a consequence, the Internet ran out of address space very quickly. This has also led to an outstanding growth in the size of the routers' lookup tables.
  • the Internet Engineering Task Force devised a more flexible method (as described in RFC1519), known as the Classless Inter-Domain Routing (CIDR).
  • the CIDR resolves the difficulties stemming from the original network Address-Class hierarchy by aggregating multiple routes into a single representation. Address aggregation is achieved by masking a contiguous number of address 32-p least significant bits, which leads to a representation of a range of addresses by a single address and its mask. This leaves p bits also defined as the address prefix, p can be any integer value from 0 to 32.
  • the convention used to describe a CIDR address entry is A/p, wherein A is the address and p is the prefix. For example, the CIDR address entry 192.30.50.0/24 matches any IPDA address in the range 192.30.50.0 ⁇ -» 192.30.50.255.
  • a CIDR address may match with a multiple number of entries in the router's key list, this due to the presence of overlapping address ranges. Selection of one out of multiple matches is based upon the most specific match, which is the one with the longest prefix.
  • the CIDR addressing scheme allows a more efficient allocation of IP addresses, which results in a significant reduction in the size of the routing table, yet the growth of the Internet is seems to be increasing with time, and the difficulties stemming from this growth in routing table size still remain.
  • the modern routers are now designed for CIDR compliance.
  • Ternary CAM technology is widely adopted in routers implementation, but the substantial growth in the size of routing tables, and the many comparison operations required in determining a key match, influence performance and power consumption.
  • Other complications in Ternary CAM (TCAM) implementations are due to the complexity involved in determining the key match to a range of possible values, and especially utilizing CIDR's longest-prefix-match policy.
  • the conventional CAM implementations are efficiently designed for lookup tables when an exact match of key values is required, but the situation is more complex when a range of values need to be matched.
  • the aggregation efficiency is greatly influenced by the allocated address space, which in many cases is not covered by a single mask prefix, resulting in a substantial increase of routing table's sizes.
  • Ternary CAMs are limited with respect to the range boundaries, which are limited only to integer values being a • 2 32 ⁇ p , wherein a is an integer, and p is the prefix length. Therefore, the boundary values do not represent the whole range of non-negative integer values. This eliminates the capability of further aggregation over and beyond that offered by the CIDR method.
  • Ternary CAM's basic cell is complex, since it incorporates the address, the mask and the comparator.
  • the resulting cell size substantially limits the amount of entries per TCAM device in comparison with an SRAM.
  • the biggest TCAM for instance, SiberCore's SiberCAM Ultra-2M
  • the biggest TCAM implemented today incorporates 64 K IPv4 CIDR address entries without the associated data.
  • IP Lookups using Multiway and Multicolumn Search discloses a search method based on an interaction between a processing device and a memory, using binary search based algorithm for CIDR address searches. This method results in having a unique memory entry in which the result may reside. However, it offers a search performance, which varies as l ⁇ g 2 n , wherein n represents the number of entries. This is worse in performance than a Ternary CAM, which is insensitive to . the lookup table size. Furthermore, this implementation is unsuitable for high-performance routing, due to its lookup rate limitation.
  • RCM Range Content Addressable Memory
  • the present invention is directed to a method for arranging and storing, in a memory, associative ' key data set of associative elements and a corresponding associated data set of associated elements, where each associative element corresponds to a range of consecutive values, such that an associated element may be extracted from the memory as valid data if an associative key belongs to its associative element, the range may be represented by its lower and upper extreme values.
  • a memory device(s) is provided for storing the associative key data set and the associated data set that comprises a first and a second storage areas, so that to each storage location in the first storage area there is a corresponding storage location in the second storage area.
  • the associative elements of the key association data set and their corresponding associated data set are arranged in an order determined by priority precedence, such that associative elements having higher priority are placed before associative elements having lower priority.
  • a unique index is assigned for each associative element for representing its ordered location.
  • At least one of the extreme values of each associative element is stored in the first storage area in a location that corresponds to the priority of the associative element.
  • Each value of the associated data set is stored in a location in the second storage area that corresponds to the location of the associative element to which it is associated.
  • associated data values are extracted from the memory upon conducting a key search on the associative key data.
  • one or more associative elements that- may contain the input key are sought, and if no such associative element(s) is found, a mismatch signal is output, for indicating that the associated data that is output is invalid. If the input key is contained in one or more associative element(s), the associated data that corresponds to the associative element having the highest priority that contains the input key, and a match signal indicating that the associated data that is being output is valid, are output.
  • the lower and/or the upper extreme value of one or more ranges may be a non-negative value.
  • the associative elements of the key association data set may be ranges of consecutive . values having semi-open/semi-closed boundaries. Each range may have a closed boundary as its lower boundary, and an open boundary as its upper boundary, thereby defining a range of associative elements, each of which contains the value of its corresponding lower boundary and all its consecutive values, except for the value of its upper boundary. Alternatively, each range may have a closed boundary as its upper boundary, and an open boundary as its lower boundary, thereby defining a range of associative elements, each of which contains the value of its corresponding upper boundary and all its consecutive values, except for the value of its lower boundary.
  • the ranges that correspond to different associative elements may be non-overlapping.
  • the ranges that correspond to different associative elements are overlapping ranges, they are converted into one or more equivalent non-overlapping ranges.
  • Overlapping ranges are combined by truncating overlapping portions from ranges having lower priority, while maintaining with no change, for each set of overlapping portions, a single portion having the highest priority within the set, thereby obtaining an equivalent set of non-overlapping ranges.
  • the non-overlapping ranges of the equivalent set are arranged in a descending/ascending order, according to the boundary values of each of the ranges.
  • the second range is represented by the first range.
  • the second range element is removed from the associated key data set, and its associated data element is removed from the associated data set.
  • the second range is truncated to include the interval of values between its lower boundary and the lower boundary of the first range, thereby obtaining adjacent ranges having the same data association that corresponds to the first and the second ranges.
  • the second range is truncated to include the interval of values between its upper boundary and the upper boundary of the first range, thereby obtaining adjacent ranges having the same data association that corresponds to the first and the second ranges.
  • the second range is truncated into two smaller ranges, a first smaller range that includes the interval between the lower boundary of the second range and the lower boundary of the first range, and a second smaller range that includes the interval between the upper boundary of the first range and the upper boundary of the second range, thereby obtaining three adjacent ranges wherein the two smaller ranges have data association which is the same as the data association of the second range, while the first range and its data association remain unchanged.
  • This process is repeated for pairs of overlapping ranges as long as there is an overlap between more than two ranges, each time for the resulting ranges, until the last resulting ranges do not overlap.
  • associated data values are extracted from the memory upon conducting a key search on the associative key data.
  • one or more associative equivalent non-overlapping ranges that may contain the input key are sought, and if no such associative equivalent non-overlapping range(s) is found, a mismatch signal is output for indicating that the associated data that is being output is invalid. If the input key is contained in an associative equivalent non-overlapping range, the associated data that corresponds to that associative equivalent non-overlapping range is output, and a match signal indicating that the associated data that is being output is valid, is issued.
  • a match between an input key and an associative element is detected using a single comparison between the input key and the boundaries of equivalent non-overlapping ranges.
  • the key association data set is converted into an equivalent non-overlapping data set.
  • the boundary values of the equivalent non-overlapping data set are stored in ascending order in the first storage area.
  • Boundary type information is stored in a third storage area. The boundary type information indicates if a boundary is open or close, thereby having for each location in the first storage area a corresponding location in the third storage area.
  • the associated data set is stored in the second storage area in locations that correspond to the locations of closed boundaries of the equivalent non-overlapping data set stored in the first storage area.
  • a key match is detected by concurrently performing a single comparison operation between each boundary value stored in the first storage area and the input key, to determine whether the input key is larger than the boundary value.
  • a TRUE value is issued whenever a comparison result of the input key indicates that the input key is larger than the boundary value, otherwise, a FALSE value is issued.
  • a match is detected whenever a transition of the comparison results, from a TRUE value to a FALSE value, is obtained.
  • the index of the match being the index of the last boundary value for which a TRUE value has been obtained, is issued.
  • the boundary type information is retrieved from the third storage area that corresponds to the index, so that a match is obtained whenever the retrieved boundary type information indicates that the value with which the comparison operation was performed is a closed boundary value.
  • the index is used to fetch the associated data from the second storage area.
  • each associative element comprises two values, a first value which is the lower boundary of a range, and a second value which is an upper boundary of the range
  • a key match is detected by concurrently performing two comparison operations for every range in the key association data set, a first comparison to determine whether the input key is larger than, or equal to, the range's lower boundary, and a second comparison to determine whether the input key is smaller than the range's upper boundary.
  • a TRUE value is issued whenever the input key is larger than, or equal to, the range's lower boundary, and smaller than the range's upper boundary.
  • a match is indicated to each range, which yields a TRUE value, and the match with the highest priority is selected. The index of the match having the highest priority is issued and the associated data is retrieved by utilizing this index.
  • a validation signal which is utilized to validate a match indication, may be added to ignore search results in a desired location(s).
  • a value that belongs to a space consisting of one or more ranges may be represented by k bits
  • the open boundary of the space is represented by k+1 bits, such that a "0" logic value is assigned to k consecutive bits and a "1" logic value is assigned to the remaining bit.
  • Each value that does not belong to a range and is beyond the open boundary of the range may be represented by k+1 bits, such that a "0" logic value is assigned to k consecutive bits and a "1" logic value is assigned to the remaining bit.
  • the range may represent Classless Inter Domain Routing (CIDR) addresses.
  • CIDR Classless Inter Domain Routing
  • an input key search is performed simultaneously in one or more associative elements, or in one or more equivalent non-overlapping ranges that may contain the input key.
  • a match between an input key and a range is sought by arranging the ranges in their priority precedence order, comparing the input key with the values within each range, and obtaining one or more match indications whenever the input key belongs to one or more ranges.
  • the match indication corresponding to the range having the highest priority is selected.
  • the present invention is also directed to an apparatus for arranging and storing, in a memory, associative key data set of associative elements and a corresponding associated data set of associated elements, where each associative element corresponds to a range of consecutive values, such that an associated element may be extracted from the memory as valid data if an associative key belongs to its associative element.
  • the range may be represented by its lower and upper extreme values.
  • the apparatus comprises a memory device(s), for storing the associative key data set and the associated data set that comprises a first and a second storage areas, so that to each storage location in the first storage area there is a corresponding storage location in the second storage area in which the associative elements of the key association data set and their corresponding associated data set are arranged in an order determined by priority precedence, such that associative elements having higher priority are placed before those having lower priority; a unique index is assigned for each associative element, representing its ordered location; at least one of the extreme values of each associative element is stored in the first storage area in a location that corresponds to the priority of the associative element; and each value of the associated data set is stored in a location in the second storage area that corresponds to the location of the associative element, to which it is associated.
  • the apparatus may further comprise circuitry for extracting associated data values from the memory upon conducting a key search on the associative key data, including: a) circuitry for seeking one or more, associative elements that may contain a searched input key, upon receiving the input key; b) circuitry for outputting the associated data that corresponds to the associative element having the highest priority that contains the input key; and c) circuitry for outputting a mismatch signal, indicating that the associated data that is being output is invalid, if no such associative element(s) is found , and a match signal indicating that the associated data that is being output is valid, if the input key is contained in one or more associative element(s).
  • the lower and/or the upper extreme value of one or more ranges that are stored in the apparatus may be a non-negative value.
  • the associative elements of the key association data set may be ranges of consecutive values having semi-open/semi-closed boundaries. Each range that is stored in the apparatus may have a closed boundary as its lower boundary, and an open boundary as its upper boundary, or alternatively, a closed boundary as its upper boundary, and an open boundary as its lower boundary.
  • the ranges that correspond to different associative elements stored in the apparatus may be non-overlapping ranges.
  • Overlapping ranges that are stored in the apparatus may be converted into one or more equivalent non-overlapping ranges by combining overlapping ranges by truncating overlapping portions from ranges having lower priority, while maintaining with no change, for each set of overlapping portions, a single portion having the highest priority within the set and by arranging the non-overlapping ranges of the equivalent set in a descending/ascending order, according to the boundary values of each of the ranges.
  • the present invention is also directed to an apparatus in which associated data values may be extracted from the memory of the apparatus upon conducting a key search on the associative key data.
  • This apparatus may comprise: a) circuitry for seeking one or more associative equivalent non-overlapping ranges that may contain a searched input key, upon receiving the input key; b) circuitry for outputting the associated data that corresponds to the associative equivalent non-overlapping range that contains the input key; and c) circuitry for outputting a mismatch signal, indicating that the associated data that is being output is invalid, if no associative equivalent non-overlapping range is found and a match signal indicating that the associated data that is being output is valid, if the input key is contained in the associative equivalent non-overlapping range.
  • the present invention is also directed to an apparatus in which a match between an input key and an associative element is detected using a single comparison between the input key and the boundaries of equivalent non-overlapping ranges.
  • This apparatus may comprise: a) a first storage area for storing the boundary values of the equivalent non-overlapping data set in ascending order; ⁇ b) a second storage area for storing the associated data set in the locations that correspond to the locations of closed boundaries of the equivalent non-overlapping data set; c) a set of comparators for concurrently performing comparisons between each boundary value stored in the first storage area and the input key, to determine whether the input key is larger than the boundary value; d) circuitry for issuing a TRUE value whenever a comparison result with the input key indicates that the input key is larger than the boundary value, and for issuing a FALSE value if the input key is equal to or smaller than the boundary value; e) an encoder for detecting a match whenever there is a transition of the comparison results, from a TRUE value to a FALSE
  • each associative element comprises two values, a first value which is the lower boundary of a range, and a second value which is an upper boundary of the range.
  • This apparatus may comprise: a) an ordered set of storage and detection units for storing the upper and lower boundaries and for detecting a key match represented by issuing a TRUE value, by concurrently performing two comparison operations for the boundaries, a first comparison to determine whether the input key is larger than or equal to the range's lower boundary, and a second comparison to determine whether the input key is smaller than the range's upper boundary; b) circuitry for selecting the match with the highest priority, and for issuing the index of the match having the highest priority; and c) circuitry for outputting the associated data that corresponds to the index.
  • Each storage and detection unit may generate a validation flag for enabling/disabling a match detection.
  • Each value that belongs to a range may be represented in the apparatus by k bits, representing the open boundary of the range by k+1 bits, such that a "0" logic value is assigned to k consecutive bits and a "1" logic value is assigned to the remaining bit.
  • Each value that does not belong to a range and is beyond the open boundary of the range may be represented in the apparatus by k+1 bits, such that a "0" logic value is assigned to k consecutive bits and a "1" logic value is assigned to the remaining bit.
  • the range may represent Classless Inter Domain Routing (CIDR) addresses.
  • An input key search may be performed in the apparatus simultaneously in one or more associative elements that may contain the input key, or one or more equivalent non-overlapping ranges that may contain the input key.
  • the present invention is also directed to an apparatus for storing and outputting associative ranges and their associated data, and for seeking matching ranges that may contain a searched input key that comprises: a) an Entry list storage consisting of an ordered set of Range Word
  • RW read-only memory
  • each of which comprises: a.l) a first memory cell for storing the lower boundary of an associative range; a.2) a second memory cell for storing the upper boundary of the associative range; a.3) an input for inputting the searched input key; a.4) a validation flag input for indicating that the lower and upper boundaries are valid; a.5) an output for indicating a match whenever the validation flag input provides a valid indication, and the associative range comprises the searched input key; the RW devices are indexed according to their location, and the ranges that are stored in the RW devices are organized in a priority precedence order.
  • a priority encoder for detecting the match indication from an RW device with the highest priority, comprising: b.l) inputs for receiving the outputs of the Range Word devices; b.2) a first output for indicating a match; b.3) a second output for issuing the index of the matching RW device having the highest priority; c) a memory for storing the associated data from which the data associated with the highest priority range having a match is output, the memory comprising: cl) a set of memory cells for storing the associated data, each data item of the associated data being stored in a location corresponding to the RW device which stores the range values associated with the data item; c.2) an input of the second output of the priority encoder carrying the index of the match having the highest priority; and c.3) an output for outputting the data associated with the range having the highest priority match, by utilizing the input as a pointer to the location in which the associated data is stored.
  • the range value stored in the first memory cell in the apparatus may be a closed lower boundary, and the value stored in the second memory cell may be an open upper boundary.
  • the Range Word device comprises: a) a first comparator having a first input connected to the input of the searched input key, a second input connected to the first memory cell, and an output for issuing a TRUE indication whenever the value on the first input is smaller than the value on the second input; ⁇ b) a second comparator having a first input connected to the input of the searched input key, a second input connected to the second memory cell, and an output for issuing a TRUE indication whenever the value on the first input is smaller than the value on the second input; c) an inverter having an input connected to the output of the first comparator, and an output for outputting the inverted comparison result from the first comparator; d) a first AND gate having an input connected to the output of the inverter and another input connected to the output of the second comparator, the first AND gate outputs a TRUE indication whenever the searched key is smaller than the value stored in the second memory cell, and greater than or equal to the value stored in the first memory cell; and e) a second comparator having
  • the present invention is also directed to an apparatus in which overlapping ranges are converted into one or more equivalent non-overlapping ranges by combining overlapping ranges by truncating overlapping portions from ranges having lower priority, while maintaining with no change, for each set of overlapping portions, a single portion having the highest priority within the set and by arranging the equivalent non-overlapping ranges of the equivalent set in a descending/ascending order, according to the boundary values of each of the ranges, and each equivalent non-overlapping range has a closed boundary as its lower boundary and an open boundary as its upper boundary.
  • This apparatus may comprise: a) an Entry List storage device consisting of an ordered set of memory cells for storing entries, each being a value that represents at least one boundary value of a equivalent non-overlapping range and is indexed according to its relative location, the entry comprising a fe-bit value and the Entry List storage device comprising: a.1) an ordered set of boundary entries stored in the order of the equivalent non-overlapping ranges, wherein an index 1 is assigned to the first boundary value of the first equivalent non-overlapping range that is stored in the first memory cell, and the last boundary value, with index i, is stored in the i-th memory cell; a.2) zero values stored in all of the remaining memory cells that do not contain boundary values; ircuitry for detecting a match between a searched input key and an equivalent non-overlapping range, and for issuing the index of the matching equivalent non-overlapping range, comprising: b.l) a &-bit key input for inputting the searched input key; b.2) an input for inputting an Empty flag indication representing
  • each of which, except for the first comparator, comprises: b.4.1) a first input connected to a corresponding £-bit input; b.4.2) a second input connected to the &-bit key input; b.4.3) an output for outputting a TRUE indication whenever the value of the first input is smaller than the value of the second input, and a FALSE indication whenever the value of the first input is greater than the value of the second input; b.4.4) circuitry for producing a logic "1" whenever a zero value is obtained on the first input, such that zero values obtained on the first input are expanded in the comparators into a k+1 bit value having "1" at their most significant location, and zeros in all of the remaining locations; b.5) a first comparator that comprises: b.5.1) a first input connected to the first £-bit input; b.5.2) a second input connected to the &-bit key input; b:5.3) an output for outputting a TRUE indication whenever the value of the first input is smaller than the value
  • the Range Encoder may comprise: a) a set of ordered inputs for receiving the outputs of the set of ordered comparators; b) an input for receiving an Entry List Empty indication whenever the
  • Entry List storage device does not comprise associative data; c) a first output for outputting the index of the matching range value; d) a second output for outputting a unique indication whenever the searched input key is larger than any range value stored in the Entry List storage device; and e) an encoder for outputting the index of the matching range.
  • Fig. 1 graphically illustrates the meaning of a range according to the method of the invention
  • Fig. 2 graphically illustrates the process of searching for key match and for a Key Associated Data
  • Fig. 3 graphically illustrates the results of combining two ranges into an equivalent set of non-overlapping ranges
  • Fig. 4 graphically demonstrates the Non-overlapping Equivalent Range Set of the Overlapping Range Set illustrated in Fig. 2;
  • Fig. 5 graphically illustrates how a Key search is performed over a .
  • Fig. 6 schematically illustrates the RCAM's Range Word structure, key match detection, and generation of the match signal m according to a first embodiment of the invention
  • Fig. 7 schematically illustrates a Post-Processing Based RCAM comprised of an array of Range Words
  • Fig. 8 schematicall illustrates a preferred embodiment for a Pre-Processing Based RCAM according to the method of the invention.
  • Fig. 9 schematically illustrates a possible embodiment of a Range Encoder, according to a preferred embodiment of the invention.
  • Fig. 10 schematically illustrates overlapping of IPv4 CIDR addresses.
  • the present invention introduces a novel type of associative CAM device - a Range Content Addressable Memory (RCAM).
  • the RCAM combines the memory function with associative processing capabilities, and it is specifically designed to match an input key with a range of possible associative keys (integer values). More precisely, the R CAM yields a match indication if it determines that the key presented to it belongs to one of a predetermined set of value ranges. Therefore, it stores intervals of integer values, and unique data items (also integer values) associated with .each interval.
  • the present invention provides a method for implementing an RCAM device and demonstrates the usefulness of the range search approach. Before proceeding any further in the description of the present invention, some definitions and terms, as they appear hereinabove, are explained hereinbelow.
  • the range R denoted hy;R ⁇ [N L ,N H ) , wherein NH and Ni are integers such that NH > NL ⁇ 0, is a consecutive range of the integer numbers starting from ' NL and ending at NH.
  • the notation utilized for the lower boundary of the range R "[”, a square angled bracket, denotes a closed boundary, meaning that the range includes its lower bound, NL.
  • the upper boundary is an open boundary, and is denoted by a rounded bracket ")", meaning that the upper boundary is excluded, i.e., does not belong to the range R.
  • Fig. 1 graphically illustrates the meaning of a range in accordance with the range definition given hereinabove.
  • the range R ⁇ [N L ,N H ) , 101 is depicted as a semi-closed/semi-opened interval on the integer number axis 100 (positive and negative numbers comply with the range definition).
  • the range's lower boundary is NL
  • the range's higher boundary is NH.
  • N L e R namely, the range's lower boundary, belongs to the range (i.e., it is a part of the range).
  • N H £ R that is, the range's high boundary, does not belong to the range.
  • the range as defined herein is a Semi-closed/Semi-opened interval of integers.
  • range definition hereinabove has been selected, since it implies significant savings in the RCAM implementation, and eliminates multiple matches on Search operation, as will be demonstrated herein.
  • range definition which is also Semi-opened/Semi- Closed interval, but in which the open boundary is on the left-hand side, and the closed boundary is on the right-hand side.
  • the space ⁇ designates the space of all possible &-bit integer values (the integer values 0 ⁇ - 2* - 1 ).
  • any integer value K e ⁇ has a binary representation consisting of a finite and constant number of bits k, K ⁇ ⁇ a k _ x , a k _ 2 ⁇ ...,a i ,...a ,a ⁇ ) 2 , such that ⁇ ( . e ⁇ 0,l ⁇ (0 ⁇ / ⁇ A) .
  • the entire space comprises all integer values K such that - (o,o,.:.,o) 2 ⁇ jc ⁇ (i, ⁇ ,...,i) 2
  • N i (0,0,...,0) 2
  • N H (1,0,0,...,0) 2 .
  • Ranges R a and Rfr are called Overlapping Ranges if there is an integer K such that K ⁇ R a and.tr e R b .
  • the set of Associated Data ⁇ D ⁇ d ⁇ ,d2,...,di,...,d n ⁇ (a set of n integer values), wherein both of the sets are arranged in their priority order, that is, Ri is higher in priority than Rj if i ⁇ j, and given an integer value K, such that,
  • the set of ranges d ⁇ R ⁇ ,R2,...,Ri,...,Rn ⁇ will be referred to hereinafter as the Associative Range Set, and the set D ⁇ d ⁇ ,d2,...,di,...,d n ⁇ as the Associated Data Set.
  • the integer K will be referred to hereinafter as the Key, used to search and select a single element from the Associated Data Set ⁇ .
  • the function is defined as an Associative Function, which maps 5R, D, and f into a (d,m) pair in the following way,
  • i is the highest priority index (or the lowest index value) of all the matching Ranges, as defined hereinabove, and d is an integer value, d ⁇ O, which will be also referred to hereinafter as the Key Associated Data.
  • the variable m is a Boolean variable (may equal either a "1" or "0" value), and which will be referred to hereinafter as the Key Match value.
  • the Associative Function, Associative Range Set, Associated Data Set, and their priority-based ordering, which are defined hereinabove, facilitate the acquisition of a consistent result, for each Key search.
  • the searching for the Associated Data of a certain integer K comprises the following steps -
  • Step 1 Find the index i of the highest priority K- Matching Range.
  • Step 2 Use this index to access the Associated Data (The Associated Data is the i-th element in the Associated Data Set). More particularly, the method for searching for a Key Associated Data comprises the steps shown in the flow chart below:
  • each range R q and its corresponding data item d q are illustrated in an ordered sequence according to their precedence priority.
  • Each of the ranges is depicted in the following form R q l ' d q (1 ⁇ q ⁇ n) , on the integer number axis numbered from 1 to n.
  • the Key K is searched simultaneously in each and every range -
  • Each range, R q has its unique data item associated with d q (illustrated by
  • This process is performed on each and every range, from the set of ordered ranges R ⁇ ,R 2 ,R 3 ,R 4 ,..., R M , R t , R M , R i+2 ,..., RNase_ 3 , R n _ 2 , R n _ , R lake (wherein l ⁇ 2 ⁇ 3 ⁇ 4 ⁇ ... ⁇ z-l ⁇ t ⁇ t + l ⁇ z + 2 ⁇ ... ⁇ «-3 ⁇ rc-2 ⁇ n-l ⁇ n), such that the result of the highest priority match (i.e., the range to which there is a match having the smallest index) is then selected to retrieve the corresponding Associated Data.
  • the result of the highest priority match i.e., the range to which there is a match having the smallest index
  • a match is detected (m ⁇ -'l") for q-i,n-3, and n (K e R,-,R n _ 3 ,R n ).
  • the highest priorit match is the match with the range R. (i ⁇ n-3 ⁇ n).
  • Post-Processing is required to determine which one of the many possible corresponding Associated Data values ought to be selected on the ranges' priority basis.
  • the basic concept behind the method of the invention is that overlapping ranges can be combined prior to performing a search on the basis of the Ranges priority.
  • the original overlapping Range Set 5R can be traded for an equivalent non-overlapping Range Set ⁇ ⁇ ⁇ p l ,p 2 ,...,p v ⁇ which yields consistently the same Associated
  • Range Set having the following features:
  • Non-O ⁇ erlaOOins Equivalent Range Set For any p i , and p ⁇ (i ⁇ j), there is no integer K simultaneously belonging to the two ranges. That is, K e p. ⁇ K ⁇ . p , i ⁇ j , so that K is found in a single non-overlapping range. Therefore, the notion of priority in the context of Non-overlapping Equivalent Range Set becomes dispensable.
  • Non-O ⁇ erlaOOins Equivalent Range Set :
  • the equivalent set of ranges 17 is defined as a Non-Overlapping Equivalent Range Set of an Overlapping Range Set 5R .
  • the number of Range elements in ⁇ , v is smaller than, or equal to n+1 (v ⁇ n + 1) , wherein n is the number of ranges in 5R .
  • the combination of two overlapping Ranges is performed as follows:
  • R a N L a , N H ) with an Associated Data.
  • R b [N ,N H b ) with an Associated Data db
  • [N H " ,N H b )l d b is a new incarnation of Rb, but one in which the lower boundary is adjusted in order to maintain the completeness of Ra (i.e., the lower boundary of this new range is taken to be the upper boundary of range R a , N H a ).
  • Rb is of low priority, it completely vanishes in this case. More particularly, a range with low priority has no existence within a range of higher priority, as in this case, so that the result of combining ranges the Ra and Rb, is R a I d a , i.e., a single range having the boundaries and the associated data of R a .
  • is an empty Range, that is Kg ⁇ , for any integer K).
  • R b ⁇ z.
  • R ⁇ (i.e., cases 1, 2, or 3) the new boundaries [N L b ,N L a )l d b ⁇ and/or
  • Range operations are distinct in the sense that in addition to the operand " " result being dependent on value of the basic elements, it also modifies the range boundaries.
  • the relative position of the boundary values on the integer number axis determines which of the results might hold. Over all, there are five different possible results when two ranges are combined.
  • Fig. 3 demonstrates graphically the possible results of the " " operation, performed on two Ranges.
  • Fig. 3. illustrates five distinct cases, Fig. 3(a) through Fig.. 3(e), which describe different possibilities for range interaction.
  • Fig. 3(a) illustrates non-overlapping of the ranges R a and Rb (R a R b - ⁇ )
  • Figs. 3(b) through 3(e) correspond to the four cases that were described before (cases 1, 2, 3, and 4).
  • the original ranges Ra and Rb are depicted on the left-hand side of each drawing, and the result of the " " operation in between the two ranges is depicted on the right-hand side of each drawing.
  • Ra assumes a higher priority than Rb (that is a ⁇ b).
  • Fig 3(a) demonstrates a case in which the "y " operation results in R a and
  • FIG. 3(e) illustrates case 4, hereinabove, wherein Rb is completely contained in Ra (R a n R b - R b ) , and which results in R a being unmodified and Rb being eliminated.
  • R a remains unmodified (cases 1,2 and 3 respectively), Rb disappears, and one or two ranges are created as a result from the " " operation in between R a and Rb.
  • Adjacent Ranges are obtained.
  • Adjacent Ranges are of great importance, since they potentially enable a compact way of representing ranges which results in significant saving in storage space. It should be understood that in Figs. 3(b), 3(c) and (d) the shared boundaries of the Adjacent Ranges are marked twice, once for being the open boundary of a left-hand Range, and once for being a closed boundary for the right-hand range.
  • N 2 , N 3 , ... , N._, , N ( . , N +1 , ... , N ? _ j , N q are the shared boundaries of the Adjacent
  • Adjacent Range Set having the compact representation [N ,...,N A ) , wherein 2 ⁇ n ⁇ 4.
  • any Range [r,.,r +1 ), in an equivalent non-overlapping range set, has an associated data ⁇ 5. .
  • ⁇ ⁇ ⁇ ⁇ » ⁇ 2 .-, ⁇ I +2 , ⁇ p+3 ,..., ⁇ q ⁇ ,..., ⁇ s , ⁇ s+1 ,..., ⁇ , ⁇
  • ⁇ h d k for l ⁇ h,ij,k ⁇ n.
  • Fig. 4 depicts the Non-overlapping Equivalent Range Set, which corresponds to the Overlapping Range Set depicted in Fig. 2.
  • This Non-overlapping Equivalent Range Set results from utilizing the "u " operator and the Commutative and the Associative laws on the Overlapping Range Set (as was described hereinabove).
  • the generation of Non-overlapping Equivalent Range Set assumes that either there are no additional Overlapping Ranges except for the depicted ones, or that all the additional overlapping ranges are contained in higher priority ranges.
  • the number of boundary points in the Non-overlapping Equivalent Range is significantly smaller than the sum of all the boundaries of the depicted ranges. Additionally, each one of these boundary points belongs to one or more of the Overlapping Range boundaries.
  • Fig. 5 demonstrates how a Key search is performed over a Non-overlapping Equivalent Range Set and its Associated Data. Three different situations for a possible search are depicted:
  • the boundary T x is the left boundary of the leftmost Range,
  • the integer "0" must be denoted as an Open Boundary. This assures that searching for a Key in the interval )0,r j ] will yield a Mismatch.
  • RCAM implementations are disclosed, according to preferred embodiments of the invention.
  • the preferred embodiments of the invention consist of one implementation which is based on a Post-Processing RCAM, and another implementation based on a Pre-Processing RCAM.
  • FIG. 6 schematically illustrates the RCAM Range Word structure, key match detection, and generation of the match signal m 610.
  • Each word contains 2k bits of Range Data, which consists of the ⁇ -bit boundary NL 601, and the &-bit boundary NH 602.
  • the value of the searched key is introduced on 603 (a /Vbit integer).
  • Two comparison operations are performed on the searched Key value 603, one with NL and the _second with NH, utilizing two separate "Greater than” (Gt) Comparators, 604 and 605 respectively.
  • Each of the comparators, 604 and 605 has two inputs, Ini and Iu2, and one output Gt which produces a "True" signal (typically, logic "1") whenever In ⁇ In2.
  • the Comparator 605 receives the value of the searched key K (on 603) on its Inl input and the value of NH (from 602) on its In2 input. Therefore, Comparator 605 produces on its Gt output a "True" signal, when K ⁇ N H .
  • Comparator 604 also receives the value of the searched key K (on 603) on its Inl input, but its In2 input is fed by the value of NL (from 601). Hence, a "True” value is produced on the Gt output of 604 whenever K ⁇ N L . This result (of 604) should now . be inverted to yield a "True” value whenever K ⁇ N L , as required. Therefore, the inverter 606 is connected to the Gt output of the comparator 604, such that a "True” value is obtained on the output of 606 whenever K ⁇ N L .
  • the AND gate 607 combines these results to yield a "True" value whenever N L ⁇ K ⁇ N H . This . is obtained by connecting one of its inputs to the output of the inverter 606 (which is responsible for a K ⁇ N L indication), and connecting its other input to the Gt output of the comparator 605 (which the provides K ⁇ N H indication).
  • Fig. 7 schematically illustrates an RCAM which incorporates an array of
  • Range Words each of which may be constructed, as illustrated in Fig.
  • the RCAM's entry list is comprised of the RWs -
  • This Index output serves as an address to the Associated Data memory 704, which incorporates the Associated Data List a x ,a 2 ,a 3 ,a 4 ..., a t _ , a i , ct 1+ , i+2 ,..., a j _ 2 , a j _ x , ., a j+x ,... ,a n _ ,a n .
  • the Associated Data memory 704 receives the index i, from the Priority Encoder 701, on 703 and fetches its i-th word containing the Associated Data d i , which is then provided on the ⁇ -bit output 705.
  • the Associated Data may be embedded in the same device or may be located in a separate device.
  • the match indication is provided on another output, 702, of the Priority Encoder 701. Additional logic inside the Priority Encoder 701 is utilized to calculate a Match, which is simply obtained by the computation of
  • the Priority Encoder's resolution time is proportional to the number of RWs. This time might be substantial for huge RCAMs, thus slowing down the RCAM performance. This effect can be reduced at the cost of a more complicated Priority Encoder.
  • the RW structure is bulky and space-consuming. Therefore, it is not yielding to the implementation of RCAMs that are large in size.
  • preprocessing is performed over the Overlapping Range Set of the RCAM device. This preprocessing results in a Non-overlapping Range Set.
  • the information related to the Non-overlapping Equivalent Range Set and its Associated Data is stored in the RCAM device.
  • Fig. 8 schematically illustrates a preferred embodiment for a Pre-Processing Based RCAM according to the method of the invention.
  • the Non-overlapping Equivalent Range Set boundaries are stored sequentially in the RCAM device.
  • gaps are not allowed to be present in between the stored boundaries.
  • a contiguous storage space in the RCAM is occupied.
  • the entry list 800 of the Pre-Processing Based RCAM (which may comprise up to n entries), consists of the t+1 entries
  • the boundaries issued by the invalid block r, +2 ,...,r belong are all of ( ⁇ ,0,..., ⁇ ) 2 value, since these entries contain no valid boundaries.
  • the boundary values T x ,r 2 ,...,T n drive inputs of the Range Locator block 801.
  • the entries in the vahd block are arranged in an ordered manner, such that - r, ⁇ ⁇ 2 ⁇ 3 ⁇ ⁇ 4 ⁇ ... ⁇ ,._ 2 ⁇ M ⁇ ; ⁇ ⁇ ,. +1 ⁇ ... ⁇ , ⁇ ⁇ , +I , wherein Entry M is the last vahd boundary entry.
  • the Empty Flag 810 is utilized to indicate that the Entry List is empty, which is the state in which its value is "1".
  • the invalid entries are loaded with ( ⁇ ,0,..., ⁇ ) 2 values, which may be used only as the open lower boundary of the range with the highest priority, as explained hereinbefore. Since in any other entry than Entry x , ( ⁇ ,0,..., ⁇ ) 2 is not a valid Entry, it is not interpreted as the /2-bit ( ⁇ ,0,..., ⁇ ) 2 value if it appears in any of the other entries Entry 2 ,..., Entry n . More precisely, the occurrence of the ( ⁇ ,0,..., ⁇ ) 2 value in any of the entries Entry '-,..., Entry n is now interpreted as the k+1 bit value (l,0,0,..., ⁇ ) 2 .
  • the Gt outputs drive the inputs of the Range Encoder 802 which detects the transitional point i at which the Gt signals drop from "1" to "0". As is depicted in Fig. 8, and with accordance to the example above, this transition occurs between the i-th and the i+1 Gt outputs (since T ( ⁇ K ⁇ r. +1 ).
  • the Range Encoder 802 detects this transition, and issues a -bit binary encoded Index signal, which carries the value of i, on 805.
  • transition detection logic 900 is comprised of an ordered set of n AND gates A x ,A 2 ,A 3 ,A 4 ,...,A n , each of which receives the corresponding Gt output of a comparator in one of it inputs, such that the AND gate A) receives the Gt output of the comparator which compares the key if with the boundary value T,..
  • each AND gate receives the inverse value of the Gt output of the next comparator in order.
  • the other input of A i receives the inverted result of the comparison of the searched key if with the value of the boundary r /+1 .
  • the output of each and every AND gate is "0", except for the i-th AND gate, A and this is precisely where the transition of the Gt outputs occurs.
  • the second input (the inverted input) of the last AND gate in the transition detection logic 900, A n receives a constant "0" value. This serves to produce the "Key is greater than any stored boundary” indication, when all of the Range Encoder's inputs set to "1", and thus the AND gate A n will detect a transition. This indication is utilized to enable/disable an output from the Boundary Type List 803, as will be explained hereinafter.
  • the Range Encoder output 805 is a g-bit wide bus, wherein 2 • n > 2 ⁇ > n .
  • the AND gate 806 receives the inverted value of the q-t line 812 in one of its inputs and the resulting boundary type m : in its other input.
  • the value of the g-th line enables or disables the output of a Match indication. In all the other cases, where the value of the q-th. line signal is "0", the resulting Match output is
  • the Index is used as an address to the Associated Data List, and to the Associated Boundary List.
  • the Associated Boundary Type List 803 is 1-bit wide, and it comprises m p values. if T p Closed — Boundary if r Opened - Boundary
  • Associated Data List that is, the data stored in the i-th location, ⁇ i .
  • the Associated-Data List may be stored on the same device or may be stored on a different device than that of the RCAM Entry List 800.
  • the hereinabove RCAM structure requires Pre-Processing.
  • the boundary entries must be stored in a sequential order. It requires half the number of storage bits, and half the number of comparators per entry. Therefore, it ' significantly reduces hardware costs, and improves storage arid performance efficiency as compared to the embodiment of the , Post-Processing RCAM that was described hereinabove. Additionally, since the result (if there is any) resides always in the context of two entries (e.g., r. ⁇ K ⁇ r. +l ) and two comparators only, reception of the Index is almost instantaneous without any propagation as required for the Post-Processing RCAM.
  • IPv4 Internet Protocol Version 4, the currently used Internet version
  • addresses are of 32 bits. These 32-bit values are typically represented as four decimal values separated by a full stop, each representing an 8-bit binary number (octets).
  • IPv4- CIDR address is represented in the following form - Alp, wherein A is the IPv4 address and p is the prefix, i.e., the number of contiguously compared most significant bits from left to right (0 p ⁇ 32).
  • the prefix is equivalent to a 32-bit mask wherein the number of "l”s equals p, and wherein those p “l”s are followed by 32-p “0"s.
  • the zeroed part of the mask indicates that this part of the address bits should be ignored, when comparing the value of a CIDR address with an address.
  • IPv4-CIDR address representation is then 198.32.0.0/13.
  • IPv4 CIDR addresses can be represented as Ranges using the following formula - A I p ⁇ [A, A + 2X ⁇ P ) .
  • each Alp IPv4 CIDR Address Range interval contains 2 32 ⁇ p integers.
  • IPv4 CIDR addresses are always convertible to Ranges. However, this is not the case in the opposite direction (i.e., when converting any given Range into an IPv4 CIDR address).
  • the Range according to the method of the invention, has an
  • a single Range may represent one or more IPv4 CIDR addresses. It can be easily shown that any two IPv4 CIDR Address Ranges, Al p and A 2 /p, A X ⁇ A 2 having the same prefix p, are always Non-overlapping Ranges. Therefore, for any address A if AeAlp and A X ⁇ A 2 , then essentially A&A 2 /p, and vice versa.
  • a X ⁇ A 2 or A 2 ⁇ A +2 32 - p - 1 .
  • IPv4 CIDR addresses are demonstrated in Fig.10.-
  • p 2 p x +1
  • a x I p x is a bigger range
  • a 2 /p 2 is a smaller range.
  • There may be one of two cases, as illustrated in Fig.10. In one case, 1002, the ranges have the same CIDR addresses A x A 2 , while in the other case the CIDR addresses are different A x ⁇ A 2 , 1003.
  • Fig. 10 also illustrates the Equivalent non-Overlapping Range Set for each case.
  • 1004 and 1005 two adjacent non-overlapping range sets are obtained.
  • a 2 1 p 2 is the range with the longer prefix (and thus with higher priority)
  • a 2 /p z remains untouched, while from .
  • a l p x only the right-hand side half remains.
  • a 2 /p 2 remains untouched while from A x I p x only the left-hand side half remains.
  • IPv4 CIDR Address Range priorities can be assigned in the order of their prefix length, that is, the longer the prefix, the higher the priority.
  • IPv4 CIDR Address Ranges are assigned one of 32 possible priorities, such that there can be different IPv4 CIDR Address Ranges which are assigned the same priority (or have the same prefix length). This is, however, of no consequence, as previously explained herein, since IPv4 CIDR Address Ranges having the same prefix value are always non-overlapping.
  • each IPv4 CIDR address must be converted to a Range, using the formula Alp ⁇ [A, A + 2 32 ⁇ p ) wherein A ⁇ a ⁇ 2 32 ⁇ p as was described hereinbefore. Any further steps depend on whether the Post-Processing or the Pre-Processing method is used.
  • the IPv4 CIDR Address Range entries are ordered according to their prefix-length (which reflects their priority), first, the ones with a prefix-length of 32, followed by those with a prefix-length of 31, and of 30,..., and finally those with prefix-length of 0 at the bottom.
  • the Zero prefix-length is defined as a Default Search Result, and applies if no higher priority Match exists,- and therefore only a single zero prefix length entry is meaningful.

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Method and apparatus for arranging and storing in a memory associative key data set of associative elements and a corresponding associated data set of associated elements, wherein each associative element corresponds to a range of consecutive values, such that an associated element may be extracted from the memory as valid data if an associative key belongs to its associative element, the range being represented by its lower and upper extreme values. A memory device(s) is provided for storing the associative key data set and the associated data set that comprises first and second storage areas, so that to each storage location in the first storage area there is a corresponding storage location in the second storage area. The associative elements of the key association data set and their corresponding associated data set are arranged in an order determined by priority precedence, such that associative elements having higher priority are placed before associative elements having lower priority. A unique index is assigned for each associative element for representing its ordered location. At least one of the extreme values of each associative element is stored in the first storage area in a location that corresponds to the priority of the associative element. Each value of the associated data set is stored in a location in the second storage area that corresponds to the location of the associative element to which it is associated. Associated data values are extracted from the memory upon conducting a key search on the associative key data. Upon receiving an input key, one or more associative elements that may contain the input key are sought, and if no such associative element(s) is found, a mismatch signal is output to indicate that the associated data that is output is invalid. If the input key is contained in one or more associative element(s), the associated data that corresponds to the associative element having the highest priority that contains the input key and a match signal indicating that the associated data that is being output is valid, are output.

Description

RANGE CONTENT-ADDRESSABLE MEMORY
Field of the Invention
The present invention relates to the field of Content Addressable Memory (CAM). More particularly, the invention relates to a method and apparatus for storing associative ranges containing keys and data associated with said ranges, in the form of a lookup table, in which a searched associative key found within a range is used to extract the associated data.
Background of the Invention
Content Addressable Memory (CAM) devices are specially designed for storing information in the form of a lookup table. CAM structures allow a direct and fast search of data items, which is based on an associative key. Software implementations of such data structures are usually slow for real time applications, especially in view of the great advances in recent years in data transmission rates.
In general, CAM comprises storage of key words, and a separate storage for associated data items. For each of the stored key words, there is a corresponding associated data item. Therefore, the structure and operation of CAMs differs from those of conventional memory devices, such as RAM, wherein each data item is addressed by utilizing a unique address. In CAMs, data items are fetched from the CAM device by submitting a key value. The key words storage is then searched to determine if a matching key word is stored inside the CAM. If there is a key-matching entry found in the CAM, a 'match' indication is issued, and the corresponding associated data (i.e., the data item associated with the key) is output from the CAM. If there is no matching key, a 'mismatch' indication is issued. The efficiency and high speed, inherent to the CAM implementations, makes them very attractive for address filtering and routing in networking applications. The Internet routers, for instance, maintain a list of Internet Protocol (IP) Destination Addresses (IPDAs), and their associated interfaces (e.g., port numbers) through which the router should forward the received packet. This list is-utilized to determine the best route for a packet of information received by the router to reach its destination. More particularly, said list of IPDAs and the interfaces is organized in the form of a lookup table. The key word associated with each IPDA, is the router interface of the destined network node (i.e., the next routing point, to which the received packet is destined).
Each IPDA is a unique 32-bit entity, usually represented in the form of four octets (sequences of eight bits, e.g., 192.30.50.0), comprising address information of the destined node within that network.
The original IP network classification method, utilizing five basic Classes for any network on the Internet, turned out to be very expansive in terms of IPDA address space consumption, and in terms of the routing table size, required for forwarding lookups. As a consequence, the Internet ran out of address space very quickly. This has also led to an outstanding growth in the size of the routers' lookup tables.
In order to overcome the problems described hereinabove, the Internet Engineering Task Force (IETF) devised a more flexible method (as described in RFC1519), known as the Classless Inter-Domain Routing (CIDR). The CIDR resolves the difficulties stemming from the original network Address-Class hierarchy by aggregating multiple routes into a single representation. Address aggregation is achieved by masking a contiguous number of address 32-p least significant bits, which leads to a representation of a range of addresses by a single address and its mask. This leaves p bits also defined as the address prefix, p can be any integer value from 0 to 32. The convention used to describe a CIDR address entry is A/p, wherein A is the address and p is the prefix. For example, the CIDR address entry 192.30.50.0/24 matches any IPDA address in the range 192.30.50.0 <-» 192.30.50.255.
Generally, a CIDR address may match with a multiple number of entries in the router's key list, this due to the presence of overlapping address ranges. Selection of one out of multiple matches is based upon the most specific match, which is the one with the longest prefix.
The CIDR addressing scheme allows a more efficient allocation of IP addresses, which results in a significant reduction in the size of the routing table, yet the growth of the Internet is seems to be increasing with time, and the difficulties stemming from this growth in routing table size still remain.
The modern routers are now designed for CIDR compliance. Ternary CAM technology is widely adopted in routers implementation, but the substantial growth in the size of routing tables, and the many comparison operations required in determining a key match, influence performance and power consumption. Other complications in Ternary CAM (TCAM) implementations are due to the complexity involved in determining the key match to a range of possible values, and especially utilizing CIDR's longest-prefix-match policy. The conventional CAM implementations are efficiently designed for lookup tables when an exact match of key values is required, but the situation is more complex when a range of values need to be matched. Moreover, the aggregation efficiency is greatly influenced by the allocated address space, which in many cases is not covered by a single mask prefix, resulting in a substantial increase of routing table's sizes.
In addition, Ternary CAMs are limited with respect to the range boundaries, which are limited only to integer values being a • 232~p , wherein a is an integer, and p is the prefix length. Therefore, the boundary values do not represent the whole range of non-negative integer values. This eliminates the capability of further aggregation over and beyond that offered by the CIDR method.
Since multiple matches are feasible, all the entries must be simultaneously compared to a key, which stems in a high power consumption that grows proportionally to the number of entries and with the lookup rate. For instance, a typical 64 Ternary CAM consumes about 10 Watts at a rate of 66 million lookups per second.
Due to the requirement to arrange Ternary CAM entries in prefix-length order, the database update may become cumbersome and lengthy in time.
Ternary CAM's basic cell is complex, since it incorporates the address, the mask and the comparator. The resulting cell size substantially limits the amount of entries per TCAM device in comparison with an SRAM. The biggest TCAM (for instance, SiberCore's SiberCAM Ultra-2M) implemented today incorporates 64 K IPv4 CIDR address entries without the associated data.
"IP Lookups using Multiway and Multicolumn Search", B. Lampson et al, Proceedings of IEEE Infocom, Volume 3, April 1998, pages 1248-1256, discloses a search method based on an interaction between a processing device and a memory, using binary search based algorithm for CIDR address searches. This method results in having a unique memory entry in which the result may reside. However, it offers a search performance, which varies as lθg2 n , wherein n represents the number of entries. This is worse in performance than a Ternary CAM, which is insensitive to . the lookup table size. Furthermore, this implementation is unsuitable for high-performance routing, due to its lookup rate limitation.
All the methods described above have not yet provided satisfactory solutions to the problem of efficient storage of associative data in lookup tables, and which might result in low power consumption and in high search performance.
It is an object of the present invention to provide a Range Content Addressable Memory (RCAM) capable of Searching whether a submitted key belongs to a range bounded by two non-negative integers, that has a common associated data.
It is another object of the present invention to provide an RCAM for storing and searching associative data items related to disjoined and/or overlapping ranges.
It is another object of the present invention to provide an RCAM which allows efficient associative data aggregation, using less storage space.
It is a further object of the present invention to provide an RCAM in which the power consumption does not grow in proportion with the amount of data entries stored and searched. It is still another object of the present invention to provide an RCAM in which the associating keys are represented in an efficient form.
Other objects and advantages of the invention will become apparent as the description proceeds.
Summary of the Invention
The present invention is directed to a method for arranging and storing, in a memory, associative ' key data set of associative elements and a corresponding associated data set of associated elements, where each associative element corresponds to a range of consecutive values, such that an associated element may be extracted from the memory as valid data if an associative key belongs to its associative element, the range may be represented by its lower and upper extreme values. A memory device(s) is provided for storing the associative key data set and the associated data set that comprises a first and a second storage areas, so that to each storage location in the first storage area there is a corresponding storage location in the second storage area. The associative elements of the key association data set and their corresponding associated data set are arranged in an order determined by priority precedence, such that associative elements having higher priority are placed before associative elements having lower priority. A unique index is assigned for each associative element for representing its ordered location. At least one of the extreme values of each associative element is stored in the first storage area in a location that corresponds to the priority of the associative element. Each value of the associated data set is stored in a location in the second storage area that corresponds to the location of the associative element to which it is associated. Preferably, associated data values are extracted from the memory upon conducting a key search on the associative key data. Upon receivin an input key, one or more associative elements that- may contain the input key are sought, and if no such associative element(s) is found, a mismatch signal is output, for indicating that the associated data that is output is invalid. If the input key is contained in one or more associative element(s), the associated data that corresponds to the associative element having the highest priority that contains the input key, and a match signal indicating that the associated data that is being output is valid, are output.
The lower and/or the upper extreme value of one or more ranges may be a non-negative value. The associative elements of the key association data set may be ranges of consecutive . values having semi-open/semi-closed boundaries. Each range may have a closed boundary as its lower boundary, and an open boundary as its upper boundary, thereby defining a range of associative elements, each of which contains the value of its corresponding lower boundary and all its consecutive values, except for the value of its upper boundary. Alternatively, each range may have a closed boundary as its upper boundary, and an open boundary as its lower boundary, thereby defining a range of associative elements, each of which contains the value of its corresponding upper boundary and all its consecutive values, except for the value of its lower boundary. The ranges that correspond to different associative elements may be non-overlapping.
Preferably, whenever the ranges that correspond to different associative elements are overlapping ranges, they are converted into one or more equivalent non-overlapping ranges. Overlapping ranges are combined by truncating overlapping portions from ranges having lower priority, while maintaining with no change, for each set of overlapping portions, a single portion having the highest priority within the set, thereby obtaining an equivalent set of non-overlapping ranges. The non-overlapping ranges of the equivalent set are arranged in a descending/ascending order, according to the boundary values of each of the ranges.
Preferably, whenever a first range contains both the upper and the lower boundaries of a second range with lower priority, the second range is represented by the first range. The second range element is removed from the associated key data set, and its associated data element is removed from the associated data set. Whenever a first range contains only the upper boundary of a second range with lower priority, the second range is truncated to include the interval of values between its lower boundary and the lower boundary of the first range, thereby obtaining adjacent ranges having the same data association that corresponds to the first and the second ranges. Whenever a first range contains only the lower boundary of a second range with lower priority, the second range is truncated to include the interval of values between its upper boundary and the upper boundary of the first range, thereby obtaining adjacent ranges having the same data association that corresponds to the first and the second ranges. Whenever both the upper and the lower boundaries of a first range are contained in a second range with lower priority,, the second range is truncated into two smaller ranges, a first smaller range that includes the interval between the lower boundary of the second range and the lower boundary of the first range, and a second smaller range that includes the interval between the upper boundary of the first range and the upper boundary of the second range, thereby obtaining three adjacent ranges wherein the two smaller ranges have data association which is the same as the data association of the second range, while the first range and its data association remain unchanged. This process is repeated for pairs of overlapping ranges as long as there is an overlap between more than two ranges, each time for the resulting ranges, until the last resulting ranges do not overlap.
Preferably, associated data values are extracted from the memory upon conducting a key search on the associative key data. Upon receiving an input key, one or more associative equivalent non-overlapping ranges that may contain the input key are sought, and if no such associative equivalent non-overlapping range(s) is found, a mismatch signal is output for indicating that the associated data that is being output is invalid. If the input key is contained in an associative equivalent non-overlapping range, the associated data that corresponds to that associative equivalent non-overlapping range is output, and a match signal indicating that the associated data that is being output is valid, is issued.
Preferably, a match between an input key and an associative element is detected using a single comparison between the input key and the boundaries of equivalent non-overlapping ranges. The key association data set is converted into an equivalent non-overlapping data set. The boundary values of the equivalent non-overlapping data set are stored in ascending order in the first storage area. Boundary type information is stored in a third storage area. The boundary type information indicates if a boundary is open or close, thereby having for each location in the first storage area a corresponding location in the third storage area. The associated data set is stored in the second storage area in locations that correspond to the locations of closed boundaries of the equivalent non-overlapping data set stored in the first storage area. A key match is detected by concurrently performing a single comparison operation between each boundary value stored in the first storage area and the input key, to determine whether the input key is larger than the boundary value. A TRUE value is issued whenever a comparison result of the input key indicates that the input key is larger than the boundary value, otherwise, a FALSE value is issued. A match is detected whenever a transition of the comparison results, from a TRUE value to a FALSE value, is obtained. The index of the match, being the index of the last boundary value for which a TRUE value has been obtained, is issued. The boundary type information is retrieved from the third storage area that corresponds to the index, so that a match is obtained whenever the retrieved boundary type information indicates that the value with which the comparison operation was performed is a closed boundary value. The index is used to fetch the associated data from the second storage area.
Whenever each associative element comprises two values, a first value which is the lower boundary of a range, and a second value which is an upper boundary of the range, a key match is detected by concurrently performing two comparison operations for every range in the key association data set, a first comparison to determine whether the input key is larger than, or equal to, the range's lower boundary, and a second comparison to determine whether the input key is smaller than the range's upper boundary. A TRUE value is issued whenever the input key is larger than, or equal to, the range's lower boundary, and smaller than the range's upper boundary. A match is indicated to each range, which yields a TRUE value, and the match with the highest priority is selected. The index of the match having the highest priority is issued and the associated data is retrieved by utilizing this index. A validation signal, which is utilized to validate a match indication, may be added to ignore search results in a desired location(s).
Whenever a value that belongs to a space consisting of one or more ranges may be represented by k bits, the open boundary of the space is represented by k+1 bits, such that a "0" logic value is assigned to k consecutive bits and a "1" logic value is assigned to the remaining bit. Each value that does not belong to a range and is beyond the open boundary of the range may be represented by k+1 bits, such that a "0" logic value is assigned to k consecutive bits and a "1" logic value is assigned to the remaining bit. The range may represent Classless Inter Domain Routing (CIDR) addresses.
Preferably, an input key search is performed simultaneously in one or more associative elements, or in one or more equivalent non-overlapping ranges that may contain the input key.
Whenever the ranges that correspond to different associative elements are overlapping ranges, a match between an input key and a range is sought by arranging the ranges in their priority precedence order, comparing the input key with the values within each range, and obtaining one or more match indications whenever the input key belongs to one or more ranges. The match indication corresponding to the range having the highest priority is selected.
The present invention is also directed to an apparatus for arranging and storing, in a memory, associative key data set of associative elements and a corresponding associated data set of associated elements, where each associative element corresponds to a range of consecutive values, such that an associated element may be extracted from the memory as valid data if an associative key belongs to its associative element. The range may be represented by its lower and upper extreme values. The apparatus comprises a memory device(s), for storing the associative key data set and the associated data set that comprises a first and a second storage areas, so that to each storage location in the first storage area there is a corresponding storage location in the second storage area in which the associative elements of the key association data set and their corresponding associated data set are arranged in an order determined by priority precedence, such that associative elements having higher priority are placed before those having lower priority; a unique index is assigned for each associative element, representing its ordered location; at least one of the extreme values of each associative element is stored in the first storage area in a location that corresponds to the priority of the associative element; and each value of the associated data set is stored in a location in the second storage area that corresponds to the location of the associative element, to which it is associated.
The apparatus may further comprise circuitry for extracting associated data values from the memory upon conducting a key search on the associative key data, including: a) circuitry for seeking one or more, associative elements that may contain a searched input key, upon receiving the input key; b) circuitry for outputting the associated data that corresponds to the associative element having the highest priority that contains the input key; and c) circuitry for outputting a mismatch signal, indicating that the associated data that is being output is invalid, if no such associative element(s) is found , and a match signal indicating that the associated data that is being output is valid, if the input key is contained in one or more associative element(s).
The lower and/or the upper extreme value of one or more ranges that are stored in the apparatus may be a non-negative value. The associative elements of the key association data set may be ranges of consecutive values having semi-open/semi-closed boundaries. Each range that is stored in the apparatus may have a closed boundary as its lower boundary, and an open boundary as its upper boundary, or alternatively, a closed boundary as its upper boundary, and an open boundary as its lower boundary. The ranges that correspond to different associative elements stored in the apparatus may be non-overlapping ranges.
Overlapping ranges that are stored in the apparatus may be converted into one or more equivalent non-overlapping ranges by combining overlapping ranges by truncating overlapping portions from ranges having lower priority, while maintaining with no change, for each set of overlapping portions, a single portion having the highest priority within the set and by arranging the non-overlapping ranges of the equivalent set in a descending/ascending order, according to the boundary values of each of the ranges.
The present invention is also directed to an apparatus in which associated data values may be extracted from the memory of the apparatus upon conducting a key search on the associative key data. This apparatus may comprise: a) circuitry for seeking one or more associative equivalent non-overlapping ranges that may contain a searched input key, upon receiving the input key; b) circuitry for outputting the associated data that corresponds to the associative equivalent non-overlapping range that contains the input key; and c) circuitry for outputting a mismatch signal, indicating that the associated data that is being output is invalid, if no associative equivalent non-overlapping range is found and a match signal indicating that the associated data that is being output is valid, if the input key is contained in the associative equivalent non-overlapping range. The present invention is also directed to an apparatus in which a match between an input key and an associative element is detected using a single comparison between the input key and the boundaries of equivalent non-overlapping ranges. This apparatus may comprise: a) a first storage area for storing the boundary values of the equivalent non-overlapping data set in ascending order; b) a second storage area for storing the associated data set in the locations that correspond to the locations of closed boundaries of the equivalent non-overlapping data set; c) a set of comparators for concurrently performing comparisons between each boundary value stored in the first storage area and the input key, to determine whether the input key is larger than the boundary value; d) circuitry for issuing a TRUE value whenever a comparison result with the input key indicates that the input key is larger than the boundary value, and for issuing a FALSE value if the input key is equal to or smaller than the boundary value; e) an encoder for detecting a match whenever there is a transition of the comparison results, from a TRUE value to a FALSE value, and for issuing the index of the last boundary value, for which the comparison result is a TRUE value; f) a third storage area for storing boundary type information, represented by a bit that indicates whether the boundary value is a closed or open boundary, the bit being retrieved from the location in the third storage area defined by the index; and g) circuitry for outputting the associated data that corresponds to the index from the second storage area. The present invention is also directed to an apparatus in which each associative element comprises two values, a first value which is the lower boundary of a range, and a second value which is an upper boundary of the range. This apparatus may comprise: a) an ordered set of storage and detection units for storing the upper and lower boundaries and for detecting a key match represented by issuing a TRUE value, by concurrently performing two comparison operations for the boundaries, a first comparison to determine whether the input key is larger than or equal to the range's lower boundary, and a second comparison to determine whether the input key is smaller than the range's upper boundary; b) circuitry for selecting the match with the highest priority, and for issuing the index of the match having the highest priority; and c) circuitry for outputting the associated data that corresponds to the index.
Each storage and detection unit may generate a validation flag for enabling/disabling a match detection.
Each value that belongs to a range may be represented in the apparatus by k bits, representing the open boundary of the range by k+1 bits, such that a "0" logic value is assigned to k consecutive bits and a "1" logic value is assigned to the remaining bit. Each value that does not belong to a range and is beyond the open boundary of the range may be represented in the apparatus by k+1 bits, such that a "0" logic value is assigned to k consecutive bits and a "1" logic value is assigned to the remaining bit. The range may represent Classless Inter Domain Routing (CIDR) addresses. An input key search may be performed in the apparatus simultaneously in one or more associative elements that may contain the input key, or one or more equivalent non-overlapping ranges that may contain the input key.
The present invention is also directed to an apparatus for storing and outputting associative ranges and their associated data, and for seeking matching ranges that may contain a searched input key that comprises: a) an Entry list storage consisting of an ordered set of Range Word
(RW) devices, each of which comprises: a.l) a first memory cell for storing the lower boundary of an associative range; a.2) a second memory cell for storing the upper boundary of the associative range; a.3) an input for inputting the searched input key; a.4) a validation flag input for indicating that the lower and upper boundaries are valid; a.5) an output for indicating a match whenever the validation flag input provides a valid indication, and the associative range comprises the searched input key; the RW devices are indexed according to their location, and the ranges that are stored in the RW devices are organized in a priority precedence order. b) a priority encoder for detecting the match indication from an RW device with the highest priority, comprising: b.l) inputs for receiving the outputs of the Range Word devices; b.2) a first output for indicating a match; b.3) a second output for issuing the index of the matching RW device having the highest priority; c) a memory for storing the associated data from which the data associated with the highest priority range having a match is output, the memory comprising: cl) a set of memory cells for storing the associated data, each data item of the associated data being stored in a location corresponding to the RW device which stores the range values associated with the data item; c.2) an input of the second output of the priority encoder carrying the index of the match having the highest priority; and c.3) an output for outputting the data associated with the range having the highest priority match, by utilizing the input as a pointer to the location in which the associated data is stored.
The range value stored in the first memory cell in the apparatus may be a closed lower boundary, and the value stored in the second memory cell may be an open upper boundary.
Preferably, the Range Word device comprises: a) a first comparator having a first input connected to the input of the searched input key, a second input connected to the first memory cell, and an output for issuing a TRUE indication whenever the value on the first input is smaller than the value on the second input; b) a second comparator having a first input connected to the input of the searched input key, a second input connected to the second memory cell, and an output for issuing a TRUE indication whenever the value on the first input is smaller than the value on the second input; c) an inverter having an input connected to the output of the first comparator, and an output for outputting the inverted comparison result from the first comparator; d) a first AND gate having an input connected to the output of the inverter and another input connected to the output of the second comparator, the first AND gate outputs a TRUE indication whenever the searched key is smaller than the value stored in the second memory cell, and greater than or equal to the value stored in the first memory cell; and e) a second AND gate having one input connected to the output of the first AND gate and another input connected to the validation flag input, the second AND gate outputs a TRUE indication whenever, a valid indication is obtained from the validation flag input, and a TRUE indication is obtained from the output of the first AND gate.
The present invention is also directed to an apparatus in which overlapping ranges are converted into one or more equivalent non-overlapping ranges by combining overlapping ranges by truncating overlapping portions from ranges having lower priority, while maintaining with no change, for each set of overlapping portions, a single portion having the highest priority within the set and by arranging the equivalent non-overlapping ranges of the equivalent set in a descending/ascending order, according to the boundary values of each of the ranges, and each equivalent non-overlapping range has a closed boundary as its lower boundary and an open boundary as its upper boundary. This apparatus may comprise: a) an Entry List storage device consisting of an ordered set of memory cells for storing entries, each being a value that represents at least one boundary value of a equivalent non-overlapping range and is indexed according to its relative location, the entry comprising a fe-bit value and the Entry List storage device comprising: a.1) an ordered set of boundary entries stored in the order of the equivalent non-overlapping ranges, wherein an index 1 is assigned to the first boundary value of the first equivalent non-overlapping range that is stored in the first memory cell, and the last boundary value, with index i, is stored in the i-th memory cell; a.2) zero values stored in all of the remaining memory cells that do not contain boundary values; ircuitry for detecting a match between a searched input key and an equivalent non-overlapping range, and for issuing the index of the matching equivalent non-overlapping range, comprising: b.l) a &-bit key input for inputting the searched input key; b.2) an input for inputting an Empty flag indication representing a state wherein the Entry List storage device is empty; b.3) an ordered set of £-bit inputs, each of which is connected to the output of a corresponding memory cell from the Entry List storage device; - b.4) a set of ordered comparators . each of which, except for the first comparator, comprises: b.4.1) a first input connected to a corresponding £-bit input; b.4.2) a second input connected to the &-bit key input; b.4.3) an output for outputting a TRUE indication whenever the value of the first input is smaller than the value of the second input, and a FALSE indication whenever the value of the first input is greater than the value of the second input; b.4.4) circuitry for producing a logic "1" whenever a zero value is obtained on the first input, such that zero values obtained on the first input are expanded in the comparators into a k+1 bit value having "1" at their most significant location, and zeros in all of the remaining locations; b.5) a first comparator that comprises: b.5.1) a first input connected to the first £-bit input; b.5.2) a second input connected to the &-bit key input; b:5.3) an output for outputting a TRUE indication whenever the value of the first input is smaller than the value of the second input, and a FALSE indication whenever the value of the first input is greater than the value of the second input; b.6) a Range Encoder for producing the index of a matching range whenever the Entry List storage device is not empty, by detecting the transition point of the outputs of the set of ordered comparators from a series of consecutive TRUE indications to a FALSE indication, and for producing a unique indication whenever the searched input key is larger than any entry in the Entry List storage device; Boundary Type storage device for storing and outputting a match or mismatch indication whenever the index of a matching range value that is received corresponds to a closed boundary value, the Boundary Type storage device comprising: cl) an ordered set of storage device containing boundary type bits, each of which corresponds to a memory cell in the Entry List storage device and is utilized for storing "1" whenever a closed boundary is stored in the corresponding memory cell, and for storing "0" whenever an open boundary is stored in the memory cell; c.2) an input for inputting the index; c.3) an output for outputting the boundary type bit that is utilized for indicating a match or a mismatch; c.4) circuitry for outputting the boundary type bits on the output, utilizing the index value received on the input to select the boundary type bit from the ordered set of storage device; d) associated data storage device for storing and outputting the data associated with each range of the equivalent non-overlapping set of ranges, the associated data storage device comprising: d.1) an ordered set of memory cells for storing associated data in locations that correspond to the locations of the closed boundary values having association with the associated data; d.2) an input for inputting the index; d.3) an output for outputting associated data stored in the ordered set of memory cells; d.4) circuitry for outputting the associated data on the output, utilizing the index value received on the input to retrieve the associated data from the ordered set of memory cells; and e) circuitry for disabling/enabling the output from the Boundary Type storage device by utilizing the indication of a searched input key that is larger than any entry in the Entry List storage device, to disable/enable the output from the Boundary Type storage device.
The Range Encoder may comprise: a) a set of ordered inputs for receiving the outputs of the set of ordered comparators; b) an input for receiving an Entry List Empty indication whenever the
Entry List storage device does not comprise associative data; c) a first output for outputting the index of the matching range value; d) a second output for outputting a unique indication whenever the searched input key is larger than any range value stored in the Entry List storage device; and e) an encoder for outputting the index of the matching range. Brief Description of the Drawings
In the drawings:
Fig. 1 graphically illustrates the meaning of a range according to the method of the invention;
Fig. 2 graphically illustrates the process of searching for key match and for a Key Associated Data;
Fig. 3 graphically illustrates the results of combining two ranges into an equivalent set of non-overlapping ranges;
Fig. 4 graphically demonstrates the Non-overlapping Equivalent Range Set of the Overlapping Range Set illustrated in Fig. 2;
Fig. 5 graphically illustrates how a Key search is performed over a . Non-overlapping Equivalent Range Set and its Associated Data;
Fig. 6 schematically illustrates the RCAM's Range Word structure, key match detection, and generation of the match signal m according to a first embodiment of the invention;
Fig. 7 schematically illustrates a Post-Processing Based RCAM comprised of an array of Range Words;
. Fig. 8 schematicall illustrates a preferred embodiment for a Pre-Processing Based RCAM according to the method of the invention;-
Fig. 9 schematically illustrates a possible embodiment of a Range Encoder, according to a preferred embodiment of the invention; and
Fig. 10 schematically illustrates overlapping of IPv4 CIDR addresses.
Detailed Description of Preferred Embodiments
The present invention introduces a novel type of associative CAM device - a Range Content Addressable Memory (RCAM). The RCAM combines the memory function with associative processing capabilities, and it is specifically designed to match an input key with a range of possible associative keys (integer values). More precisely, the R CAM yields a match indication if it determines that the key presented to it belongs to one of a predetermined set of value ranges. Therefore, it stores intervals of integer values, and unique data items (also integer values) associated with .each interval.
If it is determined that the submitted key (the key presented to the RCAM) falls into one of the intervals defined in the RCAM, the data associated with the interval is retrieved, and a match signal m is issued. The present invention provides a method for implementing an RCAM device and demonstrates the usefulness of the range search approach. Before proceeding any further in the description of the present invention, some definitions and terms, as they appear hereinabove, are explained hereinbelow.
Ranges:
The range R, denoted hy;R ≡ [NL ,NH) , wherein NH and Ni are integers such that NH > NL ≥ 0, is a consecutive range of the integer numbers starting from 'NL and ending at NH. The notation utilized for the lower boundary of the range R, "[", a square angled bracket, denotes a closed boundary, meaning that the range includes its lower bound, NL. On the other hand, the upper boundary is an open boundary, and is denoted by a rounded bracket ")", meaning that the upper boundary is excluded, i.e., does not belong to the range R.
With this definition for a range, given an integer K, the term "match" is utilized to indicate that K belongs to the range. R, K <= R , if the following holds NL ≤ K < NH . As follows, from the range definition given herein above, if K matches the range R, then it may be equal to, or bigger than NL (the closed boundary), and as this definition also states, it is essentially smaller than NH. It is therefore clear, from this range definition, that zero may appear only as the lower boundary, NL, of a range.
Fig. 1 graphically illustrates the meaning of a range in accordance with the range definition given hereinabove. The range R ≡ [NL ,NH) , 101, is depicted as a semi-closed/semi-opened interval on the integer number axis 100 (positive and negative numbers comply with the range definition). The range's lower boundary is NL, and the range's higher boundary is NH. AS explained before, NL e R , namely, the range's lower boundary, belongs to the range (i.e., it is a part of the range). On the other hand, NH £ R , that is, the range's high boundary, does not belong to the range. Thus, the range as defined herein is a Semi-closed/Semi-opened interval of integers.
The range definition hereinabove has been selected, since it implies significant savings in the RCAM implementation, and eliminates multiple matches on Search operation, as will be demonstrated herein. Alternatively, one may adopt a range definition which is also Semi-opened/Semi- Closed interval, but in which the open boundary is on the left-hand side, and the closed boundary is on the right-hand side.
Spaces:
The space Ω designates the space of all possible &-bit integer values (the integer values 0 Ό- 2* - 1 ). Thus, any integer value K e Ω, has a binary representation consisting of a finite and constant number of bits k, K ≡ {ak_x , ak_2 ^...,ai,...a ,aϋ)2 , such that α(. e {0,l} (0≤/<A) . Hence, the entire space comprises all integer values K such that - (o,o,.:.,o)2 ≤ jc < (i,ι,...,i)2
Figure imgf000026_0001
Consequently, the entire space Ω is also a range, incorporating all the possible values in the range, wherein -
Ni = (0,0,...,0)2
is a /2-bit binary number, while
NH = (1,0,0,...,0)2.
Figure imgf000026_0002
is a k+1 bit binary. number.
Thus, the entire range is actually ■
Ω S [(0,0,...,0)2,(1,0,0,...,0)2) -* biis→l l<-£+l bits→l
Since we are dealing with j-bit digital systems, the representation of £+1 bits is not practical. But as was stated hereinbefore, the zero element of the space Ω essentially may only appear as the closed lower boundary of a range. This observation will be utilized later to simplify the representation of the upper boundary of the space Ω . From now on, the combination
(0,0,...0)2
Figure imgf000026_0003
is reserved (i.e., the zero element of the space), and is utilized for designating the space's upper boundary (the right-most integer value NH > 0, NH g Ω). This representation may be interpreted as having an implied k+1 leftmost bit, which is "1". This bit, which is not shown, will be defined hereinafter as a Silent "1 " Bit. In accordance with the above, the range Ω may be represented in the following way:
Ω S[(0,0,...,0)2,(0,0,...,0)2)
Figure imgf000027_0001
and in a decimal notation, the range Ω is thus represented this way, Ω ≡ [0,0) . In this representation (decimal), the Silent "1 " Bit convention is utilized for designating the Ω Range Open Bound (NH = 2* Ω), and it appears in the form of "0".
Utilizing this convention, the match of an integer value K to the range A ≤ K < NH = 2k may be equivalently expressed as l e [^4,0) — » K ≥ A , wherein K and A are integer values. Thus, R=[A,0) represents all the integers greater than or equal to an integer A in a given space Ω . As will be demonstrated later, this type of an inequality, expression is very efficient and useful for packet classification.
In a similar fashion, if there is a match of a given integer value K to the range, 0 < K < A , this may be equivalently designated by K e [Q,A) → K < A . The range R-[0,A) is actually the range of all integers smaller than an integer A in a given space Ω . A single integer is also a range in the Ω space, and may be represented as K = [A,A + Ϊ) →K = A. .
The most common operation to be performed over ranges is a search to figure out to which range a Key K (an integer value) belongs, and to get as a result data, also called an Associated Data. Associated Data is a unique integer value associated with the found Range. Overlapping Ranges:
Two Ranges Ra and Rfr are called Overlapping Ranges if there is an integer K such that K ≡ Ra and.tr e Rb .
In general, a Key search over a set of ranges might yield inconsistent results, since the Key might be found in several Overlapping Ranges, each one having its own unique Associated Data.
To facilitate Range -Overlapping we must introduce the notion of Priority. Thus, if the Key-search results in several matches, the Associated Data of the highest priority matching Range is selected.
Priority:
Given a set of n Overlapping Ranges Orl≡{Rι,R2,...,Ri,...,Rn}, and a corresponding set of values, the set of Associated Data ~D≡{dι,d2,...,di,...,dn} (a set of n integer values), wherein both of the sets are arranged in their priority order, that is, Ri is higher in priority than Rj if i<j, and given an integer value K, such that,
K e Rn, K e Ri2, K e Ri3, ..., and K e Rip (il < i2 < i3 < ... < ip) wherein H,i2,iS,...,ip are the indexes of all the Ranges to which f belongs, then R,., , Ri2 ,Ri3,..., Rip are defined as the K - Matching Ranges.
The set of ranges dϊ≡{Rι,R2,...,Ri,...,Rn} will be referred to hereinafter as the Associative Range Set, and the set D≡{dι,d2,...,di,...,dn} as the Associated Data Set. The integer K will be referred to hereinafter as the Key, used to search and select a single element from the Associated Data Set Ω. The function is defined as an Associative Function, which maps 5R, D, and f into a (d,m) pair in the following way,
Figure imgf000029_0001
wherein i is the highest priority index (or the lowest index value) of all the matching Ranges, as defined hereinabove, and d is an integer value, d≥O, which will be also referred to hereinafter as the Key Associated Data. The variable m is a Boolean variable (may equal either a "1" or "0" value), and which will be referred to hereinafter as the Key Match value.
It should be clear that if m="0" there is no meaning to the value of d, whatever it may be. This is represented as d=x, wherein x stands for "Don't Care". Additionally, the highest priority Matching Range Ri and its Key Associated Data di, have the same index i:
The Associative Function, Associative Range Set, Associated Data Set, and their priority-based ordering, which are defined hereinabove, facilitate the acquisition of a consistent result, for each Key search.
The searching for the Associated Data of a certain integer K (the Key) comprises the following steps -
Step 1: Find the index i of the highest priority K- Matching Range.
Step 2: Use this index to access the Associated Data (The Associated Data is the i-th element in the Associated Data Set). More particularly, the method for searching for a Key Associated Data comprises the steps shown in the flow chart below:
Figure imgf000030_0001
This process is demonstrated in Fig.2, wherein each range Rq and its corresponding data item dq are illustrated in an ordered sequence according to their precedence priority. Each of the ranges is depicted in the following form Rql ' dq (1 < q < n) , on the integer number axis numbered from 1 to n.
The Key K is searched simultaneously in each and every range -
Kχ,K2,K ,K,..., Kj_χ , Kf , Λ;+1 , Λi+2 , ... , Kn_3 , Kn_2 , Λn_j , Kn .
Each range, Rq , has its unique data item associated with dq (illustrated by
Rq I dq). For each Range Rq (q is an integer, l≤q≤n), a test. is performed which determines whether K <=Rq, or K <£Rq . If it is determined that
K Rq, then the result of this test is g="l" and the index q is now utilized to select dq, which is Rq 's - Associated Data. The variable πiq is a Boolean value which indicates a Match on Rq, such that mq="l" indicates a Match (K<=Rq), and ς="0" indicates thsAK <έRq, and that there is no meaning to the value of dq. This process is performed on each and every range, from the set of ordered ranges Rλ,R2,R3,R4,..., RM , Rt , RM , Ri+2 ,..., R„_3 , Rn_2 , Rn_ , R„ (wherein l<2<3<4<...<z-l<t<t + l<z + 2<...<«-3<rc-2<n-l<n), such that the result of the highest priority match (i.e., the range to which there is a match having the smallest index) is then selected to retrieve the corresponding Associated Data. In the particular case of Fig.2, a match is detected (mς-'l") for q-i,n-3, and n (K e R,-,Rn_3,Rn). However, the highest priorit match is the match with the range R. (i<n-3<n).
Therefore, m="l", and d=d
This process of Associated Data acquisition is similar to the way it is done in a Ternary CAMs (as described in a White Paper, "High Performance Layer 3 Forwarding", of Netlogic Microsystems Inc, and in "Fully Parallel 30-MHz, 2.5Mb CAM" by Farhad Shafai et al, IEEE JSSC Vol.33 No.11, Nov.1998, pp.1690 - 1696). The searched Key, K, is first checked against all the ranges Rq , (q = 1,2, ...,n).
Post-Processing is required to determine which one of the many possible corresponding Associated Data values ought to be selected on the ranges' priority basis.
This straightforward approach results in a simple implementation in hardware. However, it has three drawbacks when implemented in hardware. These drawbacks include high power consumption, inefficient hardware implementation, and search performance which varies with the number of priority rules. There is, however, an alternative way which is based upon the combining of overlapping ranges prior to performing the search. The combination of the overlapping ranges and their conversion to equivalent non-overlapping ranges prior to performing searches is called Pre-processing.
Pre-Processing in the broader sense has been suggested in the context of classification (for instance, "High-Speed Policy-Based Forwarding Using Efficient Multi-Dimensional Range Matching", by V. Lakshman, Dimitrios Stiliadis, SIGCOM 1998, pp. 203-214). But it has not been applied in the context of Classless Inter Domain Routing (CIDR), or in the context of Ranges.
As will be explained hereinafter, the basic concept behind the method of the invention is that overlapping ranges can be combined prior to performing a search on the basis of the Ranges priority. Thus, the original overlapping Range Set 5R, can be traded for an equivalent non-overlapping Range Set π ≡ {pl,p2,...,pv} which yields consistently the same Associated
Data. In a similar fashion, as-in the general case, a non-overlapping set of ranges has an Associated Data Set, A ≡ {δ1 ;δ2,...δv} .
This method requires pre-computation of a Non-overlapping Equivalent
Range Set having the following features:
For any pi , and p} (i≠j), there is no integer K simultaneously belonging to the two ranges. That is, K e p. → K φ. p , i ≠ j , so that K is found in a single non-overlapping range. Therefore, the notion of priority in the context of Non-overlapping Equivalent Range Set becomes dispensable. Non-OυerlaOOins Equivalent Range Set:
The range sets ϋ and 5R are said to be equivalent if and only if for every integer K, the results of the association function K yield the same results, that is - (π, Δ, K) ≡ ( D, K) so that - (d, m) = ( D,K) , and (δ, μ) = (π, Δ, K.) then obviously - m = μ and d = δ .
The equivalent set of ranges 17 is defined as a Non-Overlapping Equivalent Range Set of an Overlapping Range Set 5R .
As will be explained hereinafter, the following observations hold:
For each 5R and D pair (of a an Overlapping Range Set) there is a unique equivalent pair π and Δ. (of a Non-Overlapping Equivalent Range
Set).
The number of Range elements in ϋ , v , is smaller than, or equal to n+1 (v < n + 1) , wherein n is the number of ranges in 5R .
For each pp s ll there is an Rq e 5R , such that pp z Rq .
According to a preferred embodiment of the invention, the combination of two overlapping Ranges is performed as follows:
For any given pair of overlapping ranges, Ra = NL a , NH ) with an Associated Data. dα (Rα/dα), and Rb — [N ,NH b ) with an Associated Data db
(Rb/db), wherein the priority of Rα is higher than the priority of Rb (b>d), there are the following possible combinations Case 1 (illustrated in Fig. 3b): NL' e Rb and NH a e Rb
That is, when Ra is completely included in Rb (Ra
Figure imgf000034_0001
Rb = Ra) , and in this case, since Ra is the range with the higher priority, the combination of the overlapping ranges results in three non-overlapping (but adjacent) ranges [NL b,NL a)ldb , Ra I da , and [NH a ,NH b )ldb . The high priority oϊ Ra and its being completely included in Rb lead to splitting Rb into two distinct ranges (notice that Ra is actually left untouched), [NL b,NL a)/db an.ά N} a 1,NH b )ldb , having the same associated data db.
Case 2 (illustrated in Fig. 3c): NL a Rb and NH" e Rb
That is, when Ra is partially included in Rb [Ra Rb = [N*,N )),and as before, since Ra is more dominant (i.e., with the higher priority), it remains unchanged, while Rb is truncated from its left side to yield the two non-overlapping ranges Ra /da and [NH a ,NH b )l db . The new range
[NH" ,NH b )l db is a new incarnation of Rb, but one in which the lower boundary is adjusted in order to maintain the completeness of Ra (i.e., the lower boundary of this new range is taken to be the upper boundary of range Ra, NH a ).
Case 3 (iUustrated in Fig. 3d): N e Rb and NH a £ Rb
This is the case wherein Rb is partially included in Ra
Figure imgf000034_0002
[NL a,NH b )), and as in case 2, Ra remains complete, while Rb is truncated from its right side, and the new non-overlapping ranges obtained are [NL b,NL a)l db and Ra l ' da . In this case, however, adjustment of Rb is carried out by changing its upper boundary to the value of the lower boundary of range Ra, NL a . Case 4 (illustrated in Fig. 3e): N £ Rb and NH a g Rb
This is a case of overlapping wherein none of the boundaries of Ra is contained in Rb, meaning that Rb is completely contained in Ra (R0 Rb). Because Rb is of low priority, it completely vanishes in this case. More particularly, a range with low priority has no existence within a range of higher priority, as in this case, so that the result of combining ranges the Ra and Rb, is Ra I da , i.e., a single range having the boundaries and the associated data of Ra.
Case 5 (illustrated in Fig. 3a): If the Ranges Ra and Rb are non-overlapping, they remain unchanged.
The operation of combining two ranges will be designated hereinafter utilizing this notation - u . For example, R jRb ≡ Ra l da,[NH a ,NH b )l db if
Nl Rb and NH a s Rb (case 2). It should be noted that this operation is also valid for non-overlapping, ranges, and that if the non-overlapping result is trivial, the non-overlapping ranges are left untouched. Thus, for non-overlapping ranges:
Ra n Rb = Φ → Rfl i?6 = {i?fl,R6}
(where Φ is an empty Range, that is KgΦ, for any integer K).
As follows from the observations hereinabove, since Ra is higher in priority than Rb, the non-overlapping range result always contains the original Ra. while Rb is always replaced by newly created Ranges (case 1, 2, and 3), or is completely eliminated (case 4). Additionally, if Ra rΛ Rb ≠ Φ and
Rb ζz. Rβ (i.e., cases 1, 2, or 3) the new boundaries [NL b,NL a)l db and/or
[NH a ,NH)l db aτe created, and Ra is left as is after the Rα i?fi operation. The non-overlapping ranges Ra,
Figure imgf000036_0001
and/or [NH a ,NH b )/db are of the same priority, since those ranges are non-overlapping, thus the search yields always a single result, so that there is no significance to priority.
It should be noted that the operation of combining overlapping ranges to obtain an equivalent set of non-overlapping ranges, "u " fulfills also the basic algebraic laws of -
Identity law, R Φ = R ;
Associative law, (Ra R6 ) Rc = Ra u(R6 ui?c); and
Commutative law, Ra jRb = b}J a
The Range operations are distinct in the sense that in addition to the operand " " result being dependent on value of the basic elements, it also modifies the range boundaries. The relative position of the boundary values on the integer number axis (their one-dimensional topological relation) determines which of the results might hold. Over all, there are five different possible results when two ranges are combined.
Fig. 3 demonstrates graphically the possible results of the " " operation, performed on two Ranges. Fig. 3. illustrates five distinct cases, Fig. 3(a) through Fig.. 3(e), which describe different possibilities for range interaction. Fig. 3(a) illustrates non-overlapping of the ranges Ra and Rb (Ra Rb - φ) , and Figs. 3(b) through 3(e) correspond to the four cases that were described before (cases 1, 2, 3, and 4). In the figures, the original ranges Ra and Rb are depicted on the left-hand side of each drawing, and the result of the " " operation in between the two ranges is depicted on the right-hand side of each drawing. For all the cases, Ra assumes a higher priority than Rb (that is a<b). Fig 3(a) demonstrates a case in which the "y " operation results in Ra and
Rb being unmodified (Rfl n Rb = φ) . Fig. 3(e) illustrates case 4, hereinabove, wherein Rb is completely contained in Ra (Ra n Rb - Rb ) , and which results in Ra being unmodified and Rb being eliminated. In Figs. 3(b), 3(c) and 3(d) Ra remains unmodified (cases 1,2 and 3 respectively), Rb disappears, and one or two ranges are created as a result from the " " operation in between Ra and Rb.
Adjacent Ranges:
Two Non-overlapping Ranges Ri, and Ri+i are said to be Adjacent Ranges if they share one boundary, that is, NH' = N'*1 . For example, in Fig. 3(b), according to this definition, the two non-overlapping ranges [NL b,NL a) and Ra are Adjacent Ranges, as they share the boundary NL a , which is the open boundary of {NL b,NL a) , and a closed boundary of Ra. Similarly, in each of the cases presented in Figs. 3(b), 3(c) and 3(d), Adjacent Ranges are obtained.
As will be understood later, Adjacent Ranges are of great importance, since they potentially enable a compact way of representing ranges which results in significant saving in storage space. It should be understood that in Figs. 3(b), 3(c) and (d) the shared boundaries of the Adjacent Ranges are marked twice, once for being the open boundary of a left-hand Range, and once for being a closed boundary for the right-hand range.
A significant outcome of combining sets of overlapping ranges into equivalent sets of non-overlapping/adjacent ranges is that a much more efficient and economical representation of the new set of ranges may be easily obtained (i.e., the non-overlapping). Given the set of Adjacent Ranges ^ {[Λf ,Λ ,[N2 ,Λ ,..^ ^ and its Associated Data Set
DΛ = {dl,d2,...,di_l,di,...,dq_ϊ,dq} , a set of ranges which may be equivalently represented by the boundary integer set ^A = [Nl ,N2,Ni,...Ni_l ,Ni,NM ,...,Nq_l,Nq,Nq , wherein Ni, is the closed boundary of the leftmost Adjacent Range, and Nq+i is the open boundary of the rightmost Adjacent Range, and
N2 , N3 , ... , N._, , N(. , N+1 , ... , N?_j , Nq are the shared boundaries of the Adjacent
Ranges.
As implied from the hereinabove definition,
N, < N2 < N3 < ... < NM < N,. < ... < N?_1 < Nq < Nq+l .
Thus, the process of searching in Sfi'4 for a Range Ri to which the integer K belongs (i.e., a match when K e R,. ), and obtaining the Associated Data di, is equivalent to finding the appropriate index i, such that Nt ≤ K < NM , and accordingly retrieving the Associated Data.
The hereinabove definition yields a compact Adjacent Range representation, since each of the shared boundaries (of adjacent ranges) is presented only once, instead of twice, as in the "conventional" Adjacent Range notation. More particularly, in the "conventional" Adjacent Range notation each of the shared boundaries of adjacent ranges is represented once as the left-handed Adjacent Range Open Boundary, and once as the right-handed Adjacent Range Closed Boundary. For instance, the following notations are equivalent for the cases of equivalent non-overlapping set ranges illustrated in Figs.3(b), 3(c) and 3(d). For the case Ra Rb= Ra of Fig.3(b) -
{[NL b,Nl),Ra,[NH a,NH b)}≡[NL b,Nl,NH a,NH b), for the case Ra Rb= [NL b , NH a ) of. Fig.3(c) -
{Ra , [NH' ,NH b)}≡ [Nl ,NH a,NH b) ,and finally, for the case Ra n Rb = [NL',NH b) of Fig.3(d) -
{[NL b,Nl),Ra}≡[NL b,Nl,NH a).
In accordance with the foregoing, given two Overlapping Ranges Ra and Rb, the equivalent set of non-overlapping ranges given by HA = Ra Rb is an
Adjacent Range Set, having the compact representation [N ,...,NA) , wherein 2 < n < 4. Thereby, a Non-overlapping Equivalent Range Set II and its Associated Data Set, A, may be obtained by -
• utilizing the "u" operation a multiple number of times on the Overlapping Range Set 9ϊ and its Associated Data Set D; and applying the Commutative and Associative Laws (as described herein above) a multiple number of times until all the resulted ranges are non-overlapping.
By adopting these observations, an efficient representation of a Non-overlapping Equivalent Range Set Tl≡{^,^i,— ,&,} can be obtained by expressing said Non-overlapping Equivalent Range Set as a set π of Adjacent Range subsets with an Associated Data Set Δ , that is - π = ir1,r2,...srp,r^ [r^2)r^3)...,r9,r^1)...,[rJ)rJ+,,...,r/,r/+1)}and
A = {{δl2,...,δp},{δp+2p+3,...,δq},...,{δss+1,...,δt}\, where l,2,...,p,p+l,p+2,...,s,s+l,s+2,...,t are sequential integer indexes. Therefore, any Range [r,.,r+1), in an equivalent non-overlapping range set, has an associated data <5. .
Therefore, for any given Overlapping Range Set
^ ≡ {[ ,NH i ),[Nl,Nl), ..,[Nl,N )} comprised of a set of ranges R. ≡ [NL' ,NH' ) , and its Associated Data Set
D ≡ {d1,d2,...,dn) where di is the Associated Data of Ri, and said sets are arranged in priority order, l ≤ i ≤ n (i is higher in priority than j if i<j, and 1 < j ≤ n), there is a Non-overlapping Equivalent Range Set
*■ ■ ~ L l » 2 '"*' P ' p+l />+2 ' p+3 >•• •> * q >*- q+l />"> il s ' * s+1 '"' * t ' * !+\ )) and a corresponding Associated Data Set
Δ = \δ » ^2.-, ^ I +2 , δp+3,..., δq },..., {δs , δs+1 ,..., δ, }} wherein Ti = N , or I",. = N^ , and δh = dk for l≤h,ij,k ≤n.
It should be clear that if the number of elements in D equals n, and if the number of elements in Δ is t, then necessarily t≤n.
Fig. 4 depicts the Non-overlapping Equivalent Range Set, which corresponds to the Overlapping Range Set depicted in Fig. 2. This Non-overlapping Equivalent Range Set results from utilizing the "u " operator and the Commutative and the Associative laws on the Overlapping Range Set (as was described hereinabove). The generation of Non-overlapping Equivalent Range Set assumes that either there are no additional Overlapping Ranges except for the depicted ones, or that all the additional overlapping ranges are contained in higher priority ranges. Evidently, the number of boundary points in the Non-overlapping Equivalent Range is significantly smaller than the sum of all the boundaries of the depicted ranges. Additionally, each one of these boundary points belongs to one or more of the Overlapping Range boundaries.
Fig. 5 demonstrates how a Key search is performed over a Non-overlapping Equivalent Range Set and its Associated Data. Three different situations for a possible search are depicted:
1) the Key K falls into the interval ΓM ≤ K < Tt . In this case, since r,_, is a Closed Boundary, the proceeding boundary, I", , is then the upper boundary of the Range [TM,r,) . The result of this search is ="l" (a Match), and as follows d = δt_x . It should be noted that since I", is a Closed Boundary, the interval to the right of r, is also a Range.
2) the Key K falls into the interval Tp+l ≤ K < Tp+2 . This time, the leftmost boundary T x is an Open Boundary, and therefore the interval ) p+1,Tp+2[ is not a Range. The result of this search is of course ="0" (a Mismatch), and as follows d=x (x stands for "don't care").
3) the Key K falls into the interval Tq ≤ K < Tq+l , and since Tq is a Closed Boundary, the next boundary Tq+l therefore is an upper boundary of the range [T?.r J. The result of this search is then ="l" (a Match), and therefore d = δ„ . It should be noted that since Tq+1 is an Open Boundary, the interval to the right of r?+I is not a Range.
As seen in the three different situations presented hereinabove, a determination of whether the interval to which the Key K belongs is a range is solely determined by the interval's left boundary. More particularly, if the left boundary is a Closed Boundary, then the interval is a Range, there is a Match (minterυai="l") and there is a meaningful Associated Data, dinterυai, with this Range. If, however, the interval's left boundary is an Open Boundary, then the interval is not a Range, so that there is a Mismatch (mmtervai="0"), and there is no meaning to the Associated Data.
Since the notion of the leftmost boundary of an interval into which the Key falls is used to determine whether the interval is a range, special care must be taken of the interval between 0 and T, . The boundary Tx is the left boundary of the leftmost Range, |T,,r2) , if T, >0. As a consequence, the integer "0" must be denoted as an Open Boundary. This assures that searching for a Key in the interval )0,rj ] will yield a Mismatch.
The Equivalent Non-overlapping Range Set representation described hereinabove reduces the number of enlisted boundary points as demonstrated in Fig. 5 (since each boundary point is represented only once). It also, results in a unique match if there is one. Therefore, stored entry database is aggregated, and does not require performing multiple comparisons, and highest priority result selection. RCAM Implementations
All the definitions and terms that are explained and illustrated hereinabove are sufficient for understanding the concept and helpfulness of the RCAM scheme. In the following description, RCAM implementations are disclosed, according to preferred embodiments of the invention. The preferred embodiments of the invention consist of one implementation which is based on a Post-Processing RCAM, and another implementation based on a Pre-Processing RCAM.
Post-Processing Based RCAM:
This is a method in which the Overlapping Ranges are allowed. Fig. 6 schematically illustrates the RCAM Range Word structure, key match detection, and generation of the match signal m 610. Each word contains 2k bits of Range Data, which consists of the β-bit boundary NL 601, and the &-bit boundary NH 602. When Key search is performed, the value of the searched key is introduced on 603 (a /Vbit integer). Two comparison operations are performed on the searched Key value 603, one with NL and the _second with NH, utilizing two separate "Greater than" (Gt) Comparators, 604 and 605 respectively. Each of the comparators, 604 and 605, has two inputs, Ini and Iu2, and one output Gt which produces a "True" signal (typically, logic "1") whenever Inι<In2.
The Comparator 605 receives the value of the searched key K (on 603) on its Inl input and the value of NH (from 602) on its In2 input. Therefore, Comparator 605 produces on its Gt output a "True" signal, when K < NH .
Comparator 604 also receives the value of the searched key K (on 603) on its Inl input, but its In2 input is fed by the value of NL (from 601). Hence, a "True" value is produced on the Gt output of 604 whenever K < NL . This result (of 604) should now. be inverted to yield a "True" value whenever K ≥ NL , as required. Therefore, the inverter 606 is connected to the Gt output of the comparator 604, such that a "True" value is obtained on the output of 606 whenever K ≥ NL .
The AND gate 607 combines these results to yield a "True" value whenever NL≤ K <NH . This . is obtained by connecting one of its inputs to the output of the inverter 606 (which is responsible for a K ≥ NL indication), and connecting its other input to the Gt output of the comparator 605 (which the provides K < NH indication).
Issuing a Match indication (m- 'l") is dependent on whether the word is occupied with valid data (601 and 602). The V Flag bit 609 is set to indicate that the data word is valid (a data validation flag). If V="0" (the word does not contain valid data), there should be no Match (i.e., m="Q"). For this task, another AND gate, 608, is utilized. By connecting one of the AND gate 608 inputs to the output of the AND gate 607, and its other input to the data validation flag, the V Flag 609, a "True" value is obtained on 610 whenever the conditions NL≤ K <NH and V="l" are satisfied.
Fig. 7 schematically illustrates an RCAM which incorporates an array of
Range Words (RW), each of which may be constructed, as illustrated in Fig.
6. The RCAM's entry list is comprised of the RWs -
RW^RW^RW^RW^ .^RW^RW^RW^RW^,... ...,RWj_2,RWj_x,RWj,RWJ+x,...,RWn_ ,RWn
The valid entries (having V="l") in Fig. 7 are shadowed, RW1,RW2,RW4,RWi,RWi÷2,RWJ and RWJ+X , to indicate that they contain valid data. Whenever a fe-bit Key f is submitted on 603, all the valid RWs for which the NL≤ K <NH condition is satisfied, yields a mq- 'l" value, wherein q is an integer, and l ≤ q ≤ n . All the other RWs yield g="0".
The " ς" outputs drive a Priority Encoder 701. If i is the lowest index of RWi, which generates i="l" (i.e., there is no mj="l", such that l ≤ j ≤ i), the Priority Encoder 701 outputs i at its Index output 703 (a q-hit output). This Index output serves as an address to the Associated Data memory 704, which incorporates the Associated Data List ax,a2,a3 ,a4 ..., at_ , ai , ct1+ , i+2 ,..., aj_2 , a j_x , ., a j+x ,... ,an_ ,an .
Therefore, proceeding with the example hereinabove, the Associated Data memory 704 receives the index i, from the Priority Encoder 701, on 703 and fetches its i-th word containing the Associated Data di , which is then provided on the α-bit output 705.
It should be noted that according to a preferred embodiment of the invention, the Associated Data may be embedded in the same device or may be located in a separate device.
The match indication is provided on another output, 702, of the Priority Encoder 701. Additional logic inside the Priority Encoder 701 is utilized to calculate a Match, which is simply obtained by the computation of
Match = [J" m; (may be implemented by performing the logic OR operation).
This is a simplified implementation which is also very flexible, since there is no need for entry order. A new Range can be quickly inserted into any free (V="0") location, which is free below all the Overlapping Ranges having lower priority. A Range can be easily removed simply by resetting its Valid Flag. Additionally, this implementation does not require any Pre-Processing.
However, this implementation suffers from several disadvantages which are associated with this approach (Post Processing):
First, since the Key may match multiple RWs, the comparisons must be performed on each and every RW. This results in . significant power consumption, which is proportional to the number of comparators.
Second, the Priority Encoder's resolution time is proportional to the number of RWs. This time might be substantial for huge RCAMs, thus slowing down the RCAM performance. This effect can be reduced at the cost of a more complicated Priority Encoder. Third, the RW structure is bulky and space-consuming. Therefore, it is not yielding to the implementation of RCAMs that are large in size.
Pre-Processing Based RCAM
In this embodiment of the invention, it is assumed that preprocessing is performed over the Overlapping Range Set of the RCAM device. This preprocessing results in a Non-overlapping Range Set. As will be described and illustrated herein, the information related to the Non-overlapping Equivalent Range Set and its Associated Data is stored in the RCAM device.
Fig. 8 schematically illustrates a preferred embodiment for a Pre-Processing Based RCAM according to the method of the invention. In this embodiment, the Non-overlapping Equivalent Range Set boundaries are stored sequentially in the RCAM device. However, in this case, gaps are not allowed to be present in between the stored boundaries. As a result, a contiguous storage space in the RCAM is occupied.
The entry list 800 of the Pre-Processing Based RCAM, (which may comprise up to n entries), consists of the t+1 entries
Entry , Entry 2 , Entry 3 , Entr 4 ,..., Entry _2 , Entry M , Entry t , Entry M ,..., Entry t , Entry t+x
, which are the vahd entries of the RCAM (i.e., comprising range information). Following the valid entry block, Entry , Entry 2,..., Entry M , there is the invalid entry block, Entry t+2,..., Entry n , wherein the entries are loaded with (θ,0,...,θ)2 values, for reasons that will be explained later on.
Each of the entries, Entry , , Entry 2 , ..., Entry n , in the Entry List 800, issues a boundary value ri 5r2,...,rn , respectively. The boundaries issued by the invalid block r,+2,...,r„ are all of (θ,0,...,θ)2 value, since these entries contain no valid boundaries. The boundary values Tx,r2,...,Tn drive inputs of the Range Locator block 801. The entries in the vahd block are arranged in an ordered manner, such that - r, < Γ23 < Γ4 < ... <Γ,._2M; < Γ,.+1 <... <Γ, < Γ,+I , wherein Entry M is the last vahd boundary entry.
The Range Locator 801 receives the Tx,T2,...,Tn boundary values from each entry, and the Empty Flag 810, and generates an Index on 805, Index = i j l ≤ i ≤ n . The Empty Flag 810 is utilized to indicate that the Entry List is empty, which is the state in which its value is "1".
The invalid entries are loaded with (θ,0,...,θ)2 values, which may be used only as the open lower boundary of the range with the highest priority, as explained hereinbefore. Since in any other entry than Entry x , (θ,0,...,θ)2 is not a valid Entry, it is not interpreted as the /2-bit (θ,0,...,θ)2 value if it appears in any of the other entries Entry 2,..., Entry n . More precisely, the occurrence of the (θ,0,...,θ)2 value in any of the entries Entry '-,..., Entry n is now interpreted as the k+1 bit value (l,0,0,...,θ)2 . The (A+l)t Silent "1" bit is generated inside all comparators in the Range Locator 801, except for the first Comparator 811, from (θ,0,...,θ)2 &-bit Entry inside every comparator. This is now utilized to indicate an empty location for any location other than Entry . Since the £+1 bit value (l,0,0,...,θ)2 is greater than the &-bit value K, all the Comparators, except for the first Comparators 811, having Entries of (θ,0,...,θ)2 , issue Gt="0" .
It should be clear that for Entry (θ,0,...,θ)2 indicates a true "0" if the
Empty Flag 810 is not turned ON i.e., Empty="0" (meaning the Entry List 800 is not empty). Otherwise, if the Empty Flag 810 indicates that the Entry List 800 is empty i.e., Empty="l", the value of E tr^ is interpreted as the k+1 bit value of (l,0,0,...,θ)2 .
The Range Locator 801 comprises n Comparators, each of which compare the value of its respective entry, from which a boundary value Tt (l < i ≤ n) is obtained, with the value of the searched Key K on 609. With reference to Fig. 8, assuming that T. ≤ K < TM , since the boundaries are stored in an increasing order, for any p<i, K > Tp and therefore the corresponding comparator's Gt output yields Gtp ="1" .
On the other hand, for any i < p ≤ t , K < Yp and therefore the corresponding comparators' Gt output yields Gtp ="0" . Since the k+1 bits value (l,0,0,..., θ)2 = 2k > K for any possible β-bit if value, the comparison of the two (2k and K) yields always "0" on the comparators' Gt output, (when a boundary value is "Greater than" a key K a "False" indication is obtained). Therefore, the proper interpretation of the value (θ,0,...,θ)2 in entries Entry ,,..., Entry n represents the following condition 2k > K and thus the comparators' Gt output yields Gtp ="0" for (t + 1) < p ≤ n .
The Gt outputs drive the inputs of the Range Encoder 802 which detects the transitional point i at which the Gt signals drop from "1" to "0". As is depicted in Fig. 8, and with accordance to the example above, this transition occurs between the i-th and the i+1 Gt outputs (since T( ≤ K < r.+1 ). The Range Encoder 802 detects this transition, and issues a -bit binary encoded Index signal, which carries the value of i, on 805.
One possible embodiment of such a Range Encoder, according to a preferred embodiment of the invention, is depicted in Fig. 9. In this embodiment, transition detection logic 900, and a standard Encoder 901, are utilized. The transition detection logic 900 is comprised of an ordered set of n AND gates Ax,A2,A3,A4,...,An , each of which receives the corresponding Gt output of a comparator in one of it inputs, such that the AND gate A) receives the Gt output of the comparator which compares the key if with the boundary value T,..
The second input of each AND gate (the inverted input) receives the inverse value of the Gt output of the next comparator in order. Thus, the other input of Ai receives the inverted result of the comparison of the searched key if with the value of the boundary r/+1. As illustrated in Fig. 9, the output of each and every AND gate is "0", except for the i-th AND gate, A and this is precisely where the transition of the Gt outputs occurs.
The second input (the inverted input) of the last AND gate in the transition detection logic 900, An receives a constant "0" value. This serves to produce the "Key is greater than any stored boundary" indication, when all of the Range Encoder's inputs set to "1", and thus the AND gate An will detect a transition. This indication is utilized to enable/disable an output from the Boundary Type List 803, as will be explained hereinafter.
The Range Encoder output 805 is a g-bit wide bus, wherein 2 • n > 2< > n . To access the Associated Data List 804 (depicted in Fig. 8) and . the Associated Boundary Type List 803, the least significant q-1 hnes of the data bus 805 are required. The g-th line is used for the special case in which all the Range Encoder's inputs are "1", that is, when the Key K on 609 is greater than any stored boundary, including the n-t . boundary. In this case, the q-th line is set to "1" and a Match="0" is generated , (indicating a mismatch) by the additional AND gate 806.
As is shown in Fig. 8, the AND gate 806 receives the inverted value of the q-t line 812 in one of its inputs and the resulting boundary type m: in its other input. The q-th. line 812 is at "1" state when all the entries are smaller than if, and therefore all the comparators issue Gt="l". Thus, the value of the g-th line enables or disables the output of a Match indication. In all the other cases, where the value of the q-th. line signal is "0", the resulting Match output is
Figure imgf000050_0001
The Index is used as an address to the Associated Data List, and to the Associated Boundary List. The Associated Boundary Type List 803 is 1-bit wide, and it comprises mp values. if Tp Closed — Boundary
Figure imgf000051_0001
if r Opened - Boundary
It should be noted that mM ="0" , since M-l is the last boundary. For entries located after the last boundary, the -bit value is "don't care".
Thus, for instance, if T1 ≤ K < TM , which results in selection of the Index i, and assuming that m;. ="0" (i.e., Tt is an Open Boundary), then there is a mismatch. On the other hand, if m(. ="1" (i.e., T. is a Closed Boundary), there is a Match. Therefore, the mt value can be utilized as the Match signal output.
The data associated with the Range T. ≤ K < Ti+{) is fetched from the
Associated Data List, that is, the data stored in the i-th location, δi . As was previously mentioned, it should be clear that the Associated-Data List may be stored on the same device or may be stored on a different device than that of the RCAM Entry List 800.
The hereinabove RCAM structure requires Pre-Processing. The boundary entries must be stored in a sequential order. It requires half the number of storage bits, and half the number of comparators per entry. Therefore, it ' significantly reduces hardware costs, and improves storage arid performance efficiency as compared to the embodiment of the , Post-Processing RCAM that was described hereinabove. Additionally, since the result (if there is any) resides always in the context of two entries (e.g., r. < K < r.+l ) and two comparators only, reception of the Index is almost instantaneous without any propagation as required for the Post-Processing RCAM.
Application of RCAM to Classless Inter Domain Routing (CIDR)
As was mentioned earlier, the IPv4 (Internet Protocol Version 4, the currently used Internet version) ' addresses are of 32 bits. These 32-bit values are typically represented as four decimal values separated by a full stop, each representing an 8-bit binary number (octets).
The IPv4- CIDR address is represented in the following form - Alp, wherein A is the IPv4 address and p is the prefix, i.e., the number of contiguously compared most significant bits from left to right (0 p ≤ 32).
The prefix is equivalent to a 32-bit mask wherein the number of "l"s equals p, and wherein those p "l"s are followed by 32-p "0"s. The zeroed part of the mask (the part with the "0" values) indicates that this part of the address bits should be ignored, when comparing the value of a CIDR address with an address.
For example, given the IPDA 198.32.0.0, and its Mask 255.248.0.0, the IPv4-CIDR address representation is then 198.32.0.0/13.
In the binary notation the IP Address is -
11000110 00100000 00000000 00000000 and the Mask -
11111111 11111000 00000000 00000000 \ - p = 13 →-j
Since the 19 least significant bits are to be ignored, the 198.32.0.0/13 represents an Address Range, from 11000110 00100000 00000000 00000000 = 198.32.0.0
To 11000110 00100111 11111111 11111111 = 198.39.255.255
Using the Range representation, this is - [198.32.0.0, . 198.40.0.0) .
Thus, IPv4 CIDR addresses can be represented as Ranges using the following formula - A I p ≡ [A, A + 2X~P ) . Where A ≡ a ■ 2il'p and a is a p bit binary number ( = 0 if p = 0).
In binary representation, if 0 < p < 32 then a is the p-bit number - a.= \CX3 , C Q ,..., C 32_P j |<- p - bits ->| wherein , e {θ,l} for 0 ≤ i ≤ 31. Thus, Al p ≡ {a -2n~p , (a + l)- 232-p) .
Using this representation, it can be concluded that each Alp IPv4 CIDR Address Range interval contains 232~p integers.
It should be noted that IPv4 CIDR addresses are always convertible to Ranges. However, this is not the case in the opposite direction (i.e., when converting any given Range into an IPv4 CIDR address).
For example, the Range Representation of [198.171.0.0, 198.171.69.0) , must be broken into the following three IPv4- CIDR addresses
198.171.0.0/18 198.171.64.0/22 and 198.171.68.0/24
Thus, the Range, according to the method of the invention, has an
Aggregation Property of CIDR addresses, and by utilizing the method of the invention for range representation, a single Range may represent one or more IPv4 CIDR addresses. It can be easily shown that any two IPv4 CIDR Address Ranges, Al p and A2/p, AX≠A2 having the same prefix p, are always Non-overlapping Ranges. Therefore, for any address A if AeAlp and AX≠A2, then essentially A&A2/p, and vice versa.
In addition, for any range of IPv4 CIDR Overlapping Address Ranges, Al p and A2 l{p + 1) , essentially A2 /p + 1) c Ax I p , and if
Ax≡(c3X,(X30,..., 32_p)2 -2 and A2≡( 3X,a30,...,cc2_p,a32_p_x)2-2 , then f ≡ al for (32 -p)≤i <32. Alternatively, this means that
AX≡A2, or A2≡A +232-p-1.
These observations are important, since they mean that any two IPv4 CIDR Overlapping Address Ranges having a prefix difference which equals 1 share either the lower bound, or the upper bound.
Moreover, for any two IPv4 CIDR Overlapping Address Ranges, Ax I px and A2/p2, wherein p >p2, essentially, Axl pxcA2l p2 and a)≡a2 for 32≤i≤ 32-px).
The overlapping of IPv4 CIDR addresses is demonstrated in Fig.10.- The IPv4 CIDR address range Ax/px, (Rx/dx) 1001, and A2/p2 (R2ld2), are an overlapping pair of ranges. In this example p2 = px +1 , and thus Ax I px is a bigger range, and A2/p2 is a smaller range. There may be one of two cases, as illustrated in Fig.10. In one case, 1002, the ranges have the same CIDR addresses Ax = A2 , while in the other case the CIDR addresses are different Ax≠ A2, 1003. For example, assuming that the first range A l p 1001 is the range 100.100.0.0/16 (^ = 16), then the other range l Pi (P = 17 ) ma be 100.100.0.0/17 as depicted by 1002, or otherwise it ma be 100.100.128.0/17 , as depicted by 1003.
Fig. 10 also illustrates the Equivalent non-Overlapping Range Set for each case. In both cases, 1004 and 1005, two adjacent non-overlapping range sets are obtained. Keeping in mind that A21 p2 is the range with the longer prefix (and thus with higher priority), then in the first case, 1004, A2 /pz remains untouched, while from . A l px only the right-hand side half remains. Similarly, in the second case, 1005, A2 /p2 remains untouched while from Ax I px only the left-hand side half remains.
When utilizing the CIDR convention, if an Address A matches one or more IPv4 CIDR Address Ranges, then the Associated Data with the one with the Longest Prefix Match is selected. That is, if A e Ax /px and A e A2 /p2 , wherein p2 > p1 , and di and d2 are the respective Associated Data? then d∑ is selected. Therefore, IPv4 CIDR Address Range priorities can be assigned in the order of their prefix length, that is, the longer the prefix, the higher the priority.
Hence, the IPv4 CIDR Address Ranges are assigned one of 32 possible priorities, such that there can be different IPv4 CIDR Address Ranges which are assigned the same priority (or have the same prefix length). This is, however, of no consequence, as previously explained herein, since IPv4 CIDR Address Ranges having the same prefix value are always non-overlapping. In RCAM implementations, each IPv4 CIDR address must be converted to a Range, using the formula Alp ≡ [A, A + 232~p) wherein A ≡ a ■ 232~p as was described hereinbefore. Any further steps depend on whether the Post-Processing or the Pre-Processing method is used.
In the Post-Processing implementations, depicted in Fig. 7, the IPv4 CIDR Address Range entries are ordered according to their prefix-length (which reflects their priority), first, the ones with a prefix-length of 32, followed by those with a prefix-length of 31, and of 30,..., and finally those with prefix-length of 0 at the bottom. The Zero prefix-length is defined as a Default Search Result, and applies if no higher priority Match exists,- and therefore only a single zero prefix length entry is meaningful.
In Pre-Processing implementations, depicted in Fig. 8, it is first required to convert the IPv4 CIDR Overlapping Address Range Set into a non-overlapping Equivalent Range Set, according to the principles presented hereinbefore. The conversion results in a list of open and close boundaries that are entered in their size order into the RCAM Entry List 800 of Fig. 8.
The respective notions of Closed or Opened Boundary are stored under the same Index in the Associated Boundary Type List 803, and the respective Associated Data values are stored in the Associated Data List 804. All the unoccupied entries in the RCAM's Entry List are loaded with (θ,0,...,θ)2 values as was previously explained herein.
According to tests performed on the Pre-processing RCAM implementation concerning large databases (incorporating ten of thousands of entries), a consistent reduction of approximately 35% in the number of boundaries was observed. This represents a major saving in comparison to the original database.
The above examples and description have of course been provided only for the purpose of illustration, and are not intended to limit the invention in any way. As will be appreciated by the skilled person, the invention can be carried out in a great variety of ways, employing more than one technique from those described above, all without exceeding the scope of the invention.

Claims

1. A method for arranging and storing in a memory an associative key data set of associative elements and a corresponding associated data set of associated elements, wherein each associative element corresponds to a range of consecutive values, such that an associated element may be extracted from said memory as valid data if an associative key belongs to its associative element, said range may be represented by its lower and upper extreme values, comprising: a) providing memory device(s) for storing said associative key data set and said associated data set comprising a first and a second storage areas, so that to each storage location in said first storage area there is a corresponding storage location in said second storage area; b) arranging the associative elements of said key association data set and their corresponding associated data set in an order determined by priority precedence, such that associative elements having higher priority are placed before associative elements having lower priority; c) assigning a unique index for each associative element, representing its ordered location; d) storing at least one of the extreme values of each associative element in said first storage area in a location that corresponds to the priority of said associative element; and e) storing each value of said associated data set in a location in said second storage area that corresponds to the location of the associative element to which it is associated.
2. A method according to claim 1, further comprising extracting associated data values from the memory upon conducting a key search on the associative key data, by performing the following steps: a) upon receiving an input key, seeking one or more associative elements that may contain said input key, and if no such associative element(s) is found, outputting a mismatch signal indicating that the associated data being output is invalid; and b) if said input key is contained in one or more associative element(s), outputting the associated data that corresponds to the associative element having the highest priority that contains said input key, and a match signal indicating that the associated data that is being output is valid.
3. A method according to claim 1, wherein the lower and/or the upper extreme value of one or more ranges is a non-negative value.
4. A method according to claim 1, wherein the associative elements of the key association data set are ranges of consecutive values having semi-open/semi-closed boundaries.
5. A method according to claim 4, wherein each range has a closed boundary as its lower boundary, and an open boundary as its upper boundary, thereby defining a range of associative elements, each of which contains the value of its corresponding lower boundary and all its consecutive values, except for the value of its upper boundary.
6. A method according to claim 4, wherein each range has a closed boundary as its upper boundary and an open boundary as its lower boundary, thereby defining a range of associative elements, each of which contains the value of its corresponding upper boundary and all its consecutive values, except for the value of its lower boundary.
7. A method according to claim 1, wherein the ranges that correspond to different associative elements are non-overlapping ranges.
8. A method according to claim 1, wherein whenever the ranges that correspond to different associative elements are overlapping ranges, converting said overlapping ranges into one or more equivalent non-overlapping ranges, by performing the following steps: a) combining overlapping ranges by truncating overlapping portions from ranges having lower priority, while maintaining with no change, for each set of overlapping portions, a single portion having the highest priority within said set, thereby obtaining an equivalent set of non-overlapping ranges; and b) arranging the non-overlapping ranges of said equivalent set in a descending/ascending order, according to the boundary values of each of said ranges.
9. A method according to claim 8, comprising: a) whenever a first range contains both the upper and the lower boundaries of a second range with lower priority, representing said second range by said first range, removing said second range element from said associated key. data set and removing its associated data element from said associated data set; b) whenever a first range contains only the upper boundary of a second range with lower priority truncating said second range to include the interval of values between its lower boundary and the lower boundary of said first range, thereby obtaining adjacent ranges having the same data association that corresponds to said first and said second ranges; c) whenever a first range contains only the lower boundary of a second- range with lower priority truncating said second range to include the interval of values between its upper boundary and the upper boundary of said first range, thereby obtaining adjacent ranges having the same data association that corresponds to said first and said second ranges; d) whenever both the upper and the lower boundaries of a first range are contained in a second range with lower priority truncating said second range into two smaller ranges, a first smaller range that includes the interval between the lower boundary of said second range and the lower boundary of said first range, and a second smaller range that includes the interval between the upper boundary of said first range and the upper boundary of said second range, thereby obtaining three adjacent ranges where said two smaller ranges have data association which is the same as the data association of said second range, while said first range and its data association remain unchanged; e) whenever there is an overlap between more than two ranges, repeating steps a) to d) above for pairs of overlapping ranges; and f) repeating step e) above each time for the resulting ranges, until the last resulting ranges do not overlap.
10. A method according to claim 8, further comprising extracting associated data values from the memory upon conducting a key search on the associative key data, by performing the following steps: a) upon receiving an input key, seeking one or more associative equivalent non-overlapping ranges that may contain said input key, and if no such associative equivalent non-overlapping range(s) is found, outputting a mismatch signal to indicate that the associated data being output is invalid; and b) if said input key is contained in an associative equivalent non-overlapping range, outputting the associated data that r
- 61 -
corresponds to that associative equivalent non-overlapping range, and a match signal indicating that the associated data being output, is vahd.
11. A method according to claims 2, 5 and 8, wherein a match between an input key and an associative element is detected using a single comparison between said input key and the boundaries of equivalent non-overlapping ranges, by performing the following steps: a) converting the key association data set into an equivalent non-overlapping data set; b) storing the boundary values of said equivalent non-overlapping data set in an ascending order in the first storage area; c) providing a third storage area; d) storing boundary type information in said third storage area, said boundary type information indicating if a boundary is open or close, thereby having for each location in said first storage area a corresponding location in said third storage area; e) storing the associated data set in the second storage area in locations that correspond to the locations of closed boundaries of said equivalent non-overlapping data set stored in said first storage area; f) detecting a key match by performing the following steps: f.l) performing concurrently a single comparison operation between each boundary value stored in said first storage area and the input key, to determine whether said input key is larger than said boundary value; f.2) issuing a TRUE value whenever a comparison result with said input key indicates that said input key is larger than said boundary value, otherwise, issuing a FALSE value; f.3) detecting a match whenever a transition of the comparison results, from a TRUE value to a FALSE value is detected; g) issuing the index of the match being the index of the last boundary value for which a TRUE value has been obtained; h) retrieving the boundary type information from said third storage area corresponding to said index, so that a match is obtained whenever the retrieved boundary type information indicates that the value with which the comparison operation was performed is a closed boundary value; and i) using said index to fetch the associated data from the second storage area.
12. A method according to claim 1, wherein whenever each associative element comprises two values, a first value which is the lower boundary of a range and a second value which is an upper boimdary of said range, performing the following steps: a) detecting a key match by concurrently performing two comparison operations for every range in said key association data set, a first comparison to determine whether the input key is larger than or equal to the range's lower boundary, and a second comparison to determine whether the input key is smaller than the range's upper boundary; b) issuing a TRUE value whenever said input key is larger than or equal to the range's lower boundary, and smaller than the range's upper boundary; c) indicating a match to each range which yields a TRUE value; d) selecting the match with the highest priority; e) issuing the index of the match having the highest priority; and f) retrieving the associated data utilizing said index.
13. A method according to claim 11, further comprising a vahdation signal, which is utilized to validate a match indication, thereby ignoring search results in a desired location(s).
14. A method according to claim 5 or 6, wherein whenever a value that belongs to a space that consists of one or more ranges is represented by k bits, representing the open boundary of said space by k+1 bits, such that a "0" logic value is assigned to k consecutive bits and a "1" logic value is assigned to the remaining bit.
15. A method according to claim 1, further comprising representing each value that does not belong to a range and is beyond the open boundary of said range by k+1 bits, such that a "0" logic value is assigned to k consecutive bits and a "1" logic value is assigned to the remaining bit.
16. A method according to claim 1, wherein the range represents Classless Inter Domain Routing (CIDR) addresses.
17. A method according to claim 2, wherein an input key search is performed simultaneously in one or more associative elements that may contain said input key.
18. A method according to claim 8, wherein an input key search is performed simultaneously in one or more equivalent non-overlapping ranges that may contain said input key.
19. A method according to claim 1, wherein whenever the ranges corresponding to different associative elements are overlapping ranges, seeking a match between an input key and a range by performing the following steps: a) arranging said ranges in their priority precedence order; b) comparing said input key with the values within each range and obtaining one or more match indications whenever said input key belongs to one or more ranges; c) selecting the match indication corresponding to the range having the highest priority.
20. Apparatus for arranging and storing in a memory an associative key data set of associative elements and a corresponding associated data set of associated elements, wherein each associative element corresponds to a range of consecutive values, such that an associated element may be extracted from said memory as valid data if an associative key belongs to its associative element, said range being represented by its lower and upper extreme values, comprising a memory device(s) for storing said associative key data set and said associated data set that comprises first and second storage areas, so that to each storage location in said first storage area there is a corresponding storage location in said second storage area in which the associative elements of said, key association data set and their corresponding associated data set are arranged in an order determined by priority precedence, such that: (a) associative elements having higher priority are placed before associative elements having lower priority; a unique index is assigned for each associative element, representing its ordered location; (b) at least one of the extreme values of each associative element is stored in said first storage area in a location that corresponds to the priority of said associative element; (c) and each value of said associated data set is stored in a location in said second storage area corresponding to the location of the associative element to which it is associated.
21. Apparatus according to claim 20, further comprising circuitry for extracting associated data values from the memory upon conducting a key search on the associative key data, said apparatus comprising: a) circuitry for seeking one or more associative elements that may contain a searched input key, upon receiving said input key; b) circuitry for outputting the associated data that corresponds to the associative element having the highest priority that contains said input key; and c) circuitry for outputting a mismatch signal indicating that the associated data that is being output is invalid, if no such associative element(s) is found, and a match signal indicating that the associated data that is being output is valid, if said input key is contained in one or more associative element(s).
22. Apparatus according to claim 20, in which the lower and/or the upper extreme value of one or more ranges is a non-negative value.
23. Apparatus according to claim 20, in which the associative elements of the key association data set are ranges of consecutive values having semi-open/semi-closed boundaries.
24. Apparatus according to claim 23, in which each range has a closed boundary as its lower boundary, and an open boundary as its upper boundary.
25. Apparatus according to claim 23, in which each range has a closed boundary as its upper boundary, and an open boundary as its lower boundary.
26. Apparatus according to claim 20, in which the ranges that correspond to different associative elements are non-overlapping ranges.
27. Apparatus according to claim 20, in which overlapping ranges are
. converted into one or more equivalent non-overlapping ranges by combining overlapping ranges by truncating overlapping portions from ranges having lower priority, while maintaining with no change, for each set of overlapping portions, a single portion having the highest priority within said set and by arranging the non-overlapping ranges of said equivalent set in a descending/ascending order, according to the boundary values of each of said ranges.
28. Apparatus according to claim 27, in which associated data values are extracted from the memory upon conducting a key search on the associative key data, said apparatus comprising: a) circuitry for seeking one or more associative equivalent non-overlapping ranges that may . contain a searched input key, upon receiving said input key; b) circuitry for outputting the associated data that corresponds to the associative equivalent non-overlapping range that contains said input key; and c) circuitry for outputting a mismatch signal, indicating that the associated data that is being output is invalid if no associative equivalent non-overlapping range is found, and a match signal indicating that the associated data that is being output is valid, if said input key is contained in said associative equivalent non-overlapping range.
29. Apparatus according to claims 20, 24 and 27, in which a match between an input key and an associative element is detected using a single comparison between said input key and the boundaries of equivalent non-overlapping ranges, said apparatus comprises: a) a first storage area for storing the boundary values of said equivalent non-overlapping data set in an ascending order; b) a second storage area for storing the associated data set in the locations corresponding to the locations of closed boundaries of said equivalent non-overlapping data set; c) a set of comparators for concurrently performing comparisons between each boundary, value stored in said first storage area and the input key, to determine whether said input key is larger than said boundary value; d) circuitry for issuing a TRUE value whenever a comparison result with said input key indicates that said input key is larger than said boundary value, and for issuing a FALSE value if said input key is equal to or smaller than said boundary value; e) an encoder for detecting a match whenever there is a transition of the comparison results from a TRUE value to a FALSE value, and for issuing the index of the last boundary value, for which the comparison result is a TRUE value; f) a third storage area for storing boundary type information, represented by a bit that indicates whether said boundary value is a close or open boundary, said bit being retrieved from the location in said third storage area defined by said index; and g) circuitry for outputting the associated data that corresponds to said index from the second storage area.
30. Apparatus according to claim 20, in which each associative element comprises two values, a first value which is the lower boundary of a range, and a second value which is an upper boundary of said range, said apparatus comprising: a) an ordered set of storage and detection units for storing said upper and lower boundaries and for detecting a key match represented by issuing a TRUE value by concurrently performing two comparison operations for said boundaries, a first comparison to determine whether the input key is larger than or equal to the range's lower boundary, and a second comparison to determine whether the input key is smaller than the range's upper boundary; b) circuitry for selecting the match with the highest priority, and for issuing the index of the match having the highest priority; and c) circuitry for outputting the associated data that corresponds to said index.
31. Apparatus according to claim 29 in which each storage and detection unit generates a validation flag for enabling/disabling a match detection.
32. Apparatus according to claim 23 or 24, in which a value that belongs to a range is represented by k bits representing the open boundary of said range by k+1 bits, such that a "0" logic value is assigned to k consecutive bits and a "1" logic value is assigned to the remaining bit.
33. Apparatus according to claim 20, in which each value that does not belong to a range and is beyond the open boundary of said range is represented by k+1 bits, such that a "0" logic value is assigned to k consecutive bits and a "1" logic value is assigned to the remaimng bit.
34. Apparatus according to claim 20, in which the range represents Classless Inter Domain Routing (CIDR) addresses.
35. Apparatus according to claim 20, in which an input key search is performed simultaneously in one or more associative elements that may contain said input key.
36. Apparatus according to claim 27, in which an input key search is performed simultaneously in one or more equivalent non-overlapping ranges that may contain said input key.
37. Apparatus for storing and outputting associative ranges and their associated data, and for seeking for matching ranges that may contain a searched input key, comprising: a) an Entry hst storage consisting of an ordered set of Range Words
(RW) devices each of which comprises: , a.l) a first memory cell for storing the lower boundary of an associative range; a.2) a second memory cell for storing the upper boundary of said associative range; a.3) an input for inputting said searched input key; a.4) a validation flag input for indicating that the said lower and upper boundaries are valid; a.5) an output for indicating a match whenever said validation flag input provides a valid indication, comprising said searched input key; said RW devices indexed according to their location, and the ranges stored in said RW devices being organized in a priority precedence order. b) a priority encoder for detecting the match indication from an RW device with the highest priority, said priority encoder comprising: b.l) inputs for receiving the outputs of the Range Word devices;" b.2) a first output for indicating a match; b.3) a second output for issuing the index of the matching RW device having the highest priority; c) a memory for storing said associated data from which the -data associated with the highest priority range having a match is output, said memory comprising: cl) a set of memory cells for storing said associated data, each data item of said associated data being stored in a location corresponding to the RW device which stores the range values associated with said data item ; c.2) an input of said second output of said priority encoder carrying the index of the match having the highest priority; and c.3) an output for outputting the data associated with the range having the highest priority match, by utilizing said input as a pointer to the location in which said associated data is stored.
38. Apparatus according to claim 37, wherein the range value stored in the first memory cell is a closed lower boundary, and the value stored in the second memory cell is an open upper boundary.
39. A Range Word device according to claims 37 and 38, comprising: a) a first comparator having a first input connected to the input of the searched input key and a second input connected to the first memory cell, and an output for issuing a TRUE indication whenever the value on said first input is smaller than the value on said second input; b) a second comparator having a first input connected to the input of said searched input key, a second input . connected to the second memory cell, and an output for issuing a TRUE indication whenever the value on said first input is smaller than the value on said second input; c) an inverter having an input connected to the output of said first comparator, and an output for outputting the inverted comparison result from said first comparator; d) a first AND gate having an input connected to the output of said inverter, and another input connected to the output of said second comparator, said first AND gate outputs a TRUE indication • whenever said searched key is smaller than the value stored in said second memory cell, and greater than or equal to the value stored in said first memory cell; and e) a second AND gate having an input connected to the output of said first AND gate, and another input connected to the validation flag input, said second AND gate outputs a TRUE indication whenever a vahd indication is obtained from said validation flag input, and a TRUE indication is input into said input from the output of said first AND gate.
40. Apparatus according to claim 21, in which overlapping ranges are converted into one or more equivalent non-overlapping ranges by combining overlapping ranges by truncating overlapping portions from ranges having lower priority, while maintaining with no change, for each set of overlapping portions, a single portion having the highest priority within said set and by arranging the equivalent non-overlapping ranges of said equivalent set in a descending/ascending order, according to the boundary values of each of said ranges, and each equivalent non-overlapping range has a closed boundary as its lower boundary and an open boundary as its upper boundary, comprising: a) an Entry List storage device consisting of an ordered set of memory cells for storing entries, each being a value that represents at least one boundary value of an equivalent non-overlapping range indexed according to its relative location, said entry comprising a β-bit value, said Entry List storage device comprising: a.l) an ordered set of boundary entries stored in the order of said equivalent non-overlapping ranges, wherein an index 1 is assigned to the first boundary value of the first equivalent non-overlapping range stored in the first memory cell, and the last boundary value, with index i, is stored in the i-th memory cell; a.2) zero values stored in all of the remaining memory cells that do not contain boundary values; ircuitry for detecting a match between a. searched input key and an equivalent non-overlapping range, and for issuing the index of the matching equivalent non-overlapping range, comprising: b.l) a £-bit key input for inputting said searched input key; b.2) an input for inputting an Empty flag indication representing a state wherein said Entry List storage device is empty; b.3) an ordered set of &-bit inputs, each connected to the output of a corresponding memory cell from said Entry List storage device; b.4) a set of ordered comparators each, except for the first comparator, comprising: b.4.1) a first input connected to a corresponding A-bit input; b.4.2) a second input connected to said £-bit key input; b.4.3) an output for outputting a TRUE indication whenever the value of said first input is smaller than the value of said second input, and a FALSE indication whenever the value of said first input is greater than the value of said second input; b.4.4) circuitry for producing a logic "1" whenever a zero value is obtained on said first input, such that zero values obtained on said first input are expanded in said comparators into a k+1 bit value having "1" at their most significant location, and zeros in all of the remaining locations; b.5) a first comparator that comprises: b.5.1) a first input connected to the first /2-bit input; b.5.2) a second input connected to said £-bit key input; b.5.3) an output for outputting a TRUE indication whenever the value of said first input is smaller than the value of said second input, and a FALSE indication whenever the value of said first input is greater than the value of said second input; b.6) a Range Encoder for producing the index of a matching range whenever said Entry List storage device is not empty, by detecting the transition point of the outputs of said set of ordered comparators from a series of consecutive TRUE indications to a FALSE indication, and for producing an indication whenever said searched input key is larger than any entry in said Entry List storage device; Boundary Type storage device for storing and outputting a match or mismatch indication whenever said index of a matching range value that is received corresponds to a closed boundary value, said Boundary Type storage device comprising: cl) an ordered set of storage device containing boundary type bits, each corresponding to a memory cell in said Entry List storage device, utihzed for storing "1" whenever a closed boundary is stored in the corresponding memory cell, and for storing "0" whenever an open boundary is stored in said memory cell; c.2) an input for inputting said index; c3) an output for outputting said boundary type bit that is utilized for indicating a match or a mismatch; c.4) circuitry for outputting said boundary type bits on said output, utilizing the index value received on said input to select the boundary type bit from said ordered set of storage device; d) associated data storage device for storing and outputting the data associated with each range of said equivalent non-overlapping set of ranges, said associated data storage device comprising: d.l) an ordered set of memory cells for storing associated data in locations that correspond to the locations of the closed boundary values having association with said associated data; d.2) an input for inputting said index; d.3) an output for outputting associated data stored in said ordered set of memory cells; d.4) circuitry for outputting said associated data on said output, utilizing the index value received on said input to retrieve said associated data from said ordered set of memory cells; and e) circuitry for disabling/enabling the output from said Boundary Type storage device by utilizing the indication of a searched input key that is larger than any entry in said Entry List storage device, to disable/enable the output from said Boundary Type storage device.
41. Apparatus according to claim 40, in which the Range Encoder comprises: a) a set of ordered inputs for receiving the outputs of said set of ordered comparators; b) an input for receiving an Entry List Empty indication, whenever said Entry List storage device does not comprise associative data; c) a first output for outputting the index of the matching range value; d) a second output for outputting an indication whenever said searched input key is larger than any range value stored in said Entry List storage device; and e) an encoder for outputting the index of the matching range.
PCT/IL2001/000595 2001-06-28 2001-06-28 Range content-addressable memory WO2003003250A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/IL2001/000595 WO2003003250A1 (en) 2001-06-28 2001-06-28 Range content-addressable memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/IL2001/000595 WO2003003250A1 (en) 2001-06-28 2001-06-28 Range content-addressable memory

Publications (1)

Publication Number Publication Date
WO2003003250A1 true WO2003003250A1 (en) 2003-01-09

Family

ID=11043064

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/IL2001/000595 WO2003003250A1 (en) 2001-06-28 2001-06-28 Range content-addressable memory

Country Status (1)

Country Link
WO (1) WO2003003250A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007072083A1 (en) 2005-12-23 2007-06-28 Prosidion Limited Treatment of type 2 diabetes with a combination of dpiv inhibitor and metformin or thiazolidinedione
EP2839832A2 (en) 2003-11-17 2015-02-25 Novartis AG Use of dipeptidyl peptidase IV inhibitors
EP3366283A1 (en) 2004-01-20 2018-08-29 Novartis AG Direct compression formulation and process
WO2018162722A1 (en) 2017-03-09 2018-09-13 Deutsches Institut Für Ernährungsforschung Potsdam-Rehbrücke Dpp-4 inhibitors for use in treating bone fractures
CN114615216A (en) * 2022-03-11 2022-06-10 深圳市风云实业有限公司 Routing table dynamic adjustment method based on switching chip

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5920886A (en) * 1997-03-14 1999-07-06 Music Semiconductor Corporation Accelerated hierarchical address filtering and translation using binary and ternary CAMs
US6237061B1 (en) * 1999-01-05 2001-05-22 Netlogic Microsystems, Inc. Method for longest prefix matching in a content addressable memory
US20020007446A1 (en) * 2000-02-08 2002-01-17 Moshe Stark Range content-addressable memory

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5920886A (en) * 1997-03-14 1999-07-06 Music Semiconductor Corporation Accelerated hierarchical address filtering and translation using binary and ternary CAMs
US6237061B1 (en) * 1999-01-05 2001-05-22 Netlogic Microsystems, Inc. Method for longest prefix matching in a content addressable memory
US20020007446A1 (en) * 2000-02-08 2002-01-17 Moshe Stark Range content-addressable memory

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
SHAH D ET AL: "Fast updating algorithms for TCAM", IEEE MICRO, JAN.-FEB. 2001, IEEE, USA, vol. 21, no. 1, pages 36 - 47, XP002203009, ISSN: 0272-1732 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2839832A2 (en) 2003-11-17 2015-02-25 Novartis AG Use of dipeptidyl peptidase IV inhibitors
EP3366283A1 (en) 2004-01-20 2018-08-29 Novartis AG Direct compression formulation and process
EP3738585A1 (en) 2004-01-20 2020-11-18 Novartis Ag Direct compression formulation and process
WO2007072083A1 (en) 2005-12-23 2007-06-28 Prosidion Limited Treatment of type 2 diabetes with a combination of dpiv inhibitor and metformin or thiazolidinedione
WO2018162722A1 (en) 2017-03-09 2018-09-13 Deutsches Institut Für Ernährungsforschung Potsdam-Rehbrücke Dpp-4 inhibitors for use in treating bone fractures
CN114615216A (en) * 2022-03-11 2022-06-10 深圳市风云实业有限公司 Routing table dynamic adjustment method based on switching chip

Similar Documents

Publication Publication Date Title
US6633953B2 (en) Range content-addressable memory
US6067574A (en) High speed routing using compressed tree process
EP1551141B1 (en) Apparatus and method using hashing for efficiently implementing an IP lookup solution in hardware
US7433871B2 (en) Efficient ipv4/ipv6 best matching prefix method and apparatus
US6289414B1 (en) Partially ordered cams used in ternary hierarchical address searching/sorting
US6728732B1 (en) Data structure using a tree bitmap and method for rapid classification of data in a database
CN107967219B (en) TCAM-based large-scale character string high-speed searching method
US6697363B1 (en) Method and apparatus for longest matching prefix determination in a communication network
US7986696B1 (en) Method and apparatus for longest prefix matching
US6985483B2 (en) Methods and systems for fast packet forwarding
EP1623347B1 (en) Comparison tree data structures and lookup operations
US7356033B2 (en) Method and apparatus for performing network routing with use of power efficient TCAM-based forwarding engine architectures
US20050149513A1 (en) Compressed prefix tree structure and method for traversing a compressed prefix tree
US20030093646A1 (en) RAM-based range content addressable memory
Le et al. Scalable tree-based architectures for IPv4/v6 lookup using prefix partitioning
JP4995125B2 (en) How to search fixed length data
KR100586461B1 (en) Method, Hardware Architecture and Recording Medium for Searching IP Address by Using Pipeline Binary Tree
US7249149B1 (en) Tree bitmap data structures and their use in performing lookup operations
US7478109B1 (en) Identification of a longest matching prefix based on a search of intervals corresponding to the prefixes
JP3881663B2 (en) Packet classification apparatus and method using field level tree
US7739445B1 (en) Circuit, apparatus, and method for extracting multiple matching entries from a content addressable memory (CAM) device
US20030208657A1 (en) Variable key type search engine and method therefor
WO2003003250A1 (en) Range content-addressable memory
KR101587756B1 (en) Apparatus and method for searching string data using bloom filter pre-searching
Erdem et al. Value-coded trie structure for high-performance IPv6 lookup

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A1

Designated state(s): AE AG AL AM AT AU AZ BA BB BG BR BY BZ CA CH CN CO CR CU CZ DE DK DM DZ EC EE ES FI GB GD GE GH GM HR HU ID IL IN IS JP KE KG KP KR KZ LC LK LR LS LT LU LV MA MD MG MK MN MW MX MZ NO NZ PL PT RO RU SD SE SG SI SK SL TJ TM TR TT TZ UA UG US UZ VN YU ZA ZW

AL Designated countries for regional patents

Kind code of ref document: A1

Designated state(s): GH GM KE LS MW MZ SD SL SZ TZ UG ZW AM AZ BY KG KZ MD RU TJ TM AT BE CH CY DE DK ES FI FR GB GR IE IT LU MC NL PT SE TR BF BJ CF CG CI CM GA GN GW ML MR NE SN TD TG

121 Ep: the epo has been informed by wipo that ep was designated in this application
REG Reference to national code

Ref country code: DE

Ref legal event code: 8642

122 Ep: pct application non-entry in european phase
NENP Non-entry into the national phase

Ref country code: JP