CN103248575A - Distribution method of TCAM (Ternary Content Addressable Memory) list item priority - Google Patents

Distribution method of TCAM (Ternary Content Addressable Memory) list item priority Download PDF

Info

Publication number
CN103248575A
CN103248575A CN2013101786604A CN201310178660A CN103248575A CN 103248575 A CN103248575 A CN 103248575A CN 2013101786604 A CN2013101786604 A CN 2013101786604A CN 201310178660 A CN201310178660 A CN 201310178660A CN 103248575 A CN103248575 A CN 103248575A
Authority
CN
China
Prior art keywords
list item
tcam
priority
moving
distribution method
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.)
Granted
Application number
CN2013101786604A
Other languages
Chinese (zh)
Other versions
CN103248575B (en
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.)
Suzhou Centec Communications 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 CN201310178660.4A priority Critical patent/CN103248575B/en
Publication of CN103248575A publication Critical patent/CN103248575A/en
Application granted granted Critical
Publication of CN103248575B publication Critical patent/CN103248575B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a distribution method of TCAM (Ternary Content Addressable Memory) list item priorities. When the priorities of TCAM list items are arranged, if the target position of a certain list item is a non-null position, list item moving quantity required for upwards moving and downwards moving the list item to the target position is compared and the moving direction corresponding to smaller list item moving quantity is selected as the moving direction of the list item; and when the smaller list item moving quantity is larger than a preset trigger value, the reordering algorithm of the list item priority is triggered and all list items in a TCAM are reordered to enable each list item to reach an optimum position, so that the priority arrangement speed of the TCAM list items is greatly improved.

Description

