[go: up one dir, main page]

JP5682442B2 - 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
JP5682442B2
JP5682442B2 JP2011106914A JP2011106914A JP5682442B2 JP 5682442 B2 JP5682442 B2 JP 5682442B2 JP 2011106914 A JP2011106914 A JP 2011106914A JP 2011106914 A JP2011106914 A JP 2011106914A JP 5682442 B2 JP5682442 B2 JP 5682442B2
Authority
JP
Japan
Prior art keywords
rule
block
command
processing
entry
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
JP2011106914A
Other languages
Japanese (ja)
Other versions
JP2012239048A (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 JP2011106914A priority Critical patent/JP5682442B2/en
Publication of JP2012239048A publication Critical patent/JP2012239048A/en
Application granted granted Critical
Publication of JP5682442B2 publication Critical patent/JP5682442B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Description

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

パケット分類は、ネットワーク上のルータやスイッチにおいて、パケットを「フロー」と呼ばれる一連の属性をもつパケット列に分類するための重要な技術である。パケット分類は、個々のフローに対するQoS(Quality of Service)の提供や、ファイヤウォール(Firewall)等のセキュリティといった、付加的な価値をもつネットワークアプリケーションの実現に重要な役割を果たす。   Packet classification is an important technique for classifying packets into packet strings 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” is defined using one or more fields included in the header of a packet. A rule is sometimes called a “filter”. 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. The packet classification in the case where the rule is defined using a plurality of header fields as described above 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つの技術的な課題となっている。例えば、単純な手法として、ルールセットに含まれる全てのルールを優先度順にリストで管理し、リストの先頭(優先度が高いルール)から1つずつ順番に比較を行うリニアサーチ(Linear Search)が考えられる。しかし、このような手法では、最悪ルールセットに含まれる全てのルールとの一致比較処理が必要となり、パケット分類処理にかかる時間が非常に大きくなってしまうという問題がある。このため、現状、高速なパケット分類処理を実現するために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. For example, as a simple method, a linear search (Linear Search) is performed in which all rules included in a rule set are managed in a list in order of priority, and comparison is performed in order from the top of the list (rules with high priority). Conceivable. However, in such a technique, there is a problem that matching comparison processing with all the rules included in the worst rule set is required, and the time required for packet classification processing becomes very long. For this reason, at present, a technique based on the Tertiary Content Addressable Memory (TCAM) is often used to realize high-speed packet classification processing.

しかしながら、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. Further, here, the priority and action given 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. The numbers on the X axis and Y axis in the figure are each 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に示される例では、全空間は最終的に22の領域に分割されている。なお、決定木を構築するアルゴリズムについては、非特許文献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 for 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 22 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.

ルールの複製を抑制するため、非特許文献3で開示されているような手法が提案されている。非特許文献3では、複数の決定木を用意し、決定木毎に領域分割に用いるフィールド(次元)を使い分けることにより、異なる決定木を構築する。そして、各ルールは、ルールの複製が発生しないいずれかの決定木において管理する。決定木の数には上限があるため、いずれの決定木においても複製が発生しない場合には、例えば最後の決定木にて当該ルールは管理されることになるが、複数の決定木を用いることによってルールの複製を防止することができる。なお、非特許文献3の方式は、非特許文献2と同様、ハードウェアがパイプライン処理を用いてパケット分類を実施する方式として提案されている。   In order to suppress duplication of rules, a method as disclosed in Non-Patent Document 3 has been proposed. In Non-Patent Document 3, a plurality of decision trees are prepared, and different decision trees are constructed by properly using fields (dimensions) used for region division for each decision tree. Each rule is managed in any decision tree in which no rule duplication occurs. Since there is an upper limit on the number of decision trees, if there is no duplication in any decision tree, for example, the rule will be managed in the last decision tree, but multiple decision trees should be used. Can prevent duplication of rules. Note that the method of Non-Patent Document 3 is proposed as a method in which hardware performs packet classification using pipeline processing, as in Non-Patent Document 2.

また、特許文献1では、パケットのタイプと、そのパケットタイプに依存して存在する複数のパケットフィールド値から成るルールとの組み合わせを単一の分類規則テーブル(ルールテーブル)で管理するパケット分類器が開示されている。パケットタイプをインデックスとして利用することにより、様々なパケットタイプに対するルールを同一のテーブルを用いて管理することができる。   In Patent Document 1, there is a packet classifier that manages a combination of a packet type and a rule composed of a plurality of packet field values depending on the packet type using a single classification rule table (rule table). It is disclosed. By using the packet type as an index, rules for various packet types can be managed using the same table.

特開2006−20317号公報JP 2006-20317 A

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

上記の関連技術に記載されているようなパケット分類器によれば、検索キーに一致するルールの検索が行われる場合に、全ての決定木において検索処理が実行される。しかしながら、このことは、パケット分類器の消費電力の無用な増加を招く。それは、各ノードにおいて領域分割に用いるフィールドは複数の決定木で異なっており、入力された検索キーと一致するルールが存在する可能性が無い決定木においても、検索処理が実行されてしまうからである。検索処理では、必要な情報をメモリから読み出すといった処理が行われるため、パケット分類器の消費電力がいたずらに増加してしまう。   According to the packet classifier described in the related art, when a rule matching the search key is searched, search processing is executed in all decision trees. However, this leads to an unnecessary increase in the power consumption of the packet classifier. This is because the fields used for area division in each node are different in a plurality of decision trees, and search processing is executed even in a decision tree where there is no possibility that a rule that matches the input search key exists. is there. In the search process, since necessary information is read from the memory, the power consumption of the packet classifier increases unnecessarily.

本発明の1つの目的は、パケット分類器において、不要なメモリアクセスの発生を未然に防止し、消費電力を削減することができる技術を提供することにある。   One object of the present invention is to provide a technique capable of preventing the occurrence of unnecessary memory access and reducing power consumption in a packet classifier.

本発明の1つの観点において、パケット分類に用いられるルールを管理するパケット分類器が提供される。各ルールは、パケットヘッダに含まれる1以上のフィールドの組み合わせにより定義される。パケット分類器は、コマンド入力ブロックと、複数のルール比較ブロックとを備える。コマンド入力ブロックは、検索キーにマッチするルールの検索を指示する検索コマンド、新規ルールの追加を指示する挿入コマンド、あるいは既存ルールの削除を指示する削除コマンドを入力コマンドとして作成する。複数のルール比較ブロックの各々は、1以上のルールを管理し、上記入力コマンドに応じた処理を実行する。複数のルール比較ブロックは、管理下のルールにおける1以上のフィールドの組み合わせの種類に着目して、複数のグループにグループ分けされる。複数のグループのうち、検索キーにマッチするルール、新規ルール、あるいは既存ルールを管理する可能性があるグループは、選択グループである。選択グループに属するルール比較ブロックは、選択ルール比較ブロックである。コマンド入力ブロックは、検索キー、新規ルール、あるいは既存ルールを参照することによって、選択ルール比較ブロックにだけ入力コマンドを入力する。   In one aspect of the present invention, a packet classifier that manages rules used for packet classification is provided. Each rule is defined by a combination of one or more fields included in the packet header. The packet classifier includes a command input block and a plurality of rule comparison blocks. The command input block creates, as input commands, a search command that instructs to search for a rule that matches the search key, an insert command that instructs to add a new rule, or a delete command that instructs to delete an existing rule. Each of the plurality of rule comparison blocks manages one or more rules and executes processing according to the input command. The plurality of rule comparison blocks are grouped into a plurality of groups by paying attention to the type of combination of one or more fields in the managed rule. Among a plurality of groups, a group that may manage a rule that matches the search key, a new rule, or an existing rule is a selection group. The rule comparison block belonging to the selection group is a selection rule comparison block. The command input block inputs an input command only to the selected rule comparison block by referring to a search key, a new rule, or an existing rule.

本発明の他の観点において、パケット分類に用いられるルールを管理するパケット分類器によるパケット分類方法が提供される。各ルールは、パケットヘッダに含まれる1以上のフィールドの組み合わせにより定義される。本発明に係るパケット分類方法は、(A)パケット分類器が、複数のルール比較ブロックを提供するステップ、を含む。ここで、複数のルール比較ブロックの各々は、1以上のルールを管理し、入力コマンドに応じた処理を実行するように構成される。入力コマンドは、検索キーにマッチするルールの検索を指示する検索コマンド、新規ルールの追加を指示する挿入コマンド、あるいは既存ルールの削除を指示する削除コマンドである。複数のルール比較ブロックは、管理下のルールにおける1以上のフィールドの組み合わせの種類に着目して、複数のグループにグループ分けさる。複数のグループのうち、検索キーにマッチするルール、新規ルール、あるいは既存ルールを管理する可能性があるグループは、選択グループである。選択グループに属するルール比較ブロックは、選択ルール比較ブロックである。本発明に係るパケット分類方法は、更に、(B)検索キー、新規ルール、あるいは既存ルールを参照することによって、選択ルール比較ブロックにだけ入力コマンドを入力するステップと、(C)選択ルール比較ブロックにおいて、入力コマンドに応じた処理を実行するステップと、を含む。   In another aspect of the present invention, a packet classification method is provided by a packet classifier that manages rules used for packet classification. Each rule is defined by a combination of one or more fields included in the packet header. The packet classification method according to the present invention includes (A) a packet classifier providing a plurality of rule comparison blocks. Here, each of the plurality of rule comparison blocks is configured to manage one or more rules and execute processing according to the input command. The input command is a search command for instructing a search for a rule that matches the search key, an insert command for instructing the addition of a new rule, or a delete command for instructing the deletion of an existing rule. The plurality of rule comparison blocks are grouped into a plurality of groups by paying attention to the kind of combination of one or more fields in the managed rule. Among a plurality of groups, a group that may manage a rule that matches the search key, a new rule, or an existing rule is a selection group. The rule comparison block belonging to the selection group is a selection rule comparison block. The packet classification method according to the present invention further includes (B) a step of inputting an input command only to a selection rule comparison block by referring to a search key, a new rule, or an existing rule, and (C) a selection rule comparison block. And executing a process according to the input command.

本発明の更に他の観点において、コンピュータによって実行され、当該コンピュータを、パケット分類に用いられるルールを管理するパケット分類器として機能させるパケット分類プログラムが提供される。各ルールは、パケットヘッダに含まれる1以上のフィールドの組み合わせにより定義される。パケット分類器は、コマンド入力ブロックと、複数のルール比較ブロックとを備える。コマンド入力ブロックは、検索キーにマッチするルールの検索を指示する検索コマンド、新規ルールの追加を指示する挿入コマンド、あるいは既存ルールの削除を指示する削除コマンドを入力コマンドとして作成する。複数のルール比較ブロックの各々は、1以上のルールを管理し、上記入力コマンドに応じた処理を実行する。複数のルール比較ブロックは、管理下のルールにおける1以上のフィールドの組み合わせの種類に着目して、複数のグループにグループ分けされる。複数のグループのうち、検索キーにマッチするルール、新規ルール、あるいは既存ルールを管理する可能性があるグループは、選択グループである。選択グループに属するルール比較ブロックは、選択ルール比較ブロックである。コマンド入力ブロックは、検索キー、新規ルール、あるいは既存ルールを参照することによって、選択ルール比較ブロックにだけ入力コマンドを入力する。   In still another aspect of the present invention, there is provided a packet classification program that is executed by a computer and causes the computer to function as a packet classifier that manages rules used for packet classification. Each rule is defined by a combination of one or more fields included in the packet header. The packet classifier includes a command input block and a plurality of rule comparison blocks. The command input block creates, as input commands, a search command that instructs to search for a rule that matches the search key, an insert command that instructs to add a new rule, or a delete command that instructs to delete an existing rule. Each of the plurality of rule comparison blocks manages one or more rules and executes processing according to the input command. The plurality of rule comparison blocks are grouped into a plurality of groups by paying attention to the type of combination of one or more fields in the managed rule. Among a plurality of groups, a group that may manage a rule that matches the search key, a new rule, or an existing rule is a selection group. The rule comparison block belonging to the selection group is a selection rule comparison block. The command input block inputs an input command only to the selected rule comparison block by referring to a search key, a new rule, or an existing rule.

本発明によれば、パケット分類器において、不要なメモリアクセスの発生を未然に防止し、消費電力を削減することが可能となる。   According to the present invention, it is possible to prevent unnecessary memory accesses from occurring in the packet classifier and reduce power consumption.

図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 conceptual diagram of rules managed by each rule comparison block of the packet classifier according to the first embodiment. 図6は、第1の実施の形態に係るパケット分類器の各ルール比較ブロックが決定木で実現される場合の構成を示すブロック図である。FIG. 6 is a block diagram illustrating a configuration when each rule comparison block of the packet classifier according to the first embodiment is realized by a decision tree. 図7は、第1の実施の形態における決定木ノード処理ブロックと決定木の各ノードとの対応関係を示す概念図である。FIG. 7 is a conceptual diagram showing a correspondence relationship between a decision tree node processing block and each node of the decision tree in the first embodiment. 図8は、第1の実施の形態に係る決定木処理ブロックの決定木ノード処理ブロックの構成を示すブロック図である。FIG. 8 is a block diagram showing a configuration of a decision tree node processing block of the decision tree processing block according to the first embodiment. 図9は、第1の実施の形態に係る決定木処理ブロックのエントリ数カウントブロックの構成を示すブロック図である。FIG. 9 is a block diagram showing the configuration of the entry count block of the decision tree processing block according to the first embodiment. 図10は、第1の実施の形態におけるルール処理ブロックと決定木の各葉ノードのルールリストに含まれるルールとの対応関係を示す概念図である。FIG. 10 is a conceptual diagram showing a correspondence relationship between the rule processing block and the rules included in the rule list of each leaf node of the decision tree in the first embodiment. 図11は、第1の実施の形態に係る決定木処理ブロックのルール処理ブロックの構成を示すブロック図である。FIG. 11 is a block diagram illustrating a configuration of a rule processing block of the decision tree processing block according to the first embodiment. 図12は、第1の実施の形態に係るコマンド入力ブロックの構成を示すブロック図である。FIG. 12 is a block diagram showing a configuration of a command input block according to the first embodiment. 図13は、第1の実施の形態におけるコマンド入力ブロックのコマンド出力情報記憶ブロックが記憶するコマンド出力情報を示す概念図である。FIG. 13 is a conceptual diagram illustrating command output information stored in the command output information storage block of the command input block according to the first embodiment. 図14は、第1の実施の形態におけるコマンドの構成例を示す概念図である。FIG. 14 is a conceptual diagram illustrating a configuration example of a command in the first embodiment. 図15は、第1の実施の形態におけるLOOKUP処理を示すフローチャートである。FIG. 15 is a flowchart illustrating the LOOKUP process according to the first embodiment. 図16は、ステップA2の処理を示すフローチャートである。FIG. 16 is a flowchart showing the process of step A2. 図17は、ステップB1の処理を示すフローチャートである。FIG. 17 is a flowchart showing the process of step B1. 図18は、第1の実施の形態におけるノード情報の構成例を示す概念図である。FIG. 18 is a conceptual diagram illustrating a configuration example of node information according to the first embodiment. 図19は、第1の実施の形態におけるアドレス算出方法を説明するための図である。FIG. 19 is a diagram for explaining an address calculation method according to the first embodiment. 図20は、ステップB3の処理を示すフローチャートである。FIG. 20 is a flowchart showing the process of step B3. 図21は、第1の実施の形態におけるエントリ情報の構成例を示す概念図である。FIG. 21 is a conceptual diagram illustrating a configuration example of entry information according to the first embodiment. 図22は、第1の実施の形態におけるINSERT処理を示すフローチャートである。FIG. 22 is a flowchart illustrating the INSERT processing according to the first embodiment. 図23は、ステップA4の処理を示すフローチャートである。FIG. 23 is a flowchart showing the process of step A4. 図24は、ステップB4の処理を示すフローチャートである。FIG. 24 is a flowchart showing the process of step B4. 図25は、ステップA5の処理を示すフローチャートである。FIG. 25 is a flowchart showing the process of step A5. 図26は、ステップA7の処理を示すフローチャートである。FIG. 26 is a flowchart showing the process of step A7. 図27は、第1の実施の形態におけるDELETE処理を示すフローチャートである。FIG. 27 is a flowchart illustrating the DELETE process in the first embodiment. 図28は、ステップA9の処理を示すフローチャートである。FIG. 28 is a flowchart showing the process of step A9. 図29は、ステップA10の処理を示すフローチャートである。FIG. 29 is a flowchart showing the process of step A10. 図30は、ステップB8の処理を示すフローチャートである。FIG. 30 is a flowchart showing the process of step B8. 図31は、第1の実施の形態に係るパケット分類器の第2の構成例における各ルール比較ブロックの構成を示すブロック図である。FIG. 31 is a block diagram illustrating a configuration of each rule comparison block in the second configuration example of the packet classifier according to the first embodiment. 図32は、第1の実施の形態の第2の構成例におけるLOOKUP処理を示すフローチャートである。FIG. 32 is a flowchart illustrating the LOOKUP process in the second configuration example of the first embodiment. 図33は、ステップA12の処理を示すフローチャートである。FIG. 33 is a flowchart showing the process of step A12. 図34は、第1の実施の形態の第2の構成例におけるINSERT処理を示すフローチャートである。FIG. 34 is a flowchart illustrating the INSERT processing in the second configuration example of the first embodiment. 図35は、ステップA13の処理を示すフローチャートである。FIG. 35 is a flowchart showing the process of step A13. 図36は、第1の実施の形態の第2の構成例におけるDELETE処理を示すフローチャートである。FIG. 36 is a flowchart illustrating a DELETE process in the second configuration example of the first embodiment. 図37は、第1の実施の形態の第3の構成例におけるINSERT処理のステップA14の処理を示すフローチャートである。FIG. 37 is a flowchart showing the process of step A14 of the INSERT process in the third configuration example of the first embodiment. 図38は、本発明の第2の実施の形態に係るパケット分類器の構成を示すブロック図である。FIG. 38 is a block diagram showing a configuration of a packet classifier according to the second embodiment of the present invention. 図39は、第2の実施の形態に係るコマンド入力ブロックの構成を示すブロック図である。FIG. 39 is a block diagram showing a configuration of a command input block according to the second embodiment. 図40は、第2の実施の形態におけるコマンド入力ブロックのコマンド出力情報記憶ブロックが記憶するコマンド出力情報を示す概念図である。FIG. 40 is a conceptual diagram showing command output information stored in the command output information storage block of the command input block according to the second embodiment. 図41は、本発明の第3の実施の形態に係るパケット分類器の構成を示すブロック図である。FIG. 41 is a block diagram showing a configuration of a packet classifier according to the third embodiment of the present invention. 図42は、第3の実施の形態におけるINSERT処理を示すフローチャートである。FIG. 42 is a flowchart illustrating the INSERT processing according to the third embodiment. 図43は、ステップA15の処理を示すフローチャートである。FIG. 43 is a flowchart showing the process of step A15. 図44は、ステップA18の処理を示すフローチャートである。FIG. 44 is a flowchart showing the process of step A18. 図45は、本発明の第4の実施の形態に係るパケット分類器の構成を示すブロック図である。FIG. 45 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 manages a plurality of rules used for packet classification. Each rule is defined by a combination of one or more fields included in the packet header. 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は1以上の整数)、エントリ追加対象決定ブロック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 rule comparison blocks 2 (2-1 to 2-N: N is an integer of 1 or more), an entry addition target determination 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) processing for adding a new rule (new entry). (Hereinafter referred to as “INSERT processing”), (3) processing for invalidating existing rules (existing entries) (hereinafter referred to as “DELETE processing”), (4) included in packet classifier 1 Configuration processing in which a setting value is written in advance in a memory, a setting register, or the like. 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処理を示す種別データと、無効化すべき既存ルールとを含む。   The command input block 4 receives the input data 6 and creates an input command corresponding to the input data 6. Similar to the input data 6, the input 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.

コマンド入力ブロック4は、生成した入力コマンドを、ルール比較ブロック2に入力する。ここで、コマンド入力ブロック4は、入力コマンドを、必ずしも全てのルール比較ブロック2−1〜2−Nに入力するわけではなく、複数のルール比較ブロック2−1〜2−Nのうち必要なもの(選択ルール比較ブロック)だけに入力する。具体的には、LOOKUP処理時には、コマンド入力ブロック4は、検索キーにマッチするルールを管理している可能性があるルール比較ブロック2に対してのみ、入力コマンドを入力する。INSERT処理時には、コマンド入力ブロック4は、新規ルールを管理する可能性があるルール比較ブロック2に対してのみ、入力コマンドを入力する。DELETE処理時には、コマンド入力ブロック4は、削除すべき既存ルールを管理している可能性があるルール比較ブロック2に対してのみ、入力コマンドを入力する。より詳細については後述する。   The command input block 4 inputs the generated input command to the rule comparison block 2. Here, the command input block 4 does not necessarily input the input command to all the rule comparison blocks 2-1 to 2-N, but is necessary among the plurality of rule comparison blocks 2-1 to 2-N. Enter only in (Selection rule comparison block). Specifically, at the time of LOOKUP processing, the command input block 4 inputs an input command only to the rule comparison block 2 that may manage a rule that matches the search key. During INSERT processing, the command input block 4 inputs an input command only to the rule comparison block 2 that may manage a new rule. During the DELETE process, the command input block 4 inputs an input command only to the rule comparison block 2 that may manage the existing rule to be deleted. More details will be described later.

ルール比較ブロック2−1〜2−Nは、パケット分類に用いられる複数のルールを、ある方針に従って分散的に管理する。ここでは、単一のルールは、複製が発生しないように、ルール比較ブロック2−1〜2−Nのうちいずれか1つによって管理されるとする。例えば、複数のルール比較ブロック2−1〜2−Nのそれぞれが、パケット分類に用いられる複数の決定木を構成することが考えられる。この場合、複数の決定木は、非特許文献3に記載されている手法と同様に、ルールの複製が生じないように構成される。つまり、各ルールは、当該ルールの複製が生じない決定木において管理される。言い換えれば、単一のルールは、複数の決定木のうちいずれか1つの決定木における単一の葉ノードでのみ管理される。   The rule comparison blocks 2-1 to 2-N manage a plurality of rules used for packet classification in a distributed manner according to a certain policy. Here, it is assumed that a single rule is managed by any one of the rule comparison blocks 2-1 to 2-N so that no duplication occurs. For example, each of the plurality of rule comparison blocks 2-1 to 2-N may constitute a plurality of decision trees used for packet classification. In this case, 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, a single rule is managed only by a single leaf node in any one of a plurality of decision trees.

各ルール比較ブロック2は、1以上のルールを管理する。そして、各ルール比較ブロック2は、コマンド入力ブロック4から入力された入力コマンドに応じて、LOOKUP処理、INSERT処理、あるいはDELETE処理を実行する。尚、複数のルール比較ブロック2−1〜2−Nは、同時並列に各処理を実行することができる。   Each rule comparison block 2 manages one or more rules. Each rule comparison block 2 executes a LOOKUP process, an INSERT process, or a DELETE process in accordance with the input command input from the command input block 4. The plurality of rule comparison blocks 2-1 to 2-N can execute each process simultaneously and in parallel.

<LOOKUP処理>
ルール比較ブロック2は、検索コマンドに応じて、LOOKUP処理を実行する。具体的には、ルール比較ブロック2は、自身が管理するルール群に対して、検索キーがいずれかのルールにマッチするか否かを判定する。検索キーにマッチするルール(以下、マッチルールと呼ぶ)が存在する場合、当該ルール比較ブロック2は、当該マッチルールを結果出力ブロック5に通知する。検索キーが複数のルールにマッチする場合、当該ルール比較ブロック2は、複数のマッチルールのうち最も優先度の高いルールを結果出力ブロック5に通知する。一方、検索キーにマッチするルールが存在しない場合、当該ルール比較ブロック2は、マッチルールが存在しなかったことを結果出力ブロック5に通知する。結果出力ブロック5は、各ルール比較ブロック2から検索結果を受け取り、最も優先度の高いマッチルールを選択する。そして、結果出力ブロック5は、その選択結果を示す出力データ7を、LOOKUP処理の最終結果として出力する。
<LOOKUP processing>
The rule comparison block 2 executes a LOOKUP process in response to the search command. Specifically, the rule comparison block 2 determines whether or not the search key matches any rule for the rule group managed by itself. When there is a rule that matches the search key (hereinafter referred to as a match rule), the rule comparison block 2 notifies the result output block 5 of the match rule. When the search key matches a plurality of rules, the rule comparison block 2 notifies the result output block 5 of the highest priority rule among the plurality of match rules. On the other hand, when there is no rule that matches the search key, the rule comparison block 2 notifies the result output block 5 that there is no match rule. The result output block 5 receives the search result from each rule comparison block 2 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は、挿入コマンドに応じて、INSERT処理を実行する。具体的には、まず、各ルール比較ブロック2は、新規ルールを自身で管理すべきかを判定する。例えば、ルール比較ブロック2が決定木を用いて構成されている場合、自身の決定木に追加してもルールの複製が発生しないか、つまり、新規ルールが自身の決定木における単一の葉ノードによってのみ管理され得るかどうかを判定する。ルールの複製が発生してしまう場合、当該ルール比較ブロック2は、新規ルールの追加対象とはならない。一方、新規ルールを自身で管理しても良いと判定した場合、当該ルール比較ブロック2は「エントリ追加対象候補」となる。例えば、ルール比較ブロック2が決定木を用いて構成されている場合、新規ルールが自身の決定木における単一の葉ノードによってのみ管理され得ると判定された場合に、当該ルール比較ブロック2は「エントリ追加対象候補」となる。また、この際、当該単一の葉ノードは「追加対象葉ノード」となる。
<INSERT processing>
The rule comparison block 2 executes INSERT processing in response to the insertion command. Specifically, first, each rule comparison block 2 determines whether the new rule should be managed by itself. For example, if the rule comparison block 2 is configured using a decision tree, the rule does not duplicate even if it is added to its own decision tree, that is, the new rule is a single leaf node in its own decision tree. To determine whether it can only be managed by. When rule duplication occurs, the rule comparison block 2 is not a target for adding a new rule. On the other hand, when it is determined that the new rule may be managed by itself, the rule comparison block 2 is an “entry addition target candidate”. For example, when the rule comparison block 2 is configured using a decision tree, when it is determined that a new rule can be managed only by a single leaf node in its own decision tree, the rule comparison block 2 is “ Entry candidate candidates ”. At this time, the single leaf node becomes an “addition target leaf node”.

実際にエントリが追加されるエントリ追加対象のルール比較ブロック2は、上記エントリ追加対象候補の中から選ばれる。そのエントリ追加対象を選ぶのが、エントリ追加対象決定ブロック3である。図4に示されるように、このエントリ追加対象決定ブロック3は、複数のルール比較ブロック2−1〜2−Nの各々に接続されている。そして、エントリ追加対象決定ブロック3は、各ルール比較ブロック2から通知される情報に基づいて、エントリ追加対象候補を認識し、エントリ追加対象候補の中からエントリ追加対象を選択する。   The entry comparison target rule comparison block 2 to which an entry is actually added 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 the plurality of rule comparison blocks 2-1 to 2-N. Then, the entry addition target determination block 3 recognizes the entry addition target candidate based on the information notified from each rule comparison block 2 and selects the entry addition target from the entry addition target candidates.

例えば、各エントリ追加対象候補は、当該ルール比較ブロック2が管理している有効なルールのエントリ数をエントリ追加対象決定ブロック3に通知する。この際、例えば、各エントリ追加対象候補が、ルールを管理するメモリ領域を当該ルール比較ブロック2内でさらに細分化して管理している場合には、新規ルールを追加すべきルール管理エリアで既に管理されている有効なルールのエントリ数を通知しても良い。例えば、ルール比較ブロック2が決定木を用いて構成されている場合、追加対象葉ノードが管理している有効なルールのエントリ数を通知する。そして、エントリ追加対象決定ブロック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 rule comparison block 2. At this time, for example, when each entry addition target candidate manages a memory area for managing a rule in the rule comparison block 2, it is already managed in the rule management area to which a new rule is to be added. The number of valid rule entries may be notified. For example, when the rule comparison block 2 is configured using a decision tree, the number of valid rule entries managed by the addition target leaf node is notified. 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 rule comparison blocks is suppressed, which is preferable.

エントリ追加対象決定ブロック3は、エントリ追加対象の選択結果を各ルール比較ブロック2に通知する。具体的には、エントリ追加対象決定ブロック3は、エントリ追加対象に対して新規ルールの追加を指示し、それ以外の決定木処理ブロック2に対してルール追加処理の不実行を指示する。そして、エントリ追加対象であるルール比較ブロック2は、新規ルールを、自身の管理するルールリストに追加する。   The entry addition target determination block 3 notifies each rule comparison block 2 of the selection result of the entry addition target. Specifically, 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 rule comparison block 2 as an entry addition target adds a new rule to the rule list managed by itself.

このようにして、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 rule comparison blocks 2-1 to 2-N, and outputs the output data 7 indicating the final result of the INSERT processing.

<DELETE処理>
ルール比較ブロック2は、削除コマンドに応じて、DELETE処理を実行する。具体的には、各ルール比較ブロック2は、削除対象である既存ルールが自身で管理されているか否かを判定する。当該既存ルールが自身で管理されている場合、当該ルール比較ブロック2は「エントリ削除対象」となる。また、ルール比較ブロック2が決定木を用いて構成されている場合、削除対象である既存ルールが管理されている葉ノードは「削除対象葉ノード」となる。エントリ削除対象であるルール比較ブロック2は、当該既存ルールを無効化する。
<DELETE processing>
The rule comparison block 2 executes a DELETE process in response to the delete command. Specifically, each rule comparison block 2 determines whether or not the existing rule to be deleted is managed by itself. When the existing rule is managed by itself, the rule comparison block 2 is “entry deletion target”. When the rule comparison block 2 is configured using a decision tree, the leaf node in which the existing rule that is the deletion target is managed is the “deletion target leaf node”. The rule comparison block 2 that is the entry deletion target invalidates the existing rule.

このようにして、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 rule comparison blocks 2-1 to 2-N, and outputs the output data 7 indicating the final result of the DELETE processing.

<グループ選択処理>
上述の通り、本実施の形態によれば、コマンド入力ブロック4は、入力コマンドを、複数のルール比較ブロック2−1〜2−Nのうち必要なもの(選択ルール比較ブロック)だけに入力する。図5を参照して、この処理について説明する。
<Group selection processing>
As described above, according to the present embodiment, the command input block 4 inputs an input command only to a necessary one (selected rule comparison block) among the plurality of rule comparison blocks 2-1 to 2-N. This process will be described with reference to FIG.

本実施の形態によれば、複数のルール比較ブロック2−1〜2−Nは、複数のグループにグループ分けされる。ここで、グループ分けの基準は、ルールを管理するために着目するパケットヘッダフィールドの組み合わせの種類である。より具体的に、例えば、各ルール比較ブロック2が決定木によって構成されている場合、それぞれのルール比較ブロック2を構成する決定木の領域分割に用いているヘッダフィールドの組み合わせの種類である。また、それ以外に、ワイルドカードが含まれないパケットヘッダフィールドの組み合わせの種類でも良い。このような管理を行うことで、一般的にルールは全て同じパケットヘッダフィールドの組み合わせで定義されるが、異なる複数の組み合わせで定義されるルールを同一のパケット分類器で管理することも可能となる。   According to the present embodiment, the plurality of rule comparison blocks 2-1 to 2-N are grouped into a plurality of groups. Here, the grouping standard is the type of combination of packet header fields of interest for managing rules. More specifically, for example, when each rule comparison block 2 is configured by a decision tree, it is the kind of combination of header fields used for area division of the decision tree constituting each rule comparison block 2. In addition, a combination type of packet header fields that do not include a wild card may be used. By performing such management, rules are generally defined by the same combination of packet header fields. However, rules defined by a plurality of different combinations can be managed by the same packet classifier. .

例えば、Typeフィールドが0x0800(IP version4を意味する)の場合、ルールには、送信元MACアドレス、宛先MACアドレス、TypeといったLayer2(以下、L2)までのプロトコルに関するヘッダフィールドに加え、送信元IPアドレス、宛先IPアドレス、プロトコル番号等の上位レイヤのヘッダフィールドが用いられるものとする。尚、各ルールで参照しないフィールドにはワイルドカードが付与されていてもよい。このようなヘッダフィールドの組み合わせを用いて、各ルールを管理するルール比較ブロック2は、第1グループに分類される。図5の例では、第1グループは、ルール比較ブロック2−6〜2−Nを含んでいる。   For example, when the Type field is 0x0800 (meaning IP version 4), the rule includes a source IP address in addition to a header field related to a protocol up to Layer 2 (hereinafter referred to as L2) such as a source MAC address, a destination MAC address, and Type. Assume that upper layer header fields such as destination IP address and protocol number are used. Note that wild cards may be assigned to fields that are not referred to in each rule. Using such a combination of header fields, the rule comparison block 2 that manages each rule is classified into a first group. In the example of FIG. 5, the first group includes rule comparison blocks 2-6 to 2-N.

また、Typeフィールドが0x8100(IEEE 802.1Q VLANタグフレームを意味する)の場合、ルールには、送信元MACアドレス、宛先MACアドレス、TypeといったL2までのプロトコルに関するヘッダフィールドに加え、VLAN IDやVLAN PriorityといったVLANまでのヘッダフィールドが用いられるものとする。尚、各ルールで参照しないフィールドにはワイルドカードが付与されていてもよい。このようなヘッダフィールドの組み合わせを用いて、各ルールを管理するルール比較ブロック2は、第2グループに分類される。図5の例では、第2グループは、ルール比較ブロック2−4、2−5を含んでいる。   When the Type field is 0x8100 (meaning IEEE 802.1Q VLAN tag frame), in addition to the header fields related to the protocol up to L2, such as the source MAC address, destination MAC address, and type, the rule includes VLAN ID and VLAN. It is assumed that a header field up to the VLAN such as Priority is used. Note that wild cards may be assigned to fields that are not referred to in each rule. The rule comparison block 2 for managing each rule using such a combination of header fields is classified into the second group. In the example of FIG. 5, the second group includes rule comparison blocks 2-4 and 2-5.

また、Typeフィールドが上記のもの以外の場合、ルールには、送信元MACアドレス、宛先MACアドレス、TypeといったL2までのプロトコルに関するヘッダフィールドが用いられるものとする。尚、各ルールで参照しないフィールドにはワイルドカードが付与されていてもよい。この場合、この場合、このようなヘッダフィールドの組み合わせを用いて、各ルールを管理するルール比較ブロック2は、第3グループに分類される。図5の例では、第3グループは、ルール比較ブロック2−1〜2−3を含んでいる。   When the Type field is other than those described above, it is assumed that a header field related to a protocol up to L2 such as a source MAC address, a destination MAC address, and Type is used for the rule. Note that wild cards may be assigned to fields that are not referred to in each rule. In this case, in this case, the rule comparison block 2 managing each rule using such a combination of header fields is classified into the third group. In the example of FIG. 5, the third group includes rule comparison blocks 2-1 to 2-3.

このように、複数のルール比較ブロック2−1〜2−Nは、ルールを管理するために着目するヘッダフィールドの組み合わせの種類に応じて、複数のグループにグループ分けされる。例えば、L2までのプロトコルに関するヘッダフィールド、送信元IPアドレス、宛先IPアドレス、プロトコル番号等の上位レイヤのヘッダフィールドで定義されたルールが、L2までのプロトコルに関するヘッダフィールドを用いて管理される場合、第3グループに分類される。同様に、例えば、L2までのプロトコルに関するヘッダフィールド、VLAN IDやVLAN PriorityといったVLANまでのヘッダフィールドで定義されたルールが、L2までのプロトコルに関するヘッダフィールドを用いて管理される場合も、第3グループに分類される。このような複数のグループのうち入力コマンドが入力されるべきグループは、「選択グループ」である。LOOKUP処理の場合、選択グループは、検索キーにマッチするルールを管理している可能性があるグループである。INSERT処理の場合、選択グループは、新規ルールを管理する可能性があるグループである。DELETE処理の場合、削除対象の既存ルールを管理している可能性があるグループである。   In this way, the plurality of rule comparison blocks 2-1 to 2-N are grouped into a plurality of groups according to the types of combinations of header fields of interest for managing the rules. For example, when rules defined in higher-layer header fields such as a header field related to a protocol up to L2, a source IP address, a destination IP address, and a protocol number are managed using a header field related to a protocol up to L2, It is classified into the third group. Similarly, for example, when the rules defined in the header field related to the protocol up to L2 and the header field related to the protocol up to L2 such as VLAN ID and VLAN Priority are managed using the header field related to the protocol up to L2, the third group are categorized. A group to which an input command is to be input among such a plurality of groups is a “selected group”. In the case of the LOOKUP process, the selected group is a group that may manage a rule that matches the search key. In the case of INSERT processing, the selected group is a group that may manage a new rule. In the case of DELETE processing, this is a group that may manage existing rules to be deleted.

本実施の形態によれば、コマンド入力ブロック4は、選択グループに属するルール比較ブロック2(以下、「選択ルール比較ブロック2」と参照される)にだけ入力コマンドを入力し、それ以外のルール比較ブロック2には入力コマンドを入力しない。従って、入力コマンドに応じた処理は、選択ルール比較ブロック2においてのみ実行されることになる。その結果、パケット分類器1における不要な電力消費が削減される。   According to the present embodiment, the command input block 4 inputs an input command only to the rule comparison block 2 (hereinafter referred to as “selection rule comparison block 2”) belonging to the selected group, and other rule comparisons. No input command is input to block 2. Therefore, the process according to the input command is executed only in the selection rule comparison block 2. As a result, unnecessary power consumption in the packet classifier 1 is reduced.

尚、コマンド入力ブロック4は、複数のグループのうちどれが選択グループかを、検索キーやルール(新規ルール、削除ルール)を参照することによって判定可能である。例えば、MACヘッダに含まれるTypeフィールドや、IPヘッダに含まれるプロトコルフィールド等、パケットの構成が判断できるヘッダフィールドに基づいて、選択グループを識別することができる。図5で示された例では、MACヘッダに含まれるTypeフィールドがグループ毎に異なっている。従って、コマンド入力ブロック4は、検索キーあるいはルールから抽出されるTypeフィールドを「識別情報」として用いることによって、選択グループを識別することができる。   The command input block 4 can determine which of the plurality of groups is a selected group by referring to a search key and a rule (new rule, delete rule). For example, the selected group can be identified based on a header field that can determine the packet configuration, such as a Type field included in the MAC header or a protocol field included in the IP header. In the example shown in FIG. 5, the Type field included in the MAC header is different for each group. Therefore, the command input block 4 can identify the selected group by using the Type field extracted from the search key or the rule as “identification information”.

例えば、図5で示された例において、検索キーのTypeフィールドが0x8100である場合、選択グループは第2グループと第3グループであり、コマンド入力ブロック4は、選択ルール比較ブロック2−1〜2−5だけに検索コマンドを入力する。検索キーのTypeフィールドが0x0800である場合、選択グループは第1グループと第3グループであり、コマンド入力ブロック4は、選択ルール比較ブロック2−1〜2−3、2−6〜2−Nだけに検索コマンドを入力する。検索キーのTypeフィールドがそれ以外の場合、選択グループは第3グループであり、コマンド入力ブロック4は、選択ルール比較ブロック2−1〜2−3だけに検索コマンドを入力する。   For example, in the example shown in FIG. 5, when the Type field of the search key is 0x8100, the selection groups are the second group and the third group, and the command input block 4 includes the selection rule comparison blocks 2-1 to 2 Enter the search command only at -5. When the Type field of the search key is 0x0800, the selection groups are the first group and the third group, and the command input block 4 is only the selection rule comparison blocks 2-1 to 2-3 and 2-6 to 2-N. Enter the search command. When the Type field of the search key is other than that, the selection group is the third group, and the command input block 4 inputs the search command only to the selection rule comparison blocks 2-1 to 2-3.

以上に説明されたように、本実施の形態によれば、コマンド入力ブロック4は、検索キーやルール(新規ルール、削除ルール)を参照することによって、選択グループを識別する。そして、コマンド入力ブロック4は、選択グループに属する選択ルール比較ブロック2にだけ入力コマンドを入力し、それ以外のルール比較ブロック2には入力コマンドを入力しない。従って、入力コマンドに応じた処理は、選択ルール比較ブロック2においてのみ実行されることになる。その結果、パケット分類器1における不要なメモリアクセスの発生が未然に防止され、消費電力が削減される。   As described above, according to the present embodiment, the command input block 4 identifies the selected group by referring to the search key and the rule (new rule, delete rule). Then, the command input block 4 inputs an input command only to the selection rule comparison block 2 belonging to the selection group, and does not input an input command to the other rule comparison blocks 2. Therefore, the process according to the input command is executed only in the selection rule comparison block 2. As a result, unnecessary memory access in the packet classifier 1 can be prevented and power consumption can be reduced.

なお、本実施の形態に係るパケット分類器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 deployed, for example, in a network device such as a switch or a router, or in a 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の構成例
次に、本実施の形態に係るパケット分類器1の構成例を更に詳しく説明する。上記のルールの管理ができれば、ルール比較ブロック2はどのようなルール管理機構、及び検索処理を実行しても良い。以下では、典型的な例として、各ルール比較ブロック2が決定木を用いて実現される場合の構成を説明する。
1-2. First Configuration Example Next, a configuration example of the packet classifier 1 according to the present embodiment will be described in more detail. As long as the above rules can be managed, the rule comparison block 2 may execute any rule management mechanism and search processing. Hereinafter, as a typical example, a configuration in the case where each rule comparison block 2 is realized using a decision tree will be described.

図6は、本実施の形態に係るパケット分類器1の各ルール比較ブロック2の構成を示すブロック図である。以下では、この場合のルール比較ブロックを決定木処理ブロックとも参照する。図6に示されるように、決定木処理ブロック2は、決定木パイプラインブロック20、エントリ数カウントブロック21、及びルールパイプラインブロック22を備えている。コマンド入力ブロック4から決定木処理ブロック2に入力されるデータは、入力データ23である。決定木処理ブロック2から結果出力ブロック5に出力されるデータは、出力データ24である。決定木処理ブロック2とエントリ追加対象決定ブロック3との間でやりとりされるデータは、入出力データ25である。   FIG. 6 is a block diagram showing a configuration of each rule comparison block 2 of the packet classifier 1 according to the present embodiment. Hereinafter, the rule comparison block in this case is also referred to as a decision tree processing block. As illustrated in FIG. 6, 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.

決定木パイプラインブロック20は、パイプライン処理により決定木の探索を行う。具体的には、決定木パイプラインブロック20は、決定木の深さ(段数)Hと同じ段数の決定木ノード処理ブロック200−1〜200−Hを備えている。図7に示されるように、決定木ノード処理ブロック200−i(i=1、2、・・・、H)は、決定木の根ノードから深さj(j=0、1、・・・、H−1)のノードに対応しており、当該ノードに関する処理を行う。これら決定木ノード処理ブロック200−1〜200−Hを用いることによって、決定木パイプラインブロック20は、決定木の根ノードから葉ノードに向けて1ノードずつ探索処理を実行していく。好適には、1クロックサイクル毎に、決定木の1つのノードを辿る処理が実行される。   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. 7, 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.

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

エントリ数カウントブロック21は、決定木の全ての葉ノードに関して、管理されている有効なルールのエントリ数を葉ノード毎に管理する。尚、エントリ数カウントブロック21による処理は、決定木の深さHに相当する処理サイクルにおいて実行される。   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.

図9は、本実施の形態に係るエントリ数カウントブロック21の構成を示すブロック図である。図9に示されるように、エントリ数カウントブロック21は、カウント処理ブロック210及びエントリ数記憶ブロック211を備えている。   FIG. 9 is a block diagram showing a configuration of the entry number counting block 21 according to the present embodiment. As shown in FIG. 9, 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 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 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 entries related to the addition target leaf node, and the entry number storage block 211. Write to. 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 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 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.

ルールパイプラインブロック22は、パイプライン制御によりルール処理(LOOKUP、INSERT、DELETE)を行う。具体的には、ルールパイプラインブロック22は、各葉ノードにおいて管理可能な最大ルール数(ルールリストのサイズ)Bと同じ段数のルール処理ブロック220−1〜220−Bを備えている。図10に示されるように、ルール処理ブロック220−i(i=1、2、・・・、B)は、当該葉ノードのルールリストに含まれるルールj(j=1、2・・・、B)に対応付けられており、当該ルールjに関するルール処理を実行する。これらルール処理ブロック220−1〜220−Bを用いることによって、ルールパイプラインブロック22は、葉ノードのルールリストに含まれる各ルールに対してルール処理を実行する。好適には、1クロックサイクル毎に、1つのルールに対するルール処理が実行される。   The rule pipeline block 22 performs rule processing (LOOKUP, INSERT, DELETE) 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. 10, the rule processing block 220-i (i = 1, 2,..., B) includes a rule j (j = 1, 2,..., Included in the rule list of the leaf node. 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.

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

図12は、本実施の形態に係るパケット分類器1のコマンド入力ブロック4の構成を示すブロック図である。図12に示されるように、コマンド入力ブロック4は、出力先分析ブロック40、コマンド出力情報記憶ブロック41、コマンド出力ブロック42、及びルール比較ブロック2−1〜2−Nのそれぞれへ入力コマンドを出力するための出力43−1〜43−Nを備えている。   FIG. 12 is a block diagram showing a configuration of the command input block 4 of the packet classifier 1 according to the present embodiment. As shown in FIG. 12, the command input block 4 outputs an input command to each of the output destination analysis block 40, the command output information storage block 41, the command output block 42, and the rule comparison blocks 2-1 to 2-N. Output 43-1 to 43-N.

コマンド出力情報記憶ブロック41は、「識別情報」と「選択ルール比較ブロック」との対応関係を示すコマンド出力情報を保持している。図13は、そのコマンド出力情報の一例を概念的に示している。「識別情報」は、例えば、MACヘッダのTypeフィールドである。出力先データはNビットデータ(N=ルール比較ブロック2−1〜2−Nの数)であり、それぞれのビットがルール比較ブロック2−1〜2−Nと対応付けられている。ビット値が‘0’であれば、当該ルール比較ブロック2は選択ルール比較ブロックではない。一方、ビット値が‘1’であれば、当該ルール比較ブロック2は選択ルール比較ブロックである。つまり、「選択ルール比較ブロック」は、Nビットの出力先データの中のビット‘1’で表されている。なお、INSERT処理時の新規ルールや、DELETE処理時の削除ルール等では、ルールの定義上、Typeフィールドといったヘッダフィールドがワイルドカードで定義されていたりする場合がある。その場合には、全てのルール比較ブロック2が選択ルール比較ブロックとなる。   The command output information storage block 41 holds command output information indicating the correspondence between “identification information” and “selection rule comparison block”. FIG. 13 conceptually shows an example of the command output information. “Identification information” is, for example, the Type field of the MAC header. The output destination data is N-bit data (N = number of rule comparison blocks 2-1 to 2-N), and each bit is associated with the rule comparison blocks 2-1 to 2-N. If the bit value is '0', the rule comparison block 2 is not a selected rule comparison block. On the other hand, if the bit value is ‘1’, the rule comparison block 2 is a selection rule comparison block. That is, the “selection rule comparison block” is represented by bit “1” in the N-bit output destination data. In addition, in a new rule at the time of INSERT processing, a deletion rule at the time of DELETE processing, or the like, a header field such as a Type field may be defined with a wild card in the definition of the rule. In that case, all the rule comparison blocks 2 are selected rule comparison blocks.

出力先分析ブロック40は、外部からパケット分類器1に入力された上述の入力データ6を受け取る。出力先分析ブロック40は、LOOKUPの場合は検索キー、INSERTの場合は新規ルール、DELETEの場合は削除ルールから、「識別情報」を抽出する。この識別情報は、例えば、MACヘッダのTypeフィールドである。そして、出力先分析ブロック40は、抽出された識別情報とコマンド出力情報(図13)を参照することによって、選択ルール比較ブロック2を認識する。出力先分析ブロック40は、コマンドと当該処理で用いるデータ、及びコマンド出力先の情報をコマンド出力ブロック42に出力する。   The output destination analysis block 40 receives the above-described input data 6 input to the packet classifier 1 from the outside. The output destination analysis block 40 extracts “identification information” from a search key in the case of LOOKUP, a new rule in the case of INSERT, and a deletion rule in the case of DELETE. This identification information is, for example, the Type field of the MAC header. Then, the output destination analysis block 40 recognizes the selection rule comparison block 2 by referring to the extracted identification information and command output information (FIG. 13). The output destination analysis block 40 outputs a command, data used in the processing, and command output destination information to the command output block 42.

コマンド出力ブロック42は、受け取ったコマンド情報に、内部処理で用いるフラグ等のデータを付与したものを、装置内コマンドとする。そして、コマンド出力ブロック42は、コマンド出力先の情報に従って、その装置内コマンドを選択ルール比較ブロック2に出力する。この際、コマンド出力ブロック42は、コマンド情報とそのコマンド情報が有効であるかを示すイネーブル信号を各ルール比較ブロック2に出力する方法が考えられる。この場合、コマンド出力ブロック42は、全てのルール比較ブロック2にコマンド情報を出力しながら、コマンド出力情報記憶ブロック41から読み出した出力先データの各ビットを、各ルール比較ブロック2に対するイネーブル信号として利用することもできる。   The command output block 42 uses the command information received with data such as a flag used in internal processing as an in-device command. Then, the command output block 42 outputs the in-device command to the selection rule comparison block 2 according to the command output destination information. At this time, the command output block 42 may output the command information and an enable signal indicating whether the command information is valid to each rule comparison block 2. In this case, the command output block 42 uses each bit of the output destination data read from the command output information storage block 41 as an enable signal for each rule comparison block 2 while outputting the command information to all the rule comparison blocks 2. You can also

図14は、装置内コマンドの構成例を示す概念図である。コマンド部分は、処理種別、終了フラグ、及び結果フラグを含んでいる。例えば、2ビットデータである処理種別は、“00”であればLOOKUP処理、“01”であればINSERT処理、“10”であればDELETE処理を示す。終了フラグは、‘0’であれば未終了、‘1’であれば終了を示す。結果フラグは、エントリの追加、削除を行った場合に、‘1’に設定される。尚、終了フラグと結果フラグについては、INSERT処理及びDELETE処理においてのみ参照され、それらの利用方法については後述する。また、装置内コマンドの後半部分には、検索キー(LOOKUP処理)、追加される新規エントリ(INSERT処理)、あるいは、削除される既存エントリ(DELETE処理)が格納される。なお、装置内コマンドの構成例はこれに限定されることはない。特に、終了フラグや結果フラグといった内部処理用のデータのビット幅をより多く用いることで、内部の処理状況を柔軟に把握することが可能となる。   FIG. 14 is a conceptual diagram illustrating 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. The configuration example of the in-device command is not limited to this. In particular, by using a larger bit width of internal processing data such as an end flag and a result flag, it becomes possible to flexibly grasp the internal processing status.

ここで、上記新規エントリや削除エントリ等のエントリ(ルール)は、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) such as the new entry and the deleted entry can take various expression forms in consideration of Prefix Match, Range Match, and 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.

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

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

ステップA1:
パケット分類器1に、入力データ6が入力される。その入力データ6は、LOOKUP処理を示す種別データと、被検索対象パケットから抽出された検索キーとを含む。コマンド入力ブロック4は、その入力データ6を受け取る。コマンド入力ブロック4は、その入力データ6に基づいて、上述したように選択ルール比較ブロック2を決定し、装置内コマンド(ここでは、検索コマンド)を生成する。そして、コマンド入力ブロック4は、生成した装置内コマンドを、選択ルール比較ブロック2に対して一斉に出力する。
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 determines the selection rule comparison block 2 based on the input data 6 as described above, and generates an in-device command (here, a search command). Then, the command input block 4 outputs the generated in-device command to the selection rule comparison block 2 all at once.

ステップA2:
コマンド入力ブロック4から検索コマンドを受け取ると、ルール比較ブロック2は、ルール一致比較処理を実行する。具体的に、ルール比較ブロック2が決定木で実現された決定木処理ブロック2の場合、図16に示すルール一致比較処理を行う。図16は、決定木処理ブロック2におけるステップA2の処理を示すフローチャートである。
Step A2:
When the search command is received from the command input block 4, the rule comparison block 2 executes a rule match comparison process. Specifically, when the rule comparison block 2 is a decision tree processing block 2 realized by a decision tree, the rule match comparison process shown in FIG. 16 is performed. FIG. 16 is a flowchart showing the process of step A2 in the decision tree processing block 2.

ステップB1:
決定木処理ブロック2は、ルール一致比較処理として、指定された検索キーを用いて、自身の決定木を辿る処理を実行する。図17は、ステップB1の処理を示すフローチャートである。
Step B1:
The decision tree processing block 2 executes a process for tracing its own decision tree using the designated search key as the rule matching comparison process. FIG. 17 is a flowchart showing the process of step B1.

ステップC1:
決定木を辿る処理は、決定木の根ノードから開始する。そのため、まず、現在の処理ノードが、決定木の根ノードに設定される。具体的には、挿入コマンドが、決定木パイプラインブロック20の初段の決定木ノード処理ブロック200−1に入力される。
Step C1:
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.

ステップC2:
子ノード決定ブロック2000は、処理種別がLOOKUPであることを確認した上で、ノード情報記憶ブロック2001からノード情報を読み出す。
Step C2:
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.

図18は、ノード情報の構成例を示す概念図である。ノード情報は、当該ノードにおける領域分割情報である。図18に示されるように、ノード情報は、フィールド識別子(フィールドID)とその分割数(k)のC個のペア、及びベースアドレスを含んでいる。ここで、Cは決定木の1ノードにおける領域分割に用いることができるフィールドの最大数である。フィールドIDは、検索キーやルールを構成するフィールド毎に予め決められている。また、各フィールドの範囲は、2分割されるとし(kは自然数)、分割数kはその指数を表す。例えば、既出の図1〜図3の例のように、フィールドX、Yの各々の範囲が2分割される場合、フィールドXの分割数kは1であり、フィールドYの分割数kも1である。尚、kの最大数は予め決められている。ベースアドレスは、当該ノードの子ノードのノード情報が格納されている記憶領域の最小アドレス値を示す。より詳細には、ベースアドレスは、当該ノードの子ノードのノード情報が格納されている次段の決定木ノード処理ブロック200のノード情報記憶ブロック2001における最小アドレス値であり、当該ノードの全ての子ノードのノード情報は、このベースアドレスから連続する記憶領域に格納されている。 FIG. 18 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. 18, 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.

ステップC3:
子ノード決定ブロック2000は、読み出したノード情報、検索キーの各フィールドのビット列、及び有効ビット長に基づいて、次段の子ノードのノード情報が格納されている記憶領域のアドレス値を算出する。具体的には、次のようにして次段のアドレス値は算出される(図19も参照されたい)。
Step C3:
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 next stage address value is calculated as follows (see also FIG. 19).

例えば、ノード情報として、2つのフィールドに関する分割情報(フィールドID、分割数)=(0001、01)、(0100、11)とベースアドレス=00001000が設定されているとする。検索キーにおいては、フィールドID=0001のフィールド値が“0101”、フィールドID=0100のフィールド値が“0110”であり、それぞれの有効ビット長が3、4であったとする。ここで、有効ビット長とは、各フィールドのビット列に対し、領域分割に用いる下位ビットからの長さに相当する。つまり、フィールド値のうち、有効ビット長で指定された長さをもつ下位ビットからのビット列が参照される。フィールドID=0001に関して説明する。有効ビット長が3であることから、フィールド値の下位3ビット“101”を参照する。そして、分割数k=1であるため、有効ビットの上位1ビットを参照し、‘1’を得る(図19参照)。同様に、フィールド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 valid bits is referred to obtain “1” (see FIG. 19). 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.

ステップC4:
続いて、子ノード決定ブロック2000は、入力された有効ビット長から分割数kを減算することによって、有効ビット長を更新する。上記の例では、フィールドID=0001の有効ビット長が3−1=2に、フィールドID=0100の有効ビット長が4−3=1に更新される。尚、決定木ノード処理ブロック200−1には有効ビット長が入力されないが、その場合の有効ビット長は、予め各フィールドのフィールド長として設定されているものとする。それ以降の決定木ノード処理ブロック200に対しては、前段の決定木ノード処理ブロック200から有効ビット長が入力される。
Step C4:
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.

ステップC5、C6:
次に、子ノードが葉ノードであるか否かが判定される。具体的には、決定木ノード処理ブロック200−Hが処理するノードの子ノードが葉ノードであるため(図7参照)、処理する決定木ノード処理ブロック200が自動的に判別すればよい。
Steps C5 and C6:
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. 7), the decision tree node processing block 200 to be processed may automatically determine.

次ノードが葉ノードではない場合(ステップC5;No)は、決定木ノード処理ブロック200−i(i=1、2、・・・、H−1)の場合に相当する。その決定木ノード処理ブロック200−iは、次段の決定木ノード処理ブロック200−(i+1)に出力データ2003を出力する(ステップC6)。その出力データ2003は、入力データ2002に含まれていたコマンド、算出された新しいアドレス値、及び更新後の有効ビット長を含む。そして、処理はステップC2に戻り、次段のノードが処理ノードとなる。   The case where the next node is not a leaf node (step C5; 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 decision tree node processing block 200- (i + 1) (step C6). 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 C2, and the next node becomes a processing node.

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

ステップB2:
ステップB1が終了すると、決定木ノード処理ブロック200−Hは、ルールパイプラインブロック22のルール処理ブロック220−1に、算出したアドレス値とコマンドを含む出力データ2003を出力する。
Step B2:
When step B1 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.

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

ステップD1:
マッチング処理は、ルールリスト中の1番目のルールから開始する。具体的には、初段のルール処理ブロック220−1から処理を開始する。
Step D1:
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.

ステップD2:
比較更新処理ブロック2200は、処理種別がLOOKUPであることを確認した上で、入力されたアドレス値を用いてエントリ記憶ブロック2201からエントリ情報を読み出す。そして、比較更新処理ブロック2200は、有効フラグを確認する。
Step D2:
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.

図21は、エントリ情報の構成例を示す概念図である。エントリ情報は、当該ルールが有効であるかを示す有効フラグ、ルールID、ルール、優先度を含んでいる。ルールに対応するアクションを同時に記憶する場合には、アクションを加えても良い。ここでは、アクションは本パケット分類器1とは異なる場所で管理されており、本パケット分類器1によって検索を行った後に、当該ルールIDを用いることによりアクションが取得されるとする。なお、図21のエントリ情報の構成例では、ルール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. 21 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. 21, 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.

ステップD3、D4:
ルールが有効である場合(ステップD3;Yes)、比較更新処理ブロック2200は、検索キーと読み出したルールとの比較を行う。この比較方法については、例えば、非特許文献2に開示されている。
Steps D3 and D4:
If the rule is valid (step D3; 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.

ステップD5、D6:
検索キーがルールにマッチした場合(ステップD5;Yes)、比較更新処理ブロック2200は、当該ルールの優先度と現在のマッチルールの優先度を比較する。ここで、現在のマッチルールとは、前段のルール処理ブロック220までにマッチしたルールのうち、最も優先度が高いルールを意味する。一方、現在のルール処理ブロック220において比較に用いられたルールは、比較ルールと参照される。
Steps D5 and D6:
When the search key matches the rule (step D5; 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.

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

ステップD9、D10、D11:
現在のルールが、ルールリスト中の最後のルールか否かが判定される。具体的には、ルール処理ブロック220−i(i=1、2、・・・、B−1)が処理を実行している場合、それは最後のルールではない(ステップD9;No)。この場合、そのルール処理ブロック220−iは、次段のルール処理ブロック220−(i+1)に、アドレス値とコマンドを含む出力データ2204を出力する(ステップD10)。そして、処理はステップD2に戻り、ルールリスト中の次のルールに対するマッチング処理が実行される。
Steps D9, D10, D11:
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 D9; 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 D10). Then, the process returns to step D2, and the matching process for the next rule in the rule list is executed.

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

現在のルールがルールリスト中の最後のルールである場合、つまり、処理がルール処理ブロック220−Bで行われた場合(ステップD9;Yes)、ルール処理ブロック220−Bは、マッチルールのルールIDと優先度、及びコマンドを、結果出力ブロック5に出力する(ステップD11)。そして、ステップB3が終了する。なお、マッチルールが存在しない場合には、マッチルールが存在しなかったことを示す信号を出力するが、例えば、ルール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 D9; 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 D11). Then, step B3 ends. If there is no match rule, a signal indicating that there is no match rule is output. For example, by outputting a special value in which the bit values of the rule ID are all 1, It can also indicate that the rule did not exist.

ステップA3:
結果出力ブロック5は、複数の決定木処理ブロック2−1〜2−Nから検索結果を受け取る。結果出力ブロック5は、マッチルールの優先度同士を比較し、最も優先度の高いマッチルールを選択する。そして、結果出力ブロック5は、その選択結果を示す出力データ7として、例えば、最高優先度であったマッチルールのルールIDを、LOOKUP処理の最終結果として出力する。このとき、マッチルールが存在しなかった場合には、上述した特値のルールIDを出力することで、マッチルールが存在しなかったことを示すことができる。
Step A3:
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.

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

ステップA1:
パケット分類器1に、入力データ6が入力される。その入力データ6は、INSERT処理を示す種別データと、追加される新規ルールとを含む。コマンド入力ブロック4は、その入力データ6を受け取る。コマンド入力ブロック4は、その入力データ6に基づいて、上述したように選択ルール比較ブロック2を決定し、装置内コマンド(ここでは、検索コマンド)を生成する。そして、コマンド入力ブロック4は、生成した装置内コマンドを、選択ルール比較ブロック2に対して一斉に出力する。
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 determines the selection rule comparison block 2 based on the input data 6 as described above, and generates an in-device command (here, a search command). Then, the command input block 4 outputs the generated in-device command to the selection rule comparison block 2 all at once.

ステップA4:
コマンド入力ブロック4から検索コマンドを受け取ると、ルール比較ブロック2は、当該ブロックにおいてルールの複製が発生するかを確認する。具体的には、ルール比較ブロック2が決定木で実現された決定木処理ブロック2の場合、図23に示すルールの複製有無確認処理を行う。図23は、決定木処理ブロック2におけるステップA4の処理を示すフローチャートである。
Step A4:
When a search command is received from the command input block 4, the rule comparison block 2 confirms whether rule duplication occurs in the block. Specifically, when the rule comparison block 2 is a decision tree processing block 2 realized by a decision tree, a rule duplication presence / absence confirmation process shown in FIG. 23 is performed. FIG. 23 is a flowchart showing the process of step A4 in the decision tree processing block 2.

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

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

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

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

ステップC8:
子ノード決定ブロック2000は、読み出したノード情報、新規ルールの各フィールドのビット列、及び有効ビット長に基づいて、ルールの複製が発生するか否か判定する。ルールの複製が発生するか否かは、アドレス値の算出を行う際に、ワイルドカードが含まれるか否かで判断することができる。
Step C8:
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時のステップC3と同様に、次の子ノードのアドレス値を算出することができる。一方、同様のノード情報、有効ビット長に対して、追加対象ルールにおけるフィールド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 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 C3 at the time of 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.

ステップC9、C10:
ルールの複製が発生する場合(ステップC9;Yes)、当該決定木処理ブロック2は、エントリ追加対象候補とはならない。この場合、子ノード決定ブロック2000は、コマンドの終了フラグを‘1’に設定する。その後、処理はステップC5に進む。
Steps C9 and C10:
When rule duplication occurs (step C9; 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 processing proceeds to step C5.

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

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

ステップB5:
ステップB4が終了すると、決定木ノード処理ブロック200−Hは、算出したアドレス値とコマンドを含む出力データ2004を、エントリ数カウントブロック21に出力する。
Step B5:
When step B4 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.

ステップB6:
エントリ数カウントブロック21のカウント処理ブロック210は、決定木ノード処理ブロック200−Hから入力データ212(=上述の出力データ2004)を受け取る。カウント処理ブロック210は、処理種別がINSERTであることを確認した上で、終了フラグを参照する。終了フラグが‘0’の場合、当該決定木処理ブロック2は、エントリ追加対象候補である。この場合、カウント処理ブロック210は、入力されたアドレス値を用いて、エントリ数記憶ブロック211から追加対象葉ノードに関するエントリ数情報(有効エントリ数)を読み出す。そして、カウント処理ブロック210は、読み出した有効エントリ数を示す出力データ216を、エントリ追加対象決定ブロック3に出力する。
Step B6:
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 (valid entry number) related to 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 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 entries to the maximum value and notify the entry addition target determination block 3 of the number of valid entries.

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

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

ステップE4、E5:
一方、有効エントリ数がリストサイズを下回っているものがある場合(ステップE2;Yes)、エントリ追加対象決定ブロック3は、有効エントリ数が最小であるエントリ追加対象候補を、エントリ追加対象として選択する(ステップE4)。その後、エントリ追加対象決定ブロック3は、各決定木処理ブロック2にエントリ追加の可否を通知する(ステップE5)。例えば、エントリ追加対象決定ブロック3は、エントリ追加対象に対して新規ルールの追加を指示し、それ以外の決定木処理ブロック2に対してルール追加処理の不実行を指示する。なお、ここでは有効エントリ数が最小であるエントリ追加対象候補をエントリ追加対象として選択しているが、その他のポリシーに従ってエントリ追加対象を選択しても良い。
Steps E4 and E5:
On the other hand, if there is one in which the number of valid entries is smaller than the list size (step E2; Yes), 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. (Step E4). 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 E5). 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. Although the entry addition target candidate having the minimum number of valid entries is selected as the entry addition target here, the entry addition target may be selected according to other policies.

ステップA6:
エントリ追加対象である決定木処理ブロック2のエントリ数カウントブロック21は、追加対象葉ノードに関する有効エントリ数に“1”を加算し、エントリ数記憶ブロック211に書き込む。これにより、エントリ数記憶ブロック211が最新状態に更新される。それ以外の決定木処理ブロック2のエントリ数カウントブロック21は、コマンドの終了フラグを‘1’に設定する。
Step A6:
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 entries related to the addition target leaf node, and writes it to 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”.

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

ステップD12:
各決定木処理ブロック2のエントリ数カウントブロック21は、アドレス値と挿入コマンドを含む出力データ214を、ルールパイプラインブロック22のルール処理ブロック220−1に出力する。
Step D12:
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.

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

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

ステップD2:
LOOKUP処理の場合と同様に、比較更新処理ブロック2200は、入力されたアドレス値を用いてエントリ記憶ブロック2201からエントリ情報を読み出す。そして、比較更新処理ブロック2200は、有効フラグを確認する。
Step D2:
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.

ステップD3、D15:
ルールが有効ではない場合(ステップD3;No)、当該エントリ(すなわち、空きエントリ)に新規ルールを書き込むことができる。この場合、比較更新処理ブロック2200は、エントリ情報中のルール情報を新規ルールのものに書き換え、且つ、有効フラグを‘1’に設定し、エントリ記憶ブロック2201に書き込む。さらに、比較更新処理ブロック2200は、コマンド内の終了フラグを‘1’に設定し、結果フラグを‘1’(追加成功)に設定する。その後、処理はステップD9に進む。
Steps D3 and D15:
If the rule is not valid (step D3; 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 D9.

ステップD16:
ルールが有効である場合(ステップD3;Yes)、当該エントリに新規ルールを書き込むことは許されない。この場合、そのルール処理ブロック220−iは、次段のルール処理ブロック220−(i+1)に、アドレス値とコマンドを含む出力データ2204を出力する。そして、処理はステップD14に戻り、ルールリスト中の次のルールに対する処理が実行される。
Step D16:
If the rule is valid (step D3; 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 D14, and the process for the next rule in the rule list is executed.

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

ステップA8:
結果出力ブロック5は、複数の決定木処理ブロック2−1〜2−Nからコマンドを受け取る。結果出力ブロック5は、受け取ったコマンド内の結果フラグを参照して、新規ルールが追加されたか、又は追加されなかったかを確認する。そして、結果出力ブロック5は、その結果を示す出力データ7を、INSERT処理の最終結果として出力する。
Step A8:
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.

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

ステップA1:
パケット分類器1に、入力データ6が入力される。その入力データ6は、DELETE処理を示す種別データと、削除される既存ルールとを含む。コマンド入力ブロック4は、その入力データ6を受け取る。コマンド入力ブロック4は、その入力データ6に基づいて、上述したように選択ルール比較ブロック2を決定し、装置内コマンド(ここでは、検索コマンド)を生成する。そして、コマンド入力ブロック4は、生成した装置内コマンドを、選択ルール比較ブロック2に対して一斉に出力する。
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 determines the selection rule comparison block 2 based on the input data 6 as described above, and generates an in-device command (here, a search command). Then, the command input block 4 outputs the generated in-device command to the selection rule comparison block 2 all at once.

ステップA9:
コマンド入力ブロック4から削除コマンドを受け取ると、各ルール比較ブロック2は、当該ブロックにおいてルールの複製が発生するかを確認する。具体的には、ルール比較ブロック2が決定木で実現された決定木処理ブロック2の場合、図28に示すルールの複製有無確認処理を行う。図28は、決定木処理ブロック2におけるステップA9の処理を示すフローチャートである。
Step A9:
When a delete command is received from the command input block 4, each rule comparison block 2 checks whether or not duplication of the rule occurs in that block. Specifically, when the rule comparison block 2 is the decision tree processing block 2 realized by a decision tree, the rule duplication presence / absence confirmation processing shown in FIG. 28 is performed. FIG. 28 is a flowchart showing the process of step A9 in the decision tree processing block 2.

ステップB4:
INSERT処理時と同様、コマンド入力ブロック4から削除コマンドを受け取ると、決定木処理ブロック2は、指定された削除ルールを用いて、自身の決定木を辿る処理を実行する。
Step B4:
As in the case of the INSERT process, when a delete command is received from the command input block 4, the decision tree processing block 2 executes a process for tracing its own decision tree using the designated deletion rule.

ステップB7:
ステップB4が終了すると、決定木ノード処理ブロック200−Hは、ルールパイプラインブロック22のルール処理ブロック220−1に、算出したアドレス値とコマンドを含む出力データ2003を出力し、ステップA9を終了する。
Step B7:
When step B4 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, and ends step A9. .

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

ステップB8:
ルールパイプラインブロック22は、ルールの削除処理として、対象エントリの削除を行う。図30は、ステップB8の処理を示すフローチャートである。
Step B8:
The rule pipeline block 22 deletes the target entry as a rule deletion process. FIG. 30 is a flowchart showing the process of step B8.

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

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

ステップD2、D3:
LOOKUP処理の場合と同様に、比較更新処理ブロック2200は、入力されたアドレス値を用いてエントリ記憶ブロック2201からエントリ情報を読み出す。そして、比較更新処理ブロック2200は、有効フラグを確認する。ルールが無効である場合(ステップD3:No)、当該エントリは削除対象ではない。この場合、処理はステップD9に進む。一方、ルールが有効である場合(ステップD3;Yes)、処理はステップD19に進む。
Steps D2 and D3:
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 D3: No), the entry is not a deletion target. In this case, the process proceeds to step D9. On the other hand, when the rule is valid (step D3; Yes), the process proceeds to step D19.

ステップD19:
比較更新処理ブロック2200は、読み出したルールと、削除対象として指定されたルールとを比較する。つまり、比較更新処理ブロック2200は、削除対象として指定されているルールが、読み出したルールにマッチするか否かを判定する。ここでは、両者が完全に一致するか否かが判定される。不一致の場合(ステップD5;No)、処理はステップD9に進む。一方、完全一致の場合(ステップD5;Yes)、処理はステップD20に進む。
Step D19:
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 D5; No), the process proceeds to step D9. On the other hand, if it is a complete match (step D5; Yes), the process proceeds to step D20.

ステップD20:
比較更新処理ブロック2200は、エントリ情報中の有効フラグを‘0’に設定し、エントリ記憶ブロック2201に書き込む。これにより、当該エントリ(ルール)は無効化される。この処理が既存ルールの削除に相当する。更に、比較更新処理ブロック2200は、コマンド内の終了フラグを‘1’に設定し、結果フラグを‘1’(削除成功)に設定する。その後、処理はステップD9に進む。
Step D20:
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 D9.

ステップD9、D16:
LOOKUP処理の場合と同様に、現在のルールが、ルールリスト中の最後のルールか否かが判定される。現在のルールが最後のルールではない場合(ステップD9;No)、ルール処理ブロック220−iは、次段のルール処理ブロック220−(i+1)に、アドレス値とコマンドを含む出力データ2204を出力する(ステップD16)。そして、処理はステップD18に戻り、ルールリスト中の次のルールに対する処理が実行される。一方、現在のルールがルールリスト中の最後のルールである場合(ステップD9;Yes)、ステップB8は終了する。
Steps D9 and D16:
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 D9; 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 D16). Then, the process returns to step D18, 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 D9; Yes), step B8 ends.

ステップB9:
ステップB8が完了すると、ルール処理ブロック220−Bは、アドレス値とコマンドを含む出力データ2205を、エントリ数カウントブロック21に出力する。
Step B9:
When step B8 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.

ステップB10:
エントリ数カウントブロック21のカウント処理ブロック210は、ルール処理ブロック220−Bから入力データ213(=上述の出力データ2005)を受け取る。カウント処理ブロック210は、処理種別がDELETEであることを確認した上で、終了フラグ及び結果フラグを参照する。終了フラグ及び結果フラグが共に‘1’である場合、カウント処理ブロック210は、入力されたアドレス値を用いて、エントリ数記憶ブロック211から削除対象葉ノードに関するエントリ数情報(有効エントリ数)を読み出す。そして、カウント処理ブロック210は、当該有効エントリ数から1を減算し、エントリ数記憶ブロック211に書き込む。これにより、エントリ数記憶ブロック211が最新状態に更新される。
Step B10:
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 reads the entry number information (valid entry number) related to the deletion target leaf node from the entry number storage block 211 using the input address value. . Then, the count processing block 210 subtracts 1 from the number of valid 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.

ステップA11:
最後に、カウント処理ブロック210は、コマンドを含む出力データ215を結果出力ブロック5に出力する。結果出力ブロック5は、決定木処理ブロック2−1〜2−Nのそれぞれから受け取ったコマンド内の結果フラグを参照して、ルールが削除されたか、又は削除されなかったかを確認する。そして、結果出力ブロック5は、その結果を示す出力データ7を、DELETE処理の最終結果として出力する。
Step A11:
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.第2の構成例
次に、本実施の形態に係るパケット分類器1の第2の構成例を説明する。第2の構成例では、各ルール比較ブロック2が、決定木ではなく、リスト形式でルールを管理する。それ以外の構成は第1の構成例と同じであり、重複する説明は適宜省略される。
1-3. Second Configuration Example Next, a second configuration example of the packet classifier 1 according to the present embodiment will be described. In the second configuration example, each rule comparison block 2 manages rules in a list format instead of a decision tree. Other configurations are the same as those of the first configuration example, and redundant description is omitted as appropriate.

図31は、第2の構成例における各ルール比較ブロック2の構成を示すブロック図である。以下では、この場合のルール比較ブロック2をリニアサーチブロックとも参照する。図31に示されるように、リニアサーチブロック2は、エントリ数カウントブロック21及びルールパイプラインブロック22を備えている。つまり、リニアサーチブロック2は、図6で示された決定木処理ブロック2から決定木パイプラインブロック20が省かれた構成を有している。コマンド入力ブロック4からリニアサーチブロック2に入力されるデータは、入力データ23である。リニアサーチブロック2から結果出力ブロック5に出力されるデータは、出力データ24である。リニアサーチブロック2とエントリ追加対象決定ブロック3との間でやりとりされるデータは、入出力データ25である。   FIG. 31 is a block diagram showing a configuration of each rule comparison block 2 in the second configuration example. Hereinafter, the rule comparison block 2 in this case is also referred to as a linear search block. As shown in FIG. 31, the linear search block 2 includes an entry count block 21 and a rule pipeline block 22. That is, the linear search block 2 has a configuration in which the decision tree pipeline block 20 is omitted from the decision tree processing block 2 shown in FIG. Data input from the command input block 4 to the linear search block 2 is input data 23. Data output from the linear search block 2 to the result output block 5 is output data 24. Data exchanged between the linear search block 2 and the entry addition target determination block 3 is input / output data 25.

エントリ数カウントブロック21の構成は、図9で示されたものと同一であるため詳細な説明を省略する。但し、エントリ数記憶ブロック211には、決定木の各葉ノードによって管理されている有効なルールのエントリ数ではなく、当該リニアサーチブロック2で管理されている有効なルールのエントリ数を保持している。ここで、後述するが、リニアサーチブロック2のルールパイプラインブロック22内の各ルール処理ブロック220は、1つのルールを保持する。従って、ルールリストはB個のルールをリスト(ルール処理ブロック220)で接続した構成になるため、このルールリストに含まれる有効なルールのエントリ数としては1つの値を保持すれば良い。なお、各ルール処理ブロック220において、複数のルールを管理することで、1つのリニアサーチブロック2で複数のルールリストを管理するように見せることも可能であるが、それらは1つのルールリストを管理するリニアサーチブロック2が複数存在する場合と何ら変わりない。このため、以降では、各リニアサーチブロック2は1つのルールリストのみを管理することを前提とする。   The configuration of the entry count block 21 is the same as that shown in FIG. However, the entry count storage block 211 holds the number of valid rule entries managed by the linear search block 2, not the number of valid rule entries managed by each leaf node of the decision tree. Yes. Here, as will be described later, each rule processing block 220 in the rule pipeline block 22 of the linear search block 2 holds one rule. Therefore, the rule list has a configuration in which B rules are connected by a list (rule processing block 220). Therefore, it is only necessary to hold one value as the number of valid rule entries included in the rule list. In each rule processing block 220, a plurality of rules can be managed to make it appear that a single linear search block 2 manages a plurality of rule lists, but they manage a single rule list. This is no different from the case where there are a plurality of linear search blocks 2 to be performed. Therefore, hereinafter, it is assumed that each linear search block 2 manages only one rule list.

ルールパイプラインブロック22の構成及びルール処理ブロック220の構成も、第1の構成例の場合と同じである。但し、上述したように、エントリ記憶ブロック2201では、1つのルールのみが管理される。   The configuration of the rule pipeline block 22 and the configuration of the rule processing block 220 are the same as those in the first configuration example. However, as described above, in the entry storage block 2201, only one rule is managed.

上述したように、エントリ数カウントブロック21のエントリ数記憶ブロック211、及びルール処理ブロック220のエントリ記憶ブロック2201は、第1の構成例とは異なり、1つの有効エントリ数、及び1つのルールのみを管理できれば良い。このため、メモリで実現することも可能ではあるが、ワード数等の制約により記憶媒体が無駄になるような場合には、レジスタで実現することが望ましい。   As described above, the entry number storage block 211 of the entry count block 21 and the entry storage block 2201 of the rule processing block 220 differ from the first configuration example in that only one valid entry number and only one rule are stored. It only has to be managed. For this reason, it can be realized by a memory, but when a storage medium is wasted due to restrictions such as the number of words, it is preferably realized by a register.

なお、本構成の場合も第1の構成例と同様に、例えば、MACヘッダのTypeフィールドの値によって、装置内コマンドの出力先を決定することになる。   In the case of this configuration, as in the first configuration example, for example, the output destination of the in-device command is determined by the value of the Type field of the MAC header.

次に、本構成におけるパケット分類器1の動作について説明する。但し、以下では、第1の構成例における動作と異なる点のみを説明し、同じ動作を行う点については詳細な説明を省略する。   Next, the operation of the packet classifier 1 in this configuration will be described. However, in the following, only points different from the operation in the first configuration example will be described, and detailed description of the same operation will be omitted.

<LOOKUP処理>
まず、LOOKUP処理を説明する。図32は、第2の構成例におけるLOOKUP処理を示すフローチャートである。図32を参照すると、第2の構成例におけるLOOKUP処理は、第1の構成例の動作におけるステップA2がステップA12に置き換わったものである。その他の動作は全て第1の構成例における動作と変わりないため、詳細な説明を省略する。
<LOOKUP processing>
First, the LOOKUP process will be described. FIG. 32 is a flowchart showing the LOOKUP process in the second configuration example. Referring to FIG. 32, the LOOKUP process in the second configuration example is obtained by replacing step A2 in the operation of the first configuration example with step A12. Since all other operations are the same as those in the first configuration example, detailed description thereof is omitted.

ステップA12:
コマンド入力ブロック4から検索コマンドを受け取るとルール比較ブロック2は、ルール一致比較処理を実行する。図33は、リニアサーチブロック2におけるステップA12の処理を示すフローチャートである。
Step A12:
When a search command is received from the command input block 4, the rule comparison block 2 executes a rule match comparison process. FIG. 33 is a flowchart showing the process of step A12 in the linear search block 2.

図33を参照すると、ステップA12は、第1の構成例におけるステップB3を実行することが分かる。本構成例では、ルール比較ブロック2が単一のルールリストで構成されるため、LOOKUP処理時には、直接先頭のルール処理ブロック220−1から順に検索キーとルールとの比較処理を実行していけば良い。また、第1の構成例における動作時と異なり、決定木を辿る際のアドレス計算等も不要である。本構成例におけるLOOKUP処理時では、アドレスは明示的に指定可能である。   Referring to FIG. 33, it can be seen that step A12 executes step B3 in the first configuration example. In this configuration example, the rule comparison block 2 is composed of a single rule list. Therefore, when performing the LOOKUP process, the comparison process between the search key and the rule should be executed in order from the first rule processing block 220-1. good. Further, unlike the operation in the first configuration example, it is not necessary to calculate an address when tracing the decision tree. At the time of LOOKUP processing in this configuration example, the address can be explicitly specified.

<INSERT処理>
次に、INSERT処理を説明する。図34は、第2の構成例におけるINSERT処理を示すフローチャートである。図34を参照すると、第2の構成例におけるINSERT処理は、第1の構成例の動作におけるステップA4がステップA13に置き換わったものである。その他の動作は全て第1の構成例における動作と変わりないため、詳細な説明を省略する。
<INSERT processing>
Next, the INSERT process will be described. FIG. 34 is a flowchart showing INSERT processing in the second configuration example. Referring to FIG. 34, the INSERT process in the second configuration example is obtained by replacing step A4 in the operation of the first configuration example with step A13. Since all other operations are the same as those in the first configuration example, detailed description thereof is omitted.

ステップA13:
コマンド入力ブロック4からINSERTコマンドを受け取ると、ルール比較ブロック2は、当該ブロックにおいてルールの複製が発生するかを確認する。本構成例の場合、ルール比較ブロックは決定木で構成されていないため、ルールの複製は発生しない。このため、図35に示すルールの複製有無確認処理を行う。図35は、リニアサーチブロック2におけるステップA13の処理を示すフローチャートである。
Step A13:
When the INSERT command is received from the command input block 4, the rule comparison block 2 checks whether or not duplication of the rule occurs in the block. In the case of this configuration example, the rule comparison block is not configured with a decision tree, and therefore, rule replication does not occur. Therefore, a rule duplication presence / absence confirmation process shown in FIG. FIG. 35 is a flowchart showing the process of step A13 in the linear search block 2.

ステップB11:
エントリ数カウントブロック21のカウント処理ブロック210は、コマンド入力ブロック4からコマンドを受け取る。カウント処理ブロック210は、エントリ数記憶ブロック211から当該リニアサーチブロック2の有効エントリ数を読み出す。そして、カウント処理ブロック210は、読み出した有効エントリ数を示す出力データ216を、エントリ追加対象決定ブロック3に出力する。
Step B11:
The count processing block 210 of the entry count block 21 receives a command from the command input block 4. The count processing block 210 reads the number of valid entries of the linear search block 2 from the entry number storage block 211. Then, the count processing block 210 outputs output data 216 indicating the number of read valid entries to the entry addition target determination block 3.

本ステップ以降は、第1の構成例と同様の動作であるため、詳細な説明は省略する。   Since the operation after this step is the same as that of the first configuration example, detailed description thereof is omitted.

<DELETE処理>
次に、DELETE処理を説明する。図36は、第2の構成例におけるDELETE処理を示すフローチャートである。図36を参照すると、第2の構成例におけるDELETE処理は、第1の構成例の動作におけるステップA9が除かれたものである。その他の動作は全て第1の構成例における動作と変わりないため、詳細な説明を省略する。
<DELETE processing>
Next, the DELETE process will be described. FIG. 36 is a flowchart showing DELETE processing in the second configuration example. Referring to FIG. 36, the DELETE process in the second configuration example is obtained by removing step A9 in the operation of the first configuration example. Since all other operations are the same as those in the first configuration example, detailed description thereof is omitted.

1−4.第3の構成例
次に、本実施の形態に係るパケット分類器1の第3の構成例について説明する。第3の構成例では、第1の構成例におけるルール比較ブロック2(決定木処理ブロック2)と、第2の構成例におけるルール比較ブロック2(リニアサーチブロック2)が混在する。この場合、ルール比較ブロック2−1〜2−NにおけるM個が第1の構成例におけるルール比較ブロック2(決定木処理ブロック2)であり、残りN−M個が第2の構成例におけるルール比較ブロック2(リニアサーチブロック2)である。
1-4. Third Configuration Example Next, a third configuration example of the packet classifier 1 according to the present embodiment will be described. In the third configuration example, the rule comparison block 2 (decision tree processing block 2) in the first configuration example and the rule comparison block 2 (linear search block 2) in the second configuration example are mixed. In this case, M in the rule comparison blocks 2-1 to 2-N are the rule comparison block 2 (decision tree processing block 2) in the first configuration example, and the remaining NM are the rules in the second configuration example. This is a comparison block 2 (linear search block 2).

但し、本実施の形態に係るパケット分類器1は、パイプライン処理によるハードウェア実装を想定している。そのため、第1の構成におけるルール比較ブロック2のパイプライン段数と、第2の構成におけるルール比較ブロック2のパイプライン段数を合わせておいた方がより効率的である。第1の構成におけるルール比較ブロック2は、H個の決定木ノード処理ブロック200と、1個のエントリ数カウントブロック21、B個のルール処理ブロック220を備えている。一方、第2の構成におけるルール比較ブロック2は、1個のエントリカウントブロック21と、B個のルール処理ブロック220を備えている。例えばLOOKUP処理の場合、第1の構成におけるルール比較ブロック2のパイプライン段数がH+B段になるのに対し、第2の構成におけるルール比較ブロック2のパイプライン段数はB段となる。この不一致を防ぐため、第3の構成においては、第2の構成におけるルール比較ブロック2を用いる際には、H+B個のルール処理ブロック220を備えることが望ましい。これにより、LOOKUP処理を基準として考えた場合に、パイプライン段数が一致することになり、より効率的な処理が可能となる。   However, the packet classifier 1 according to the present embodiment assumes hardware implementation by pipeline processing. Therefore, it is more efficient to combine the number of pipeline stages of the rule comparison block 2 in the first configuration with the number of pipeline stages of the rule comparison block 2 in the second configuration. The rule comparison block 2 in the first configuration includes H decision tree node processing blocks 200, one entry count block 21, and B rule processing blocks 220. On the other hand, the rule comparison block 2 in the second configuration includes one entry count block 21 and B rule processing blocks 220. For example, in the case of LOOKUP processing, the number of pipeline stages in the rule comparison block 2 in the first configuration is H + B, whereas the number of pipeline stages in the rule comparison block 2 in the second configuration is B. In order to prevent this inconsistency, in the third configuration, when using the rule comparison block 2 in the second configuration, it is desirable to include H + B rule processing blocks 220. As a result, when the LOOKUP process is considered as a reference, the number of pipeline stages matches, and more efficient processing is possible.

上記以外の構成については、第1、第2の構成例と同様であるため、詳細な説明は省略する。   Since the configuration other than the above is the same as the first and second configuration examples, detailed description thereof is omitted.

次に、本構成におけるパケット分類器1の動作について説明する。但し、LOOKUP処理、DELETE処理については、各ルール処理ブロック2において、第1の構成における動作、あるいは、第2の構成における動作を実行すれば良いため、詳細な説明を省略する。以下では、より効率的なルール管理が可能となるよう、INSERT処理における動作について説明する。   Next, the operation of the packet classifier 1 in this configuration will be described. However, the LOOKUP process and the DELETE process will not be described in detail because it is only necessary to execute the operation in the first configuration or the operation in the second configuration in each rule processing block 2. Hereinafter, an operation in the INSERT process will be described so that more efficient rule management can be performed.

<INSERT処理>
第3の構成例におけるINSERT処理は、第1及び第2の構成例の動作とほぼ同様である。ルール比較ブロック2、エントリ追加対象決定ブロック3以外のブロックについては、全く変わりはないため、詳細な説明を省略する。
<INSERT processing>
The INSERT processing in the third configuration example is substantially the same as the operations in the first and second configuration examples. Since the blocks other than the rule comparison block 2 and the entry addition target determination block 3 are not changed at all, a detailed description thereof will be omitted.

ルール比較ブロック2は、その構成が第1の構成例におけるルール比較ブロック2である場合、第1の構成例における動作を実行する。ルール比較ブロック2は、その構成が第2の構成例におけるルール比較ブロック2である場合、第2の構成例における動作を実行する。   When the configuration is the rule comparison block 2 in the first configuration example, the rule comparison block 2 executes the operation in the first configuration example. When the configuration is the rule comparison block 2 in the second configuration example, the rule comparison block 2 executes the operation in the second configuration example.

第3の構成例におけるINSERT処理においては、上記の第1及び第2の構成例におけるステップA5(エントリ追加対象のルール比較ブロック2を決定する処理)が、次に説明されるステップA14に置き換えられる。   In the INSERT processing in the third configuration example, step A5 (processing for determining the rule comparison block 2 to be added to the entry) in the first and second configuration examples described above is replaced with step A14 described next. .

ステップA14:
エントリ追加対象決定ブロック3は、ルール比較ブロック2から通知される情報に基づいて、エントリ追加対象候補を認識し、エントリ追加対象候補の中からエントリ追加対象を選択する。図37は、ステップA14の処理を示すフローチャートである。
Step A14:
The entry addition target determination block 3 recognizes the entry addition target candidate based on the information notified from the rule comparison block 2, and selects the entry addition target from the entry addition target candidates. FIG. 37 is a flowchart showing the process of step A14.

ステップE1、E6:
エントリ追加対象決定ブロック3は、エントリ追加対象候補から有効エントリ数を示す情報を受け取る(ステップE1)。次に、エントリ追加対象決定ブロック3は、第1の構成例のルール比較ブロック2のうち、有効エントリ数がルールリストの最大数B(リストサイズ)を下回っているものがあるか否か確認する(ステップE6)。有効エントリ数がリストサイズを下回っているものが無い場合(ステップE6;No)、処理はステップE8に進む。一方、有効エントリ数がリストサイズを下回っているものが有る場合(ステップE6;Yes)、処理はステップE7に進む。
Step E1, E6:
The entry addition target determination block 3 receives information indicating the number of valid entries from the entry addition target candidate (step E1). Next, the entry addition target determination block 3 checks whether there is any rule comparison block 2 in the first configuration example in which the number of valid entries is less than the maximum number B (list size) of the rule list. (Step E6). If there is no valid entry number less than the list size (step E6; No), the process proceeds to step E8. On the other hand, if there is one in which the number of valid entries is smaller than the list size (step E6; Yes), the process proceeds to step E7.

ステップE7:
エントリ追加対象決定ブロック3は、第1の構成例のルール比較ブロック2のうち、有効エントリ数が最小であるエントリ追加対象候補を、エントリ追加対象として選択する。その後、処理は、ステップE5に進む。
Step E7:
The entry addition target determination block 3 selects an entry addition target candidate having the smallest number of valid entries as the entry addition target from the rule comparison block 2 of the first configuration example. Thereafter, the processing proceeds to step E5.

ステップE8:
エントリ追加対象決定ブロック3は、第2の構成例を用いているルール比較ブロック2のうち、有効エントリ数がルールリストの最大数H+B(リストサイズ)を下回っているものがあるか否か確認する。有効エントリ数がリストサイズを下回っているものが無い場合(ステップE8;No)、処理はステップE3に進む。一方、有効エントリ数がリストサイズを下回っているものが有る場合(ステップE8;Yes)、処理はステップE9に進む。
Step E8:
The entry addition target determination block 3 checks whether any of the rule comparison blocks 2 using the second configuration example has a number of valid entries below the maximum number H + B (list size) of the rule list. . If there is no valid entry number less than the list size (step E8; No), the process proceeds to step E3. On the other hand, if there is one in which the number of valid entries is smaller than the list size (step E8; Yes), the process proceeds to step E9.

ステップE3:
エントリ追加対象決定ブロック3は、エントリを追加できるルール比較ブロック2は存在しないと判断する。その後、処理は、ステップE5に進む。
Step E3:
The entry addition target determination block 3 determines that there is no rule comparison block 2 to which an entry can be added. Thereafter, the processing proceeds to step E5.

ステップE9:
エントリ追加対象決定ブロック3は、第2の構成例のルール比較ブロック2のうち、有効エントリ数が最小であるエントリ追加対象候補を、エントリ追加対象として選択する。その後、処理は、ステップE5に進む。
Step E9:
The entry addition target determination block 3 selects an entry addition target candidate having the minimum number of valid entries as the entry addition target from the rule comparison block 2 of the second configuration example. Thereafter, the processing proceeds to step E5.

ステップE5:
エントリ追加対象決定ブロック3は、各ルール比較ブロック2にエントリ追加の可否を通知する。例えば、エントリ追加対象決定ブロック3は、エントリ追加対象に対して新規ルールの追加を指示し、それ以外のルール比較ブロック2に対してルール追加処理の不実行を指示する。なお、ここでは有効エントリ数が最小であるエントリ追加対象候補をエントリ追加対象として選択しているが、その他のポリシーに従ってエントリ追加対象を選択しても良い。
Step E5:
The entry addition target determination block 3 notifies each rule comparison block 2 of whether or not an entry can be added. For example, the entry addition target determination block 3 instructs the entry addition target to add a new rule, and instructs the other rule comparison block 2 not to execute the rule addition process. Although the entry addition target candidate having the minimum number of valid entries is selected as the entry addition target here, the entry addition target may be selected according to other policies.

本ステップ以降は、第1、第2の構成例と同様の動作であるため、詳細な説明は省略する。   Since the operation after this step is the same as that of the first and second configuration examples, detailed description thereof is omitted.

なお、上記の動作からも分かるように、INSERT処理の場合には、第2の構成例のルール比較ブロック2は、ステップA14を実行するまで、パイプラインが停止した状態になり、ステップA14を実行後にパイプラインが再開する。第1の構成例のルール比較ブロック2は、ステップA14を実行するまでに、既にパイプライン段数としてH段を実行し終わっているため、INSERT処理時にのみ、各ルール比較ブロック2におけるパイプラインの処理タイミングが異なってしまう。しかしながら、第1の構成例のルール比較ブロック2にルールを追加する場合は、第2の構成例のルール比較ブロック2にはルールは決して追加されないため、第2の構成例のルール比較ブロック2のステップA14以降の動作は無視しても良い。一方、第2の構成例のルール比較ブロック2にルールを追加する場合は、第1の構成例のルール比較ブロック2におけるステップA14以降の動作は無視しても良い。どちらの動作を無視しても良いかは、結果出力ブロック5に各ルール比較ブロック2からの処理結果が入力された際に、判断することできる。   As can be seen from the above operation, in the case of the INSERT processing, the rule comparison block 2 of the second configuration example is in a state where the pipeline is stopped until Step A14 is executed, and Step A14 is executed. The pipeline will resume later. Since the rule comparison block 2 of the first configuration example has already executed the H stage as the number of pipeline stages before executing step A14, the pipeline processing in each rule comparison block 2 is performed only during the INSERT process. The timing will be different. However, when a rule is added to the rule comparison block 2 of the first configuration example, no rule is added to the rule comparison block 2 of the second configuration example. Operations after step A14 may be ignored. On the other hand, when adding a rule to the rule comparison block 2 of the second configuration example, the operations after step A14 in the rule comparison block 2 of the first configuration example may be ignored. Which operation can be ignored can be determined when the processing result from each rule comparison block 2 is input to the result output block 5.

また、本構成例におけるINSERT処理では、第1の構成例のルール比較ブロック2にルールを追加することを優先している。これは、第2の構成例のルール比較ブロックは単なるルールリストであるため、有効エントリ数がルールリストに満たない場合、必ずルールを追加することが可能となる。一方、第1の構成例のルール比較ブロック2は、決定木を用いているため、ルールの複製が生じる可能性がある。このため、可能な限り第1の構成例のルール比較ブロック2へのルール追加を優先することによって、効率的なルール管理を実現している。   Further, in the INSERT processing in this configuration example, priority is given to adding a rule to the rule comparison block 2 of the first configuration example. This is because the rule comparison block of the second configuration example is a simple rule list, and therefore, it is possible to always add a rule when the number of valid entries is less than the rule list. On the other hand, since the rule comparison block 2 of the first configuration example uses a decision tree, there is a possibility that duplication of rules will occur. Therefore, efficient rule management is realized by giving priority to adding rules to the rule comparison block 2 of the first configuration example as much as possible.

2.第2の実施の形態
図38は、本発明の第2の実施の形態に係るパケット分類器8の構成を示すブロック図である。図38を参照すると、第2の実施の形態におけるパケット分類器8は、第1の実施の形態におけるパケット分類器1におけるコマンド入力ブロック4をコマンド入力ブロック9に、入力データ6を入力データ10に置き換えたものである。その他の構成は、第1の実施の形態におけるパケット分類器1と同様であるため、詳細な説明は省略する。
2. Second Embodiment FIG. 38 is a block diagram showing a configuration of a packet classifier 8 according to a second embodiment of the present invention. Referring to FIG. 38, the packet classifier 8 in the second embodiment is configured such that the command input block 4 in the packet classifier 1 in the first embodiment is the command input block 9 and the input data 6 is the input data 10. It is a replacement. The other configuration is the same as that of the packet classifier 1 in the first embodiment, and thus detailed description thereof is omitted.

図39は、コマンド入力ブロック9の構成を示すブロック図である。図39を参照すると、コマンド入力ブロック9は、第1の実施の形態におけるコマンド入力ブロック4における出力先分析ブロック40を出力先分析ブロック44に、コマンド出力情報記憶ブロック41をコマンド出力情報記憶ブロック45に置き換えたものである。出力先分析ブロック44には、外部からパケット分類器8への入力データ10が入力される。本構成の場合、各ルール比較ブロック2においては、ワイルドカードを含むヘッダフィールドの種類によって、装置内コマンドの出力先を決定することになる。   FIG. 39 is a block diagram showing the configuration of the command input block 9. Referring to FIG. 39, in the command input block 9, the output destination analysis block 40 in the command input block 4 in the first embodiment is set as the output destination analysis block 44, and the command output information storage block 41 is set in the command output information storage block 45. It has been replaced with. Input data 10 to the packet classifier 8 is input to the output destination analysis block 44 from the outside. In the case of this configuration, in each rule comparison block 2, the output destination of the in-device command is determined according to the type of the header field including the wild card.

図40は、コマンド出力情報記憶ブロック45が記憶するコマンド出力情報を示す概念図である。本実施の形態によれば、「識別情報」は、フィールド分析データである。より詳細には、フィールド分析データは、ルールを構成するヘッダフィールド数と等しいビット幅で構成されており、各ビットが各フィールドと対応付けられている。フィールドにワイルドカードが含まれる場合、当該フィールドに対応づけられたビットは‘0’となる。一方、フィールドにワイルドカードが含まれない場合、当該フィールドに対応付けられたビットは‘1’となる。すなわち、本実施の形態では、「識別情報」は、複数のフィールドのそれぞれがワイルドカードを含んでいるか否かを示す情報である。出力先データは、第1の実施の形態の場合と同じである。   FIG. 40 is a conceptual diagram showing command output information stored in the command output information storage block 45. According to the present embodiment, “identification information” is field analysis data. More specifically, the field analysis data has a bit width equal to the number of header fields constituting the rule, and each bit is associated with each field. When a wild card is included in the field, the bit associated with the field is '0'. On the other hand, when the field does not include a wild card, the bit associated with the field is “1”. That is, in the present embodiment, “identification information” is information indicating whether or not each of the plurality of fields includes a wild card. The output destination data is the same as that in the first embodiment.

出力先分析ブロック44は、外部からパケット分類器1に入力された入力データ10を受け取る。出力先分析ブロック44は、LOOKUPの場合は検索キー、INSERTの場合は新規ルール、DELETEの場合は削除ルールから、上記の「識別情報」を抽出する。そして、出力先分析ブロック44は、抽出された識別情報とコマンド出力情報を参照することによって、選択ルール比較ブロック2を認識する。その他は、第1の実施の形態と同じである。   The output destination analysis block 44 receives the input data 10 input to the packet classifier 1 from the outside. The output destination analysis block 44 extracts the “identification information” from a search key in the case of LOOKUP, a new rule in the case of INSERT, and a deletion rule in the case of DELETE. Then, the output destination analysis block 44 recognizes the selection rule comparison block 2 by referring to the extracted identification information and command output information. Others are the same as those in the first embodiment.

ここで、新規ルールや削除ルールについては、第1の実施の形態と同様の表現形式で表現することによって、各フィールドにワイルドカードが含まれるか否かを判断することができる。一方、LOOKUP時の検索キーの場合は、到着パケットによっては、ルールで定義されたフィールドが存在しない場合が考えられる。これに対応するため、入力データ10としては、検索キーの各フィールドが定義されていない、すなわち、到着パケットには当該フィールド値が存在しないことを示すための1ビットの信号を用いる。これは、すなわち、コマンド出力情報におけるフィールド分析データと同様のものであり、外部の制御ブロック等で生成されるものとする。   Here, it is possible to determine whether each field includes a wild card by expressing the new rule and the deletion rule in the same expression format as in the first embodiment. On the other hand, in the case of a search key at the time of LOOKUP, there may be a case where the field defined by the rule does not exist depending on the arrival packet. To cope with this, as the input data 10, a 1-bit signal is used to indicate that each field of the search key is not defined, that is, that the field value does not exist in the arrival packet. That is, it is the same as the field analysis data in the command output information, and is generated by an external control block or the like.

あるいは、ルールの表現形式と同様、マスクビットを用いて検索キーを定義しても構わない。この場合、出力先分析ブロック44は、入力データ10として検索キーを受け取った場合、マスクビットを基にフィールド分析データと同様のものを生成する。   Alternatively, the search key may be defined using mask bits as in the rule expression format. In this case, when receiving the search key as the input data 10, the output destination analysis block 44 generates the same as the field analysis data based on the mask bits.

その他の構成は、第1の実施の形態におけるコマンド入力ブロック4と同様であるため、詳細な説明は省略する。   Since other configurations are the same as those of the command input block 4 in the first embodiment, detailed description thereof is omitted.

尚、第2の実施の形態には、第1の実施の形態におけるパケット分類器1のルール比較ブロック2の3種類の構成例が適用できる。   Note that three types of configuration examples of the rule comparison block 2 of the packet classifier 1 in the first embodiment can be applied to the second embodiment.

本実施の形態によれば、第1の実施の形態と同じ効果が得られる。   According to the present embodiment, the same effect as in the first embodiment can be obtained.

3.第3の実施の形態
図41は、本発明の第3の実施の形態に係るパケット分類器11の構成を示すブロック図である。図41を参照すると、第3の実施の形態におけるパケット分類器11は、第1の実施の形態におけるパケット分類器1におけるエントリ追加対象決定ブロック3をエントリ追加対象ブロック12、結果出力ブロック5を結果出力ブロック13に置き換え、さらにエントリ追加対象ブロック12から結果出力ブロック13へ出力信号を加えたものである。その他の構成は、第1の実施の形態におけるパケット分類器1と同様であるため、詳細な説明は省略する。
3. Third Embodiment FIG. 41 is a block diagram showing a configuration of a packet classifier 11 according to a third embodiment of the present invention. Referring to FIG. 41, the packet classifier 11 in the third embodiment includes the entry addition target determination block 3 in the packet classifier 1 in the first embodiment, the entry addition target block 12, and the result output block 5 in the result. The output block 13 is replaced, and an output signal is further added from the entry addition target block 12 to the result output block 13. The other configuration is the same as that of the packet classifier 1 in the first embodiment, and thus detailed description thereof is omitted.

尚、第3の実施の形態には、第1の実施の形態におけるパケット分類器1のルール比較ブロック2の3種類の構成例が適用できる。   Note that three types of configuration examples of the rule comparison block 2 of the packet classifier 1 in the first embodiment can be applied to the third embodiment.

次に、本実施の形態に係るパケット分類器11の動作を説明する。   Next, the operation of the packet classifier 11 according to this embodiment will be described.

本実施の形態におけるパケット分類器11の動作は、INSERT時の動作のみ第1の実施の形態と異なる。このため、以下ではINSERT時の動作において、第1の実施の形態と異なる点のみを説明し、その他については詳細な説明を省略する。なお、LOOKUP時の動作、及びDELETE時の動作については、第1の実施の形態における動作と同様であるため、こちらも詳細な説明は省略する。   The operation of the packet classifier 11 in the present embodiment is different from that of the first embodiment only in the operation at the time of INSERT. For this reason, only the difference from the first embodiment in the operation at the time of INSERT will be described below, and detailed description of the other will be omitted. Note that the operation at the time of LOOKUP and the operation at the time of DELETE are the same as the operations in the first embodiment, and thus detailed description thereof is also omitted here.

図42は、本実施の形態におけるINSERT時の処理を示すフローチャートである。図42を参照すると、本実施の形態におけるINSERT時の処理は、第1の実施の形態におけるINSERT時の処理(図22)におけるステップA5をステップA15に、ステップA8をステップA17に置き換え、ステップA15とステップA6の間にステップA16を加えた点が異なる。これ以外の動作については、全て第1の実施の形態におけるINSERT時の処理と同様であるため、以下では、ステップA15、ステップA16、ステップA17の動作について説明する。   FIG. 42 is a flowchart showing processing at the time of INSERT in the present embodiment. Referring to FIG. 42, the processing at the time of INSERT in the present embodiment is the same as the processing at the time of INSERT (FIG. 22) in the first embodiment (step A5), step A8 is replaced by step A17, and step A15 is performed. The difference is that step A16 is added between step A6 and step A6. Since all other operations are the same as the processing at the time of INSERT in the first embodiment, the operations of Step A15, Step A16, and Step A17 will be described below.

ステップA15:
エントリ追加対象決定ブロック12は、ルール処理ブロック2から通知される情報に基づいて、エントリ追加対象候補を認識し、エントリ追加対象候補の中からエントリ追加対象を選択する。図43は、ステップA15の処理を示すフローチャートである。
Step A15:
The entry addition target determination block 12 recognizes an entry addition target candidate based on the information notified from the rule processing block 2 and selects an entry addition target from the entry addition target candidates. FIG. 43 is a flowchart showing the process of step A15.

ステップE1、E2:
エントリ追加対象決定ブロック12は、エントリ追加対象候補から有効エントリ数を示す情報を受け取る(ステップE1)。次に、エントリ追加対象決定ブロック12は、各エントリ追加対象候補のうち、有効エントリ数がルールリストの最大数B(リストサイズ)を下回っているものがあるか否か確認する(ステップE2)。有効エントリ数がリストサイズを下回っているものが無い場合(ステップE2;No)、処理はステップE3に進む。一方、有効エントリ数がリストサイズを下回っているものが有る場合(ステップE2;Yes)、処理はステップE4に進む。
Steps E1, E2:
The entry addition target determination block 12 receives information indicating the number of valid entries from the entry addition target candidate (step E1). Next, the entry addition target determination block 12 confirms whether there is any entry addition target candidate whose number of valid entries is less than the maximum number B (list size) of the rule list (step E2). If there is no valid entry number less than the list size (step E2; No), the process proceeds to step E3. On the other hand, if there is one in which the number of valid entries is less than the list size (step E2; Yes), the process proceeds to step E4.

ステップE3、E10:
エントリ追加対象決定ブロック12は、エントリを追加できるルール比較ブロック2は存在しないと判断する(ステップE3)。この場合、エントリ追加対象決定ブロック12は、エントリ追加対象のルール比較ブロック2が存在しなかったことを意味する信号を、結果出力ブロック13に通知する(ステップE10)。そして、ステップA15の処理は終了する。
Steps E3 and E10:
The entry addition target determination block 12 determines that there is no rule comparison block 2 to which an entry can be added (step E3). In this case, the entry addition target determination block 12 notifies the result output block 13 of a signal that means that the rule comparison block 2 that is the target of entry addition does not exist (step E10). And the process of step A15 is complete | finished.

ステップE4、E11:
エントリ追加対象決定ブロック12は、有効エントリ数がリストサイズを下回っているものの中で、有効エントリ数が最小のものをエントリ追加対象ルール比較ブロックとして決定する(ステップE4)。その後、エントリ追加対象決定ブロック12は、エントリ追加対象ルール比較ブロックにのみ、エントリ追加許可を出力する(ステップE11)。この時、エントリ追加対象以外のルール比較ブロック2には、何ら信号は出力されない。そして、ステップA15の処理は終了する。
Steps E4 and E11:
The entry addition target determination block 12 determines the entry addition target rule comparison block having the minimum number of valid entries from among the number of valid entries less than the list size (step E4). Thereafter, the entry addition target determination block 12 outputs entry addition permission only to the entry addition target rule comparison block (step E11). At this time, no signal is output to the rule comparison block 2 other than the entry addition target. And the process of step A15 is complete | finished.

ステップA16:
ステップA15において、エントリ追加対象のルール比較ブロック2が存在したかによって以降の処理が異なる。エントリ追加対象のルール比較ブロック2が存在した場合(ステップA16;Yes)、エントリ追加許可を受け取ったエントリ追加対象のルール比較ブロック2は、第1の実施の形態におけるINSERT時の動作と同様に、ステップA6、ステップA7の処理を実行する。その後、処理はステップA17に進む。一方、エントリ追加対象のルール比較ブロック2が存在しなかった場合(ステップA16;No)、処理はそのままステップA17に進む。
Step A16:
In step A15, the subsequent processing differs depending on whether or not the rule comparison block 2 to which an entry is to be added exists. If there is a rule comparison block 2 to which an entry is to be added (step A16; Yes), the rule comparison block 2 to which an entry is to be added that has received entry addition permission is similar to the operation at the time of INSERT in the first embodiment. Steps A6 and A7 are executed. Thereafter, the processing proceeds to step A17. On the other hand, if there is no entry comparison target rule comparison block 2 (step A16; No), the process proceeds directly to step A17.

ステップA17:
結果出力ブロック13がエントリ追加対象のルール比較ブロック2からコマンドを受け取った場合、結果出力ブロック13は、受け取ったコマンド内の結果フラグを参照して、新規ルールが追加されたか、又は追加されなかったかを確認する。そして、結果出力ブロック13は、その結果を示す出力データ7を、INSERT処理の最終結果として出力する。
Step A17:
When the result output block 13 receives a command from the rule comparison block 2 to which an entry is added, the result output block 13 refers to the result flag in the received command, and whether a new rule has been added or has not been added. Confirm. Then, the result output block 13 outputs the output data 7 indicating the result as the final result of the INSERT process.

一方、結果出力ブロック13がエントリ追加対象決定ブロック12から、エントリ追加対象のルール比較ブロック2が存在しなかったことを意味する信号を受け取る場合もある(ステップE10)。この場合、結果出力ブロック13は、新規ルールの追加に失敗したことを示す出力データ7を、INSERT処理の最終結果として出力する。   On the other hand, the result output block 13 may receive a signal from the entry addition target determination block 12 indicating that there is no entry comparison target rule comparison block 2 (step E10). In this case, the result output block 13 outputs the output data 7 indicating that the addition of the new rule has failed as the final result of the INSERT process.

なお、第1の実施の形態におけるINSERT処理時の動作と同様、新規ルールを追加できた場合の最終結果として、ルールを追加した箇所を示すエントリIDを出力することが挙げられる。エントリIDやその他の情報を最終結果として出力する方法については、第1の実施の形態におけるINSERT処理時の動作と同様であるため、説明を省略する。   Similar to the operation at the time of the INSERT processing in the first embodiment, the final result when a new rule can be added is to output an entry ID indicating the location where the rule is added. The method of outputting the entry ID and other information as the final result is the same as the operation at the time of the INSERT processing in the first embodiment, and thus the description is omitted.

また、上記では有効エントリ数が最小であるエントリ追加対象候補をエントリ追加対象として選択しているが、その他のポリシーに従ってエントリ追加対象を選択しても良い。   In the above, the entry addition target candidate having the minimum number of valid entries is selected as the entry addition target. However, the entry addition target may be selected according to other policies.

上記では、第1の実施の形態における第1の構成例のINSERT処理に対する変更点を説明した。但し、第1の実施の形態における第2の構成例のINSERT処理に対しても、本実施の形態を適用可能である。具体的には、図34で示された第2の構成例のINSERT処理において、ステップA5をステップA15に、ステップA8をステップA17に置き換え、ステップA15とステップA6の間にステップA16を加える。   In the above, the change with respect to the INSERT processing of the 1st structural example in 1st Embodiment was demonstrated. However, this embodiment can also be applied to the INSERT processing of the second configuration example in the first embodiment. Specifically, in the INSERT processing of the second configuration example shown in FIG. 34, step A5 is replaced with step A15, step A8 is replaced with step A17, and step A16 is added between step A15 and step A6.

同様に、第1の実施の形態における第3の構成例のINSERT処理に対しても、本実施の形態を適用可能である。この場合は、ステップA14をステップA18に、ステップA8をステップA17に置き換え、ステップA18とステップA6の間にステップA16を加える。図44は、ステップA18の処理を示すフローチャートである。上記と同様に、エントリ追加対象のルール比較ブロック2が存在しなかった場合、ステップE3の後にステップE10が実行される。一方、エントリ追加対象のルール比較ブロック2として、第1あるいは第2の構成例のルール比較ブロック2が選択された場合、ステップE11が実行される。   Similarly, the present embodiment can be applied to the INSERT processing of the third configuration example in the first embodiment. In this case, step A14 is replaced with step A18, step A8 is replaced with step A17, and step A16 is added between step A18 and step A6. FIG. 44 is a flowchart showing the process of step A18. Similarly to the above, when there is no entry comparison target rule comparison block 2, step E10 is executed after step E3. On the other hand, when the rule comparison block 2 of the first or second configuration example is selected as the entry comparison target rule comparison block 2, step E11 is executed.

また、本実施の形態と第2の実施の形態の組み合わせも可能である。   A combination of the present embodiment and the second embodiment is also possible.

本実施の形態によれば、既出の実施の形態と同じ効果が得られる。更に、次のような効果も得られる。   According to the present embodiment, the same effect as the above-described embodiment can be obtained. Further, the following effects can be obtained.

第1、第2の実施の形態では、エントリ追加対象のルール比較ブロック2でないブロックに対しても、エントリ追加対象決定ブロック12からエントリ追加不可の返信がある。この場合、メモリアクセスは行われないが、コマンドだけは順次パイプラインを受け渡されていく。つまり、パイプラインレジスタが起動するため、この電力は消費される。しかし、本実施の形態では、エントリ追加対象のルール比較ブロック2以外のブロックに対しては、何らコマンドを返信しない。従って、エントリ追加対象以外のルール比較ブロック2のパイプラインレジスタは起動しない。よって、その分だけ消費電力を削減することが可能となる。   In the first and second embodiments, the entry addition target determination block 12 also sends a reply indicating that the entry cannot be added even for a block that is not the rule comparison block 2 to be added. In this case, memory access is not performed, but only commands are sequentially delivered to the pipeline. That is, since the pipeline register is activated, this power is consumed. However, in this embodiment, no command is returned to any block other than the rule comparison block 2 to be added. Accordingly, the pipeline registers of the rule comparison block 2 other than the entry addition target are not activated. Therefore, power consumption can be reduced by that amount.

4.第4の実施の形態
次に、本発明の第4の発明を実施するための最良の形態について図面を参照して詳細に説明する。
4). Fourth Embodiment Next, the best mode for carrying out the fourth invention of the present invention will be described in detail with reference to the drawings.

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

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

プログラム処理装置14として、複数のCPUコアを有するマルチコアプロセッサ(さらには、より多くのCPUコアを有するメニーコアプロセッサ)を用いてもよい。その場合、それぞれのCPUコアに、コマンド入力ブロック4、ルール比較ブロック2−1〜2−N、エントリ追加対象決定ブロック3、結果出力ブロック5、さらには、ルール比較ブロック2を構成する各決定木ノード処理ブロック200、エントリ数カウントブロック21、ルール処理ブロック220等の処理を実行させることにより、より高速な処理が可能となる。   As the program processing device 14, 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, rule comparison blocks 2-1 to 2 -N, an entry addition target determination block 3, a result output block 5, and further each decision tree constituting the rule comparison block 2. By executing processing such as the node processing block 200, the entry number counting block 21, and the rule processing block 220, higher-speed processing is possible.

本実施の形態によれば、既出の実施の形態と同じ効果が得られる。   According to the present embodiment, the same effect as the above-described embodiment can be obtained.

以上、本発明の実施の形態が添付の図面を参照することにより説明された。但し、本発明は、上述の実施の形態に限定されず、要旨を逸脱しない範囲で当業者により適宜変更され得る。   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以上のルールを管理し、前記入力コマンドに応じた処理を実行するように構成された複数のルール比較ブロックと
を備え、
前記複数のルール比較ブロックは、管理下のルールにおける前記1以上のフィールドの組み合わせの種類に着目して、複数のグループにグループ分けされ、
前記複数のグループのうち、前記検索キーにマッチするルール、前記新規ルール、あるいは前記既存ルールを管理する可能性があるグループは、選択グループであり、
前記選択グループに属するルール比較ブロックは、選択ルール比較ブロックであり、
前記コマンド入力ブロックは、前記検索キー、前記新規ルール、あるいは前記既存ルールを参照することによって、前記選択ルール比較ブロックにだけ前記入力コマンドを入力する
パケット分類器。
(Appendix 1)
A packet classifier for managing rules used for packet classification,
Each rule is defined by a combination of one or more fields included in the packet header,
The packet classifier
A command input block that creates a search command that instructs to search for a rule that matches the search key, an insert command that instructs to add a new rule, or a delete command that instructs to delete an existing rule as an input command;
A plurality of rule comparison blocks each configured to manage one or more rules and execute processing according to the input command;
The plurality of rule comparison blocks are grouped into a plurality of groups, focusing on a combination type of the one or more fields in a managed rule.
Among the plurality of groups, a rule that matches the search key, the new rule, or a group that may manage the existing rule is a selection group,
The rule comparison block belonging to the selection group is a selection rule comparison block,
The command input block inputs the input command only to the selection rule comparison block by referring to the search key, the new rule, or the existing rule.

(付記2)
付記1に記載のパケット分類器であって、
前記選択グループは、前記検索キー及びルールから抽出される識別情報に基づいて識別可能であり、
前記コマンド入力ブロックは、前記識別情報と前記選択ルール比較ブロックとの対応関係を示すコマンド出力情報を保持し、
前記コマンド入力ブロックは、前記検索キー、前記新規ルール、あるいは前記既存ルールから前記識別情報を抽出し、前記抽出された識別情報と前記コマンド出力情報を参照することによって、前記選択ルール比較ブロックを識別する
パケット分類器。
(Appendix 2)
The packet classifier according to appendix 1,
The selected group is identifiable based on identification information extracted from the search key and rule,
The command input block holds command output information indicating a correspondence relationship between the identification information and the selection rule comparison block,
The command input block identifies the selection rule comparison block by extracting the identification information from the search key, the new rule, or the existing rule, and referring to the extracted identification information and the command output information. Yes Packet classifier.

(付記3)
付記2に記載のパケット分類器であって、
前記識別情報は、前記検索キー及びルールに含まれる所定のフィールドの値である
パケット分類器。
(Appendix 3)
The packet classifier according to attachment 2, wherein
The identification information is a value of a predetermined field included in the search key and rule.

(付記4)
付記2に記載のパケット分類器であって、
前記検索キー及びルールは、複数のフィールドを含み、
前記識別情報は、前記複数のフィールドのそれぞれがワイルドカードを含んでいるか否かを示す情報である
パケット分類器。
(Appendix 4)
The packet classifier according to attachment 2, wherein
The search key and rule include a plurality of fields,
The identification information is information indicating whether or not each of the plurality of fields includes a wild card.

(付記5)
付記1乃至4のいずれか一項に記載のパケット分類器であって、
前記複数のルール比較ブロックに接続されたエントリ追加対象決定ブロックを更に備え、
単一のルールは、複製が発生しないように、前記複数のルール比較ブロックのうちいずれか1つによって管理され、
前記入力コマンドが前記挿入コマンドである場合、前記選択ルール比較ブロックの各々は、前記新規ルールが自身によって管理され得るかどうかを判定し、
前記新規ルールが自身によって管理され得る場合、当該選択ルール比較ブロックはエントリ追加対象候補であり、
前記エントリ追加対象決定ブロックは、前記新規ルールを追加する対象であるエントリ追加対象を、前記エントリ追加対象候補の中から選択し、
前記選択されたエントリ追加対象は、前記新規ルールを、自身が管理するルールリストに追加する
パケット分類器。
(Appendix 5)
The packet classifier according to any one of appendices 1 to 4,
An entry addition target determination block connected to the plurality of rule comparison blocks;
A single rule is managed by any one of the plurality of rule comparison blocks so that duplication does not occur,
If the input command is the insert command, each of the selection rule comparison blocks determines whether the new rule can be managed by itself;
When the new rule can be managed by itself, the selected rule comparison block is an entry addition target candidate,
The entry addition target determination block selects an entry addition target to which the new rule is to be added from the entry addition target candidates,
The selected entry addition target is a packet classifier that adds the new rule to a rule list managed by itself.

(付記6)
付記5に記載のパケット分類器であって、
前記複数のルール比較ブロックは、パケット分類に用いられる複数の決定木のそれぞれを構成し、
単一のルールは、前記複数の決定木のうちいずれか1つの決定木における単一の葉ノードによって管理され、
前記入力コマンドが前記挿入コマンドである場合、前記選択ルール比較ブロックの各々は、前記新規ルールが自身の決定木における単一の葉ノードによって管理され得るかどうかを判定し、
前記新規ルールが単一の葉ノードによって管理され得る場合、当該選択ルール比較ブロックは前記エントリ追加対象候補であり、当該単一の葉ノードは追加対象葉ノードであり、
前記エントリ追加対象は、前記新規ルールを、自身の決定木における前記追加対象葉ノードが管理するルールリストに追加する
パケット分類器。
(Appendix 6)
The packet classifier according to appendix 5, wherein
The plurality of rule comparison blocks constitute each of a plurality of decision trees used for packet classification,
A single rule is managed by a single leaf node in any one of the plurality of decision trees,
If the input command is the insert command, each of the selection rule comparison blocks determines whether the new rule can be managed by a single leaf node in its decision tree;
When the new rule can be managed by a single leaf node, the selection rule comparison block is the entry addition target candidate, the single leaf node is an addition target leaf node,
The entry addition target is a packet classifier that adds the new rule to a rule list managed by the addition target leaf node in its own decision tree.

(付記7)
付記6に記載のパケット分類器であって、
前記エントリ追加対象候補は、前記追加対象葉ノードが管理している有効なルールのエントリ数を、前記エントリ追加対象決定ブロックに通知し、
前記エントリ追加対象決定ブロックは、前記エントリ数に基づいて、前記エントリ追加対象を選択する
パケット分類器。
(Appendix 7)
The packet classifier according to appendix 6, 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.

(付記8)
付記5に記載のパケット分類器であって、
前記複数のルール比較ブロックの各々は、リスト形式でルールを管理する
パケット分類器。
(Appendix 8)
The packet classifier according to appendix 5, wherein
Each of the plurality of rule comparison blocks is a packet classifier that manages rules in a list format.

(付記9)
パケット分類に用いられるルールを管理するパケット分類器によるパケット分類方法であって、
各ルールは、パケットヘッダに含まれる1以上のフィールドの組み合わせにより定義され、
前記パケット分類方法は、
(A)前記パケット分類器が、複数のルール比較ブロックを提供するステップと、
ここで、
前記複数のルール比較ブロックの各々は、1以上のルールを管理し、入力コマンドに応じた処理を実行するように構成され、
前記入力コマンドは、検索キーにマッチするルールの検索を指示する検索コマンド、新規ルールの追加を指示する挿入コマンド、あるいは既存ルールの削除を指示する削除コマンドであり、
前記複数のルール比較ブロックは、管理下のルールにおける前記1以上のフィールドの組み合わせの種類に着目して、複数のグループにグループ分けされ、
前記複数のグループのうち、前記検索キーにマッチするルール、前記新規ルール、あるいは前記既存ルールを管理する可能性があるグループは、選択グループであり、
前記選択グループに属するルール比較ブロックは、選択ルール比較ブロックであり、
(B)前記検索キー、前記新規ルール、あるいは前記既存ルールを参照することによって、前記選択ルール比較ブロックにだけ前記入力コマンドを出力するステップと、
(C)前記選択ルール比較ブロックにおいて、前記入力コマンドに応じた処理を実行するステップと
を含む
パケット分類方法。
(Appendix 9)
A packet classification method by a packet classifier that manages rules used for packet classification,
Each rule is defined by a combination of one or more fields included in the packet header,
The packet classification method includes:
(A) the packet classifier providing a plurality of rule comparison blocks;
here,
Each of the plurality of rule comparison blocks is configured to manage one or more rules and execute a process according to an input command,
The input command is a search command that instructs to search for a rule that matches the search key, an insert command that instructs to add a new rule, or a delete command that instructs to delete an existing rule,
The plurality of rule comparison blocks are grouped into a plurality of groups, focusing on a combination type of the one or more fields in a managed rule.
Among the plurality of groups, a rule that matches the search key, the new rule, or a group that may manage the existing rule is a selection group,
The rule comparison block belonging to the selection group is a selection rule comparison block,
(B) outputting the input command only to the selected rule comparison block by referring to the search key, the new rule, or the existing rule;
(C) In the selection rule comparison block, a step of executing processing according to the input command.

(付記10)
コンピュータによって実行され、前記コンピュータを、パケット分類に用いられるルールを管理するパケット分類器として機能させるパケット分類プログラムであって、
各ルールは、パケットヘッダに含まれる1以上のフィールドの組み合わせにより定義され、
前記パケット分類器は、
検索キーにマッチするルールの検索を指示する検索コマンド、新規ルールの追加を指示する挿入コマンド、あるいは既存ルールの削除を指示する削除コマンドを入力コマンドとして作成するコマンド入力ブロックと、
各々が1以上のルールを管理し、前記入力コマンドに応じた処理を実行するように構成された複数のルール比較ブロックと
を備え、
前記複数のルール比較ブロックは、管理下のルールにおける前記1以上のフィールドの組み合わせの種類に着目して、複数のグループにグループ分けされ、
前記複数のグループのうち、前記検索キーにマッチするルール、前記新規ルール、あるいは前記既存ルールを管理する可能性があるグループは、選択グループであり、
前記選択グループに属するルール比較ブロックは、選択ルール比較ブロックであり、
前記コマンド入力ブロックは、前記検索キー、前記新規ルール、あるいは前記既存ルールを参照することによって、前記選択ルール比較ブロックにだけ前記入力コマンドを入力する
パケット分類プログラム。
(Appendix 10)
A packet classification program that is executed by a computer and causes the computer to function as a packet classifier that manages rules used for packet classification,
Each rule is defined by a combination of one or more fields included in the packet header,
The packet classifier
A command input block that creates a search command that instructs to search for a rule that matches the search key, an insert command that instructs to add a new rule, or a delete command that instructs to delete an existing rule as an input command;
A plurality of rule comparison blocks each configured to manage one or more rules and execute processing according to the input command;
The plurality of rule comparison blocks are grouped into a plurality of groups, focusing on a combination type of the one or more fields in a managed rule.
Among the plurality of groups, a rule that matches the search key, the new rule, or a group that may manage the existing rule is a selection group,
The rule comparison block belonging to the selection group is a selection rule comparison block,
A packet classification program in which the command input block inputs the input command only to the selection rule comparison block by referring to the search key, the new rule, or the existing rule.

1 パケット分類器
2 ルール比較ブロック
3 エントリ追加対象決定ブロック
4 コマンド入力ブロック
5 結果出力ブロック
8 パケット分類器
9 コマンド入力ブロック
11 パケット分類器
12 エントリ追加対象決定ブロック
13 結果出力ブロック
14 プログラム処理装置
15 パケット分類プログラム
20 決定木パイプラインブロック
21 エントリ数カウントブロック
22 ルールパイプラインブロック
40 出力先分析ブロック
41 コマンド出力情報記憶ブロック
42 コマンド出力ブロック
44 出力先分析ブロック
45 コマンド出力情報記憶ブロック
200 決定木ノード処理ブロック
210 カウント処理ブロック
211 エントリ数記憶ブロック
220 ルール処理ブロック
2000 子ノード決定ブロック
2001 ノード情報記憶ブロック
2200 比較更新処理ブロック
2201 エントリ記憶ブロック
DESCRIPTION OF SYMBOLS 1 Packet classifier 2 Rule comparison block 3 Entry addition object decision block 4 Command input block 5 Result output block 8 Packet classifier 9 Command input block 11 Packet classifier 12 Entry addition object decision block 13 Result output block 14 Program processor 15 Packet Classification program 20 Decision tree pipeline block 21 Entry count block 22 Rule pipeline block 40 Output destination analysis block 41 Command output information storage block 42 Command output block 44 Output destination analysis block 45 Command output information storage 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以上のルールを管理し、前記入力コマンドに応じた処理を実行するように構成された複数のルール比較ブロックと
を備え、
前記複数のルール比較ブロックは、管理下のルールにおける前記1以上のフィールドの組み合わせの種類に着目して、複数のグループにグループ分けされ、
前記複数のグループのうち、前記検索キーにマッチするルール、前記新規ルール、あるいは前記既存ルールを管理する可能性があるグループは、選択グループであり、
前記選択グループに属するルール比較ブロックは、選択ルール比較ブロックであり、
前記コマンド入力ブロックは、前記検索キー、前記新規ルール、あるいは前記既存ルールを参照することによって、前記選択ルール比較ブロックにだけ前記入力コマンドを入力する
パケット分類器。
A packet classifier for managing rules used for packet classification,
Each rule is defined by a combination of one or more fields included in the packet header,
The packet classifier
A command input block that creates a search command that instructs to search for a rule that matches the search key, an insert command that instructs to add a new rule, or a delete command that instructs to delete an existing rule as an input command;
A plurality of rule comparison blocks each configured to manage one or more rules and execute processing according to the input command;
The plurality of rule comparison blocks are grouped into a plurality of groups, focusing on a combination type of the one or more fields in a managed rule.
Among the plurality of groups, a rule that matches the search key, the new rule, or a group that may manage the existing rule is a selection group,
The rule comparison block belonging to the selection group is a selection rule comparison block,
The command input block inputs the input command only to the selection rule comparison block by referring to the search key, the new rule, or the existing rule.
請求項1に記載のパケット分類器であって、
前記選択グループは、前記検索キー及びルールから抽出される識別情報に基づいて識別可能であり、
前記コマンド入力ブロックは、前記識別情報と前記選択ルール比較ブロックとの対応関係を示すコマンド出力情報を保持し、
前記コマンド入力ブロックは、前記検索キー、前記新規ルール、あるいは前記既存ルールから前記識別情報を抽出し、前記抽出された識別情報と前記コマンド出力情報を参照することによって、前記選択ルール比較ブロックを識別する
パケット分類器。
The packet classifier according to claim 1, wherein
The selected group is identifiable based on identification information extracted from the search key and rule,
The command input block holds command output information indicating a correspondence relationship between the identification information and the selection rule comparison block,
The command input block identifies the selection rule comparison block by extracting the identification information from the search key, the new rule, or the existing rule, and referring to the extracted identification information and the command output information. Yes Packet classifier.
請求項2に記載のパケット分類器であって、
前記識別情報は、前記検索キー及びルールに含まれる所定のフィールドの値である
パケット分類器。
The packet classifier according to claim 2, wherein
The identification information is a value of a predetermined field included in the search key and rule.
請求項2に記載のパケット分類器であって、
前記検索キー及びルールは、複数のフィールドを含み、
前記識別情報は、前記複数のフィールドのそれぞれがワイルドカードを含んでいるか否かを示す情報である
パケット分類器。
The packet classifier according to claim 2, wherein
The search key and rule include a plurality of fields,
The identification information is information indicating whether or not each of the plurality of fields includes a wild card.
請求項1乃至4のいずれか一項に記載のパケット分類器であって、
前記複数のルール比較ブロックに接続されたエントリ追加対象決定ブロックを更に備え、
単一のルールは、複製が発生しないように、前記複数のルール比較ブロックのうちいずれか1つによって管理され、
前記入力コマンドが前記挿入コマンドである場合、前記選択ルール比較ブロックの各々は、前記新規ルールが自身によって管理され得るかどうかを判定し、
前記新規ルールが自身によって管理され得る場合、当該選択ルール比較ブロックはエントリ追加対象候補であり、
前記エントリ追加対象決定ブロックは、前記新規ルールを追加する対象であるエントリ追加対象を、前記エントリ追加対象候補の中から選択し、
前記選択されたエントリ追加対象は、前記新規ルールを、自身が管理するルールリストに追加する
パケット分類器。
The packet classifier according to any one of claims 1 to 4,
An entry addition target determination block connected to the plurality of rule comparison blocks;
A single rule is managed by any one of the plurality of rule comparison blocks so that duplication does not occur,
If the input command is the insert command, each of the selection rule comparison blocks determines whether the new rule can be managed by itself;
When the new rule can be managed by itself, the selected rule comparison block is an entry addition target candidate,
The entry addition target determination block selects an entry addition target to which the new rule is to be added from the entry addition target candidates,
The selected entry addition target is a packet classifier that adds the new rule to a rule list managed by itself.
請求項5に記載のパケット分類器であって、
前記複数のルール比較ブロックは、パケット分類に用いられる複数の決定木のそれぞれを構成し、
単一のルールは、前記複数の決定木のうちいずれか1つの決定木における単一の葉ノードによって管理され、
前記入力コマンドが前記挿入コマンドである場合、前記選択ルール比較ブロックの各々は、前記新規ルールが自身の決定木における単一の葉ノードによって管理され得るかどうかを判定し、
前記新規ルールが単一の葉ノードによって管理され得る場合、当該選択ルール比較ブロックは前記エントリ追加対象候補であり、当該単一の葉ノードは追加対象葉ノードであり、
前記エントリ追加対象は、前記新規ルールを、自身の決定木における前記追加対象葉ノードが管理するルールリストに追加する
パケット分類器。
The packet classifier according to claim 5, wherein
The plurality of rule comparison blocks constitute each of a plurality of decision trees used for packet classification,
A single rule is managed by a single leaf node in any one of the plurality of decision trees,
If the input command is the insert command, each of the selection rule comparison blocks determines whether the new rule can be managed by a single leaf node in its decision tree;
When the new rule can be managed by a single leaf node, the selection rule comparison block is the entry addition target candidate, the single leaf node is an addition target leaf node,
The entry addition target is a packet classifier that adds the new rule to a rule list managed by the addition target leaf node in its own decision tree.
請求項6に記載のパケット分類器であって、
前記エントリ追加対象候補は、前記追加対象葉ノードが管理している有効なルールのエントリ数を、前記エントリ追加対象決定ブロックに通知し、
前記エントリ追加対象決定ブロックは、前記エントリ数に基づいて、前記エントリ追加対象を選択する
パケット分類器。
The packet classifier according to claim 6, comprising:
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.
請求項5に記載のパケット分類器であって、
前記複数のルール比較ブロックの各々は、リスト形式でルールを管理する
パケット分類器。
The packet classifier according to claim 5, wherein
Each of the plurality of rule comparison blocks is a packet classifier that manages rules in a list format.
パケット分類に用いられるルールを管理するパケット分類器によるパケット分類方法であって、
各ルールは、パケットヘッダに含まれる1以上のフィールドの組み合わせにより定義され、
前記パケット分類方法は、
(A)前記パケット分類器が、複数のルール比較ブロックを提供するステップと、
ここで、
前記複数のルール比較ブロックの各々は、1以上のルールを管理し、入力コマンドに応じた処理を実行するように構成され、
前記入力コマンドは、検索キーにマッチするルールの検索を指示する検索コマンド、新規ルールの追加を指示する挿入コマンド、あるいは既存ルールの削除を指示する削除コマンドであり、
前記複数のルール比較ブロックは、管理下のルールにおける前記1以上のフィールドの組み合わせの種類に着目して、複数のグループにグループ分けされ、
前記複数のグループのうち、前記検索キーにマッチするルール、前記新規ルール、あるいは前記既存ルールを管理する可能性があるグループは、選択グループであり、
前記選択グループに属するルール比較ブロックは、選択ルール比較ブロックであり、
(B)前記検索キー、前記新規ルール、あるいは前記既存ルールを参照することによって、前記選択ルール比較ブロックにだけ前記入力コマンドを出力するステップと、
(C)前記選択ルール比較ブロックにおいて、前記入力コマンドに応じた処理を実行するステップと
を含む
パケット分類方法。
A packet classification method by a packet classifier that manages rules used for packet classification,
Each rule is defined by a combination of one or more fields included in the packet header,
The packet classification method includes:
(A) the packet classifier providing a plurality of rule comparison blocks;
here,
Each of the plurality of rule comparison blocks is configured to manage one or more rules and execute a process according to an input command,
The input command is a search command that instructs to search for a rule that matches the search key, an insert command that instructs to add a new rule, or a delete command that instructs to delete an existing rule,
The plurality of rule comparison blocks are grouped into a plurality of groups, focusing on a combination type of the one or more fields in a managed rule.
Among the plurality of groups, a rule that matches the search key, the new rule, or a group that may manage the existing rule is a selection group,
The rule comparison block belonging to the selection group is a selection rule comparison block,
(B) outputting the input command only to the selected rule comparison block by referring to the search key, the new rule, or the existing rule;
(C) In the selection rule comparison block, a step of executing processing according to the input command.
コンピュータによって実行され、前記コンピュータを、パケット分類に用いられるルールを管理するパケット分類器として機能させるパケット分類プログラムであって、
各ルールは、パケットヘッダに含まれる1以上のフィールドの組み合わせにより定義され、
前記パケット分類器は、
検索キーにマッチするルールの検索を指示する検索コマンド、新規ルールの追加を指示する挿入コマンド、あるいは既存ルールの削除を指示する削除コマンドを入力コマンドとして作成するコマンド入力ブロックと、
各々が1以上のルールを管理し、前記入力コマンドに応じた処理を実行するように構成された複数のルール比較ブロックと
を備え、
前記複数のルール比較ブロックは、管理下のルールにおける前記1以上のフィールドの組み合わせの種類に着目して、複数のグループにグループ分けされ、
前記複数のグループのうち、前記検索キーにマッチするルール、前記新規ルール、あるいは前記既存ルールを管理する可能性があるグループは、選択グループであり、
前記選択グループに属するルール比較ブロックは、選択ルール比較ブロックであり、
前記コマンド入力ブロックは、前記検索キー、前記新規ルール、あるいは前記既存ルールを参照することによって、前記選択ルール比較ブロックにだけ前記入力コマンドを入力する
パケット分類プログラム。
A packet classification program that is executed by a computer and causes the computer to function as a packet classifier that manages rules used for packet classification,
Each rule is defined by a combination of one or more fields included in the packet header,
The packet classifier
A command input block that creates a search command that instructs to search for a rule that matches the search key, an insert command that instructs to add a new rule, or a delete command that instructs to delete an existing rule as an input command;
A plurality of rule comparison blocks each configured to manage one or more rules and execute processing according to the input command;
The plurality of rule comparison blocks are grouped into a plurality of groups, focusing on a combination type of the one or more fields in a managed rule.
Among the plurality of groups, a rule that matches the search key, the new rule, or a group that may manage the existing rule is a selection group,
The rule comparison block belonging to the selection group is a selection rule comparison block,
A packet classification program in which the command input block inputs the input command only to the selection rule comparison block by referring to the search key, the new rule, or the existing rule.
JP2011106914A 2011-05-12 2011-05-12 Packet classifier, packet classification method, and packet classification program Expired - Fee Related JP5682442B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011106914A JP5682442B2 (en) 2011-05-12 2011-05-12 Packet classifier, packet classification method, and packet classification program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011106914A JP5682442B2 (en) 2011-05-12 2011-05-12 Packet classifier, packet classification method, and packet classification program

Publications (2)

Publication Number Publication Date
JP2012239048A JP2012239048A (en) 2012-12-06
JP5682442B2 true JP5682442B2 (en) 2015-03-11

Family

ID=47461556

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011106914A Expired - Fee Related JP5682442B2 (en) 2011-05-12 2011-05-12 Packet classifier, packet classification method, and packet classification program

Country Status (1)

Country Link
JP (1) JP5682442B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6143367B2 (en) * 2014-06-27 2017-06-07 日本電信電話株式会社 Packet transfer path setting circuit, packet transfer switch, packet transfer path setting method and packet transfer method
JP6438375B2 (en) * 2015-11-02 2018-12-12 日本電信電話株式会社 Communication system, communication apparatus, control apparatus, traffic observation method, and program
US11636220B2 (en) * 2019-02-01 2023-04-25 Intertrust Technologies Corporation Data management systems and methods

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3228249B2 (en) * 1998-12-04 2001-11-12 日本電気株式会社 Router device
JP2005051648A (en) * 2003-07-31 2005-02-24 Nippon Telegr & Teleph Corp <Ntt> Table searching apparatus for vpn
JP2009239401A (en) * 2008-03-26 2009-10-15 Alaxala Networks Corp Packet transfer apparatus
SE532426C2 (en) * 2008-05-26 2010-01-19 Oricane Ab Method for data packet classification in a data communication network
JP5807676B2 (en) * 2010-12-15 2015-11-10 日本電気株式会社 Packet classifier, packet classification method, and packet classification program

Also Published As

Publication number Publication date
JP2012239048A (en) 2012-12-06

Similar Documents

Publication Publication Date Title
JP5807676B2 (en) Packet classifier, packet classification method, and packet classification program
US7089240B2 (en) Longest prefix match lookup using hash function
JP6383578B2 (en) Apparatus and method for uniquely enumerating paths in a parse tree
KR100477391B1 (en) Full match(fm) search algorithm implementation for a network processor
Becchi et al. An improved algorithm to accelerate regular expression evaluation
US7782868B2 (en) Two-stage computer network packet classification method and system
KR100429142B1 (en) Software management tree implementation for a network processor
US10230639B1 (en) Enhanced prefix matching
CN102945249B (en) A kind of policing rule matching inquiry tree generation method, matching process and device
US20080192754A1 (en) Routing system and method for managing rule entries of ternary content addressable memory in the same
US20100076919A1 (en) Method and apparatus for pattern matching
Luo et al. Practical flow table aggregation in SDN
US11652744B1 (en) Multi-stage prefix matching enhancements
CN106487769B (en) Method and device for realizing Access Control List (ACL)
CN108134739A (en) A kind of method for searching route and device based on index trie
CN107276916B (en) Switch flow table management method based on protocol-aware forwarding technology
JP5682442B2 (en) Packet classifier, packet classification method, and packet classification program
JP5673667B2 (en) Packet classifier, packet classification method, packet classification program
Chuprikov et al. General ternary bit strings on commodity longest-prefix-match infrastructures
Norige et al. A ternary unification framework for optimizing TCAM-based packet classification systems
CN115834340A (en) Rule storage method and device, electronic equipment and storage medium
JPWO2002082750A1 (en) Apparatus and method for searching bit string
CN110868388B (en) System and method for operating networked devices
CN101989946A (en) Compression method of communication equipment route forwarding table
Markoborodov et al. An approach to the translation of software-defined network switch flow table into network processing unit assembly language

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140411

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20141208

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: 20141216

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20141229

R150 Certificate of patent or registration of utility model

Ref document number: 5682442

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees