CN101039215A - Method and system for maintaining ternary content addressable memory items - Google Patents

Method and system for maintaining ternary content addressable memory items Download PDF

Info

Publication number
CN101039215A
CN101039215A CNA2006101093297A CN200610109329A CN101039215A CN 101039215 A CN101039215 A CN 101039215A CN A2006101093297 A CNA2006101093297 A CN A2006101093297A CN 200610109329 A CN200610109329 A CN 200610109329A CN 101039215 A CN101039215 A CN 101039215A
Authority
CN
China
Prior art keywords
list item
piece
space
prefix length
content addressable
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
CNA2006101093297A
Other languages
Chinese (zh)
Other versions
CN100546257C (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CNB2006101093297A priority Critical patent/CN100546257C/en
Publication of CN101039215A publication Critical patent/CN101039215A/en
Application granted granted Critical
Publication of CN100546257C publication Critical patent/CN100546257C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a maintenance method and system for three-state content addressable memorizer entry, the basic principle is to pre-partition the TCAM, and preset the entrys number of each prefix block. By using such scatter storage mode, the changes of other entrys are not influenced in most instances when adding or deleting the entrys, therefor reducing the times of searching space and operating the direct entrys of hardwares, and improving the system processing performance.

Description

A kind of method and system of maintaining ternary content addressable memory items
Technical field
The present invention relates to the maintenance technology of ternary content addressable memory items, relate in particular to a kind of method and system of maintaining ternary content addressable memory items.
Background technology
Along with the continuous expansion of computer network scale, the fast development of large-scale internet (as Internet), people have been not content with the information of only sharing on local network, and wish to maximally utilise each area, the whole world, various types of Internet resources.User's demand is promoting the development of route technology and popularizing of router, makes route technology become key component gradually in network technology, and router also becomes the most important network equipment thereupon.Any one has the computer network of certain scale at present, and what no matter adopt is Fast Ethernet technology, FDDI technology, or atm technology, all be unable to do without router.The main action of router has comprised seeks footpath and forwarding, and it is even more important wherein to seek the footpath, because have only the path of addressing arrival destination, and could be along this road through forwards packets.Therefore, how fast and effeciently to realize searching of best routed path, the problem that has become industry generally to be concerned about.
Below introduce the longest prefix match lookup method: in network, existing the subnet of different sizes, is example with IP v4, a subnet can be represented with a network ip address and prefix, 192.168.160.0/24 for example, 192.168.160.0 represents network ip address, and the 24th, prefix length.Prefix length is corresponding with mask, mask is 32, high n position is 1 full during with binary representation, low (32-n) position is 0 entirely, n is a prefix length, thereby above-mentioned subnet mask is 255.255.255.0, and 192.168.160.255 represents broadcasting in the subnet, and 192.168.160.1 is the interior node that may exist (hop) of subnet to 192.168.160.254, i.e. terminal or router.If this subnet is not directly to be connected on the router that we will discuss, common processing method is with 192.168.160.0/24 as FIB (forwarding information table), to a message, if identical (prefix length of this list item of n position) among the preceding n position of its purpose IP address and the FIB just transmitted by this.If many epiphase couplings in certain IP message and the fib table for example have following 4: 192.168.0.0/16,192.168.128.0/18,192.168.160.0/24,192.168.160.0/25 in the fib table.For purpose IP address is the situation of 192.168.160.129, and preceding 3 all meet the requirements, and the 4th does not match.Should be by a longest forwarding of prefix in the list item that is mated, in this example will be by the 3rd forwarding.
The algorithm that existing multiple realization longest-prefix length coupling (hereinafter to be referred as the longest coupling) is searched, in high-speed hardware was transmitted, using TCAM (Ternary Content Addressable Memory) to carry out this method of searching was a method that realizes easily.Each list item among the TCAM will compare numerical value except presetting, and it is unconcerned can also specifying more any positions by the mask of setting every list item, does not participate in comparison.Notice that the TCAM of different manufacturers is different to the definition of list item mask, the producer's definition mask that has is that the position is indifferent in 1 expression, and the producer that has definition mask is that the position is indifferent in 0 expression.Please refer to Fig. 1, for depositing the example of fib table among the TCAM.Each list item among the TCAM will compare numerical value except presetting, and it is unconcerned can also specifying more any positions by the mask of setting every list item, does not participate in comparison.With the difference in the arrangement of longest prefix match list item be, generally that mask is the long list item of TCAM is placed on low address, and the short list item of mask is placed on high address, and the result who guarantees feedback is the best.In the time need searching the purpose IP of a coupling by TCAM, with this purpose IP and mask is input, and TCAM will be in a single clock cycle, the result of feedback search, software is searched more detailed forwarding information by the result in SDRAM then, and this routine result is shown in grey item among Fig. 1.
What prior art adopted the maintenance of TCAM list item is intensive storage mode, and so-called intensive storage mode be exactly always to the fib table of total n item, it press the prefix length arrangement, leaves address 0 in and arrives in the address space of (n-1), is empty more than the n of address.Please refer to Fig. 2, be the list item of technology increase now schematic diagram.If add prefix length is the list item of k, and the way of processing is to place it in after last of prefix piece k, and back every moves a position backward.Owing to want a large amount of mobile list items, thereby the list item address of writing down in the mapping table is chosen at the offset address in the prefix piece, and it is as follows to add the list item operating process: search the list item that will add in mapping table, if find, just do not add, but upgrade contents in table; Check that whether TCAM expires (superlatively whether use the location), does not add if just expired; The list item of the part of (not containing) more than the prefix piece k is all moved on to the position of original cyclic address change; The prefix piece initial address littler than k adds one; The initial address that the list item that will add writes prefix piece k adds the position of list item number; The list item number of prefix piece k adds 1.Please refer to Fig. 3, be prior art remove entries schematic diagram.If delete a list item, way is that its back every moved forward a position.Owing to want a large amount of mobile list items, thereby the list item address of writing down in the mapping table is chosen at the offset address in the prefix piece, and for the list item of avoiding this prefix piece back is changed offset address in a large number, the notebook data piece only moves to the original position of list item of deleting with last.The remove entries operating process is as follows: in mapping table, search the list item that will add, if can not find, with regard to inoperation; The active position of this list item among the TCAM is invalid; The list item of deletion is deleted from mapping table; If deleted entry is not the prefix piece last, last is moved to the original position of deleted entry, and in mapping table, find this, change its offset address in the prefix piece; The list item number of prefix piece k subtracts 1; The list item of the part of (not containing) more than the prefix piece k is all moved on to original address subtract one position; The prefix piece initial address littler than k subtracts one.
Safeguard process that TCAM realizes longest-prefix length matched and searched as can be seen from the intensive storage mode of above employing, each increase or remove entries in, need repeatedly search mapping table, carry out a large amount of list items and move, brought very heavy burden to CPU; When route flapping occurring, Routing Protocol recomputates route, and CPU possibly can't in time handle the list item of frequent variations, thereby causes the variation of network not to be reflected on the fib table timely.
Summary of the invention
The technical problem to be solved in the present invention provides a kind of method and system of maintaining ternary content addressable memory items, to realize longest-prefix length matched and searched, in increase or remove entries, reduce operation to list item in other memory, improve the system handles performance.
For solving the problems of the technologies described above, the present invention is achieved through the following technical solutions:
A kind of method of maintaining ternary content addressable memory items comprises: piecemeal is carried out according to prefix length in the Ternary Content Addressable Memory space, the space that prediction block is occupied, the information of record block; When issuing the order of increase list item, inquire about the block message of described list item correspondence, and, described list item is increased to Ternary Content Addressable Memory according to described block message application space; When issuing the remove entries order, inquire about the affiliated block message of described list item, and treat remove entries according to described block message searching, described list item is deleted from Ternary Content Addressable Memory.
Preferably, the described information prefix length, piece that comprise piece is in the initial address of Ternary Content Addressable Memory, with the state of list item number, free list item number and piece.
Preferably, described state comprises termination attitude and activated state; It is 0 that the piece of termination attitude occupies the list item number; List item judges whether the controll block of list item correspondence is in the termination attitude before increasing, if, change bulk state into activated state, be described distribution Ternary Content Addressable Memory space.
Preferably, be scheduled to the weight that takies of every kind of prefix length according to the use amount of prefix length; The size of described allocation space can use following formula to draw:
Assign = FreeCnt - FreeCnt * Weight ( n , p ) Weight ( t , p ) - 1
Weight(x,y)=W(x)/2+W(x-2)+...+W(y-1)+W(y)/2
Wherein: Assign represents the allocation space size, FreeCnt represents the free list item number of last activated state piece, n is the prefix length of space to be allocated piece, p is the prefix length of the last activated state piece of space to be allocated piece, t is the prefix length of an activation block behind the piece of space to be allocated, p>n>t, W (x) is the weight that takies of x for predetermined prefix length.
Preferably, after the list item deletion, whether what judge the affiliated piece of described list item has been 0 with the list item number, if change bulk state into the termination attitude.
Preferably, described state also comprises virtual state, and the prefix length of the piece correspondence of virtual state is 0 or 33.
Preferably, the described piecemeal that carries out is: according to prefix length order from big to small, with the Ternary Content Addressable Memory space from low to high the order of address carry out piecemeal.
A kind of system of maintaining ternary content addressable memory items, comprise that Ternary Content Addressable Memory, memory divide module unit, controll block unit, list item to increase unit and list item delete cells: Ternary Content Addressable Memory is used for storage item; Memory divides module unit to be used for piecemeal being carried out according to prefix length in the space of described Ternary Content Addressable Memory, the space that prediction block is occupied; The controll block unit is used for the information of record block; List item increases the unit and is used for inquiring about the block message in the described controll block of being stored in of the described list item correspondence unit, and according to described block message application space, described list item being increased to Ternary Content Addressable Memory when issuing the order of increase list item; The list item delete cells is used for when issuing the remove entries order, inquires about the block message in the control unit of being stored under the described list item, and seeks according to described block message and to treat remove entries, and described list item is deleted from Ternary Content Addressable Memory.
Preferably, comprise that also state changes unit and parameter scheduled unit: the controll block unit is used for record block information, and the prefix length, piece that comprise piece are in the initial address of Ternary Content Addressable Memory, with list item number, free list item number and bulk state; State changes the state that the unit is used to change piece, and list item if the list item corresponding blocks is in the termination attitude, is an activated state with described state-transition before increasing; After the list item deletion,, described state-transition is the termination attitude if the affiliated piece of list item has been 0 with the list item number; The parameter scheduled unit is used for being provided with according to the use amount of prefix length the weight that takies of every kind of prefix length; When piece changes activated state into from ending attitude, be described allocation space, described space size can use following formula to draw:
Assign = FreeCnt - FreeCnt * Weight ( n , p ) Weight ( t , p ) - 1
Weight(x,y)=W(x)/2+W(x-1)+...+W(y-1)+W(y)/2
Wherein: Assign represents the allocation space size, FreeCnt represents the free list item number of last activated state piece, n is the prefix length of space to be allocated piece, p is the prefix length of the last activated state piece of space to be allocated piece, t is the prefix length of an activation block behind the piece of space to be allocated, p>n>t, W (x) is the weight that takies of x for predetermined prefix length.
Above technical scheme as can be seen, because the present invention carries out piecemeal with the Ternary Content Addressable Memory space according to prefix length, the space that prediction block is occupied, the information of record block, the block message of foundation variation list item prefix length correspondence increases list item or deletes, the piece of every kind of prefix length has pre-assigned space, by such distributing storage mode, can in most cases not influence other list item in increase or remove entries.The way to manage of this optimization reduces the number of times of searching the space and to the direct list item number of operations of hardware, make the bottleneck that issues speed when forwarding list item no longer becomes route oscillation under the hardware, on the basis that channel performance between plate improves, can realize that the high speed of hardware fib table refreshes.
Description of drawings
Fig. 1 is for depositing the instance graph of fib table among the TCAM;
Fig. 2 is that present technology increases the list item schematic diagram;
Fig. 3 is a prior art remove entries schematic diagram;
Fig. 4 is a method flow diagram of the present invention;
Fig. 5 is an embodiment of the invention method flow diagram;
Fig. 6 is a controll block chain hoist pennants of the present invention;
Fig. 7-8 is changed into the process schematic diagram of activated state by the termination attitude for controll block of the present invention;
Fig. 9 is the present patent application space schematic diagram;
Figure 10 moves the process schematic diagram of list item for the present invention;
Figure 11 is a system schematic of the present invention.
Embodiment
The invention provides a kind of method and system of maintaining ternary content addressable memory items, its basic ideas are in advance TCAM to be carried out piecemeal, and preset the list item number that each prefix piece occupies, use such distributing storage mode, make when increase or remove entries, in most cases do not influence other list item and change, thereby reduce the number of times of searching the space and, improve the system handles performance the direct list item number of operations of hardware.
Please refer to Fig. 4, be method flow diagram of the present invention;
D1. piecemeal is carried out according to prefix length in the Ternary Content Addressable Memory space, the space that prediction block is occupied, the information of record block;
D2. when issuing the order of increase list item, inquire about the block message of described list item correspondence, and, described list item is increased to Ternary Content Addressable Memory according to described block message application space; When issuing the remove entries order, inquire about the affiliated block message of described list item, and treat remove entries according to described block message searching, described list item is deleted from Ternary Content Addressable Memory.
For further understanding the present invention, below the technical program is described in detail by embodiment.
Please refer to Fig. 5 and be embodiment of the invention method flow diagram:
Step 1. is carried out piecemeal with the Ternary Content Addressable Memory space according to prefix length, the space that prediction block is occupied, the information of record block.
Described block message comprises that the prefix length, piece of piece are in the initial address of Ternary Content Addressable Memory, with list item number and free list item number.The described piecemeal that carries out is: according to prefix length order from big to small, with the Ternary Content Addressable Memory space from low to high the order of address carry out piecemeal.
In order to guarantee that the big list item of prefix length always is placed on the basis of TCAM lower position, realize the purpose that piece moves that reduces significantly proposed above, the present invention has abandoned the plain mode that all list items are stored continuously in the design in the past, and the storage of the distributing in the employing priority set, the list item of same prefix piece is put together, distributes the space of prefix piece in advance according to the situation of actual use subnet on the network for each prefix.The benefit of doing like this is with respect to intensive storage mode, and most cases does not influence other prefix piece when interpolation or remove entries.
Step 2. is issued to the variation of list item among the TCAM.The fault of equipment and link can cause Routing Protocol to calculate the road again in the network, if calculate the list item of road result generation additions and deletions or change is arranged, and system is issued to these variations among the TCAM of each interface board automatically.
If steps A 3. judges for increasing list item whether the controll block of list item prefix length correspondence is activated state, if, continue steps A 5, otherwise, steps A 4 continued.
Please refer to Fig. 6, be controll block chain hoist pennants of the present invention.For dynamic management TCAM, need in internal memory, safeguard a cover controll block chained list, with the state of convenient all sublists of record.In the process of piecemeal, set up the piecemeal among the TCAM and the controll block that is used to manage between one-to-one relationship, promptly the message reflection of controll block the inside is exactly the block message of TCAM.For avoiding narration burdensome, in description of the invention, the information of controll block is regarded as the block message of TCAM.
The information of controll block record comprises: prefix length, the original position in TCAM (first address), with list item number (taking number), free list item number (idle number) and bulk state.The controll block state comprises activated state, ends attitude, virtual state.Controll block is not activated state when the list item population of certain prefix piece is not 0; Before and after pointing to respectively, its head and the tail pointers (stain of Fig. 6) are in the controll block of activated state or virtual state.When take number when being 0 controll block be in abort state.Virtual state controll block is owing in order reducing border controll block to be judged the special blocks that adds when controll block is carried out traversing operation, not have practical significance, in the present embodiment, not referring to that prefix length is 0 and 33 controll block.
Steps A 4. is revised as activated state to controll block from ending attitude, and according to the weight allocation space.
Please refer to Fig. 7-8, change the process schematic diagram of activated state for controll block of the present invention by the termination attitude into.The list item population of certain prefix length no longer is 0 o'clock, needs to convert the controll block of this sublist to activated state, and allocation space.After controll block activates, record list item first address and upgrade the head and the tail pointer and point to the controll block that former and later two are in activated state or virtual state respectively, and the tail pointer and the owner pointer that respectively front and back are in the controll block of activated state or virtual state are updated to the controll block of pointing to this new activation.Owing to need allocation space to give the controll block of new activation; So a part will be existed the controll block of the controll block spatial division of free space to this activation.The new space of activating the controll block distribution is:
Assign=FreeCnt-OffsetCnt-1
Assign represents the allocation space size, and FreeCnt represents the free list item number before last activated state piece is divided, and OffsetCnt represents the free list item number after the last activation block of new activation block is divided.
In the present invention, added the parameter that takies weight.Because the use amount of the prefix length of IP address is not average in the network, as 24,16,8 etc. all being prefix length relatively more commonly used, the list item number that occupies in TCAM naturally will be more.And will lack in actual applications much as prefix lengths such as 1,11,29.We introduce a notion that takies weight according to this situation; The right to occupation of the prefix length that practice is more is reseted and is put lowlyer; And the right to occupation of the prefix length that practice is less is reseted and is put higherly.The purpose of doing like this is the list item space that need take other prefix lengths when certain prefix length list item space is not enough; At this moment since prefix length commonly used to take weight lower, make will the hanging down of occupied rate of its more non-common prefix length list item space; Can effectively reduce the TCAM list item so frequently vibrates.After adding took the weight parameter, the space of newly activating the controll block distribution was:
Assign = FreeCnt - FreeCnt * Weight ( n , p ) Weight ( t , p ) - 1
Weight(x,y)=W(x)/2+W(x-1)+...+W(y-1)+W(y)/2
Wherein, n represents newly to activate the prefix length of controll block, and p represents newly to activate the prefix length of the last activation controll block of controll block, and t represents newly to activate the prefix length that back one of controll block activates controll block, p>n>t; The long weight that takies of W (x) expression prefix length for x.
In the present embodiment, the controll block of activation is the controll block of prefix length 28, and the space that should distribute is:
Assign = FreeCnt - FreeCnt * W ( 28 ) / 2 + W ( 29 ) + W ( 30 ) / 2 W ( 27 ) / 2 + W ( 28 ) + W ( 29 ) + W ( 30 / 2 ) / 2 ) - 1
= FreeCnt * W ( 27 ) / 2 + W ( 28 ) / 2 W ( 27 ) / 2 + W ( 28 ) + W ( 29 ) + W ( 30 / 2 ) / 2 - 1
The list item application space of steps A 5. for increasing newly.
Please refer to Fig. 9, be the present patent application space schematic diagram.There are following 4 kinds of situations:
(1) preceding and wait to apply for that the controll block of the activated state at piece place, space does not all have the space, then needs according to the weight calculation moving direction, and carry out piece and move to vacate free space, shown in Fig. 9 article one.
(2) do not have the space if wait the preceding piece of applying for the space piece, the activation block at place has living space, and shown in Fig. 9 second, then uses the space of place activation block.
(3) do not have free space if wait to apply for the space activation block, and preceding had living space, shown in the 3rd of Fig. 9, then use and wait to apply for fast space before the piece of space;
(4) if preceding and wait that all there is the space in the activation block of applying for piece place, space, then decides direction according to weight.Shown in the 4th of Fig. 9.
If first and the 4th kind of situation, need balance right to occupation double recipe to, following formula will illustrate the realization of specifically weighing.Still apply for backward that forward the space mainly is made up of two big factors: idle number and take weight.We should consider to idle number many, and the application space, one side that right to occupation is great does the piece that helps reducing the frequent change of list item and bring like this and move number of times.The summary formula is as follows, and Direction is the result who calculates in the formula:
PrevFreeCnt=FreeCnt(cur+1,n+1)
NextFreeCnt=FreeCnt(0,cur)
FreeCnt(m,n)=FreeCnt(m)+...+FreeCnt(n)
PrevWeight=Weight(cur,n+1)
NextWeight=Weight(0,cur)
Weight(m,n)=W(m)/2+W(m-1)+...+W(n-1)+W(m)/2
Direction=(PrevFreeCnt*NextWeight≥NextFreeCnt*PrevWeight)?Prev:Nex
FreeCnt (m) expression prefix length is the idle number in the piece of m
W (m) expression prefix length is the weight of m
Steps A 6. is added list item to TCAM, revises the controll block information of list item correspondence.
To each prefix piece,, generally can think and each bar list item of whole prefix piece need be moved an address forward or backward if we need integral body to move a list item forward or backward; Such consequence will be brought a large amount of move operations.
The technical program reaches same purpose by operation still less.Such as, integral body moves a list item backward: the first address that only a list item of this prefix block address minimum need be moved on to a list item back (cyclic address change) the while controll block record of address maximum adds once being effective.The foundation of doing like this is because the list item order in the same prefix piece is unimportant, when a plurality of prefix pieces move simultaneously, if move (cyclic address change) backward, and the short piece of earlier mobile prefix, the piece that mobile again prefix is long; Otherwise, if to reach (address subtracts), the long piece of earlier mobile prefix, the piece that mobile again prefix is short.
Please refer to Figure 10, move the process schematic diagram of list item for the present invention.Cur is the activation block that current hope adds new list item among the figure, and last of this activation block and it does not all have the space, analyzes through the weight direction, and discovery should move forward.It is pointed out that three of Cur fronts have not all had the space in this example, corresponding trade-off analysis also has repeatedly.As Figure 10, through three exchanges, a space is moved out of in Cur piece front, newly adds list item and puts into this space.
If step B3. is a remove entries, judge deletion back list item correspondence controll block take whether number is 0, if, continuation B3.
Step B4. changes described controll block into the termination attitude from activated state.Controll block discharges the space of being occupied after becoming the termination attitude.
Please refer to Figure 11, be system schematic of the present invention.A kind of system of maintaining ternary content addressable memory items comprises that Ternary Content Addressable Memory 100, memory divide module unit 200, controll block unit 300, list item to increase unit 400, list item delete cells 500, state change unit 600 and parameter scheduled unit 700:
Ternary Content Addressable Memory 100 is used for storage item;
Memory divides module unit 200 to be used for piecemeal being carried out according to prefix length in the space of described Ternary Content Addressable Memory 100, the space that prediction block is occupied;
Controll block unit 300 is used for the information of record block; The block message of record comprises that the prefix length, piece of piece are in the initial address of Ternary Content Addressable Memory 100, with list item number, free list item number and bulk state;
List item increases unit 400 and is used for inquiring about the block message in the described controll block of being stored in of the described list item correspondence unit 300, and according to described block message application space, described list item being increased to Ternary Content Addressable Memory 100 when issuing the order of increase list item;
State changes the state that unit 600 is used to change piece, and list item if the list item corresponding blocks is in the termination attitude, is an activated state with described state-transition before increasing; After the list item deletion,, described state-transition is the termination attitude if the affiliated piece of list item has been 0 with the list item number;
Parameter scheduled unit 700 is used for being provided with according to the use amount of prefix length the weight that takies of every kind of prefix length; When piece changes activated state into from ending attitude, be described allocation space, described space size can use following formula to draw:
Assign = FreeCnt - FreeCnt * Weight ( n , p ) Weight ( t , p ) - 1
Weight(x,y)=W(x)/2+W(x-1)+...+W(y-1)+W(y)/2
Wherein: Assign represents the allocation space size, FreeCnt represents the free list item number of last activated state piece, n is the prefix length of space to be allocated piece, p is the prefix length of the last activated state piece of space to be allocated piece, t is the prefix length of an activation block behind the piece of space to be allocated, p>n>t, W (x) is the weight that takies of x for predetermined prefix length;
List item delete cells 500 is used for when issuing the remove entries order, inquire about 300 the block message of being stored in the control unit under the described list item, and seek according to described block message and to treat remove entries, described list item is deleted from Ternary Content Addressable Memory 100.
Memory divides 200 pairs of Ternary Content Addressable Memory 100 spaces of module unit to carry out piecemeal, prediction block occupy the space, controll block unit 300 records divide block message, and the block message of record comprises that the prefix length of piece, piece are in the initial address of Ternary Content Addressable Memory 100, with list item number, free list item number and bulk state.When list item increase unit 400 issues the order of increase list item, inquire about the block message in the described controll block of being stored in of the described list item correspondence unit 300; If the list item corresponding blocks is in the termination attitude, state change unit 600 is an activated state with described state-transition, and is described allocation space, and described space size can use following formula to draw:
Assign = FreeCnt - FreeCnt * Weight ( n , p ) Weight ( t , p ) - 1
Weight(x,y)=W(x)/2+W(x-1)+...+W(y-1)+W(y)/2
Wherein: Assign represents the allocation space size, FreeCnt represents the free list item number of last activated state piece, n is the prefix length of space to be allocated piece, p is the prefix length of the last activated state piece of space to be allocated piece, t is the prefix length of an activation block behind the piece of space to be allocated, p>n>t, W (x) are that parameter scheduled unit 700 is the weight that takies of x according to the predetermined prefix length of the use amount of prefix length; List item increases unit 400 according to the block message in the controll block unit 300, and described list item is increased to Ternary Content Addressable Memory 100.When list item delete cells 500 issues the remove entries order, inquire about 300 the block message of being stored in the control unit under the described list item, and remove entries is treated in the described block message searching of foundation, described list item is deleted from Ternary Content Addressable Memory 100, if piece has been 0 with the list item number under the list item, state change unit 600 is the termination attitude with described state-transition.
More than the method and system of a kind of maintaining ternary content addressable memory items provided by the present invention is described in detail, used specific case herein principle of the present invention and execution mode are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.