A kind of distribution method of TCAM list item priority
Technical field
The present invention relates to network communications technology field, relate in particular to the distribution method of TCAM list item medium priority in the Ethernet.
Background technology
The list item of TCAM (Ternary Content Addressable Memory, three-state content addressing memory) is according to an order all the time, and inquiry from top to bottom is coupling one by one, just stops inquiry at once if the match is successful.If in the TCAM table, have only a list item to mate, that just can only be a result; If there is many list items coupling, that just can only be priority high the match is successful, and low just can not mated of priority.So in Ethernet is used, in the visit such as ACL (Access Control List, Access Control List (ACL)), the possibility that has a plurality of list item couplings is just arranged, so the priority that needs a kind of mechanism to manage list item.
When arrangement TCAM list item priority, traditional way is according to given priority, and traversal finds the appropriate deposit position of this priority from high priority toward low priority.This deposit position may be empty, also may allow other list item account for.If empty, just do not need so to move and can use.If accounted for by other list item, that need be done earlier and move the position of vacateing a sky then and re-use.
Though this method can guarantee the correctness of prioritization, this scheme is not considered performance issue.Suppose that article one list item is first index position that is placed on TCAM, just the highest position of priority all adds a list item that priority is higher then at every turn, then needs all list items that at every turn all will move to descend the front.Following N bar list item, it is inferior to move 1+2+...+ (n-1).Therefore the list item of moving TCAM is a job consuming time, and this efficient is unusual poor efficiency in actual application, and especially when N is very big, it is consuming time more long that more under the list item move more.
Second shortcoming of this method be, the direction of moving is not according to moving what of number of times, but the direction that changes according to target list item priority: priority becomes when high from low, and moving is toward low direction; Priority becomes when low from height, and moving is toward high direction.The prior art scheme is defended tenaciously a direction, does not weigh the number of times of moving of both direction, is not optimum therefore.
Summary of the invention
One of purpose of the present invention is the moving method of putting priority among the TCAM in order by optimizing, and relatively two number of times of moving of moving direction find the best direction of moving, thereby simplifies the process of moving of list item.
Another object of the present invention is when the moving number of times and reach default certain condition of list item, then existing list item is resequenced, and makes the index after the rearrangement reach a kind of optimum state, and the number of times of moving after this state can make it reduces as much as possible.
For achieving the above object, the present invention proposes following technical scheme: a kind of distribution method of TCAM list item priority, when the priority of arrangement TCAM list item, if the target location of a certain list item is non-empty position, then relatively described list item is moved to described target location and moved number by upwards moving and moving required list item downwards, and select list item to move and count the less direction of moving that direction is described list item of moving.
Move number during greater than predefined trigger value when the described less list items of number of moving, then trigger the shuffle algorithm of list item priority, all list items among the TCAM are resequenced, make each list item arrive optimal location.
Described rearrangement is with all list items of whole TCAM discrete opening as much as possible.
Under the described shuffle algorithm, the optimal location that each list item is reset is:
The relative position of (number of the number of TCAM index/existing list item) the current list item of * in existing list item.
Described preset triggering conditions is calculated consuming time and list item according to software and is moved once setting consuming time.
When the priority of arrangement TCAM list item, if the target location of a certain list item is non-empty position, then at first need the list item of described target location is moved up or down, making destination locations is empty position.
When the priority of arrangement TCAM list item, if the target location of a certain list item is empty position, then directly described list item is moved to the target location.
Compared with prior art, the present invention no longer sticks to a direction moving on the direction, but considered two-way, empty for the purpose index is become, compared upwards to move and move needed list item downwards and moved number of times, chosen that less direction of number of times at last.Because upwards move and move downwards consuming time be impartial, so as long as guarantee number of times still less, just can guarantee to move consuming time shorter.
Secondly, the present invention proposes to trigger the mechanism of rearrangement, and namely when moving number of times and reach certain condition, shuffle algorithm is triggered, and all list items among the existing TCAM are resequenced, and makes it to reach a kind of state of optimum.The condition that triggers is a kind of experimental data, and it is consuming time to need balance comprise that software calculates, and list item moves once consuming time etc., its core is with all list items of whole TCAM discrete coming as much as possible, because Li San list item, the possibility of moving is just more little, and the number of times of moving is also more few.Under extreme conditions, the index of a sky is arranged between per two list items, the change of so any priority at most only need be moved once.So under shuffle algorithm, each list item has its optimal location, the computational methods of this position namely: (number of the number of TCAM index/existing list item) the current list item of * relative position in existing list item.This simple algorithm computational speed is fast, and the purpose index of list item is unique, and will have as much as possible that list item is discrete to come now, thereby has promoted the speed of arrangement priority greatly.
Description of drawings
Fig. 1 is the schematic flow sheet of TCAM list item medium priority distribution method of the present invention;
Fig. 2 A~C carries out the two-way schematic diagram of moving list item among the TCAM of the present invention;
Fig. 3 A~C be among the TCAM of the present invention when list item move number of times greater than preset value the time, the schematic diagram of list item rearrangement.
Embodiment
Below in conjunction with accompanying drawing of the present invention, the technical scheme in the preferred embodiment of the present invention is carried out clear, complete description.
The distribution method of list item priority among the TCAM that the present invention proposes, as shown in Figure 1, it is moved on the direction by relatively making progress, downwards behind the two-way number of times of moving, choosing and move the direction of moving that the less direction of number of times is list item list item.During TCAM shows shown in Fig. 2 A~C, have 6 list items, its index and priority are respectively that index 1 corresponding priorities is 100, index 2 corresponding priorities are 90, index 3 corresponding priorities are 80, index 4 corresponding priorities are 30, and index 5 corresponding priorities are 20, and index 7 corresponding priorities are 5.Priority with index in the list item 5 changes 50 into now, and then the target location of this index 5 is between priority 80 and priority 30.
Shown in Fig. 2 A, be that 80 index 3 and priority are that 30 4 of index do not have vacant position in priority, namely the target location of index 5 is non-NULL, therefore, at first need the list item of target location is moved to other positions this moment.If adopt the direction of upwards moving, then need to move 3 list items, shown in Fig. 2 B; If adopt the direction of moving downwards, then need to move 2 list items, shown in Fig. 2 C; The number of times of upwards moving and the coefficient of moving are downwards compared, draw and move number of times downwards still less, so take mode that the TCAM list item is moved downwards.
During for the moving number of times and reach predetermined conditions of list item, then the list item shuffle algorithm is triggered, thereby all list items among the existing TCAM are resequenced, and makes it reach a kind of state of optimum.The core concept of shuffle algorithm is with discrete the coming as much as possible of all list items among the whole TCAM, because Li San list item, the possibility of moving is just more little, and the number of times of moving is also just more few.
5 list items are arranged among the TCAM as Fig. 3 A~C, its index and priority are respectively: index 0 corresponding priorities is 100, and index 1 corresponding priorities is 90, and index 2 corresponding priorities are 80, index 3 corresponding priorities are 70, and index 4 corresponding priorities are 60.Now be that 60 list item changes priority 1 10 into priority, therefore the target location need move down index 0,1,2,3,4 respectively a position at index 0, needs to move 5 list items altogether.Suppose that predetermined conditions is 4 times, because this number of times of moving has arrived the condition that sets in advance, therefore triggered rearrangement.According to the given formula in front, the result of rearrangement is, all list items all at interval a position deposit, discrete coming as much as possible forms the arrangement mode after the rearrangement shown in Fig. 3 C, promoted the speed of arrangement priority among the TCAM greatly.
Technology contents of the present invention and technical characterictic have disclosed as above; yet those of ordinary skill in the art still may be based on teaching of the present invention and announcements and are done all replacement and modifications that does not deviate from spirit of the present invention; therefore; protection range of the present invention should be not limited to the content that embodiment discloses; and should comprise various do not deviate from replacement of the present invention and modifications, and contained by the present patent application claim.

