JP5807676B2 - Packet classifier, packet classification method, and packet classification program - Google Patents

Packet classifier, packet classification method, and packet classification program Download PDF

Info

Publication number
JP5807676B2
JP5807676B2 JP2013514491A JP2013514491A JP5807676B2 JP 5807676 B2 JP5807676 B2 JP 5807676B2 JP 2013514491 A JP2013514491 A JP 2013514491A JP 2013514491 A JP2013514491 A JP 2013514491A JP 5807676 B2 JP5807676 B2 JP 5807676B2
Authority
JP
Japan
Prior art keywords
rule
entry
block
decision tree
processing
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.)
Expired - Fee Related
Application number
JP2013514491A
Other languages
Japanese (ja)
Other versions
JP2014504042A (en
Inventor
則夫 山垣
則夫 山垣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP2013514491A priority Critical patent/JP5807676B2/en
Publication of JP2014504042A publication Critical patent/JP2014504042A/en
Application granted granted Critical
Publication of JP5807676B2 publication Critical patent/JP5807676B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

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/748Address table lookup; Address filtering using longest matching prefix

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Description

本発明は、パケット分類(Packet Classification)に関する。   The present invention relates to packet classification.

パケット分類(Packet Classification)は、ネットワーク上のルータやスイッチにおいて、パケットをフローと呼ばれる一連の属性をもつパケット列に分類するための重要な技術である。パケット分類は、個々のフローに対するQoS(Quality of Service)の提供や、ファイヤウォール(Firewall)等のセキュリティといった、付加的な価値をもつネットワークアプリケーションの実現に重要な役割を果たす。   Packet classification is an important technique for classifying packets into packet sequences having a series of attributes called flows in routers and switches on the network. Packet classification plays an important role in the realization of network applications with added value, such as providing QoS (Quality of Service) for individual flows and security such as a firewall.

パケット分類では、パケットのヘッダに含まれている1つ以上のフィールドを用いて、「ルール(フィルタと呼ばれることもある)」が定義される。ルールは、例えば、パケットのIP(Internet Protocol)ヘッダに定義されている送信元IPアドレス、宛先IPアドレス、プロトコル番号に加え、TCP(Transmission Control Protocol)/UDP(User Datagram Protocol)ヘッダに定義されている送信ポート番号、宛先ポート番号といった複数のヘッダフィールドによって定義される。このようにルールが複数のヘッダフィールドを用いて定義されているパケット分類は、特に、Multi−Field Packet Classificationと呼ばれている。   In packet classification, a “rule (sometimes called a filter)” is defined using one or more fields included in the header of the packet. The rules are defined in, for example, a TCP (Transmission Control Protocol) / UDP (User Datagram Protocol) header in addition to a source IP address, a destination IP address, and a protocol number defined in an IP (Internet Protocol) header of the packet. Defined by a plurality of header fields such as a transmission port number and a destination port number. Packet classification in which a rule is defined using a plurality of header fields in this way is particularly called multi-field packet classification.

通常、このようなルールは複数個定義される。パケットが到着すると、そのパケットヘッダからルールの定義に用いられているフィールド値が抽出される。抽出されたフィールド値の組が複数個のルールと比較され、どのルールにマッチするか判定されることにより、パケットがフローに分類される。ここで、到着したパケットのヘッダから抽出されたフィールド値の組を「検索キー」と呼ぶ。また、一般的には、各ルールに対して、優先度(Priority)とアクション(Action)とが定義される。検索キーが複数個のルールのうち、2つ以上のルールにマッチする場合には、優先度がより高いルールが選択される。また、アクションには、そのルールにマッチした場合に到着パケットをどのように扱うか(例えば、廃棄する、1番のポートに送信する等)が定義される。   Usually, a plurality of such rules are defined. When the packet arrives, the field value used for defining the rule is extracted from the packet header. The set of extracted field values is compared with a plurality of rules, and a rule is matched to determine a rule, so that the packet is classified into a flow. Here, a set of field values extracted from the header of the arrived packet is called a “search key”. In general, a priority (Priority) and an action (Action) are defined for each rule. If the search key matches two or more rules among the plurality of rules, a rule with a higher priority is selected. The action defines how to handle an incoming packet when it matches the rule (for example, discard it and send it to the first port).

また、ルールにおける各フィールドに対しては、ある特定の値として定義されるExact Match、上位の複数ビットは特定されるが下位の数ビットはワイルドカード(wildcard)‘*’を用いて不定として定義されるPrefix Match、2つのある特定の値の範囲として定義するRange Match、個々のビット単位にワイルドカードを指定して定義されるWildcard Matchといった手法が用いられる。例えば、8bitのフィールドを考えた場合、“00110101”のように特定値として指定されるものがExact Match、“0011****”のように、“0011”の4bitから始まる値として指定されるものがPrefix Match、[3−64]のように8bitのフィールドが10進数で考えた際に3から64の範囲に入っていればよいとするものがRange Match、“0**10*01”のようにビット単位でワイルドカードが使用できるものがWildcard Matchである。   In addition, for each field in the rule, Exact Match defined as a specific value, a plurality of upper bits are specified, but a few lower bits are defined as undefined using a wildcard (*). Prefix Match, Range Match defined as a range of two specific values, and Wildcard Match defined by specifying a wild card for each bit unit are used. For example, when an 8-bit field is considered, a specified value such as “00110101” is specified as a value starting from 4 bits of “0011” such as Exact Match, “0011 ***”. The thing is Prefix Match, and the 8-bit field should be within the range of 3 to 64 when considered in decimal as in [3-64]. Range Match, “0 ** 10 * 01” A wildcard match is a wildcard that can be used in bit units.

このようなMulti−Field Packet Classification技術に関して、ルールセットの大容量化とリンク速度の向上により、高速なルータやスイッチにおいてこれをいかに高速に処理させるかが1つの技術的な課題となっている。現状、その高速処理を実現するためにTernary Content Addressable Memory(TCAM)を基にした手法が用いられることが多い。   With respect to such a multi-field packet classification technique, it is one technical problem how to process this in a high-speed router or switch by increasing the capacity of the rule set and improving the link speed. Currently, in order to realize the high-speed processing, a technique based on Tertiary Content Addressable Memory (TCAM) is often used.

しかしながら、TCAMはコストが高く、消費電力や回路規模も大きいといった問題が存在する。また、Range Matchを用いた場合には、そのルールをPrefix Matchを用いたルールに分割する必要があるため、ルール数が増加してしまうといった問題もある。   However, TCAM has problems such as high cost, large power consumption and circuit scale. In addition, when Range Match is used, there is a problem that the number of rules increases because the rule needs to be divided into rules using Prefix Match.

その一方で、TCAMの高コスト、高消費電力の問題を回避すべく、より低コスト、低消費電力なStatic Random Access Memory(SRAM)やDynamic Random Access Memory(DRAM)を用いた様々なMulti−Field Packet Classification手法が提案されている。   On the other hand, various multi-fields using static random access memory (SRAM) and dynamic random access memory (DRAM) with lower cost and lower power consumption to avoid the problem of high cost and high power consumption of TCAM. Packet classification methods have been proposed.

例えば、非特許文献1では、「決定木(Decision Tree)」を用いた手法が提案されている。決定木を用いた手法では、全てのルールに対してマッチングを行うのではなく、当該検索キーがマッチする可能性のある少数のルールに対してのみマッチングを行う。これにより、検索処理に要する時間が短縮される。決定木を用いた手法について図1〜図3を用いて簡単に説明する。   For example, Non-Patent Document 1 proposes a method using a “Decision Tree”. In the method using the decision tree, matching is not performed for all rules, but only for a small number of rules that can be matched by the search key. This reduces the time required for the search process. A method using a decision tree will be briefly described with reference to FIGS.

図1は、それぞれ4bit長である2つのフィールドX、Yを用いて定義されたR0からR15までの16個のルールからなるルールセットの例を示している。フィールドX、Yは、例えば、送信元IPアドレスや送信元ポート番号等、実際のパケットヘッダフィールドに相当する。尚、フィールドXは、2進数で表記されており、‘*’はワイルドカードを示している。また、フィールドYは、Range Matchで表記されており、“[a:b]”のa、bはそれぞれ下限値、上限値(10進数表記)を示している。尚、ここでは、各ルールに付与される優先度とアクションについては省略している。   FIG. 1 shows an example of a rule set consisting of 16 rules from R0 to R15 defined using two fields X and Y each having a length of 4 bits. The fields X and Y correspond to actual packet header fields such as a transmission source IP address and a transmission source port number. The field X is expressed in binary numbers, and '*' indicates a wild card. The field Y is represented by Range Match, and a and b of “[a: b]” represent a lower limit value and an upper limit value (decimal notation), respectively. Here, the priority and action assigned to each rule are omitted.

図2は、図1で示されたルールセットを、フィールドX、Yの2軸から成る2次元空間上で表している。尚、X軸、Y軸上の数はそれぞれ10進数で表記してある。決定木を用いた手法によれば、図2に示されるような多次元空間を複数の次元に着目して分割する。そして、分割領域内に存在するルール数がある閾値以下になるまで領域分割を繰り返すことにより、決定木が構築される。ここで、分割された領域で管理されるルール群を「ルールリスト」と呼ぶ。   FIG. 2 represents the rule set shown in FIG. 1 on a two-dimensional space composed of two axes of fields X and Y. Note that the numbers on the X-axis and the Y-axis are expressed in decimal numbers. According to the technique using a decision tree, a multidimensional space as shown in FIG. 2 is divided by paying attention to a plurality of dimensions. The decision tree is constructed by repeating the area division until the number of rules existing in the divided area is equal to or smaller than a threshold value. Here, the rule group managed in the divided area is referred to as a “rule list”.

図3は、図1で示されたルールセットに対して構築された決定木の一例を示している。尚、図3で示される決定木では、分割領域内のルール数の閾値は2に設定されている。図3に示されるように、まず、全空間がX方向とY方向のそれぞれに2分割される。つまり、全空間(X、Y)=([0:15]、[0:15])が、領域0([0:7]、[0:7])、領域1([0:7]、[8:15])、領域2([8:15]、[0:7])、及び領域3([8:15]、[8:15])の4つの領域に分割される。また、それぞれの領域で管理されるルールリストは、[R7、R8、R9、R11](領域0)、[R0、R6、R9、R10、R11、R12](領域1)、[R1、R2、R3、R4、R5、R13、R14](領域2)、[R10、R14、R15](領域3)となる。各領域には、まだ閾値である2よりも多いルールが管理されているため、それぞれの領域について、閾値以下のルール数になるまでさらに領域分割を行う。図3に示される例では、全空間は最終的に24の領域に分割されている。なお、決定木を構築するアルゴリズムについては、非特許文献1や非特許文献2に記載されているため、ここでは省略する。   FIG. 3 shows an example of a decision tree constructed for the rule set shown in FIG. In the decision tree shown in FIG. 3, the threshold value of the number of rules in the divided area is set to 2. As shown in FIG. 3, first, the entire space is divided into two parts in the X direction and the Y direction, respectively. That is, the entire space (X, Y) = ([0:15], [0:15]) is the region 0 ([0: 7], [0: 7]), region 1 ([0: 7], [8:15]), region 2 ([8:15], [0: 7]), and region 3 ([8:15], [8:15]). The rule list managed in each area is [R7, R8, R9, R11] (area 0), [R0, R6, R9, R10, R11, R12] (area 1), [R1, R2, R3, R4, R5, R13, R14] (region 2) and [R10, R14, R15] (region 3). Since more rules than the threshold value 2 are still managed in each region, further region division is performed until the number of rules is equal to or less than the threshold value for each region. In the example shown in FIG. 3, the entire space is finally divided into 24 regions. Note that the algorithm for constructing a decision tree is described in Non-Patent Document 1 and Non-Patent Document 2, and is omitted here.

パケット分類を行う場合には、検索キーを参照しながら決定木を辿っていき、辿り着いた葉ノードで管理されている閾値数以下のルールの全てに対してマッチングが行われる。例として、検索キーがX=0111、Y=1001となるパケットに対するパケット分類を考える。図3に示される決定木では、根ノードにおいて全空間が上記4つの領域に分割されており、当該パケットは、それら4つの領域のうち、領域1([0:7]、[8:15])に属することが分かる。続いて、領域1のノードでは、更に、空間がX方向とY方向のそれぞれに2分割されている。つまり、領域1が、領域10([0:3]、[8:11])、領域11([0:3]、[12:15])、領域12([4:7]、[8:11])、及び領域13([4:7]、[12:15])に4分割されている。当該パケットは、このうち領域12に属することが分かる。更にその領域12は4分割されており、当該パケットは、領域122([6:7]、[8:9])に属することが分かる。そして、その領域122で管理されている2つのルールR9、R10に対してマッチングが実施され、マッチしたルールが選択される。尚、本例では、当該パケットがルールR9、R10の両方にマッチするため、図3では省略している各ルールに付与された優先度に応じて、ルールが選択される。   When packet classification is performed, the decision tree is traced while referring to the search key, and matching is performed for all rules that are equal to or less than the threshold number managed by the arrived leaf node. As an example, consider packet classification for packets with search keys X = 0111 and Y = 1001. In the decision tree shown in FIG. 3, the entire space is divided into the above four regions at the root node, and the packet is divided into region 1 ([0: 7], [8:15] among these four regions). ). Subsequently, at the node in the region 1, the space is further divided into two parts in the X direction and the Y direction. That is, region 1 is region 10 ([0: 3], [8:11]), region 11 ([0: 3], [12:15]), region 12 ([4: 7], [8: 11]) and area 13 ([4: 7], [12:15]). It can be seen that the packet belongs to the region 12 among them. Further, the area 12 is divided into four, and it can be seen that the packet belongs to the area 122 ([6: 7], [8: 9]). Then, matching is performed on the two rules R9 and R10 managed in the area 122, and the matched rule is selected. In this example, since the packet matches both the rules R9 and R10, the rule is selected according to the priority assigned to each rule omitted in FIG.

以上に説明されたような決定木を用いた手法によれば、領域分割の結果、同じルールが複数の分割領域で管理される可能性があり、これは以下「ルールの複製」と参照される。例えば図3では、R7やR9等のルールが複製されている。ルールの複製が発生した場合、複製されたルールそのもの、あるいは、複製されたルールに対するアドレス値を管理するためのメモリ容量が増加し、見た目上、実際のルールセットよりも多くのルールを扱うことになる。つまり、ルールの複製は、決定木におけるデータ量の増加を招く。ルールの複製を抑制するための技術として、次のものが知られている。   According to the method using the decision tree as described above, the same rule may be managed in a plurality of divided areas as a result of area division, which is hereinafter referred to as “replication of rules”. . For example, in FIG. 3, rules such as R7 and R9 are duplicated. When rule duplication occurs, the memory capacity for managing the duplicate rule itself or the address value for the duplicate rule increases, and it seems to handle more rules than the actual rule set. Become. That is, rule duplication causes an increase in the amount of data in the decision tree. The following are known techniques for suppressing rule duplication.

非特許文献1によれば、葉ノードではないノードもルールリストを持つ。そして、領域分割の結果、全ての子ノード(分割領域)に同一のルールが複製されてしまう場合には、複製されるルールが当該ノードのルールリストで管理される。しかしながら、この手法では、全てではない複数の子ノードへのルールの複製を防止することはできない。   According to Non-Patent Document 1, nodes that are not leaf nodes also have a rule list. If the same rule is duplicated in all child nodes (divided areas) as a result of area division, the duplicated rules are managed in the rule list of the node. However, this method cannot prevent replication of rules to a plurality of child nodes that are not all.

非特許文献2では、決定木を用いたパケット分類手法を、パイプライン処理を用いたハードウェアによって高速に処理させるハードウェアアーキテクチャが提案されている。本方式においても、葉ノードではないノードも同様にルールリストを持つ。そして、領域分割の結果、同一のルールが複数の子ノードに複製されてしまう場合には、複製されるルールが当該ノードのルールリストで管理される。しかしながら、単一ノードにおいて複製されるルールの数がルールリストで管理可能なルール数以上となる場合には、ルールの複製が発生してしまう。   Non-Patent Document 2 proposes a hardware architecture that allows a packet classification method using a decision tree to be processed at high speed by hardware using pipeline processing. In this method, nodes that are not leaf nodes also have rule lists. When the same rule is duplicated to a plurality of child nodes as a result of area division, the duplicated rule is managed in the rule list of the node. However, if the number of rules replicated in a single node exceeds the number of rules that can be managed in the rule list, rule replication occurs.

非特許文献3では、非特許文献2と同様に、ハードウェアがパイプライン処理を用いてパケット分類を実施する方式が提案されている。但し、非特許文献1や非特許文献2の場合とは異なり、決定木では葉ノードのみがルールを管理する。本方式によれば、複数の決定木が用意され、ルールの複製が発生しないいずれかの決定木が当該ルールを管理する。これにより、ルールの複製が防止される。   In Non-Patent Document 3, as in Non-Patent Document 2, a method in which hardware performs packet classification using pipeline processing is proposed. However, unlike the cases of Non-Patent Document 1 and Non-Patent Document 2, only the leaf nodes manage rules in the decision tree. According to this method, a plurality of decision trees are prepared, and any one of the decision trees that does not cause replication of rules manages the rules. This prevents rule duplication.

Sumeet Singh、Florin Baboescu、George Varghese、Jia Wang、“Packet Classification Using Multidimensional Cutting”、Proceedings of the ACM SIGCOMM 2003 Conference on Applications、Technologies、Architectures、and Protocols for Computer Communications、2003年、pp.213−224Sumeet Singh, Florin Baboescu, George Varghese, Jia Wang, "Packet Classification Using Multidimensional Cutting", Proceedings of the ACM SIGCOMM 2003 Conference on Applications, Technologies, Architectures, and Protocols for Computer Communications, 2003 years, pp. 213-224 Weirong Jiang、 Viktor K. Prasanna、“Large−Scale Wire−Speed Packet Classification on FPGAs”、Proceedings of the ACM/SIGDA International Symposium on Field Programmable Gate Arrays、2009年、pp.219−228Weilong Jiang, Victor K. Prasanna, “Large-Scale Wire-Speed Packet Classification on FPGAs”, Processeds of the ACM / SIGDA International Symposium on Field Program. 219-228 Weirong Jiang、 Viktor K. Prasanna、Norio Yamagaki、“Decision Forest: A Scalable Architecture for Flexible Flow Matching on FPGA”、Proceedings of 2010 International Conference on Field Programmable Logic and Application、2010年、pp.394−399Weilong Jiang, Victor K. Prasanna, Norio Yamagaki, “Decision Forest: A Scalable Architecture for Flexible Principal Matching on FPGA”, Proceedings of 2010, International Contest. 394-399

決定木を用いたパケット分類では、その決定木に対して新たなルールを追加したり、その決定木から既存ルールを削除したりすることも重要である。そのようなルールの追加/削除処理は、以下、「エントリの動的更新」と参照される。   In packet classification using a decision tree, it is also important to add a new rule to the decision tree or delete an existing rule from the decision tree. Such rule addition / deletion processing is hereinafter referred to as “dynamic update of an entry”.

非特許文献3では、エントリの動的更新を行うための具体的な手順については述べられていない。従って、どの決定木のどのノードにおけるルールを更新するのか、あらかじめ決定しておく必要があると考えられる。すなわち、エントリの動的更新を行うために、「前処理」が別途必要になるという問題がある。特に、非特許文献3では、予め与えられたルールセットに対して最適な決定木を構成することを前提としているため、最悪の場合には、決定木の構成自体を全て変更する必要があると考えられる。そのような場合には、エントリの動的更新の前処理に必要な時間と、エントリ更新に必要な時間が共に増大してしまうという問題がある。   Non-Patent Document 3 does not describe a specific procedure for dynamically updating entries. Therefore, it is considered necessary to determine in advance which rule in which decision tree the rule is to be updated. That is, there is a problem that “preprocessing” is separately required to dynamically update an entry. In particular, in Non-Patent Document 3, it is assumed that an optimal decision tree is configured for a rule set given in advance. Therefore, in the worst case, it is necessary to change all of the configuration of the decision tree itself. Conceivable. In such a case, there is a problem that both the time required for the pre-processing of dynamic entry update and the time required for entry update increase.

本発明の1つの目的は、決定木を用いたパケット分類において、前処理を行うことなく、エントリの動的更新を実現することができる技術を提供することにある。   One object of the present invention is to provide a technique capable of realizing dynamic update of an entry without performing preprocessing in packet classification using a decision tree.

本発明の1つの観点において、パケット分類器が提供される。そのパケット分類器は、パケット分類に用いられる複数の決定木のそれぞれを構成する複数の決定木処理ブロックと、複数の決定木処理ブロックに対してコマンドを一斉に入力するコマンド入力ブロックと、複数の決定木処理ブロックに接続されたエントリ追加対象決定ブロックと、を備える。1つのルールは、複数の決定木のうちいずれか1つの決定木における単一の葉ノードによって管理される。コマンドが検索コマンドである場合、複数の決定木処理ブロックの各々は、自身の決定木を用いることによって、検索キーがいずれかのルールにマッチするか否かを判定する。コマンドが新たなルールを決定木に追加するための挿入コマンドである場合、複数の決定木処理ブロックの各々は、新たなルールが自身の決定木における単一の葉ノードによって管理され得るかどうかを判定する。新たなルールが単一の葉ノードによって管理され得る場合、当該決定木処理ブロックはエントリ追加対象候補であり、当該単一の葉ノードは追加対象葉ノードである。この場合、エントリ追加対象決定ブロックは、新たなルールを追加する対象であるエントリ追加対象を、エントリ追加対象候補の中から選択する。そして、選択されたエントリ追加対象は、新たなルールを、自身の決定木における追加対象葉ノードが管理するルールリストに追加する。   In one aspect of the invention, a packet classifier is provided. The packet classifier includes a plurality of decision tree processing blocks constituting each of a plurality of decision trees used for packet classification, a command input block for simultaneously inputting commands to the plurality of decision tree processing blocks, An entry addition target decision block connected to the decision tree processing block. One rule is managed by a single leaf node in any one of a plurality of decision trees. When the command is a search command, each of the plurality of decision tree processing blocks determines whether or not the search key matches any rule by using its own decision tree. If the command is an insert command to add a new rule to the decision tree, each of the multiple decision tree processing blocks determines whether the new rule can be managed by a single leaf node in its decision tree. judge. When a new rule can be managed by a single leaf node, the decision tree processing block is an entry addition target candidate, and the single leaf node is an addition target leaf node. In this case, the entry addition target determination block selects an entry addition target to which a new rule is to be added from among the entry addition target candidates. The selected entry addition target adds a new rule to the rule list managed by the addition target leaf node in its own decision tree.

