JP2020017147A - Packet search device, packet search method, and packet search program - Google Patents
Packet search device, packet search method, and packet search program Download PDFInfo
- Publication number
- JP2020017147A JP2020017147A JP2018140701A JP2018140701A JP2020017147A JP 2020017147 A JP2020017147 A JP 2020017147A JP 2018140701 A JP2018140701 A JP 2018140701A JP 2018140701 A JP2018140701 A JP 2018140701A JP 2020017147 A JP2020017147 A JP 2020017147A
- Authority
- JP
- Japan
- Prior art keywords
- bit position
- binary tree
- hash table
- packet search
- hash
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/74—Address processing for routing
- H04L45/745—Address table lookup; Address filtering
- H04L45/7453—Address table lookup; Address filtering using hashing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/74—Address processing for routing
- H04L45/745—Address table lookup; Address filtering
- H04L45/74591—Address table lookup; Address filtering using content-addressable memories [CAM]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Description
本発明は、パケット検索装置、パケット検索方法、及びパケット検索プログラムに関する。 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値等が許容されない)ことや、ハッシュ衝突の問題があることから、二分木法が用いられることが多い。 2. Description of the Related Art Conventionally, as packet search techniques, there are a TCAM (Ternary Content Addressable Memory) search mainly using hardware, and a search using 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) has to be fixed for all rules (ANY values and the like are 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
しかしながら、上述した従来技術では、以下の様な問題点があった。ハッシュ法では、全てのルール間で、検索対象フィールドが同じでなければならないことから、複数のフィールドの内、何れかのフィールドでANY等が許容される場合には、パケット検索に際して、ハッシュ法が適用できないという問題点があった。換言すれば、検索対象フィールドが固定化されていない場合(例えば、ルールにANYを許容する場合)には、ハッシュ法の高速性を活かすことは困難であった。 However, the above-described related art 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.
以下に、本願の開示するパケット検索装置、パケット検索方法、及びパケット検索プログラムの実施例を、図面を参照しながら詳細に説明する。なお、以下の実施例により本願の開示するパケット検索装置、パケット検索方法、及びパケット検索プログラムが限定されるものではない。 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, a configuration of a
詳細な構成については後述するが、二分木作成部11は、所定の枝分かれを有する二分木を作成する。ビット位置決定部12は、作成された上記二分木の一部に対するハッシュテーブル化の開始ビット位置と終了ビット位置とを決定する。ハッシュテーブル作成部13は、決定された上記開始ビット位置から上記終了ビット位置までを対象として、上記二分木の一部のハッシュテーブルを作成する。
Although a detailed configuration will be described later, the binary
図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
図2に示す例では、破線枠A1内の3つの情報(011、101、111)に対する検索が、ハッシュテーブル化により高速化されることとなる。但し、この例とは異なり、ハッシュテーブル化する部分の情報が1つしかない(枝分かれが無い)場合には、元の二分木法でも比較検索処理が実行されないため、ハッシュテーブル化による効果は得られない。このため、かかる場合には、必ずしもハッシュテーブル化を行う必要は無い。反対に、ハッシュテーブル化する部分の枝分かれの数が多い程、ハッシュテーブル化により得られる高速化の効果は高くなる。 In the example shown in FIG. 2, the search for three pieces of information (011, 101, 111) within 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 illustrating 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
以下、図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
上記最短のルールの終了ビット位置以降については、パケット検索装置10は、当該位置から、その次に短いルールまで、ハッシュテーブルを作成する。図5に示す例では、破線枠A3に対応するハッシュテーブルが引き続き作成される(S2)。以降、同様の処理が繰り返し、実行される。
After the end bit position of the shortest rule, the
このとき、破線枠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 and 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 binary tree hash table conversion algorithm 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 the binary tree hash table conversion algorithm according to the present embodiment. As shown in FIG. 6, in (1), a binary tree configuration is created with the start node as a starting point, so 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 next (2), if a 0 or 1 node or both 0 and 1 nodes follow the start node or A of the binary tree, the bit position is set as the start bit position of the hash table, and 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. As a result, in the example shown in FIG. 6, four hash tables corresponding to the broken-line frames A6 to A9 are newly created.
なお、図6の(4)の様に、ハッシュテーブル化する部分に枝分かれが無い場合には、ハッシュテーブル化は行われない。これにより、高速化に寄与しない部分にまで、不要なハッシュ法が適用されることが抑制され、より効率的なパケット検索が可能となる。 As shown in (4) of FIG. 6, when there is no branch in the portion to be converted into a hash table, 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.
ハッシュテーブル化の評価に関し、二分木法による検索回数をlog2(N)(Nはルール数)とすると、図6に示す例では、ルール数(終端ノードの数)が19であるので、検索回数はlog2(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 broken lines 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 occurs. . Therefore, efficiency of packet search is realized.
以上説明した様に、パケット検索装置10は、二分木作成部11とビット位置決定部12とハッシュテーブル作成部13とを有する。二分木作成部11は、所定の枝分かれを有する二分木を作成する。ビット位置決定部12は、作成された上記二分木の一部に対するハッシュテーブル化の開始ビット位置と終了ビット位置とを決定する。ハッシュテーブル作成部13は、決定された上記開始ビット位置から上記終了ビット位置までを対象として、上記二分木の一部のハッシュテーブルを作成し、該一部にハッシュ法を適用する。ハッシュ法は、二分木法と比較して一般的に高速であるため、パケット検索装置10によれば、ハッシュ法を適用可能な範囲内で、パケット検索の高速化を図ることができる。
As described above, the
パケット検索装置10において、上記二分木は、ANY値、prefix、suffixのうち、少なくとも1つを含むものとしてもよい。また、パケット検索装置10において、二分木作成部11は、上記所定の枝分かれが上から0、1、ANY値の順になる様に、上記二分木を作成し、ビット位置決定部12は、上記二分木の開始点または上記ANY値の次に、0または1のノード、あるいは0と1の双方のノードが続く場合、そのビット位置を、上記開始ビット位置に決定すると共に、その後に別のANY値または終端点が現れた場合、該ANY値の手前または上記終端点のビット位置を、上記終了ビット位置に決定するものとしてもよい。
In the
換言すれば、ビット位置決定部12は、二分木内のANY値を回避しつつ、部分的なハッシュテーブル化の対象範囲が極力広くなる様に、二分木の構成に合わせて動的に、ハッシュテーブル化の開始ビット位置と終了ビット位置とを決定する。これにより、検索対象フィールドが固定化されていない場合(例えば、ルールにANYを許容する場合)にも、可能な限り、ハッシュ法の高速性を活かすことができる。
In other words, the bit
また、パケット検索装置10において、ビット位置決定部12は、上記ハッシュテーブル化の対象部分となる二分木の一部の枝分かれ数が、所定数(例えば、2)以下の場合には、上記二分木の一部を、上記ハッシュテーブル化の対象から除外して、そのまま二分木法を適用するものとしてもよい。
In the
なお、ビット位置決定部12は、二分木にハッシュテーブル化を適用する部分に同期する様に、パケットによりハッシュ値を求める、ルール側の対象フィールドも変更する。これにより、二分木において高速化を所望する部分を、正確かつ継続的に、ハッシュテーブル化の対象とすることができる。
Note that the bit
上述した様に、本実施例に係るパケット検索技術は、二分木法に対して、部分的にハッシュ法を適用することで、ルールのマッチフィールドが固定化されていない(例えば、マッチフィールドに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
メモリ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
ここで、図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
なお、パケット検索プログラムに係るプログラムモジュール108cやプログラムデータ108dは、ハードディスクドライブ108に記憶される場合に限られず、例えば着脱可能な記憶媒体に記憶され、ディスクドライブ109等を介してCPU102によって読み出されてもよい。あるいは、パケット検索プログラムに係るプログラムモジュール108cやプログラムデータ108dは、ネットワーク(LAN(Local Area Network)、WAN(Wide Area Network)等)を介して接続された他のコンピュータに記憶され、ネットワークインタフェース107を介してCPU102によって読み出されてもよい。
The
また、上述したパケット検索装置10の各構成要素は、必ずしも物理的に図示の如く構成されていることを要しない。すなわち、各装置の分散・統合の具体的態様は、図示のものに限らず、その全部又は一部を、各種の負荷や使用状況等に応じて、任意の単位で機能的又は物理的に分散・統合して構成することもできる。例えば、ビット位置決定部12とハッシュテーブル作成部13を1つの構成要素として統合してもよい。反対に、ビット位置決定部12に関し、ハッシュテーブル化の開始ビット位置と終了ビット位置とを決定する部分と、ルール側の対象フィールドを変更する部分とに分散してもよい。更に、二分木データ、ハッシュテーブルを格納するハードディスクドライブ108を、パケット検索装置10の外部装置として、ネットワークやケーブル経由で接続する様にしてもよい。
Further, each component of the above-described
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
101b RAM
102 CPU
103 hard
108b
Claims (6)
作成された前記二分木の一部に対するハッシュテーブル化の開始ビット位置と終了ビット位置とを決定する決定部と、
決定された前記開始ビット位置から前記終了ビット位置までを対象として、前記二分木の一部のハッシュテーブルを作成するテーブル作成部と
を有することを特徴とするパケット検索装置。 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.
前記決定部は、前記二分木の開始点または前記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.
所定の枝分かれを有する二分木を作成する二分木作成工程と、
作成された前記二分木の一部に対するハッシュテーブル化の開始ビット位置と終了ビット位置とを決定する決定工程と、
決定された前記開始ビット位置から前記終了ビット位置までを対象として、前記二分木の一部のハッシュテーブルを作成するテーブル作成工程と
を含むことを特徴とするパケット検索方法。 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.
作成された前記二分木の一部に対するハッシュテーブル化の開始ビット位置と終了ビット位置とを決定する決定ステップと、
決定された前記開始ビット位置から前記終了ビット位置までを対象として、前記二分木の一部のハッシュテーブルを作成するテーブル作成ステップと
をコンピュータに実行させるためのパケット検索プログラム。 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.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2018140701A JP2020017147A (en) | 2018-07-26 | 2018-07-26 | Packet search device, packet search method, and packet search program |
PCT/JP2019/028986 WO2020022374A1 (en) | 2018-07-26 | 2019-07-24 | Packet search device, packet search method, and packet search program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
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 |
---|---|
JP2020017147A true JP2020017147A (en) | 2020-01-30 |
Family
ID=69180791
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2018140701A Pending JP2020017147A (en) | 2018-07-26 | 2018-07-26 | Packet search device, packet search method, and packet search program |
Country Status (2)
Country | Link |
---|---|
JP (1) | JP2020017147A (en) |
WO (1) | WO2020022374A1 (en) |
Families Citing this family (1)
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 |
Family Cites Families (2)
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 |
-
2018
- 2018-07-26 JP JP2018140701A patent/JP2020017147A/en active Pending
-
2019
- 2019-07-24 WO PCT/JP2019/028986 patent/WO2020022374A1/en active Application Filing
Also Published As
Publication number | Publication date |
---|---|
WO2020022374A1 (en) | 2020-01-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Zhou et al. | High-performance packet classification on GPU | |
Wang et al. | Namefilter: Achieving fast name lookup with low memory cost via applying two-stage bloom filters | |
US8478707B1 (en) | System and method for reducing flow rules in forwarding tables | |
EP3276501B1 (en) | Traffic classification method and device, and storage medium | |
US20060221954A1 (en) | Methods for performing packet classification | |
US10164884B2 (en) | Search apparatus, search configuration method, and search method | |
Cho et al. | Fast reconfiguring deep packet filter for 1+ gigabit network | |
JP5960863B1 (en) | SEARCH DEVICE, SEARCH METHOD, PROGRAM, AND RECORDING MEDIUM | |
WO2016184029A1 (en) | Storage and lookup methods and apparatuses supporting hash lookup and routing lookup, and storage 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 | |
US20220109626A1 (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 | |
US20160301658A1 (en) | Method, apparatus, and computer-readable medium for efficient subnet identification | |
CN113726660B (en) | Route finder and method based on perfect hash algorithm | |
Vespa et al. | Swm: Simplified wu-manber for gpu-based deep packet inspection | |
Alimohammadi et al. | Clustering-based many-field packet classification in software-defined networking | |
JP6888234B2 (en) | Search device, search program, and search method | |
WO2021166087A1 (en) | Packet search device, packet search method, and packet search program | |
WO2019160164A1 (en) | Search device, search method, and search program | |
WO2021024392A1 (en) | Packet search device, packet search method, and packet search program |