Claims (10)

1. the distribution method of a TCAM list item priority, it is characterized in that: when the priority of arrangement TCAM list item, if the target location of a certain list item is non-empty position, then relatively described list item is moved to described target location and moved number by upwards moving and moving required list item downwards, and select list item to move and count the less direction of moving that direction is described list item of moving.
2. the distribution method of TCAM list item priority according to claim 1, it is characterized in that: when the described less list items of number of moving are moved number during greater than predefined trigger value, then trigger the shuffle algorithm of list item priority, all list items among the TCAM are resequenced, make each list item arrive optimal location.
3. the distribution method of TCAM list item priority according to claim 2 is characterized in that: described rearrangement is with all list items of whole TCAM discrete opening as much as possible.
4. according to the distribution method of claim 2 or 3 described TCAM list item priority, it is characterized in that: under the described shuffle algorithm, the optimal location that each list item is reset is:
The relative position of (number of the number of TCAM index/existing list item) the current list item of * in existing list item.
5. the distribution method of TCAM list item priority according to claim 2 is characterized in that: described preset triggering conditions is calculated consuming time and list item according to software and is moved once setting consuming time.
6. the distribution method of TCAM list item priority according to claim 1, it is characterized in that: when the priority of arrangement TCAM list item, if the target location of a certain list item is non-empty position, then at first need the list item of described target location is moved up or down, making destination locations is empty position.
7. the distribution method of TCAM list item priority according to claim 1 is characterized in that: when the priority of arrangement TCAM list item, if the target location of a certain list item is empty position, then directly described list item is moved to the target location.
8. the distribution method of a TCAM list item priority, it is characterized in that: when the priority of arrangement TCAM list item, if the target location of a certain list item is non-empty position, then relatively described list item is moved to described target location and moved number by upwards moving and moving required list item downwards, and when the less list item that obtains after is relatively moved number greater than predefined trigger condition, then trigger the shuffle algorithm of list item priority, all list items among the TCAM are resequenced, make each list item arrive optimal location.
9. the distribution method of TCAM list item priority according to claim 8 is characterized in that: under the described shuffle algorithm, the optimal location that each list item is reset is:
The relative position of (number of the number of TCAM index/existing list item) the current list item of * in existing list item.
10. the distribution method of TCAM list item priority according to claim 2 is characterized in that: described preset triggering conditions is calculated consuming time and list item according to software and is moved once setting consuming time.
CN201310178660.4A 2013-05-14 2013-05-14 A kind of distribution method of TCAM list item priority Active CN103248575B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310178660.4A CN103248575B (en) 2013-05-14 2013-05-14 A kind of distribution method of TCAM list item priority

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310178660.4A CN103248575B (en) 2013-05-14 2013-05-14 A kind of distribution method of TCAM list item priority

Publications (2)

Publication Number Publication Date
CN103248575A true CN103248575A (en) 2013-08-14
CN103248575B CN103248575B (en) 2016-09-14

Family

ID=48927803

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310178660.4A Active CN103248575B (en) 2013-05-14 2013-05-14 A kind of distribution method of TCAM list item priority

Country Status (1)

