CN105812262A - Method for realizing efficient data sorting in TCAM with mask management - Google Patents

Method for realizing efficient data sorting in TCAM with mask management Download PDF

Info

Publication number
CN105812262A
CN105812262A CN201610136171.6A CN201610136171A CN105812262A CN 105812262 A CN105812262 A CN 105812262A CN 201610136171 A CN201610136171 A CN 201610136171A CN 105812262 A CN105812262 A CN 105812262A
Authority
CN
China
Prior art keywords
tcam
block
mask
add
efficient data
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.)
Withdrawn
Application number
CN201610136171.6A
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 CN201610136171.6A priority Critical patent/CN105812262A/en
Publication of CN105812262A publication Critical patent/CN105812262A/en
Withdrawn legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing

Abstract

The invention discloses a method for realizing efficient data sorting in TCAM with mask management, and the method comprises the steps: TCAM is divided into a plurality of blocks according t the mask, and each block is distributed by size in advance or in average according to the arrangement of the routing table; each block comprises a left and a right to indicate the real position of start/end index of the block in TCAM; the internal of each block adopts a internal index management algorithm to acquire the index position, record maximum entry number and current used number of the block, and record which internal indexes are used. The method has an ability of quickly sorting operation functions and maximum move times.

Description

A kind of in the TCAM managed with mask efficient data sequence realize method
Technical field
The present invention relates to a kind of communication technique field, especially relate to a kind of in TCAM manage with mask efficient data sort realize method.
Background technology
In existing network, all of IP forwards and is all based on routing forwarding, and route is that in Software Protocol Stack, common algorithm has fib and trie tree etc. to realize the ability that addressing forwards according to LPM algorithm simultaneously;Owing to LPM algorithm itself does not define a public algorithm, as long as what therefore meet the behavior of LPM algorithm own is all called LPM algorithm.
In ipuc, common TCAM (ternarycontentaddressablememory, three-state content addressing memory, or claim ternary content addressable memorizer) sort algorithm, it is the operation inserted by traveling through key+mask to be then ranked up according to key+mask from the beginning to the end;In this algorithm, the interpolation/deletion each time for route will travel through, and then moves TCAM, causes the waste of substantial amounts of time.
As it is shown in figure 1, in existing routing table, increase the route of an xxx.xxx.xxx.xxx/15:
1, traversal routing table, on the left of Fig. 1, finds mask 16 > 15 > 14 so positions;
2, with reference to routing table, in the middle of Fig. 1, according to the position found, mask is big, all up move a position one by one;
3, with reference to routing table, on the right side of Fig. 1, the route newly increased is added on the position moving out;Delete a routing table and then carry out contrary operating process, move downwards after deletion and become left block from right block;Existing technically, it can be seen that shared chronic of operation, often carry out once-through operation simultaneously, all can carry out substantial amounts of moving number of times;Huge along with routing table, the time of consumption increases therewith.
Summary of the invention
It is an object of the invention to overcome the defect of prior art, it is provided that a kind of in the TCAM managed with mask efficient data sequence realize method.
For achieving the above object, the present invention proposes following technical scheme: a kind of in the TCAM managed with mask efficient data sequence realize method, carry out dividing multiple pieces (block) according to mask (mask) by TCAM in advance, each block distributes the size of block in advance according to the distribution of routing table, or divides equally;Each block has left and right, indicates the index original position in this block and index end position real index original position and index end position in TCAM;Each block is internal adopts inner cable to draw management algorithm, obtains index position, records the maximum entry number of this block simultaneously and has currently used number, and needs to record which internal index and have been used.
Preferably, described TCAM predistribution is that 32 block manage 32 different routes of mask.
Preferably, its method includes normal interpolation when adding route to move, normally add and need upwards to carry out to move, normally add and need to carry out downwards moving three kinds of modes.
Preferably, described normal interpolation theed add when routeing need not be moved, the block of correspondence is obtained according to MASK, by judge in corresponding blocks already with number (used_count) and corresponding blocks in maximum can with how many (max_count), confirm that current block also has position, by indexing one index position of distribution, add and route.
Preferably, described normal interpolation theed add when routeing needs upwards to move, the block of correspondence is obtained according to mask, by judge in corresponding blocks already with number (used_count) and corresponding blocks in maximum can with how many (max_count), confirm that current block does not have position, find previous block, judge also have position, then by obtaining last position of previous block, the left of current block is moved forward a unit, the right of a upper block also moves forward a position, number with max_count, then add and be routed to new position;When previous block is also without resource, then repeat to continue up to borrow, oneself the last item is moved to before by each block, vacant resource is moved current block, to add route, when block0 needs upwards to use resource, find block1 also without, then repeat upwards to use, it has been found that block32 has resource, then the Section Eight territory of oneself is moved on to the 4th region by block31, adjust block32_right, block31_left, then repeats up to move the 13rd region, is finally used in block0 in the 13rd region of block1.
Preferably, the described normally interpolation added when routeing needs the normally interpolation carried out downwards when moving with described interpolation route need not move identical.
Preferably, when previous piece also without resource, then repeating to continue up to borrow, oneself the last item is moved to before, vacant resource is moved current block, in order to add route by each piece.
Preferably, when block0 needs upwards to use resource, find block1 also without, then repeat upwards to use, it has been found that block32 has resource, then the Section Eight territory of oneself is moved on to the 4th region by block31, adjust block32_right, block31_left, then repeats up to move the 13rd region, is finally used in block0 in the 13rd region of block1.
The invention has the beneficial effects as follows: the present invention can rapid pin to this type of with mask management TCAM resource, carry out quick sorting operation;Maximum move the quantity that number of times is block.
Accompanying drawing explanation
Fig. 1 is in existing routing table, increases the schematic diagram of the route of an xxx.xxx.xxx.xxx/15;
Fig. 2 is the schematic diagram that TCAM carries out dividing multiple block in advance according to mask of the present invention;
Fig. 3 is that the present invention adds the schematic diagram being routed to new position on the basis of Fig. 2;
Fig. 4 is that the present invention needs to move the flow chart repeatedly completing a routing operations.
Detailed description of the invention
Below in conjunction with the accompanying drawing of the present invention, the technical scheme of the embodiment of the present invention is carried out clear, complete description.
Shown in Fig. 2, Fig. 3 and Fig. 4, disclosed a kind of in the TCAM managed with mask efficient data sequence realize method, it adopts brand-new LPM sort algorithm, for route with the feature being made without sequence in mask, be that 32 block manage 32 different routes of mask by TCAM predistribution, in this operation, it is possible to reduce route add/delete time move number of times, if even had vacant position, it may not be necessary to move and can complete operation.It is embodied as follows:
Referring again to Fig. 2, in advance TCAM is carried out dividing, according to mask, the size that multiple block, each block can distribute block in advance according to the distribution of routing table, or divide equally;Each block has left and right, indicates start/endindex (index original position and index end position) the real start/endindex position in TCAM of this block;Each block is internal adopts inner cable to draw management algorithm, obtain index position, record the maximum entry number (max_count) of this block simultaneously and currently used number (used_count), and needing to record which internal index and have been used.
When adding route, it is broadly divided into 3 modes:
1, normal interpolation need not be moved: when adding route, according to the MASK block obtaining correspondence, by judging used_count and max_count, confirms that current block also has position, by indexing one index position of distribution, adds and route.
2, need upwards to move: when adding route, the block of correspondence is obtained according to mask, by judging used_count and max_count, confirm that current block does not have position, find previous block, it is judged that also have position, then by obtaining last position of previous block, the left of current block moves forward a unit, and the right of a upper block also moves forward a position, with the number of new max_count;Then add and be routed to new position, be illustrated in fig. 3 shown below;
When previous block is also without resource, then repeat to continue up to borrow, oneself the last item is moved to before by each block, vacant resource is moved current block, to add route, as shown in Figure 4: when block0 needs upwards to use resource, find block1 also without, then repeat upwards to use, find that block32 has resource, then the Section Eight region of oneself is moved on to the 4th region by block31, adjust block32_right, block31_left, then repeat up to move the 13rd region, finally the 13rd region of block1 is used in block0.
Finally adjust then with reference on the right side of Fig. 4;Under maximum case, it is necessary to move 32 times and can complete a routing operations.
3, need to move downwards: similar with upwards moving, be not illustrated herein;In time adding route, additionally use resource not success toward a direction, then use to opposite direction, if all without, then it represents that resource is also full, it does not have vacant position, position issues route.
When deleting route, it is only necessary to delete current location and route, it is not necessary to other operation.
TCAM it be actually a bulk of internal memory, special internal memory. general memory is to look for content. according to address and TCAM is just the opposite, is look for address by Content.In the present invention, adopt TCAM to realize the sequence of Longest prefix match algorithm (LPM) algorithm, there is quick sorting operation function and the maximum ability moving number of times.
The technology contents of the present invention and technical characteristic have revealed that as above; but those of ordinary skill in the art are still potentially based on teachings of the present invention and announcement and do all replacements without departing substantially from spirit of the present invention and modification; therefore; scope should be not limited to the content that embodiment is disclosed; and the various replacement without departing substantially from the present invention and modification should be included, and contained by present patent application claim.

Claims (8)

1. one kind in the TCAM managed with mask efficient data sequence realize method, it is characterised in that: in advance by TCAM according to mask carry out divide multiple pieces, each piece of distribution according to routing table distributes the size of block in advance, or divides equally;Each piece has left and right, indicates the index original position in this block and index end position real index original position and index end position in TCAM;Each block is internal adopts inner cable to draw management algorithm, obtains index position, records the maximum entry number of this block simultaneously and has currently used number, and needs to record which internal index and have been used.
2. according to claim 1 in the TCAM managed with mask efficient data sequence realize method, it is characterised in that described TCAM predistribution is that 32 blocks manage 32 different routes of mask.
3. according to claim 1 in the TCAM managed with mask efficient data sequence realize method, it is characterized in that, its method includes when adding route normal interpolation and need not move, normally add and need upwards to carry out to move, normally add and need to carry out downwards moving three kinds of modes.
4. according to claim 3 in the TCAM managed with mask efficient data sequence realize method, it is characterized in that, described normal interpolation theed add when routeing need not be moved, the block of correspondence is obtained according to mask, by judge in corresponding blocks already with number and corresponding blocks in maximum can with how many, confirm that current block also has position, by indexing one index position of distribution, add and route.
5. according to claim 3 in the TCAM managed with mask efficient data sequence realize method, it is characterized in that, described normal interpolation theed add when routeing needs upwards to move, the block of correspondence is obtained according to mask, by judge in corresponding blocks already with number and corresponding blocks in maximum can with how many, confirm that current block does not have position, find previous piece, judge also have position, then last position by obtaining previous piece, the left of current block is moved forward a unit, the right of a upper block also moves forward a position, with maximum in new corresponding blocks can by the number of how many, then add and be routed to new position.
6. according to claim 3 in the TCAM managed with mask efficient data sequence realize method, it is characterised in that normal during described interpolation route add need to carry out downwards to move with described add route time normal add need not move identical.
7. according to claim 5 in the TCAM managed with mask efficient data sequence realize method, it is characterized in that, when previous piece also without resource, then repeat to continue up to borrow, oneself the last item is moved to before by each piece, vacant resource is moved current block, in order to add route.
8. according to claim 5 in the TCAM managed with mask efficient data sequence realize method, it is characterized in that, when block0 needs upwards to use resource, it has been found that block1 also without, then repeat upwards to use, find that block32 has resource, then the Section Eight territory of oneself is moved on to the 4th region by block31, adjusts block32_right, block31_left, then repeat up to move the 13rd region, finally the 13rd region of block1 is used in block0.
CN201610136171.6A 2016-03-10 2016-03-10 Method for realizing efficient data sorting in TCAM with mask management Withdrawn CN105812262A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610136171.6A CN105812262A (en) 2016-03-10 2016-03-10 Method for realizing efficient data sorting in TCAM with mask management

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610136171.6A CN105812262A (en) 2016-03-10 2016-03-10 Method for realizing efficient data sorting in TCAM with mask management

Publications (1)

Publication Number Publication Date
CN105812262A true CN105812262A (en) 2016-07-27

Family

ID=56467173

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610136171.6A Withdrawn CN105812262A (en) 2016-03-10 2016-03-10 Method for realizing efficient data sorting in TCAM with mask management

Country Status (1)

Country Link
CN (1) CN105812262A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112235198A (en) * 2020-10-15 2021-01-15 东莞飞思凌通信技术有限公司 Multi-user TCAM mask matching algorithm realized based on FPGA

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1441579A (en) * 2003-03-28 2003-09-10 清华大学 TCAM high-speed search method and system supporting multiple nexthop
CN1859208A (en) * 2006-03-29 2006-11-08 华为技术有限公司 Method and system for managing TCAM route list
CN101039215A (en) * 2006-08-10 2007-09-19 华为技术有限公司 Method and system for maintaining ternary content addressable memory items
EP2288092A1 (en) * 2009-08-16 2011-02-23 Compass Electro-Optical Systems Ltd Method and device for improving scalability of longest prefix match

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1441579A (en) * 2003-03-28 2003-09-10 清华大学 TCAM high-speed search method and system supporting multiple nexthop
CN1859208A (en) * 2006-03-29 2006-11-08 华为技术有限公司 Method and system for managing TCAM route list
CN101039215A (en) * 2006-08-10 2007-09-19 华为技术有限公司 Method and system for maintaining ternary content addressable memory items
EP2288092A1 (en) * 2009-08-16 2011-02-23 Compass Electro-Optical Systems Ltd Method and device for improving scalability of longest prefix match

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112235198A (en) * 2020-10-15 2021-01-15 东莞飞思凌通信技术有限公司 Multi-user TCAM mask matching algorithm realized based on FPGA

