Implementation method of three-state content addressable memory and device

A technology for addressing memory and an implementation method, which is applied in the field of three-state content addressable memory implementation, and can solve the problems that a single chip is difficult to achieve high capacity, increased complexity, and increased cost.

Inactive Publication Date: 2010-02-17
NEW H3C TECH CO LTD
0 Cites 14 Cited by

AI-Extracted Technical Summary

Problems solved by technology

[0004] The core of TCAM is to compare the input Key with the data and mask stored in TCAM by & (AND) operation. In order to achieve high search performance, it is necessary to compare the Key with all entries in TCAM in a short time. The number of rules increases, and the complexity of the comparison will be greatly increased
For example, TCAM stores 10,000 rules. In ord...
View more

Abstract

The invention discloses an implementation method of a three-state content addressable memory, applied to a device comprising a traditional TCAM and a cache module. The method comprises the following steps: acquiring a corresponding key from a received message by the cache module; searching whether a record item matched with the key exists in the cache module or not; returning the record item matched with the key if the record item matched with the key exists in the cache module; and sending the key to the traditional TCAM to search for a matched item if the record item matched with the key does not exist in the cache module. The invention generates a searching cache in a TCAM chip according to a searching key to solve the problems occurring in the prior TCAM.

Application Domain

Memory adressing/allocation/relocationData switching networks

Technology Topic

Content-addressable storageOperating system +1

Image

  • Implementation method of three-state content addressable memory and device
  • Implementation method of three-state content addressable memory and device
  • Implementation method of three-state content addressable memory and device

Examples

  • Experimental program(1)

Example Embodiment

