CN101620623A - Method and device for managing list item of content addressable memory CAM - Google Patents

Method and device for managing list item of content addressable memory CAM Download PDF

Info

Publication number
CN101620623A
CN101620623A CN200910091223A CN200910091223A CN101620623A CN 101620623 A CN101620623 A CN 101620623A CN 200910091223 A CN200910091223 A CN 200910091223A CN 200910091223 A CN200910091223 A CN 200910091223A CN 101620623 A CN101620623 A CN 101620623A
Authority
CN
China
Prior art keywords
list item
information
module
cam
coupling
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN200910091223A
Other languages
Chinese (zh)
Inventor
赵里遥
祁正林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies Co 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 Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN200910091223A priority Critical patent/CN101620623A/en
Publication of CN101620623A publication Critical patent/CN101620623A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses a method and a device for managing list items of a content addressable memory CAM. The method comprises the following steps: storing a priority level message which corresponds to each list item of the content addressable memory CAM; and when a plurality of matched list items are obtained by searching data to match the list items of the content addressable memory CAM, selecting one matched list item according to the priority level message which corresponds to each matched list item or the priority level message or a matched address message which corresponds to each matched list item. The invention is easy to realize and has high efficiency.

Description

Content addressable memory items management method and device
Technical field
The present invention relates to field of computer technology, refer to a kind of Content Addressable Memory content-addressable memory item management method and device especially.
Background technology
Content Addressable Memory (CAM, Content Addressable memory) is a kind of special computers storer that is used for high-speed search, be the hardware search engine that provides of application, have with respect to the searching method that uses algorithm seek rate faster for sensitivity search time.
CAM has two kinds of citation forms: double Content Addressable Memory (BCAM, Binary CAM) and Ternary Content Addressable Memory (TCAM, Ternary CAM).BCAM is a kind of simple CAM, supports the storage and the search of two disable bit (0 or 1).TCAM supports the third matching status " to be indifferent to ", with " X " expression, is used to provide search flexibly.For example, TCAM has stored a list item and has been " 10XX0 ", and this list item will mate any one in four search in " 10000 " " 10010 " " 10100 " " 10110 ".With respect to BCAM, the extra search dirigibility of TCAM also is accompanied by extra expense, promptly internal storage unit must be able to encode 3 kinds may states, and BCAM only need encode two kinds may states.This extra state is usually by caring about for all storage unit increases or unconcerned masked bits realizes.
Sensitive application search time of two the most frequently used use CAM is that the message in the router/switch is transmitted and classification.
The random-access memory (ram) technology of transmitting with the IP package commonly used is, in RAM, deposit IP address and other relevant entries of port, in the process that execution is searched, based on certain software algorithm, obtaining data in the appropriate address by the address of input among the RAM, judge then whether these data are needed addresses, is then from the corresponding list item of this address output, its route querying mainly is based on the algorithm of software, is finished by packet handler (PP) usually.
Access control list (ACL) is an orderly statement collection, has widely to use, as the classification of message etc.ACL is one, to be handled by different modes matching the message of different rules based on rule and message are mated, as allowing or the refusal message.Traditional network is finished in the mode that ACL table mainly cooperates by software or software and hardware aspect searching, and treatment effeciency is low, has been called the bottleneck of equipment performance gradually.In switching equipment, the visit of frequently ACL being shown that brings is handled in multi-service, makes the switching equipment handling property descend greatly.
BCAM can realize route or acl lookup fast, but BCAM can not store the flexible ACL territory that changes of elongated route prefix or position, thereby causes the waste of storage space.TCAM proposes in order to address this problem.The advantage of TCAM is very flexible on the length requirement of its list item of preserving, promptly can preserve the key word list item of random length in same TCAM chip.Each list item among the TCAM all is to be made of content item and mask entry two parts, can shield each of storage space like this, does not need the data bit handled thereby mask easily, improves processing speed thus.
The appearance of TCAM in the CAM field is because the longest prefix match standard of route is the application of example explanation TCAM in route data is transmitted below with the route.
Router, switch are when transmitting the IP package, and forwarding engine need be searched the pairing routing iinformation of destination address in this IP message in routing table, thereby determines this IP message forwarding mode.The routing table of a simplification is as shown in table 1:
Numbering The address Outbound port
??1 ??101XX ??A
??2 ??0110X ??B
??3 ??011XX ??C
??4 ??10011 ??D
Table 1
In a series of activities process that message is transmitted, the most key with the routing table lookup process, the speed that improves routing table lookup has also correspondingly improved the performance of router.
Fig. 1 is a principle schematic of using routing table shown in the TCAM realization table 1 in the prior art.
Fig. 2 is the system architecture diagram that uses routing table shown in the TCAM realization table 1 in the prior art.Referring to Fig. 2, the capacity of TCAM is by the degree of depth and field (degree of depth * word is wide) expression, the wherein jumping figure of the degree of depth=all list items; The figure place of field=each list item.
Fig. 3 is the 4 * 5bit TCAM module map of simplifying in the prior art based on the NOR structure.As shown in Figure 3, the CAM core cell is arranged in the word of four levels, and 5 bits of each word (bit) are long.Core cell comprises memory circuit and comparator circuit.In Fig. 3, scounting line (Search line) prolongs the vertical direction operation, and the broadcast search data are given the CAM unit; Matched line (match line) then prolongs horizontal direction and passes array and indicate the word whether search data mates this row.The list item of a coupling of matched line indication of an activation, unmatched list item of matched line indication of a deactivation simultaneously.Matched line is imported into scrambler through behind the sensor amplifier, is used to export the address of corresponding field coupling list item.The type of output match address has following three kinds:
(1) binary coding (Binary Encoded): the binary mode output of match address is provided.When having multiple coupling, TCAM returns minimum or the highest match address.
(2) single coupling is not encoded (Single-match Un-encoded): the decoded form output of match address is provided.The output width equals the TCAM degree of depth, and a list item among each corresponding TCAM of output.When having multiple coupling, the position of the minimum or the highest match address correspondence of TCAM output.
(3) multiple coupling is not encoded (Multi-Match Un-encoded): the decoded form output of match address is provided for the multiaddress (multi-address) configuration.The output width equals the TCAM degree of depth, and a list item among each corresponding TCAM of data.When having multiple coupling, TCAM has output in each of match address correspondence.
Last match address is used to comprise the RAM addressing of outbound port tabulation.CAM/RAM system shown in Figure 2 is the complete realization of an address search engine.The output of TCAM match address is actually a pointer that is used to obtain the RAM related data, and in this example, the RAM related data is an outbound port.Use the CAM search to improve the speed of inquiry greatly, generally the maximum inquiry times of finishing with per second is weighed the efficient of search.This parameter is relevant with the storage data width of device work clock and configuration, generally uses the CAM per second can finish up to a hundred million times inquiry.
As can be seen, CAM is for after the coupling of the key word of supporting random length introduces " being indifferent to ", and a consequence of bringing is that CAM searches and has multiple coupling.CAM need choose a lookup result that conduct is last in a plurality of list items of these couplings.For the requirement of the initial hit coupling of the longest prefix match principle that adapts to route and ACL, CAM returns minimum or the highest match address when having stipulated multiple coupling.General CAM is defined in the list item of all couplings and chooses the minimum list item in address as last result, has brought the problem of the list item management of CAM like this, is the example explanation with the route table items management below.
Return under the configuration of lowest address when multiple coupling, in order to ensure the longest prefix match of route, TCAM need guarantee that the long route of prefix is kept at before the short route of prefix, and then the route of being preserved among the TCAM should be as shown in table 2:
0 Prefix length is 32 route
1 Prefix length is 31 route
2 Prefix length is 30 route
...... ??......
N-1 Prefix length is 9 route
N Prefix length is 8 route
M-1 Idle list item
Table 2
The study of route and aging mechanism can bring dynamically updating of route table items, and this must relate to the deletion and the increase of route table items.And there have new route table items to add to be fashionable at every turn, still must keep the long route of prefix in the order of prefix than short route front.Because route is dynamic, the problem that all exists list item to increase or delete at any time.And when entry updating, search coupling and can not carry out, during this period of time message need be buffered in the message buffer renewal of waiting for route table items and finishes.Therefore, if the renewal speed of route table items is slow, then the capacity to the system message buffer zone has very big requirement.
At present, mainly rely on software that the route table items in the TCAM space is distributed dynamically and adjust, the mode of similar memory management is finished the maintenance and the renewal of content-addressable memory item.When inserting list item, expansion downwards earlier if the base address can expand the free space that needs downwards, is then directly inserted downwards; If expansion failure downwards, then upwards expansion, even the base address upwards can expand the space that needs, and then directly inserts downwards; If downward, upwards all failures of expansion then in the continuous free space of existing maximum, are found out an assignable new region, integral body copies in the middle of the new zone, and the storage area that will use before discharges.If the continuous free space of existing maximum distributes inadequately, then carry out the CAM memory scrubbing, and memory fragmentation combines, distribute once more.For example, be that example describes with following table 1~6:
Figure G2009100912232D00051
Table 3 table 4 table 5 table 6 table 7 table 8
Suppose that the original operating position of TCAM is as shown in table 3, had the 1st, 2,4 and 6 list item, order is carried out following entry updating process afterwards:
(1) insert the 3rd list item, owing to there is idle zone above the list item 4, therefore directly insert list item 3 on list item 4, the TCAM operating position of this moment is as shown in table 4.
(2) insert the 7th list item, owing to there is idle zone after the list item 6, therefore directly insert list item 7 in the back of list item 6, the TCAM operating position of this moment is as shown in table 5.
(3) insert the 5th list item, owing to do not had the clear area in the middle of portrait 4 and the list item 6, therefore need in area of space, find an enough big zone, existing and newly-increased part integral body is copied in the newly assigned zone, discharge original zone again, the TCAM operating position of this moment is as shown in table 6.
(4) 900 list items of insertion 8~908, exist space 1 and space 2 among the TCAM this moment, and hypothesis space 1 and space 2 have only the space of 500 list items of storage respectively, and when then inserting 900 list items again, the size in space 1 and space 2 is all not enough separately.At this moment, need carry out memory scrubbing to TCAM, the TCAM after the arrangement is as shown in table 7, and two clear areas are merged together, and can distribute the zone of 900 list items, directly inserts 900 list items in list item 7 backs, obtains TCAM as shown in table 8.
From top description as can be seen, there is following shortcoming in existing C AM list item Managed Solution:
1, software realize complicated, to the maintenance of content-addressable memory item with upgrade and need to realize the searching of similar memory management, move and function such as defragmentation.
2, content-addressable memory item update efficiency is low, particularly has under the situation of a large amount of list items interpolations and deletion.In real network, the occasions such as route flapping that the study of dynamic routing and the variation of network topology bring often are accompanied by the routing update of a large amount of high speeds; The ACL list item dynamically issues application scenarios such as attack protection, anti-virus, and agreement all can cause operations such as moving of content-addressable memory item to a large amount of uses of ACL resource.This can cause the occupied time of CPU long, and other tasks can not get scheduling.
3, study and aging mechanism can bring dynamically updating of list item, this must relate to the deletion and the increase of list item, adding of the new list item that promptly at every turn has is fashionable, still must keep each list item between sequencing, for example in routing table, keep the front of long prefix route in short prefix route.In general, during entry updating, searching of list item mated and can not be carried out, and message need be buffered in the message buffer in the time of entry updating, and the capacity of therefore slower entry updating meeting system message buffer zone has very big requirement.
In sum, existing C AM list item Managed Solution is realized complicated, and efficient is low.
Summary of the invention
The invention provides a kind of content-addressable memory item management method, this method realizes simple, and the efficient height.
The present invention also provides three kinds of content-addressable memory item management devices, and these devices are realized simple, and the efficient height.
For achieving the above object, technical scheme of the present invention specifically is achieved in that
The disclosure of the present invention a kind of content-addressable memory item management method, this method comprises:
Preserve each the list item corresponding priorities information among the CAM;
When carry out content-addressable memory item coupling according to search data, when obtaining a plurality of coupling list item, according to these a plurality of coupling list items corresponding priorities information separately, perhaps, select one to mate list item according to this a plurality of coupling list items corresponding priorities information and match address information separately.
The invention discloses a kind of content-addressable memory item management devices, this device comprises: precedence information module, search module and selection module, wherein,
The precedence information module, each the list item corresponding priorities information that is used for preserving CAM;
Search module is used for mating according to the list item of search data to CAM, when obtaining a plurality of coupling list item, resulting a plurality of coupling list items is sent to the selection module;
Select module, be used for obtaining this a plurality of coupling list item corresponding priorities information,, select a coupling list item according to these a plurality of coupling list item corresponding priorities information from the precedence information module; Perhaps, be used to obtain the match address information of these a plurality of coupling list items, and obtain this a plurality of coupling list item corresponding priorities information from the precedence information module, according to these a plurality of coupling list items corresponding priorities information and match address information separately, select a coupling list item.
The invention also discloses a kind of content-addressable memory item management devices, this device comprises: precedence information module, search module and selection module, wherein,
The precedence information module, each the list item corresponding priorities information that is used for preserving CAM;
Search module is used for mating according to the list item of search data to CAM, when obtaining a plurality of coupling list item, resulting a plurality of coupling list items is sent to the precedence information module;
The precedence information module is used for when a plurality of coupling list item that receives that search module sends, and the precedence information of these a plurality of coupling list items is sent to the selection module; Perhaps be used to obtain the match address information of these a plurality of coupling list items, and precedence information that will these a plurality of coupling list items sends to the selection module after appending on the corresponding match address information;
Select module, be used for according to these a plurality of coupling list item corresponding priorities information, selecting one to mate list item when the precedence information module receives a plurality of coupling list item corresponding priorities information; Perhaps, be used for from the precedence information module receive these a plurality of coupling list items with the match address information of precedence information the time, according to a plurality of coupling list items corresponding priorities information and match address information separately, selects one to mate list item earlier.
The invention also discloses a kind of content-addressable memory item management devices, comprise: CAM module and coding module, the pairing matched line of each list item in the described CAM module is connected with coding module, preserve the match address information of each list item in the CAM module in the coding module, also preserved the precedence information of each list item in the CAM module in the coding module;
Described coding module is used for when receiving the matched signal of a plurality of matched lines, according to the precedence information of the pairing a plurality of list items of these a plurality of matched lines, selects a list item; Perhaps, select a list item, and export the match address information of selected list item according to the precedence information and the match address information of the pairing a plurality of list items of these a plurality of matched lines.
The invention also discloses a kind of content-addressable memory item management devices; Comprise: CAM module and coding module; The corresponding matched line of each list item in the described CAM module is connected with coding module; When coding module is received the signal of a plurality of list item couplings by matched line; Output CAM output data; Wherein, The corresponding CAM outputs data bits of each list item in the CAM module; And the value of the CAM outputs data bits corresponding with the coupling list item is particular value; This content-addressable memory item management devices also comprises: priority information module and selection module
The priority information module is used for preserving pairing precedence information of each list item and match address information with the CAM module;
Select module, be used to receive CAM output from coding module, and be the data bit of particular value according to the value in the CAM output data, from the priority information module, obtain corresponding priority information and match address information, compare the priority information that is obtained, therefrom select a priority information, and export the match address of this priority information correspondence; Perhaps when the priority information that is relatively obtained, when still therefrom selecting a plurality of priority information, the match address information of the priority information correspondence of further relatively selecting is therefrom selected high or minimum match address information and output.
As seen from the above technical solution, each list item corresponding priorities information among this preservation of the present invention CAM, when carry out content-addressable memory item coupling according to search data, when obtaining a plurality of coupling list item, according to these a plurality of coupling list items corresponding priorities information separately, perhaps according to these a plurality of coupling list items corresponding priorities information and match address information separately, select the technical scheme of a coupling list item, when multiple coupling, can therefrom select a matching result according to priority information, therefore do not need as prior art, with the mode of similar memory management the content-addressable memory item is managed, when increasing a content-addressable memory item, only need in any clear area of CAM, add this list item, and the priority information of preserving this list item correspondence gets final product, thereby reduced that a large amount of list items add and the CPU holding time during deletion, the demand of packet buffer has improved efficient greatly in the update time of content-addressable memory item and entry updating time.
Description of drawings
Fig. 1 is a principle schematic of using routing table shown in the TCAM realization table 1 in the prior art;
Fig. 2 is the system architecture diagram that uses routing table shown in the TCAM realization table 1 in the prior art;
Fig. 3 is the 4 * 5bit TCAM module map of simplifying in the prior art based on the NOR structure;
Fig. 4 is the process flow diagram of a kind of content-addressable memory item of embodiment of the invention management method;
Fig. 5 is the synoptic diagram of existing C AM system;
Fig. 6 is the synoptic diagram of the content-addressable memory item management method in the embodiment of the invention 1;
Fig. 7 is the synoptic diagram of the content-addressable memory item management method during the IP route in the embodiment of the invention 1 is used;
Fig. 8 is the synoptic diagram of the content-addressable memory item management method in the embodiment of the invention 2;
Fig. 9 is the composition structured flowchart of a kind of content-addressable memory item of embodiment of the invention management devices;
Figure 10 is the composition structured flowchart of another the content-addressable memory item management devices in the embodiment of the invention.
Embodiment
Fig. 4 is the process flow diagram of a kind of content-addressable memory item of embodiment of the invention management method.As shown in Figure 4, this method comprises:
Step 401 is preserved each the list item corresponding priorities information among the CAM.
In this step, the priority information of list item can be decided according to actual conditions by the user.For example, in the application of route prefix, according to the longest prefix match principle of route, the length of the route prefix of preserving in list item is long more, and then the right of priority of this list item is high more.
Step 402, when carry out content-addressable memory item coupling according to search data, when obtaining a plurality of coupling list item, according to these a plurality of coupling list items corresponding priorities information separately, perhaps, select one to mate list item according to this a plurality of coupling list items corresponding priorities information and match address information separately.
In this step, when selecting, at first select, if still select a plurality of coupling list items according to priority information according to precedence information and match address Information Selection coupling list item, then further select, select the high or minimum list item of match address according to predetermined policy according to match address.
Therefore scheme shown in Figure 4 makes when multiple coupling, can therefrom select a matching result according to priority information, does not need as prior art, with the mode of similar memory management the content-addressable memory item is managed.When increasing a content-addressable memory item, only need in any clear area of CAM, add this list item, and the priority information of preserving this list item correspondence gets final product, thereby reduced that a large amount of list items add and the demand of packet buffer in the update time of the CPU holding time during deletion, content-addressable memory item and entry updating time.
For making purpose of the present invention, technical scheme and advantage clearer, below with reference to accompanying drawing and embodiment, the present invention is described in more detail.
Embodiment 1
In the prior art, when CAM is that binary coding (Binary Encoded) way of output or single coupling be not when encoding (Single-match Un-encoded) way of output, when having multiple coupling, CAM need choose a lookup result that conduct is last in the list item of these couplings.In order to adapt to the needs of practical application, need as the longest prefix match of route and the initial hit coupling of ACL, CAM returns the highest or minimum match address when having stipulated multiple coupling, general provision is chosen the minimum list item in address as last result in all coupling list items of CAM.This just need be in CAM during the storage item content, stores in a certain order, thereby has brought the problem of content-addressable memory item complex management.
Fig. 5 is the synoptic diagram of existing C AM system.As shown in Figure 5, when carrying out the CAM coupling according to search data, storage data 2 and two list items of storage data w-2 hit, and the match address of wherein storing data 2 correspondences is 0001, the match address of storage data w-2 correspondence is 1110, and scrambler is therefrom selected 0001 output of minimum match address.Among Fig. 5, for the initial hit coupling of the longest prefix match that guarantees route or ACL, TCAM need guarantee that the long route of prefix is kept at before the short route of prefix, and the ACL specification that perhaps priority level is high is placed on before the low acl rule of priority level.It is very complicated that route/ACL among this TCAM that just makes upgrades work, and the existing management of content-addressable memory becomes the task of a difficulty.
In present embodiment 1, in order to solve the problem of content-addressable memory item management, increase a territory in the coding for the pairing matched line output of each list item among the CAM, preserve the precedence information of corresponding list item in this territory.When CAM need export single matching result, promptly under the Binary Encoded way of output or the Single-match Un-encoded way of output, the precedence information of comparison match list item, perhaps the precedence information of comparison match list item and match address information are finally selected an output result.
Fig. 6 is the synoptic diagram of the content-addressable memory item management method in the embodiment of the invention 1.As shown in Figure 6, increase a territory in the coding for the pairing matched line output of each list item among the CAM, preserve the precedence information of corresponding list item in this territory.The coding of matched line output here is the match address corresponding with each list item in the scrambler.When carrying out content-addressable memory item coupling according to search data, storage data 1, storage data 2 and three list items of storage data w-2 hit.Wherein, (priority, the address) of storage data 1 correspondence is to being (0020,0000), and (priority, the address) of storage data 2 correspondences is to being (0010,0001), and (priority, the address) of storage data w-2 correspondence is to being (0010,1110).Scrambler selects (priority, the address) of minimum coupling that (0010,0001) is exported.Wherein, elder generation is priority relatively, draws optimum storage data 2 and store data w-2, relatively stores the address of data 2 and storage data w-2 then, draws the storage data 2 of lowest address wherein.In addition, (priority, address) distich can also be combined into an integer and once relatively obtain the result, obvious (priority, address) in the integer that is unified into, precedence portion has higher position power, and the address has lower position power.
For the application of IP routing forwarding, minimum (priority, address) to preferential configuration under, can simply priority be defined as: the length of the route prefix in the maximum length of route prefix (being generally 32)-this list item.
Fig. 7 is the synoptic diagram of the content-addressable memory item management method during the IP route in the embodiment of the invention 1 is used.As shown in Figure 7, the priority of each list item is defined as: the length of the route prefix in this list item of 32-.And hexadecimal representation is all used in priority and address.If when then carrying out content-addressable memory item coupling according to search data, prefix length is that 16 route, prefix length are that 30 route and prefix length are that three list items of route of 32 hit, and wherein, prefix length is the (priority of 16 route correspondence, the address) to being (0010,0000), prefix length is that (priority, the address) of 30 route correspondence is to being (0002,0001), prefix length is that (priority, the address) of 32 route correspondence is to being (0000,1110).Scrambler is selected priority value minimum (0000,1110), and output address 1110 wherein, and promptly prefix length is that 32 route is hit.
Embodiment 2
In present embodiment 2, for the do not encode CAM of (Multi-Match Un-encoded) way of output of multiple coupling, its output data width equals the TCAM degree of depth, and corresponding CAM carry-out bit of each list item, then be that each CAM carry-out bit increases a corresponding domain in the present embodiment, preserve in this corresponding domain corresponding CAM carry-out bit the precedence information of corresponding list item.When needs were exported single matching result, according to the precedence information of CAM output data comparison match list item, perhaps the precedence information of comparison match list item and match address information were finally selected an output result.
Fig. 8 is the synoptic diagram of the content-addressable memory item management method in the embodiment of the invention 2.As shown in Figure 8, in the CAM system of this Multi-Match Un-encoded way of output, the degree of depth of TCAM list item is 32, and then the width of CAM output data also is 32, when promptly carrying out content-addressable memory item coupling according to search data at every turn, the data that scrambler output is 32,32 positions in these data are corresponding one by one with 32 list items, if certain list item hits, then Dui Ying carry-out bit is a designated value, be 1 in the present embodiment, then corresponding carry-out bit is that 0 corresponding list item of expression does not hit.In the present embodiment, increase a priority information table, this table comprises the territory corresponding with each CAM carry-out bit, preserve in each territory corresponding CAM carry-out bit the precedence information and the match address information of corresponding list item.
For example, in Fig. 8, after carrying out content-addressable memory item coupling according to the search data of input, the CAM output data of scrambler output is 4,000 0002 (scale-of-eight), second list item and the penult list item of 32 list items of expression hit, from the priority information table, find out and second list item and the corresponding (right of priority of penult list item according to the CAM output data, the address) right, promptly find out the 2nd and the 31st (right of priority, the address) right, be specially: (0010,0001) and (0001,1110), by relatively exporting 1110.
In the embodiment shown in fig. 8, do not need to revise existing C AM system, only need the priority information table be set, and after the CAM output, select to get final product according to output data.
In the above-described embodiments, be applied as example with the content-addressable memory item in route prefix and ACL and be illustrated, in addition, content-addressable memory item management method of the present invention can also be used in the application such as management of tunnel (tunnel) termination, MAC address entries, FDB list item.
Next provide the content-addressable memory item management devices among the present invention.
Fig. 9 is the composition structured flowchart of a kind of content-addressable memory item of embodiment of the invention management devices.As shown in Figure 9, this device comprises: precedence information module 901, search module 902 and selection module 903.
In Fig. 9, precedence information module 901, each the list item corresponding priorities information that is used for preserving CAM; Search module 902 is used for mating according to the list item of search data to CAM, when obtaining a plurality of coupling list item, resulting a plurality of coupling list items is sent to select module 903; Select module 903, be used for obtaining this a plurality of coupling list item corresponding priorities information,, select a coupling list item according to these a plurality of coupling list item corresponding priorities information from the precedence information module; Perhaps, be used to obtain the match address information of these a plurality of coupling list items, and obtain this a plurality of coupling list item corresponding priorities information from the precedence information module, according to these a plurality of coupling list items corresponding priorities information and match address information separately, select a coupling list item.
In Fig. 9, select module 903, be used for selecting, if still select a plurality of list items according to the pairing separately precedence information of a plurality of coupling list items, then, therefrom select a high or minimum list item of match address further according to the match address information of a plurality of list items of this selection.
Figure 10 is the composition structured flowchart of another the content-addressable memory item management devices in the embodiment of the invention.As shown in figure 10, this device comprises: precedence information module 1001, search module 1002 and selection module 1003, wherein,
Precedence information module 1001, each the list item corresponding priorities information that is used for preserving CAM;
Search module 1002 is used for mating according to the list item of search data to CAM, when obtaining a plurality of coupling list item, resulting a plurality of coupling list items is sent to precedence information module 1001;
Precedence information module 1001 is used for when a plurality of coupling list item that receives that search module 1002 sends, and the precedence information of these a plurality of coupling list items is sent to select module 1003; Perhaps be used to obtain the match address information of these a plurality of coupling list items, and precedence information that will these a plurality of coupling list items sends to and selects module 1003 after appending on the corresponding match address information;
Select module 1003, be used for according to these a plurality of coupling list item corresponding priorities information, selecting one to mate list item when precedence information module 1001 receives a plurality of coupling list item corresponding priorities information; Perhaps, be used for from precedence information module 1001 receive these a plurality of coupling list items with the match address information of precedence information the time, according to a plurality of coupling list items corresponding priorities information and match address information separately, selects one to mate list item earlier.
The third content-addressable memory item management devices in the embodiment of the invention comprises: CAM module and coding module, the pairing matched line of each list item in the described CAM module is connected with coding module, preserved the match address information of each list item in the CAM module in the coding module, it is characterized in that, also preserved the precedence information of each list item in the CAM module in the coding module; Wherein:
Described coding module is used for when receiving the matched signal of a plurality of matched lines, according to the precedence information of the pairing a plurality of list items of these a plurality of matched lines, selects a list item; Perhaps, select a list item, and export the match address information of selected list item according to the precedence information and the match address information of the pairing a plurality of list items of these a plurality of matched lines.
The realization of the third content-addressable memory item management devices in the present embodiment is identical with mode shown in Figure 6.
The 4th kind of content-addressable memory item management devices in the embodiment of the invention comprises: CAM module and coding module, the pairing matched line of each list item in the described CAM module is connected with coding module, when coding module is received the signal of a plurality of list item couplings by matched line, output CAM output data, wherein, the corresponding CAM outputs data bits of each list item in the CAM module, and the value of the CAM outputs data bits corresponding with the coupling list item is a particular value, this content-addressable memory item management devices and existing scheme are not really, also comprise: priority information module and selection module, wherein:
The priority information module is used for preserving pairing precedence information of each list item and match address information with the CAM module;
Select module, be used to receive CAM output from coding module, and be the data bit of particular value according to the value in the CAM output data, from the priority information module, obtain corresponding priority information and match address information, compare the priority information that is obtained, therefrom select a priority information, and export the match address of this priority information correspondence; Perhaps when the priority information that is relatively obtained, when still therefrom selecting a plurality of priority information, the match address information of the priority information correspondence of further relatively selecting is therefrom selected high or minimum match address information and output.
The realization of the 4th kind of content-addressable memory item management devices in the present embodiment is identical with mode shown in Figure 8.
In sum, each list item corresponding priorities information among this preservation of the present invention CAM, when carry out content-addressable memory item coupling according to search data, when obtaining a plurality of coupling list item, according to these a plurality of coupling list items corresponding priorities information separately, perhaps according to these a plurality of coupling list items corresponding priorities information and match address information separately, select the technical scheme of a coupling list item, when multiple coupling, can therefrom select a matching result according to priority information, therefore do not need as prior art, with the mode of similar memory management the content-addressable memory item is managed, when increasing a content-addressable memory item, only need in any clear area of CAM, add this list item, and the priority information of preserving this list item correspondence gets final product, thereby reduced that a large amount of list items add and the CPU holding time during deletion, the demand of packet buffer has improved efficient greatly in the update time of content-addressable memory item and entry updating time.
The above is preferred embodiment of the present invention only, is not to be used to limit protection scope of the present invention, all any modifications of being made within the spirit and principles in the present invention, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (11)

1, a kind of Content Addressable Memory content-addressable memory item management method is characterized in that this method comprises:
Preserve each the list item corresponding priorities information among the CAM;
When carry out content-addressable memory item coupling according to search data, when obtaining a plurality of coupling list item, according to these a plurality of coupling list items corresponding priorities information separately, perhaps, select one to mate list item according to this a plurality of coupling list items corresponding priorities information and match address information separately.
2, the method for claim 1 is characterized in that, each the list item corresponding priorities information among the described preservation CAM comprises:
When CAM is the binary coding way of output or single coupling uncoded output mode, increase a territory in the coding for the pairing matched line output of each list item among the CAM, preserve the precedence information of corresponding list item in this territory;
Perhaps, when CAM was multiple coupling uncoded output mode, the corresponding CAM carry-out bit of each list item then be that each CAM carry-out bit increases a corresponding domain, in this corresponding domain the corresponding CAM carry-out bit of preservation the precedence information of corresponding list item.
3, the method for claim 1 is characterized in that, each the list item corresponding priorities information among the described preservation CAM comprises:
When needs increase a list item in CAM, add this list item in any clear area of CAM, and preserve this list item corresponding priorities information.
4, method as claimed in claim 3 is characterized in that, this method further comprises: revise the list item corresponding priorities information among the CAM.
5, as each described method in the claim 1 to 4, it is characterized in that,
When the content in the content-addressable memory item was route prefix, the precedence information of a list item was: the maximum length of route prefix deducts the length of the route prefix in this list item.
6, as each described method in the claim 1 to 4, it is characterized in that, according to pairing separately precedence information of these a plurality of coupling list items and match address information, select a coupling list item to comprise: at first to select according to the pairing separately precedence information of a plurality of coupling list items, if still select a plurality of list items, then, therefrom select a high or minimum list item of match address further according to the match address information of a plurality of list items of this selection.
7, a kind of content-addressable memory item management devices is characterized in that this device comprises: precedence information module, search module and selection module, wherein,
The precedence information module, each the list item corresponding priorities information that is used for preserving CAM;
Search module is used for mating according to the list item of search data to CAM, when obtaining a plurality of coupling list item, resulting a plurality of coupling list items is sent to the selection module;
Select module, be used for obtaining this a plurality of coupling list item corresponding priorities information,, select a coupling list item according to these a plurality of coupling list item corresponding priorities information from the precedence information module; Perhaps, be used to obtain the match address information of these a plurality of coupling list items, and obtain this a plurality of coupling list item corresponding priorities information from the precedence information module, according to these a plurality of coupling list items corresponding priorities information and match address information separately, select a coupling list item.
8, content-addressable memory item management devices as claimed in claim 7 is characterized in that,
Described selection module, be used for selecting according to the pairing separately precedence information of a plurality of coupling list items, if still select a plurality of list items, then, therefrom select a high or minimum list item of match address further according to the match address information of a plurality of list items of this selection.
9, a kind of content-addressable memory item management devices is characterized in that this device comprises: precedence information module, search module and selection module, wherein,
The precedence information module, each the list item corresponding priorities information that is used for preserving CAM;
Search module is used for mating according to the list item of search data to CAM, when obtaining a plurality of coupling list item, resulting a plurality of coupling list items is sent to the precedence information module;
The precedence information module is used for when a plurality of coupling list item that receives that search module sends, and the precedence information of these a plurality of coupling list items is sent to the selection module; Perhaps be used to obtain the match address information of these a plurality of coupling list items, and precedence information that will these a plurality of coupling list items sends to the selection module after appending on the corresponding match address information;
Select module, be used for according to these a plurality of coupling list item corresponding priorities information, selecting one to mate list item when the precedence information module receives a plurality of coupling list item corresponding priorities information; Perhaps, be used for from the precedence information module receive these a plurality of coupling list items with the match address information of precedence information the time, according to a plurality of coupling list items corresponding priorities information and match address information separately, selects one to mate list item earlier.
10, a kind of content-addressable memory item management devices, comprise: CAM module and coding module, the pairing matched line of each list item in the described CAM module is connected with coding module, preserved the match address information of each list item in the CAM module in the coding module, it is characterized in that, also preserved the precedence information of each list item in the CAM module in the coding module;
Described coding module is used for when receiving the matched signal of a plurality of matched lines, according to the precedence information of the pairing a plurality of list items of these a plurality of matched lines, selects a list item; Perhaps, select a list item, and export the match address information of selected list item according to the precedence information and the match address information of the pairing a plurality of list items of these a plurality of matched lines.
11, a kind of content-addressable memory item management devices; Comprise: CAM module and coding module; The corresponding matched line of each list item in the described CAM module is connected with coding module; When coding module is received the signal of a plurality of list item couplings by matched line; Output CAM output data; Wherein, The corresponding CAM outputs data bits of each list item in the CAM module; And the value of the CAM outputs data bits corresponding with the coupling list item is particular value; It is characterized in that; This content-addressable memory item management devices also comprises: priority information module and selection module
The priority information module is used for preserving pairing precedence information of each list item and match address information with the CAM module;
Select module, be used to receive CAM output from coding module, and be the data bit of particular value according to the value in the CAM output data, from the priority information module, obtain corresponding priority information and match address information, compare the priority information that is obtained, therefrom select a priority information, and export the match address of this priority information correspondence; Perhaps when the priority information that is relatively obtained, when still therefrom selecting a plurality of priority information, the match address information of the priority information correspondence of further relatively selecting is therefrom selected high or minimum match address information and output.
CN200910091223A 2009-08-12 2009-08-12 Method and device for managing list item of content addressable memory CAM Pending CN101620623A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200910091223A CN101620623A (en) 2009-08-12 2009-08-12 Method and device for managing list item of content addressable memory CAM

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200910091223A CN101620623A (en) 2009-08-12 2009-08-12 Method and device for managing list item of content addressable memory CAM

