JP6073761B2 - Search device and search method - Google Patents
Search device and search method Download PDFInfo
- Publication number
- JP6073761B2 JP6073761B2 JP2013175946A JP2013175946A JP6073761B2 JP 6073761 B2 JP6073761 B2 JP 6073761B2 JP 2013175946 A JP2013175946 A JP 2013175946A JP 2013175946 A JP2013175946 A JP 2013175946A JP 6073761 B2 JP6073761 B2 JP 6073761B2
- Authority
- JP
- Japan
- Prior art keywords
- condition
- group
- memory
- search
- don
- 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.)
- Active
Links
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/50—Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Description
本発明は、入力したデータと合致する条件を検索する検索装置および方法に関する。 The present invention relates to a search apparatus and method for searching for conditions that match input data.
通信端末の多くは、受信したパケットにフィルタリングやルーティングなどの処理を行うため、検索装置を搭載している。この検索装置は、受信したパケットの一部または全てを入力とし(入力データ)、事前に登録した条件テーブルから入力データと合致する条件を検索する装置である。この検索装置は、合致した条件を発見した場合にはその条件番号を出力し、合致する条件がなかった場合には一致する条件なし(不一致)の検索結果を出力する。そして、通信端末は、検索装置の出力する検索結果に従い、受信したパケットを廃棄したり、出力ポートを決定したりする。 Many communication terminals are equipped with a search device to perform processing such as filtering and routing on received packets. This search device is a device that takes a part or all of a received packet as input (input data) and searches for a condition that matches the input data from a pre-registered condition table. The search device outputs a condition number when a matching condition is found, and outputs a search result with no matching condition (non-matching) when there is no matching condition. Then, the communication terminal discards the received packet or determines the output port according to the search result output by the search device.
ブロードバンドの普及に伴い、通信端末には高スループット化が求められている。そのため、検索装置にも高スループット化、つまり、単位時間当たりに検索可能な入力データの数を増やすことが求められている。さらに、省エネの観点からは低消費エネルギー化も必要である。 With the spread of broadband, communication terminals are required to have high throughput. Therefore, the search apparatus is also required to increase the throughput, that is, to increase the number of input data that can be searched per unit time. Furthermore, it is necessary to reduce energy consumption from the viewpoint of energy saving.
検索装置が入力データと合致する条件を検索する方式として、線形探索方式がある。本方式は、入力データと条件1つ1つを比較して、入力データと合致する条件を探しだす方式である(一致検索)。本方式を実装した検索装置の構成例を図14に示す。検索装置10は、条件テーブルを記憶する条件メモリ40と、入力データと条件を比較する比較器50から構成されている。本構成において、入力データがスタートとともに入力されると、比較器は条件メモリに読出しアドレスを送信し、条件メモリに記憶された条件を1つずつ読み出して入力データと比較する。そして、全条件と入力データを比較し終えると、その結果を検索結果として外部に出力する構成となっている。
There is a linear search method as a method for the search device to search for a condition that matches the input data. This method is a method in which the input data is compared with each condition one by one to find a condition that matches the input data (match search). FIG. 14 shows a configuration example of a search apparatus that implements this method. The
上記方式では、入力データと全条件とを比較した後でなければ検索結果を出力できないため、1つの入力データを処理するのに時間がかかっていた。さらに、条件数と同じ回数だけメモリにアクセスする必要があるため、電力を多く消費するという問題があった。 In the above method, since the search result can be output only after comparing the input data with all the conditions, it takes time to process one input data. Further, since it is necessary to access the memory as many times as the condition number, there is a problem that a large amount of power is consumed.
この問題を解決するため特許文献1では不一致検出手段を用いた検索装置が提案されている。特許文献1の検索装置では、入力データと不一致の条件を短時間で検出可能な不一致検出手段を検索装置に具備することにより、入力データと不一致の条件を条件メモリから読み出して比較する処理数を削減し、検索装置の平均検索時間を短くすることができる。
In order to solve this problem,
図15は、特許文献1の検索装置のブロック図である。検索装置10は、図14の線形探索方式と同様の方法で入力データと一致する条件を検索する一致検索手段30と、入力データと合致しない条件を短時間で検出可能な不一致検出手段20とで構成される。この検索装置10においては、登録される条件は複数のグループに分けられる。例えば、4種の条件(条件#0:0000、条件#1:0100、条件#2:1000、条件#3:1011)が条件テーブルに登録されている場合、条件#0と条件#1をグループ#0とし、条件#2と条件#3をグループ#1とする。
FIG. 15 is a block diagram of the search device of
検索装置10に入力される入力データは、まず不一致検出手段20に入力される。この不一致検索手段20は、入力データと合致する条件が存在していない(不一致)グループを短時間で検出する。そして、不一致検出手段20は、不一致を検出したグループを不一致検出結果として一致検索手段30に出力する。不一致検出手段20で不一致が検出されたグループは一致検索手段30で検索する必要がなくなるため、一致検索手段30において条件をメモリから読み出して入力データと比較する処理数が削減でき、検索装置10の平均検索時間を短くすることができる。
The input data input to the
特許文献1の不一致検出手段は、条件メモリを用いてグループ毎の不一致を検出する。この条件メモリには、グループ毎に条件が登録される。条件をメモリに登録する方法を図16を用いて説明する。条件メモリの各bitは、それぞれのグループに対応する。たとえば、条件メモリのbit[0]はグループ#0に対応し、bit[1]はグループ#1に対応する。そして、各アドレスにはグループ毎の条件テーブルの値の有無が記憶されており、条件テーブルの値と等しいアドレスには、その条件が属するグループに「有」が記憶され、それ以外の領域には、「無」が記憶されている。
The mismatch detection means of
例えば、条件#0(値が0000でグループ#0に属する)により、条件メモリのアドレス0000のbit[0]には「有」のシンボルが記憶され、同様に、条件#1(値が0100でグループ#0に属する)により、条件メモリのアドレス0100のbit[0]、条件#2(値が1000でグループ#1に属する)により条件メモリのアドレス1000のbit[1]、条件#3(値が1011でグループ#1に属する)により条件メモリのアドレス1011のbit[1]には「有」のシンボルが記憶される。そして、それ以外の領域には、「無」のシンボルが記憶される。
For example, according to the condition # 0 (the value is 0000 and belongs to the group # 0), a symbol “present” is stored in bit [0] of the
本メモリを用いてグループ毎の不一致を検出する場合には、図17のように、入力データと等しいアドレスを読み出せばよい。例えば、入力データが0100の場合には、条件メモリのアドレス0100を読み出す。アドレス0100のbit[0]には「有」の条件が記憶され、bit[1]には「無」の条件が記憶されているため、グループ#1に不一致の検出結果が出力される。グループ#1に不一致が検出されるとその後の一致検索手段において、入力データとグループ1の条件との比較が不要となる。
In the case of detecting a mismatch for each group using this memory, an address equal to the input data may be read as shown in FIG. For example, when the input data is 0100, the
このように、入力データと等しいアドレスを読み出すだけで、各グループ毎にデータの不一致が検出できるので、一致検索処理において不一致が検出されたグループの一致検索が不要となり、入力データと比較する処理数を削減することができる。 In this way, since it is possible to detect data mismatch for each group simply by reading an address equal to the input data, it is not necessary to perform a match search for the group in which the mismatch was detected in the match search process, and the number of processes to be compared with the input data Can be reduced.
上記構成は1回のメモリアクセスでグループ毎の不一致を検出することが可能であるが、入力データと一致条件の数値範囲が大きくなった場合には必要なメモリ容量が大きくなる。たとえば、入力データと一致条件がm bitの数値範囲の場合、必要なメモリ容量は2mbitとなる。そのため、特許文献1では、m bitをn bitずつのブロックに分割し、並列して不一致を検出する手段をとり、メモリ容量の削減を図っている。
Although the above configuration can detect a mismatch for each group by one memory access, the required memory capacity increases when the numerical range of the matching condition with the input data becomes large. For example, when the matching condition with the input data is a numerical range of m bits, the required memory capacity is 2 m bits. For this reason, in
図18は、従来の検索装置における検索条件テーブルを2つのブロックに分割した場合の条件テーブルおよび条件メモリを説明する図である。図18では、図16で例示した条件テーブルをブロック#0とブロック#1の2つのブロックに分割し、各ブロック毎に条件メモリを用意する。分割した各ブロックにおいても条件テーブルを2つのグループに分けて、それぞれの条件の値と等しい条件メモリのアドレスには、その条件が属するグループに「有」が記憶され、それ以外の領域には、「無」が記憶されている。
FIG. 18 is a diagram for explaining a condition table and a condition memory when a search condition table in a conventional search device is divided into two blocks. In FIG. 18, the condition table illustrated in FIG. 16 is divided into two blocks,
例えば、上位2bitのブロック#1の場合には、条件#0(値が00でグループ#0に属する)により、条件メモリ#2のアドレス00のbit[0]には「有」のシンボルが記憶され、同様に、条件#1(値が01でグループ#0に属する)により、条件メモリ#2のアドレス01のbit[0]、条件#2(値が10でグループ#1に属する)により条件メモリ#2のアドレス10のbit[1]、条件#3(値が10でグループ#1に属する)により条件メモリ#2のアドレス10のbit[1]には「有」のシンボルが記憶される。そして、それ以外の領域には、「無」のシンボルが記憶される。下位2bitのブロック#0についても同等に、条件テーブルにおける値の有無が条件メモリ#1に記憶されている。
For example, in the case of the upper 2-
図19は、図16の条件メモリにおける不一致判定処理の一例を示す図である。条件メモリが2つのブロックに分割されているので、入力データ0100も2つのブロックに分割して、不一致検出を行う。例えば、上記2ビット01と同じ値のアドレス01の値を読み出すことにより、グループ#1の不一致を検出することができる。
FIG. 19 is a diagram illustrating an example of a mismatch determination process in the condition memory of FIG. Since the condition memory is divided into two blocks, the
上述したように、特許文献1の不一致検出手段を用いた検索装置では、入力データと条件が完全に一致する「完全一致検索」において、高スループット化と低消費電力化を達成することができた。しかしながら、特許文献1の不一致演出手段は、値が0でも1でもよいDon’t Careシンボルに対応することができないため、ルータなどで用いられているPrefix検索に適用することができないという問題がある。
As described above, in the search device using the mismatch detection means of
本発明が解決しようとする課題は、Don’t Careに対応できる不一致検出手段を備え、Prefix検索に適用可能な検索装置を提供することにある。 The problem to be solved by the present invention is to provide a search device that includes mismatch detection means that can handle Don't Care and can be applied to Prefix search.
上述したような課題を解決するために、本発明に係る検索装置は、予め登録した複数の条件の中から入力されたデータと合致する条件を検索する検索装置であって、前記条件のそれぞれは、1つまたは複数のグループに属し、前記条件を記憶するメモリを備え、前記入力されたデータが前記条件と不一致であることを前記グループ毎に検出する不一致検出手段と、前記入力されたデータと前記条件とを照合して前記入力されたデータと合致する条件を検索する一致検索手段とを備え、前記条件は、前記条件に含まれるDon’tCareシンボルが0の場合と1の場合に展開され、前記メモリの各アドレスには、前記条件の一部または全てが前記各アドレスの数値と等しいか否かを表すシンボルが前記グループ毎に記憶されており、前記不一致検出手段は、前記入力された数値の一部または全てを前記メモリの読み出しアドレスとして、前記メモリから前記グループ毎のシンボルを読み出すことにより前記各グループに対する不一致を検出する手段と、前記検出の結果を前記一致検索手段に通知する手段とを備え、前記一致検索手段は入力されたデータと前記不一致が検出されたグループの条件との照合は行わないことを特徴とする。 In order to solve the above-described problems, a search device according to the present invention is a search device that searches for a condition that matches data input from a plurality of pre-registered conditions, and each of the conditions is A non-coincidence detection unit that belongs to one or a plurality of groups and includes a memory that stores the condition, and detects that the input data does not match the condition for each group; and the input data; A match search means for checking the condition and matching the input data with the condition, and the condition is expanded when the Don't Care symbol included in the condition is 0 and 1; Each address of the memory stores, for each group, a symbol indicating whether or not some or all of the conditions are equal to the numerical value of each address. The detecting means detects a mismatch for each group by reading a symbol for each group from the memory by using a part or all of the inputted numerical value as a read address of the memory, and a result of the detection. Means for notifying the match search means, wherein the match search means does not perform collation between the input data and the condition of the group in which the mismatch is detected.
また、前記不一致検出手段は、前記入力された数値を、当該桁数またはビット数より小さい複数のブロックからなる部分入力数値に分割する分割手段と、前記部分入力数値を前記メモリの読み出しアドレスとして、前記メモリから前記グループ毎のシンボルを読み出すことにより前記各グループに対する不一致を前記ブロック毎に検出する手段を備え、前記ブロック毎の各グループに対する不一致の検出結果を集計する集計手段とを備えるようにしてもよい。 In addition, the non-coincidence detecting unit includes a dividing unit that divides the input numerical value into partial input numerical values composed of a plurality of blocks smaller than the number of digits or the bit number, and the partial input numerical value as a read address of the memory. A unit for detecting a mismatch for each group by reading the symbol for each group from the memory for each block, and a totaling unit for counting the detection result of the mismatch for each group for each block. Also good.
また、前記条件は、Prefix値とDon’tCareシンボルの数とDon’tCareシンボルの位置の少なくとも一つに基づいてグループ分けされるようにしてもよい。 The conditions may be grouped based on at least one of a Prefix value, the number of Don't Care symbols, and the position of the Don't Care symbols.
また、前記条件の少なくとも一つがただ一つのグループにのみ属するようにしてもよい。 Further, at least one of the conditions may belong to only one group.
上述したような課題を解決するために、本発明に係る検索方法は、予め登録した複数の条件の中から入力されたデータと合致する条件を検索する検索方法であって、前記条件のそれぞれは、1つまたは複数のグループに属し、前記入力されたデータがメモリに記憶された前記条件と不一致であることを前記グループ毎に検出する不一致検出ステップと、前記入力されたデータと前記条件とを照合して前記入力されたデータと合致する条件を検索する一致検索ステップとを備え、前記条件は、前記条件に含まれるDon’tCareシンボルが0の場合と1の場合に展開され、前記メモリの各アドレスには、前記条件の一部または全てが前記各アドレスの数値と等しいか否かを表すシンボルが前記グループ毎に記憶されており、前記不一致検出ステップは、前記入力された数値の一部または全てを前記メモリの読み出しアドレスとして、前記メモリから前記グループ毎のシンボルを読み出すことにより前記各グループに対する不一致を検出するステップと、前記検出の結果を前記一致検索ステップに通知するステップとを備え、前記一致検索ステップは入力されたデータと前記不一致が検出されたグループの条件との照合は行わないことを特徴とする。 In order to solve the above-described problems, a search method according to the present invention is a search method for searching for a condition that matches data input from a plurality of previously registered conditions, and each of the conditions is A mismatch detection step for detecting for each group that the input data belongs to one or a plurality of groups and the input data does not match the condition stored in a memory; and the input data and the condition A matching search step for matching and searching for a condition that matches the input data. The condition is expanded when the Don't Care symbol included in the condition is 0 and 1, and Each address stores, for each group, a symbol indicating whether a part or all of the conditions are equal to the numerical value of each address. The step detects a mismatch for each group by reading a symbol for each group from the memory by using a part or all of the input numerical value as a read address of the memory, And a step of notifying the match search step, wherein the match search step does not perform collation between the input data and the condition of the group in which the mismatch is detected.
また、前記不一致検出ステップは、前記入力された数値を、当該桁数またはビット数より小さい複数のブロックからなる部分入力数値に分割するステップと、前記部分入力数値を前記メモリの読み出しアドレスとして、前記メモリから前記グループ毎のシンボルを読み出すことにより前記各グループに対する不一致を前記ブロック毎に検出するステップと、前記ブロック毎の各グループに対する不一致の検出結果を集計するステップとを備えるようにしてもよい。 The mismatch detection step includes the step of dividing the input numerical value into partial input numerical values composed of a plurality of blocks smaller than the number of digits or bits, and the partial input numerical value as a read address of the memory. You may make it provide the step which detects the mismatch with respect to each said group for every said block by reading the symbol for every said group from memory, and the step which totals the detection result of the mismatch with respect to each group for every said block.
前記条件は、Prefix値とDon’tCareシンボルの数とDon’tCareシンボルの位置の少なくとも一つに基づいてグループ分けされるようにしてもよい。 The conditions may be grouped based on at least one of the Prefix value, the number of Don't Care symbols, and the position of the Don't Care symbols.
前記条件の少なくとも一つがただ一つのグループにのみ属するようにしてもよい。 At least one of the conditions may belong to only one group.
本発明によれば、不一致検出手段を備えた検出装置において、検索条件にPrefixの値やDon’t Careシンボルがある場合でも、不一致検出結果を高くすることが可能となり、一致検索手段における入力データと条件の比較数を削減し、検索装置におけるスループットを向上させ、さらには低消費電力化を図ることができる。 According to the present invention, in the detection apparatus including the mismatch detection means, it is possible to increase the mismatch detection result even when the search condition includes a Prefix value or a Don't Care symbol, and the input data in the match search means Thus, the number of comparisons of the conditions can be reduced, the throughput of the search device can be improved, and further the power consumption can be reduced.
(第1の実施の形態)
本発明の第1の実施の形態を説明する。本実施の形態は、不一致検出手段のメモリに条件を登録する際、Don’t Careを含む1つの条件を、Don’t Careのシンボルが1の場合と0の場合というように条件を複数個に展開し、展開したDon’t Careシンボルを含まない全条件をメモリに登録する。
(First embodiment)
A first embodiment of the present invention will be described. In this embodiment, when registering a condition in the memory of the mismatch detection means, one condition including Don't Care is set to a plurality of conditions such as when the Don't Care symbol is 1 and 0. All the conditions not including the expanded Don't Care symbol are registered in the memory.
まず、ルータ等で用いられるPrefix検索を、図1を参照して説明する。Prefix検索において、条件テーブルの列は、条件と、Prefixと、優先度から構成される。Prefixは、入力データと条件の照合において、Don’t Care設定しない(照合対象になる)bit数が最上位bitから何bitかを示している。 First, Prefix search used in a router or the like will be described with reference to FIG. In the Prefix search, the condition table column includes a condition, a Prefix, and a priority. Prefix indicates how many bits from the most significant bit are not set in Don't Care (matching target) in collating the input data with the condition.
例えば、図2のように、条件が0000でPrefixが1の場合、0010という値を持つ入力データが入力されると、入力データと条件の下位3bitはDon’t Care扱いとなり、照合の対象にはならない。この場合、入力データである0010と条件0000の最上位bitのみが照合対象となり、最上位bitは両方とも0であるため、一致することになる。また、複数の条件が入力データと一致した場合には優先度が参照され、優先度が高い条件に一致したと判定される。
For example, as shown in FIG. 2, when the condition is 0000 and the Prefix is 1, when input data having a value of 0010 is input, the input data and the lower 3 bits of the condition are treated as Don't Care, and are used as targets of collation. Must not. In this case, only the most significant bits of the input data 0010 and the
不一致検出手段にPrefix検索用の条件を登録する例を、図3を用いて説明する。本図では、条件#0は条件値が0000でPrefixが3、条件#1は条件値が0100でPrefixが4、条件#2は条件値が1000でPrefixが4、条件#3は条件値が1011でPrefixが4とする。さらに、条件#0と#1がグループ#0に属し、条件#2と#3がグループ#1に属するとする。
An example of registering Prefix search conditions in the mismatch detection means will be described with reference to FIG. In this figure,
まず初めに、各条件のPrefixの値に応じてDon’t Careを設定する(Prefixの展開)。本図では、条件#0のPrefixが3であるため、条件#0は000*になる。次に、各条件のDon’t Care(*)が1の場合と0の場合に条件を展開する(Don’t Careの展開)。
First, Don't Care is set in accordance with the Prefix value of each condition (Prefix expansion). In this figure, since the Prefix for
本図の例では、条件#0のみがDon’t Careを含んでいるので、条件#0のみを展開する。条件#0は、000*であるため、この条件#0は、0000と0001という2つの条件に展開される。つまり、条件テーブルの条件が5種あることと同じになる。
In the example of this figure, since
最後に、図4に示すように、Prefix検索用に5種に展開された条件を従来と同様に不一致検出手段のメモリに登録すればよい。ここで、Don’t Careを展開した2つの条件、0000と0001は、条件#0が属していたグループ#0に属する。このように、条件テーブルがDon’t Careを含んでいる場合には、Don’t Careの展開を行って、メモリに登録することにより、Prefix値およびDon’t Careを考慮する必要がなくなるので、入力データが入力された時の動作は、従来の完全一致検索での不一致検出手段の動作と同様に不一致検出が可能となる。
Finally, as shown in FIG. 4, the five conditions for the Prefix search may be registered in the memory of the mismatch detection means as in the conventional case. Here, the two conditions, 0000 and 0001, which expanded Don't Care belong to the
以上のような処理を行う不一致検出手段の構成例を図5に示す、不一致検出手段20は入力データを遅延させて一致検索手段に入力するための遅延手段21と、条件テーブルが記憶されている条件メモリ22から構成されており、条件メモリ22に入力データを読み出しアドレスとして入力すると各グループ毎の不一致検出結果が出力される。尚、検出装置全体の構成は図15と同様である。
FIG. 5 shows an example of the configuration of the mismatch detection means that performs the above processing. The mismatch detection means 20 stores a delay means 21 for delaying input data and input it to the match search means, and a condition table. When the input data is input to the
尚、図6に示すように、Don’t Careの展開を行った場合にも、条件テーブルをnbitずつの複数のブロックに分割し、各ブロック毎に並列に不一致を検出することも可能である。この場合の不一致検出手段の構成を図7に示す。不一致検出手段20は、入力データを複数のブロックに分割するデータ分割手段24と各ブロック毎に不一致検出結果を出力する条件メモリ22および23、ブロック毎に不一致検出結果を集計する集計手段25を備える。不一致検出手段20は各グループ毎に不一致検出結果を集計して一致検索手段に出力する。
As shown in FIG. 6, even when Don't Care is expanded, it is possible to divide the condition table into a plurality of blocks each having n bits and detect inconsistencies in parallel for each block. . The configuration of the mismatch detection means in this case is shown in FIG. The
本実施の形態において、検索する条件テーブルの条件値は4種類としたが、入力データおよび各条件の数値範囲や、条件の登録数によらず他の条件値の場合でも本発明が適用可能であることはいうまでもない。条件のグループ分けについても2つのグループに限らず、各条件の数値範囲や、条件の登録数に応じて適宜選択すればよい。例えば、グループ数を1つにした場合でも、本発明の適用は可能である。また、各グループの条件数を等しくする必要はない。 In this embodiment, four condition values are searched for in the condition table to be searched. However, the present invention can be applied to other condition values regardless of the input data, the numerical range of each condition, and the number of registered conditions. Needless to say. The grouping of conditions is not limited to two groups, and may be appropriately selected according to the numerical range of each condition and the number of registered conditions. For example, the present invention can be applied even when the number of groups is one. Moreover, it is not necessary to make the condition number of each group equal.
本実施の形態では、Prefix値に応じて上位bitからDon’t Care設定をしないbit数を設定するPrefix検索方式に適用した例を示したが、Don’t Careがランダムに設定されているような場合にも適用可能である。 In the present embodiment, an example applied to the Prefix search method in which the number of bits that do not set Don't Care is set from the upper bits according to the Prefix value is shown, but Don't Care seems to be set at random. It is applicable to any case.
また、本実施の形態において、一致判定手段は線形検索方式を実装した構成となっているが、構成はこれのみに限られず、たとえば2分探索木方式やB木探索、さらには、CAM(Content addressing memory)を用いてもよい。 In the present embodiment, the match determination unit has a configuration in which a linear search method is implemented. However, the configuration is not limited to this, and for example, a binary search tree method, a B-tree search, and a CAM (Content addressing memory) may be used.
本実施の形態においては、検索装置が検索結果を出力する例を示したが、それぞれの条件が入力データと合致した場合に出力すべきデータ(関連データ)を一致検索手段のメモリに格納し、判定結果の代わりに上記関連データを出力する構成でもよい。例えば、関連データを出力ポートや出力キューとすることもできる。 In the present embodiment, an example in which the search device outputs a search result has been shown, but data (related data) to be output when each condition matches the input data is stored in the memory of the match search means, Instead of the determination result, the related data may be output. For example, related data can be output ports or output queues.
本実施の形態では、本発明をハードウェアに実装した例を示したが、本発明をプログラム言語で記述したソフトウェアに実装してもよいことはいうまでもない。 In the present embodiment, an example in which the present invention is implemented in hardware has been described, but it goes without saying that the present invention may be implemented in software described in a program language.
(第2の実施の形態)
図8、9を用いて、本発明の第2の実施の形態を説明する。本実施の形態も第1の実施の形態と同様に、Don’t Careシンボルを展開するが、条件をPrefixに基づいてグループ分けしている点が、第1の実施の形態と異なる。
(Second Embodiment)
A second embodiment of the present invention will be described with reference to FIGS. As in the first embodiment, this embodiment also expands the Don't Care symbol, but differs from the first embodiment in that conditions are grouped based on Prefix.
第1の実施の形態では、Prefixや条件に含まれるDon’t Careシンボルを考慮することなく、各条件が属するグループが決めていた。しかし、このやり方では、各グループに属する条件のPrefix値によっては不一致検出手段が不一致を検出できる確率が低下し、一致判定手段で検索する条件数を削減できない場合がある。 In the first embodiment, the group to which each condition belongs is determined without considering the Prefix and the Don't Care symbol included in the condition. However, in this method, depending on the Prefix value of the condition belonging to each group, the probability that the mismatch detection unit can detect a mismatch may decrease, and the number of conditions searched by the match determination unit may not be reduced.
例えば、図8に示すように、条件#0は条件値が0000でPrefixが0、条件#1は条件値が0100でPrefixが4、条件#2は条件値が1000でPrefixが0、条件#3は条件値が1011でPrefixが4とする。この場合、Prefixを展開すると、条件#0と#2は、****となる。
For example, as shown in FIG. 8,
****のDon’t Careを展開すると、0000〜1111のすべての数値範囲を取りうるため、図8に示すように不一致を検出するメモリには全て「有」のシンボルが書き込まれてしまい、入力データが不一致検出手段に入力されても全グループに対して不一致を検出することができず、後段の一致検出手段で入力データと全条件の比較が必要になってしまう。 When Don't Care of **** is expanded, all numerical values in the range of 0000 to 1111 can be obtained, and therefore, a “present” symbol is written in all the memories that detect mismatches as shown in FIG. Even if input data is input to the mismatch detection means, it is not possible to detect mismatches for all groups, and it is necessary to compare the input data with all conditions in the subsequent match detection means.
この問題を解決するため本実施の形態では、図9に示すように、Prefixの値に応じてグループ分けを行う。例えば、図8の4種の条件の場合には、Prefix値が0である条件#0と#2をグループ#0とし、Prefix値が4である条件#1と#3をグループ#1とする。このようにグループ分けを行うことにより、図9に示すように、****という条件はグループ#0のみに存在することになり、不一致を検出するメモリのbit[1]には「無」のシンボルが存在できるようになる。
In order to solve this problem, in this embodiment, as shown in FIG. 9, grouping is performed according to the value of Prefix. For example, in the case of the four types of conditions shown in FIG. 8,
このように、Prefixの値に応じてグループ分けを行うことにより、グループ#1に関しては不一致を検出できるようになり、一致検索手段における入力データと条件の比較数を削減することができるようになる。グループ分けの方法としては、各条件の値ができるだけ同じグループにのみ存在するようにグループ分けを行えば、上述したように特定のグループに対する不一致の検出確率を高くすることができる。さらに、各条件の値が一つのグループのみ存在するようにグループ分けを行えば、より不一致の検出確率を高くすることができる。
In this way, by performing grouping according to the value of Prefix, it becomes possible to detect mismatches for
(第3の実施の形態)
第2の実施の形態では、Prefixの値に応じて条件のグループ分けを実施する例を示したが、Don’t Careの数や位置に応じて条件のグループ分けを行ってもよい。
(Third embodiment)
In the second embodiment, an example in which condition grouping is performed according to the value of Prefix has been described. However, condition grouping may be performed according to the number and position of Don't Care.
すなわち、不一致検出手段において、不一致となるグループが検出できる確率が高くなるように条件テーブルのグループ分けを行うことにより、一致検索手段における入力データと条件との比較する稼働を削減することが可能である。Don’t Careの数に応じてグループ分けを行う場合は、例えば、同じ数のDon’t Careシンボルを有する条件を同じグループにすることにより不一致となるグループが検出できる確率を高くすることができる。 That is, in the mismatch detection unit, it is possible to reduce the operation of comparing the input data and the condition in the match search unit by grouping the condition table so that the probability that a group that does not match can be detected becomes high. is there. When performing grouping according to the number of Don't Care, for example, by making the condition having the same number of Don't Care symbols the same group, the probability that a mismatching group can be detected can be increased. .
図10〜図13を用いて、Don’t Careの位置に応じて条件のグループ分けを行う場合を説明する。 A case where conditions are grouped according to the position of Don't Care will be described with reference to FIGS.
図10は、Don’t Careがランダムに設定されている場合の条件テーブルの構成例である。図10に示すように、条件#0は条件値が000*であり、最下位bitがDon’t Care設定されている。同様に、条件#1は最上位bitがDon’t Care設定され、条件#2は最下位bitがDon’t Care設定され、条件#3は最上位bitがDon’t Care設定されている。
FIG. 10 is a configuration example of a condition table when Don't Care is set at random. As shown in FIG. 10, the
この条件テーブルにおいて、各条件のDon’t Careシンボルを展開すると図10に示すように8つの条件に展開される。 In this condition table, when the Don't Care symbol of each condition is expanded, it is expanded into eight conditions as shown in FIG.
本実施の形態では、この条件テーブルを2つのブロックに分割して各ブロック毎に並列に不一致を検出する場合を説明する。図11は、図10の条件テーブルを2つのブロックに分けて不一致検出をする場合のメモリの構成例である。 In the present embodiment, a case will be described in which this condition table is divided into two blocks and a mismatch is detected in parallel for each block. FIG. 11 is a configuration example of a memory when the condition table of FIG. 10 is divided into two blocks and mismatch detection is performed.
この例では、上位2bitのブロック#1と下位2bitのブロック#0のそれぞれのアドレス領域には、グループ#1、グループ#0の両方に「有」が記憶されているアドレスがそれぞれ2アドレスずつ存在するため、不一致検出ができる確率が低くなってしまう。
In this example, in each address area of the upper 2-
これに対して、図12に示すように、Don’t Careの位置が同じ条件#0と条件#2、条件#1と条件#3がそれぞれ同じグループになるようにグループ分けを行った場合を説明する。図13は、図12の条件テーブルを2つのブロックに分けて不一致検出をする場合のメモリの構成例である。
On the other hand, as shown in FIG. 12, the case where the grouping is performed so that the
図13のメモリを用いた場合には、上位2bitのブロック#1と下位2bitのブロック#0のそれぞれのアドレス領域において、グループ#1、グループ#0の両方に「有」が記憶されているアドレスがそれぞれ1アドレスずつとなり、図11の場合と比較して、不一致となるグループの検出確率を高くすることができる。
When the memory shown in FIG. 13 is used, in each address area of the upper 2-
このように、Don’t Careシンボルの位置に応じてグループ分けを行うことにより、不一致となるグループの検出確率を高くすることができ、一致検索手段における入力データと条件の比較数を削減することができるようになる。グループ分けの方法としては、各条件の値ができるだけ同じグループにのみ存在するようにグループ分けを行えば、上述したように特定のグループに対する不一致の検出確率を高くすることができる。さらに、各条件の値が一つのグループのみ存在するようにグループ分けを行えば、より不一致の検出確率を高くすることができる。 Thus, by performing grouping according to the position of the Don't Care symbol, it is possible to increase the detection probability of a group that does not match, and to reduce the number of comparisons of input data and conditions in the match search means. Will be able to. As a grouping method, if the grouping is performed so that the values of the respective conditions exist only in the same group as much as possible, it is possible to increase the mismatch detection probability for a specific group as described above. Further, if the grouping is performed so that the value of each condition exists in only one group, the detection probability of mismatch can be further increased.
尚、第3の実施の形態では、Don’t Careの数が1つの場合の例を説明したが、これに限られず、Prefixの値、Don’t Careの数や位置に応じて適宜条件テーブルのグループ分けや複数ブロックへの分割を行うことにより、不一致となるグループの検出確率を高くすることができ、一致検索手段における入力データと条件の比較数を削減することができるようになる。 In the third embodiment, an example in which the number of Don't Care is one has been described. However, the present invention is not limited to this, and the condition table is appropriately set according to the value of Prefix and the number and position of Don't Care. By performing grouping and division into a plurality of blocks, it is possible to increase the detection probability of a group that does not match, and to reduce the number of comparisons of input data and conditions in the matching search means.
以上のように、本発明の実施の形態によれば、不一致検出手段を備えた検出装置において、検索条件にPrefixの値やDon’t Careシンボルがある場合でも、不一致検出結果を高くすることが可能となり、一致検索手段における入力データと条件の比較数を削減し、検索装置におけるスループットを向上させ、さらには低消費電力化を図ることができる。 As described above, according to the embodiment of the present invention, in the detection apparatus including the mismatch detection unit, even when the search condition includes the value of Prefix or the Don't Care symbol, the mismatch detection result can be increased. This makes it possible to reduce the number of comparisons between input data and conditions in the match search means, improve the throughput in the search device, and further reduce power consumption.
本発明は、検索条件にPrefixの値やDon’t Careシンボルがある場合でも、高いスループットで受信したパケットのフィルタリングやルーティング処理を行うことができる通信装置に適用できる。 The present invention can be applied to a communication apparatus that can perform filtering and routing processing of packets received at high throughput even when the search condition includes a Prefix value or a Don't Care symbol.
10…検索装置、20…不一致検出手段、21…遅延手段、22、23…条件メモリ、24…データ分割手段、25…集計手段、30…一致検索手段、40…条件メモリ、50…比較部。
DESCRIPTION OF
Claims (8)
前記条件のそれぞれは、1つまたは複数のグループに属し、
前記条件を記憶するメモリを備え、
前記入力されたデータが前記条件と不一致であることを前記グループ毎に検出する不一致検出手段と、
前記入力されたデータと前記条件とを照合して前記入力されたデータと合致する条件を検索する一致検索手段とを備え、
前記条件は、前記条件に含まれるDon’tCareシンボルが0の場合と1の場合に展開され、前記メモリの各アドレスには、前記条件の一部または全てが前記各アドレスの数値と等しいか否かを表すシンボルが前記グループ毎に記憶されており、
前記不一致検出手段は、前記入力された数値の一部または全てを前記メモリの読み出しアドレスとして、前記メモリから前記グループ毎のシンボルを読み出すことにより前記各グループに対する不一致を検出する手段と、前記検出の結果を前記一致検索手段に通知する手段とを備え、
前記一致検索手段は入力されたデータと前記不一致が検出されたグループの条件との照合は行わないこと、
前記条件は、Prefix値とDon’tCareシンボルの数とDon’tCareシンボルの位置の少なくとも一つに基づいてグループ分けされ、前記条件の一部または全てが前記各アドレスの数値と等しいことを表すシンボルの数が最小となるように、グループ分けされること
を特徴とする検索装置。 A search device that searches for a condition that matches data input from a plurality of pre-registered conditions,
Each of the conditions belongs to one or more groups,
A memory for storing the conditions;
Mismatch detection means for detecting for each group that the input data does not match the condition;
A match search means for matching the input data with the condition and searching for a condition that matches the input data;
The condition is expanded when the Don't Care symbol included in the condition is 0 or 1, and whether or not a part or all of the condition is equal to the numerical value of each address in each address of the memory. A symbol representing this is stored for each group,
The mismatch detection means detects a mismatch for each group by reading a symbol for each group from the memory by using a part or all of the input numerical values as a read address of the memory, and the detection Means for notifying the match search means of the result,
The match search means does not perform collation between the input data and the condition of the group in which the mismatch is detected ;
The conditions are grouped based on at least one of the Prefix value, the number of Don't Care symbols, and the position of the Don't Care symbols, and a symbol indicating that a part or all of the conditions are equal to the numerical value of each address. A search apparatus characterized by being grouped so as to minimize the number of .
前記入力された数値を、当該桁数またはビット数より小さい複数のブロックからなる部分入力数値に分割する分割手段と、
前記部分入力数値を前記メモリの読み出しアドレスとして、前記メモリから前記グループ毎のシンボルを読み出すことにより前記各グループに対する不一致を前記ブロック毎に検出する手段を備え、
前記ブロック毎の各グループに対する不一致の検出結果を集計する集計手段とを備えること
を特徴とする請求項1記載の検索装置。 The mismatch detection means includes
Dividing means for dividing the inputted numerical value into partial input numerical values composed of a plurality of blocks smaller than the number of digits or the number of bits;
Means for detecting, for each block, a mismatch for each group by reading a symbol for each group from the memory using the partial input numerical value as a read address of the memory;
The search device according to claim 1, further comprising: a counting unit that tabulates the mismatch detection results for each group for each block.
を特徴とする請求項1または2記載の検索装置。 The condition is whether Prefix value is the same, whether the condition after Don'tCare symbol is deployed are the same, the position of Don'tCare symbols based on at least one of either the same The search device according to claim 1, wherein the search device is divided into groups.
を特徴とする請求項1乃至3のいずれか一つに記載の検索装置。 The search device according to any one of claims 1 to 3, wherein at least one of the conditions belongs to only one group.
前記条件のそれぞれは、1つまたは複数のグループに属し、
前記入力されたデータがメモリに記憶された前記条件と不一致であることを前記グループ毎に検出する不一致検出ステップと、
前記入力されたデータと前記条件とを照合して前記入力されたデータと合致する条件を検索する一致検索ステップとを備え、
前記条件は、前記条件に含まれるDon’tCareシンボルが0の場合と1の場合に展開され、前記メモリの各アドレスには、前記条件の一部または全てが前記各アドレスの数値と等しいか否かを表すシンボルが前記グループ毎に記憶されており、
前記不一致検出ステップは、前記入力された数値の一部または全てを前記メモリの読み出しアドレスとして、前記メモリから前記グループ毎のシンボルを読み出すことにより前記各グループに対する不一致を検出するステップと、前記検出の結果を前記一致検索ステップに通知するステップとを備え、
前記一致検索ステップは入力されたデータと前記不一致が検出されたグループの条件との照合は行わないこと、
前記条件は、Prefix値とDon’tCareシンボルの数とDon’tCareシンボルの位置の少なくとも一つに基づいてグループ分けされ、前記条件の一部または全てが前記各アドレスの数値と等しいことを表すシンボルの数が最小となるように、グループ分けされること
を特徴とする検索方法。 A search method for searching for a condition that matches data input from a plurality of pre-registered conditions,
Each of the conditions belongs to one or more groups,
A mismatch detection step for detecting for each group that the input data does not match the condition stored in a memory;
A match search step of matching the input data with the condition and searching for a condition that matches the input data;
The condition is expanded when the Don't Care symbol included in the condition is 0 or 1, and whether or not a part or all of the condition is equal to the numerical value of each address in each address of the memory. A symbol representing this is stored for each group,
The mismatch detection step includes detecting a mismatch for each group by reading a symbol for each group from the memory using a part or all of the input numerical value as a read address of the memory, Notifying the result to the match search step,
The matching search step does not perform matching between the input data and the condition of the group in which the mismatch is detected ;
The conditions are grouped based on at least one of the Prefix value, the number of Don't Care symbols, and the position of the Don't Care symbols, and a symbol indicating that a part or all of the conditions are equal to the numerical value of each address. A search method characterized by grouping so that the number of items is minimized .
前記入力された数値を、当該桁数またはビット数より小さい複数のブロックからなる部分入力数値に分割するステップと、
前記部分入力数値を前記メモリの読み出しアドレスとして、前記メモリから前記グループ毎のシンボルを読み出すことにより前記各グループに対する不一致を前記ブロック毎に検出するステップと、
前記ブロック毎の各グループに対する不一致の検出結果を集計するステップとを備えること
を特徴とする請求項5記載の検索方法。 The mismatch detection step includes:
Dividing the input numerical value into partial input numerical values composed of a plurality of blocks smaller than the number of digits or the number of bits;
Detecting a mismatch for each group by reading the symbol for each group from the memory using the partial input numerical value as a read address of the memory;
The method according to claim 5, further comprising a step of counting the mismatch detection results for each group for each block.
を特徴とする請求項5または6記載の検索方法。 The condition is whether Prefix value is the same, whether the condition after Don'tCare symbol is deployed are the same, the position of Don'tCare symbols based on at least one of either the same The search method according to claim 5 or 6, wherein the search method is divided into groups.
を特徴とする請求項5乃至7のいずれか一つに記載の検索方法。 The search method according to any one of claims 5 to 7, wherein at least one of the conditions belongs to only one group.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013175946A JP6073761B2 (en) | 2013-08-27 | 2013-08-27 | Search device and search method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013175946A JP6073761B2 (en) | 2013-08-27 | 2013-08-27 | Search device and search method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2015046711A JP2015046711A (en) | 2015-03-12 |
JP6073761B2 true JP6073761B2 (en) | 2017-02-01 |
Family
ID=52671913
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2013175946A Active JP6073761B2 (en) | 2013-08-27 | 2013-08-27 | Search device and search method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6073761B2 (en) |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4156112B2 (en) * | 1998-12-25 | 2008-09-24 | 富士通株式会社 | High-speed search method and high-speed search device |
JP3250544B2 (en) * | 1999-04-16 | 2002-01-28 | 日本電気株式会社 | Transfer destination search method, transfer destination search device, search table recording medium, and search program recording medium |
JP3569802B2 (en) * | 1999-06-17 | 2004-09-29 | 日本電信電話株式会社 | Routing table search device and search method |
JP5584171B2 (en) * | 2011-06-13 | 2014-09-03 | 日本電信電話株式会社 | Match determination apparatus, method, and program |
-
2013
- 2013-08-27 JP JP2013175946A patent/JP6073761B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2015046711A (en) | 2015-03-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11102120B2 (en) | Storing keys with variable sizes in a multi-bank database | |
US10496680B2 (en) | High-performance bloom filter array | |
US9984144B2 (en) | Efficient lookup of TCAM-like rules in RAM | |
US8856203B1 (en) | System and method for algorithmic TCAM packet classification | |
EP2830260B1 (en) | Rule matching method and device | |
US20200228449A1 (en) | Exact match and ternary content addressable memory (tcam) hybrid lookup for network device | |
US20180083770A1 (en) | Detecting encoding attack | |
CN111817978B (en) | Flow classification method and device | |
CN106789859B (en) | Message matching method and device | |
Yang et al. | Fast OpenFlow table lookup with fast update | |
CN108664518B (en) | Method and device for realizing table look-up processing | |
CN109039911B (en) | Method and system for sharing RAM based on HASH searching mode | |
JP6073761B2 (en) | Search device and search method | |
US10795580B2 (en) | Content addressable memory system | |
US9703484B2 (en) | Memory with compressed key | |
US20160105363A1 (en) | Memory system for multiple clients | |
US11025650B2 (en) | Multi-pattern policy detection system and method | |
US10476785B2 (en) | IP routing search | |
JP5584171B2 (en) | Match determination apparatus, method, and program | |
JP3757882B2 (en) | Packet filtering method | |
CN111177198B (en) | Content searching method for chip | |
Kumar et al. | Fast map-addressing for content addressable memories using register reconfiguration | |
JP2002374289A (en) | Retrieval system and method for registering retrieval condition to cam used therefor, and program thereof | |
Lin et al. | TCAM-Based Packet Classification Using Multi-stage Scheme | |
CN108632131B (en) | Email address matching method based on fingerprint type variable-length bloom filter |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20150825 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20160720 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20160816 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20161012 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20161227 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20170105 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6073761 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |