[go: up one dir, main page]

JP2004187201A - Data string search node, data string search method using the same, and data string search processing device - Google Patents

Data string search node, data string search method using the same, and data string search processing device Download PDF

Info

Publication number
JP2004187201A
JP2004187201A JP2002354733A JP2002354733A JP2004187201A JP 2004187201 A JP2004187201 A JP 2004187201A JP 2002354733 A JP2002354733 A JP 2002354733A JP 2002354733 A JP2002354733 A JP 2002354733A JP 2004187201 A JP2004187201 A JP 2004187201A
Authority
JP
Japan
Prior art keywords
search
data string
node
data
tree
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.)
Pending
Application number
JP2002354733A
Other languages
Japanese (ja)
Inventor
Takao Kawada
隆夫 川田
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 JP2002354733A priority Critical patent/JP2004187201A/en
Publication of JP2004187201A publication Critical patent/JP2004187201A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

【課題】非連続なマスクへの対応が可能で、かつ、容易にハードウェア化することが可能なデータ列検索用ノード、並びに、位置不定の部分データ列を含むデータ列を検索キーとして取り扱い可能としたデータ列検索用ノード、およびこれを用いるデータ列検索方法並びにデータ列検索処理装置を提供すること。
【解決手段】検索キーとなるデータ列の部分列、または検索キーとなるデータ列上の位置情報等、検索キーとなるデータ列の部分列を特定するための情報を持ち(登録データ部12)、前記データ部分列と検索対象として与えられたデータ列との比較結果(入力データ・登録データ比較部13)によって分岐先を変更することを特徴とするデータ列検索用ノード(検索ツリー部11内)、これを用いるデータ列検索方法並びにデータ列検索処理装置。
【選択図】 図1
[PROBLEMS] To provide a data string search node that can handle discontinuous masks and that can be easily implemented as hardware, and that a data string including an unfixed partial data string can be handled as a search key. A data string search node, a data string search method using the same, and a data string search processing device.
The information storage device includes information for specifying a subsequence of a data string serving as a search key, such as a subsequence of a data string serving as a search key or positional information on the data string serving as a search key. A data string search node (in the search tree unit 11), wherein a branch destination is changed by a comparison result (input data / registered data comparison unit 13) between the data subsequence and a data string given as a search target. ), A data string search method and a data string search processing device using the same.
[Selection diagram] Fig. 1

Description

【0001】
【発明の属する技術分野】
本発明は、データ列検索用ノード,これを用いるデータ列検索方法並びにデータ列検索処理装置に関し、特に、イーサフレーム,IPパケット,HTTPテキストのヘッダ情報等に、特定のアドレス等、所定のデータ列が含まれるか否かを高速に検索可能とするするデータ列検索用ノード,これを用いるデータ列検索方法並びにデータ列検索処理装置に関する。
【0002】
【従来の技術】
IPパケット等のアドレス検索においては、ハッシュ関数による方法,CAMを用いる方法,検索ツリーを用いる方法が一般的である(非特許文献1参照)。検索ツリーによる方法は、検索キー長等に対する柔軟性,高速性,経済性の観点から用いられることが多い。検索ツリーを用いる方法において、単純な2分木探索による手法は高速検索が可能であるが、検索ツリーのエントリ追加・削除に関する手間が大きいため、PATRICIA(Practical Algorithm to Retrieve Information Code in Alphanumeric)ツリー(非特許文献2参照)ないしは類似の方法が多く使用される。
【0003】
PATRICIAツリーは、ツリーの各ノードが2つの子ノード、および検索キー上の位置情報を持つツリーで、最も子孫側のノード(リーフ)を検索結果に対応させる。例えば、IPパケットのルーティングに用いる場合、検索キーはIPアドレスで、検索結果はIPアドレスと次方路の組である。ツリーの各ノードが持つ検索キー上の位置情報は、当該ノードがIPアドレスの何ビット目に対応するかの情報となる。簡単化のためにアドレスを16ビットとした例を、図13,図14に示す。
【0004】
検索は、以下のように行う(図14)。
(1)最も先祖側のノード(ノード1)を、処理ノードとする。
(2)与えられたアドレスの、処理ノードの位置情報に対応するビットを読み出す(ノード1では2ビット目、ノード2では4ビット目)。
(3)読み出したビットが‘0’ならば子1を、‘1’ならば子2を処理ノードとする。
(4)リーフについたら(5)へ、それ以外は(2)へ進む。
(5)与えられたアドレスと、リーフに登録されたアドレスとが一致したら、方路情報を返す。一致しない場合は、該当エントリなしとする。
【0005】
例えば、“1100110000111001”は2ビット目が1、4ビット目が‘0’なので、上記の手順から登録データ2のリーフに到達するが、アドレスの全桁が一致しないので、該当なしになる。
IPアドレス等にマスクを用いた場合、上記の手順のみでは対応できないが、一旦リーフに到達した後、ツリーを遡る等の手法により対処可能である。マスクが不連続な場合、ツリーを遡り、再度探索を繰り返す手順がとられるが、この場合Radixツリーと呼ばれる(非特許文献3参照)。
【0006】
前述のPATRICIAツリーの高速化を目的としては、様々な試みがなされている。特許文献1では、検索処理を並列処理化することにより高速化を図っている。また、特許文献2,特許文献3では、検索ツリーのデータ構造を改良することにより高速化を図っている。これらの技術は、検索の高速化を目的としており、非連続マスクへの対応等、検索対象の拡張を図るものではなかった。
【0007】
【非特許文献1】
「LANスイッチング徹底解説」Rich Seifert 著、間宮あきら訳、日経BP社、2001年発行、p.78‐88)
【非特許文献2】
http://www.csse.monash.edu.au/lloyd/tildeAlgDS/Tree/PATRICIA.html
【非特許文献3】
http://www.wide.ad.jp/document/reports/pdf1996/oart5.htm
【0008】
【特許文献1】
特開2000−83054号公報
【特許文献2】
特開2000−83056号公報
【特許文献3】
特開2000−196670号公報
【0009】
【発明が解決しようとする課題】
アドレス検索において、IPアドレスのみを目的とする場合、連続なマスクに対応できれば十分であるが、OSI参照モデルのレイヤ2〜レイヤ7への対応を図る場合、不連続なマスクへの対応は必須である。従って、単純なPATRICIAツリーは不適であり、Radixツリーが用いられる。但し、Radixツリーは前述のようにツリーを遡り、再検索を行う手順を含んでいるため、検索に手間がかかり、またハードウェア化が困難であるという問題があった。
【0010】
上記に加え、レイヤ7(アプリケーションレイヤ)への適用に際しては、検索キーとなるデータ列の位置が不定となる問題がある。例えば、HTTPテキストにおいて、各HTTPヘッダの形式,名称は規定されているが、出現の有無,順番,データ長については、通常規定されない。このような、位置が不定の部分検索キーに対しては、従来のツリー型検索で取り扱うことは困難であった。
【0011】
本発明は上記事情に鑑みてなされたものであり、その目的とするところは、従来の技術における上述のような問題を解消し、不連続なマスクへの対応が可能で、かつ、容易にハードウェア化することが可能なデータ列検索用ノード,これを用いるデータ列検索方法並びにデータ列検索処理装置を提供することにある。
【0012】
また、本発明の他の目的は、位置不定の部分データ列を含むデータ列を検索キーとして取り扱い可能としたデータ列検索用ノード,これを用いるデータ列検索方法並びにデータ列検索処理装置を提供することにある。
【0013】
【課題を解決するための手段】
上記目的を達成するため、本発明に係るデータ列検索用ノードは、検索キーとなるデータ列の部分列、または検索キーとなるデータ列上の位置情報等、検索キーとなるデータ列の部分列を特定するための情報を持ち、前記データ部分列と検索対象として与えられたデータ列との比較結果によって分岐先を変更することを特徴とする。
【0014】
また、本発明に係る他のデータ列検索用ノードは、前記分岐先の1つを自ノードを含む検索ツリー上の祖先ノードとし、この祖先ノードに分岐する際には検索位置をずらすことにより、位置不定の部分データ列を含むデータ列を検索キーとして取り扱い可能としたことを特徴とする。
【0015】
また、本発明に係るデータ列検索方法は、上述のデータ列検索用ノードのいずれかを用いるデータ列検索方法であって、前記データ列検索用ノードを多段に組み合わせた検索ツリーないしはツリーの変形を用いることにより、非連続のマスクを有する検索キーおよびデータ列上の検索位置が確定していない検索キーの取り扱いを可能としたことを特徴とする。
【0016】
また、本発明に係る他のデータ列検索方法は、上述のデータ列検索用ノードのいずれかに加えて、検索対象として与えられたデータ列上の位置情報を持ち、その位置のビット値により分岐先を変更するノードを用い、これらを多段に組み合わせることにより、非連続のマスクを有する検索キーおよびデータ列上の検索位置が確定していない検索キーの取り扱いにおいて、マスク部分に複数の候補を対応付けることを可能としたことを特徴とする。
【0017】
さらに、本発明に係るデータ列検索処理装置は、上述のデータ列検索用ノードのいずれかを用いるデータ列検索処理装置であって、前記データ列検索用ノードを有する検索ツリーないしはツリーの変形を用いる検索ツリー部と、この検索ツリー部により指定された登録データを出力する登録データ部と、入力データと上記登録データ部から出力された登録データとの比較を行うデータ比較部とを有することを特徴とする。
【0018】
より具体的には、本発明においては、例えば、図1に示すようなシステム構成を採用することにより、課題を解決したものである。図1中、10は検索エンジンを示している。また、11は検索ツリー部であり、ここには、先に述べたような、後述する本発明の特徴を導き出すノード、更には、従来から用いられているノード(例えば、前記PATRICIAツリーのノード)からなる検索ツリーが用いられる。
【0019】
また、12は登録データ部であり、ここには、検索キーによる検索結果に対する登録データが格納されている。13は入力データ・登録データ比較部であり、両者を比較して、次方路等の検索結果を出力する。
なお、本発明における検索ツリーは、複雑な構成が取り得るため、登録データの追加/削除時に検索ツリーの変更点の指示を行うための、検索ツリーデータ生成部14が設けられている。
【0020】
上述のように、本発明においては、図13に示した通常のPATRICIAツリーのノードの他に、図2に示すマスク処理用ノードを用いる。
図13に示す通常のPATRICIAツリーのノードは、各ノードの情報として、2つの子ノードと検索キー上の位置情報を持つ。当該ノードが処理対象になった場合、位置情報に対応する位置のbit値を検索対象となるデータ列から読み取り、‘0’の場合は子ノード1へ、‘1’の場合は子ノード2へ分岐する。
【0021】
これに対し、図2に示す本発明で用いられるマスク処理ノードは、2つの子ノードと、検索キー上の区間を指定する情報(例えば、開始位置と終了位置)と、検索キーとして登録されたデータ列、またはその格納場所の情報を、各ノードに保持する。当該ノードが処理対象となった場合には、登録された区間で登録されたデータ列と検索対象のデータ列とを比較し、一致した場合は子ノード1へ、一致しなかった場合は子ノード2へ分岐する。
【0022】
図3に、マスクを含むデータ列の検索の場合の検索ツリーの構成例を示す。
また、図4には、マスク処理ノードを位置不定の部分検索キーの処理に用いる場合を示す。データ列の部分が一致しなかった場合には祖先ノードへ戻り、検索位置をずらして再度検索を行う。
図5は、位置不定の部分検索キーを扱う検索ツリーの構成例を示すものである(位置不定の部分検索キーの処理を行う場合には、祖先ノードへの分岐を含むため、正確に言えば「ツリー」構造ではなくなる)。
【0023】
【作用】
図3の検索ツリーに、例えば、“0110111110111001”のデータ列が加わった場合、以下のように検索が行われる。
・ツリーの最も先祖側のノード(ノード1:このノードは、通常のPATRICIAツリーのノードである)から検索を開始する。検索対象のデータ列の3bit目が‘1’なので、子ノード2側のノード2へ進む。
【0024】
・ノード2はマスク処理ノードなので、検索対象データ列の5〜9bit目である、“11111”と、ノードに登録された登録データ2の検索キーの5〜9bit目である“10010”とを比較する。
・比較の結果、一致しないので、子ノード2側へ進み、登録データ3を得る。
・検索対象のデータ列と登録データ3の検索キーのマスクされていない部分とを比較する。
・比較の結果、一致するので、検索結果として方路−Cを得る。
【0025】
以上の手順でマスク付きの検索キーの検索を行う。ノード2において、マスクされた部分が登録データ2の検索キーと一致する場合は、登録データ2へ分岐することから、マスクされた検索キーとマスクされない検索キーとがある場合、マスクされない検索キーの方が優先されることがわかる。
【0026】
図5の検索ツリーに、例えば“0110000100101001”のデータが加わった場合、以下のように検索が行われる。
・ツリーの最も先祖側のノード(ノード1:このノードは、通常のPATRICIAツリーのノードである)から検索を開始する。検索対象のデータ列の3bit目が‘1’なので、子ノード2側のノード2へ進む。
【0027】
・ノード2はマスク処理ノードなので、検索対象データ列の5〜9bit目である、“00010”と、ノードに登録された登録データ2の検索キーの5〜9bit目である、“10010”とを比較する。
・一致しないので、検索位置を所定のbit数(この例では1bit。多くの場合1byte)だけずらして、祖先ノード側(この例では、自ノードであるノード2)へ進む。
【0028】
・検索対象データ列の6〜10bit目である“00100”と、ノードに登録された登録データ2の検索キーの5〜9bit目である、“10010”とを比較する。一致しないので、さらに1bitだけずらして自ノードへ進む。
・・・
・検索対象データ列の8〜12bit目である“10010”と、ノードに登録された登録データ2の検索キーの5〜9bit目である、“10010”とを比較する。一致するので、子ノード側へ進み、登録データ2を得る。
【0029】
・検索対象のデータ列と、登録データ2の検索キーの、位置不定部分検索キーの前まで(1〜4bit目)とを比較する。また、位置不定部分検索キー以降を位置ずれを考慮して比較する(13bit目以降と10bit目以降)。
・一致するので、検索結果として方路−Bを得る。
以上のように、位置不定の部分検索キーを含んだ検索が行われる。また、検索位置をずらして行き、データ列の終端に達した場合は、検索失敗として検索処理を終了する。
【0030】
【発明の実施の形態】
以下に本発明を用いた場合の検索ツリーの構成および動作例を示す。なお、下記の例では、検索結果として方路データを返しているが、実際の使用においてはこの限りではなく、用途に応じたデータを返せばよい。
【0031】
〔実施例1〕:マスク部分に複数の検索キーが対応する場合の例
マスク部分に、複数の検索キーが対応する場合の検索ツリーの構成を、図6に示す。
ここに、例えば、“0110111110111001”のデータ列が加わった場合、6bit目が‘1’なので、ノード1からノード3へ進む。ノード3では、5〜9bit目が登録データ3の検索キーと一致しないので、登録データ3が検索ツリーによる処理の結果となる。与えられた文字列と、登録データ3の検索ツリーとを、マスクを考慮して比較すると一致するので、検索結果として、方路−Cを返す。
この例は、例えば、複数のIPアドレスと、それらに一致しなかった場合のデフォルトの方路を設定するような場合に相当する。
【0032】
〔実施例2〕:位置不定の部分検索キーを複数種類持つ場合の例
位置不定の部分検索キーを複数持つ場合の検索ツリーの構成を、図7に示す。ここに、例えば、“01100110100111001”のデータ列が加わった場合、まず、
・ノード1で6bit目をみて、‘1’なのでノード3へ進む
・5〜9bit目を登録データ2の検索キーと比較し、不一致なので、検索位置を(この例では)1bitずらしてノード1へ戻る
・7bit目が‘1’なのでノード3へ進む
【0033】
・与えられたデータ列の6〜10bit目と、登録データ2の検索キーの5〜9bit目が一致するので、登録データ2が検索ツリーによる処理の結果となる。
・与えられたデータの1〜5bit目と登録データ2の検索キーの1〜5bit目、および11〜17bit目と10〜16bit目とを比較し、一致するので方路−Bを検索結果として返す。
となる。
この例は、例えば、複数のHTTPヘッダを検索するような場合に相当するものである。
【0034】
〔実施例3〕:非連続のマスクの場合の例
非連続のマスクの場合の検索ツリーの構成を、図8に示す。
ノード3では、与えられたデータ列の5〜9bit目が登録データ1の検索キーと一致しない場合に処理が行われる。ノード3のように、検索キーのマスク部分がマスクされない他の検索キーが存在しない場合、マスク処理ノードには検索キーは対応させず、常に子ノード2側に分岐させる。また、検索処理上ノード3は意味を持たないので、省略することも可能である。
【0035】
このツリーに、例えば、“0110110100111101”のデータ列が加わった場合、
・ノード1で5〜9bit目を見て、一致するのでノード2へ進む。
・ノード2で12〜14bit目を見て、一致しないので、登録データ2が検索ツリーによる処理の結果となる。
・与えられたデータと登録データ2の検索キーを比較し、一致するので方路−Bを検索結果として返す。
この例は、例えば、IPヘッダにおいて発アドレスと着ポート番号だけを指定し、あとの部分にマスクをかけるような場合に相当する。
【0036】
〔実施例4〕:マスクが重なる場合の例
マスクが重なる場合の検索ツリーの構成を、図9に示す。本実施例では、登録データ2と登録データ3の検索キーの5〜9bit目のマスクが重なる。
このツリーに、例えば、“0110110100111101”のデータ列が加わった場合、
・ノード1で5〜9bit目を見て、一致しないのでノード3へ進む。
【0037】
・ノード3で10〜11bit目を見て、一致するので登録データ2が検索ツリーによる処理の結果となる。
・与えられたデータと登録データ2の検索キーとを比較し、一致するので方路−Bを検索結果として返す。
この例は、例えば、全桁を指定したIPアドレス、一部の桁を指定したIPアドレス、どちらにも一致しない場合のデフォルト値、を扱うような場合に相当するものである。
【0038】
〔実施例5〕:非連続のマスクと位置不定の部分検索キーを持つ場合の例
非連続のマスクと位置不定の部分検索キーを持つ場合の検索ツリーの構成を、図10に示す。
本実施例は、図9の例と図8の例とを組み合わせたもので、特定のIPアドレス間のHTTP通信でHTTPヘッダにAuthorizationヘッダがついているパケットをフィルタリングするような場合に相当する。動作は、実施例4と実施例3の組み合わせになる。なお、図10はノード2およびノード3の、子ノード2側のノードを共通化し、メモリの節約を図った場合を示しており、ノード5と同じ情報を持つ別のノードを、ノード2の子ノード2としても同様に動作する。
【0039】
〔実施例6〕:マスクが検索キー全体を覆う場合の例
マスクが検索キー全体を覆う場合の検索ツリーの構成を図11に示す。登録データ3のマスクは検索キーの全体を覆うため、他に該当する登録データがない場合は、常に検索結果として方路−Cを得る。
このツリーに、例えば、“0110101111111111”のデータ列が加わった場合、
・ノード1で1〜8bit目を見て、一致するのでノード2へ進む。
・ノード2で9〜16bit目を見て、一致しないので登録データ3が検索ツリーによる処理の結果となる。
【0040】
・与えられたデータと登録データ3の検索キーとを比較し、一致するので方路−Bを検索結果として返す(この場合、マスクが全桁に及んでいるため、必ず一致する)。
となる。
この例は、例えば、発着のIPアドレス、着側のみのIPアドレス、どちらにも一致しない場合のデフォルト値、を扱うような場合に相当する。
本実施例のような場合、マスク処理ノードでのデータ列比較が検索キーの全長に及ぶため、検索ツリーでの処理後の全桁の比較は省略することが可能である。
【0041】
〔実施例7〕:マスクの優先順位を考慮する場合の例
図中、上部の登録データ1〜5に基づくツリーの例を、図12(a),(b)に示す。
図12(a)に示す検索ツリー1は、検索キーの1〜9bit目が検索対象データ列と一致するか否かを、10〜16bit目に優先して判定する。同図(b)に示す検索ツリー2は、その逆となる。
【0042】
例えば、“0110110010101001”のデータ列は、登録データ1でも登録データ3でも一致する。このデータ列が図12のツリーに加わった場合、(a),(b)双方のツリーで、ノード1→ノード2→ノード6→ノード7と動作するが、得られる結果は、検索ツリー1では登録データ1、検索ツリー2では登録データ3となる。このように、ノードの並べ方によりマスクの優先順位を設定することが可能である。
この例は、例えば、発側および着側IPアドレスを登録し、どちらかを優先する場合などに相当するものである。
【0043】
なお、上記各実施例はいずれも本発明の一例を示すものであり、本発明はこれらに限定されるべきものではなく、本発明の要旨を逸脱しない範囲内で任意の変更・改良を行ってもよいことはいうまでもない。
【0044】
【発明の効果】
以上、詳細に説明したように、本発明によれば、非連続なマスクを有し、位置の不定な検索キーを含むデータ列の検索を高速に行うことが可能となるという顕著な効果を奏するものである。
【0045】
また、本発明によれば、位置不定の部分データ列を含むデータ列を検索キーとして取り扱い可能となるという顕著な効果をも奏するものである。
【図面の簡単な説明】
【図1】本発明に係るデータ列検索システムの概要を説明する図である。
【図2】マスク処理用ノードを説明する図である。
【図3】マスクを含むデータ列の検索を行う場合の検索ツリーの構成例を説明する図である。
【図4】マスク処理のードを位置不定の部分検索キーの処理に用いる場合を説明する図である。
【図5】位置不定の部分検索キーを扱う検索ツリーの構成例を説明する図である。
【図6】マスク部分に複数の検索キーが対応する場合の例(実施例1)を説明する図である。
【図7】位置不定の部分検索キーを複数種類持つ場合の例(実施例2)を説明する図である。
【図8】非連続のマスクの場合の例(実施例3)を説明する図である。
【図9】マスクが重なる場合の例(実施例4)を説明する図である。
【図10】非連続のマスクと位置不定の部分検索キーを持つ場合の例(実施例5)を説明する図である。
【図11】マスクが検索キー全体を覆う場合の例(実施例6)を説明する図である。
【図12】マスクの優先順位を考慮する場合の例(実施例7)を説明する図である。
【図13】通常のPATRICIAツリーのノードを説明する図である。
【図14】PATRICIAツリーの例を説明する図である。
【符号の説明】
10 検索エンジン
11 検索ツリー部
12 登録データ部
13 入力データ・登録データ比較部
14 検索ツリーデータ生成部
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a data string search node, a data string search method and a data string search processing device using the same, and more particularly, to a predetermined data string such as a specific address in an Ethernet frame, an IP packet, HTTP text header information or the like. The present invention relates to a data string search node enabling a high-speed search for whether or not the data string is included, a data string search method using the same, and a data string search processing device.
[0002]
[Prior art]
In searching for an address of an IP packet or the like, a method using a hash function, a method using a CAM, and a method using a search tree are generally used (see Non-Patent Document 1). The search tree method is often used from the viewpoints of flexibility for the search key length and the like, high speed, and economy. In a method using a search tree, a simple binary tree search method can perform a high-speed search, but requires a great deal of time to add / delete entries in the search tree. Non-Patent Document 2) or similar methods are often used.
[0003]
The PATRICIA tree is a tree in which each node of the tree has two child nodes and location information on a search key, and the node (leaf) closest to the descendant corresponds to the search result. For example, when used for routing an IP packet, a search key is an IP address, and a search result is a set of an IP address and a next route. The position information on the search key of each node in the tree is information on the bit of the IP address corresponding to the node. FIGS. 13 and 14 show an example in which the address is 16 bits for simplification.
[0004]
The search is performed as follows (FIG. 14).
(1) The node on the ancestor side (node 1) is set as a processing node.
(2) The bit corresponding to the position information of the processing node of the given address is read (the second bit in the node 1 and the fourth bit in the node 2).
(3) If the read bit is “0”, the child 1 is set as a processing node, and if the read bit is “1”, the child 2 is set as a processing node.
(4) If the leaf is reached, go to (5), otherwise go to (2).
(5) If the given address matches the address registered in the leaf, return the route information. If they do not match, there is no corresponding entry.
[0005]
For example, “1100110000111001” reaches the leaf of the registered data 2 from the above procedure because the second bit is 1 and the fourth bit is “0”, but is not applicable because all digits of the address do not match.
When a mask is used for an IP address or the like, it is not possible to cope with the above procedure alone, but it is possible to cope with a method of once arriving at the leaf and going back up the tree. If the masks are discontinuous, a procedure is taken to go back up the tree and repeat the search, and in this case, it is called a Radix tree (see Non-Patent Document 3).
[0006]
Various attempts have been made to speed up the above-mentioned PATRICIA tree. In Patent Literature 1, the search processing is speeded up by parallel processing. In Patent Documents 2 and 3, the speed is increased by improving the data structure of a search tree. These techniques are aimed at speeding up the search, and do not attempt to expand the search target, such as handling discontinuous masks.
[0007]
[Non-patent document 1]
"Thorough Explanation of LAN Switching," by Rich Seifert, translated by Akira Mamiya, Nikkei BP, published in 2001, p. 78-88)
[Non-patent document 2]
http: // www. csse. monash. edu. au / ~ lloyd / tildeAlgDS / Tree / PATRICIA. html
[Non-Patent Document 3]
http: // www. wide. ad. jp / document / reports / pdf1996 / art5. htm
[0008]
[Patent Document 1]
Japanese Patent Application Laid-Open No. 2000-83054 [Patent Document 2]
JP 2000-83056 A [Patent Document 3]
JP 2000-196670 A
[Problems to be solved by the invention]
In address search, if only an IP address is intended, it is sufficient to be able to deal with continuous masks. However, in order to deal with layers 2 to 7 of the OSI reference model, it is essential to deal with discontinuous masks. is there. Therefore, a simple PATRICIA tree is not suitable, and a Radix tree is used. However, since the Radix tree includes the procedure of retracing the tree and re-searching as described above, there is a problem that the search is troublesome and it is difficult to implement hardware.
[0010]
In addition to the above, when applied to layer 7 (application layer), there is a problem that the position of a data string serving as a search key is undefined. For example, in the HTTP text, the format and name of each HTTP header are specified, but the presence / absence, order, and data length are not normally specified. It is difficult to handle such a partial search key whose position is unfixed by the conventional tree-type search.
[0011]
The present invention has been made in view of the above circumstances, and an object of the present invention is to solve the above-described problems in the conventional technology, to be able to cope with discontinuous masks, and to easily implement a hard mask. It is an object of the present invention to provide a data string search node that can be implemented as hardware, a data string search method using the same, and a data string search processing device.
[0012]
Further, another object of the present invention is to provide a data string search node capable of handling a data string including an indeterminate partial data string as a search key, a data string search method using the same, and a data string search processing device. It is in.
[0013]
[Means for Solving the Problems]
In order to achieve the above object, a data string search node according to the present invention includes a substring of a data string serving as a search key, or a substring of a data string serving as a search key, such as position information on the data string serving as a search key. And a branch destination is changed according to a result of comparison between the data subsequence and a data sequence given as a search target.
[0014]
Further, the other data string search node according to the present invention sets one of the branch destinations as an ancestor node on a search tree including its own node, and shifts a search position when branching to this ancestor node. A data string including a partial data string whose position is not fixed can be handled as a search key.
[0015]
Further, a data string search method according to the present invention is a data string search method using any one of the above-described data string search nodes, wherein the search tree or the tree is modified by combining the data string search nodes in multiple stages. By using the search key, it is possible to handle a search key having a discontinuous mask and a search key whose search position on the data string is not determined.
[0016]
Further, another data string search method according to the present invention has, in addition to any of the above-described data string search nodes, position information on a data string given as a search target and branches based on a bit value of the position. By using a node whose destination is changed and combining them in multiple stages, in handling a search key having a discontinuous mask and a search key whose search position on a data string is not fixed, a plurality of candidates are associated with a mask portion. It is characterized by being able to do.
[0017]
Further, a data string search processing device according to the present invention is a data string search processing device using any of the above-described data string search nodes, and uses a search tree or a modification of the tree having the data string search node. A search tree section, a registration data section that outputs registration data specified by the search tree section, and a data comparison section that compares input data with registration data output from the registration data section. And
[0018]
More specifically, the present invention has solved the problem by adopting, for example, a system configuration as shown in FIG. In FIG. 1, reference numeral 10 denotes a search engine. Reference numeral 11 denotes a search tree unit, which includes a node for deriving a feature of the present invention described later, and a conventionally used node (for example, a node of the PATRICIA tree). Is used.
[0019]
Reference numeral 12 denotes a registration data section, in which registration data for a search result by a search key is stored. Reference numeral 13 denotes an input data / registered data comparison unit, which compares the two and outputs a search result such as a next route.
Since the search tree in the present invention can have a complicated configuration, a search tree data generation unit 14 is provided to indicate a change in the search tree when adding / deleting registration data.
[0020]
As described above, in the present invention, the mask processing node shown in FIG. 2 is used in addition to the normal PATRICIA tree node shown in FIG.
The node of the normal PATRICIA tree shown in FIG. 13 has two child nodes and position information on a search key as information of each node. When the node becomes a processing target, the bit value at the position corresponding to the position information is read from the data string to be searched, and if "0", the child node 1; if "1", the child node 2 Branch.
[0021]
On the other hand, the mask processing node used in the present invention shown in FIG. 2 has two child nodes, information (for example, a start position and an end position) specifying a section on a search key, and is registered as a search key. A data string or information on its storage location is stored in each node. If the node is to be processed, the data string registered in the registered section is compared with the data string to be searched, and if they match, the child node 1 is used; if not, the child node is used. Branch to 2.
[0022]
FIG. 3 shows a configuration example of a search tree in the case of searching for a data string including a mask.
FIG. 4 shows a case where a mask processing node is used for processing a partial search key whose position is unfixed. If the data string does not match, the process returns to the ancestor node, and the search position is shifted to perform the search again.
FIG. 5 shows an example of the configuration of a search tree that handles an indeterminate partial search key. (When processing an indeterminate partial search key, it includes a branch to an ancestor node. It is no longer a "tree" structure).
[0023]
[Action]
When, for example, a data string of “0110111110111001” is added to the search tree of FIG. 3, the search is performed as follows.
Start the search from the node at the most ancestral side of the tree (node 1: this node is a node of a regular PATRICIA tree). Since the third bit of the data string to be searched is “1”, the process proceeds to the node 2 on the child node 2 side.
[0024]
Since node 2 is a mask processing node, “11111”, which is the fifth to ninth bits of the data string to be searched, is compared with “10010”, which is the fifth to ninth bits of the search key of the registered data 2 registered in the node. I do.
-As a result of the comparison, since they do not match, the procedure proceeds to the child node 2 side, and the registration data 3 is obtained.
Compare the search target data string with the unmasked portion of the search key of the registered data 3.
-As a result of the comparison, they match, so the route-C is obtained as a search result.
[0025]
The search key with the mask is searched by the above procedure. In the node 2, if the masked portion matches the search key of the registered data 2, the process branches to the registered data 2. Therefore, if there is a masked search key and a non-masked search key, the unmasked search key It can be seen that priority is given to
[0026]
When data of, for example, “01100000100101001” is added to the search tree of FIG. 5, the search is performed as follows.
Start the search from the node at the most ancestral side of the tree (node 1: this node is a node of a regular PATRICIA tree). Since the third bit of the data string to be searched is “1”, the process proceeds to the node 2 on the child node 2 side.
[0027]
Since node 2 is a mask processing node, “00010”, which is the fifth to ninth bits of the data string to be searched, and “10010”, which is the fifth to ninth bits of the search key of the registered data 2 registered in the node, Compare.
Since there is no match, the search position is shifted by a predetermined number of bits (in this example, 1 bit; in most cases, 1 byte), and the process proceeds to the ancestor node side (in this example, node 2 which is the own node).
[0028]
Compare "00100" which is the sixth to tenth bits of the search target data string with "10010" which is the fifth to ninth bits of the search key of the registered data 2 registered in the node. Since they do not match, the process proceeds to the own node with a further shift by one bit.
...
Compare “10010”, which is the 8th to 12th bits of the search target data string, and “10010”, which is the 5th to 9th bits of the search key of the registered data 2 registered in the node. Since they match, the process proceeds to the child node side, and registration data 2 is obtained.
[0029]
The data string to be searched is compared with the search key of the registered data 2 up to (between the first and fourth bits) up to the position-unfixed part search key. In addition, the position after the indeterminate position search key is compared in consideration of the position shift (13th bit and after and 10th bit and after).
-Since they match, route-B is obtained as a search result.
As described above, the search including the partial search key whose position is unfixed is performed. If the search position is shifted and the end of the data string is reached, the search is terminated as a search failure.
[0030]
BEST MODE FOR CARRYING OUT THE INVENTION
The configuration and operation example of the search tree when the present invention is used will be described below. In the following example, route data is returned as a search result. However, this is not limited to actual use, and data according to the application may be returned.
[0031]
[Example 1]: Example of a case where a plurality of search keys correspond to a mask portion A configuration of a search tree when a plurality of search keys correspond to a mask portion is shown in FIG.
Here, for example, when a data string of “0110111110111001” is added, the sixth bit is “1”, so that the process proceeds from node 1 to node 3. In the node 3, since the fifth to ninth bits do not match the search key of the registered data 3, the registered data 3 is the result of the processing by the search tree. When the given character string and the search tree of the registered data 3 are compared in consideration of the mask, they match, so that the route-C is returned as the search result.
This example corresponds to, for example, a case where a plurality of IP addresses and a default route when they do not match are set.
[0032]
[Second Embodiment]: Example of Having a Plurality of Unfixed Partial Search Keys FIG. 7 shows a configuration of a search tree having a plurality of unfixed partial search keys. Here, for example, when a data string of “011001101001111001” is added, first,
-After looking at the 6th bit at node 1, go to node 3 because it is "1".-Compare the 5th to 9th bits with the search key of registration data 2, and because they do not match, shift the search position by 1 bit (in this example) to node 1 Return ・ Because the 7th bit is '1', proceed to node 3
Since the 6th to 10th bits of the given data string match the 5th to 9th bits of the search key of the registered data 2, the registered data 2 is the result of processing by the search tree.
-The first to fifth bits of the given data are compared with the first to fifth bits of the search key of the registered data 2, and the 11th and 17th bits and the 10th to 16th bits, and since they match, the route-B is returned as the search result. .
It becomes.
This example corresponds to a case where a plurality of HTTP headers are searched, for example.
[0034]
[Embodiment 3]: Example of non-continuous mask FIG. 8 shows the configuration of a search tree in the case of non-continuous mask.
In the node 3, processing is performed when the fifth to ninth bits of the given data string do not match the search key of the registered data 1. When there is no other search key whose mask portion of the search key is not masked as in the node 3, the search key is not made to correspond to the mask processing node and the branch is always made to the child node 2 side. Further, since the node 3 has no meaning in the search processing, it can be omitted.
[0035]
For example, when a data string of “0110110100111101” is added to this tree,
-Looking at the fifth to ninth bits at the node 1 and matching, proceed to the node 2.
When the node 2 looks at the 12th to 14th bits and does not match, the registered data 2 is the result of processing by the search tree.
Compare the given data with the search key of the registered data 2 and return the route-B as the search result because they match.
This example corresponds to a case in which, for example, only the originating address and the destination port number are specified in the IP header, and the subsequent part is masked.
[0036]
[Embodiment 4]: Example when masks overlap FIG. 9 shows the configuration of a search tree when masks overlap. In the present embodiment, the masks of the fifth to ninth bits of the search keys of the registration data 2 and the registration data 3 overlap.
For example, when a data string of “0110110100111101” is added to this tree,
-Looking at the fifth to ninth bits at the node 1, they do not match and proceed to the node 3.
[0037]
Look at the 10th to 11th bits at the node 3 and match, so the registered data 2 is the result of processing by the search tree.
Compare the given data with the search key of the registered data 2 and return the route-B as the search result because they match.
This example corresponds to a case in which, for example, an IP address in which all digits are specified, an IP address in which some digits are specified, and a default value in a case where none of them match.
[0038]
[Embodiment 5]: Example in the case of having a discontinuous mask and an indeterminate partial search key The configuration of a search tree in the case of having a discontinuous mask and an indeterminate partial search key is shown in FIG.
This embodiment is a combination of the example of FIG. 9 and the example of FIG. 8, and corresponds to a case where a packet having an Authorization header added to an HTTP header is filtered in HTTP communication between specific IP addresses. The operation is a combination of the fourth and third embodiments. FIG. 10 shows a case where the nodes on the child node 2 side of the node 2 and the node 3 are shared to save memory. Another node having the same information as the node 5 is replaced by a child of the node 2. The node 2 operates similarly.
[0039]
[Embodiment 6]: Example when mask covers entire search key FIG. 11 shows a configuration of a search tree when a mask covers the entire search key. Since the mask of the registration data 3 covers the entire search key, if there is no other corresponding registration data, the route-C is always obtained as a search result.
For example, when a data string of “0110101111111111” is added to this tree,
The node 1 looks at the first to eighth bits and matches, so it proceeds to the node 2.
When looking at the 9th to 16th bits at the node 2, they do not match, so the registered data 3 is the result of processing by the search tree.
[0040]
The given data is compared with the search key of the registered data 3 and the route-B is returned as a search result because they match (in this case, the match is always made because the mask covers all digits).
It becomes.
This example corresponds to a case in which, for example, an IP address of a call originating and terminating, an IP address of only a terminating side, and a default value when both do not match.
In the case of this embodiment, since the data string comparison at the mask processing node extends over the entire length of the search key, the comparison of all digits after processing in the search tree can be omitted.
[0041]
[Embodiment 7]: Example in Consideration of Mask Priority In the figure, an example of a tree based on registered data 1 to 5 at the top is shown in FIGS. 12 (a) and 12 (b).
The search tree 1 illustrated in FIG. 12A determines whether the first to ninth bits of the search key match the search target data string, prioritizing the 10th to 16th bits. The search tree 2 shown in FIG.
[0042]
For example, the data string of “01101100101001001” matches both the registered data 1 and the registered data 3. When this data string is added to the tree of FIG. 12, in both of the trees (a) and (b), the operation is performed in the order of node 1 → node 2 → node 6 → node 7. The registered data 1 is the registered data 3 in the search tree 2. As described above, it is possible to set the priority of the mask depending on the arrangement of the nodes.
This example corresponds to a case where, for example, the calling side and called side IP addresses are registered, and one of them is given priority.
[0043]
It should be noted that each of the above embodiments is merely an example of the present invention, and the present invention should not be limited thereto, and may be arbitrarily changed and improved without departing from the gist of the present invention. Needless to say, it is good.
[0044]
【The invention's effect】
As described above in detail, according to the present invention, a remarkable effect that it is possible to perform a high-speed search for a data string including a search key having a non-continuous mask and an unfixed position can be achieved. Things.
[0045]
Further, according to the present invention, a remarkable effect that a data string including a partial data string whose position is unfixed can be handled as a search key is also exerted.
[Brief description of the drawings]
FIG. 1 is a diagram illustrating an outline of a data string search system according to the present invention.
FIG. 2 is a diagram illustrating a mask processing node;
FIG. 3 is a diagram illustrating a configuration example of a search tree when a search for a data string including a mask is performed.
FIG. 4 is a diagram illustrating a case where a mask processing mode is used for processing a partial search key whose position is unfixed.
FIG. 5 is a diagram illustrating a configuration example of a search tree that handles a partial search key whose position is unfixed.
FIG. 6 is a diagram illustrating an example (first embodiment) in which a plurality of search keys correspond to a mask portion.
FIG. 7 is a diagram illustrating an example (second embodiment) in which a plurality of types of partial search keys having undetermined positions are provided.
FIG. 8 is a diagram for explaining an example (Example 3) in the case of a discontinuous mask.
FIG. 9 is a diagram illustrating an example (Example 4) where masks overlap.
FIG. 10 is a diagram illustrating an example (embodiment 5) in which a discontinuous mask and an indeterminate position partial search key are provided.
FIG. 11 is a diagram illustrating an example (sixth embodiment) in which a mask covers the entire search key.
FIG. 12 is a diagram illustrating an example (Embodiment 7) in which the priority order of masks is taken into account.
FIG. 13 is a diagram illustrating nodes of a normal PATRICIA tree.
FIG. 14 is a diagram illustrating an example of a PATRICIA tree.
[Explanation of symbols]
Reference Signs List 10 search engine 11 search tree section 12 registration data section 13 input data / registration data comparison section 14 search tree data generation section

