WO2020022374A1 - Packet search device, packet search method, and packet search program - Google Patents

Packet search device, packet search method, and packet search program Download PDF

Info

Publication number
WO2020022374A1
WO2020022374A1 PCT/JP2019/028986 JP2019028986W WO2020022374A1 WO 2020022374 A1 WO2020022374 A1 WO 2020022374A1 JP 2019028986 W JP2019028986 W JP 2019028986W WO 2020022374 A1 WO2020022374 A1 WO 2020022374A1
Authority
WO
WIPO (PCT)
Prior art keywords
bit position
binary tree
hash table
packet search
hash
Prior art date
Application number
PCT/JP2019/028986
Other languages
French (fr)
Japanese (ja)
Inventor
斉 金子
雅幸 西木
内田 博志
Original Assignee
日本電信電話株式会社
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 日本電信電話株式会社 filed Critical 日本電信電話株式会社
Publication of WO2020022374A1 publication Critical patent/WO2020022374A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • H04L45/7453Address table lookup; Address filtering using hashing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • H04L45/74591Address table lookup; Address filtering using content-addressable memories [CAM]

Abstract

This packet search device (10) comprises a binary tree creation unit (11), a bit position determination unit (12), and a hash table creation unit (13). The binary tree creation unit (11) creates a binary tree having a predetermined branch. The bit position determination unit (12) determines a start bit position and an end bit position for hash table formation for a part of the created binary tree. The hash table creation unit (13) creates a hash table of a part of the binary tree, for a range from the determined start bit position to the end bit position.

Description

パケット検索装置、パケット検索方法、及びパケット検索プログラムPacket search device, packet search method, and packet search program
 本発明は、パケット検索装置、パケット検索方法、及びパケット検索プログラムに関する。 << The present invention relates to a packet search device, a packet search method, and a packet search program.
 従来、パケットの検索技術として、主にハードウェアを用いたTCAM(Ternary Content Addressable Memory)検索と、主にソフトウェア処理を用いた二分木法やハッシュ(Hash)法による検索がある。これらの検索技術のうち、ハッシュ法は、通常の変数値取得処理と同様の動作であり、比較処理を行わないため、一般的には二分木法よりも高速である。しかしながら、ハッシュ法の場合、全てのルール(rule)についてマッチフィールド(Match Field)が固定されなければならい(ANY値等が許容されない)ことや、ハッシュ衝突の問題があることから、二分木法が用いられることが多い。 Conventionally, as a packet search technique, there are a TCAM (Ternary Content Addressable Memory) search mainly using hardware, and a search based on a binary tree method or a hash (Hash) method mainly using software processing. Among these search techniques, the hash method has the same operation as the normal variable value acquisition processing and does not perform the comparison processing. Therefore, the hash method is generally faster than the binary tree method. However, in the case of the hash method, since the match field (Match @ Field) must be fixed for all rules (any value is not allowed) and there is a problem of hash collision, the binary tree method is used. Often used.
 例えば、非特許文献1の第31頁には、ハッシュ方式と二分木方式との長所と短所が比較されているが、機能拡張性の項目において、ハッシュ方式はLPM(Longest Prefix Match)検索ができないと記載されている。すなわち、ハッシュ方式では、全てのルール間で、検索対象のフィールドが同じでなければならないとう、厳しい適用条件が課される。 For example, on page 31 of Non-Patent Document 1, the advantages and disadvantages of the hash method and the binary tree method are compared. It is described. That is, the hash method imposes strict application conditions such that the field to be searched must be the same among all rules.
 しかしながら、上述した従来技術では、以下の様な問題点があった。ハッシュ法では、全てのルール間で、検索対象フィールドが同じでなければならないことから、複数のフィールドの内、何れかのフィールドでANY等が許容される場合には、パケット検索に際して、ハッシュ法が適用できないという問題点があった。換言すれば、検索対象フィールドが固定化されていない場合(例えば、ルールにANYを許容する場合)には、ハッシュ法の高速性を活かすことは困難であった。 However, the above-described conventional technology has the following problems. In the hash method, the search target field must be the same among all rules. Therefore, if ANY or the like is allowed in any of a plurality of fields, the hash method is used in the packet search. There was a problem that it could not be applied. In other words, when the search target field is not fixed (for example, when ANY is allowed in the rule), it is difficult to utilize the high speed of the hash method.
 以下、図8を参照しながら、従来技術の課題について、より詳細に説明する。図8は、従来技術の課題を説明するための図である。ハッシュ法の適用は、検索対象フィールドが5tupleの様に予め固定されており、値としてANY等の変数が許容されていない場合が典型例である。すなわち、各ルールの検索対象フィールドが、完全長方形型の様に完全に一致していないと、ハッシュ法は原則として適用できない。 Hereinafter, the problem of the related art will be described in more detail with reference to FIG. FIG. 8 is a diagram for explaining a problem of the related art. A typical example of the application of the hash method is a case where a search target field is fixed in advance, such as 5 tuple, and a variable such as ANY is not allowed as a value. In other words, the hash method cannot be applied in principle unless the search target field of each rule completely matches, such as a perfect rectangular shape.
 より具体的には、図8に示す様に、ハッシュ法は、入力パケットの対象フィールドとルールのマッチフィールドとを、それぞれハッシュ値化して比較する方法であるため、マッチフィールドにANYやprefix、suffixが許容され、ルールの検索対象フィールドがまちまちになると、パケットによりハッシュ化する対象領域が固定化されず、ハッシュ法の適用は困難となる。なぜなら、ハッシュを成立させるためには、入力パケット側の対象フィールドとルール側の対象フィールドとが一致している必要があるが、ルール内のフィールドにANYやprefix、suffixが含まれることにより、ルール側の対象フィールドが定まらない場合には、上記一致が困難となるからである。 More specifically, as shown in FIG. 8, the hash method is a method in which a target field of an input packet and a match field of a rule are hashed and compared, so that ANY, prefix, and suffix are added to the match field. Is allowed, and if the search target fields of the rule are mixed, the target area to be hashed by the packet is not fixed, and it becomes difficult to apply the hash method. This is because, in order to establish a hash, the target field on the input packet side and the target field on the rule side need to match, but since the fields in the rule include ANY, prefix, and suffix, the rule This is because if the target field on the side is not determined, the above matching becomes difficult.
 開示の技術は、上記に鑑みてなされたものであって、検索対象のフィールドが固定化されていない場合にも、パケット検索を高速化することができるパケット検索装置、パケット検索方法、及びパケット検索プログラムを提供することを目的とする。 The disclosed technology has been made in view of the above, and a packet search device, a packet search method, and a packet search method that can speed up packet search even when a search target field is not fixed. The purpose is to provide the program.
 上述した課題を解決し、目的を達成するために、本願の開示するパケット検索装置は、一つの態様において、所定の枝分かれを有する二分木を作成する二分木作成部と、作成された前記二分木の一部に対するハッシュテーブル化の開始ビット位置と終了ビット位置とを決定する決定部と、決定された前記開始ビット位置から前記終了ビット位置までを対象として、前記二分木の一部のハッシュテーブルを作成するテーブル作成部とを有する。 In order to solve the above-described problems and achieve the object, in one aspect, a packet search device disclosed in the present application includes a binary tree creating unit that creates a binary tree having a predetermined branching, and the created binary tree A determination unit that determines a start bit position and an end bit position of hash table conversion for a part of the binary table, and performs a hash table of a part of the binary tree from the determined start bit position to the end bit position. And a table creation unit for creating.
 また、本願の開示するパケット検索方法は、一つの態様において、パケット検索装置が、所定の枝分かれを有する二分木を作成する二分木作成工程と、作成された前記二分木の一部に対するハッシュテーブル化の開始ビット位置と終了ビット位置とを決定する決定工程と、決定された前記開始ビット位置から前記終了ビット位置までを対象として、前記二分木の一部のハッシュテーブルを作成するテーブル作成工程とを含む。 In one aspect of the packet search method disclosed by the present application, a packet search device creates a binary tree having a predetermined branch, and creates a hash table for a part of the created binary tree. A determination step of determining a start bit position and an end bit position, and a table creation step of creating a hash table of a part of the binary tree from the determined start bit position to the end bit position. Including.
 更に、本願の開示するパケット検索プログラムは、一つの態様において、所定の枝分かれを有する二分木を作成する二分木作成ステップと、作成された前記二分木の一部に対するハッシュテーブル化の開始ビット位置と終了ビット位置とを決定する決定ステップと、決定された前記開始ビット位置から前記終了ビット位置までを対象として、前記二分木の一部のハッシュテーブルを作成するテーブル作成ステップとをコンピュータに実行させる。 Further, in one aspect, the packet search program disclosed by the present application includes a binary tree creating step of creating a binary tree having a predetermined branch, and a start bit position of hash table conversion for a part of the created binary tree. A computer is caused to execute a determination step of determining an end bit position and a table creation step of creating a hash table of a part of the binary tree from the determined start bit position to the end bit position.
 本願の開示するパケット検索装置、パケット検索方法、及びパケット検索プログラムは、検索対象のフィールドが固定化されていない場合にも、パケット検索を高速化することができるという効果を奏する。 The packet search device, the packet search method, and the packet search program disclosed in the present application have an effect that the speed of the packet search can be increased even when the search target field is not fixed.
図1は、パケット検索装置の構成を示す図である。FIG. 1 is a diagram illustrating a configuration of a packet search device. 図2は、本実施例に係るパケット検索処理を説明するための図である。FIG. 2 is a diagram for explaining the packet search process according to the embodiment. 図3は、従来技術及び本実施例に係るハッシュ法の適用対象となるフィールドを示す図である。FIG. 3 is a diagram illustrating fields to which the hash method according to the related art and the present embodiment is applied. 図4は、本実施例に係るハッシュテーブル化アルゴリズムの概要を示す図である。FIG. 4 is a diagram illustrating an outline of the hash table conversion algorithm according to the present embodiment. 図5は、本実施例に係るハッシュテーブル化アルゴリズムの具体例を示す図である。FIG. 5 is a diagram illustrating a specific example of the hash table conversion algorithm according to the present embodiment. 図6は、本実施例に係る二分木のハッシュテーブル化アルゴリズムを説明するための図である。FIG. 6 is a diagram for explaining the binary tree hash table conversion algorithm according to the present embodiment. 図7は、本実施例に係るパケット検索プログラムによる情報処理がコンピュータを用いて具体的に実現されることを示す図である。FIG. 7 is a diagram illustrating that information processing by the packet search program according to the present embodiment is specifically realized using a computer. 図8は、従来技術の課題を説明するための図である。FIG. 8 is a diagram for explaining a problem of the related art.
 以下に、本願の開示するパケット検索装置、パケット検索方法、及びパケット検索プログラムの実施例を、図面を参照しながら詳細に説明する。なお、以下の実施例により本願の開示するパケット検索装置、パケット検索方法、及びパケット検索プログラムが限定されるものではない。 Hereinafter, embodiments of a packet search device, a packet search method, and a packet search program disclosed in the present application will be described in detail with reference to the drawings. The packet search device, the packet search method, and the packet search program disclosed in the present application are not limited by the following embodiments.
 まず、本願の開示する一実施例に係るパケット検索装置10の構成を説明する。図1は、パケット検索装置10の構成を示す図である。図1に示す様に、パケット検索装置10は、二分木作成部11とビット位置決定部12とハッシュテーブル作成部13とを有する。これら各構成部分は、一方向又は双方向に、信号やデータの入出力が可能な様に接続されている。 First, the configuration of the packet search device 10 according to one embodiment disclosed in the present application will be described. FIG. 1 is a diagram illustrating a configuration of the packet search device 10. As shown in FIG. 1, the packet search device 10 has a binary tree creating unit 11, a bit position determining unit 12, and a hash table creating unit 13. These components are connected so that signals and data can be input and output in one or two directions.
 詳細な構成については後述するが、二分木作成部11は、所定の枝分かれを有する二分木を作成する。ビット位置決定部12は、作成された上記二分木の一部に対するハッシュテーブル化の開始ビット位置と終了ビット位置とを決定する。ハッシュテーブル作成部13は、決定された上記開始ビット位置から上記終了ビット位置までを対象として、上記二分木の一部のハッシュテーブルを作成する。 Although the detailed configuration will be described later, the binary tree creating unit 11 creates a binary tree having a predetermined branch. The bit position determining unit 12 determines a start bit position and an end bit position of hash table conversion for a part of the created binary tree. The hash table creation unit 13 creates a part of the binary tree hash table from the determined start bit position to the end bit position.
 図2は、本実施例に係るパケット検索処理を説明するための図である。図2に示す様に、本実施例に係るパケット検索装置10は、二分木の一部(破線枠A1の部分)をハッシュテーブル化することにより、該当部分の比較検索処理に対し、ハッシュ法を適用する。ハッシュ法では、ハッシュテーブルを配列変数で作成し、検索値(ハッシュ値)を配列変数のインデックスにする。ハッシュ法による検索は、このインデックス値の指定により行うが、本動作は、機械語レベルでは、メモリのアドレス指定処理となるため、通常の変数値取得処理と同様の動作になる。すなわち、ハッシュ法では、パケット検索装置10は、上記比較検索処理を、メモリアドレス指定処理に変更することにより、比較処理を行わずに検索を実行することができる。このため、高速処理が実現される。 FIG. 2 is a diagram for explaining the packet search process according to the embodiment. As illustrated in FIG. 2, the packet search device 10 according to the present embodiment converts the part of the binary tree (the part indicated by the broken line frame A1) into a hash table, and performs a hash method for the comparison search processing of the corresponding part. Apply. In the hash method, a hash table is created using an array variable, and a search value (hash value) is used as an index of the array variable. The search by the hash method is performed by designating the index value. However, this operation is a memory address designation process at a machine language level, and thus becomes an operation similar to a normal variable value acquisition process. That is, in the hash method, the packet search device 10 can execute the search without performing the comparison process by changing the comparison search process to the memory address designation process. Therefore, high-speed processing is realized.
 図2に示す例では、破線枠A1内の3つの情報(011、101、111)に対する検索が、ハッシュテーブル化により高速化されることとなる。但し、この例とは異なり、ハッシュテーブル化する部分の情報が1つしかない(枝分かれが無い)場合には、元の二分木法でも比較検索処理が実行されないため、ハッシュテーブル化による効果は得られない。このため、かかる場合には、必ずしもハッシュテーブル化を行う必要は無い。反対に、ハッシュテーブル化する部分の枝分かれの数が多い程、ハッシュテーブル化により得られる高速化の効果は高くなる。 In the example shown in FIG. 2, the search for three pieces of information (011, 101, 111) in the broken line frame A1 is speeded up by hash table conversion. However, unlike this example, if there is only one piece of information of the portion to be converted into a hash table (there is no branching), the comparison search process is not executed even by the original binary tree method, so that the effect of the hash table conversion is obtained. I can't. Therefore, in such a case, it is not always necessary to perform hash table conversion. Conversely, the greater the number of branches of the portion to be hash-tabled, the higher the speed-up effect obtained by hash-table conversion.
 図3は、従来技術及び本実施例に係るハッシュ法の適用対象となるフィールドを示す図である。図3では、横軸方向にはビットが規定され、縦軸方向にはルールが規定されている。図3に示す様に、従来技術においてハッシュ法の適用対象となるフィールドは、完全長方形型であるため、全てのルール間で対象フィールドが一致している。これに対して、本実施例においてハッシュ法の適用対象となるフィールドは、ANY値(prefix、suffixを含む)を伴うため、各ルールの対象フィールドは、必ずしも一致していない。このため、従来の方法では、ハッシュ法の適用による高速化を図ることは困難である。そこで、本実施例に係るパケット検索装置10は、ANYを伴う二分木テーブルを前提とし、ルール状況(例えば、トリー状況)に応じて動的に、部分的なハッシュテーブル化を行う。 FIG. 3 is a diagram showing fields to which the hash method according to the related art and the present embodiment is applied. In FIG. 3, bits are defined in the horizontal axis direction, and rules are defined in the vertical axis direction. As shown in FIG. 3, the field to which the hash method is applied in the related art is a perfect rectangular type, and therefore, the target field matches among all rules. On the other hand, in the present embodiment, the fields to which the hash method is applied have an ANY value (including a prefix and a suffix). Therefore, the target fields of the respective rules do not always match. For this reason, it is difficult to increase the speed by applying the hash method in the conventional method. Therefore, the packet search device 10 according to the present embodiment presumes a binary tree table with ANY, and dynamically performs partial hash table conversion in accordance with a rule situation (for example, a tree situation).
 以下、図4及び図5を参照しながら、本実施例に係るハッシュテーブル化アルゴリズムについて、説明する。図4は、本実施例に係るハッシュテーブル化アルゴリズムの概要を示す図である。図4は前述の図3に対応し、横軸方向にはビットが規定され、縦軸方向にはルールが規定されている。図5は、本実施例に係るハッシュテーブル化アルゴリズムの具体例を示す図である。前提として、ルールの並び順は、ANYを伴う二分木を作成する際に、各ノードを上から0、1、A(ANY)として二分木を作成した場合に、その上下の順に従って上からルールを並べる(S0)。 Hereinafter, the hash table conversion algorithm according to the present embodiment will be described with reference to FIGS. FIG. 4 is a diagram illustrating an outline of the hash table conversion algorithm according to the present embodiment. FIG. 4 corresponds to FIG. 3 described above, in which bits are defined in the horizontal axis direction and rules are defined in the vertical axis direction. FIG. 5 is a diagram illustrating a specific example of the hash table conversion algorithm according to the present embodiment. As a premise, the order of rules is such that when a binary tree with ANY is created, if each node is 0, 1, A (ANY) from the top and a binary tree is created, the rules are ordered from the top down. Are arranged (S0).
 次のS1では、パケット検索装置10は、開始ビット位置が同じであるルールの中で、終了ビット位置が最短のルール(最短長ルール)R1に合わせて、破線枠A2に対応するハッシュテーブルT1を作成する。ここで、開始ビット位置とは、文字通りの開始位置(例えば、図4の(1))のみならず、ANY値直後のビット位置(例えば、図4の(2))を含む。同様に、終了ビット位置とは、文字通りの終了位置(例えば、図4の(3))のみならず、ANY値直前のビット位置(例えば、図4の(4))を含む。 In the next S1, the packet search device 10 matches the hash table T1 corresponding to the broken line frame A2 with the rule (shortest rule) R1 having the shortest end bit position among the rules having the same start bit position. create. Here, the start bit position includes not only the literal start position (for example, (1) in FIG. 4), but also the bit position immediately after the ANY value (for example, (2) in FIG. 4). Similarly, the end bit position includes not only the literal end position (for example, (3) in FIG. 4), but also the bit position immediately before the ANY value (for example, (4) in FIG. 4).
 上記最短のルールの終了ビット位置以降については、パケット検索装置10は、当該位置から、その次に短いルールまで、ハッシュテーブルを作成する。図5に示す例では、破線枠A3に対応するハッシュテーブルが引き続き作成される(S2)。以降、同様の処理が繰り返し、実行される。 に つ い て For the bit after the end bit position of the shortest rule, the packet search device 10 creates a hash table from the position to the next shortest rule. In the example shown in FIG. 5, the hash table corresponding to the broken line frame A3 is continuously created (S2). Thereafter, similar processing is repeatedly executed.
 このとき、破線枠A4に対応するハッシュテーブルについては、ハッシュテーブル化する部分の元の二分木の枝分かれ数が2であり、2以下であるので、作成されない。従って、そのまま二分木法が採られる(S3)。 At this time, the hash table corresponding to the dashed-line frame A4 is not created because the number of branches of the original binary tree of the portion to be converted into the hash table is 2, which is 2 or less. Therefore, the binary tree method is adopted as it is (S3).
 なお、ハッシュテーブル化せずにそのまま二分木法が採られる条件として、枝分かれ数が2以下であることを例示したが、これに限らず、所定値N(例えば、3)以下であってもよい。上記S1の場合、枝分かれ数が11であるので、所定値Nが11以上でない限り、ハッシュテーブル化が実行される。反対に、枝分かれ数が2以下であっても、枝分かれが存在する場合には、ハッシュテーブル化を行ってもよい。 In addition, as an example of the condition under which the binary tree method is employed without forming a hash table, the number of branches is 2 or less. However, the present invention is not limited to this, and may be a predetermined value N (for example, 3) or less. . In the case of S1, since the number of branches is 11, hash table conversion is executed unless the predetermined value N is 11 or more. Conversely, even if the number of branches is two or less, if there is a branch, hash table conversion may be performed.
 以下、図6を参照しながら、二分木のハッシュテーブル化アルゴリズムについて、より詳細に説明する。通常の検索ルールでは、ANY値やprefix、suffixを伴うのが一般的である。この様な場合にも、以下の手順によりハッシュテーブル化することで、パケット検索の効率化が実現される。 Hereinafter, the hash table conversion algorithm of the binary tree will be described in more detail with reference to FIG. Generally, a normal search rule involves an ANY value, a prefix, and a suffix. Even in such a case, the efficiency of packet search can be realized by forming a hash table according to the following procedure.
 図6は、本実施例に係る二分木のハッシュテーブル化アルゴリズムを説明するための図である。図6に示す様に、(1)では、start nodeを起点として、枝分かれが、上から0、1、A(any node)の順になる様に、二分木構成が作成される。 FIG. 6 is a diagram for explaining a binary tree hash table conversion algorithm according to this embodiment. As shown in FIG. 6, in (1), a binary tree configuration is created from the start @ node as a starting point such that the branches are in the order of 0, 1, and A (any @ node) from the top.
 次の(2)では、二分木のstart nodeまたはAの次に、0または1のノード、あるいは0と1双方のノードが続く場合、そのビット位置を、ハッシュテーブルの開始ビット位置とし、その後、Aまたは終端点が現れた場合、Aの手前または終端点のビット位置を、ハッシュテーブルの終了ビット位置とする。図6に示す例では、左端のstart nodeに0と1双方のノードが続くため、このビット位置B1が、破線枠A5に対応するハッシュテーブルの開始ビット位置となる。その後、ビット位置B1から4ビット後のビット位置B2にAが現れるため、その手前のビット位置B3が、破線枠A5に対応するハッシュテーブルの終了ビット位置となる。 In the following (2), if a node of 0 or 1 or both 0 and 1 follows the start @ node or A of the binary tree, the bit position is set as the start bit position of the hash table. When A or the end point appears, the bit position before or at the end point of A is set as the end bit position of the hash table. In the example shown in FIG. 6, since both 0 and 1 nodes follow the leftmost start @ node, this bit position B1 is the start bit position of the hash table corresponding to the broken line frame A5. Thereafter, A appears at bit position B2, which is four bits after bit position B1, and bit position B3 before that becomes the end bit position of the hash table corresponding to broken line frame A5.
 次の(3)では、上記(2)に引き続き、ハッシュテーブルの終了ビット位置から、0または1のノード、あるいは0と1双方のノードが続く場合、そのビット位置を、新たなハッシュテーブルの開始ビット位置とする。その後は、上記(2)と同様に、Aまたは終端点が現れた場合、Aの手前または終端点のビット位置を、ハッシュテーブルの終了ビット位置とする。これにより、図6に示す例では、破線枠A6~A9に対応する4つのハッシュテーブルが新たに作成されることとなる。 In the following (3), following the above (2), if a node of 0 or 1 or both 0 and 1 continues from the end bit position of the hash table, the bit position is changed to the start bit of the new hash table. Bit position. Thereafter, similarly to the above (2), when A or the terminal point appears, the bit position before or at the terminal point of A is set as the end bit position of the hash table. Thus, in the example shown in FIG. 6, four hash tables corresponding to the dashed frames A6 to A9 are newly created.
 なお、図6の(4)の様に、ハッシュテーブル化する部分に枝分かれが無い場合には、ハッシュテーブル化は行われない。これにより、高速化に寄与しない部分にまで、不要なハッシュ法が適用されることが抑制され、より効率的なパケット検索が可能となる。 If there is no branch in the portion to be converted into a hash table as in (4) of FIG. 6, the hash table is not formed. This suppresses the application of an unnecessary hash method to a portion that does not contribute to speeding up, and enables more efficient packet search.
 ハッシュテーブル化の評価に関し、二分木法による検索回数をlog(N)(Nはルール数)とすると、図6に示す例では、ルール数(終端ノードの数)が19であるので、検索回数はlog(19)≒4.2となる。一方、図6の破線枠A5~A9に示す部分をハッシュテーブル化した場合には、1ハッシュテーブル内において1NULL判定を行うとすると、101101AA1のルールヒット時に、最大3回の検索で済むことになる。従って、パケット検索の効率化が実現される。 Regarding the evaluation of the hash table, if the number of searches by the binary tree method is log 2 (N) (N is the number of rules), the number of rules (the number of terminal nodes) is 19 in the example shown in FIG. The number of times is log 2 (19) ≒ 4.2. On the other hand, in the case where the portions indicated by the dashed frames A5 to A9 in FIG. 6 are converted into a hash table, if one NULL determination is performed in one hash table, a maximum of three searches can be performed when the rule hit of 101101AA1 is hit. . Therefore, efficiency of packet search is realized.
 以上説明した様に、パケット検索装置10は、二分木作成部11とビット位置決定部12とハッシュテーブル作成部13とを有する。二分木作成部11は、所定の枝分かれを有する二分木を作成する。ビット位置決定部12は、作成された上記二分木の一部に対するハッシュテーブル化の開始ビット位置と終了ビット位置とを決定する。ハッシュテーブル作成部13は、決定された上記開始ビット位置から上記終了ビット位置までを対象として、上記二分木の一部のハッシュテーブルを作成し、該一部にハッシュ法を適用する。ハッシュ法は、二分木法と比較して一般的に高速であるため、パケット検索装置10によれば、ハッシュ法を適用可能な範囲内で、パケット検索の高速化を図ることができる。 As described above, the packet search device 10 includes the binary tree creating unit 11, the bit position determining unit 12, and the hash table creating unit 13. The binary tree creating unit 11 creates a binary tree having a predetermined branch. The bit position determination unit 12 determines a start bit position and an end bit position of hash table conversion for a part of the created binary tree. The hash table creation unit 13 creates a hash table of a part of the binary tree from the determined start bit position to the end bit position and applies a hash method to the part. Since the hash method is generally faster than the binary tree method, the packet search device 10 can speed up the packet search within a range where the hash method can be applied.
 パケット検索装置10において、上記二分木は、ANY値、prefix、suffixのうち、少なくとも1つを含むものとしてもよい。また、パケット検索装置10において、二分木作成部11は、上記所定の枝分かれが上から0、1、ANY値の順になる様に、上記二分木を作成し、ビット位置決定部12は、上記二分木の開始点または上記ANY値の次に、0または1のノード、あるいは0と1の双方のノードが続く場合、そのビット位置を、上記開始ビット位置に決定すると共に、その後に別のANY値または終端点が現れた場合、該ANY値の手前または上記終端点のビット位置を、上記終了ビット位置に決定するものとしてもよい。 In the packet search device 10, the binary tree may include at least one of an ANY value, a prefix, and a suffix. In the packet search device 10, the binary tree creating unit 11 creates the binary tree so that the predetermined branching is in the order of 0, 1, and ANY value from the top, and the bit position determining unit 12 If a node of 0 or 1 or both 0 and 1 follows the starting point of the tree or the ANY value, the bit position is determined to be the starting bit position, and then another ANY value is set. Alternatively, when an end point appears, a bit position before the ANY value or the bit position of the end point may be determined as the end bit position.
 換言すれば、ビット位置決定部12は、二分木内のANY値を回避しつつ、部分的なハッシュテーブル化の対象範囲が極力広くなる様に、二分木の構成に合わせて動的に、ハッシュテーブル化の開始ビット位置と終了ビット位置とを決定する。これにより、検索対象フィールドが固定化されていない場合(例えば、ルールにANYを許容する場合)にも、可能な限り、ハッシュ法の高速性を活かすことができる。 In other words, the bit position determination unit 12 dynamically adjusts the hash table according to the configuration of the binary tree so as to avoid the ANY value in the binary tree and maximize the range of partial hash table conversion. The start bit position and the end bit position of the conversion are determined. Accordingly, even when the search target field is not fixed (for example, when ANY is allowed in the rule), the high speed of the hash method can be utilized as much as possible.
 また、パケット検索装置10において、ビット位置決定部12は、上記ハッシュテーブル化の対象部分となる二分木の一部の枝分かれ数が、所定数(例えば、2)以下の場合には、上記二分木の一部を、上記ハッシュテーブル化の対象から除外して、そのまま二分木法を適用するものとしてもよい。 In the packet search device 10, if the number of branches of a part of the binary tree to be hashed is less than or equal to a predetermined number (for example, 2), the bit position determination unit 12 May be excluded from the target of the hash table conversion and the binary tree method may be applied as it is.
 なお、ビット位置決定部12は、二分木にハッシュテーブル化を適用する部分に同期する様に、パケットによりハッシュ値を求める、ルール側の対象フィールドも変更する。これにより、二分木において高速化を所望する部分を、正確かつ継続的に、ハッシュテーブル化の対象とすることができる。 The bit position determination unit 12 also changes the target field on the rule side for obtaining a hash value from a packet so as to synchronize with the portion where hash table conversion is applied to the binary tree. This makes it possible to accurately and continuously target a portion of the binary tree for which high-speed processing is to be performed on the hash table.
 上述した様に、本実施例に係るパケット検索技術は、二分木法に対して、部分的にハッシュ法を適用することで、ルールのマッチフィールドが固定化されていない(例えば、マッチフィールドにANYやprefix、suffixなどが存在する)場合にも、パケット検索を高速化することができる。換言すれば、本実施例に係るパケット検索技術は、ANYやprefix、suffixを伴う二分木テーブルを前提とし、ルール状況に応じて動的に、部分的なハッシュテーブル化を行う。これにより、検索ルールの仕様が、マッチフィールドにANY値やprefix、suffixを含む柔軟な仕様の場合にも、ハッシュテーブルを部分的に適用し、高速化を実現することが可能となる。また、本実施例に係るパケット検索技術は、二分木を部分的にハッシュテーブル化するため、ANY値のみならず、prefixやsuffixがマッチフィールドに許容される場合にも対応することができる。 As described above, in the packet search technique according to the present embodiment, the match field of the rule is not fixed by partially applying the hash method to the binary tree method (for example, ANY is added to the match field). , Prefix, suffix, etc.), it is possible to speed up the packet search. In other words, the packet search technique according to the present embodiment presupposes a binary tree table with ANY, prefix, and suffix, and dynamically performs partial hash table conversion according to the rule situation. Thus, even when the specification of the search rule is a flexible specification including an ANY value, a prefix, and a suffix in the match field, it is possible to partially apply the hash table and achieve high speed. Further, since the packet search technique according to the present embodiment partially converts the binary tree into a hash table, it is possible to cope with not only the ANY value but also the case where a prefix or a suffix is allowed in the match field.