Similar Documents

Publication Publication Date Title
US7774538B2 (en) Method for ternary contents address memory table management
CN102484610B (en) Routing table construction method and device and routing table lookup method and device
CN104811387B (en) The equal cost multipath explicitly replicated with position index
CN106034087B (en) Method, device and system for balancing load of service function chain
US10003533B2 (en) SDN packet forwarding
US9736058B2 (en) Multi-region source routed multicast using sub-tree identifiers
US8848709B2 (en) Source rooted multicast (SRM)
US10284472B2 (en) Dynamic and compressed trie for use in route lookup
US8514714B2 (en) Device and method for providing forwarding information and QOS information in flow based network environment
CN102405623B (en) Method and device for storing routing table entry
CN104462549A (en) Data processing method and device
CN103546380B (en) A kind of message forwarding method based on policybased routing and device
JP3881663B2 (en) Packet classification apparatus and method using field level tree
KR101331018B1 (en) Method for classifying packet and apparatus thereof
US20200328974A1 (en) Dynamic forward information base prefix optimization
CN1893393A (en) Method for realizing retransmission business of data communication equipment
CN102387068A (en) Extensible routing method and router of identification network
CN105049373A (en) APS-based MLAG switching protection method
CN105812262A (en) Method for realizing efficient data sorting in TCAM with mask management
CN104836738A (en) Router hardware item resource management method and device, and network equipment
CN104252504A (en) Method, equipment and system for inquiring data
CN101562574A (en) Method for updating routing list and device thereof
EP2615791A1 (en) Method, system and devices for delivering media content in IP networks
WO2015192742A1 (en) Lookup device, lookup method and configuration method
CN108259353B (en) Multistage flow table design method based on specific value repetition rate of matching field

Legal Events

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

Application publication date: 20160727

WW01 Invention patent application withdrawn after publication