本発明の他の観点において、複数の決定木を用いたパケット分類方法が提供される。1つのルールは、複数の決定木のうちいずれか1つの決定木における単一の葉ノードによって管理される。本発明に係るパケット分類方法は、(A)複数の決定木に対してコマンドを一斉に入力するステップと、(B)コマンドが検索コマンドである場合、複数の決定木の各々において、検索キーがいずれかのルールにマッチするか否かを判定するステップと、(C)コマンドが新たなルールを決定木に追加するための挿入コマンドである場合、複数の決定木の各々において、新たなルールが単一の葉ノードによって管理され得るかどうかを判定するステップと、ここで、新たなルールが単一の葉ノードによって管理され得る場合、当該決定木はエントリ追加対象候補であり、当該単一の葉ノードは追加対象葉ノードであり、(D)新たなルールを追加する対象であるエントリ追加対象を、エントリ追加対象候補の中から選択するステップと、(E)新たなルールを、エントリ追加対象の追加対象葉ノードが管理するルールリストに追加するステップと、を含む。   In another aspect of the present invention, a packet classification method using a plurality of decision trees is provided. One rule is managed by a single leaf node in any one of a plurality of decision trees. In the packet classification method according to the present invention, (A) a step of inputting commands to a plurality of decision trees all at once, and (B) when the command is a search command, a search key is set in each of the plurality of decision trees. A step of determining whether or not any of the rules is matched; and (C) when the command is an insertion command for adding a new rule to the decision tree, the new rule is determined in each of the plurality of decision trees. Determining whether it can be managed by a single leaf node, and if the new rule can be managed by a single leaf node, then the decision tree is a candidate for entry addition, The leaf node is an addition target leaf node, and (D) selecting an entry addition target to which a new rule is to be added from among entry addition target candidates; The new rules, including the steps of adding to the rule list addition target leaf nodes entry additional object is managed, a.

本発明の更に他の観点において、複数の決定木を用いたパケット分類処理をコンピュータに実行させるためのパケット分類プログラムが提供される。1つのルールは、複数の決定木のうちいずれか1つの決定木における単一の葉ノードによって管理される。本発明に係るパケット分類処理は、(A)複数の決定木に対してコマンドを一斉に入力するステップと、(B)コマンドが検索コマンドである場合、複数の決定木の各々において、検索キーがいずれかのルールにマッチするか否かを判定するステップと、(C)コマンドが新たなルールを決定木に追加するための挿入コマンドである場合、複数の決定木の各々において、新たなルールが単一の葉ノードによって管理され得るかどうかを判定するステップと、ここで、新たなルールが単一の葉ノードによって管理され得る場合、当該決定木はエントリ追加対象候補であり、当該単一の葉ノードは追加対象葉ノードであり、(D)新たなルールを追加する対象であるエントリ追加対象を、エントリ追加対象候補の中から選択するステップと、(E)新たなルールを、エントリ追加対象の追加対象葉ノードが管理するルールリストに追加するステップと、を含む。   In still another aspect of the present invention, a packet classification program for causing a computer to execute packet classification processing using a plurality of decision trees is provided. One rule is managed by a single leaf node in any one of a plurality of decision trees. The packet classification processing according to the present invention includes (A) a step of inputting commands to a plurality of decision trees all at once, and (B) when the command is a search command, a search key is set in each of the plurality of decision trees. A step of determining whether or not any of the rules is matched; and (C) when the command is an insertion command for adding a new rule to the decision tree, the new rule is determined in each of the plurality of decision trees. Determining whether it can be managed by a single leaf node, and if the new rule can be managed by a single leaf node, then the decision tree is a candidate for entry addition, The leaf node is an addition target leaf node, and (D) selecting an entry addition target to which a new rule is to be added from among entry addition target candidates; The new rules, including the steps of adding to the rule list addition target leaf nodes entry additional object is managed, a.

本発明によれば、決定木を用いたパケット分類において、前処理を行うことなく、エントリの動的更新を実現することが可能となる。   According to the present invention, in packet classification using a decision tree, it is possible to realize dynamic update of an entry without performing preprocessing.

図1は、ルールセットの一例を示す概念図である。FIG. 1 is a conceptual diagram illustrating an example of a rule set. 図2は、図1で示されたルールセットがフィールドX、Yの2軸から成る2次元空間上に配置された場合を示す概念図である。FIG. 2 is a conceptual diagram showing a case where the rule set shown in FIG. 1 is arranged in a two-dimensional space consisting of two axes of fields X and Y. 図3は、図1で示されたルールセットに対する決定木の一例を示す概念図である。FIG. 3 is a conceptual diagram showing an example of a decision tree for the rule set shown in FIG. 図4は、本発明の第1の実施の形態に係るパケット分類器の構成を示すブロック図である。FIG. 4 is a block diagram showing the configuration of the packet classifier according to the first embodiment of the present invention. 図5は、第1の実施の形態に係るパケット分類器の各決定木処理ブロックの構成を示すブロック図である。FIG. 5 is a block diagram illustrating a configuration of each decision tree processing block of the packet classifier according to the first embodiment. 図6は、第1の実施の形態における決定木ノード処理ブロックと決定木の各ノードとの対応関係を示す概念図である。FIG. 6 is a conceptual diagram showing a correspondence relationship between the decision tree node processing block and each node of the decision tree in the first embodiment. 図7は、第1の実施の形態に係る決定木処理ブロックの決定木ノード処理ブロックの構成を示すブロック図である。FIG. 7 is a block diagram illustrating a configuration of a decision tree node processing block of the decision tree processing block according to the first embodiment. 図8は、第1の実施の形態に係る決定木処理ブロックのエントリ数カウントブロックの構成を示すブロック図である。FIG. 8 is a block diagram showing the configuration of the entry count block of the decision tree processing block according to the first embodiment. 図9は、第1の実施の形態におけるルール処理ブロックと決定木の各葉ノードのルールリストに含まれるルールとの対応関係を示す概念図である。FIG. 9 is a conceptual diagram illustrating a correspondence relationship between the rule processing block and the rules included in the rule list of each leaf node of the decision tree according to the first embodiment. 図10は、第1の実施の形態に係る決定木処理ブロックのルール処理ブロックの構成を示すブロック図である。FIG. 10 is a block diagram illustrating a configuration of a rule processing block of the decision tree processing block according to the first embodiment. 図11は、第1の実施の形態におけるLOOKUP処理を示すフローチャートである。FIG. 11 is a flowchart showing the LOOKUP process in the first embodiment. 図12は、第1の実施の形態におけるコマンドの構成例を示す概念図である。FIG. 12 is a conceptual diagram illustrating a configuration example of a command according to the first embodiment. 図13は、ステップA2の処理を示すフローチャートである。FIG. 13 is a flowchart showing the process of step A2. 図14は、第1の実施の形態におけるノード情報の構成例を示す概念図である。FIG. 14 is a conceptual diagram illustrating a configuration example of node information according to the first embodiment. 図15は、第1の実施の形態におけるアドレス算出方法を説明するための図である。FIG. 15 is a diagram for explaining an address calculation method according to the first embodiment. 図16は、ステップA4の処理を示すフローチャートである。FIG. 16 is a flowchart showing the process of step A4. 図17は、第1の実施の形態におけるエントリ情報の構成例を示す概念図である。FIG. 17 is a conceptual diagram illustrating a configuration example of entry information in the first embodiment. 図18は、第1の実施の形態におけるINSERT処理を示すフローチャートである。FIG. 18 is a flowchart illustrating the INSERT processing according to the first embodiment. 図19は、ステップA6の処理を示すフローチャートである。FIG. 19 is a flowchart showing the process of step A6. 図20は、ステップA9の処理を示すフローチャートである。FIG. 20 is a flowchart showing the process of step A9. 図21は、ステップA12の処理を示すフローチャートである。FIG. 21 is a flowchart showing the process of step A12. 図22は、第1の実施の形態におけるDELETE処理を示すフローチャートである。FIG. 22 is a flowchart illustrating the DELETE process in the first embodiment. 図23は、ステップA14の処理を示すフローチャートである。FIG. 23 is a flowchart showing the process of step A14. 図24は、本発明の第2の実施の形態に係るパケット分類器の構成を示すブロック図である。FIG. 24 is a block diagram showing a configuration of a packet classifier according to the second embodiment of the present invention. 図25は、第2の実施の形態に係るパケット分類器の決定木処理ブロックの構成を示すブロック図である。FIG. 25 is a block diagram illustrating a configuration of a decision tree processing block of the packet classifier according to the second embodiment. 図26は、第2の実施の形態におけるINSERT処理を示すフローチャートである。FIG. 26 is a flowchart illustrating the INSERT processing according to the second embodiment. 図27は、ステップA18の処理を示すフローチャートである。FIG. 27 is a flowchart showing the process of step A18. 図28は、第2の実施の形態におけるDELETE処理を示すフローチャートである。FIG. 28 is a flowchart illustrating a DELETE process according to the second embodiment. 図29は、本発明の第3の実施の形態におけるコマンドの構成例を示す概念図である。FIG. 29 is a conceptual diagram showing a command configuration example according to the third embodiment of the present invention. 図30は、第3の実施の形態におけるINSERT処理を示すフローチャートである。FIG. 30 is a flowchart showing the INSERT processing according to the third embodiment. 図31は、ステップA19の処理を示すフローチャートである。FIG. 31 is a flowchart showing the process of step A19. 図32は、ステップA20の処理を示すフローチャートである。FIG. 32 is a flowchart showing the process of step A20. 図33は、本発明の第4の実施の形態に係るパケット分類器の構成を示すブロック図である。FIG. 33 is a block diagram showing a configuration of a packet classifier according to the fourth exemplary embodiment of the present invention.

添付図面を参照して、本発明の実施の形態を説明する。   Embodiments of the present invention will be described with reference to the accompanying drawings.

1.第1の実施の形態
1−1.概要
図4は、本発明の第1の実施の形態に係るパケット分類器1の構成を示すブロック図である。パケット分類器1は、決定木を用いることによりパケット分類を行う。つまり、パケット分類器1は、パケットヘッダから抽出された検索キーがどのルールにマッチするかを、決定木を用いることにより判定する。更に、本実施の形態に係るパケット分類器1は、入力コマンドに応じて、エントリの動的更新(新規ルールの追加、既存ルールの削除)を自動的に行う。
1. 1. First embodiment 1-1. Overview FIG. 4 is a block diagram showing a configuration of the packet classifier 1 according to the first exemplary embodiment of the present invention. The packet classifier 1 performs packet classification by using a decision tree. That is, the packet classifier 1 determines which rule the search key extracted from the packet header matches by using the decision tree. Furthermore, the packet classifier 1 according to the present embodiment automatically performs dynamic update of entries (addition of new rules, deletion of existing rules) according to input commands.

本実施の形態において、パケット分類器1は、ハードウェア回路により実現される。より詳細には、図4に示されるように、パケット分類器1は、1個以上の複数の決定木処理ブロック2(2−1〜2−N:Nは2以上の整数)、エントリ追加対象決定ブロック3、コマンド入力ブロック4、及び結果出力ブロック5を備えている。また、パケット分類器1には入力データ6が入力され、パケット分類器1からは出力データ7が出力される。   In the present embodiment, the packet classifier 1 is realized by a hardware circuit. More specifically, as shown in FIG. 4, the packet classifier 1 includes one or more decision tree processing blocks 2 (2-1 to 2-N: N is an integer of 2 or more), entry addition target A decision block 3, a command input block 4, and a result output block 5 are provided. Further, input data 6 is input to the packet classifier 1, and output data 7 is output from the packet classifier 1.

入力データ6は、パケット分類器1が実行すべき処理に依存する。パケット分類器1が実行する処理としては、(1)検索キーにマッチするルールを検索する処理(以下、「LOOKUP処理」と参照される)、(2)新規ルール(新規エントリ)を決定木に追加する処理(以下、「INSERT処理」と参照される)、及び(3)既存ルール(既存エントリ)を無効化する処理(以下、「DELETE処理」と参照される)、(4)パケット分類器1に含まれるメモリや設定レジスタ等へ予め設定値を書き込むConfiguration処理、が挙げられる。ここで、Configuration処理は初期化時に行われ、パケット分類器1に含まれる各ブロック内に備えられた設定レジスタやメモリへ構成に関わる値を設定することである。以下では、LOOKUP処理、INSERT処理、DELETE処理に関してのみ説明する。入力データ6は、処理種別を示す種別データと、当該処理で用いられるデータとを含む。LOOKUP処理の場合、入力データ6は、LOOKUP処理を示す種別データと、検索キーとを含む。INSERT処理の場合、入力データ6は、INSERT処理を示す種別データと、追加すべき新規ルールとを含む。DELETE処理の場合、入力データ6は、DELETE処理を示す種別データと、無効化すべき既存ルールとを含む。   The input data 6 depends on the process to be executed by the packet classifier 1. The processing executed by the packet classifier 1 includes (1) processing for searching for a rule matching the search key (hereinafter referred to as “LOOKUP processing”), and (2) new rule (new entry) as a decision tree. Processing to be added (hereinafter referred to as “INSERT processing”), (3) Processing to invalidate existing rules (existing entries) (hereinafter referred to as “DELETE processing”), (4) Packet classifier 1 is a configuration process in which a setting value is written in advance in a memory, a setting register, or the like included in 1. Here, the configuration process is performed at the time of initialization, and is to set a value related to the configuration in a setting register or a memory provided in each block included in the packet classifier 1. Only the LOOKUP process, the INSERT process, and the DELETE process will be described below. The input data 6 includes type data indicating a processing type and data used in the processing. In the case of the LOOKUP process, the input data 6 includes type data indicating the LOOKUP process and a search key. In the case of the INSERT process, the input data 6 includes type data indicating the INSERT process and a new rule to be added. In the case of the DELETE process, the input data 6 includes type data indicating the DELETE process and an existing rule to be invalidated.

コマンド入力ブロック4は、入力データ6を受け取り、その入力データ6に応じたコマンドを作成する。入力データ6の場合と同様に、コマンドは、処理種別を示す種別データと、当該処理で用いられるデータとを含む。LOOKUP処理の実行を指示する検索コマンドは、LOOKUP処理を示す種別データと、検索キーとを含む。INSERT処理の実行を指示する挿入コマンドは、INSERT処理を示す種別データと、追加すべき新規ルールとを含む。DELETE処理の実行を指示する削除コマンドは、DELETE処理を示す種別データと、無効化すべき既存ルールとを含む。コマンド入力ブロック4は、生成したコマンドを、複数の決定木処理ブロック2−1〜2−Nに対して一斉に入力する。   The command input block 4 receives the input data 6 and creates a command corresponding to the input data 6. As in the case of the input data 6, the command includes type data indicating the type of processing and data used in the processing. The search command for instructing execution of the LOOKUP process includes type data indicating the LOOKUP process and a search key. The insertion command for instructing execution of the INSERT process includes type data indicating the INSERT process and a new rule to be added. The delete command for instructing execution of the DELETE process includes type data indicating the DELETE process and an existing rule to be invalidated. The command input block 4 inputs the generated commands all at once to the plurality of decision tree processing blocks 2-1 to 2-N.

複数の決定木処理ブロック2−1〜2−Nのそれぞれは、パケット分類に用いられる複数の決定木を構成する。ここで、複数の決定木は、非特許文献3に記載されている手法と同様に、ルールの複製が生じないように構成される。つまり、各ルールは、当該ルールの複製が生じない決定木において管理される。言い換えれば、1つのルールは、複数の決定木のうちいずれか1つの決定木における単一の葉ノードでのみ管理される。各決定木処理ブロック2は、コマンド入力ブロック4から入力されたコマンドに応じて、LOOKUP処理、INSERT処理、あるいはDELETE処理を実行する。尚、複数の決定木処理ブロック2−1〜2−Nは、同時並列に各処理を実行することができる。   Each of the plurality of decision tree processing blocks 2-1 to 2-N constitutes a plurality of decision trees used for packet classification. Here, the plurality of decision trees are configured so that rule duplication does not occur as in the method described in Non-Patent Document 3. That is, each rule is managed in a decision tree where no duplication of the rule occurs. In other words, one rule is managed only by a single leaf node in any one of a plurality of decision trees. Each decision tree processing block 2 executes a LOOKUP process, an INSERT process, or a DELETE process according to the command input from the command input block 4. The plurality of decision tree processing blocks 2-1 to 2-N can execute each process in parallel.

<LOOKUP処理>
複数の決定木処理ブロック2−1〜2−Nは、検索コマンドに応じて、LOOKUP処理を同時並列に実行する。具体的には、各決定木処理ブロック2は、自身の決定木を用いることによって、検索キーがいずれかの葉ノードで管理されているいずれかのルールにマッチするか否かを判定する。検索キーにマッチするルールが存在する場合、当該決定木処理ブロック2は、当該マッチルールを結果出力ブロック5に通知する。検索キーが当該葉ノードにおけるルールリストに含まれるルールの複数にマッチする場合、当該決定木処理ブロック2は、複数のマッチルールのうち最も優先度の高いルールを結果出力ブロック5に通知する。一方、検索キーにマッチするルールが存在しない場合、当該決定木処理ブロック2は、マッチルールが存在しなかったことを結果出力ブロック5に通知する。結果出力ブロック5は、複数の決定木処理ブロック2−1〜2−Nから検索結果を受け取り、最も優先度の高いマッチルールを選択する。そして、結果出力ブロック5は、その選択結果を示す出力データ7を、LOOKUP処理の最終結果として出力する。
<LOOKUP processing>
The plurality of decision tree processing blocks 2-1 to 2-N execute the LOOKUP processing simultaneously and in parallel according to the search command. Specifically, each decision tree processing block 2 uses its own decision tree to determine whether the search key matches any rule managed by any leaf node. If there is a rule that matches the search key, the decision tree processing block 2 notifies the result output block 5 of the match rule. When the search key matches a plurality of rules included in the rule list in the leaf node, the decision tree processing block 2 notifies the result output block 5 of the highest priority rule among the plurality of match rules. On the other hand, if there is no rule that matches the search key, the decision tree processing block 2 notifies the result output block 5 that there is no match rule. The result output block 5 receives the search results from the plurality of decision tree processing blocks 2-1 to 2-N, and selects the match rule with the highest priority. Then, the result output block 5 outputs the output data 7 indicating the selection result as the final result of the LOOKUP process.

<INSERT処理>
複数の決定木処理ブロック2−1〜2−Nは、挿入コマンドに応じて、INSERT処理を同時並列に実行する。具体的には、まず、各決定木処理ブロック2は、新規ルールを自身の決定木に追加してもルールの複製が発生しないかどうか判定する。言い換えれば、各決定木処理ブロック2は、新規ルールが自身の決定木における単一の葉ノードによってのみ管理され得るかどうかを判定する。ルールの複製が発生してしまう場合、当該決定木処理ブロック2は、新規ルールの追加対象とはならない。一方、ルールの複製が発生しない場合、すなわち、新規ルールが自身の決定木における単一の葉ノードによってのみ管理され得る場合、当該決定木処理ブロック2は「エントリ追加対象候補」となり、当該単一の葉ノードは「追加対象葉ノード」となる。
<INSERT processing>
The plurality of decision tree processing blocks 2-1 to 2-N execute the INSERT processing simultaneously and in parallel according to the insertion command. Specifically, each decision tree processing block 2 first determines whether or not duplication of rules will occur even if a new rule is added to its own decision tree. In other words, each decision tree processing block 2 determines whether the new rule can be managed only by a single leaf node in its decision tree. When rule duplication occurs, the decision tree processing block 2 is not a target for adding a new rule. On the other hand, when rule duplication does not occur, that is, when a new rule can be managed only by a single leaf node in its own decision tree, the decision tree processing block 2 becomes an “entry addition target candidate” The leaf node is “addition target leaf node”.

新規ルールが追加される対象である決定木処理ブロック2は、「エントリ追加対象」である。エントリ追加対象は、上記エントリ追加対象候補の中から選ばれる。そのエントリ追加対象を選ぶのが、エントリ追加対象決定ブロック3である。図4に示されるように、このエントリ追加対象決定ブロック3は、複数の決定木処理ブロック2−1〜2−Nの各々に接続されている。そして、エントリ追加対象決定ブロック3は、複数の決定木処理ブロック2−1〜2−Nから通知される情報に基づいて、エントリ追加対象候補を認識し、エントリ追加対象候補の中からエントリ追加対象を選択する。   The decision tree processing block 2 to which new rules are added is “entry addition target”. The entry addition target is selected from the entry addition target candidates. The entry addition target determination block 3 selects the entry addition target. As shown in FIG. 4, the entry addition target determination block 3 is connected to each of a plurality of decision tree processing blocks 2-1 to 2-N. Then, the entry addition target determination block 3 recognizes the entry addition target candidate based on information notified from the plurality of decision tree processing blocks 2-1 to 2-N, and selects the entry addition target from the entry addition target candidates. Select.

例えば、各エントリ追加対象候補は、追加対象葉ノードが管理している有効なルールのエントリ数を、エントリ追加対象決定ブロック3に通知する。そして、エントリ追加対象決定ブロック3は、各エントリ追加対象候補から受け取った有効エントリ数を参照し、所定のポリシーに従って、エントリ追加対象を選択する。例えば、エントリ追加対象決定ブロック3は、当該有効エントリ数が最小であるエントリ追加対象候補を、エントリ追加対象として選択する。この場合、複数の決定木間でのルール数の偏りが抑えられ、好適である。   For example, each entry addition target candidate notifies the entry addition target determination block 3 of the number of valid rule entries managed by the addition target leaf node. Then, the entry addition target determination block 3 refers to the number of valid entries received from each entry addition target candidate, and selects an entry addition target according to a predetermined policy. For example, the entry addition target determination block 3 selects the entry addition target candidate having the minimum number of valid entries as the entry addition target. In this case, the deviation of the number of rules among a plurality of decision trees is suppressed, which is preferable.

エントリ追加対象決定ブロック3は、エントリ追加対象の選択結果を各決定木処理ブロック2に通知する。例えば、エントリ追加対象決定ブロック3は、エントリ追加対象に対して新規ルールの追加を指示し、それ以外の決定木処理ブロック2に対してルール追加処理の不実行を指示する。そして、エントリ追加対象である決定木処理ブロック2は、新規ルールを、自身の決定木における追加対象葉ノードが管理するルールリストに追加する。   The entry addition target determination block 3 notifies each decision tree processing block 2 of the selection result of the entry addition target. For example, the entry addition target determination block 3 instructs the entry addition target to add a new rule, and instructs the other decision tree processing block 2 not to execute the rule addition process. Then, the decision tree processing block 2 as an entry addition target adds the new rule to the rule list managed by the addition target leaf node in its own decision tree.

このようにして、INSERT処理が実行される。結果出力ブロック5は、複数の決定木処理ブロック2−1〜2−Nから処理結果を受け取り、INSERT処理の最終結果を示す出力データ7を出力する。   In this way, the INSERT process is executed. The result output block 5 receives the processing results from the plurality of decision tree processing blocks 2-1 to 2-N, and outputs the output data 7 indicating the final result of the INSERT processing.

<DELETE処理>
複数の決定木処理ブロック2−1〜2−Nは、削除コマンドに応じて、DELETE処理を同時並列に実行する。具体的には、各決定木処理ブロック2は、削除対象である既存ルールが自身の決定木における単一の葉ノードによって管理されているか否かを判定する。当該既存ルールが単一の葉ノードによって管理されている場合、当該決定木処理ブロック2は「エントリ削除対象」となり、当該単一の葉ノードは「削除対象葉ノード」となる。エントリ削除対象である決定木処理ブロック2は、削除対象葉ノードが管理していた当該既存ルールを無効化する。
<DELETE processing>
The plurality of decision tree processing blocks 2-1 to 2-N execute the DELETE processing in parallel in response to the delete command. Specifically, each decision tree processing block 2 determines whether an existing rule to be deleted is managed by a single leaf node in its own decision tree. When the existing rule is managed by a single leaf node, the decision tree processing block 2 is “entry deletion target”, and the single leaf node is “deletion target leaf node”. The decision tree processing block 2 that is the entry deletion target invalidates the existing rule managed by the deletion target leaf node.