(パケット検索プログラム)
 図7は、本実施例に係るパケット検索プログラムによる情報処理がコンピュータ100を用いて具体的に実現されることを示す図である。図7に示す様に、コンピュータ100は、例えば、メモリ101と、CPU(Central Processing Unit)102と、ハードディスクドライブインタフェース103と、ディスクドライブインタフェース104と、シリアルポートインタフェース105と、ビデオアダプタ106と、ネットワークインタフェース107とを有し、これらの各部はバスCによって接続される。
(Packet search program)
FIG. 7 is a diagram illustrating that information processing by the packet search program according to the present embodiment is specifically realized using the computer 100. As shown in FIG. 7, the computer 100 includes, for example, a memory 101, a CPU (Central Processing Unit) 102, a hard disk drive interface 103, a disk drive interface 104, a serial port interface 105, a video adapter 106, a network An interface 107 is provided, and these units are connected by a bus C.
 メモリ101は、図7に示す様に、ROM(Read Only Memory)101a及びRAM(Random Access Memory)101bを含む。ROM101aは、例えば、BIOS(Basic Input Output System)等のブートプログラムを記憶する。ハードディスクドライブインタフェース103は、図7に示す様に、ハードディスクドライブ108に接続される。ディスクドライブインタフェース104は、図7に示す様に、ディスクドライブ109に接続される。例えば磁気ディスクや光ディスク等の着脱可能な記憶媒体が、ディスクドライブ109に挿入される。シリアルポートインタフェース105は、図7に示す様に、例えばマウス110、キーボード111に接続される。ビデオアダプタ106は、図7に示す様に、例えばディスプレイ112に接続される。 As shown in FIG. 7, the memory 101 includes a ROM (Read Only Memory) 101a and a RAM (Random Access Memory) 101b. The ROM 101a stores, for example, a boot program such as a BIOS (Basic Input Output System). The hard disk drive interface 103 is connected to the hard disk drive 108 as shown in FIG. The disk drive interface 104 is connected to the disk drive 109 as shown in FIG. For example, a removable storage medium such as a magnetic disk or an optical disk is inserted into the disk drive 109. The serial port interface 105 is connected to, for example, a mouse 110 and a keyboard 111 as shown in FIG. The video adapter 106 is connected to, for example, a display 112 as shown in FIG.
 ここで、図7に示す様に、ハードディスクドライブ108は、例えば、OS(Operating System)108a、アプリケーションプログラム108b、プログラムモジュール108c、プログラムデータ108d、二分木データ、ハッシュテーブルを記憶する。すなわち、開示の技術に係るパケット検索プログラムは、コンピュータ100によって実行される指令が記述されたプログラムモジュール108cとして、例えばハードディスクドライブ108に記憶される。具体的には、上記実施例で説明した二分木作成部11、ビット位置決定部12、ハッシュテーブル作成部13の各々と同様の情報処理を実行する各種手順が記述されたプログラムモジュール108cが、ハードディスクドライブ108に記憶される。また、パケット検索プログラムによる情報処理に用いられるデータは、プログラムデータ108dとして、例えばハードディスクドライブ108に記憶される。そして、CPU102が、ハードディスクドライブ108に記憶されたプログラムモジュール108cやプログラムデータ108dを必要に応じてRAM101bに読み出し、上記各種手順を実行する。 Here, as shown in FIG. 7, the hard disk drive 108 stores, for example, an operating system (OS) 108a, an application program 108b, a program module 108c, program data 108d, binary tree data, and a hash table. That is, the packet search program according to the disclosed technology is stored in, for example, the hard disk drive 108 as a program module 108c in which an instruction to be executed by the computer 100 is described. Specifically, the program module 108c in which various procedures for executing the same information processing as each of the binary tree creating unit 11, the bit position determining unit 12, and the hash table creating unit 13 described in the above embodiment are described. Stored in the drive 108. Further, data used for information processing by the packet search program is stored in the hard disk drive 108 as program data 108d, for example. Then, the CPU 102 reads out the program module 108c and the program data 108d stored in the hard disk drive 108 to the RAM 101b as necessary, and executes the above various procedures.
 なお、パケット検索プログラムに係るプログラムモジュール108cやプログラムデータ108dは、ハードディスクドライブ108に記憶される場合に限られず、例えば着脱可能な記憶媒体に記憶され、ディスクドライブ109等を介してCPU102によって読み出されてもよい。あるいは、パケット検索プログラムに係るプログラムモジュール108cやプログラムデータ108dは、ネットワーク(LAN(Local Area Network)、WAN(Wide Area Network)等)を介して接続された他のコンピュータに記憶され、ネットワークインタフェース107を介してCPU102によって読み出されてもよい。 The program module 108c and the program data 108d related to the packet search program are not limited to being stored in the hard disk drive 108, but are stored in, for example, a removable storage medium and read out by the CPU 102 via the disk drive 109 and the like. You may. Alternatively, the program module 108c and the program data 108d related to the packet search program are stored in another computer connected via a network (LAN (Local Area Network), WAN (Wide Area Network), etc.), and the network interface 107 And may be read by the CPU 102 via the
 また、上述したパケット検索装置10の各構成要素は、必ずしも物理的に図示の如く構成されていることを要しない。すなわち、各装置の分散・統合の具体的態様は、図示のものに限らず、その全部又は一部を、各種の負荷や使用状況等に応じて、任意の単位で機能的又は物理的に分散・統合して構成することもできる。例えば、ビット位置決定部12とハッシュテーブル作成部13を1つの構成要素として統合してもよい。反対に、ビット位置決定部12に関し、ハッシュテーブル化の開始ビット位置と終了ビット位置とを決定する部分と、ルール側の対象フィールドを変更する部分とに分散してもよい。更に、二分木データ、ハッシュテーブルを格納するハードディスクドライブ108を、パケット検索装置10の外部装置として、ネットワークやケーブル経由で接続する様にしてもよい。 The components of the above-described packet search device 10 do not necessarily need to be physically configured as illustrated. That is, the specific mode of distribution / integration of each device is not limited to the illustrated one, and all or a part thereof may be functionally or physically distributed in arbitrary units according to various loads and usage conditions.・ It can be integrated. For example, the bit position determining unit 12 and the hash table creating unit 13 may be integrated as one component. Conversely, the bit position determination unit 12 may be divided into a part that determines the start bit position and the end bit position of the hash table, and a part that changes the target field on the rule side. Further, the hard disk drive 108 storing the binary tree data and the hash table may be connected as an external device of the packet search device 10 via a network or a cable.