Publications (1)

Publication Number Publication Date
CN101620623A true CN101620623A (en) 2010-01-06

Family

ID=41513862

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200910091223A Pending CN101620623A (en) 2009-08-12 2009-08-12 Method and device for managing list item of content addressable memory CAM

Country Status (1)

Country Link
CN (1) CN101620623A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102289453A (en) * 2011-06-20 2011-12-21 北京星网锐捷网络技术有限公司 TCAM (ternary content addressable memory) rule storing method, device and network equipment
CN102843298A (en) * 2012-09-12 2012-12-26 盛科网络(苏州)有限公司 Method and system for achieving priority of Openflow switchboard chip flow tables
CN103915114A (en) * 2014-04-01 2014-07-09 苏州无离信息技术有限公司 High-density ternary content addressable memory (TCAM) unit structure
CN104200838A (en) * 2014-08-28 2014-12-10 平湖凌云信息科技有限公司 Content addressable memory (CAM) and intelligent similarity matching method
CN104468361A (en) * 2014-12-15 2015-03-25 盛科网络(苏州)有限公司 Storing and searching method and device for TCAM with priorities
WO2016045316A1 (en) * 2014-09-22 2016-03-31 中兴通讯股份有限公司 Method and apparatus for controlling soft-reset data recovery, and packet transport network device
CN105608021A (en) * 2015-08-17 2016-05-25 上海磁宇信息科技有限公司 Storage device and method capable of utilizing content addressing MRAM (Magnetic Random Access Memory)
US10545867B2 (en) 2015-06-26 2020-01-28 Sanechips Technology Co., Ltd. Device and method for enhancing item access bandwidth and atomic operation
CN112311698A (en) * 2020-09-28 2021-02-02 清华大学无锡应用技术研究院 Method, device and storage medium for processing network data packet
CN114050997A (en) * 2020-07-23 2022-02-15 科尔奇普投资公司 Method and system for processing packets according to table lookup

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102289453A (en) * 2011-06-20 2011-12-21 北京星网锐捷网络技术有限公司 TCAM (ternary content addressable memory) rule storing method, device and network equipment
CN102289453B (en) * 2011-06-20 2013-09-18 北京星网锐捷网络技术有限公司 TCAM (ternary content addressable memory) rule storing method, device and network equipment
CN102843298A (en) * 2012-09-12 2012-12-26 盛科网络(苏州)有限公司 Method and system for achieving priority of Openflow switchboard chip flow tables
CN102843298B (en) * 2012-09-12 2015-08-05 盛科网络(苏州)有限公司 Realize the method and system of exchanger chip Openflow stream table priority
CN103915114A (en) * 2014-04-01 2014-07-09 苏州无离信息技术有限公司 High-density ternary content addressable memory (TCAM) unit structure
CN104200838A (en) * 2014-08-28 2014-12-10 平湖凌云信息科技有限公司 Content addressable memory (CAM) and intelligent similarity matching method
CN104200838B (en) * 2014-08-28 2016-08-24 平湖凌云信息科技有限公司 content addressable memory and similarity intelligent matching method
CN105516001A (en) * 2014-09-22 2016-04-20 中兴通讯股份有限公司 Method and device for controlling data recovery after soft reset, and packet transport network equipment
WO2016045316A1 (en) * 2014-09-22 2016-03-31 中兴通讯股份有限公司 Method and apparatus for controlling soft-reset data recovery, and packet transport network device
CN104468361A (en) * 2014-12-15 2015-03-25 盛科网络(苏州)有限公司 Storing and searching method and device for TCAM with priorities
US10545867B2 (en) 2015-06-26 2020-01-28 Sanechips Technology Co., Ltd. Device and method for enhancing item access bandwidth and atomic operation
CN105608021A (en) * 2015-08-17 2016-05-25 上海磁宇信息科技有限公司 Storage device and method capable of utilizing content addressing MRAM (Magnetic Random Access Memory)
CN105608021B (en) * 2015-08-17 2019-03-19 上海磁宇信息科技有限公司 It is a kind of to utilize content addressed MRAM memory device and method
CN114050997A (en) * 2020-07-23 2022-02-15 科尔奇普投资公司 Method and system for processing packets according to table lookup
CN112311698A (en) * 2020-09-28 2021-02-02 清华大学无锡应用技术研究院 Method, device and storage medium for processing network data packet
CN112311698B (en) * 2020-09-28 2021-08-24 清华大学无锡应用技术研究院 Method, device and storage medium for processing network data packet