[0041] The invention reduces the design difficulty of the traditional TCAM by adding a cache module. High-end routers generally forward on a packet-by-packet basis, that is to say, each packet checks routing or ACL; in fact, packets belonging to the same connection have the same attributes, such as 5-tuples (source IP address, destination IP address, source The port number, destination port, protocol number) are the same, TOS (Type-Of-Service, service type) is the same, and the key value is obtained through the above attributes. For the same attribute message, the key value is the same, and the same key value is checked The result of routing or information flow is the same.
[0042] If you consider that the same connection messages get the same results from the traditional TCAM check, assuming that there are 10 messages for each connection, the first message cannot find matching content in the cache module, so the cache module sends the Key Traditional TCAM, after TCAM finds a matching result, sends the result to the cache module. The next 9 messages can be found in the cache module to find the matching result. There is no need to send to the traditional TCAM. Then the traditional TCAM only needs the original 1 to achieve the same performance. /10 performance is sufficient, which will greatly reduce the complexity of the search system.
[0043] The present invention provides a three-state content addressable memory implementation method, which is applied to a device including a traditional TCAM and a cache module. The method is as figure 2 As shown, including the following steps:
[0044] Step 201: The cache module obtains the corresponding Key from the received message. The key value varies according to the different search purposes of the message. For example, for route search, the key value can be obtained from the destination IP address and the length is 32 bits; for ACL search, the key value is obtained from the five-tuple, and the length is 104 bits. Of course, the length of the key value needs to match the corresponding data and mask length in the TCAM table.
[0045] Step 202, search whether there is a record entry matching the Key in the cache module; if there is, go to step 203, if not, go to step 204.
[0046] Wherein, searching whether there is a record entry in the cache module that matches the Key specifically includes: setting in the cache module an input Key and a matching entry searched in the traditional TCAM using the input Key Correspondence: When receiving the input Key, search for matching entries in the correspondence. In addition, multiple correspondence tables may be recorded, and the correspondence tables respectively include correspondence relationships between keys of different lengths and corresponding search results.
[0047] Among them, the search method can transform an input key of any length into a fixed-length output key through Hash, and set the output key in the cache module to correspond to the matching table entry searched in the traditional TCAM using the input key corresponding to the output key. relationship. When looking up whether there is a record entry in the cache module that matches the Key, search for the output Key in the corresponding relationship, and if there is a match, look for the matching entry in the corresponding relationship; sometimes there may be multiple An input key of any length may be transformed into the same output key. Therefore, if there is more than one matching output key, it is necessary to further determine the matching output key according to the input key before the transformation corresponding to the output key. Find the matching table entry in the corresponding relationship.
[0048] Step 203: Return the record entry matching the Key to the initiator of the message.
[0049] Step 204: It is indicated that the Key represents the first packet of the new data stream, and the Key is sent to the traditional TCAM to find a matching entry. The traditional TCAM searches for all rules in the traditional TCAM according to the method of comparing Key&mask and data&mask, and returns the search result to the cache. The cache adds record entries according to the Key and the result returned by the traditional TCAM, and returns the result to the initiator. end.
[0050] The cache module sets a miss time stamp for each record entry, and when the record entry is full, the record entry with the oldest time stamp is replaced with a new record entry. Of course, in order to improve the efficiency of the system, it is also possible to delete several record entries with the oldest timestamp when the record entries are not full; it is also possible to delete certain record entries according to user requirements.
[0051] The present invention will be described in detail below in conjunction with specific application scenarios:
[0052] When a key is input to the search system, the key is generated by the five-tuple src_ip 1.1.1.1dest_ip 2.1.1.1 src_port 3000 dest_port 50000 protocol 80, that is, these 5 fields can be organized into a 104-bit Key. Look up whether there is a record entry that matches the key in the hash table. If there is, the search result will be returned directly. If not, it means this is the first packet of a new stream. The key needs to be sent to the traditional TCAM to check the ACL based on the mask. Obtain the record entry that matches the Key.
[0053] The traditional TCAM checks all the rules according to the method of comparing Key&mask with data&mask, and returns the search result to the cache. The cache creates a record based on the result of the Key and the traditional TCAM. This process is a new record, and the message with the same Key can be directly received in the future. Looked up in the cache.
[0054] In addition, the cache module also has an aging function. When an information flow ends, the key of the information flow will not enter the search system. Due to the limited size of the hash table in the cache, the records that are no longer used must be cleared: for each record Design a miss time stamp and replace the record with the oldest time stamp with a new record when the hash table is full.
[0055] The present invention provides a three-state content addressable memory realization device, including traditional TCAM and cache modules, such as image 3 Shown, where,
[0056] The cache module 310 is used to obtain the corresponding Key from the received message and find whether there is a record entry matching the Key in the cache module; if there is, it returns the record entry matching the Key, if not, then Indicates that the Key represents the first packet of a new data stream, and the Key is sent to the traditional TCAM to find a matching entry, and a record entry is added according to the Key and the result returned by the traditional TCAM; the Key of the ACL is The five-tuple of the IP message: source IP address, destination IP address, source port number, destination port, protocol number; the key of the route is the destination IP address. Among them, the Key can also be set according to the characteristics of other information streams.
[0057] The traditional TCAM 320 searches for all the rules in the traditional TCAM, and returns the search result to the cache. It is specifically used for searching all the rules in the traditional TCAM according to the method of comparing Key&mask and data&mask.
[0058] cache module, such as Figure 4 As shown, specifically including:
[0059] The Key lookup submodule 410 is used to obtain the corresponding Key from the received message, to find whether there is a record entry matching the Key in the cache module; if there is, return the record entry matching the Key, if If not, it means that the Key represents the first packet of a new data stream, and the Key is sent to the traditional TCAM to find a matching entry;
[0060] The key search submodule 410 is specifically configured to set the corresponding relationship between the input Key and the matching table entry searched in the traditional TCAM using the input Key in the cache module. When the input Key is received, the corresponding relationship is set in the corresponding relationship Find matching entries. In addition, multiple correspondences can be established based on keys of different lengths and corresponding search results. It is also possible to transform an input key of any length into an output key of a fixed length through Hash, and set the corresponding relationship between the output key and the input key corresponding to the output key in the traditional TCAM search in the traditional TCAM in the cache module, and search When there is a record entry matching the Key in the cache module, search for the matching output Key in the corresponding relationship. If there is more than one matching output Key, then according to the output key corresponding to the output key before transformation The input Key of further determines the matching output Key, and the matching table entry is searched in the corresponding relationship. Suppose there is a packet quintuple as src_ip 1.1.1.1 dest_ip 2.1.1.1 src_port3000 dest_port 50000 protocol 80, organize these 5 fields into a 104-bit Key, and see if there is a record entry that matches this Key in the hash table. If If yes, return the search result directly, if not, it means that this is the first packet of a new flow, and it needs to be sent to the traditional TCAM to check the ACL based on the mask.
[0061] The Key record sub-module 420 is used to add record entries according to the Key and the result returned by the traditional TCAM. This process is a new record, and the messages with the same Key in the future can be directly searched in the cache.
[0062] Because the size of the hash table in the cache is limited, the records that are no longer used must be cleared. Therefore, the Key record aging sub-module 430 is also included, which is used to set the miss timestamp for each record entry, when the record entry is full Replace the record entry with the oldest time stamp with the new record entry. Of course, in order to improve the efficiency of the system, it is also possible to delete several record entries with the oldest timestamp when the record entries are not full; it is also possible to delete certain record entries according to user requirements.
[0063] Through the description of the above embodiments, those skilled in the art can clearly understand that the present invention can be implemented by hardware, or can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution of the present invention can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (which can be a CD-ROM, U disk, mobile hard disk, etc.), including several The instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute the methods described in the various embodiments of the present invention.
[0064] Those skilled in the art can understand that the accompanying drawings are only schematic diagrams of preferred embodiments, and the modules or processes in the accompanying drawings are not necessarily necessary for implementing the present invention.
[0065] Those skilled in the art can understand that the modules in the device in the embodiment can be distributed in the device in the embodiment according to the description of the embodiment, or can be changed to be located in one or more devices different from this embodiment. The modules of the above-mentioned embodiments can be combined into one module, or further divided into multiple sub-modules.
[0066] The above-mentioned serial numbers of the present invention are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0067] The above-disclosed are only a few specific embodiments of the present invention, but the present invention is not limited thereto, and any changes that can be thought of by those skilled in the art should fall into the protection scope of the present invention.

PUM

no PUM

Description & Claims & Application Information

We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products