CN104468361A - Storing and searching method and device for TCAM with priorities - Google Patents

Storing and searching method and device for TCAM with priorities Download PDF

Info

Publication number
CN104468361A
CN104468361A CN201410777440.8A CN201410777440A CN104468361A CN 104468361 A CN104468361 A CN 104468361A CN 201410777440 A CN201410777440 A CN 201410777440A CN 104468361 A CN104468361 A CN 104468361A
Authority
CN
China
Prior art keywords
tcam
list item
priority
search rule
stores
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
CN201410777440.8A
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.)
Centec Networks Suzhou Co Ltd
Original Assignee
Centec Networks Suzhou 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 Centec Networks Suzhou Co Ltd filed Critical Centec Networks Suzhou Co Ltd
Priority to CN201410777440.8A priority Critical patent/CN104468361A/en
Publication of CN104468361A publication Critical patent/CN104468361A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a storing and searching method and device for a TCAM with priorities. The method includes the steps that the priorities of searching rules storied in TCAM table items are configured, when at least one searching rule needs to be added to the TCAM table items, added searching rules are stored in unoccupied table items of the TCAM, corresponding priorities are configured for the added searching rules, keywords in a message are matched with the searching rules in the TCAM table items, and if a plurality of table items are matched with the keywords simultaneously, actions corresponding to the searching rules with the highest priorities in the TCAM table items are executed. According to the method and device, searching and executing actions can be accurately executed, and the problems of complexity and error probability of software are solved to a large extent.

Description