Claims (9)

1. the method for a maintaining ternary content addressable memory items is characterized in that, comprising:
Piecemeal is carried out according to the list item prefix length in the Ternary Content Addressable Memory space, the list item number that prediction block is occupied, the information of record block;
When issuing the order of increase list item, inquire about the block message of described list item correspondence, and, described list item is increased to Ternary Content Addressable Memory according to described block message application space; When issuing the remove entries order, inquire about the affiliated block message of described list item, and treat remove entries according to described block message searching, described list item is deleted from Ternary Content Addressable Memory.
2. method according to claim 1 is characterized in that, the prefix length, piece that described information comprises piece is in the initial address of Ternary Content Addressable Memory, with the state of list item number, free list item number and piece.
3. method according to claim 2 is characterized in that, described state comprises ends attitude and activated state; It is 0 that the piece of termination attitude occupies the list item number; List item judges whether the controll block of list item correspondence is in the termination attitude before increasing, if, change bulk state into activated state, be described distribution Ternary Content Addressable Memory space.
4. method according to claim 3 is characterized in that, is scheduled to the weight that takies of every kind of prefix length according to the use amount of prefix length; The size of described allocation space can use following formula to draw:
Assign = FreeCnt - FreeCnt * Weight ( n , p ) Weight ( t , p ) - 1
Weight(x,y)=W(x)/2+W(x-1)+...+W(y-1)+W(y)/2
Wherein: Assign represents the allocation space size, FreeCnt represents the free list item number of last activated state piece, n is the prefix length of space to be allocated piece, p is the prefix length of the last activated state piece of space to be allocated piece, t is the prefix length of an activation block behind the piece of space to be allocated, p>n>t, W (x) is the weight that takies of x for predetermined prefix length.
5. method according to claim 3 is characterized in that, after the list item deletion, whether what judge the affiliated piece of described list item has been 0 with the list item number, if change bulk state into the termination attitude.
6. method according to claim 3 is characterized in that described state also comprises virtual state, and the prefix length of the piece correspondence of virtual state is 0 or 33.
7. method according to claim 1 is characterized in that, the described piecemeal that carries out is: according to prefix length order from big to small, with the Ternary Content Addressable Memory space from low to high the order of address carry out piecemeal.
8. the system of a maintaining ternary content addressable memory items is characterized in that, comprises that Ternary Content Addressable Memory, memory divide module unit, controll block unit, list item to increase unit and list item delete cells:
Ternary Content Addressable Memory is used for storage item;
Memory divides module unit to be used for piecemeal being carried out according to prefix length in described Ternary Content Addressable Memory space, the space that prediction block is occupied;
The controll block unit is used for the information of record block;
List item increases the unit and is used for inquiring about the block message in the described controll block of being stored in of the described list item correspondence unit, and according to described block message application space, described list item being increased to Ternary Content Addressable Memory when issuing the order of increase list item;
The list item delete cells is used for when issuing the remove entries order, inquires about the block message in the control unit of being stored under the described list item, and seeks according to described block message and to treat remove entries, and described list item is deleted from Ternary Content Addressable Memory.
9. system according to claim 8 is characterized in that, comprises that also state changes unit and parameter scheduled unit:
The controll block unit is used for record block information, and the prefix length, piece that comprise piece are in the initial address of Ternary Content Addressable Memory, with list item number, free list item number and bulk state;
State changes the state that the unit is used to change piece, and list item if the list item corresponding blocks is in the termination attitude, is an activated state with described state-transition before increasing; After the list item deletion,, described state-transition is the termination attitude if the affiliated piece of list item has been 0 with the list item number;
The parameter scheduled unit is used for being provided with according to the use amount of prefix length the weight that takies of every kind of prefix length; When piece changes activated state into from ending attitude, be described allocation space, described space size can use following formula to draw:
Assign = FreeCnt - FreeCnt * Weight ( n , p ) Weight ( t , p ) - 1
Weight(x,y)=W(x)/2+W(x-1)+...+W(y-1)+W(y)/2
Wherein: Assign represents the allocation space size, FreeCnt represents the free list item number of last activated state piece, n is the prefix length of space to be allocated piece, p is the prefix length of the last activated state piece of space to be allocated piece, t is the prefix length of an activation block behind the piece of space to be allocated, p>n>t, W (x) is the weight that takies of x for predetermined prefix length.
CNB2006101093297A 2006-08-10 2006-08-10 A kind of method and system of maintaining ternary content addressable memory items Expired - Fee Related CN100546257C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2006101093297A CN100546257C (en) 2006-08-10 2006-08-10 A kind of method and system of maintaining ternary content addressable memory items

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2006101093297A CN100546257C (en) 2006-08-10 2006-08-10 A kind of method and system of maintaining ternary content addressable memory items

Publications (2)

Publication Number Publication Date
CN101039215A true CN101039215A (en) 2007-09-19
CN100546257C CN100546257C (en) 2009-09-30

Family

ID=38889872

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2006101093297A Expired - Fee Related CN100546257C (en) 2006-08-10 2006-08-10 A kind of method and system of maintaining ternary content addressable memory items

Country Status (1)

Country Link
CN (1) CN100546257C (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101866357A (en) * 2010-06-11 2010-10-20 福建星网锐捷网络有限公司 Method and device for updating items of three-state content addressing memory
CN101350771B (en) * 2008-07-07 2010-12-29 中国人民解放军国防科学技术大学 Method and system for storing elements of tri-state content addressable memory without ordering
CN101222434B (en) * 2008-01-31 2011-04-20 福建星网锐捷网络有限公司 Storage policy control list, policy searching method and tri-state addressing memory
CN102801500A (en) * 2012-08-02 2012-11-28 苏州雄立科技有限公司 Error code real-time correction method for searching chip
US8527694B2 (en) 2010-06-11 2013-09-03 Beijing Star-Net Ruijie Networks Co., Ltd. Method and apparatus for updating table entries of a ternary content addressable memory
CN104035928A (en) * 2013-03-04 2014-09-10 杭州华三通信技术有限公司 TCAM (telecommunication access method) table space recovery method and device
CN104935517A (en) * 2015-04-29 2015-09-23 杭州华三通信技术有限公司 Item management method and apparatus
CN105812262A (en) * 2016-03-10 2016-07-27 盛科网络(苏州)有限公司 Method for realizing efficient data sorting in TCAM with mask management
CN108287946A (en) * 2017-12-30 2018-07-17 盛科网络(苏州)有限公司 A kind of TCAM lookup methods and device
CN109831384A (en) * 2017-11-23 2019-05-31 华为技术有限公司 Name Lookup method and router
CN112039782A (en) * 2017-01-25 2020-12-04 华为技术有限公司 Multi-branch jump co-processing method and device
CN112650452A (en) * 2020-12-31 2021-04-13 成都卓讯智安科技有限公司 Data query method and equipment
CN113901274A (en) * 2021-09-10 2022-01-07 锐捷网络股份有限公司 Method, device, equipment and medium for moving TCAM (ternary content addressable memory) table items

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101222434B (en) * 2008-01-31 2011-04-20 福建星网锐捷网络有限公司 Storage policy control list, policy searching method and tri-state addressing memory
CN101350771B (en) * 2008-07-07 2010-12-29 中国人民解放军国防科学技术大学 Method and system for storing elements of tri-state content addressable memory without ordering
CN101866357A (en) * 2010-06-11 2010-10-20 福建星网锐捷网络有限公司 Method and device for updating items of three-state content addressing memory
CN101866357B (en) * 2010-06-11 2011-11-16 北京星网锐捷网络技术有限公司 Method and device for updating items of three-state content addressing memory
WO2011153784A1 (en) * 2010-06-11 2011-12-15 北京星网锐捷网络技术有限公司 Entry updating method and device for ternary content addressable memory
US8527694B2 (en) 2010-06-11 2013-09-03 Beijing Star-Net Ruijie Networks Co., Ltd. Method and apparatus for updating table entries of a ternary content addressable memory
CN102801500A (en) * 2012-08-02 2012-11-28 苏州雄立科技有限公司 Error code real-time correction method for searching chip
CN104035928A (en) * 2013-03-04 2014-09-10 杭州华三通信技术有限公司 TCAM (telecommunication access method) table space recovery method and device
CN104935517A (en) * 2015-04-29 2015-09-23 杭州华三通信技术有限公司 Item management method and apparatus
CN104935517B (en) * 2015-04-29 2019-03-15 新华三技术有限公司 Entry management method and device
CN105812262A (en) * 2016-03-10 2016-07-27 盛科网络(苏州)有限公司 Method for realizing efficient data sorting in TCAM with mask management
CN112039782A (en) * 2017-01-25 2020-12-04 华为技术有限公司 Multi-branch jump co-processing method and device
CN112039782B (en) * 2017-01-25 2022-01-18 华为技术有限公司 Multi-branch jump co-processing method and device
CN109831384A (en) * 2017-11-23 2019-05-31 华为技术有限公司 Name Lookup method and router
CN109831384B (en) * 2017-11-23 2021-08-03 华为技术有限公司 Name searching method and router
CN108287946A (en) * 2017-12-30 2018-07-17 盛科网络(苏州)有限公司 A kind of TCAM lookup methods and device
CN112650452A (en) * 2020-12-31 2021-04-13 成都卓讯智安科技有限公司 Data query method and equipment
CN113901274A (en) * 2021-09-10 2022-01-07 锐捷网络股份有限公司 Method, device, equipment and medium for moving TCAM (ternary content addressable memory) table items

Also Published As

Publication number Publication date
CN100546257C (en) 2009-09-30

Similar Documents

Publication Publication Date Title
CN101039215A (en) Method and system for maintaining ternary content addressable memory items
CN102882810B (en) A kind of packet fast forwarding method and device
CN1279729C (en) Distributed paralled IP route searching method based on TCAM
Bando et al. FlashTrie: beyond 100-Gb/s IP route lookup using hash-based prefix-compressed trie
CN1928839A (en) Long-distance inner server and its implementing method
CN1757202A (en) Free list and ring data structure management
CN1859316A (en) Packet transfer apparatus
CN1949776A (en) 4 over 6 tunnel packing and depacking method for extending boundary gateway protocol
CN1606291A (en) Network-processor accelerator
CN103116627B (en) A kind of method and system of high concurrent SOA technology access database
EP2352258A1 (en) Storage method and apparatus
WO2012091702A1 (en) Accelerating cache state transfer on a directory-based multicore architecture
CN1866845A (en) Virtual identifying method for multicast forwarding table output port
CN101047576A (en) Contents control method and system
CN1216473C (en) TCAM high-speed search method and system supporting multiple nexthop
CN104079478A (en) Method and device of packet forwarding
US6697923B2 (en) Buffer management method and a controller thereof
CN101883055B (en) Capacity expansion realization method and device of routing forwarding table and switching device
CN1819544A (en) Buffer management based on bitmap list
CN1614591A (en) Method for organizing and accessing distributive catalogue of document system
CN106940696A (en) A kind of information query method and system for SDN multilayer directors
CN1881936A (en) Dynamic loading and control method for router virtual drive module
CN1702658A (en) IP base LSI designing system and designing method
CN1949736A (en) Text edition circuit and method
CN1777148A (en) Routing table next-hop IP address to MAC address analytic method

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
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20090930

Termination date: 20120810