このようにして、DELETE処理が実行される。結果出力ブロック5は、複数の決定木処理ブロック2−1〜2−Nから処理結果を受け取り、DELETE処理の最終結果を示す出力データ7を出力する。   In this way, the DELETE process is executed. The result output block 5 receives the processing results from the plurality of decision tree processing blocks 2-1 to 2-N, and outputs the output data 7 indicating the final result of the DELETE processing.

以上に説明されたように、本実施の形態によれば、ルールの複製が発生しない。特に、エントリの動的更新においても、ルールの複製が発生しないようにINSERT処理が実行される。比較例として、ルールの複製が許容された決定木に対してエントリの動的更新が実施される場合を考える。エントリの動的更新では、更新するエントリのメモリ上のデータ保存領域のデータを書き換える必要がある。ルールの複製が存在する場合には、その複製回数だけデータ書き換えが必要になる。従って、INSERT処理やDELETE処理において、その処理時間が毎回一定ではなくなり、場合によっては処理時間が非常に増大してしまう。本実施の形態によれば、このような問題が解決される。すなわち、INSERT処理やDELETE処理といったエントリの動的更新に要する処理時間が一定となる。   As described above, according to the present embodiment, rule duplication does not occur. In particular, the INSERT process is executed so that rule replication does not occur even in the dynamic update of entries. As a comparative example, let us consider a case where dynamic update of an entry is performed on a decision tree in which rule duplication is allowed. In dynamic update of an entry, it is necessary to rewrite data in a data storage area on the memory of the entry to be updated. If there are duplicated rules, data rewrite is required for the number of duplicates. Therefore, in the INSERT processing and the DELETE processing, the processing time is not constant every time, and the processing time may be greatly increased in some cases. According to the present embodiment, such a problem is solved. That is, the processing time required for dynamic update of entries such as INSERT processing and DELETE processing is constant.

更に、本実施の形態によれば、INSERT処理時、複数の決定木処理ブロック2−1〜2−Nの各々が、挿入コマンドを受け取り、その挿入コマンドに応じて、自身がエントリ追加対象候補か否かを自動的に判定する。エントリ追加対象決定ブロック3は、少なくともエントリ追加対象候補から通知される情報に基づいて、適切なエントリ追加対象を自動的に決定する。そして、エントリ追加対象は、新規ルールを追加対象葉ノードに自動的に追加する。また、DELETE処理時、複数の決定木処理ブロック2−1〜2−Nの各々が、削除コマンドを受け取り、その削除コマンドに応じて、自身がエントリ削除対象か否かを自動的に判定する。そして、エントリ削除対象は、削除対象葉ノード中の指定されたルールを自動的に無効化する。このように、エントリの動的更新は、コマンドに応じて自動的に実施される。どの決定木のどのノードにおけるルールを更新するのか予め決定しておくといった「前処理」は不要である。すなわち、本実施の形態によれば、決定木を用いたパケット分類において、前処理を行うことなく、エントリの動的更新を実現することが可能となる。   Furthermore, according to the present embodiment, at the time of INSERT processing, each of the plurality of decision tree processing blocks 2-1 to 2-N receives an insertion command, and according to the insertion command, is it an entry addition target candidate? Automatically determine whether or not. The entry addition target determination block 3 automatically determines an appropriate entry addition target based on at least information notified from the entry addition target candidate. The entry addition target automatically adds a new rule to the addition target leaf node. Further, at the time of DELETE processing, each of the plurality of decision tree processing blocks 2-1 to 2-N receives a deletion command and automatically determines whether or not itself is an entry deletion target in accordance with the deletion command. The entry deletion target automatically invalidates the specified rule in the deletion target leaf node. Thus, the dynamic update of the entry is automatically performed according to the command. “Preprocessing” such as determining in advance which rule in which decision tree is to be updated is unnecessary. That is, according to the present embodiment, it is possible to realize dynamic update of entries without performing preprocessing in packet classification using a decision tree.

尚、本実施の形態に係るパケット分類器1は、例えば、スイッチやルータ等のネットワーク装置内や、サーバの拡張カードやオンボードで搭載されるNIC(Network Interface Card)内に配備される。この場合、パケット分類器1は、制御ブロックと接続される。その制御ブロックは、到着したパケットのヘッダを解析する機能、当該パケットヘッダから検索キーを抽出する機能、その検索キーを用いたLOOKUP処理をパケット分類器1に実行させる機能を有する。更に、制御ブロックは、外部から指定される新規ルールを追加するINSERT処理をパケット分類器1に実行させる機能、及び外部から指定される既存ルールを削除するDELETE処理をパケット分類器1に実行させる機能を有する。パケット分類器1は、処理に応じた入力データ6を制御ブロックから受け取り、出力データ7を制御ブロックに出力する。   The packet classifier 1 according to the present embodiment is provided, for example, in a network device such as a switch or a router, or in an NIC (Network Interface Card) mounted on a server expansion card or onboard. In this case, the packet classifier 1 is connected to the control block. The control block has a function of analyzing a header of an incoming packet, a function of extracting a search key from the packet header, and a function of causing the packet classifier 1 to execute a LOOKUP process using the search key. Further, the control block has a function for causing the packet classifier 1 to execute an INSERT process for adding a new rule specified from the outside, and a function for causing the packet classifier 1 to execute a DELETE process for deleting an existing rule specified from the outside. Have The packet classifier 1 receives input data 6 corresponding to the processing from the control block, and outputs output data 7 to the control block.

1−2.構成例
次に、本実施の形態に係るパケット分類器1の構成例を更に詳しく説明する。図5は、本実施の形態に係るパケット分類器1の各決定木処理ブロック2の構成を示すブロック図である。図5に示されるように、決定木処理ブロック2は、決定木パイプラインブロック20、エントリ数カウントブロック21、及びルールパイプラインブロック22を備えている。コマンド入力ブロック4から決定木処理ブロック2に入力されるデータは、入力データ23である。決定木処理ブロック2から結果出力ブロック5に出力されるデータは、出力データ24である。決定木処理ブロック2とエントリ追加対象決定ブロック3との間でやりとりされるデータは、入出力データ25である。
1-2. Configuration Example Next, a configuration example of the packet classifier 1 according to the present embodiment will be described in more detail. FIG. 5 is a block diagram showing a configuration of each decision tree processing block 2 of the packet classifier 1 according to the present embodiment. As shown in FIG. 5, the decision tree processing block 2 includes a decision tree pipeline block 20, an entry count block 21, and a rule pipeline block 22. Data input from the command input block 4 to the decision tree processing block 2 is input data 23. Data output from the decision tree processing block 2 to the result output block 5 is output data 24. Data exchanged between the decision tree processing block 2 and the entry addition target determination block 3 is input / output data 25.

1−2−1.決定木パイプラインブロック20
決定木パイプラインブロック20は、パイプライン処理により決定木の探索を行う。具体的には、決定木パイプラインブロック20は、決定木の深さ(段数)Hと同じ段数の決定木ノード処理ブロック200−1〜200−Hを備えている。図6に示されるように、決定木ノード処理ブロック200−i(i=1、2、・・・、H)は、決定木の根ノードから深さj(j=0、1、・・・、H−1)のノードに対応しており、当該ノードに関する処理を行う。これら決定木ノード処理ブロック200−1〜200−Hを用いることによって、決定木パイプラインブロック20は、決定木の根ノードから葉ノードに向けて1ノードずつ探索処理を実行していく。好適には、1クロックサイクル毎に、決定木の1つのノードを辿る処理が実行される。
1-2-1. Decision tree pipeline block 20
The decision tree pipeline block 20 searches for a decision tree by pipeline processing. Specifically, the decision tree pipeline block 20 includes decision tree node processing blocks 200-1 to 200-H having the same number of stages as the depth (number of stages) H of the decision tree. As shown in FIG. 6, the decision tree node processing block 200-i (i = 1, 2,..., H) has a depth j (j = 0, 1,..., H) from the root node of the decision tree. -1) corresponds to the node and performs processing related to the node. By using these decision tree node processing blocks 200-1 to 200-H, the decision tree pipeline block 20 executes a search process node by node from the root node of the decision tree toward the leaf node. Preferably, a process of tracing one node of the decision tree is executed every clock cycle.

図7は、本実施の形態に係る決定木ノード処理ブロック200の構成を示すブロック図である。図7に示されるように、決定木ノード処理ブロック200は、子ノード決定ブロック2000及びノード情報記憶ブロック2001を備えている。   FIG. 7 is a block diagram showing a configuration of the decision tree node processing block 200 according to the present embodiment. As shown in FIG. 7, the decision tree node processing block 200 includes a child node determination block 2000 and a node information storage block 2001.

ノード情報記憶ブロック2001は、メモリやレジスタ等の記憶媒体により構成され、ノード情報を記憶する。ノード情報は、根ノードから見て同じ深さにある全てのノードの各々に関して、当該ノードにおける領域分割情報、つまり当該ノードによって管理される子ノード(分割領域)に対する情報を示す。   The node information storage block 2001 is configured by a storage medium such as a memory or a register, and stores node information. The node information indicates, for each of all nodes at the same depth when viewed from the root node, area division information in the node, that is, information on a child node (divided area) managed by the node.

決定木ノード処理ブロック200は、前段の決定木ノード処理ブロック200から入力データ2002を受け取る。但し、決定木ノード処理ブロック200−1は、コマンド入力ブロック4から入力データ2002(=入力データ23)を受け取る。入力データ2002は、各処理に応じたコマンドと、ノード情報記憶ブロック2001へのアクセスに用いられるアドレス値を含んでいる。前段の決定木ノード処理ブロック200からの入力データ2002は、更に、後述される「有効ビット長」の情報も含んでいる。   The decision tree node processing block 200 receives the input data 2002 from the preceding decision tree node processing block 200. However, the decision tree node processing block 200-1 receives the input data 2002 (= input data 23) from the command input block 4. The input data 2002 includes a command corresponding to each process and an address value used for accessing the node information storage block 2001. The input data 2002 from the decision tree node processing block 200 at the preceding stage further includes “effective bit length” information described later.

子ノード決定ブロック2000は、入力データ2002を受け取り、その入力データ2002で指定されているアドレス値を参照してノード情報記憶ブロック2001からノード情報を読み出す。そして、子ノード決定ブロック2000は、ノード情報、有効ビット長及びコマンドに基づいて、当該ノードの子ノードのノード情報が記憶されているアドレス値を算出する。また、子ノード決定ブロック2000は、有効ビット長を更新する。アドレス値の算出や有効ビット長の更新に関しては、後に詳しく説明される。出力データ2003は、入力データ2002に含まれていたコマンド、算出された新しいアドレス値、及び更新後の有効ビット長を含む。子ノード決定ブロック2000は、その出力データ2003を、次段の決定木ノード処理ブロック200に出力する。   The child node determination block 2000 receives the input data 2002 and reads the node information from the node information storage block 2001 with reference to the address value specified by the input data 2002. Then, the child node determination block 2000 calculates an address value in which the node information of the child node of the node is stored based on the node information, the effective bit length, and the command. In addition, the child node determination block 2000 updates the effective bit length. The calculation of the address value and the update of the effective bit length will be described in detail later. The output data 2003 includes the command included in the input data 2002, the calculated new address value, and the updated effective bit length. The child node determination block 2000 outputs the output data 2003 to the decision tree node processing block 200 at the next stage.

最終段の決定木ノード処理ブロック200−Hに関しては、次の通りである。LOOKUP処理あるいはDELETE処理の場合、子ノード決定ブロック2000によって算出されるアドレス値は、ルールパイプラインブロック22のルール処理ブロック220のエントリ記憶ブロック2201(後述される)へのアクセスに用いられるアドレス値である。決定木ノード処理ブロック200−Hは、出力データ2003をルール処理ブロック220−1に出力する。また、INSERT処理の場合、子ノード決定ブロック2000によって算出されるアドレス値は、エントリ数カウントブロック21のエントリ数記憶ブロック211(後述される)へのアクセスに用いられるアドレス値である。出力データ2004は、入力データ2002に含まれていたコマンドと算出されたアドレス値を含む。子ノード決定ブロック2000は、その出力データ2004を、エントリ数カウントブロック21に出力する。   The decision tree node processing block 200-H at the final stage is as follows. In the case of LOOKUP processing or DELETE processing, the address value calculated by the child node determination block 2000 is an address value used for accessing an entry storage block 2201 (described later) of the rule processing block 220 of the rule pipeline block 22. is there. The decision tree node processing block 200-H outputs the output data 2003 to the rule processing block 220-1. In the case of the INSERT processing, the address value calculated by the child node determination block 2000 is an address value used for access to the entry number storage block 211 (described later) of the entry number count block 21. The output data 2004 includes the command included in the input data 2002 and the calculated address value. The child node determination block 2000 outputs the output data 2004 to the entry count block 21.

1−2−2.エントリ数カウントブロック21
エントリ数カウントブロック21は、決定木の全ての葉ノードに関して、管理されている有効なルールのエントリ数を葉ノード毎に管理する。尚、エントリ数カウントブロック21による処理は、決定木の深さHに相当する処理サイクルにおいて実行される。
1-2-2. Entry count block 21
The entry count block 21 manages, for each leaf node, the number of valid rule entries managed for all leaf nodes of the decision tree. Note that the processing by the entry count block 21 is executed in a processing cycle corresponding to the depth H of the decision tree.

図8は、本実施の形態に係るエントリ数カウントブロック21の構成を示すブロック図である。図8に示されるように、エントリ数カウントブロック21は、カウント処理ブロック210及びエントリ数記憶ブロック211を備えている。   FIG. 8 is a block diagram showing a configuration of the entry count block 21 according to the present embodiment. As shown in FIG. 8, the entry count block 21 includes a count processing block 210 and an entry count storage block 211.

エントリ数記憶ブロック211は、メモリやレジスタ等の記憶媒体により構成され、エントリ数情報を記憶する。エントリ数情報は、決定木の各葉ノードによって管理されている有効なルールのエントリ数を示す。   The entry number storage block 211 includes a storage medium such as a memory or a register, and stores entry number information. The entry number information indicates the number of valid rule entries managed by each leaf node of the decision tree.

INSERT処理の場合、カウント処理ブロック210は、決定木パイプラインブロック20の決定木ノード処理ブロック200−Hから入力データ212(=上述の出力データ2004)を受け取る。その入力データ212は、挿入コマンド、及びエントリ数記憶ブロック211へのアクセスに用いられるアドレス値を含む。カウント処理ブロック210は、そのアドレス値を参照して、エントリ数記憶ブロック211から追加対象葉ノードに関するエントリ数情報(有効ルールエントリ数)を読み出す。そして、カウント処理ブロック210は、読み出した有効ルールエントリ数を示す出力データ216を、上述のエントリ追加対象決定ブロック3に出力する。   In the case of the INSERT processing, the count processing block 210 receives the input data 212 (= the above-mentioned output data 2004) from the decision tree node processing block 200-H of the decision tree pipeline block 20. The input data 212 includes an insert command and an address value used for accessing the entry number storage block 211. The count processing block 210 refers to the address value and reads the entry number information (valid rule entry number) regarding the addition target leaf node from the entry number storage block 211. Then, the count processing block 210 outputs the output data 216 indicating the number of read valid rule entries to the entry addition target determination block 3 described above.

また、カウント処理ブロック210は、エントリ追加対象決定ブロック3から入力データ216を受け取る。その入力データ216が「決定木への新規ルールの追加」を指定している場合、カウント処理ブロック210は、上記追加対象葉ノードに関する有効ルールエントリ数に“1”を加算し、エントリ数記憶ブロック211に書き込む。これにより、エントリ数記憶ブロック211が最新状態に更新される。更に、カウント処理ブロック210は、出力データ214を、ルールパイプラインブロック22のルール処理ブロック220−1に出力する。その出力データ214は、挿入コマンドと、ルール処理ブロック220−1のエントリ記憶ブロック2201(後述される)へのアクセスに用いられるアドレス値を含む。   The count processing block 210 receives the input data 216 from the entry addition target determination block 3. When the input data 216 specifies “add new rule to decision tree”, the count processing block 210 adds “1” to the number of valid rule entries related to the addition target leaf node, and stores the number of entries storage block. 211 is written. As a result, the entry number storage block 211 is updated to the latest state. Further, the count processing block 210 outputs the output data 214 to the rule processing block 220-1 of the rule pipeline block 22. The output data 214 includes an insert command and an address value used for accessing the entry storage block 2201 (described later) of the rule processing block 220-1.

DELETE処理の場合、カウント処理ブロック210は、ルールパイプラインブロック22のルール処理ブロック220−Bから入力データ213を受け取る。カウント処理ブロック210は、その入力データ213で指定されるアドレス値を参照して、エントリ数記憶ブロック211から削除対象葉ノードに関するエントリ数情報(有効ルールエントリ数)を読み出す。そして、カウント処理ブロック210は、当該有効ルールエントリ数から“1”を減算し、エントリ数記憶ブロック211に書き込む。これにより、エントリ数記憶ブロック211が最新状態に更新される。更に、カウント処理ブロック210は、DELETE処理の完了を示す出力データ215を、出力データ24として結果出力ブロック5に出力する。   In the case of DELETE processing, the count processing block 210 receives the input data 213 from the rule processing block 220-B of the rule pipeline block 22. The count processing block 210 refers to the address value specified by the input data 213 and reads the entry number information (valid rule entry number) regarding the deletion target leaf node from the entry number storage block 211. Then, the count processing block 210 subtracts “1” from the number of valid rule entries and writes it to the entry number storage block 211. As a result, the entry number storage block 211 is updated to the latest state. Further, the count processing block 210 outputs output data 215 indicating completion of the DELETE processing to the result output block 5 as output data 24.

1−2−3.ルールパイプラインブロック22
ルールパイプラインブロック22は、パイプライン制御によりルール処理(検索キーにマッチするルールの検索、新規ルールの追加、既存ルールの削除)を行う。具体的には、ルールパイプラインブロック22は、各葉ノードにおいて管理可能な最大ルール数(ルールリストのサイズ)Bと同じ段数のルール処理ブロック220−1〜220−Bを備えている。図9に示されるように、ルール処理ブロック220−i(i=1、2、・・・、B)は、当該葉ノードのルールリストに含まれるルールj(j=1、2・・・、B)に対応付けられており、当該ルールjに関するルール処理を実行する。これらルール処理ブロック220−1〜220−Bを用いることによって、ルールパイプラインブロック22は、葉ノードのルールリストに含まれる各ルールに対してルール処理を実行する。好適には、1クロックサイクル毎に、1つのルールに対するルール処理が実行される。
1-2-3. Rule pipeline block 22
The rule pipeline block 22 performs rule processing (search for a rule matching the search key, addition of a new rule, deletion of an existing rule) by pipeline control. Specifically, the rule pipeline block 22 includes rule processing blocks 220-1 to 220-B having the same number of stages as the maximum number of rules (rule list size) B that can be managed in each leaf node. As shown in FIG. 9, the rule processing block 220-i (i = 1, 2,..., B) includes a rule j (j = 1, 2,. B) is associated with the rule j, and the rule processing relating to the rule j is executed. By using these rule processing blocks 220-1 to 220-B, the rule pipeline block 22 executes rule processing for each rule included in the rule list of the leaf node. Preferably, rule processing for one rule is executed every clock cycle.

図10は、本実施の形態に係るルール処理ブロック220の構成を示すブロック図である。図10に示されるように、ルール処理ブロック220は、比較更新処理ブロック2200及びエントリ記憶ブロック2201を備えている。   FIG. 10 is a block diagram showing a configuration of rule processing block 220 according to the present embodiment. As shown in FIG. 10, the rule processing block 220 includes a comparative update processing block 2200 and an entry storage block 2201.

エントリ記憶ブロック2201は、メモリやレジスタ等の記憶媒体により構成され、エントリ情報を記憶する。エントリ情報は、当該ルールが有効か無効かを示す有効フラグ、ルールID、ルール等を含む。   The entry storage block 2201 includes a storage medium such as a memory or a register, and stores entry information. The entry information includes a validity flag indicating whether the rule is valid or invalid, a rule ID, a rule, and the like.

LOOKUP処理あるいはDELETE処理の場合、ルール処理ブロック220−1は、決定木パイプラインブロック20の決定木ノード処理ブロック200−Hから入力データ2202(=上述の出力データ2003)を受け取る。入力データ2202は、各処理に応じたコマンドと、エントリ記憶ブロック2201へのアクセスに用いられるアドレス値を含んでいる。   In the case of LOOKUP processing or DELETE processing, the rule processing block 220-1 receives the input data 2202 (= the above-described output data 2003) from the decision tree node processing block 200-H of the decision tree pipeline block 20. The input data 2202 includes a command corresponding to each process and an address value used for accessing the entry storage block 2201.

INSERT処理の場合、ルール処理ブロック220−1は、エントリ数カウントブロック21から入力データ2203(=上述の出力データ214)を受け取る。入力データ2203は、挿入コマンドと、エントリ記憶ブロック2201へのアクセスに用いられるアドレス値を含んでいる。入力データ2203は、これ以降、上記入力データ2202と同様に扱われる。   In the case of the INSERT processing, the rule processing block 220-1 receives the input data 2203 (= the output data 214 described above) from the entry count block 21. The input data 2203 includes an insert command and an address value used for accessing the entry storage block 2201. Thereafter, the input data 2203 is handled in the same manner as the input data 2202 described above.

比較更新処理ブロック2200は、入力データ2202を受け取り、その入力データ2202で指定されているアドレス値を参照してエントリ記憶ブロック2201からエントリ情報を読み出す。そして、比較更新処理ブロック2200は、読み出したエントリ情報に基づいて、コマンドに応じたルール処理を実行する。ルール処理の詳細は後述される。また、比較更新処理ブロック2200は、受け取った入力データ2202を出力データ2204として、次段のルール処理ブロック220に出力する。   The comparison update processing block 2200 receives the input data 2202 and reads the entry information from the entry storage block 2201 with reference to the address value specified by the input data 2202. Then, the comparative update processing block 2200 executes rule processing according to the command based on the read entry information. Details of the rule processing will be described later. The comparison update processing block 2200 outputs the received input data 2202 as output data 2204 to the rule processing block 220 at the next stage.

ルール処理ブロック220−2〜220−Bの各々は、前段のルール処理ブロック220から入力データ2202(=上述の出力データ2204)を受け取る。比較更新処理ブロック2200による処理は、上記と同じである。尚、DELETE処理の場合、最終段のルール処理ブロック220−Bの比較更新処理ブロック2200は、出力データ2204の代わりに出力データ2205(=上述の入力データ213)をエントリ数カウントブロック21に出力する。出力データ2205の内容は、出力データ2204と同じである。   Each of the rule processing blocks 220-2 to 220-B receives the input data 2202 (= the output data 2204 described above) from the preceding rule processing block 220. The processing by the comparative update processing block 2200 is the same as described above. In the case of the DELETE processing, the comparison update processing block 2200 of the final-stage rule processing block 220 -B outputs the output data 2205 (= the above-mentioned input data 213) instead of the output data 2204 to the entry count block 21. . The contents of the output data 2205 are the same as the output data 2204.

1−3.動作
次に、本実施の形態に係るパケット分類器1の動作を詳しく説明する。
1-3. Operation Next, the operation of the packet classifier 1 according to the present embodiment will be described in detail.