TCAM with priority stores and lookup method and device
Technical field
The present invention relates to network communication technology field, especially relate in a kind of network processing unit or its process chip and storing and lookup method and device with the TCAM of priority.
Background technology
TCAM (Ternary Content Addressable Memory, three-state content addressing memory), is a kind of memory based on binary content inquiry, is mainly used in classifying to message.TCAM is provided with some list items, and stores the action corresponding with TCAM list item in RAM (Random Access Memory, static random access memory).In the process of carrying out message classification, the keyword in a message and the list item in TCAM are mated, if there is the keyword match success in a list item and this message, then action corresponding to this list item is performed to this message.Due to the fast finding mechanism of TCAM, a lot of network chip manufacturer adopts TCAM usually when designing and storing matched rule at present, such as stores ACL(Access Control List, Access Control List (ACL)), route or other search rule.
If the mechanism of searching due to TCAM is the keyword match success had in a list item and this message, then perform relative list item action, when mating if multinomial, then perform the action being arranged in the most front rule correspondence simultaneously.If what store is routing rule, because route will meet the longest coupling, this is when issuing in routing rule to TCAM, rule the longest for mask is then needed to be placed on foremost, short for mask is put behind, and once add longer mask, the resettlement of original rule in TCAM likely can be caused, therefore need the resettlement algorithm of a set of complexity to carry out the resettlement of processing rule.
Prior art is moved by software processing rule, but need software consideration many factors, such as moves efficiency, room fragment compression arranges, considerably increase the complexity of software, and the continuous change of rule in TCAM can be caused due to resettlement and change, thus affect searching of rule.
Summary of the invention
The object of the invention is to the defect overcoming prior art, a kind of TCAM with priority is provided to store and lookup method and device, in TCAM search rule, add the strategy of priority match, to realize not needing software processing rule to move, the accuracy of searching and performing an action can be reached.
For achieving the above object, the present invention proposes following technical scheme: a kind of TCAM with priority stores and lookup method, the priority of each search rule stored in configuration TCAM list item, keyword in message is mated with the search rule in described TCAM list item, if when having multiple list item to mate simultaneously, then perform the action that the highest search rule of described TCAM list item medium priority is corresponding.
Preferably, the storage of described search rule in described TCAM list item is continuous print.
Preferably, the search rule of described TCAM list item is ACL or route.
Another technical scheme that the present invention proposes: a kind of TCAM with priority stores and lookup method, the priority of each search rule stored in configuration TCAM list item, if when increasing by least one search rule in described TCAM list item, then the described search rule increased is stored in the vacant list item of TCAM, and the priority that configuration is corresponding, keyword in message is mated with the search rule in described TCAM list item, if when having multiple list item to mate simultaneously, then perform the action that the highest search rule of described TCAM list item medium priority is corresponding.
Preferably, the storage of described search rule in described TCAM list item is continuous print.
Preferably, the search rule of described TCAM list item is ACL or route.
Another technical scheme that the present invention proposes: a kind of TCAM with priority stores and searches device, comprise network processing unit, TCAM list item and RAM memory, the search rule stored in described TCAM list item is configured with corresponding priority, network processing unit extracts keyword and inputs to described TCAM list item from message, described keyword contrasts with described TCAM list item, if there is multiple list item to mate simultaneously, then the address at described TCAM list item place the highest for the priority matched is inputed to described RAM memory, described network processing unit performs the corresponding action of the TCAM list item the highest with described priority that obtain from described RAM memory.
Preferably, if when increasing by least one search rule in described TCAM list item, then the described search rule increased is stored in the vacant list item of TCAM, and the priority that configuration is corresponding.
Preferably, the storage of described search rule in described TCAM list item is continuous print.
Preferably, the search rule of described TCAM list item is ACL or route.
Compared with prior art, the invention has the beneficial effects as follows: the present invention searches in mechanism at TCAM and adds priority concept, if there is multiple search rule to be matched in existing TCAM simultaneously, then can perform the action of the rule correspondence of first time coupling, and the present invention is owing to adding priority, if have multiple rule to match, then the rule action that execution priority is the highest simultaneously, the accuracy of searching and performing an action can be reached; In addition, in TCAM, increase storage search rule if existing, then need to be moved by software processing rule, and the present invention only need configure the preferential of search rule in TCAM list item, solves complexity and the error probability of software significantly.
Accompanying drawing explanation
Fig. 1 is the TCAM storage of the present invention with priority and the principle schematic of lookup method technical scheme one;
Fig. 2 is the schematic diagram of the present invention with the TCAM of priority;
Fig. 3 is the TCAM storage of the present invention with priority and the principle schematic of lookup method technical scheme two;
Fig. 4 is the principle schematic of existing TCAM route storage mechanism;
Fig. 5 is the principle schematic of the present invention with the TCAM route storage mechanism of priority;
Fig. 6 is that the present invention is with the TCAM storage of priority and the theory structure schematic diagram searching device.
Embodiment
Below in conjunction with accompanying drawing of the present invention, clear, complete description is carried out to the technical scheme of the embodiment of the present invention.
The disclosed TCAM with priority stores and lookup method.Shown in composition graphs 1 and Fig. 3, the priority of each search rule stored in configuration TCAM list item, as stored N bar search rule in TCAM list item, is respectively Rule 0, Rule 1 ... Rule N, configures corresponding priority to every bar Rule.The storage of search rule in TCAM list item is continuous print.
As shown in Figure 2, when if desired increasing by least one search rule in TCAM list item, then the search rule of increase is stored in the vacant list item of TCAM, and the priority that configuration is corresponding.
When adopting the present invention to carry out message classification, the keyword in message is mated with the search rule in TCAM list item, if when having multiple list item to mate simultaneously, then perform the action that the highest search rule of TCAM list item medium priority is corresponding.
The search rule of TCAM list item can be ACL or route or other search rule.
Be routing rule for what store in TCAM list item below, the present invention searched with priority TCAM, browsing process is described as follows:
Suppose to store 4 routes in TCAM, routing address is all 1.1.1.1, and mask is respectively 32,24,16,8, and they store in TCAM is continuous print.If need the route of a storage 1.1.1.1/25, if now adopt traditional TCAM, as shown in Figure 4, then needing mask is 24,16, and the entry of 8, toward moving down, leaves 1.1.1.1/25 in the position of 1.1.1.1/24.If it is 25,24 that the route storing a 1.1.1.1/26 more then needs mask, the entry of 16,8, toward moving down, leaves 1.1.1.1/26 in the position of 1.1.1.1/25.So just, the rule in TCAM can be moved frequently.
If adopt the TCAM with priority, as shown in Figure 5, only need to change priority corresponding to TCAM rule, as above example, if need the route of a storage 1.1.1.1/25, a needs finds an empty position in TCAM, and the priority arranging this route is 25, if need the route of a storage 1.1.1.1/26, in TCAM, in like manner look for the position that empty, and the priority arranging this route is 26.Do not need the rule in mobile TCAM like this, just can reach the accuracy of searching and performing an action.
The TCAM that the present invention is based on priority stores and lookup method, also correspondence discloses a kind of TCAM with priority storage and searches device, as shown in Figure 6, it comprises network processing unit NP, TCAM list item and RAM memory, the search rule stored in TCAM list item is configured with corresponding priority, network processing unit NP extracts keyword and inputs to TCAM list item from message, keyword contrasts with TCAM list item, if there is multiple list item to mate simultaneously, then the address at TCAM list item place the highest for the priority matched is inputed to RAM memory, network processing unit NP performs the corresponding action of the TCAM list item the highest with priority that obtain from RAM memory.
Technology contents of the present invention and technical characteristic have disclosed as above; but those of ordinary skill in the art still may do all replacement and the modification that do not deviate from spirit of the present invention based on teaching of the present invention and announcement; therefore; scope should be not limited to the content that embodiment discloses; and various do not deviate from replacement of the present invention and modification should be comprised, and contained by present patent application claim.