Similar Documents

Publication Publication Date Title
CN101620623A (en) Method and device for managing list item of content addressable memory CAM
US6434144B1 (en) Multi-level table lookup
US7606236B2 (en) Forwarding information base lookup method
Bando et al. Flashtrie: Hash-based prefix-compressed trie for IP route lookup beyond 100Gbps
US8780926B2 (en) Updating prefix-compressed tries for IP route lookup
US7774538B2 (en) Method for ternary contents address memory table management
US6985483B2 (en) Methods and systems for fast packet forwarding
US7630373B2 (en) Packet transfer apparatus
EP1486040B1 (en) Vlan table management system for memory efficient lookups and inserts in hardware-based packet switches
US7019674B2 (en) Content-based information retrieval architecture
EP1551141A1 (en) Apparatus and method using hashing for efficiently implementing an IP lookup solution in hardware
CN101141389B (en) Reinforcement multidigit Trie tree searching method and apparatus
US9871727B2 (en) Routing lookup method and device and method for constructing B-tree structure
CN107528783B (en) IP route caching with two search phases for prefix length
Bando et al. FlashTrie: beyond 100-Gb/s IP route lookup using hash-based prefix-compressed trie
CN109981464A (en) A kind of TCAM circuit structure and its matching process realized in FPGA
CN103973571A (en) Network processor and routing searching method
JP2006246488A (en) Network router, address processing method, and computer program
US20030023581A1 (en) Method and system for performing a longest prefix match search
US20230367720A1 (en) Data search method and apparatus, and integrated circuit
Li et al. Deterministic and efficient hash table lookup using discriminated vectors
Ghosh et al. A hash based architecture of longest prefix matching for fast IP processing
CN107204926B (en) Rapid route searching method for preprocessing cache
US20210250272A1 (en) Network communication method and apparatus
Song et al. Rwhash: Rewritable hash table for fast network processing with dynamic membership updates

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Open date: 20100106