Claims (5)

検索キーとなるデータ列の部分列、または検索キーとなるデータ列上の位置情報等、検索キーとなるデータ列の部分列を特定するための情報を持ち、前記データ部分列と検索対象として与えられたデータ列との比較結果によって分岐先を変更することを特徴とするデータ列検索用ノード。It has information for specifying a subsequence of a data string serving as a search key, such as a subsequence of a data string serving as a search key or position information on the data string serving as a search key, and is provided as the data subsequence and a search target. A data string search node wherein a branch destination is changed according to a result of comparison with a given data string. 前記分岐先の1つを自ノードを含む検索ツリー上の祖先ノードとし、この祖先ノードに分岐する際には検索位置をずらすことにより、位置不定の部分データ列を含むデータ列を検索キーとして取り扱い可能としたことを特徴とするデータ列検索用ノード。One of the branch destinations is an ancestor node on the search tree including its own node, and when branching to this ancestor node, the search position is shifted so that a data string including an unfixed partial data string is used as a search key. A data string search node characterized by being made possible. 請求項1または2に記載のデータ列検索用ノードを用いるデータ列検索方法であって、
前記データ列検索用ノードを多段に組み合わせた検索ツリーないしはツリーの変形を用いることにより、非連続のマスクを有する検索キーおよびデータ列上の検索位置が確定していない検索キーの取り扱いを可能としたことを特徴とするデータ列検索方法。
A data string search method using the data string search node according to claim 1 or 2,
By using a search tree or a modification of the tree in which the data string search nodes are combined in multiple stages, it is possible to handle a search key having a discontinuous mask and a search key whose search position on the data string is not fixed. A data string search method characterized in that:
請求項1または2に記載のデータ列検索用ノードに加えて、検索対象として与えられたデータ列上の位置情報を持ち、その位置のビット値により分岐先を変更するノードを用い、
これらを多段に組み合わせることにより、非連続のマスクを有する検索キーおよびデータ列上の検索位置が確定していない検索キーの取り扱いにおいて、マスク部分に複数の候補を対応付けることを可能としたことを特徴とするデータ列検索方法。
In addition to the data string search node according to claim 1 or 2, a node having position information on a data string given as a search target and changing a branch destination according to a bit value of the position is used.
By combining these in multiple stages, it is possible to associate a plurality of candidates with a mask portion when handling a search key having a discontinuous mask and a search key whose search position on the data string is not fixed. Data string search method.
請求項1または2に記載のデータ列検索用ノードを用いるデータ列検索処理装置であって、
前記データ列検索用ノードを有する検索ツリーないしはツリーの変形を用いる検索ツリー部と、
この検索ツリー部により指定された登録データを出力する登録データ部と、
入力データと上記登録データ部から出力された登録データとの比較を行うデータ比較部と
を有することを特徴とするデータ列検索処理装置。
A data string search processing device using the data string search node according to claim 1 or 2,
A search tree having the data string search node or a search tree part using a modification of the tree;
A registration data section for outputting registration data specified by the search tree section;
A data string search processing device comprising: a data comparison unit that compares input data with registration data output from the registration data unit.
JP2002354733A 2002-12-06 2002-12-06 Data string search node, data string search method using the same, and data string search processing device Pending JP2004187201A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002354733A JP2004187201A (en) 2002-12-06 2002-12-06 Data string search node, data string search method using the same, and data string search processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002354733A JP2004187201A (en) 2002-12-06 2002-12-06 Data string search node, data string search method using the same, and data string search processing device