Claims (10)

1. the TCAM with priority stores and lookup method, it is characterized in that: the priority of each search rule stored in configuration TCAM list item, keyword in message is mated with the search rule in described TCAM list item, if when having multiple list item to mate simultaneously, then perform the action that the highest search rule of described TCAM list item medium priority is corresponding.
2. the TCAM with priority according to claim 1 stores and lookup method, and it is characterized in that, the storage of described search rule in described TCAM list item is continuous print.
3. the TCAM with priority according to claim 1 and 2 stores and lookup method, and it is characterized in that, the search rule of described TCAM list item is ACL or route.
4. the TCAM with priority stores and lookup method, it is characterized in that: the priority of each search rule stored in configuration TCAM list item, if when increasing by least one search rule in described TCAM list item, then the described search rule increased is stored in the vacant list item of TCAM, and the priority that configuration is corresponding, keyword in message is mated with the search rule in described TCAM list item, if when having multiple list item to mate simultaneously, then perform the action that the highest search rule of described TCAM list item medium priority is corresponding.
5. the TCAM with priority according to claim 4 stores and lookup method, and it is characterized in that, the storage of described search rule in described TCAM list item is continuous print.
6. the TCAM with priority according to claim 4 or 5 stores and lookup method, and it is characterized in that, the search rule of described TCAM list item is ACL or route.
7. the TCAM with priority stores and searches device, it is characterized in that: comprise network processing unit, TCAM list item and RAM memory, the search rule stored in described TCAM list item is configured with corresponding priority, network processing unit extracts keyword and inputs to described TCAM list item from message, described keyword contrasts with described TCAM list item, if there is multiple list item to mate simultaneously, then the address at described TCAM list item place the highest for the priority matched is inputed to described RAM memory, described network processing unit performs the corresponding action of the TCAM list item the highest with described priority that obtain from described RAM memory.
8. the TCAM with priority according to claim 7 stores and searches device, it is characterized in that, if when increasing by least one search rule in described TCAM list item, then the described search rule increased is stored in the vacant list item of TCAM, and the priority that configuration is corresponding.
9. the TCAM with priority according to claim 7 stores and searches device, and it is characterized in that, the storage of described search rule in described TCAM list item is continuous print.
10. the TCAM with priority according to claim 7 ~ 9 any one stores and searches device, and it is characterized in that, the search rule of described TCAM list item is ACL or route.
CN201410777440.8A 2014-12-15 2014-12-15 Storing and searching method and device for TCAM with priorities Pending CN104468361A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410777440.8A CN104468361A (en) 2014-12-15 2014-12-15 Storing and searching method and device for TCAM with priorities

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410777440.8A CN104468361A (en) 2014-12-15 2014-12-15 Storing and searching method and device for TCAM with priorities

Publications (1)

Publication Number Publication Date
CN104468361A true CN104468361A (en) 2015-03-25

Family

ID=52913759

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410777440.8A Pending CN104468361A (en) 2014-12-15 2014-12-15 Storing and searching method and device for TCAM with priorities

Country Status (1)

Country Link
CN (1) CN104468361A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106230791A (en) * 2016-07-20 2016-12-14 杭州迪普科技有限公司 A kind of method and apparatus of single business many strategies Rapid matching
CN106302174A (en) * 2015-06-12 2017-01-04 中兴通讯股份有限公司 A kind of method and device realizing route querying
CN108769045A (en) * 2018-06-07 2018-11-06 深圳市风云实业有限公司 Acl rule configuration method, device and the network equipment
CN109688126A (en) * 2018-12-19 2019-04-26 迈普通信技术股份有限公司 A kind of data processing method, the network equipment and computer readable storage medium
CN110191057A (en) * 2019-03-19 2019-08-30 鹏城实验室 Method for searching route and routing device
CN111131029A (en) * 2019-12-03 2020-05-08 长沙理工大学 High-energy-efficiency OpenFlow flow table lookup method supporting rule dependence
CN112311698A (en) * 2020-09-28 2021-02-02 清华大学无锡应用技术研究院 Method, device and storage medium for processing network data packet

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6944709B2 (en) * 1999-09-23 2005-09-13 Netlogic Microsystems, Inc. Content addressable memory with block-programmable mask write mode, word width and priority
CN101350771A (en) * 2008-07-07 2009-01-21 中国人民解放军国防科学技术大学 Method and system for storing elements of tri-state content addressable memory without ordering
CN101620623A (en) * 2009-08-12 2010-01-06 杭州华三通信技术有限公司 Method and device for managing list item of content addressable memory CAM

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6944709B2 (en) * 1999-09-23 2005-09-13 Netlogic Microsystems, Inc. Content addressable memory with block-programmable mask write mode, word width and priority
CN101350771A (en) * 2008-07-07 2009-01-21 中国人民解放军国防科学技术大学 Method and system for storing elements of tri-state content addressable memory without ordering
CN101620623A (en) * 2009-08-12 2010-01-06 杭州华三通信技术有限公司 Method and device for managing list item of content addressable memory CAM

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106302174A (en) * 2015-06-12 2017-01-04 中兴通讯股份有限公司 A kind of method and device realizing route querying
CN106230791A (en) * 2016-07-20 2016-12-14 杭州迪普科技有限公司 A kind of method and apparatus of single business many strategies Rapid matching
US10491636B2 (en) 2016-07-20 2019-11-26 Hangzhou Dptech Technologies Co., Ltd. Managing security policy
CN108769045A (en) * 2018-06-07 2018-11-06 深圳市风云实业有限公司 Acl rule configuration method, device and the network equipment
CN108769045B (en) * 2018-06-07 2020-09-29 深圳市风云实业有限公司 ACL rule configuration method, device and network equipment
CN109688126A (en) * 2018-12-19 2019-04-26 迈普通信技术股份有限公司 A kind of data processing method, the network equipment and computer readable storage medium
CN109688126B (en) * 2018-12-19 2021-08-17 迈普通信技术股份有限公司 Data processing method, network equipment and computer readable storage medium
CN110191057A (en) * 2019-03-19 2019-08-30 鹏城实验室 Method for searching route and routing device
CN111131029A (en) * 2019-12-03 2020-05-08 长沙理工大学 High-energy-efficiency OpenFlow flow table lookup method supporting rule dependence
CN111131029B (en) * 2019-12-03 2022-08-19 长沙理工大学 High-energy-efficiency OpenFlow flow table searching method supporting rule dependence
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
CN104468361A (en) Storing and searching method and device for TCAM with priorities
US9647941B2 (en) Hierarchical hashing for longest prefix matching
CN104580027B (en) A kind of OpenFlow message forwarding methods and equipment
CN102880724A (en) Method and system for processing Hash collision
CN103425725A (en) Hash collision reduction system
CN104104604A (en) Exact match hash lookup databases in network switch devices
WO2016184029A1 (en) Storage and lookup methods and apparatuses supporting hash lookup and routing lookup, and storage medium
CN103354522A (en) Method and device for searching multistage flow table
CN102298650B (en) Distributed recommendation method of massive digital information
EP3012747B1 (en) Tcam-based table query processing method and apparatus
CN100442255C (en) Associative memory with entry groups and skip operations
CN106789859B (en) Message matching method and device
US8180958B2 (en) Key selection device and process for content-addressable memory
US20170222937A1 (en) A memory efficient packet classification method
CN103902700A (en) Tree structure data processing method
CN101277252A (en) Method for traversing multi-branch Trie tree
CN101848248A (en) Rule searching method and device
CN115695014A (en) Access control list construction and data message processing method, device and system
CN104954263A (en) Method and device for searching target nodes of complex network
CN103581023A (en) Method and device for realizing longest mask matching
CN101478482A (en) Non-rule matching method, apparatus and system in packet classification
CN107196857B (en) Moving method and network equipment
US20130163595A1 (en) Packet classification apparatus and method for classifying packet thereof
CN104021192A (en) Database renewing method and device
US10366125B2 (en) Object display system for relationship graph

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20150325

WD01 Invention patent application deemed withdrawn after publication