Country Link
CN (1) CN103248575B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109688126A (en) * 2018-12-19 2019-04-26 迈普通信技术股份有限公司 A kind of data processing method, the network equipment and computer readable storage medium
CN113656329A (en) * 2021-08-09 2021-11-16 国家计算机网络与信息安全管理中心 Mask rule insertion method based on TCAM, electronic equipment and storage medium
CN113901274A (en) * 2021-09-10 2022-01-07 锐捷网络股份有限公司 Method, device, equipment and medium for moving TCAM (ternary content addressable memory) table items
WO2022042742A1 (en) * 2020-08-31 2022-03-03 中兴通讯股份有限公司 Acl rule processing method and apparatus, computer device, and readable medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6886073B2 (en) * 2002-06-18 2005-04-26 International Business Machines Corporation Method and system for performing range rule testing in a ternary content addressable memory
US20060164425A1 (en) * 2005-01-24 2006-07-27 Ati Technologies, Inc. Methods and apparatus for updating a memory address remapping table
CN1862534A (en) * 2005-11-24 2006-11-15 华为技术有限公司 Method for managing and maintaining tatic range matching table
CN101447940A (en) * 2008-12-23 2009-06-03 杭州华三通信技术有限公司 Method and device for updating access control list rules

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6886073B2 (en) * 2002-06-18 2005-04-26 International Business Machines Corporation Method and system for performing range rule testing in a ternary content addressable memory
US20060164425A1 (en) * 2005-01-24 2006-07-27 Ati Technologies, Inc. Methods and apparatus for updating a memory address remapping table
CN1862534A (en) * 2005-11-24 2006-11-15 华为技术有限公司 Method for managing and maintaining tatic range matching table
CN101447940A (en) * 2008-12-23 2009-06-03 杭州华三通信技术有限公司 Method and device for updating access control list rules

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
赵峥嵘,李鹏,兰巨龙: "TCAM表项管理算法研究", 《微计算机信息》 *
邓黠,黄芝平,刘纯武,张羿猛: "TCAM路由表项管理算法优化研究", 《微计算机信息》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
WO2022042742A1 (en) * 2020-08-31 2022-03-03 中兴通讯股份有限公司 Acl rule processing method and apparatus, computer device, and readable medium
CN113656329A (en) * 2021-08-09 2021-11-16 国家计算机网络与信息安全管理中心 Mask rule insertion method based on TCAM, electronic equipment and storage medium
CN113656329B (en) * 2021-08-09 2024-02-02 国家计算机网络与信息安全管理中心 Mask rule insertion method based on TCAM, electronic equipment and storage medium
CN113901274A (en) * 2021-09-10 2022-01-07 锐捷网络股份有限公司 Method, device, equipment and medium for moving TCAM (ternary content addressable memory) table items
CN113901274B (en) * 2021-09-10 2023-03-21 锐捷网络股份有限公司 Method, device, equipment and medium for moving TCAM (ternary content addressable memory) table item

Also Published As

Publication number Publication date
CN103248575B (en) 2016-09-14

Similar Documents

Publication Publication Date Title
CN103248575A (en) Distribution method of TCAM (Ternary Content Addressable Memory) list item priority
CN104641616A (en) Low latency networking device using header prediction
US10027602B2 (en) Packet queue depth sorting scheme for switch fabric
US9020953B1 (en) Search table for data networking matching
EP2187580B1 (en) Method for scheduling packets of a plurality of flows and system for carrying out the method
US9876716B2 (en) Packet processing apparatus, flow entry configuration method and program
CN107704401A (en) Data cached method of replacing, system and storage system in a kind of storage system
CN107977738B (en) Multi-objective optimization control method for conveyor belt feeding processing station system
CN102521151A (en) Data caching method and device
CN104092612A (en) Method and device for updating matching order of fast forwarding table
CN106956882B (en) Method, device and system for picking up objects, and method and terminal for interacting picking-up information
CN103139732A (en) Improved short message sending method and system
CN106330765A (en) Cache distribution method and device
CN109720813A (en) A kind of special-shaped cigarette sorting method and sorting equipment based on virtual queue
CN101741737B (en) Maintenance method and device of route table
CN104717160A (en) Interchanger and scheduling algorithm
CN107632789A (en) Method, system and Data duplication detection method are deleted based on distributed storage again
CN103428099B (en) A kind of method of universal multi-core network processor flow control
CN110474845A (en) Flow entry eliminates method and relevant apparatus
CN100433009C (en) Method for managing and maintaining tatic range matching table
US7830797B1 (en) Preserving packet order for data flows when applying traffic shapers
CN102571973B (en) Network control method and device
CN102546423A (en) Method and device for queue scheduling and network device
CN103701721B (en) Message transmitting method and device
CN106330772B (en) Flow table sending method and OpenFlow controller in SDN

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CP03 Change of name, title or address

Address after: 215101 unit 13 / 16, 4th floor, building B, No. 5, Xinghan street, Suzhou Industrial Park, Jiangsu Province

Patentee after: Suzhou Shengke Communication Co.,Ltd.

Address before: 215021 unit 13 / 16, floor 4, building B, No. 5, Xinghan street, Suzhou Industrial Park, Suzhou City, Jiangsu Province

Patentee before: CENTEC NETWORKS (SU ZHOU) Co.,Ltd.

CP03 Change of name, title or address