1−3−1.LOOKUP処理
まず、LOOKUP処理を説明する。図11は、本実施の形態におけるLOOKUP処理を示すフローチャートである。
1-3-1. LOOKUP Process First, the LOOKUP process will be described. FIG. 11 is a flowchart showing the LOOKUP process in the present embodiment.

ステップA1:
パケット分類器1に、入力データ6が入力される。その入力データ6は、LOOKUP処理を示す種別データと、被検索対象パケットから抽出された検索キーとを含む。コマンド入力ブロック4は、その入力データ6を受け取る。コマンド入力ブロック4は、その入力データ6に基づいて装置内コマンド(ここでは、検索コマンド)を生成し、その装置内コマンドを決定木処理ブロック2−1〜2−Nに一斉に出力する。
Step A1:
Input data 6 is input to the packet classifier 1. The input data 6 includes type data indicating the LOOKUP process and a search key extracted from the search target packet. The command input block 4 receives the input data 6. The command input block 4 generates an in-device command (here, a search command) based on the input data 6 and outputs the in-device command to the decision tree processing blocks 2-1 to 2-N all at once.

図12は、装置内コマンドの構成例を示す概念図である。コマンド部分は、処理種別、終了フラグ、及び結果フラグを含んでいる。例えば、2ビットデータである処理種別は、“00”であればLOOKUP処理、“01”であればINSERT処理、“10”であればDELETE処理を示す。終了フラグは、‘0’であれば未終了、‘1’であれば終了を示す。結果フラグは、エントリの追加、削除を行った場合に、‘1’に設定される。尚、終了フラグと結果フラグについては、INSERT処理及びDELETE処理においてのみ参照され、それらの利用方法については後述する。また、装置内コマンドの後半部分には、検索キー(LOOKUP処理)、追加される新規エントリ(INSERT処理)、あるいは、削除される既存エントリ(DELETE処理)が格納される。   FIG. 12 is a conceptual diagram showing a configuration example of the in-device command. The command part includes a processing type, an end flag, and a result flag. For example, if the processing type that is 2-bit data is “00”, it indicates LOOKUP processing, “01” indicates INSERT processing, and “10” indicates DELETE processing. If the end flag is “0”, it indicates that the end is not completed, and if it is “1”, it indicates the end. The result flag is set to “1” when an entry is added or deleted. Note that the end flag and the result flag are referred to only in the INSERT process and the DELETE process, and the usage method thereof will be described later. Further, the search key (LOOKUP process), a new entry to be added (INSERT process), or an existing entry to be deleted (DELETE process) is stored in the latter half of the in-device command.

ここで、エントリ(ルール)は、Prefix Match、Range Match、Wildcard Matchを考慮すると様々な表現形態が考えられる。例えば、検索キー長と同じ長さのデータ列A、Bを用意し、Prefix MatchやWildcard Matchの場合には、Aに対象データ、Bにマスクビットデータを割り当て、Range Matchの場合には、Aに下限値、Bに上限値を割り当てる方法が考えられる。この場合、ルールのエントリ長は検索キー長の2倍となる。これらを考慮し、装置内コマンドの後半部分においては、LOOKUP処理時の検索キーと、INSERT、DELETE処理時の追加・削除エントリの長さが異なることを許容する。なお、追加エントリの場合には、その優先度も指定される。   Here, the entry (rule) can take various expression forms in consideration of the Prefix Match, the Range Match, and the Wildcard Match. For example, data strings A and B having the same length as the search key length are prepared, and in the case of Prefix Match or Wildcard Match, target data is assigned to A, and mask bit data is assigned to B. In the case of Range Match, A A method of assigning a lower limit value to B and an upper limit value to B can be considered. In this case, the entry length of the rule is twice the search key length. Considering these, in the second half of the in-device command, it is allowed that the search key at the time of LOOKUP processing and the length of the addition / deletion entry at the time of INSERT and DELETE processing are different. In the case of an additional entry, its priority is also specified.

ステップA2:
コマンド入力ブロック4から検索コマンドを受け取ると、各決定木処理ブロック2は、指定された検索キーを用いて、自身の決定木を辿る処理を実行する。図13は、本ステップA2の処理を示すフローチャートである。
Step A2:
When a search command is received from the command input block 4, each decision tree processing block 2 executes a process for tracing its own decision tree using the designated search key. FIG. 13 is a flowchart showing the processing of step A2.

ステップB1:
決定木を辿る処理は、決定木の根ノードから開始する。そのため、まず、現在の処理ノードが、決定木の根ノードに設定される。具体的には、挿入コマンドが、決定木パイプラインブロック20の初段の決定木ノード処理ブロック200−1に入力される。
Step B1:
The process of tracing the decision tree starts from the root node of the decision tree. Therefore, first, the current processing node is set as the root node of the decision tree. Specifically, an insertion command is input to the decision tree node processing block 200-1 at the first stage of the decision tree pipeline block 20.

ステップB2:
子ノード決定ブロック2000は、処理種別がLOOKUPであることを確認した上で、ノード情報記憶ブロック2001からノード情報を読み出す。
Step B2:
The child node determination block 2000 reads the node information from the node information storage block 2001 after confirming that the processing type is LOOKUP.

図14は、ノード情報の構成例を示す概念図である。ノード情報は、当該ノードにおける領域分割情報である。図14に示されるように、ノード情報は、フィールド識別子(フィールドID)とその分割数(k)のC個のペア、及びベースアドレスを含んでいる。ここで、Cは決定木の1ノードにおける領域分割に用いることができるフィールドの最大数である。フィールドIDは、検索キーやルールを構成するフィールド毎に予め決められている。また、各フィールドの範囲は、2分割されるとし(kは自然数)、分割数kはその指数を表す。例えば、既出の図1〜図3の例のように、フィールドX、Yの各々の範囲が2分割される場合、フィールドXの分割数kは1であり、フィールドYの分割数kも1である。尚、kの最大数は予め決められている。ベースアドレスは、当該ノードの子ノードのノード情報が格納されている記憶領域の最小アドレス値を示す。より詳細には、ベースアドレスは、当該ノードの子ノードのノード情報が格納されている次段の決定木ノード処理ブロック200のノード情報記憶ブロック2001における最小アドレス値であり、当該ノードの全ての子ノードのノード情報は、このベースアドレスから連続する記憶領域に格納されている。 FIG. 14 is a conceptual diagram illustrating a configuration example of node information. The node information is area division information in the node. As shown in FIG. 14, the node information includes C pairs of a field identifier (field ID) and the number of divisions (k), and a base address. Here, C is the maximum number of fields that can be used for region division in one node of the decision tree. The field ID is determined in advance for each field constituting the search key and rule. In addition, the range of each field is divided into 2k (k is a natural number), and the divided number k represents the index. For example, when the ranges of the fields X and Y are divided into two as in the examples of FIGS. 1 to 3 described above, the division number k of the field X is 1, and the division number k of the field Y is also 1. is there. The maximum number of k is determined in advance. The base address indicates the minimum address value of the storage area in which the node information of the child node of the node is stored. More specifically, the base address is the minimum address value in the node information storage block 2001 of the next decision tree node processing block 200 in which the node information of the child node of the node is stored, and all the children of the node The node information of the node is stored in a storage area continuous from this base address.

ステップB3:
子ノード決定ブロック2000は、読み出したノード情報、検索キーの各フィールドのビット列、及び有効ビット長に基づいて、次段の子ノードのノード情報が格納されている記憶領域のアドレス値を算出する。具体的には、次のようにして次段のアドレス値は算出される(図15も参照されたい)。
Step B3:
Based on the read node information, the bit string of each field of the search key, and the effective bit length, the child node determination block 2000 calculates the address value of the storage area in which the node information of the child node at the next stage is stored. Specifically, the address value of the next stage is calculated as follows (see also FIG. 15).

例えば、ノード情報として、2つのフィールドに関する分割情報(フィールドID、分割数)=(0001、01)、(0100、11)とベースアドレス=00001000が設定されているとする。検索キーにおいては、フィールドID=0001のフィールド値が“0101”、フィールドID=0100のフィールド値が“0110”であり、それぞれの有効ビット長が3、4であったとする。ここで、有効ビット長とは、各フィールドのビット列に対し、領域分割に用いる下位ビットからの長さに相当する。つまり、フィールド値のうち、有効ビット長で指定された長さをもつ下位ビットからのビット列が参照される。フィールドID=0001に関して説明する。有効ビット長が3であることから、フィールド値の下位3ビット“101”を参照する。そして、分割数k=1であるため、有効ビットの上位1ビットを参照し、‘1’を得る(図15参照)。同様に、フィールドID=0100に関しては、有効ビット長が4、分割数kが3であることから、“011”を得る。これらを連結した“1011”に対して、ベースアドレス“00001000”が加算される。その結果得られる“00010011”が、次段の子ノードのノード情報が格納されている記憶領域のアドレス値である。   For example, it is assumed that division information (field ID, number of divisions) = (0001, 01), (0100, 11) and base address = 00001000 are set as node information. In the search key, it is assumed that the field value of field ID = 0001 is “0101”, the field value of field ID = 0100 is “0110”, and the effective bit lengths are 3 and 4, respectively. Here, the effective bit length corresponds to the length from the lower bit used for region division for the bit string of each field. That is, the bit string from the lower bits having the length specified by the effective bit length is referred to in the field value. The field ID = 0001 will be described. Since the effective bit length is 3, the lower 3 bits “101” of the field value are referred to. Since the division number k = 1, the upper 1 bit of the effective bits is referred to obtain “1” (see FIG. 15). Similarly, for field ID = 0100, since the effective bit length is 4 and the division number k is 3, “011” is obtained. The base address “00001000” is added to “1011” obtained by connecting these. “00010011” obtained as a result is the address value of the storage area in which the node information of the child node of the next stage is stored.

ステップB4:
続いて、子ノード決定ブロック2000は、入力された有効ビット長から分割数kを減算することによって、有効ビット長を更新する。上記の例では、フィールドID=0001の有効ビット長が3−1=2に、フィールドID=0100の有効ビット長が4−3=1に更新される。尚、決定木ノード処理ブロック200−1には有効ビット長が入力されないが、その場合の有効ビット長は、予め各フィールドのフィールド長として設定されているものとする。それ以降の決定木ノード処理ブロック200に対しては、前段の決定木ノード処理ブロック200から有効ビット長が入力される。
Step B4:
Subsequently, the child node determination block 2000 updates the effective bit length by subtracting the division number k from the input effective bit length. In the above example, the effective bit length of the field ID = 0001 is updated to 3-1 = 2, and the effective bit length of the field ID = 0100 is updated to 4-3 = 1. Note that the effective bit length is not input to the decision tree node processing block 200-1, but the effective bit length in this case is assumed to be set in advance as the field length of each field. For the subsequent decision tree node processing block 200, the effective bit length is input from the preceding decision tree node processing block 200.

ステップB5、B6:
次に、子ノードが葉ノードであるか否かが判定される。具体的には、決定木ノード処理ブロック200−Hが処理するノードの子ノードが葉ノードであるため(図6参照)、処理する決定木ノード処理ブロック200が自動的に判別すればよい。
Step B5, B6:
Next, it is determined whether the child node is a leaf node. Specifically, since the child node of the node processed by the decision tree node processing block 200-H is a leaf node (see FIG. 6), the decision tree node processing block 200 to be processed may automatically determine.

次ノードが葉ノードではない場合(ステップB5;No)は、決定木ノード処理ブロック200−i(i=1、2、・・・、H−1)の場合に相当する。その決定木ノード処理ブロック200−iは、次段の決定木ノード処理ブロック200−(i+1)に出力データ2003を出力する(ステップB6)。その出力データ2003は、入力データ2002に含まれていたコマンド、算出された新しいアドレス値、及び更新後の有効ビット長を含む。そして、処理はステップB2に戻り、次段のノードが処理ノードとなる。   The case where the next node is not a leaf node (step B5; No) corresponds to the case of the decision tree node processing block 200-i (i = 1, 2,..., H-1). The decision tree node processing block 200-i outputs the output data 2003 to the next-stage decision tree node processing block 200- (i + 1) (step B6). The output data 2003 includes the command included in the input data 2002, the calculated new address value, and the updated effective bit length. Then, the process returns to step B2, and the next node becomes a processing node.

次ノードが葉ノードである場合(ステップB5;Yes)は、決定木ノード処理ブロック200−Hの場合に相当する。この場合、ステップA2が終了する。   The case where the next node is a leaf node (step B5; Yes) corresponds to the case of the decision tree node processing block 200-H. In this case, step A2 ends.

ステップA3:
ステップA2が終了すると、決定木ノード処理ブロック200−Hは、ルールパイプラインブロック22のルール処理ブロック220−1に、算出したアドレス値とコマンドを含む出力データ2003を出力する。
Step A3:
When step A2 ends, the decision tree node processing block 200-H outputs the output data 2003 including the calculated address value and command to the rule processing block 220-1 of the rule pipeline block 22.

ステップA4:
続いて、ルールパイプラインブロック22が、検索キーとルールリスト中の各ルールとの比較(マッチング処理)を行う。図16は、本ステップA4の処理を示すフローチャートである。
Step A4:
Subsequently, the rule pipeline block 22 performs a comparison (matching process) between the search key and each rule in the rule list. FIG. 16 is a flowchart showing the process of step A4.

ステップC1:
マッチング処理は、ルールリスト中の1番目のルールから開始する。具体的には、初段のルール処理ブロック220−1から処理を開始する。
Step C1:
The matching process starts from the first rule in the rule list. Specifically, the processing is started from the first-stage rule processing block 220-1.

ステップC2:
比較更新処理ブロック2200は、処理種別がLOOKUPであることを確認した上で、入力されたアドレス値を用いてエントリ記憶ブロック2201からエントリ情報を読み出す。そして、比較更新処理ブロック2200は、有効フラグを確認する。
Step C2:
The comparison update processing block 2200 reads the entry information from the entry storage block 2201 using the input address value after confirming that the processing type is LOOKUP. Then, the comparative update processing block 2200 confirms the valid flag.

図17は、エントリ情報の構成例を示す概念図である。エントリ情報は、当該ルールが有効であるかを示す有効フラグ、ルールID、ルール、優先度を含んでいる。ルールに対応するアクションを同時に記憶する場合には、アクションを加えても良い。ここでは、アクションは本パケット分類器1とは異なる場所で管理されており、本パケット分類器1によって検索を行った後に、当該ルールIDを用いることによりアクションが取得されるとする。なお、図17のエントリ情報の構成例では、ルールIDを含んでいたが、これをエントリ情報には含まず、例えば、処理を行った決定木処理ブロックのID、葉ノードのID、ルールリストの順序等からルールIDを生成しても良い。より具体的には、処理を行った決定木処理ブロック2−i(i=1、2、・・・、N)のi、決定木処理ブロック2−iで辿り着いた葉ノードのIDであるj、ルール処理ブロック220−k(k=1、2、・・・、B)のkを2進数で連結したものをルールIDとして参照することが可能である。   FIG. 17 is a conceptual diagram illustrating a configuration example of entry information. The entry information includes a valid flag indicating whether the rule is valid, a rule ID, a rule, and a priority. An action may be added when actions corresponding to a rule are stored simultaneously. Here, it is assumed that the action is managed at a location different from that of the packet classifier 1, and the search is performed by the packet classifier 1, and then the action is acquired by using the rule ID. In the configuration example of the entry information in FIG. 17, the rule ID is included, but this is not included in the entry information. For example, the ID of the decision tree processing block that has performed the process, the ID of the leaf node, the rule list A rule ID may be generated from the order or the like. More specifically, i is the i of the decision tree processing block 2-i (i = 1, 2,..., N) that has been processed, and the ID of the leaf node reached in the decision tree processing block 2-i. j, a rule processing block 220-k (k = 1, 2,..., B) concatenated with binary numbers can be referred to as a rule ID.

ステップC4:
ルールが有効である場合(ステップC3;Yes)、比較更新処理ブロック2200は、検索キーと読み出したルールとの比較を行う。この比較方法については、例えば、非特許文献2に開示されている。
Step C4:
When the rule is valid (step C3; Yes), the comparison / update processing block 2200 compares the search key with the read rule. This comparison method is disclosed in Non-Patent Document 2, for example.

ステップC6:
検索キーがルールにマッチした場合(ステップC5;Yes)、比較更新処理ブロック2200は、当該ルールの優先度と現在のマッチルールの優先度を比較する。ここで、現在のマッチルールとは、前段のルール処理ブロック220までにマッチしたルールのうち、最も優先度が高いルールを意味する。一方、現在のルール処理ブロック220において比較に用いられたルールは、比較ルールと参照される。
Step C6:
When the search key matches the rule (step C5; Yes), the comparison update processing block 2200 compares the priority of the rule with the priority of the current match rule. Here, the current matching rule means a rule having the highest priority among the rules matched up to the previous rule processing block 220. On the other hand, the rule used for comparison in the current rule processing block 220 is referred to as a comparison rule.

ステップC8:
比較ルールの優先度の方が大きかった場合(ステップC7;Yes)、比較更新処理ブロック2200は、比較ルールを新たな現在のマッチルールに設定する。その後、処理は、ステップC9に進む。
Step C8:
When the priority of the comparison rule is higher (step C7; Yes), the comparison update processing block 2200 sets the comparison rule as a new current match rule. Thereafter, the processing proceeds to step C9.

ステップC9、C10、C11:
現在のルールが、ルールリスト中の最後のルールか否かが判定される。具体的には、ルール処理ブロック220−i(i=1、2、・・・、B−1)が処理を実行している場合、それは最後のルールではない(ステップC9;No)。この場合、そのルール処理ブロック220−iは、次段のルール処理ブロック220−(i+1)に、アドレス値とコマンドを含む出力データ2204を出力する(ステップC10)。そして、処理はステップC2に戻り、ルールリスト中の次のルールに対するマッチング処理が実行される。
Steps C9, C10, C11:
It is determined whether the current rule is the last rule in the rule list. Specifically, when the rule processing block 220-i (i = 1, 2,..., B-1) is executing a process, it is not the last rule (step C9; No). In this case, the rule processing block 220-i outputs the output data 2204 including the address value and the command to the next-stage rule processing block 220- (i + 1) (step C10). Then, the process returns to step C2, and the matching process for the next rule in the rule list is executed.

尚、読み出したルールが有効で無い場合(ステップC3;No)、及び、検索キーがルールにマッチしない場合(ステップC5;No)、更に、比較ルールの優先度がマッチルールの優先度よりも小さかった場合(ステップC7;No)にも、処理はステップC9に進む。   If the read rule is not valid (step C3; No) and the search key does not match the rule (step C5; No), the priority of the comparison rule is lower than the priority of the match rule. In the case (step C7; No), the process proceeds to step C9.

現在のルールがルールリスト中の最後のルールである場合、つまり、処理がルール処理ブロック220−Bで行われた場合(ステップC9;Yes)、ルール処理ブロック220−Bは、マッチルールのルールIDと優先度、及びコマンドを、結果出力ブロック5に出力する(ステップC11)。そして、ステップA4が終了する。尚、マッチルールが存在しない場合には、例えば、ルールIDのビット値が全て1であるような特値を出力することで、マッチルールが存在しなかったことを示す。   When the current rule is the last rule in the rule list, that is, when the processing is performed in the rule processing block 220-B (step C9; Yes), the rule processing block 220-B displays the rule ID of the match rule. The priority and the command are output to the result output block 5 (step C11). Then, step A4 ends. If there is no match rule, for example, a special value in which all the bit values of the rule ID are 1 is output to indicate that no match rule exists.

ステップA5:
結果出力ブロック5は、複数の決定木処理ブロック2−1〜2−Nから検索結果を受け取る。結果出力ブロック5は、マッチルールの優先度同士を比較し、最も優先度の高いマッチルールを選択する。そして、結果出力ブロック5は、その選択結果を示す出力データ7として、例えば、最高優先度であったマッチルールのルールIDを、LOOKUP処理の最終結果として出力する。このとき、マッチルールが存在しなかった場合には、上述した特値のルールIDを出力することで、マッチルールが存在しなかったことを示すことができる。
Step A5:
The result output block 5 receives search results from the plurality of decision tree processing blocks 2-1 to 2-N. The result output block 5 compares the priority levels of the match rules and selects the match rule with the highest priority. Then, the result output block 5 outputs, for example, the rule ID of the match rule having the highest priority as the final result of the LOOKUP process as the output data 7 indicating the selection result. At this time, if there is no match rule, the rule ID having the above-described special value can be output to indicate that no match rule exists.

1−3−2.INSERT処理
次に、INSERT処理を説明する。図18は、本実施の形態におけるINSERT処理を示すフローチャートである。
1-3-2. INSERT Processing Next, INSERT processing will be described. FIG. 18 is a flowchart showing the INSERT processing in the present embodiment.

ステップA1:
パケット分類器1に、入力データ6が入力される。その入力データ6は、INSERT処理を示す種別データと、追加される新規ルールとを含む。コマンド入力ブロック4は、その入力データ6を受け取る。コマンド入力ブロック4は、その入力データ6に基づいて装置内コマンド(ここでは、挿入コマンド)を生成し、その装置内コマンドを決定木処理ブロック2−1〜2−Nに一斉に出力する。
Step A1:
Input data 6 is input to the packet classifier 1. The input data 6 includes type data indicating INSERT processing and a new rule to be added. The command input block 4 receives the input data 6. The command input block 4 generates an in-device command (here, an insert command) based on the input data 6 and outputs the in-device command to the decision tree processing blocks 2-1 to 2-N all at once.

ステップA6:
コマンド入力ブロック4から挿入コマンドを受け取ると、各決定木処理ブロック2は、指定された新規ルールを用いて、自身の決定木を辿る処理を実行する。図19は、本ステップA6の処理を示すフローチャートである。
Step A6:
When an insertion command is received from the command input block 4, each decision tree processing block 2 executes a process of tracing its own decision tree using the designated new rule. FIG. 19 is a flowchart showing the process of step A6.

ステップB1:
まず、LOOKUP処理の場合と同様に、現在の処理ノードが、決定木の根ノードに設定される。
Step B1:
First, as in the case of the LOOKUP process, the current processing node is set as the root node of the decision tree.

ステップB7:
子ノード決定ブロック2000は、処理種別がINSERTであることを確認した上で、コマンド内の終了フラグを参照する。終了フラグが‘1’である場合(ステップB7;Yes)、処理はステップB5に進む。一方、終了フラグが‘0’である場合(ステップB7;No)、処理はステップB2に進む。
Step B7:
The child node determination block 2000 refers to the end flag in the command after confirming that the processing type is INSERT. If the end flag is “1” (step B7; Yes), the process proceeds to step B5. On the other hand, when the end flag is “0” (step B7; No), the process proceeds to step B2.

ステップB2:
LOOKUP処理の場合と同様に、子ノード決定ブロック2000は、ノード情報記憶ブロック2001からノード情報を読み出す。
Step B2:
As in the case of the LOOKUP process, the child node determination block 2000 reads node information from the node information storage block 2001.

ステップB8:
子ノード決定ブロック2000は、読み出したノード情報、新規ルールの各フィールドのビット列、及び有効ビット長に基づいて、ルールの複製が発生するか否か判定する。ルールの複製が発生するか否かは、アドレス値の算出を行う際に、ワイルドカードが含まれるか否かで判断することができる。
Step B8:
The child node determination block 2000 determines whether or not rule duplication occurs based on the read node information, the bit string of each field of the new rule, and the effective bit length. Whether or not rule duplication occurs can be determined by whether or not a wild card is included when calculating an address value.

例えば、ノード情報として、2つのフィールドに対する領域分割情報(フィールドID、分割数)=(0001、01)、(0100、11)とベースアドレス=00001000が設定されていたとする。追加対象ルールにいては、フィールドID=0001、フィールドID=0100の各フィールドに対して、(フィールド値、マスクビット列)が、(“0101”、“1111”)、(“0110”、“1111”)のように設定されており、それぞれの有効ビット長が3、4であったとする。なお、マスクビット列は各ビットが‘1’であれば有効、‘0’であれば無効、つまり、ワイルドカードとして扱うものとする。この場合、両フィールドともに、ワイルドカードは含まれていないため、ルールの複製は発生しないことが分かり、LOOKUP時のステップB3と同様に、次の子ノードのアドレス値を算出することができる。一方、同様のノード情報、有効ビット長に対して、追加対象ルールにおけるフィールドID=0001、フィールドID=0100の各フィールドの(フィールド値、マスクビット列)が、(“0101”、“1111”)、(“0110”、“1100”)のように設定されている場合を考える。この場合、マスクビット列を考慮すると、各フィールド値はそれぞれ、“0101”、“01**”となる。ノード情報を元に子ノードのアドレス値を算出しようとすると、それぞれの有効ビット長が3、4であることから、フィールドID=0001に対して、下位3ビット“101”の上位1ビットを参照し、‘1’を得る。一方、フィールドID=0100のフィールドに対しては、有効ビット長が4、分割数が3であることから、“01*”を得る。この結果、子ノードの分割領域を示すビット列にワイルドカードが含まれ、これは、ルールの複製が発生することを意味する。なお、フィールド値がRange Matchとして設定されている場合、下限値と上限値の有効ビット長に相当するビット列に対し、参照するビット列が共に同じ値であるか否かで判断できる。例えば、上記の例において、フィールドID=0001が下限値0000、上限値0011として設定されていたとする。有効ビット長が3であることから、下限値、上限値の下位3ビットの“000”と“011”を参照する。分割数が1であることから、各有効ビット長の先頭ビットを参照し、共に‘0’であることから、領域分割を行ってもルールの複製が発生しないと判断できる。一方、フィールドID=0001が下限値0000、上限値0111が設定されている場合には、参照ビットが‘0’と‘1’であるため、ルールの複製が発生すると判断できる。   For example, it is assumed that area division information (field ID, number of divisions) = (0001, 01), (0100, 11) and base address = 00001000 are set as node information. In the addition target rule, for each field of field ID = 0001 and field ID = 0100, (field value, mask bit string) is (“0101”, “1111”), (“0110”, “1111”). ) And the effective bit lengths are 3 and 4, respectively. The mask bit string is valid if each bit is ‘1’, and invalid if ‘0’, that is, it is treated as a wild card. In this case, since both fields do not contain a wild card, it can be seen that rule duplication does not occur, and the address value of the next child node can be calculated in the same manner as in step B3 at LOOKUP. On the other hand, for the same node information and effective bit length, (field value, mask bit string) of each field of field ID = 0001 and field ID = 0100 in the addition target rule is (“0101”, “1111”), Consider the case where the setting is made as (“0110”, “1100”). In this case, considering the mask bit string, the field values are “0101” and “01 **”, respectively. When trying to calculate the address value of the child node based on the node information, since the effective bit lengths are 3 and 4, the upper 1 bit of the lower 3 bits “101” is referred to for the field ID = 0001. And get '1'. On the other hand, for the field with field ID = 0100, the effective bit length is 4 and the number of divisions is 3, so that “01 *” is obtained. As a result, a wild card is included in the bit string indicating the divided area of the child node, which means that rule duplication occurs. When the field value is set as Range Match, it can be determined whether or not the bit strings referred to are the same value for the bit string corresponding to the effective bit length of the lower limit value and the upper limit value. For example, in the above example, it is assumed that the field ID = 0001 is set as the lower limit value 0000 and the upper limit value 0011. Since the effective bit length is 3, the lower 3 bits “000” and “011” of the lower limit value and the upper limit value are referred to. Since the number of divisions is 1, the first bit of each effective bit length is referred to, and since both are '0', it can be determined that rule duplication does not occur even if region division is performed. On the other hand, when the field ID = 0001 is set to the lower limit value 0000 and the upper limit value 0111, since the reference bits are ‘0’ and ‘1’, it can be determined that duplication of the rule occurs.

ステップB10:
ルールの複製が発生する場合(ステップB9;Yes)、当該決定木処理ブロック2は、エントリ追加対象候補とはならない。この場合、子ノード決定ブロック2000は、コマンドの終了フラグを‘1’に設定する。その後、処理はステップB5に進む。
Step B10:
When rule duplication occurs (step B9; Yes), the decision tree processing block 2 is not an entry addition target candidate. In this case, the child node determination block 2000 sets the command end flag to “1”. Thereafter, the process proceeds to step B5.

ステップB3、B4:
一方、ルールの複製が発生しない場合(ステップB9;No)、LOOKUP処理の場合と同様に、次段のアドレス値の算出(ステップB3)及び有効ビット長の更新(ステップB4)が行われる。その後、処理はステップB5に進む。
Step B3, B4:
On the other hand, if no rule duplication occurs (step B9; No), the next-stage address value is calculated (step B3) and the effective bit length is updated (step B4), as in the case of the LOOKUP process. Thereafter, the process proceeds to step B5.

ステップB5、B6:
LOOKUP処理の場合と同様に、ステップB5、B6が実施される。つまり、次ノードが葉ノードではない場合(ステップB5;No)は、決定木ノード処理ブロック200−i(i=1、2、・・・、H−1)は、次段の決定木ノード処理ブロック200−(i+1)に出力データ2003を出力する(ステップB6)。そして、処理はステップB7に戻り、次段のノードが処理ノードとなる。一方、次ノードが葉ノードである場合(ステップB5;Yes)は、ステップA6が終了する。
Step B5, B6:
As in the case of the LOOKUP process, steps B5 and B6 are performed. That is, when the next node is not a leaf node (step B5; No), the decision tree node processing block 200-i (i = 1, 2,..., H−1) Output data 2003 is output to block 200- (i + 1) (step B6). Then, the process returns to step B7, and the next node becomes a processing node. On the other hand, when the next node is a leaf node (step B5; Yes), step A6 ends.

ステップA7:
ステップA6が終了すると、決定木ノード処理ブロック200−Hは、算出したアドレス値とコマンドを含む出力データ2004を、エントリ数カウントブロック21に出力する。
Step A7:
When step A6 ends, the decision tree node processing block 200-H outputs the output data 2004 including the calculated address value and command to the entry count block 21.

ステップA8:
エントリ数カウントブロック21のカウント処理ブロック210は、決定木ノード処理ブロック200−Hから入力データ212(=上述の出力データ2004)を受け取る。カウント処理ブロック210は、処理種別がINSERTであることを確認した上で、終了フラグを参照する。終了フラグが‘0’の場合、当該決定木処理ブロック2は、エントリ追加対象候補である。この場合、カウント処理ブロック210は、入力されたアドレス値を用いて、エントリ数記憶ブロック211から追加対象葉ノードに関するエントリ数情報(有効ルールエントリ数)を読み出す。そして、カウント処理ブロック210は、読み出した有効ルールエントリ数を示す出力データ216を、エントリ追加対象決定ブロック3に出力する。
Step A8:
The count processing block 210 of the entry count block 21 receives the input data 212 (= the output data 2004 described above) from the decision tree node processing block 200-H. The count processing block 210 refers to the end flag after confirming that the processing type is INSERT. When the end flag is “0”, the decision tree processing block 2 is an entry addition target candidate. In this case, the count processing block 210 reads the entry number information (number of valid rule entries) regarding the addition target leaf node from the entry number storage block 211 using the input address value. Then, the count processing block 210 outputs output data 216 indicating the number of read valid rule entries to the entry addition target determination block 3.

一方、終了フラグが‘1’の場合、当該決定木処理ブロック2は、エントリ追加対象候補ではない。この場合、カウント処理ブロック210は、処理終了信号をエントリ追加対象決定ブロック3に出力する。あるいは、カウント処理ブロック210は、有効ルールエントリ数を最大値に設定し、その有効ルールエントリ数をエントリ追加対象決定ブロック3に通知してもよい。   On the other hand, when the end flag is “1”, the decision tree processing block 2 is not an entry addition target candidate. In this case, the count processing block 210 outputs a processing end signal to the entry addition target determination block 3. Alternatively, the count processing block 210 may set the number of valid rule entries to the maximum value and notify the entry addition target determination block 3 of the number of valid rule entries.

ステップA9:
エントリ追加対象決定ブロック3は、複数の決定木処理ブロック2−1〜2−Nから通知される情報に基づいて、エントリ追加対象候補を認識し、エントリ追加対象候補の中からエントリ追加対象を選択する。図20は、本ステップA9の処理を示すフローチャートである。
Step A9:
The entry addition target determination block 3 recognizes an entry addition target candidate based on information notified from the plurality of decision tree processing blocks 2-1 to 2-N, and selects an entry addition target from the entry addition target candidates. To do. FIG. 20 is a flowchart showing the process of step A9.

ステップD1、D2、D3:
エントリ追加対象決定ブロック3は、エントリ追加対象候補から有効ルールエントリ数を示す情報を受け取る(ステップD1)。次に、エントリ追加対象決定ブロック3は、有効ルールエントリ数がルールリストの最大数B(リストサイズ)を下回っているものがあるか否か確認する(ステップD2)。有効ルールエントリ数がリストサイズを下回っているものが無い場合(ステップD2;No)、エントリ追加対象決定ブロック3は、エントリ追加対象は存在しないと判断する(ステップD3)。
Steps D1, D2, D3:
The entry addition target determination block 3 receives information indicating the number of valid rule entries from the entry addition target candidate (step D1). Next, the entry addition target determination block 3 checks whether or not there is any valid rule entry number that is less than the maximum number B (list size) of the rule list (step D2). If there is no valid rule entry number less than the list size (step D2; No), the entry addition target determination block 3 determines that there is no entry addition target (step D3).

ステップD4、D5:
一方、有効ルールエントリ数がリストサイズを下回っているものがある場合(ステップD2;Yes)、エントリ追加対象決定ブロック3は、有効エントリ数が最小であるエントリ追加対象候補を、エントリ追加対象として選択する(ステップD4)。その後、エントリ追加対象決定ブロック3は、各決定木処理ブロック2にエントリ追加の可否を通知する(ステップD5)。例えば、エントリ追加対象決定ブロック3は、エントリ追加対象に対して新規ルールの追加を指示し、それ以外の決定木処理ブロック2に対してルール追加処理の不実行を指示する。なお、ここでは有効ルールエントリ数が最小であるエントリ追加対象候補をエントリ追加対象として選択しているが、その他のポリシーに従ってエントリ追加対象を選択しても良い。
Steps D4 and D5:
On the other hand, if there is one in which the number of valid rule entries is smaller than the list size (step D2; Yes), the entry addition target determination block 3 selects the entry addition target candidate having the smallest number of valid entries as the entry addition target. (Step D4). Thereafter, the entry addition target determination block 3 notifies each decision tree processing block 2 of whether or not an entry can be added (step D5). For example, the entry addition target determination block 3 instructs the entry addition target to add a new rule, and instructs the other decision tree processing block 2 not to execute the rule addition process. Here, the entry addition target candidate having the minimum number of valid rule entries is selected as the entry addition target, but the entry addition target may be selected according to another policy.

ステップA10:
エントリ追加対象である決定木処理ブロック2のエントリ数カウントブロック21は、追加対象葉ノードに関する有効ルールエントリ数に“1”を加算し、エントリ数記憶ブロック211に書き込む。これにより、エントリ数記憶ブロック211が最新状態に更新される。それ以外の決定木処理ブロック2のエントリ数カウントブロック21は、コマンドの終了フラグを‘1’に設定する。
Step A10:
The entry count block 21 of the decision tree processing block 2 that is the entry addition target adds “1” to the number of valid rule entries related to the addition target leaf node, and writes the result into the entry count storage block 211. As a result, the entry number storage block 211 is updated to the latest state. The other entry count block 21 of the decision tree processing block 2 sets the command end flag to “1”.

ステップA11:
また、各決定木処理ブロック2のエントリ数カウントブロック21は、アドレス値と挿入コマンドを含む出力データ214を、ルールパイプラインブロック22のルール処理ブロック220−1に出力する。
Step A11:
The entry count block 21 of each decision tree processing block 2 outputs the output data 214 including the address value and the insertion command to the rule processing block 220-1 of the rule pipeline block 22.

ステップA12:
ルールパイプラインブロック22は、ルールの追加処理を行う。図21は、本ステップA12の処理を示すフローチャートである。
Step A12:
The rule pipeline block 22 performs rule addition processing. FIG. 21 is a flowchart showing the processing of step A12.

ステップC12:
ステップA12は、ルールリスト中の1番目のルールから開始する。具体的には、初段のルール処理ブロック220−1から処理を開始する。
Step C12:
Step A12 starts from the first rule in the rule list. Specifically, the processing is started from the first-stage rule processing block 220-1.

ステップC13:
比較更新処理ブロック2200は、処理種別がINSERTであることを確認した上で、コマンド内の終了フラグを参照する。終了フラグが‘1’である場合(ステップC13;Yes)、処理はステップC9に進む。一方、終了フラグが‘0’である場合(ステップC13;No)、処理はステップC2に進む。
Step C13:
The comparative update processing block 2200 refers to the end flag in the command after confirming that the processing type is INSERT. When the end flag is “1” (step C13; Yes), the process proceeds to step C9. On the other hand, when the end flag is “0” (step C13; No), the process proceeds to step C2.

ステップC2:
LOOKUP処理の場合と同様に、比較更新処理ブロック2200は、入力されたアドレス値を用いてエントリ記憶ブロック2201からエントリ情報を読み出す。そして、比較更新処理ブロック2200は、有効フラグを確認する。
Step C2:
As in the case of the LOOKUP process, the comparison / update processing block 2200 reads entry information from the entry storage block 2201 using the input address value. Then, the comparative update processing block 2200 confirms the valid flag.

ステップC15:
ルールが有効である場合(ステップC3;Yes)、当該エントリに新規ルールを書き込むことは許されない。この場合、そのルール処理ブロック220−iは、次段のルール処理ブロック220−(i+1)に、アドレス値とコマンドを含む出力データ2204を出力する。そして、処理はステップC13に戻り、ルールリスト中の次のルールに対する処理が実行される。
Step C15:
If the rule is valid (step C3; Yes), writing a new rule to the entry is not permitted. In this case, the rule processing block 220-i outputs output data 2204 including an address value and a command to the next-stage rule processing block 220- (i + 1). Then, the process returns to step C13, and the process for the next rule in the rule list is executed.

ステップC14:
一方、ルールが有効ではない場合(ステップC3;No)、当該エントリ(すなわち、空きエントリ)に新規ルールを書き込むことができる。この場合、比較更新処理ブロック2200は、エントリ情報中のルール情報を新規ルールのものに書き換え、且つ、有効フラグを‘1’に設定し、エントリ記憶ブロック2201に書き込む。更に、比較更新処理ブロック2200は、コマンド内の終了フラグを‘1’に設定し、結果フラグを‘1’(追加成功)に設定する。その後、処理はステップC9に進む。
Step C14:
On the other hand, if the rule is not valid (step C3; No), a new rule can be written in the entry (that is, an empty entry). In this case, the comparison update processing block 2200 rewrites the rule information in the entry information to that of the new rule, sets the valid flag to “1”, and writes it in the entry storage block 2201. Further, the comparison update processing block 2200 sets the end flag in the command to “1”, and sets the result flag to “1” (addition success). Thereafter, the processing proceeds to step C9.

ステップC9:
LOOKUP処理の場合と同様に、現在のルールが、ルールリスト中の最後のルールか否かが判定される。現在のルールが最後のルールではない場合(ステップC9;No)、処理は上記ステップC15に進む。一方、最後のルールの場合(ステップC9;Yes)、ルール処理ブロック220−Bは、現在のコマンドを、結果出力ブロック5に出力する(ステップC16)。そして、ステップA12が終了する。
Step C9:
As in the case of the LOOKUP process, it is determined whether or not the current rule is the last rule in the rule list. If the current rule is not the last rule (step C9; No), the process proceeds to step C15. On the other hand, in the case of the last rule (step C9; Yes), the rule processing block 220-B outputs the current command to the result output block 5 (step C16). Then, step A12 ends.

ステップA13:
結果出力ブロック5は、複数の決定木処理ブロック2−1〜2−Nからコマンドを受け取る。結果出力ブロック5は、受け取ったコマンド内の結果フラグを参照して、新規ルールが追加されたか、又は追加されなかったかを確認する。そして、結果出力ブロック5は、その結果を示す出力データ7を、INSERT処理の最終結果として出力する。
Step A13:
The result output block 5 receives commands from the plurality of decision tree processing blocks 2-1 to 2-N. The result output block 5 refers to the result flag in the received command and confirms whether a new rule has been added or not added. Then, the result output block 5 outputs output data 7 indicating the result as the final result of the INSERT process.

ここで、INSERT処理の最終結果として、新規ルールを追加した箇所を示すエントリIDを出力することが挙げられる。エントリIDは、上述したエントリ情報にルールIDを含まない場合のルールID生成手法と同様、エントリ追加対象となった決定木処理ブロックのID、葉ノードのID、ルールリスト順序等からエントリIDを生成することができる。このとき、新規ルールを追加できる空き領域が無く、新規ルールを追加できなかった場合には、それを示す信号を出力することでルールの追加ができなかったことを示すことができるが、例えば、エントリIDを全て‘1’とした特値として出力することで、ルールの追加ができなかったことを示す信号を省くこともできる。また、INSERT処理では、各々1ビットから成る終了フラグと結果フラグを用いて処理を行ったが、終了フラグのビット幅を増やし、例えば、ルールの複製が発生したことが要因で処理を終了したことや、当該葉ノードのルールリストに空きが無かったことが要因で処理を終了したこと等、処理を終了した要因を表現させることができる。このような終了フラグを参照することで、INSERT処理の最終結果として、新規ルールを追加できなかった場合にその要因も最終結果として出力することができる。   Here, as the final result of the INSERT processing, an entry ID indicating the location where the new rule is added may be output. The entry ID is generated from the ID of the decision tree processing block that is the entry addition target, the ID of the leaf node, the rule list order, etc., as in the rule ID generation method when the rule ID is not included in the entry information described above can do. At this time, if there is no free space where a new rule can be added and a new rule could not be added, it can indicate that the rule could not be added by outputting a signal indicating that, for example, By outputting as a special value with all entry IDs set to “1”, a signal indicating that a rule could not be added can be omitted. In INSERT processing, processing was performed using an end flag and a result flag each consisting of 1 bit, but the bit width of the end flag was increased, for example, the processing was terminated due to the occurrence of rule duplication. Alternatively, it is possible to express a factor that terminated the processing, such as the termination of the processing due to the fact that there is no space in the rule list of the leaf node. By referring to such an end flag, when a new rule cannot be added as the final result of the INSERT processing, the factor can also be output as the final result.

1−3−3.DELETE処理
次に、DELETE処理を説明する。図22は、本実施の形態におけるDELETE処理を示すフローチャートである。
1-3-3. DELETE Process Next, the DELETE process will be described. FIG. 22 is a flowchart showing DELETE processing in the present embodiment.

ステップA1:
パケット分類器1に、入力データ6が入力される。その入力データ6は、DELETE処理を示す種別データと、削除される既存ルールとを含む。コマンド入力ブロック4は、その入力データ6を受け取る。コマンド入力ブロック4は、その入力データ6に基づいて装置内コマンド(ここでは、削除コマンド)を生成し、その装置内コマンドを決定木処理ブロック2−1〜2−Nに一斉に出力する。
Step A1:
Input data 6 is input to the packet classifier 1. The input data 6 includes type data indicating DELETE processing and an existing rule to be deleted. The command input block 4 receives the input data 6. The command input block 4 generates an in-device command (in this case, a delete command) based on the input data 6 and outputs the in-device command to the decision tree processing blocks 2-1 to 2-N all at once.

ステップA6:
INSERT処理の場合と同様に、各決定木処理ブロック2は、指定された既存ルールを用いて、自身の決定木を辿る処理を実行する。
Step A6:
As in the case of the INSERT process, each decision tree processing block 2 executes a process of tracing its own decision tree using the specified existing rule.

ステップA3:
ステップA6が終了すると、決定木ノード処理ブロック200−Hは、ルールパイプラインブロック22のルール処理ブロック220−1に、算出したアドレス値とコマンドを含む出力データ2003を出力する。
Step A3:
When step A6 ends, the decision tree node processing block 200-H outputs the output data 2003 including the calculated address value and command to the rule processing block 220-1 of the rule pipeline block 22.

ステップA14:
ルールパイプラインブロック22は、ルールの削除処理を行う。図23は、本ステップA14の処理を示すフローチャートである。
Step A14:
The rule pipeline block 22 performs rule deletion processing. FIG. 23 is a flowchart showing the process of step A14.

ステップC1:
ステップA14は、ルールリスト中の1番目のルールから開始する。具体的には、初段のルール処理ブロック220−1から処理を開始する。
Step C1:
Step A14 starts from the first rule in the rule list. Specifically, the processing is started from the first-stage rule processing block 220-1.

ステップC13:
比較更新処理ブロック2200は、処理種別がDELETEであることを確認した上で、コマンド内の終了フラグを参照する。終了フラグが‘1’である場合(ステップC13;Yes)、処理はステップC9に進む。一方、終了フラグが‘0’である場合(ステップC13;No)、処理はステップC2に進む。
Step C13:
The comparative update processing block 2200 refers to the end flag in the command after confirming that the processing type is DELETE. When the end flag is “1” (step C13; Yes), the process proceeds to step C9. On the other hand, when the end flag is “0” (step C13; No), the process proceeds to step C2.

ステップC2、C3:
LOOKUP処理の場合と同様に、比較更新処理ブロック2200は、入力されたアドレス値を用いてエントリ記憶ブロック2201からエントリ情報を読み出す。そして、比較更新処理ブロック2200は、有効フラグを確認する。ルールが無効である場合(ステップC3:No)、当該エントリは削除対象ではない。この場合、処理はステップC9に進む。一方、ルールが有効である場合(ステップC3;Yes)、処理はステップC17に進む。
Steps C2, C3:
As in the case of the LOOKUP process, the comparison / update processing block 2200 reads entry information from the entry storage block 2201 using the input address value. Then, the comparative update processing block 2200 confirms the valid flag. If the rule is invalid (step C3: No), the entry is not a deletion target. In this case, the process proceeds to step C9. On the other hand, if the rule is valid (step C3; Yes), the process proceeds to step C17.

ステップC17:
比較更新処理ブロック2200は、読み出したルールと、削除対象として指定されたルールとを比較する。つまり、比較更新処理ブロック2200は、削除対象として指定されているルールが、読み出したルールにマッチするか否かを判定する。ここでは、両者が完全に一致するか否かが判定される。不一致の場合(ステップC5;No)、処理はステップC9に進む。一方、完全一致の場合(ステップC5;Yes)、処理はステップC18に進む。
Step C17:
The comparison update processing block 2200 compares the read rule with the rule designated as the deletion target. That is, the comparison update processing block 2200 determines whether or not the rule designated as the deletion target matches the read rule. Here, it is determined whether or not both match completely. If they do not match (step C5; No), the process proceeds to step C9. On the other hand, if it is a complete match (step C5; Yes), the process proceeds to step C18.

ステップC18:
比較更新処理ブロック2200は、エントリ情報中の有効フラグを‘0’に設定し、エントリ記憶ブロック2201に書き込む。これにより、当該エントリ(ルール)は無効化される。この処理が既存ルールの削除に相当する。更に、比較更新処理ブロック2200は、コマンド内の終了フラグを‘1’に設定し、結果フラグを‘1’(削除成功)に設定する。その後、処理はステップC9に進む。
Step C18:
The comparison update processing block 2200 sets the valid flag in the entry information to “0” and writes it in the entry storage block 2201. Thereby, the entry (rule) is invalidated. This process corresponds to deletion of an existing rule. Further, the comparison update processing block 2200 sets the end flag in the command to “1”, and sets the result flag to “1” (successful deletion). Thereafter, the processing proceeds to step C9.

ステップC9、C15:
LOOKUP処理の場合と同様に、現在のルールが、ルールリスト中の最後のルールか否かが判定される。現在のルールが最後のルールではない場合(ステップC9;No)、ルール処理ブロック220−iは、次段のルール処理ブロック220−(i+1)に、アドレス値とコマンドを含む出力データ2204を出力する(ステップC15)。そして、処理はステップC13に戻り、ルールリスト中の次のルールに対する処理が実行される。一方、現在のルールがルールリスト中の最後のルールである場合(ステップC9;Yes)、ステップA14は終了する。
Steps C9 and C15:
As in the case of the LOOKUP process, it is determined whether or not the current rule is the last rule in the rule list. When the current rule is not the last rule (step C9; No), the rule processing block 220-i outputs output data 2204 including an address value and a command to the next rule processing block 220- (i + 1). (Step C15). Then, the process returns to step C13, and the process for the next rule in the rule list is executed. On the other hand, when the current rule is the last rule in the rule list (step C9; Yes), step A14 ends.

ステップA15:
ステップA14が完了すると、ルール処理ブロック220−Bは、アドレス値とコマンドを含む出力データ2205を、エントリ数カウントブロック21に出力する。
Step A15:
When step A14 is completed, the rule processing block 220-B outputs the output data 2205 including the address value and the command to the entry count block 21.

ステップA16:
エントリ数カウントブロック21のカウント処理ブロック210は、ルール処理ブロック220−Bから入力データ213(=上述の出力データ2005)を受け取る。カウント処理ブロック210は、処理種別がDELETEであることを確認した上で、終了フラグ及び結果フラグを参照する。終了フラグ及び結果フラグが共に‘1’である場合、カウント処理ブロック210は、入力されたアドレス値を用いて、エントリ数記憶ブロック211から削除対象葉ノードに関するエントリ数情報(有効ルールエントリ数)を読み出す。そして、カウント処理ブロック210は、当該有効ルールエントリ数から1を減算し、エントリ数記憶ブロック211に書き込む。これにより、エントリ数記憶ブロック211が最新状態に更新される。
Step A16:
The count processing block 210 of the entry count block 21 receives the input data 213 (= the output data 2005 described above) from the rule processing block 220-B. The count processing block 210 refers to the end flag and the result flag after confirming that the processing type is DELETE. When both the end flag and the result flag are “1”, the count processing block 210 uses the input address value to obtain entry number information (valid rule entry number) related to the deletion target leaf node from the entry number storage block 211. read out. Then, the count processing block 210 subtracts 1 from the number of valid rule entries and writes it in the entry number storage block 211. As a result, the entry number storage block 211 is updated to the latest state.

ステップA17:
最後に、カウント処理ブロック210は、コマンドを含む出力データ215を結果出力ブロック5に出力する。結果出力ブロック5は、決定木処理ブロック2−1〜2−Nのそれぞれから受け取ったコマンド内の結果フラグを参照して、ルールが削除されたか、又は削除されなかったかを確認する。そして、結果出力ブロック5は、その結果を示す出力データ7を、DELETE処理の最終結果として出力する。
Step A17:
Finally, the count processing block 210 outputs output data 215 including a command to the result output block 5. The result output block 5 refers to the result flag in the command received from each of the decision tree processing blocks 2-1 to 2-N and confirms whether the rule is deleted or not deleted. Then, the result output block 5 outputs the output data 7 indicating the result as the final result of the DELETE process.

ここで、DELETE処理の最終結果として、INSERT処理時の新規ルール追加箇所のエントリIDと同様、削除ルールを追加した箇所を示すエントリIDを出力することが挙げられる。この際、削除ルールが何らかの理由で管理ルールに存在しなかった場合には、削除ルールが存在しなかったことを示す信号や、エントリIDを全て‘1’とした特値として出力することで、削除ルールが存在しなかったことを示すことができる。   Here, the final result of the DELETE process is to output an entry ID indicating the location where the deletion rule is added, as with the entry ID of the new rule addition location during the INSERT processing. At this time, if the deletion rule does not exist in the management rule for some reason, a signal indicating that the deletion rule does not exist, or a special value with all entry IDs set to '1', It can be shown that the delete rule did not exist.

1−3−4.補足
尚、本実施の形態における動作では、INSERT、DELETE処理時に、決定木パイプラインブロック20にて決定木を辿る処理や、ルールパイプラインブロック22にてルールの追加、削除処理を行う場合に、処理が完了していても、各パイプラインを順に処理していく。しかし、各パイプライン内の処理ブロックは、処理が完了した時点で何ら処理を実行しない。そのため、処理が完了した時点で、当該処理ブロックは、エントリ数カウントブロック21や結果出力ブロック5に、処理が完了した信号とコマンドを直接出力してもよい。そして、それぞれのブロックで各決定木処理ブロックの処理タイミングが合うように待ち合わせを行っても構わない。
1-3-4. Supplementary Note: In the operation in the present embodiment, at the time of INSERT and DELETE processing, when the decision tree pipeline block 20 traces the decision tree, or the rule pipeline block 22 performs rule addition / deletion processing, Even if processing is completed, each pipeline is processed in order. However, the processing block in each pipeline does not perform any processing when the processing is completed. For this reason, when the processing is completed, the processing block may directly output a signal and a command that have been processed to the entry count block 21 or the result output block 5. Then, waiting may be performed so that the processing timing of each decision tree processing block matches in each block.

また、INSERT処理時には、ルールは複数の決定木のうち必ず1つだけに追加され、DELETE処理時にも、削除対象ルールが必ず1つだけ削除されることを想定している。本実施の形態における動作では、既に追加されているエントリと同一エントリを追加しようとする場合の処理については、詳細には述べていない。しかし、INSERT処理時に、追加対象木以外の決定木も含めて、有効エントリに対して新規追加エントリとの比較を行うことで、既に追加済みのエントリとの重複追加を防止することが可能である。このような処理は、上記のLOOKUP処理と組み合わせることで実現可能である。なお、INSERT時に追加しようとしているエントリと既に追加済みのエントリとの確認を行うことによって、DELETE時に、削除しようとしているルールが複数の箇所から削除されてしまうようなことは発生しない。   Further, it is assumed that a rule is always added to only one of a plurality of decision trees at the time of INSERT processing, and that only one deletion target rule is always deleted at the time of DELETE processing. In the operation according to the present embodiment, the processing for adding the same entry as that already added is not described in detail. However, at the time of INSERT processing, it is possible to prevent duplicate additions with already added entries by comparing valid entries, including decision trees other than the addition target tree, with newly added entries. . Such processing can be realized by combining with the above-mentioned LOOKUP processing. By checking the entry to be added at the time of INSERT and the entry that has already been added, the rule to be deleted at the time of DELETE will not be deleted from a plurality of locations.

更に、コマンド入力ブロック4は、外部から入力データ6として、処理種別や検索キー、追加/削除対象エントリを受け取り、装置内コマンドを生成していた。しかし、入力データ6として到着パケット、又は到着パケットのヘッダ情報データを直接受け取り、ヘッダ解析、検索キーの抽出を行い、装置内コマンドを生成しても構わない。   Further, the command input block 4 receives a processing type, a search key, and an entry to be added / deleted as input data 6 from the outside, and generates an in-device command. However, the in-device command may be generated by directly receiving the arrival packet or the header information data of the arrival packet as the input data 6 and performing header analysis and search key extraction.

1−4.効果
本実施の形態によれば、決定木を用いたパケット分類において、前処理を行うことなく、エントリの動的更新を実現することが可能となる。
1-4. Effect According to the present embodiment, it is possible to realize dynamic update of entries without performing preprocessing in packet classification using a decision tree.

また、本実施の形態によれば、INSERT処理において、有効ルールエントリ数が最小であるエントリリストに新規ルールが追加される。これにより、複数の決定木間でのルール数の偏りが抑えられ、好適である。   Further, according to the present embodiment, a new rule is added to the entry list having the minimum number of valid rule entries in the INSERT process. As a result, the deviation in the number of rules among a plurality of decision trees is suppressed, which is preferable.

更に、本実施の形態によれば、INSERT処理やDELETE処理といったエントリの動的更新に要する処理時間が一定となる。   Furthermore, according to the present embodiment, the processing time required for dynamic update of entries such as INSERT processing and DELETE processing is constant.

具体的に、各処理に要するサイクル数、及びパケット分類器1に対する次のコマンド入力までのサイクル数の概算値を見積もる。尚、ここでの見積もりは、コマンド入力ブロック4、エントリ追加対象決定ブロック3、結果出力ブロック5、決定木ノード処理ブロック200、エントリ数カウントブロック21、ルール処理ブロック220においては、読み出し処理とそれに関連する処理、あるいは、書き込み処理とそれに関連する処理を、それぞれ1単位サイクルで実行できるとした場合の概算値である。ここで、1単位サイクルは望ましくは1クロックサイクルである。また、次のコマンド入力までのサイクル数は、厳密にはLOOKUP処理、INSERT処理、DELETE処理それぞれに対して次にどの処理コマンドを入力するかによって変わってくるが、ここでは次の処理コマンドを入力するまでサイクル数が最も大きい場合についての見積もり値である。   Specifically, the approximate number of cycles required for each process and the number of cycles until the next command input to the packet classifier 1 are estimated. The estimate here is for the command input block 4, the entry addition target determination block 3, the result output block 5, the decision tree node processing block 200, the entry count counting block 21, and the rule processing block 220. Or an approximate value when it is assumed that the writing process and the related process can be executed in one unit cycle. Here, one unit cycle is preferably one clock cycle. The number of cycles until the next command input changes depending on which processing command is input next to each of the LOOKUP processing, INSERT processing, and DELETE processing, but here the next processing command is input. This is an estimated value for the case where the number of cycles is the largest until.

LOOKUP処理の場合、パケット分類器1内の各メモリ領域に対しては、読み出ししか実行しない。そのため、コマンド入力ブロック4の処理、決定木処理ブロック2のH段の決定木パイプラインブロック20における処理、B段のルールパイプラインブロック22における処理、結果出力ブロック5の処理を、合計H+B+2単位サイクルで実行することが可能である。また、メモリ内の情報は更新されないため、LOOKUPコマンドを入力したすぐ次のサイクルにて、次のコマンドを入力することができる。   In the case of the LOOKUP process, only reading is executed for each memory area in the packet classifier 1. Therefore, the processing of the command input block 4, the processing of the decision tree processing block 2 in the H-stage decision tree pipeline block 20, the processing of the B-stage rule pipeline block 22, and the processing of the result output block 5 are total H + B + 2 unit cycles. It is possible to execute with. Further, since the information in the memory is not updated, the next command can be input in the next cycle after the LOOKUP command is input.

INSERT処理の場合、パケット分類器1内の各メモリ領域に対して、読み出し、書き込みが実行される。このため、コマンド入力ブロック4の処理、決定木処理ブロック2のH段の決定木パイプラインブロック20の処理、エントリ数カウントブロック21の読み出し処理、エントリ追加対象決定ブロック3の処理、エントリ数カウントブロック21の書き込み処理、B段のルールパイプラインブロック22における読み出し処理と1回の書き込み処理、結果出力ブロック5の処理を、H+B+6単位サイクルで実行することが可能である。また、エントリ数カウントブロック21のエントリ数記憶ブロック211の書き込み処理が完了した後で無ければ、次のコマンド、特にINSERT処理を正しく実行できない。このため、INSERTコマンドを入力後3単位サイクル経過すれば、次のコマンドを入力することができる。   In the case of the INSERT process, reading and writing are executed for each memory area in the packet classifier 1. For this reason, the process of the command input block 4, the process of the decision tree pipeline block 20 of the H stage of the decision tree process block 2, the read process of the entry count block 21, the process of the entry addition target determination block 3, the entry count block It is possible to execute 21 write processes, a read process in the B-stage rule pipeline block 22, a single write process, and a process in the result output block 5 in H + B + 6 unit cycles. Further, the next command, in particular, the INSERT processing cannot be correctly executed unless the writing processing of the entry number storage block 211 of the entry number counting block 21 is completed. For this reason, the next command can be input if three unit cycles elapse after the INSERT command is input.

DELETE処理の場合、INSERT処理の場合と同様、本パケット分類器内の各メモリ領域に対して、読み出し、書き込みが実行される。このため、コマンド入力ブロック4の処理、決定木処理ブロック2のH段の決定木パイプラインブロック20の処理、B段のルールパイプラインブロック22における読み出し処理と1回の書き込み処理、エントリ数カウントブロック21における1回の読み出しと1回の書き込み処理、結果出力ブロック5の処理を、H+B+5単位サイクルで実行することが可能である。また、エントリ数カウントブロック21のエントリ数記憶ブロック211の書き込み処理が完了した後で無ければ、次のコマンド、特にINSERT処理を正しく実行できない。このため、INSERTコマンドを入力後B+3単位サイクル経過すれば、次のコマンドを入力することができる。   In the case of the DELETE process, as in the case of the INSERT process, reading and writing are performed on each memory area in the packet classifier. Therefore, processing of the command input block 4, processing of the decision tree pipeline block 20 of the H stage of the decision tree processing block 2, read processing and one-time writing processing in the rule pipeline block 22 of the B stage, entry count count block It is possible to execute one read and one write process in 21 and the process of the result output block 5 in H + B + 5 unit cycles. Further, the next command, in particular, the INSERT processing cannot be correctly executed unless the writing processing of the entry number storage block 211 of the entry number counting block 21 is completed. For this reason, if B + 3 unit cycles elapse after the INSERT command is input, the next command can be input.

このように、本実施の形態では、例えば、LOOKUP処理はH+B+2単位サイクル、INSERT処理はH+B+6単位サイクル、DELETE処理はH+B+5単位サイクルといった固定時間で処理可能である。従来例のように、ルールの複製が要因で処理時間が変動するようなことはない。また、LOOKUP処理の場合は次の単位サイクルで、INSERT処理の場合は3単位サイクル経過後、DELETE処理の場合はB+3単位サイクル経過後に、次のコマンドを入力することができる。従って、わずかな処理オーバーヘッドで、各処理を実行することが可能である。   Thus, in this embodiment, for example, the LOOKUP process can be processed in a fixed time such as H + B + 2 unit cycles, the INSERT process is H + B + 6 unit cycles, and the DELETE process is H + B + 5 unit cycles. Unlike the conventional example, the processing time does not fluctuate due to duplication of rules. In the case of LOOKUP processing, the next command can be input after the next unit cycle, in the case of INSERT processing after 3 unit cycles have elapsed, and in the case of DELETE processing, the next command can be input after B + 3 unit cycles. Therefore, each process can be executed with a slight processing overhead.

2.第2の実施の形態
次に、本発明の第2の実施の形態を説明する。尚、第1の実施の形態と重複する説明は適宜省略される。
2. Second Embodiment Next, a second embodiment of the present invention will be described. In addition, the description which overlaps with 1st Embodiment is abbreviate | omitted suitably.

2−1.構成及び概要
図24は、第2の実施の形態に係るパケット分類器1の構成を示すブロック図である。図4で示された第1の実施の形態の構成と比較して、決定木処理ブロック2−1〜2−Nが、それぞれ、決定木処理ブロック9−1〜9−Nによって置き換えられている。
2-1. Configuration and Outline FIG. 24 is a block diagram illustrating a configuration of the packet classifier 1 according to the second embodiment. Compared with the configuration of the first embodiment shown in FIG. 4, the decision tree processing blocks 2-1 to 2-N are replaced by decision tree processing blocks 9-1 to 9-N, respectively. .

図25は、第2の実施の形態に係る決定木処理ブロック9の構成を示すブロック図である。図5で示された決定木処理ブロック2の構成と比較して、エントリ数カウントブロック21が省かれている。また、ルールパイプラインブロック22のルール処理ブロック220−Bは、出力データ26をエントリ追加対象決定ブロック3に出力する。また、ルール処理ブロック220−1は、エントリ追加対象決定ブロックから入力データ27を受け取る。   FIG. 25 is a block diagram illustrating a configuration of the decision tree processing block 9 according to the second embodiment. Compared with the configuration of the decision tree processing block 2 shown in FIG. 5, the entry count block 21 is omitted. Also, the rule processing block 220 -B of the rule pipeline block 22 outputs the output data 26 to the entry addition target determination block 3. The rule processing block 220-1 receives the input data 27 from the entry addition target determination block.

本実施の形態によれば、INSERT処理時、エントリ追加対象候補の全てが、一旦、新規ルールを決定木に追加する。この処理は、以下「一時追加処理」と参照される。より詳細には、一時追加処理において、エントリ追加対象候補の各々のルールパイプラインブロック22が、追加対象葉ノードによって管理されるルールリストに新規ルールを一時的に追加する。この一時追加処理の最中に、ルールパイプラインブロック22は、当該ルールリスト中の有効ルールエントリ数をカウントする。そして、ルールパイプラインブロック22が、エントリ数カウントブロック21の代わりに、有効ルールエントリ数をエントリ追加対象決定ブロック3に通知する。具体的には、ルールパイプラインブロック22の最終段のルール処理ブロック220−Bが、一時追加処理を通して得られた有効ルールエントリ数を示す出力データ26を、エントリ追加対象決定ブロック3に出力する。   According to this embodiment, at the time of INSERT processing, all of the entry addition target candidates temporarily add new rules to the decision tree. This process is hereinafter referred to as “temporary addition process”. More specifically, in the temporary addition process, each rule pipeline block 22 of the entry addition target candidate temporarily adds a new rule to the rule list managed by the addition target leaf node. During this temporary addition process, the rule pipeline block 22 counts the number of valid rule entries in the rule list. The rule pipeline block 22 notifies the entry addition target determination block 3 of the number of valid rule entries instead of the entry count block 21. Specifically, the rule processing block 220 -B at the final stage of the rule pipeline block 22 outputs output data 26 indicating the number of valid rule entries obtained through the temporary addition process to the entry addition target determination block 3.

エントリ追加対象決定ブロック3は、第1の実施の形態と同様に、エントリ追加対象候補の中から1つのエントリ追加対象を選択する。そして、エントリ追加対象決定ブロック3は、選択結果を示す情報(入力データ27)を、全てのエントリ追加対象候補に送る。   As in the first embodiment, the entry addition target determination block 3 selects one entry addition target from among the entry addition target candidates. Then, the entry addition target determination block 3 sends information (input data 27) indicating the selection result to all entry addition target candidates.

選択されたエントリ追加対象以外のエントリ追加対象候補の各々は、「追加エントリ無効化処理」を行う。この追加エントリ無効化処理では、当該エントリ追加対象候補は、上記一時追加処理によって一時的に追加された新規ルールを無効化する。追加エントリ無効化処理は、DELETE処理と同様に実現可能である。   Each of the entry addition target candidates other than the selected entry addition target performs “addition entry invalidation processing”. In this additional entry invalidation process, the entry addition target candidate invalidates the new rule temporarily added by the temporary addition process. The additional entry invalidation process can be realized in the same manner as the DELETE process.

このように、本実施の形態によれば、エントリ数カウントブロック21を用いることなく、第1の実施の形態と同じ処理結果を得ることができる。エントリ数カウントブロック21が省かれるため、全体のメモリ容量を削減することが可能である。   Thus, according to the present embodiment, the same processing result as that of the first embodiment can be obtained without using the entry count block 21. Since the entry count block 21 is omitted, the entire memory capacity can be reduced.

2−2.動作
次に、本実施の形態に係るパケット分類器1の動作を詳しく説明する。
2-2. Operation Next, the operation of the packet classifier 1 according to the present embodiment will be described in detail.

2−2−1.LOOKUP処理
LOOKUP処理は、第1の実施の形態の場合と同様である。
2-2-1. LOOKUP process The LOOKUP process is the same as in the first embodiment.

2−2−2.INSERT処理
次に、INSERT処理を説明する。図26は、本実施の形態におけるINSERT処理を示すフローチャートである。ステップA1、A6、A13は、第1の実施の形態のINSERT処理の場合と同じである。
2-2-2. INSERT Processing Next, INSERT processing will be described. FIG. 26 is a flowchart showing the INSERT processing in the present embodiment. Steps A1, A6, and A13 are the same as those in the INSERT processing of the first embodiment.

ステップA3:
ステップA6が終了すると、ステップA7の代わりに、LOOKUP処理の場合と同様にステップA3が実行される。すなわち、決定木ノード処理ブロック200−Hは、ルールパイプラインブロック22のルール処理ブロック220−1に、算出したアドレス値とコマンドを含む出力データ2003を出力する。
Step A3:
When step A6 ends, step A3 is executed instead of step A7 as in the case of the LOOKUP process. That is, the decision tree node processing block 200-H outputs the output data 2003 including the calculated address value and command to the rule processing block 220-1 of the rule pipeline block 22.

ステップA18:
ルールパイプラインブロック22は、上述の「一時追加処理」を実行する。図27は、本ステップA18の処理を示すフローチャートである。
Step A18:
The rule pipeline block 22 executes the “temporary addition process” described above. FIG. 27 is a flowchart showing the processing of step A18.

ステップC12:
ステップA18は、ルールリスト中の1番目のルールから開始する。具体的には、初段のルール処理ブロック220−1から処理を開始する。ここで、有効ルールエントリ数は、初期値0に設定される。
Step C12:
Step A18 starts with the first rule in the rule list. Specifically, the processing is started from the first-stage rule processing block 220-1. Here, the number of valid rule entries is set to an initial value of zero.

ステップC2、C3、C19:
第1の実施の形態と同様に、ルール処理ブロック220は、エントリ情報を読み出し、有効フラグを確認する(ステップC2)。ルールが有効である場合(ステップC3;Yes)、ルール処理ブロック220は、有効ルールエントリ数に“1”を加算する(ステップC19)。その後、処理はステップC15に進む。
Steps C2, C3, C19:
Similar to the first embodiment, the rule processing block 220 reads the entry information and checks the valid flag (step C2). If the rule is valid (step C3; Yes), the rule processing block 220 adds “1” to the number of valid rule entries (step C19). Thereafter, the processing proceeds to step C15.

ステップC15:
ルール処理ブロック220−iは、次段のルール処理ブロック220−(i+1)に、アドレス値及びコマンドに加えて有効ルールエントリ数を含む出力データ2204を出力する。そして、処理はステップC2に戻り、ルールリスト中の次のルールに対する処理が実行される。
Step C15:
The rule processing block 220-i outputs output data 2204 including the number of valid rule entries in addition to the address value and command to the next-stage rule processing block 220- (i + 1). Then, the process returns to step C2, and the process for the next rule in the rule list is executed.

ステップC13:
一方、ルールが有効ではない場合(ステップC3;No)、ルール処理ブロック220は、コマンド内の終了フラグを参照する。終了フラグが‘1’である場合(ステップC13;Yes)、処理は上記ステップC15に進む。一方、終了フラグが‘0’である場合(ステップC13;No)、処理はステップC14に進む。
Step C13:
On the other hand, when the rule is not valid (step C3; No), the rule processing block 220 refers to the end flag in the command. If the end flag is “1” (step C13; Yes), the process proceeds to step C15. On the other hand, when the end flag is “0” (step C13; No), the process proceeds to step C14.

ステップC14:
第1の実施の形態と同様に、ルール処理ブロック220は、当該エントリ(すなわち、空きエントリ)に新規ルールを書き込み、有効フラグを‘1’に設定する。更に、ルール処理ブロック220は、コマンド内の終了フラグを‘1’に設定し、結果フラグを‘1’(追加成功)に設定する。その後、処理はステップC9に進む。
Step C14:
Similar to the first embodiment, the rule processing block 220 writes a new rule to the entry (that is, an empty entry) and sets the valid flag to “1”. Further, the rule processing block 220 sets the end flag in the command to “1”, and sets the result flag to “1” (addition success). Thereafter, the processing proceeds to step C9.

ステップC9、C20:
第1の実施の形態と同様に、現在のルールが、ルールリスト中の最後のルールか否かが判定される。現在のルールが最後のルールではない場合(ステップC9;No)、処理は上記ステップC15に進む。一方、最後のルールの場合(ステップC9;Yes)、ルール処理ブロック220−Bは、現在のコマンド及び有効ルールエントリ数を、エントリ追加対象決定ブロック3に出力する(ステップC20)。そして、ステップA18が終了する。
Steps C9 and C20:
As in the first embodiment, it is determined whether or not the current rule is the last rule in the rule list. If the current rule is not the last rule (step C9; No), the process proceeds to step C15. On the other hand, in the case of the last rule (step C9; Yes), the rule processing block 220-B outputs the current command and the number of valid rule entries to the entry addition target determination block 3 (step C20). Then, step A18 ends.

ステップA9:
次に、エントリ追加対象決定ブロック3は、第1の実施の形態と同様に、エントリ追加対象候補の中からエントリ追加対象を選択する。そして、エントリ追加対象決定ブロック3は、選択結果を示す情報を、全てのエントリ追加対象候補に送る。
Step A9:
Next, the entry addition target determination block 3 selects an entry addition target from among the entry addition target candidates, as in the first embodiment. Then, the entry addition target determination block 3 sends information indicating the selection result to all entry addition target candidates.

ステップA14:
ルールパイプラインブロック22は、上述の「追加エントリ無効化処理」を実行する。この追加エントリ無効化処理は、DELETE処理と同様に行われる。ここで、削除対象のルールは、一時追加処理によって追加された新規ルールである。尚、追加エントリ無効化処理を実施する際のコマンドの処理種別として、第1の実施の形態で使用されなかった“11”を用いることが考えられる。また、このときの終了フラグ、結果フラグについては、初期化しておく。
Step A14:
The rule pipeline block 22 executes the “addition entry invalidation process” described above. This additional entry invalidation process is performed in the same manner as the DELETE process. Here, the rule to be deleted is a new rule added by the temporary addition process. Note that “11” that is not used in the first embodiment may be used as the command processing type when the additional entry invalidation processing is performed. The end flag and result flag at this time are initialized.

2−2−3.DELETE処理
図28は、本実施の形態におけるDELETE処理を示すフローチャートである。本実施の形態によれば、エントリ数カウントブロック21が省かれている。従って、図22で示された第1の実施の形態におけるDELETE処理と比較して、エントリ数カウントブロック21に関連するステップA15、A16を省略することができる。その他は、第1の実施の形態と同様である。
2-2-3. DELETE Process FIG. 28 is a flowchart showing the DELETE process in the present embodiment. According to the present embodiment, the entry count block 21 is omitted. Therefore, as compared with the DELETE process in the first embodiment shown in FIG. 22, steps A15 and A16 related to the entry count block 21 can be omitted. Others are the same as those in the first embodiment.

2−3.効果
本実施の形態によれば、第1の実施の形態と同じ効果が得られる。更に、メモリ領域が削減される。
2-3. Effect According to the present embodiment, the same effect as in the first embodiment can be obtained. Further, the memory area is reduced.

第1の実施の形態の場合と同様に、各処理に要するサイクル数、及びパケット分類器1に対する次のコマンド入力までのサイクル数の概算値を見積もる。   As in the case of the first embodiment, the approximate number of cycles required for each process and the approximate number of cycles until the next command input to the packet classifier 1 are estimated.

LOOKUP処理は、第1の実施の形態と同じである。   The LOOKUP process is the same as that in the first embodiment.

INSERT処理は、コマンド入力ブロック4の処理、決定木処理ブロック2のH段の決定木パイプラインブロック20の処理、B段のルールパイプラインブロック22における読み出し処理と1回の書き込み処理、エントリ追加対象決定ブロック3の処理、さらに、B段のルールパイプラインブロック22における読み出し処理と1回の書き込み処理、結果出力ブロック5の処理を含む。従って、全体で、H+2B+5単位サイクルで実行することが可能である。また、追加対象木以外の決定木に対する追加エントリの無効化を完了しなければ、その後の処理を待ち合わせ無く行うことができない。このため、INSERTコマンドを入力後B+3単位サイクル経過すれば、次のコマンドを入力することができる。   The INSERT processing includes processing of the command input block 4, processing of the H-stage decision tree pipeline block 20 of the decision tree processing block 2, reading processing and one-time writing processing in the B-stage rule pipeline block 22, and entry addition targets The processing of the decision block 3, and further includes the reading processing in the B-stage rule pipeline block 22, one writing processing, and processing of the result output block 5. Therefore, it is possible to execute in H + 2B + 5 unit cycles as a whole. Further, if invalidation of the additional entry for the decision tree other than the addition target tree is not completed, the subsequent processing cannot be performed without waiting. For this reason, if B + 3 unit cycles elapse after the INSERT command is input, the next command can be input.

DELETE処理は、コマンド入力ブロック4の処理、決定木処理ブロック2のH段の決定木パイプラインブロック20の処理、B段のルールパイプラインブロック22における読み出し処理と1回の書き込み処理、結果出力ブロック5の処理を含む。従って、全体で、H+B+3単位サイクルで実行することが可能である。一方、削除対象エントリは順次削除されるため、エントリの削除を行うルールパイプラインブロック22における1回の書き込み処理を考慮し、DELETEコマンドを入力後1単位サイクル経過すれば、次のコマンドを入力することができる。   The DELETE processing includes processing of the command input block 4, processing of the decision tree pipeline block 20 in the H stage of the decision tree processing block 2, reading processing and writing processing once in the rule pipeline block 22 of the B stage, and result output block 5 processes are included. Therefore, it is possible to execute in H + B + 3 unit cycles as a whole. On the other hand, since the entries to be deleted are sequentially deleted, the next command is input when one unit cycle elapses after the DELETE command is input in consideration of one writing process in the rule pipeline block 22 that deletes the entries. be able to.

このように、本実施の形態では、例えば、LOOKUP処理はH+B+2単位サイクル、INSERT処理はH+2B+5単位サイクル、DELETE処理はH+B+3単位サイクルといった固定時間で処理可能である。従来例のように、ルールの複製が要因で処理時間が変動するようなことはない。また、LOOKUP処理の場合は次の単位サイクルで、INSERT処理の場合はB+3単位サイクル経過後、DELETE処理の場合は1単位サイクル経過後に次のコマンドを入力することができる。従って、わずかな処理オーバーヘッドが必要になるものの、各処理を順次実行することが可能である。   Thus, in this embodiment, for example, the LOOKUP process can be processed in a fixed time such as H + B + 2 unit cycles, the INSERT process is H + 2B + 5 unit cycles, and the DELETE process is H + B + 3 unit cycles. Unlike the conventional example, the processing time does not fluctuate due to duplication of rules. The next command can be input in the next unit cycle in the case of LOOKUP processing, the B + 3 unit cycle in the case of INSERT processing, and the one unit cycle in the case of DELETE processing. Therefore, although a slight processing overhead is required, each process can be executed sequentially.

3.第3の実施の形態
本発明の第3の実施の形態は、コマンドの構成及びそのコマンドを用いたINSERT処理が、第2の実施の形態と異なる。構成、LOOKUP処理及びDELETE処理は第2の実施の形態と同様であり、重複する説明は適宜省略される。
3. Third Embodiment A third embodiment of the present invention differs from the second embodiment in the configuration of commands and the INSERT processing using the commands. The configuration, the LOOKUP process, and the DELETE process are the same as those in the second embodiment, and redundant descriptions are omitted as appropriate.

図29は、第3の実施の形態におけるコマンドの構成例を示す概念図である。図29に示されるように、本実施の形態によれば、コマンド部に更に「エントリ追加リストID」のフィールドが追加されている。このエントリ追加リストIDは、上述の一時追加処理において新規ルールが追加された位置(段数)を示す位置情報である。つまり、ルール処理ブロック220−i(i=1、2、・・・、B)において新規ルールが追加された場合、エントリ追加リストIDには“i”が設定される。   FIG. 29 is a conceptual diagram illustrating a command configuration example according to the third embodiment. As shown in FIG. 29, according to the present embodiment, a field of “entry addition list ID” is further added to the command portion. This entry addition list ID is position information indicating the position (number of stages) where a new rule is added in the temporary addition process described above. That is, when a new rule is added in the rule processing block 220-i (i = 1, 2,..., B), “i” is set in the entry addition list ID.

図30は、本実施の形態におけるINSERT処理を示すフローチャートである。本実施の形態では、一時追加処理として、第2の実施の形態でのステップA18の代わりに、ステップA19が実行される。また、追加エントリ無効化処理として、第2の実施の形態でのステップA14の代わりに、ステップA20が実行される。その他は、第2の実施の形態と同様である。   FIG. 30 is a flowchart showing INSERT processing in the present embodiment. In the present embodiment, step A19 is executed as a temporary addition process instead of step A18 in the second embodiment. As additional entry invalidation processing, step A20 is executed instead of step A14 in the second embodiment. Others are the same as in the second embodiment.

ステップA19:
図31は、ステップA19の処理を示すフローチャートである。第2の実施の形態でのステップA18(図27参照)と比較して、ステップC14とステップC9との間にステップC21が追加されている。ステップC21において、ルール処理ブロック220−iは、コマンドのエントリ追加リストIDを、当該ルール処理ブロックのID(=i)に設定する。その他は、ステップA18と同様である。
Step A19:
FIG. 31 is a flowchart showing the process of step A19. Compared with step A18 (refer FIG. 27) in 2nd Embodiment, step C21 is added between step C14 and step C9. In step C21, the rule processing block 220-i sets the entry addition list ID of the command to the ID (= i) of the rule processing block. Others are the same as step A18.

ステップA20:
図32は、ステップA20の処理を示すフローチャートである。
Step A20:
FIG. 32 is a flowchart showing the process of step A20.

ステップC1:
ステップA20は、ルールリスト中の1番目のルールから開始する。具体的には、初段のルール処理ブロック220−1から処理を開始する。
Step C1:
Step A20 starts from the first rule in the rule list. Specifically, the processing is started from the first-stage rule processing block 220-1.

ステップC22:
ルール処理ブロック220は、自身のIDが、入力されたコマンドのエントリ追加リストIDと一致するか否か判定する。一致の場合(ステップC22;Yes)、処理はステップC2に進む。一方、不一致の場合(ステップC22;No)、処理はステップC9に進む。
Step C22:
The rule processing block 220 determines whether its own ID matches the entry addition list ID of the input command. If they match (step C22; Yes), the process proceeds to step C2. On the other hand, if they do not match (step C22; No), the process proceeds to step C9.

ステップC2、C18:
ルール処理ブロック220は、入力されたアドレス値を用いてエントリ記憶ブロック2201からエントリ情報を読み出す(ステップC2)。更に、ルール処理ブロック220は、エントリ情報中の有効フラグを‘0’に設定し、エントリ記憶ブロック2201に書き込む。これにより、当該エントリ(ルール)は無効化される。更に、ルール処理ブロック220は、コマンド内の終了フラグを‘1’に設定し、結果フラグを‘1’(削除成功)に設定する。その後、処理はステップC9に進む。
Steps C2, C18:
The rule processing block 220 reads entry information from the entry storage block 2201 using the input address value (step C2). Further, the rule processing block 220 sets the valid flag in the entry information to “0” and writes it in the entry storage block 2201. Thereby, the entry (rule) is invalidated. Further, the rule processing block 220 sets the end flag in the command to “1”, and sets the result flag to “1” (deletion success). Thereafter, the processing proceeds to step C9.

ステップC9、C15:
既出の実施の形態の場合と同様に、現在のルールが、ルールリスト中の最後のルールか否かが判定される。現在のルールが最後のルールではない場合(ステップC9;No)、ルール処理ブロック220−iは、次段のルール処理ブロック220−(i+1)に、アドレス値とコマンドを含む出力データ2204を出力する(ステップC15)。そして、処理はステップC22に戻り、ルールリスト中の次のルールに対する処理が実行される。一方、現在のルールがルールリスト中の最後のルールである場合(ステップC9;Yes)、ステップA20は終了する。
Steps C9 and C15:
As in the case of the above-described embodiment, it is determined whether or not the current rule is the last rule in the rule list. When the current rule is not the last rule (step C9; No), the rule processing block 220-i outputs output data 2204 including an address value and a command to the next rule processing block 220- (i + 1). (Step C15). Then, the process returns to step C22, and the process for the next rule in the rule list is executed. On the other hand, when the current rule is the last rule in the rule list (step C9; Yes), step A20 ends.

本実施の形態によれば、第2の実施の形態と同じ効果が得られる。更に、追加エントリ無効化処理において、無効化しないルールに関するルールマッチング処理(読み出し/比較処理)をスキップすることができる。従って、処理時間及び消費電力が低減される。   According to the present embodiment, the same effect as in the second embodiment can be obtained. Furthermore, in the additional entry invalidation process, it is possible to skip the rule matching process (reading / comparison process) related to a rule that is not invalidated. Therefore, processing time and power consumption are reduced.

4.第4の実施の形態
図33は、本発明の第4の実施の形態に係るパケット分類器の構成を示すブロック図である。第4の実施の形態では、コンピュータがソフトウェアプログラムを実行することによりパケット分類処理が実現される。具体的には、本実施の形態に係るパケット分類器は、プログラム処理装置10とパケット分類プログラム11を備えている。プログラム処理装置10は、サーバやPC等のホストのCPUにより実現される。パケット分類プログラム11は、プログラム処理装置10によって実行されるコンピュータプログラムであり、プログラム処理装置10の動作を制御する。プログラム処理装置10は、パケット分類プログラム11を実行することにより、既出の実施の形態で説明されたパケット分類器1の機能を備えることができる。
4). Fourth Embodiment FIG. 33 is a block diagram showing a configuration of a packet classifier according to a fourth embodiment of the present invention. In the fourth embodiment, packet classification processing is realized by a computer executing a software program. Specifically, the packet classifier according to the present embodiment includes a program processing device 10 and a packet classification program 11. The program processing apparatus 10 is realized by a CPU of a host such as a server or a PC. The packet classification program 11 is a computer program executed by the program processing apparatus 10 and controls the operation of the program processing apparatus 10. The program processing apparatus 10 can have the function of the packet classifier 1 described in the foregoing embodiment by executing the packet classification program 11.

尚、パケット分類プログラム11は、コンピュータ読み取り可能な記録媒体に記録されていてもよい。   The packet classification program 11 may be recorded on a computer-readable recording medium.

プログラム処理装置10として、複数のCPUコアを有するマルチコアプロセッサ(さらには、より多くのCPUコアを有するメニーコアプロセッサ)を用いてもよい。その場合、それぞれのCPUコアに、コマンド入力ブロック4、決定木処理ブロック2−1〜2−N、エントリ追加対象決定ブロック3、結果出力ブロック5、さらには、決定木処理ブロック2を構成する各決定木ノード処理ブロック200、エントリ数カウントブロック21、ルール処理ブロック220の処理を実行させることにより、より高速な処理が可能となる。   As the program processing apparatus 10, a multi-core processor having a plurality of CPU cores (and a many-core processor having more CPU cores) may be used. In this case, each CPU core includes a command input block 4, decision tree processing blocks 2-1 to 2 -N, an entry addition target determination block 3, a result output block 5, and a decision tree processing block 2. By executing the processing of the decision tree node processing block 200, the entry number counting block 21, and the rule processing block 220, higher speed processing is possible.

以上、本発明の実施の形態が添付の図面を参照することにより説明された。但し、本発明は、上述の実施の形態に限定されず、要旨を逸脱しない範囲で当業者により適宜変更され得る。   The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the above-described embodiments, and can be appropriately changed by those skilled in the art without departing from the scope of the invention.

上記の実施形態の一部又は全部は、以下の付記のようにも記載されうるが、以下には限られない。   A part or all of the above-described embodiment can be described as in the following supplementary notes, but is not limited thereto.

(付記1)
パケット分類に用いられる複数の決定木のそれぞれを構成する複数の決定木処理ブロックと、
前記複数の決定木処理ブロックに対してコマンドを一斉に入力するコマンド入力ブロックと、
前記複数の決定木処理ブロックに接続されたエントリ追加対象決定ブロックと
を備え、
1つのルールは、前記複数の決定木のうちいずれか1つの決定木における単一の葉ノードによって管理され、
前記コマンドが検索コマンドである場合、前記複数の決定木処理ブロックの各々は、自身の決定木を用いることによって、検索キーがいずれかのルールにマッチするか否かを判定し、
前記コマンドが新たなルールを決定木に追加するための挿入コマンドである場合、前記複数の決定木処理ブロックの各々は、前記新たなルールが自身の決定木における単一の葉ノードによって管理され得るかどうかを判定し、
前記新たなルールが単一の葉ノードによって管理され得る場合、当該決定木処理ブロックはエントリ追加対象候補であり、当該単一の葉ノードは追加対象葉ノードであり、
前記エントリ追加対象決定ブロックは、前記新たなルールを追加する対象であるエントリ追加対象を、前記エントリ追加対象候補の中から選択し、
前記選択されたエントリ追加対象は、前記新たなルールを、自身の決定木における前記追加対象葉ノードが管理するルールリストに追加する
パケット分類器。
(Appendix 1)
A plurality of decision tree processing blocks constituting each of a plurality of decision trees used for packet classification;
A command input block for simultaneously inputting commands to the plurality of decision tree processing blocks;
An entry addition target decision block connected to the plurality of decision tree processing blocks;
One rule is managed by a single leaf node in any one of the plurality of decision trees,
When the command is a search command, each of the plurality of decision tree processing blocks determines whether or not the search key matches any rule by using its own decision tree.
If the command is an insert command for adding a new rule to a decision tree, each of the plurality of decision tree processing blocks can be managed by a single leaf node in which the new rule is in its decision tree Whether or not
When the new rule can be managed by a single leaf node, the decision tree processing block is an entry addition target candidate, the single leaf node is an addition target leaf node,
The entry addition target determination block selects an entry addition target to which the new rule is added from the entry addition target candidates,
The selected entry addition target adds the new rule to a rule list managed by the addition target leaf node in its own decision tree.

(付記2)
付記1に記載のパケット分類器であって、
前記エントリ追加対象候補は、前記追加対象葉ノードが管理している有効なルールのエントリ数を、前記エントリ追加対象決定ブロックに通知し、
前記エントリ追加対象決定ブロックは、前記エントリ数に基づいて、前記エントリ追加対象を選択する
パケット分類器。
(Appendix 2)
The packet classifier according to appendix 1,
The entry addition target candidate notifies the entry addition target determination block of the number of valid rule entries managed by the addition target leaf node,
The entry addition target determination block is a packet classifier that selects the entry addition target based on the number of entries.

(付記3)
付記2に記載のパケット分類器であって、
前記エントリ追加対象決定ブロックは、前記エントリ数が最小である前記エントリ追加対象候補を、前記エントリ追加対象として選択する
パケット分類器。
(Appendix 3)
The packet classifier according to attachment 2, wherein
The entry addition target determination block selects the entry addition target candidate having the minimum number of entries as the entry addition target.

(付記4)
付記2又は3に記載のパケット分類器であって、
前記複数の決定木処理ブロックの各々は、自身の決定木の各葉ノードによって管理されている有効なルールのエントリ数を記憶するエントリ数記憶ブロックを備え、
前記エントリ追加対象候補は、前記追加対象葉ノードに関する前記エントリ数を前記エントリ数記憶ブロックから読み出し、前記読み出したエントリ数を前記エントリ追加対象決定ブロックに通知し、
前記エントリ追加対象は、前記追加対象葉ノードに関する前記エントリ数に1を加算することにより、前記エントリ数記憶ブロックを更新する
パケット分類器。
(Appendix 4)
The packet classifier according to appendix 2 or 3,
Each of the plurality of decision tree processing blocks includes an entry number storage block for storing the number of valid rule entries managed by each leaf node of its own decision tree;
The entry addition target candidate reads the number of entries related to the addition target leaf node from the entry number storage block, notifies the entry addition target determination block of the read number of entries,
The entry addition target is a packet classifier that updates the entry number storage block by adding 1 to the number of entries related to the addition target leaf node.

(付記5)
付記4に記載のパケット分類器であって、
前記コマンドが既存ルールを削除するための削除コマンドである場合、前記複数の決定木処理ブロックの各々は、前記既存ルールが自身の決定木における単一の葉ノードによって管理されているか否かを判定し、
前記既存ルールが単一の葉ノードによって管理されている場合、当該決定木処理ブロックはエントリ削除対象であり、当該単一の葉ノードは削除対象葉ノードであり、
前記エントリ削除対象は、前記既存ルールを無効化し、また、前記削除対象葉ノードに関する前記エントリ数から1を減算することにより、前記エントリ数記憶ブロックを更新する
パケット分類器。
(Appendix 5)
The packet classifier according to appendix 4, wherein
If the command is a delete command for deleting an existing rule, each of the plurality of decision tree processing blocks determines whether the existing rule is managed by a single leaf node in its decision tree. And
When the existing rule is managed by a single leaf node, the decision tree processing block is an entry deletion target, the single leaf node is a deletion target leaf node,
The packet deletion classifier updates the entry number storage block by invalidating the existing rule and subtracting 1 from the number of entries related to the deletion target leaf node.

(付記6)
付記2又は3に記載のパケット分類器であって、
前記エントリ追加対象候補の各々は、前記追加対象葉ノードが管理するルールリストに前記新たなルールを一時的に追加する一時追加処理を行い、また、前記一時追加処理の最中に、当該ルールリスト中の有効なルールのエントリ数をカウントし、
前記エントリ追加対象候補の各々は、前記一時追加処理において得られた前記エントリ数を、前記エントリ追加対象決定ブロックに通知し、
前記選択されたエントリ追加対象以外の前記エントリ追加対象候補の各々は、前記一時的に追加された新たなルールを無効化する追加エントリ無効化処理を行う
パケット分類器。
(Appendix 6)
The packet classifier according to appendix 2 or 3,
Each of the entry addition target candidates performs a temporary addition process for temporarily adding the new rule to the rule list managed by the addition target leaf node, and during the temporary addition process, the rule list Count the number of active rule entries in
Each of the entry addition target candidates notifies the entry addition target determination block of the number of entries obtained in the temporary addition process,
Each of the entry addition target candidates other than the selected entry addition target performs an additional entry invalidation process for invalidating the newly added rule.

(付記7)
付記6に記載のパケット分類器であって、
前記一時追加処理において、前記エントリ追加対象候補の各々は、前記ルールリスト中で前記新たなルールが追加された位置を示す位置情報を前記挿入コマンドに書き込み、
前記選択されたエントリ追加対象以外の前記エントリ追加対象候補の各々は、前記位置情報を参照することによって、ルールマッチングを行うことなく、前記追加エントリ無効化処理を行う
パケット分類器。
(Appendix 7)
The packet classifier according to appendix 6, wherein
In the temporary addition process, each of the entry addition target candidates writes position information indicating a position where the new rule is added in the rule list to the insertion command,
Each of the entry addition target candidates other than the selected entry addition target performs the additional entry invalidation processing without performing rule matching by referring to the position information.

(付記8)
付記1乃至7のいずれか一項に記載のパケット分類器であって、
前記複数の決定木処理ブロックの各々は、
各決定木の段数と同じ段数の決定木ノード処理ブロックを備え、前記決定木ノード処理ブロックを用いることによって決定木の探索をパイプライン処理で行う決定木パイプラインブロックと、
各葉ノードにおいて管理可能なルール数と同じ段数のルール処理ブロックを備え、前記ルール処理ブロックを用いることによってルールの検索、追加及び削除をパイプライン処理で行うルールパイプラインブロックと
を備える
パケット分類器。
(Appendix 8)
The packet classifier according to any one of appendices 1 to 7,
Each of the plurality of decision tree processing blocks is
A decision tree pipeline block having a decision tree node processing block having the same number of stages as each decision tree, and performing a search of the decision tree by pipeline processing by using the decision tree node processing block;
A packet classifier comprising a rule processing block having the same number of stages as the number of rules that can be managed in each leaf node, and a rule pipeline block that searches, adds, and deletes rules by pipeline processing by using the rule processing block .

(付記9)
複数の決定木を用いたパケット分類方法であって、
1つのルールは、前記複数の決定木のうちいずれか1つの決定木における単一の葉ノードによって管理され、
前記パケット分類方法は、
前記複数の決定木に対してコマンドを一斉に入力するステップと、
前記コマンドが検索コマンドである場合、前記複数の決定木の各々において、検索キーがいずれかのルールにマッチするか否かを判定するステップと、
前記コマンドが新たなルールを決定木に追加するための挿入コマンドである場合、前記複数の決定木の各々において、前記新たなルールが単一の葉ノードによって管理され得るかどうかを判定するステップと、ここで、前記新たなルールが単一の葉ノードによって管理され得る場合、当該決定木はエントリ追加対象候補であり、当該単一の葉ノードは追加対象葉ノードであり、
前記新たなルールを追加する対象であるエントリ追加対象を、前記エントリ追加対象候補の中から選択するステップと、
前記新たなルールを、前記エントリ追加対象の前記追加対象葉ノードが管理するルールリストに追加するステップと
を含む
パケット分類方法。
(Appendix 9)
A packet classification method using a plurality of decision trees,
One rule is managed by a single leaf node in any one of the plurality of decision trees,
The packet classification method includes:
Inputting commands simultaneously to the plurality of decision trees;
If the command is a search command, determining whether a search key matches any rule in each of the plurality of decision trees;
Determining whether in each of the plurality of decision trees, the new rule can be managed by a single leaf node if the command is an insert command for adding a new rule to the decision tree; Here, if the new rule can be managed by a single leaf node, the decision tree is an entry addition candidate, the single leaf node is an addition leaf node,
Selecting an entry addition target to which the new rule is to be added from the entry addition target candidates;
Adding the new rule to a rule list managed by the addition target leaf node of the entry addition target.

(付記10)
複数の決定木を用いたパケット分類処理をコンピュータに実行させるためのパケット分類プログラムであって、
1つのルールは、前記複数の決定木のうちいずれか1つの決定木における単一の葉ノードによって管理され、
前記パケット分類処理は、
前記複数の決定木に対してコマンドを一斉に入力するステップと、
前記コマンドが検索コマンドである場合、前記複数の決定木の各々において、検索キーがいずれかのルールにマッチするか否かを判定するステップと、
前記コマンドが新たなルールを決定木に追加するための挿入コマンドである場合、前記複数の決定木の各々において、前記新たなルールが単一の葉ノードによって管理され得るかどうかを判定するステップと、ここで、前記新たなルールが単一の葉ノードによって管理され得る場合、当該決定木はエントリ追加対象候補であり、当該単一の葉ノードは追加対象葉ノードであり、
前記新たなルールを追加する対象であるエントリ追加対象を、前記エントリ追加対象候補の中から選択するステップと、
前記新たなルールを、前記エントリ追加対象の前記追加対象葉ノードが管理するルールリストに追加するステップと
を含む
パケット分類プログラム。
(Appendix 10)
A packet classification program for causing a computer to execute packet classification processing using a plurality of decision trees,
One rule is managed by a single leaf node in any one of the plurality of decision trees,
The packet classification process includes:
Inputting commands simultaneously to the plurality of decision trees;
If the command is a search command, determining whether a search key matches any rule in each of the plurality of decision trees;
Determining whether in each of the plurality of decision trees, the new rule can be managed by a single leaf node if the command is an insert command for adding a new rule to the decision tree; Here, if the new rule can be managed by a single leaf node, the decision tree is an entry addition candidate, the single leaf node is an addition leaf node,
Selecting an entry addition target to which the new rule is to be added from the entry addition target candidates;
Adding the new rule to a rule list managed by the addition target leaf node to which the entry is to be added.

本出願は、2010年12月15日に出願された日本国特許出願2010−279693を基礎とする優先権を主張し、その開示の全てをここに取り込む。   This application claims the priority on the basis of the Japan patent application 2010-279593 for which it applied on December 15, 2010, and takes in those the indications of all here.

1 パケット分類器
2 決定木処理ブロック
3 エントリ追加対象決定ブロック
4 コマンド入力ブロック
5 結果出力ブロック
9 決定木処理ブロック
10 プログラム処理装置
11 パケット分類プログラム
20 決定木パイプラインブロック
21 エントリ数カウントブロック
22 ルールパイプラインブロック
200 決定木ノード処理ブロック
210 カウント処理ブロック
211 エントリ数記憶ブロック
220 ルール処理ブロック
2000 子ノード決定ブロック
2001 ノード情報記憶ブロック
2200 比較更新処理ブロック
2201 エントリ記憶ブロック
DESCRIPTION OF SYMBOLS 1 Packet classifier 2 Decision tree processing block 3 Entry addition object decision block 4 Command input block 5 Result output block 9 Decision tree processing block 10 Program processing device 11 Packet classification program 20 Decision tree pipeline block 21 Entry count block 22 Rule pipe Line block 200 Decision tree node processing block 210 Count processing block 211 Entry number storage block 220 Rule processing block 2000 Child node determination block 2001 Node information storage block 2200 Comparison update processing block 2201 Entry storage block

Claims (10)

パケット分類に用いられる複数の決定木のそれぞれを構成する複数の決定木処理ブロックと、
前記複数の決定木処理ブロックに対してコマンドを一斉に入力するコマンド入力ブロックと、
前記複数の決定木処理ブロックに接続されたエントリ追加対象決定ブロックと
を備え、
1つのルールは、前記複数の決定木のうちいずれか1つの決定木における単一の葉ノードによって管理され、
前記コマンドが検索コマンドである場合、前記複数の決定木処理ブロックの各々は、自身の決定木を用いることによって、検索キーがいずれかのルールにマッチするか否かを判定し、
前記コマンドが新たなルールを決定木に追加するための挿入コマンドである場合、前記複数の決定木処理ブロックの各々は、前記新たなルールが自身の決定木における単一の葉ノードによって管理され得るかどうかを判定し、
前記新たなルールが単一の葉ノードによって管理され得る場合、当該決定木処理ブロックはエントリ追加対象候補であり、当該単一の葉ノードは追加対象葉ノードであり、
前記エントリ追加対象決定ブロックは、前記新たなルールを追加する対象であるエントリ追加対象を、前記エントリ追加対象候補の中から選択し、
前記選択されたエントリ追加対象は、前記新たなルールを、自身の決定木における前記追加対象葉ノードが管理するルールリストに追加する
パケット分類器。
A plurality of decision tree processing blocks constituting each of a plurality of decision trees used for packet classification;
A command input block for simultaneously inputting commands to the plurality of decision tree processing blocks;
An entry addition target decision block connected to the plurality of decision tree processing blocks;
One rule is managed by a single leaf node in any one of the plurality of decision trees,
When the command is a search command, each of the plurality of decision tree processing blocks determines whether or not the search key matches any rule by using its own decision tree.
If the command is an insert command for adding a new rule to a decision tree, each of the plurality of decision tree processing blocks can be managed by a single leaf node in which the new rule is in its decision tree Whether or not
When the new rule can be managed by a single leaf node, the decision tree processing block is an entry addition target candidate, the single leaf node is an addition target leaf node,
The entry addition target determination block selects an entry addition target to which the new rule is added from the entry addition target candidates,
The selected entry addition target adds the new rule to a rule list managed by the addition target leaf node in its own decision tree.
請求項1に記載のパケット分類器であって、
前記エントリ追加対象候補は、前記追加対象葉ノードが管理している有効なルールのエントリ数を、前記エントリ追加対象決定ブロックに通知し、
前記エントリ追加対象決定ブロックは、前記エントリ数に基づいて、前記エントリ追加対象を選択する
パケット分類器。
The packet classifier according to claim 1, wherein
The entry addition target candidate notifies the entry addition target determination block of the number of valid rule entries managed by the addition target leaf node,
The entry addition target determination block is a packet classifier that selects the entry addition target based on the number of entries.
請求項2に記載のパケット分類器であって、
前記エントリ追加対象決定ブロックは、前記エントリ数が最小である前記エントリ追加対象候補を、前記エントリ追加対象として選択する
パケット分類器。
The packet classifier according to claim 2, wherein
The entry addition target determination block selects the entry addition target candidate having the minimum number of entries as the entry addition target.
請求項2又は3に記載のパケット分類器であって、
前記複数の決定木処理ブロックの各々は、自身の決定木の各葉ノードによって管理されている有効なルールのエントリ数を記憶するエントリ数記憶ブロックを備え、
前記エントリ追加対象候補は、前記追加対象葉ノードに関する前記エントリ数を前記エントリ数記憶ブロックから読み出し、前記読み出したエントリ数を前記エントリ追加対象決定ブロックに通知し、
前記エントリ追加対象は、前記追加対象葉ノードに関する前記エントリ数に1を加算することにより、前記エントリ数記憶ブロックを更新する
パケット分類器。
The packet classifier according to claim 2 or 3, wherein
Each of the plurality of decision tree processing blocks includes an entry number storage block for storing the number of valid rule entries managed by each leaf node of its own decision tree;
The entry addition target candidate reads the number of entries related to the addition target leaf node from the entry number storage block, notifies the entry addition target determination block of the read number of entries,
The entry addition target is a packet classifier that updates the entry number storage block by adding 1 to the number of entries related to the addition target leaf node.
請求項4に記載のパケット分類器であって、
前記コマンドが既存ルールを削除するための削除コマンドである場合、前記複数の決定木処理ブロックの各々は、前記既存ルールが自身の決定木における単一の葉ノードによって管理されているか否かを判定し、
前記既存ルールが単一の葉ノードによって管理されている場合、当該決定木処理ブロックはエントリ削除対象であり、当該単一の葉ノードは削除対象葉ノードであり、
前記エントリ削除対象は、前記既存ルールを無効化し、また、前記削除対象葉ノードに関する前記エントリ数から1を減算することにより、前記エントリ数記憶ブロックを更新する
パケット分類器。
The packet classifier according to claim 4, wherein
If the command is a delete command for deleting an existing rule, each of the plurality of decision tree processing blocks determines whether the existing rule is managed by a single leaf node in its decision tree. And
When the existing rule is managed by a single leaf node, the decision tree processing block is an entry deletion target, the single leaf node is a deletion target leaf node,
The packet deletion classifier updates the entry number storage block by invalidating the existing rule and subtracting 1 from the number of entries related to the deletion target leaf node.
請求項2又は3に記載のパケット分類器であって、
前記エントリ追加対象候補の各々は、前記追加対象葉ノードが管理するルールリストに前記新たなルールを一時的に追加する一時追加処理を行い、また、前記一時追加処理の最中に、当該ルールリスト中の有効なルールのエントリ数をカウントし、
前記エントリ追加対象候補の各々は、前記一時追加処理において得られた前記エントリ数を、前記エントリ追加対象決定ブロックに通知し、
前記選択されたエントリ追加対象以外の前記エントリ追加対象候補の各々は、前記一時的に追加された新たなルールを無効化する追加エントリ無効化処理を行う
パケット分類器。
The packet classifier according to claim 2 or 3, wherein
Each of the entry addition target candidates performs a temporary addition process for temporarily adding the new rule to the rule list managed by the addition target leaf node, and during the temporary addition process, the rule list Count the number of active rule entries in
Each of the entry addition target candidates notifies the entry addition target determination block of the number of entries obtained in the temporary addition process,
Each of the entry addition target candidates other than the selected entry addition target performs an additional entry invalidation process for invalidating the newly added rule.
請求項6に記載のパケット分類器であって、
前記一時追加処理において、前記エントリ追加対象候補の各々は、前記ルールリスト中で前記新たなルールが追加された位置を示す位置情報を前記挿入コマンドに書き込み、
前記選択されたエントリ追加対象以外の前記エントリ追加対象候補の各々は、前記位置情報を参照することによって、ルールマッチングを行うことなく、前記追加エントリ無効化処理を行う
パケット分類器。
The packet classifier according to claim 6, comprising:
In the temporary addition process, each of the entry addition target candidates writes position information indicating a position where the new rule is added in the rule list to the insertion command,
Each of the entry addition target candidates other than the selected entry addition target performs the additional entry invalidation processing without performing rule matching by referring to the position information.
請求項1乃至7のいずれか一項に記載のパケット分類器であって、
前記複数の決定木処理ブロックの各々は、
各決定木の段数と同じ段数の決定木ノード処理ブロックを備え、前記決定木ノード処理ブロックを用いることによって決定木の探索をパイプライン処理で行う決定木パイプラインブロックと、
各葉ノードにおいて管理可能なルール数と同じ段数のルール処理ブロックを備え、前記ルール処理ブロックを用いることによってルールの検索、追加及び削除をパイプライン処理で行うルールパイプラインブロックと
を備える
パケット分類器。
The packet classifier according to any one of claims 1 to 7,
Each of the plurality of decision tree processing blocks is
A decision tree pipeline block having a decision tree node processing block having the same number of stages as each decision tree, and performing a search of the decision tree by pipeline processing by using the decision tree node processing block;
A packet classifier comprising a rule processing block having the same number of stages as the number of rules that can be managed in each leaf node, and a rule pipeline block that searches, adds, and deletes rules by pipeline processing by using the rule processing block .
複数の決定木を用いたパケット分類方法であって、
1つのルールは、前記複数の決定木のうちいずれか1つの決定木における単一の葉ノードによって管理され、
前記パケット分類方法は、
前記複数の決定木に対してコマンドを一斉に入力するステップと、
前記コマンドが検索コマンドである場合、前記複数の決定木の各々において、検索キーがいずれかのルールにマッチするか否かを判定するステップと、
前記コマンドが新たなルールを決定木に追加するための挿入コマンドである場合、前記複数の決定木の各々において、前記新たなルールが単一の葉ノードによって管理され得るかどうかを判定するステップと、ここで、前記新たなルールが単一の葉ノードによって管理され得る場合、当該決定木はエントリ追加対象候補であり、当該単一の葉ノードは追加対象葉ノードであり、
前記新たなルールを追加する対象であるエントリ追加対象を、前記エントリ追加対象候補の中から選択するステップと、
前記新たなルールを、前記エントリ追加対象の前記追加対象葉ノードが管理するルールリストに追加するステップと
を含む
パケット分類方法。
A packet classification method using a plurality of decision trees,
One rule is managed by a single leaf node in any one of the plurality of decision trees,
The packet classification method includes:
Inputting commands simultaneously to the plurality of decision trees;
If the command is a search command, determining whether a search key matches any rule in each of the plurality of decision trees;
Determining whether in each of the plurality of decision trees, the new rule can be managed by a single leaf node if the command is an insert command for adding a new rule to the decision tree; Here, if the new rule can be managed by a single leaf node, the decision tree is an entry addition candidate, the single leaf node is an addition leaf node,
Selecting an entry addition target to which the new rule is to be added from the entry addition target candidates;
Adding the new rule to a rule list managed by the addition target leaf node of the entry addition target.
複数の決定木を用いたパケット分類処理をコンピュータに実行させるためのパケット分類プログラムであって、
1つのルールは、前記複数の決定木のうちいずれか1つの決定木における単一の葉ノードによって管理され、
前記パケット分類処理は、
前記複数の決定木に対してコマンドを一斉に入力するステップと、
前記コマンドが検索コマンドである場合、前記複数の決定木の各々において、検索キーがいずれかのルールにマッチするか否かを判定するステップと、
前記コマンドが新たなルールを決定木に追加するための挿入コマンドである場合、前記複数の決定木の各々において、前記新たなルールが単一の葉ノードによって管理され得るかどうかを判定するステップと、ここで、前記新たなルールが単一の葉ノードによって管理され得る場合、当該決定木はエントリ追加対象候補であり、当該単一の葉ノードは追加対象葉ノードであり、
前記新たなルールを追加する対象であるエントリ追加対象を、前記エントリ追加対象候補の中から選択するステップと、
前記新たなルールを、前記エントリ追加対象の前記追加対象葉ノードが管理するルールリストに追加するステップと
を含む
パケット分類プログラム。
A packet classification program for causing a computer to execute packet classification processing using a plurality of decision trees,
One rule is managed by a single leaf node in any one of the plurality of decision trees,
The packet classification process includes:
Inputting commands simultaneously to the plurality of decision trees;
If the command is a search command, determining whether a search key matches any rule in each of the plurality of decision trees;
Determining whether in each of the plurality of decision trees, the new rule can be managed by a single leaf node if the command is an insert command for adding a new rule to the decision tree; Here, if the new rule can be managed by a single leaf node, the decision tree is an entry addition candidate, the single leaf node is an addition leaf node,
Selecting an entry addition target to which the new rule is to be added from the entry addition target candidates;
Adding the new rule to a rule list managed by the addition target leaf node to which the entry is to be added.
JP2013514491A 2010-12-15 2011-09-13 Packet classifier, packet classification method, and packet classification program Expired - Fee Related JP5807676B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013514491A JP5807676B2 (en) 2010-12-15 2011-09-13 Packet classifier, packet classification method, and packet classification program

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
JP2010279693 2010-12-15
JP2010279693 2010-12-15
JP2013514491A JP5807676B2 (en) 2010-12-15 2011-09-13 Packet classifier, packet classification method, and packet classification program
PCT/JP2011/005131 WO2012081148A1 (en) 2010-12-15 2011-09-13 Packet classifier, packet classification method and packet classification program

Publications (2)

Publication Number Publication Date
JP2014504042A JP2014504042A (en) 2014-02-13
JP5807676B2 true JP5807676B2 (en) 2015-11-10

Family

ID=46244268

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013514491A Expired - Fee Related JP5807676B2 (en) 2010-12-15 2011-09-13 Packet classifier, packet classification method, and packet classification program

Country Status (2)

Country Link
JP (1) JP5807676B2 (en)
WO (1) WO2012081148A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5682442B2 (en) * 2011-05-12 2015-03-11 日本電気株式会社 Packet classifier, packet classification method, and packet classification program
WO2016023232A1 (en) * 2014-08-15 2016-02-18 Hewlett-Packard Development Company, L.P. Memory efficient packet classification method
US10341242B2 (en) 2016-12-13 2019-07-02 Oracle International Corporation System and method for providing a programmable packet classification framework for use in a network device
US10404594B2 (en) 2016-12-13 2019-09-03 Oracle International Corporation System and method for providing partitions of classification resources in a network device
KR101897612B1 (en) * 2017-04-14 2018-09-12 계명대학교 산학협력단 METHOD FOR CREATING DECISION TREE FOR PACKET CLASSIFICATION BASED ON WILD CARD RATIO IN IoT AND SYSTEM THEREOF
CN108711074B (en) * 2018-05-21 2021-08-24 创新先进技术有限公司 Service classification method, device, server and readable storage medium
CN109101260B (en) * 2018-08-30 2023-01-24 郑州云海信息技术有限公司 Node software upgrading method and device and computer readable storage medium
US20220222232A1 (en) * 2019-05-27 2022-07-14 Nec Corporation Data management device, control method, and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020176355A1 (en) * 2001-05-22 2002-11-28 Alan Mimms Snooping standby router
US7536476B1 (en) * 2002-12-20 2009-05-19 Cisco Technology, Inc. Method for performing tree based ACL lookups
US7840696B2 (en) * 2003-07-25 2010-11-23 Broadcom Corporation Apparatus and method for classifier identification
US8005114B2 (en) * 2008-09-08 2011-08-23 Wisconsin Alumni Research Foundation Method and apparatus to vary the transmission bit rate within individual wireless packets through multi-rate packetization

Also Published As

Publication number Publication date
WO2012081148A1 (en) 2012-06-21
JP2014504042A (en) 2014-02-13

Similar Documents

Publication Publication Date Title
JP5807676B2 (en) Packet classifier, packet classification method, and packet classification program
US8180803B2 (en) Deterministic finite automata (DFA) graph compression
US7949683B2 (en) Method and apparatus for traversing a compressed deterministic finite automata (DFA) graph
CN108370352B (en) High speed flexible packet classification using network processors
US9495479B2 (en) Traversal with arc configuration information
KR100477391B1 (en) Full match(fm) search algorithm implementation for a network processor
JP6383578B2 (en) Apparatus and method for uniquely enumerating paths in a parse tree
US8843508B2 (en) System and method for regular expression matching with multi-strings and intervals
US20080192754A1 (en) Routing system and method for managing rule entries of ternary content addressable memory in the same
US20070168377A1 (en) Method and apparatus for classifying Internet Protocol data packets
WO2010065418A1 (en) Graph-based data search
US11652744B1 (en) Multi-stage prefix matching enhancements
CN108763443A (en) block chain account processing method and device
JP5682442B2 (en) Packet classifier, packet classification method, and packet classification program
JP5673667B2 (en) Packet classifier, packet classification method, packet classification program
US8069304B2 (en) Determining the presence of a pre-specified string in a message
Norige et al. A ternary unification framework for optimizing TCAM-based packet classification systems
JP2009017439A (en) Packet transfer device and method
JPWO2002082750A1 (en) Apparatus and method for searching bit string
JP5144225B2 (en) Information search apparatus and entry information registration method in information search apparatus
CN109194613A (en) A kind of data packet detection method and device
JP2018056739A (en) Switch, and communication method
WO2022097725A1 (en) Information processing device, information processing method, and computer program
Markoborodov et al. An approach to the translation of software-defined network switch flow table into network processing unit assembly language
Kawano et al. A novel channel assignment method to ensure deadlock-freedom for deterministic routing

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140813

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20150811

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20150824

R150 Certificate of patent or registration of utility model

Ref document number: 5807676

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees