JP6073761B2 - Search device and search method - Google Patents

Search device and search method Download PDF

Info

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
Application number
JP2013175946A
Other languages
Japanese (ja)
Other versions
JP2015046711A (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.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone Corp
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 Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2013175946A priority Critical patent/JP6073761B2/en
Publication of JP2015046711A publication Critical patent/JP2015046711A/en
Application granted granted Critical
Publication of JP6073761B2 publication Critical patent/JP6073761B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing 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 search device 10 includes a condition memory 40 that stores a condition table, and a comparator 50 that compares input data with a condition. In this configuration, when input data is input at the start, the comparator transmits a read address to the condition memory, reads the conditions stored in the condition memory one by one, and compares them with the input data. When all the conditions and the input data are compared, the result is output to the outside as a search result.

上記方式では、入力データと全条件とを比較した後でなければ検索結果を出力できないため、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, Patent Document 1 proposes a search device using a mismatch detection means. In the search device of Patent Document 1, the search device is provided with a mismatch detection means capable of detecting a condition that does not match input data in a short time, so that the number of processes for reading and comparing the condition that does not match the input data from the condition memory can be increased. This can reduce the average search time of the search device.

図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 Patent Document 1. The search device 10 includes a match search unit 30 that searches for a condition that matches input data by a method similar to the linear search method of FIG. 14, and a mismatch detection unit 20 that can detect a condition that does not match input data in a short time. Composed. In the search device 10, the registered conditions are divided into a plurality of groups. For example, if four types of conditions (condition # 0: 0000, condition # 1: 0100, condition # 2: 1000, condition # 3: 1011) are registered in the condition table, the condition # 0 and the condition # 1 are grouped. # 0 and condition # 2 and condition # 3 are group # 1.

検索装置10に入力される入力データは、まず不一致検出手段20に入力される。この不一致検索手段20は、入力データと合致する条件が存在していない(不一致)グループを短時間で検出する。そして、不一致検出手段20は、不一致を検出したグループを不一致検出結果として一致検索手段30に出力する。不一致検出手段20で不一致が検出されたグループは一致検索手段30で検索する必要がなくなるため、一致検索手段30において条件をメモリから読み出して入力データと比較する処理数が削減でき、検索装置10の平均検索時間を短くすることができる。   The input data input to the search device 10 is first input to the mismatch detection means 20. The mismatch search means 20 detects a group that does not have a condition that matches the input data (mismatch) in a short time. Then, the mismatch detection unit 20 outputs the group in which the mismatch is detected to the match search unit 30 as a mismatch detection result. Since it is not necessary to search the group in which the mismatch is detected by the mismatch detection unit 20 by the match search unit 30, the number of processes in which the condition search unit 30 reads the condition from the memory and compares it with the input data can be reduced. The average search time can be shortened.

特許文献1の不一致検出手段は、条件メモリを用いてグループ毎の不一致を検出する。この条件メモリには、グループ毎に条件が登録される。条件をメモリに登録する方法を図16を用いて説明する。条件メモリの各bitは、それぞれのグループに対応する。たとえば、条件メモリのbit[0]はグループ#0に対応し、bit[1]はグループ#1に対応する。そして、各アドレスにはグループ毎の条件テーブルの値の有無が記憶されており、条件テーブルの値と等しいアドレスには、その条件が属するグループに「有」が記憶され、それ以外の領域には、「無」が記憶されている。   The mismatch detection means of Patent Document 1 detects a mismatch for each group using a condition memory. Conditions are registered in this condition memory for each group. A method for registering the conditions in the memory will be described with reference to FIG. Each bit of the condition memory corresponds to each group. For example, bit [0] in the condition memory corresponds to group # 0, and bit [1] corresponds to group # 1. Each address stores the presence / absence of a value in the condition table for each group. In an address equal to the value in the condition table, “Yes” is stored in the group to which the condition belongs, and in other areas. , “Nothing” is stored.

例えば、条件#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 address 0000 of the condition memory. Similarly, the condition # 1 (the value is 0100) Bit [0] of condition memory address 0100 due to group # 0), bit [1] of condition memory address 1000 due to condition # 2 (value belonging to group # 1 with condition 1000), condition # 3 (value Is 1011 and belongs to group # 1), a “present” symbol is stored in bit [1] of address 1011 of the condition memory. In the other areas, the symbol “Nothing” is stored.

本メモリを用いてグループ毎の不一致を検出する場合には、図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 address 0100 of the condition memory is read. Since the “Yes” condition is stored in bit [0] of address 0100 and the “No” condition is stored in bit [1], a mismatch detection result is output to group # 1. When a mismatch is detected in group # 1, it is not necessary to compare the input data with the conditions of group 1 in the subsequent matching search means.

このように、入力データと等しいアドレスを読み出すだけで、各グループ毎にデータの不一致が検出できるので、一致検索処理において不一致が検出されたグループの一致検索が不要となり、入力データと比較する処理数を削減することができる。   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 Patent Document 1, m bits are divided into blocks each of n bits, and a means for detecting a mismatch in parallel is taken to reduce the memory capacity.

図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, block # 0 and block # 1, and a condition memory is prepared for each block. In each divided block, the condition table is divided into two groups. In the address of the condition memory equal to the value of each condition, “present” is stored in the group to which the condition belongs, and in other areas, “Nothing” is stored.

例えば、上位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-bit block # 1, the symbol “Yes” is stored in bit [0] of the address 00 of the condition memory # 2 due to the condition # 0 (value is 00 and belongs to the group # 0). Similarly, according to condition # 1 (value is 01 and belongs to group # 0), condition [bit] of address 01 in condition memory # 2 and condition # 2 (value is 10 and belongs to group # 1) A bit “1” is stored in bit [1] of address 10 of condition memory # 2 due to bit [1] of address 10 of memory # 2 and condition # 3 (value is 10 and belongs to group # 1). . In the other areas, the symbol “Nothing” is stored. Similarly, the presence or absence of a value in the condition table is also stored in the condition memory # 1 for the lower 2-bit block # 0.

図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 input data 0100 is also divided into two blocks and mismatch detection is performed. For example, it is possible to detect the mismatch of the group # 1 by reading the value of the address 01 having the same value as the 2 bits 01.

特開2013−3644号公報JP2013-3644A

上述したように、特許文献1の不一致検出手段を用いた検索装置では、入力データと条件が完全に一致する「完全一致検索」において、高スループット化と低消費電力化を達成することができた。しかしながら、特許文献1の不一致演出手段は、値が0でも1でもよいDon’t Careシンボルに対応することができないため、ルータなどで用いられているPrefix検索に適用することができないという問題がある。   As described above, in the search device using the mismatch detection means of Patent Document 1, it is possible to achieve high throughput and low power consumption in “complete match search” in which input data and conditions completely match. . However, the discrepancy presentation means of Patent Document 1 cannot cope with a Don't Care symbol whose value may be 0 or 1, and therefore cannot be applied to a Prefix search used in a router or the like. .

本発明が解決しようとする課題は、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は、本発明の実施の形態に係る条件メモリ内の条件テーブルの一例を表す図である。FIG. 1 is a diagram showing an example of a condition table in the condition memory according to the embodiment of the present invention. 図2は、本発明の実施の形態に係るPrefix値が設定されている場合のマスク処理を説明する図である。FIG. 2 is a diagram for explaining the masking process when the Prefix value is set according to the embodiment of the present invention. 図3は、本発明の実施の形態に係る条件テーブルのDon’tCareシンボルを展開した場合の条件テーブルを説明する図である。FIG. 3 is a diagram for explaining the condition table when the Don't Care symbol of the condition table according to the embodiment of the present invention is expanded. 図4は、本発明の実施の形態に係るDon’tCareシンボルを展開した条件テーブルを登録した条件メモリを説明する図である。FIG. 4 is a diagram for explaining a condition memory in which a condition table in which a Don't Care symbol is expanded is registered according to the embodiment of the present invention. 図5は、本発明の実施の形態に係る不一致検出手段のブロック図である。FIG. 5 is a block diagram of the mismatch detection means according to the embodiment of the present invention. 図6は、本発明の実施の形態に係る条件テーブルを2つのブロックに分割した場合の条件テーブルおよび条件メモリを説明する図である。FIG. 6 is a diagram for explaining the condition table and the condition memory when the condition table according to the embodiment of the present invention is divided into two blocks. 図7は、本発明の実施の形態に係る条件テーブルを2つのブロックに分割した場合の不一致検出手段のブロック図である。FIG. 7 is a block diagram of the mismatch detection means when the condition table according to the embodiment of the present invention is divided into two blocks. 図8は、Prefix値によるグループ分けを行わなかった場合の条件テーブルおよび条件メモリを説明する図である。FIG. 8 is a diagram for explaining the condition table and the condition memory when the grouping by the Prefix value is not performed. 図9は、本発明の実施の形態に係るPrefix値によるグループ分けを行った場合の条件テーブルおよび条件メモリを説明する図である。FIG. 9 is a diagram for explaining a condition table and a condition memory when grouping is performed according to the Prefix value according to the embodiment of the present invention. 図10は、Don’tCareシンボルの位置によるグループ分けを行わなかった場合の条件テーブルを説明する図である。FIG. 10 is a diagram illustrating a condition table in the case where grouping based on the position of the Don't Care symbol is not performed. 図11は、本発明の実施の形態に係るDon’t Careシンボルの位置によるグループ分けを行わず、かつ条件テーブルを2つのブロックに分割した場合の条件テーブルおよび条件メモリを説明する図である。FIG. 11 is a diagram for explaining a condition table and a condition memory when grouping based on the position of the Don't Care symbol according to the embodiment of the present invention is not performed and the condition table is divided into two blocks. 図12は、Don’tCareシンボルの位置によるグループ分けを行った場合の条件テーブルを説明する図である。FIG. 12 is a diagram illustrating a condition table when grouping is performed based on the position of the Don't Care symbol. 図13は、本発明の実施の形態に係るDon’t Careシンボルの位置によるグループ分けを行い、かつ条件テーブルを2つのブロックに分割した場合の条件テーブルおよび条件メモリを説明する図である。FIG. 13 is a diagram for explaining a condition table and a condition memory when grouping is performed according to the position of the Don't Care symbol according to the embodiment of the present invention and the condition table is divided into two blocks. 図14は、従来の検索装置のブロック図である。FIG. 14 is a block diagram of a conventional search device. 図15は、従来の不一致検出手段を備えた検索装置のブロック図である。FIG. 15 is a block diagram of a search apparatus provided with a conventional mismatch detection means. 図16は、従来の検索装置における条件テーブル及び条件メモリを一例を示す図である。FIG. 16 is a diagram illustrating an example of a condition table and a condition memory in a conventional search device. 図17は、従来の検索装置における不一致検索手段における不一致判定処理の一例を示す図である。FIG. 17 is a diagram showing an example of the mismatch determination process in the mismatch search means in the conventional search device. 図18は、従来の検索装置における条件テーブルをを2つのブロックに分割した場合の条件テーブルおよび条件メモリを説明する図である。FIG. 18 is a diagram for explaining a condition table and a condition memory when the condition table in the conventional search device is divided into two blocks. 図19は、従来の検索装置における条件テーブルをを2つのブロックに分割した場合の条件メモリにおける不一致判定処理の一例を示す図である。FIG. 19 is a diagram showing an example of the mismatch determination process in the condition memory when the condition table in the conventional search device is divided into two blocks.

(第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 condition 0000 are to be collated, and both the most significant bits are 0, so they match. Further, when a plurality of conditions match the input data, the priority is referred to, and it is determined that the condition matches a higher priority.

不一致検出手段に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, condition # 0 is condition value 0000 and Prefix is 3, condition # 1 is condition value 0100 and Prefix is 4, condition # 2 is condition value 1000, Prefix is 4, condition # 3 is condition value In 1011, Prefix is set to 4. Furthermore, it is assumed that conditions # 0 and # 1 belong to group # 0, and conditions # 2 and # 3 belong to group # 1.

まず初めに、各条件の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 condition # 0 is 3, condition # 0 is 000 *. Next, the condition is expanded when Don't Care (*) of each condition is 1 and 0 (development of Don't Care).

本図の例では、条件#0のみがDon’t Careを含んでいるので、条件#0のみを展開する。条件#0は、000*であるため、この条件#0は、0000と0001という2つの条件に展開される。つまり、条件テーブルの条件が5種あることと同じになる。   In the example of this figure, since only condition # 0 includes Don't Care, only condition # 0 is expanded. Since condition # 0 is 000 *, this condition # 0 is expanded into two conditions, 0000 and 0001. That is, it is the same as having five conditions in the condition table.

最後に、図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 group # 0 to which the condition # 0 belonged. As described above, when the condition table includes Don't Care, it is not necessary to consider the Prefix value and Don't Care by expanding Don't Care and registering it in the memory. The operation when the input data is input can detect the mismatch as the operation of the mismatch detection means in the conventional complete match search.

以上のような処理を行う不一致検出手段の構成例を図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 condition memory 22 as a read address, a mismatch detection result for each group is output. The overall configuration of the detection apparatus is the same as that shown in FIG.

尚、図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 mismatch detection unit 20 includes a data division unit 24 that divides input data into a plurality of blocks, condition memories 22 and 23 that output a mismatch detection result for each block, and a tabulation unit 25 that tabulates the mismatch detection results for each block. . The mismatch detection means 20 aggregates the mismatch detection results for each group and outputs them to the match search means.

本実施の形態において、検索する条件テーブルの条件値は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, condition # 0 is condition value 0000 and Prefix is 0, condition # 1 is condition value 0100 and Prefix is 4, condition # 2 is condition value 1000 and Prefix is 0, condition # 3 has a condition value of 1011 and a Prefix of 4. In this case, when Prefix is expanded, the conditions # 0 and # 2 become ***.

****の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, conditions # 0 and # 2 with a Prefix value of 0 are group # 0, and conditions # 1 and # 3 with a Prefix value of 4 are group # 1. . By performing grouping in this way, as shown in FIG. 9, the condition “***” exists only in group # 0, and “none” is present in bit [1] of the memory that detects the mismatch. The symbol can be present.

このように、Prefixの値に応じてグループ分けを行うことにより、グループ#1に関しては不一致を検出できるようになり、一致検索手段における入力データと条件の比較数を削減することができるようになる。グループ分けの方法としては、各条件の値ができるだけ同じグループにのみ存在するようにグループ分けを行えば、上述したように特定のグループに対する不一致の検出確率を高くすることができる。さらに、各条件の値が一つのグループのみ存在するようにグループ分けを行えば、より不一致の検出確率を高くすることができる。   In this way, by performing grouping according to the value of Prefix, it becomes possible to detect mismatches for group # 1, and it is possible to reduce the number of comparisons between input data and conditions in the match search means. . 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の実施の形態)
第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 condition # 0 has a condition value of 000 *, and the least significant bit is set to Don't Care. Similarly, in condition # 1, the most significant bit is set to Don't Care, in condition # 2, the least significant bit is set to Don't Care, and in condition # 3, the most significant bit is set to Don't Care.

この条件テーブルにおいて、各条件の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-bit block # 1 and the lower 2-bit block # 0, there are two addresses each storing “Yes” in both the group # 1 and the group # 0. For this reason, the probability that mismatch detection can be performed becomes low.

これに対して、図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 condition # 0 and the condition # 2, and the condition # 1 and the condition # 3 in the same Don't Care position are in the same group, respectively. explain. FIG. 13 is a configuration example of a memory when the condition table of FIG. 12 is divided into two blocks and mismatch detection is performed.

図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-bit block # 1 and the lower 2-bit block # 0, an address where “present” is stored in both the group # 1 and the group # 0. Each has one address, and the probability of detection of a mismatched group can be increased compared to the case of FIG.

このように、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 SYMBOLS 10 ... Search apparatus, 20 ... Mismatch detection means, 21 ... Delay means, 22, 23 ... Condition memory, 24 ... Data division means, 25 ... Counting means, 30 ... Match search means, 40 ... Condition memory, 50 ... Comparison part.

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.
前記条件は、Prefix値が同一であるかDon’tCareシンボルが展開された後前記条件が同一であるかDon’tCareシンボルの位置が同一であるかの少なくとも一つに基づいてグループ分けされること
を特徴とする請求項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.
前記条件は、Prefix値が同一であるかDon’tCareシンボルが展開された後前記条件が同一であるかDon’tCareシンボルの位置が同一であるかの少なくとも一つに基づいてグループ分けされること
を特徴とする請求項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.
JP2013175946A 2013-08-27 2013-08-27 Search device and search method Active JP6073761B2 (en)

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)

* Cited by examiner, † Cited by third party
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

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