10 パケット検索装置
11 二分木作成部
12 ビット位置決定部
13 ハッシュテーブル作成部
100 コンピュータ
101 メモリ
101a ROM
101b RAM
102 CPU
103 ハードディスクドライブインタフェース
104 ディスクドライブインタフェース
105 シリアルポートインタフェース
106 ビデオアダプタ
107 ネットワークインタフェース
108 ハードディスクドライブ
108a OS
108b アプリケーションプログラム
108c プログラムモジュール
108d プログラムデータ
109 ディスクドライブ
110 マウス
111 キーボード
112 ディスプレイ
B1、B2、B3 ビット位置
C バス
T1 ハッシュテーブル
DESCRIPTION OF SYMBOLS 10 Packet search apparatus 11 Binary tree creation part 12 Bit position determination part 13 Hash table creation part 100 Computer 101 Memory 101a ROM
101b RAM
102 CPU
103 hard disk drive interface 104 disk drive interface 105 serial port interface 106 video adapter 107 network interface 108 hard disk drive 108a OS
108b application program 108c program module 108d program data 109 disk drive 110 mouse 111 keyboard 112 display B1, B2, B3 bit position C bus T1 hash table

Claims (6)

  1.  所定の枝分かれを有する二分木を作成する二分木作成部と、
     作成された前記二分木の一部に対するハッシュテーブル化の開始ビット位置と終了ビット位置とを決定する決定部と、
     決定された前記開始ビット位置から前記終了ビット位置までを対象として、前記二分木の一部のハッシュテーブルを作成するテーブル作成部と
     を有することを特徴とするパケット検索装置。
    A binary tree creating unit that creates a binary tree having a predetermined branching;
    A determination unit that determines a start bit position and an end bit position of hash table conversion for a part of the created binary tree;
    A table creation unit for creating a hash table of a part of the binary tree from the determined start bit position to the end bit position.
  2.  前記二分木は、ANY値を含むことを特徴とする請求項1に記載のパケット検索装置。 The packet search device according to claim 1, wherein the binary tree includes an ANY value.
  3.  前記二分木作成部は、前記所定の枝分かれが0、1、ANY値の順になる様に、前記二分木を作成し、
     前記決定部は、前記二分木の開始点または前記ANY値の次に、0または1、あるいは0と1の双方が続く場合、そのビット位置を、前記開始ビット位置に決定すると共に、その後に別のANY値または終端点が現れた場合、該ANY値の手前または前記終端点のビット位置を、前記終了ビット位置に決定することを特徴とする請求項2に記載のパケット検索装置。
    The binary tree creating unit creates the binary tree such that the predetermined branching is in the order of 0, 1, and ANY values.
    When 0 or 1 or both 0 and 1 follow the start point of the binary tree or the ANY value, the determination unit determines the bit position as the start bit position, and then determines another. 3. The packet search apparatus according to claim 2, wherein, when an ANY value or a terminal point of the above appears, a bit position before the ANY value or a bit position of the terminal point is determined as the end bit position.
  4.  前記決定部は、前記ハッシュテーブル化の対象部分となる二分木の一部の枝分かれ数が、所定数以下の場合には、前記二分木の一部を、前記ハッシュテーブル化の対象から除外することを特徴とする請求項1に記載のパケット検索装置。 The determining unit, when the number of branches of a part of the binary tree to be the target part of the hash table conversion is equal to or less than a predetermined number, excludes the part of the binary tree from the target of the hash table conversion. The packet search device according to claim 1, wherein:
  5.  パケット検索装置が、
     所定の枝分かれを有する二分木を作成する二分木作成工程と、
     作成された前記二分木の一部に対するハッシュテーブル化の開始ビット位置と終了ビット位置とを決定する決定工程と、
     決定された前記開始ビット位置から前記終了ビット位置までを対象として、前記二分木の一部のハッシュテーブルを作成するテーブル作成工程と
     を含むことを特徴とするパケット検索方法。
    The packet search device is
    A binary tree creating step of creating a binary tree having a predetermined branching;
    A determining step of determining a start bit position and an end bit position of hash table conversion for a part of the created binary tree;
    A table creation step of creating a hash table of a part of the binary tree from the determined start bit position to the end bit position.
  6.  所定の枝分かれを有する二分木を作成する二分木作成ステップと、
     作成された前記二分木の一部に対するハッシュテーブル化の開始ビット位置と終了ビット位置とを決定する決定ステップと、
     決定された前記開始ビット位置から前記終了ビット位置までを対象として、前記二分木の一部のハッシュテーブルを作成するテーブル作成ステップと
     をコンピュータに実行させるためのパケット検索プログラム。
    A binary tree creating step of creating a binary tree having a predetermined branching;
    A determining step of determining a start bit position and an end bit position of hash table conversion for a part of the created binary tree;
    A table creation step for creating a hash table of a part of the binary tree from the determined start bit position to the end bit position.
PCT/JP2019/028986 2018-07-26 2019-07-24 Packet search device, packet search method, and packet search program WO2020022374A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2018-140701 2018-07-26
JP2018140701A JP2020017147A (en) 2018-07-26 2018-07-26 Packet search device, packet search method, and packet search program

Publications (1)

Publication Number Publication Date
WO2020022374A1 true WO2020022374A1 (en) 2020-01-30

Family

ID=69180791

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2019/028986 WO2020022374A1 (en) 2018-07-26 2019-07-24 Packet search device, packet search method, and packet search program

Country Status (2)

Country Link
JP (1) JP2020017147A (en)
WO (1) WO2020022374A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021166087A1 (en) * 2020-02-18 2021-08-26 日本電信電話株式会社 Packet search device, packet search method, and packet search program

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6018524A (en) * 1997-09-09 2000-01-25 Washington University Scalable high speed IP routing lookups
US6212184B1 (en) * 1998-07-15 2001-04-03 Washington University Fast scaleable methods and devices for layer four switching

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6018524A (en) * 1997-09-09 2000-01-25 Washington University Scalable high speed IP routing lookups
US6212184B1 (en) * 1998-07-15 2001-04-03 Washington University Fast scaleable methods and devices for layer four switching

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
WALDVOGELT, M. ET AL.: "Scalable high speed IP routing lookups, Proceedings of the ACM SIGCOMM", 97 CONFERENCE ON APPLICATIONS, TECHNOLOGIES, ARCHITECTURES, AND PROTOCOLS FOR COMPUTER COMMUNICATION, 14 September 1997 (1997-09-14), pages 25 - 36, XP058336841 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021166087A1 (en) * 2020-02-18 2021-08-26 日本電信電話株式会社 Packet search device, packet search method, and packet search program