Publications (1)

Publication Number Publication Date
JP2004187201A true JP2004187201A (en) 2004-07-02

Family

ID=32755634

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002354733A Pending JP2004187201A (en) 2002-12-06 2002-12-06 Data string search node, data string search method using the same, and data string search processing device

Country Status (1)

Country Link
JP (1) JP2004187201A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006087832A1 (en) * 2005-02-18 2006-08-24 Duaxes Corporation Data processing device
WO2009066340A1 (en) * 2007-11-19 2009-05-28 Duaxes Corporation Determining device and determining method
US7865474B2 (en) 2005-05-20 2011-01-04 Duaxes Corporation Data processing system
US8073855B2 (en) 2005-03-28 2011-12-06 Duaxes Corporation Communication control device and communication control system
US8336092B2 (en) 2005-02-18 2012-12-18 Duaxes Corporation Communication control device and communication control system

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006087832A1 (en) * 2005-02-18 2006-08-24 Duaxes Corporation Data processing device
CN101147381B (en) * 2005-02-18 2011-07-27 Duaxes株式会社 Data processing device
US8336092B2 (en) 2005-02-18 2012-12-18 Duaxes Corporation Communication control device and communication control system
US8073855B2 (en) 2005-03-28 2011-12-06 Duaxes Corporation Communication control device and communication control system
US7865474B2 (en) 2005-05-20 2011-01-04 Duaxes Corporation Data processing system
WO2009066340A1 (en) * 2007-11-19 2009-05-28 Duaxes Corporation Determining device and determining method
US8019776B2 (en) 2007-11-19 2011-09-13 Duaxes Corporation Determining device and determining method for determining processing to be performed based on acquired data

Similar Documents

Publication Publication Date Title
CN100581129C (en) packet transfer device
US7237058B2 (en) Input data selection for content addressable memory
Liu Routing table compaction in ternary CAM
KR102727964B1 (en) High-speed flexible packet classification technique using network processors
US6985483B2 (en) Methods and systems for fast packet forwarding
Le et al. A memory-efficient and modular approach for large-scale string pattern matching
US20080034427A1 (en) Fast and scalable process for regular expression search
CN109474641B (en) Reconfigurable switch forwarding engine resolver capable of destroying hardware trojans
Iyer et al. ClassiPl: an architecture for fast and flexible packet classification
JP3881663B2 (en) Packet classification apparatus and method using field level tree
CN107431660B (en) Search device, search method, and recording medium
WO2015125801A1 (en) Network control method, network system, device, and program
Bremler-Barr et al. CompactDFA: Scalable pattern matching using longest prefix match solutions
US7624226B1 (en) Network search engine (NSE) and method for performing interval location using prefix matching
Bremler-Barr et al. CompactDFA: Generic state machine compression for scalable pattern matching
CN102427428A (en) Stream identifying method and device based on multi-domain longest match
Chang et al. Range-enhanced packet classification design on FPGA
JP2004187201A (en) Data string search node, data string search method using the same, and data string search processing device
Sun et al. An on-chip IP address lookup algorithm
Fide et al. A survey of string matching approaches in hardware
Erdem et al. Hierarchical hybrid search structure for high performance packet classification
US10205658B1 (en) Reducing size of policy databases using bidirectional rules
Chang Efficient multidimensional packet classification with fast updates
WO2022097725A1 (en) Information processing device, information processing method, and computer program
Chiu et al. The design and implementation of a latency-aware packet classification for OpenFlow protocol based on FPGA

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050120

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060620

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20070403