Also Published As

Publication number Publication date
JP2020017147A (en) 2020-01-30

Similar Documents

Publication Publication Date Title
Wang et al. Namefilter: Achieving fast name lookup with low memory cost via applying two-stage bloom filters
US7668160B2 (en) Methods for performing packet classification
US8478707B1 (en) System and method for reducing flow rules in forwarding tables
EP3276501B1 (en) Traffic classification method and device, and storage medium
Cho et al. Fast reconfiguring deep packet filter for 1+ gigabit network
EP3145134B1 (en) Lookup device and lookup configuration method
JP5960863B1 (en) SEARCH DEVICE, SEARCH METHOD, PROGRAM, AND RECORDING MEDIUM
WO2015127721A1 (en) Data matching method and apparatus and computer storage medium
JP6557334B2 (en) Access classification device, access classification method, and access classification program
WO2020022374A1 (en) Packet search device, packet search method, and packet search program
CN110505322A (en) A kind of IP address section lookup method and device
CN104679854B (en) Routing table stores and lookup method
US11431626B2 (en) Forwarding rules among lookup tables in a multi-stage packet processor
Kekely et al. Fast lookup for dynamic packet filtering in FPGA
Kekely et al. Packet classification with limited memory resources
CN113726660B (en) Route finder and method based on perfect hash algorithm
WO2021166087A1 (en) Packet search device, packet search method, and packet search program
Vespa et al. Swm: Simplified wu-manber for gpu-based deep packet inspection
WO2021024392A1 (en) Packet search device, packet search method, and packet search program
JP2005242672A (en) Pattern matching device, method, and program
JP6012814B1 (en) Sequential clustering apparatus, method, and program
WO2019160164A1 (en) Search device, search method, and search program
Mahini et al. MLET: a power efficient approach for TCAM based, IP lookup engines in Internet routers
JP4726310B2 (en) Information retrieval apparatus, information retrieval multiprocessor and router
JP2018196075A (en) Retrieval device, retrieval program, and retrieval method

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19841086

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19841086

Country of ref document: EP

Kind code of ref document: A1