JP3443356B2 - Packet classifier - Google Patents

Packet classifier

Info

Publication number
JP3443356B2
JP3443356B2 JP07132599A JP7132599A JP3443356B2 JP 3443356 B2 JP3443356 B2 JP 3443356B2 JP 07132599 A JP07132599 A JP 07132599A JP 7132599 A JP7132599 A JP 7132599A JP 3443356 B2 JP3443356 B2 JP 3443356B2
Authority
JP
Japan
Prior art keywords
function
key
value
packet
expansion table
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
JP07132599A
Other languages
Japanese (ja)
Other versions
JP2000270021A (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.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP07132599A priority Critical patent/JP3443356B2/en
Publication of JP2000270021A publication Critical patent/JP2000270021A/en
Application granted granted Critical
Publication of JP3443356B2 publication Critical patent/JP3443356B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は、受信パケットの一
部であるキーフィールドを調べてその内容に従って対応
するデータを選択するシステムのためのパケット分類装
置に関するものであり、更に詳しくは、キーフィールド
が満たすべき条件を定めたルールの集合であるルールセ
ットからパケットが全ての条件を満たすルールを見つけ
出すためのパケット分類装置に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a packet classification device for a system that examines a key field which is a part of a received packet and selects corresponding data according to the content of the key field. The present invention relates to a packet classifying device for finding a rule that a packet satisfies all conditions from a rule set, which is a set of rules defining conditions to be satisfied.

【0002】[0002]

【従来の技術】パケット分類装置には、一般的に大別す
ると、探索すべきデータを作成するためのコンパイル処
理機能及び探索処理機能が具えられている。従来のパケ
ット分類装置としてアクセス制御リストを用いるパケッ
トフィルタリングのためのパケット分類装置を例とし
て、これらの処理機能を説明する。
2. Description of the Related Art Generally speaking, a packet classification device is provided with a compile processing function and a search processing function for creating data to be searched. These processing functions will be described by using a packet classification device for packet filtering that uses an access control list as a conventional packet classification device.

【0003】先ず、コンパイル処理機能では、アクセス
制御リスト(ACL)を内部表現に変換して図10のよう
なデータ即ちACL内部表現を作成する。ここでACL
は、各キーの値が満たすべき条件、及び、それらを満た
すパケットを通過させるか棄却するかを指定するアクシ
ョンの組を定めるルールの系列である。ACL内部表現
の各行がACLの1つのルールに対応する。送信先アド
レス、送信元アドレス、送信先ポート番号、送信元ポー
ト番号、プロトコルフィールド、TCPフラグ等のフィ
ールドをキーとして用いる。
First, in the compile processing function, the access control list (ACL) is converted into an internal representation to create data as shown in FIG. 10, that is, an ACL internal representation. ACL here
Is a series of rules that define a condition that each key value must satisfy, and a set of actions that specify whether to pass or reject a packet that satisfies them. Each line of the ACL internal representation corresponds to one rule of ACL. Fields such as destination address, source address, destination port number, source port number, protocol field, and TCP flag are used as keys.

【0004】ルールでは、完全一致照合、プレフィクス
照合及び領域照合のような照合方法を用いて各キーに対
する条件を指定する。完全一致照合では、条件がキーの
値uで表され、受信パケットのキーの値がuの場合に照
合に成功する。プレフィクス照合では、条件がキーのプ
レフィクス値vとプレフィクス長plの対v/plで表され、
受信パケットのキーの値の上記plビットがvの場合に照
合に成功する。例えば送信先アドレスに対するプレフィ
クス照合では、条件123.45.67/24は、送信先アドレスの
上位24ビットが123.45.67 であるパケットと照合に成功
する。また、ACLにおいて複数のルールが照合に成功
した場合に、プレフィクス長が最長のルールを選択して
照合結果とする方法を最長プレフィクス照合という。ま
た、領域照合では、条件がキーの値の対の集合
{〔w11,w12〕,〔w21,w22〕,...,〔wn1
n2〕}で表され、キーの値kがwi1≧k≧wi2なるi
が存在する場合に照合に成功する。例えば送信先ポート
番号の領域照合では、フィルタの述語{〔10,30〕,
〔50,60〕}は、受信パケットの送信先ポート番号pが
10≧p≧30又は50≧p≧60の場合に照合に成功する。
The rules specify conditions for each key using matching methods such as exact match matching, prefix matching and area matching. In the perfect match, the condition is represented by the key value u, and the match is successful when the key value of the received packet is u. In prefix matching, the condition is expressed as a pair of key prefix value v and prefix length pl, v / pl,
If the pl bit of the key value of the received packet is v, the matching is successful. For example, in prefix matching against a destination address, the condition 123.45.67 / 24 succeeds in matching with a packet in which the higher 24 bits of the destination address is 123.45.67. In addition, a method of selecting a rule having the longest prefix length as a matching result when a plurality of rules succeed in matching in ACL is called longest prefix matching. Further, in the area matching, the condition is a set of key value pairs {[w 11 , w 12 ], [w 21 , w 22 ], ..., [w n1 ,
w n2 ]}, and the key value k is i such that w i1 ≧ k ≧ w i2
Matches successfully if exists. For example, in the area matching of the destination port number, the filter predicate {[10,30],
[50, 60]} indicates that the destination port number p of the received packet is
If 10 ≧ p ≧ 30 or 50 ≧ p ≧ 60, the collation is successful.

【0005】一般的に、採用する照合方法をルールのキ
ー毎に予め定めておく。図10において、dは送信先アド
レス、sは送信元アドレス、d-p は送信先ポート番号、
s-pは送信元ポート番号、pはプロトコルフィールド、T
CP はTCPフラグであり、アクションについては、1
は通過を、0は棄却を、それぞれ指示するアクションを
表す。図の左側の1〜mはルールの番号を表し、図の右
側の矢印は探索の順番を表す。ルール1では、送信先ア
ドレスが1.2.3.4 、送信元アドレスが1.2.5.8、送信先
ポート番号が10以上40以下、送信元ポート番号が80、プ
ロトコルフィールドが10、TCPフラグが1の時に、パ
ケットの通過を許可することを示す。
Generally, the matching method to be adopted is predetermined for each rule key. In FIG. 10, d is the destination address, s is the source address, dp is the destination port number,
sp is the source port number, p is the protocol field, T
CP is a TCP flag, 1 for action
Indicates passing and 0 indicates rejection. The numbers 1 to m on the left side of the figure represent rule numbers, and the arrows on the right side of the figure represent the order of search. In rule 1, when the destination address is 1.2.3.4, the source address is 1.2.5.8, the destination port number is 10 to 40, the source port number is 80, the protocol field is 10, and the TCP flag is 1, the packet Indicates that the passage of the vehicle is permitted.

【0006】次に、探索処理では、図10の矢印で示すよ
うに、受信パケットが与えられるとACL内部表現の上
から順番にルールを調べ、各キーに応じた照合方法によ
りパケットのキーの値を調べて、全てのキーが照合に成
功するルールが見出された場合に、アクションの記述に
従ってそのパケットを通過させるか棄却するかを決定す
る。
Next, in the search processing, as shown by the arrow in FIG. 10, when a received packet is given, the rules are examined in order from the top of the ACL internal representation, and the key value of the packet is checked by the matching method according to each key. If a rule is found that all keys are successfully matched, it is determined whether to pass or drop the packet according to the description of the action.

【0007】これらの従来のパケット分類装置において
は、第1に、ACLを上から順番に調べるのでルール数
が多くなると探索処理の時間が長くなることがある。最
悪の場合、全ルールを調べるための時間を要することと
なる。このため、探索処理時間を短縮するために、探索
処理をハードウェア化する方法が提案されているが、ル
ール数に依存して探索処理時間が長くなるという問題点
は残されている。この問題点を解決するため、ルーティ
ングテーブルを用いるパケット分類が提案されている。
この分類ではパトリシア木等のディジタル探索木を用い
る方法がある。ここで、代表的なディジタル探索木であ
るパトリシア木を例として説明する。
In these conventional packet classifiers, firstly, the ACL is checked in order from the top, and therefore the search processing time may increase as the number of rules increases. In the worst case, it will take time to examine all the rules. Therefore, in order to reduce the search processing time, a method of hardwareizing the search processing has been proposed, but the problem that the search processing time becomes long depending on the number of rules remains. In order to solve this problem, packet classification using a routing table has been proposed.
In this classification, there is a method of using a digital search tree such as Patricia tree. Here, a Patricia tree which is a typical digital search tree will be described as an example.

【0008】先ず、ディジタル探索木で保持対象となる
見出しとしてA〜Z及びnullの27種類を考え、それぞ
れの符号の2進数表示を 00001〜11010 及び00000 とす
る。この符号の2進数表示では、最も左側のビットをビ
ット0とし、以下右側へ順にビット1,2,3,4とす
る。図11は、null,A,C,E,G,H,I,N,P,R,S,Tの12個の見
出しが存在するパトリシア木である。図で大きい丸印は
節点、小さい丸印は葉、節点間又は節点と葉との間を結
ぶ線は枝を示す。節点又は葉の丸印の上側に記された数
値は節点又は葉を識別するための番号を表し、節点の丸
印の中に書かれた数値は検査ビット位置(その節点で調
べる探索キーの桁)を表し、葉の丸印の下側に記された
記号は、その葉の見出しを表す。節点0はディジタル探
索木の根であり、根を指している矩形はヘッドである。
パトリシア木では、探索キーが与えられた場合、探索木
の根から順に枝に沿って節点を辿り、探索キーに対して
検査ビット位置のビットが0の時は左側の節点に下が
り、そのビットが1の時は右側の節点に下がる。この操
作を繰り返すと、その探索キーに等しい見出しの葉が探
索木に存在する場合にはその葉に到達することができ
る。例えばHを探索するには、Hの符号01000 を探索キ
ーとして用い、木の根の節点から順に節点が指示する検
査ビット位置の探索キーのビットの値を調べて節点を辿
って行けばよい。この場合、最初の節点で探索キーのビ
ット0を調べると0であるので左下の節点に行く。次の
節点でビット1を調べると1であるので右下の節点に行
く。このように、節点0,1,4,9の順に辿ってそれ
ぞれの探索キーのビット0,1,2,4を調べて行く
と、見出しHの葉に至ることが分かる。
First, 27 types of A to Z and null are considered as headings to be held in the digital search tree, and the binary notation of each code is set to 00001 to 11010 and 00000. In the binary notation of this code, the leftmost bit is bit 0, and the bits to the right are bit 1, 2, 3, and 4 in that order. FIG. 11 is a Patricia tree having 12 headings of null, A, C, E, G, H, I, N, P, R, S, and T. In the figure, large circles indicate nodes, small circles indicate leaves, and lines connecting nodes or between nodes and leaves indicate branches. The number written above the circle of a node or leaf represents the number for identifying the node or leaf, and the number written in the circle of the node is the check bit position (the digit of the search key to be checked at that node). ), The symbol under the circle of the leaf indicates the heading of the leaf. Node 0 is the root of the digital search tree, and the rectangle pointing to the root is the head.
In a Patricia tree, when a search key is given, the nodes are traced along the branches in order from the root of the search key, and when the bit at the check bit position is 0 with respect to the search key, it descends to the node on the left side and that bit is 1 Time goes down to the right node. When this operation is repeated, if a leaf having a heading equal to the search key exists in the search tree, that leaf can be reached. For example, in order to search for H, the code 01000 of H is used as a search key, and the value of the search key bit at the check bit position designated by the node is sequentially searched from the root node of the tree to trace the node. In this case, if bit 0 of the search key is examined at the first node, it is 0, so the node goes to the lower left node. When bit 1 is checked at the next node, it is 1 so go to the node at the lower right. As described above, when the bits 0, 1, 2, and 4 of the respective search keys are examined by tracing the order of the nodes 0, 1, 4, and 9, it is understood that the leaf of the heading H is reached.

【0009】コンパイル処理でルールセットが図11のパ
トリシア木に変換されると、探索処理は以下のように行
われる。即ち、図11において、探索キーがI(符号0100
1)の葉を探索する場合、探索キーのビット0,1,2が
それぞれ0,1,0なので節点0,1,4の順に辿り、
節点9に到達する。節点9で探索キーのビット4を調べ
ると1なので葉18に到達する。葉18の見出しはIで探索
キーと等しいので、求めるべき葉に到達したことが分か
る。この時、到達した葉の見出しが探索キーと等しくな
い場合は、探索したい葉がこのディジタル探索木に存在
しないことが判明する。
When the rule set is converted into the Patricia tree of FIG. 11 by the compiling process, the searching process is performed as follows. That is, in FIG. 11, the search key is I (reference numeral 0100).
1) When searching for leaves, since the search key bits 0, 1, 2 are 0, 1, 0 respectively, follow the order of nodes 0, 1, 4
Reach node 9. When the bit 4 of the search key is examined at the node 9, it is 1 and the leaf 18 is reached. Since the heading of the leaf 18 is I and is equal to the search key, it can be seen that the leaf to be obtained has been reached. At this time, when the heading of the arrived leaf is not equal to the search key, it is found that the leaf to be searched does not exist in this digital search tree.

【0010】この方法では、探索処理時間がルール数に
依存しないので、前記の探索処理時間が長くなるという
問題は解決しているが、なお、ルールの条件として最長
プレフィクス照合を用いる場合にバックトラック或いは
ポインター操作が生じるため探索時間が長くなること、
ルールの条件として領域照合を用いる場合にパトリシア
木等のディジタル探索木をそのまま用いることができな
いこと、等の問題点がある。前者の問題点を解決するた
め、連想メモリーを用いる方法が提案されているが、こ
れは前記の後者の問題点を解決していないのに加え、更
に、ハードウェア量が多くなるため、ルール数が多い場
合に適用が困難であるという問題点がある。
In this method, since the search processing time does not depend on the number of rules, the problem that the search processing time becomes long has been solved, but it is still necessary to use the longest prefix matching as a rule condition. Search time will be long because of track or pointer operation,
When region matching is used as a rule condition, there is a problem that a digital search tree such as a Patricia tree cannot be used as it is. In order to solve the former problem, a method using associative memory has been proposed. However, in addition to solving the latter problem, the number of rules increases because the amount of hardware increases. There is a problem that it is difficult to apply when there are many cases.

【0011】[0011]

【発明が解決しようとする課題】本発明の目的は、上述
の事情に鑑み、探索処理時間がルール数に依存せず、ル
ールの条件に対して最長プレフィクス照合及び領域照合
を用いる場合においても、比較的少ないハードウェアに
より、探索処理を高速に行うことができるパケット分類
装置を提供することにある。
In view of the above-mentioned circumstances, an object of the present invention is to provide a search processing time that does not depend on the number of rules, and that uses longest prefix matching and area matching for rule conditions. The object of the present invention is to provide a packet classification device that can perform search processing at high speed with relatively little hardware.

【0012】[0012]

【課題を解決するための手段】本発明の上記の目的は、
前述のようなパケット分類装置において、予めルールセ
ットをドメイン記述子及び展開表に変換するコンパイル
機能、並びに、パケットのキーの値及びドメイン記述子
の値によって定まるアドレスに位置する展開表のエント
リーの値によって次のキーの位置及びドメイン記述子の
アドレスを決定する探索機能を有し、該探索機能が受信
パケットのキーの値に従って前記コンパイル機能が生成
したデータを辿ることを特徴とするパケット分類装置に
よって達成される。
The above objects of the present invention are as follows.
In the packet classification device as described above, a compile function for converting a rule set into a domain descriptor and an expansion table in advance, and an expansion table entry value located at an address determined by the packet key value and the domain descriptor value. A packet classifying device characterized by having a search function for determining the position of the next key and the address of the domain descriptor according to To be achieved.

【0013】本発明において、ドメイン記述子とは、キ
ーの値の定義域全体に対して、キーの値と展開表のエン
トリーとの対応付けを定めるデータである。また、展開
表とは、前記エントリーに対応するキーの値が条件を満
たさないルールを除外したルールセットに対して探索す
る時に用いるドメイン記述子のアドレスをエントリーす
る表である。
In the present invention, the domain descriptor is data which defines the correspondence between the key value and the expansion table entry for the entire domain of the key value. The expansion table is a table in which the address of a domain descriptor used when searching for a rule set excluding a rule whose key value corresponding to the entry does not satisfy the condition is entered.

【0014】このような本発明のパケット分類装置にお
いては、コンパイル機能が、キーの長さが長い場合に分
割し、短い場合に連結することにより、キーを固定長に
変換する機能を具えることができる。
In such a packet classifying apparatus of the present invention, the compiling function has a function of converting a key into a fixed length by dividing the key when the length is long and concatenating the keys when the length is short. You can

【0015】また、コンパイル機能が、キーの全ての値
について、対応する展開表のエントリーの識別子を保持
するドメイン記述子を生成する機能を具え、探索機能
が、キーの値に基づいてドメイン記述子から展開表のエ
ントリーのアドレスを求める機能を具えることができ
る。
Further, the compiling function has a function of generating a domain descriptor holding the identifiers of the corresponding expansion table entries for all the values of the key, and the searching function has the domain descriptor based on the value of the key. The function to obtain the address of the expansion table entry can be provided from.

【0016】また、コンパイル機能が、キーの値を一定
間隔のグループに分け、各グループについて最小のキー
に対応する展開表のエントリーの識別子の値と展開表の
エントリーが変化するか否かを表すビットマップデータ
とのデータ対を保持するドメイン記述子を生成する機能
を具え、探索機能が、キーの値に基づいてドメイン記述
子のデータ対を解釈して展開表のエントリーのアドレス
を求める機能を具えることができる。
The compiling function divides the key values into groups at regular intervals and indicates whether or not the value of the identifier of the expansion table entry corresponding to the smallest key in each group and the expansion table entry change. It has a function to generate a domain descriptor that holds a data pair with bitmap data, and a search function has the function of interpreting the data pair of the domain descriptor based on the value of the key to obtain the address of the expansion table entry. Can be equipped.

【0017】また、コンパイル機能が、展開表のエント
リーが少ない場合に、展開表のエントリーが変化するキ
ーの値からなるドメイン記述子を生成する機能を具え、
探索機能が、パケットのキーの値とドメイン記述子に保
持されているキーの値とを比較して展開表のエントリー
のアドレスを求める機能を具えることができる。
Further, the compiling function has a function of generating a domain descriptor consisting of a key value of which the expansion table entry changes when the expansion table has few entries,
The search function may include a function of comparing the key value of the packet and the key value held in the domain descriptor to obtain the address of the entry in the expansion table.

【0018】また、コンパイル機能が、ルールセットか
らパケットが全ての条件を満たす可能性のないルールを
除外してできるルールセットが同一の場合は、同一ドメ
イン記述子にまとめた展開表を生成する機能を具え、探
索機能が、パケットのキー及び展開表を用いて次のキー
の位置及びドメイン記述子のアドレスを決定する機能を
具えることができる。
Also, the compiling function is a function for generating a development table in which the same domain descriptor is put together when the rule sets formed by excluding the rules whose packets may not satisfy all conditions from the rule sets are the same. The look-up function may include the function of determining the position of the next key and the address of the domain descriptor by using the key of the packet and the expansion table.

【0019】また、コンパイル機能が、展開表のエント
リー数が1の時に、そのエントリーの値を前段の展開表
のエントリーの値として保持させ、その展開表及びドメ
イン記述子を除外する機能を具え、探索機能が、パケッ
トのキーの値と展開表を用いて次のキーの位置及びドメ
イン記述子のアドレスを決定する機能を具えることがで
きる。
Further, the compiling function has a function of holding the value of the entry as the value of the entry of the preceding expansion table when the number of entries of the expansion table is 1, and excluding the expansion table and the domain descriptor. The look-up function may include a function of determining the position of the next key and the address of the domain descriptor by using the key value of the packet and the expansion table.

【0020】このような本発明を適用することができる
具体的なシステムとしては、ルータ等の通信装置でのル
ーティングテーブルの検索、ファイアウォールでのフィ
ルタリング、QoS制御、IPスイッチングにおけるフ
ロー検出等がある。ルーティングテーブルの検索では、
キーは送信先アドレスフィールドであり、ルールは送信
先アドレス、ネットマスク及び転送先リンクの組であ
る。ルールではネットマスクにより送信先アドレスのプ
レフィクスを指定する。ルータ等の通信装置では、ルー
ルセットをルーティングテーブルとして保持し、受信パ
ケットの送信先アドレスフィールドのプレフィクスがル
ールの送信先アドレスのプレフィクスと等しいルールを
探し出し、複数のルールが該当する場合にはネットマス
クの最大のルールが選択され、そのルールの転送先リン
クに当該パケットを転送する。
As a specific system to which the present invention can be applied, there are a routing table search in a communication device such as a router, filtering in a firewall, QoS control, and flow detection in IP switching. In searching the routing table,
The key is the destination address field, and the rule is the set of destination address, netmask and destination link. In the rule, the prefix of the destination address is specified by the net mask. In a communication device such as a router, a rule set is held as a routing table, a rule in which the prefix of the destination address field of the received packet is equal to the prefix of the destination address of the rule is searched, and when multiple rules are applicable, The maximum rule of the netmask is selected and the packet is transferred to the transfer destination link of the rule.

【0021】ファイアウォールでのフィルタリングで
は、送信先アドレス、送信元アドレス、送信先ポート番
号、送信元ポート番号、プロトコルフィールド、TCP
フラグ等のフィールドをキーとして用いる。ルールで
は、各キーに対応する条件の指定及びパケットが全ての
条件を満たした場合に通過すべきか廃棄すべきかの指定
を行う。ファイアウォールでは、ルールセットをアクセ
ス制御リストとして保持し、受信パケットのキーが全て
の条件を満たすルールを探し出し、そのルールの指定に
従って当該パケットを通過させるか廃棄するかを決定す
る。
In the filtering by the firewall, the destination address, the source address, the destination port number, the source port number, the protocol field, the TCP
Fields such as flags are used as keys. The rule specifies the condition corresponding to each key and specifies whether the packet should pass or be discarded when all the conditions are satisfied. The firewall holds the rule set as an access control list, searches for a rule whose key of the received packet satisfies all conditions, and determines whether to pass or discard the packet according to the designation of the rule.

【0022】QoS制御及びIPスイッチングにおける
フロー検出では、パケットの送信元アドレス及び送信先
アドレスをキーとして用いる。ルールでは、各キーの満
たすべき条件、全ての条件が満たされた場合に当該パケ
ットに割付けるべきネットワーク資源に関する情報を指
定する。受信パケットのキーが全ての条件を満たすルー
ルを探し出し、そのルールの指定に従って当該パケット
にネットワーク資源を割付ける。
In the flow control in the QoS control and the IP switching, the source address and the destination address of the packet are used as keys. The rule specifies the condition to be satisfied by each key, and information on the network resource to be allocated to the packet when all the conditions are satisfied. The key of the received packet is searched for a rule that satisfies all the conditions, and the network resource is assigned to the packet according to the specification of the rule.

【0023】[0023]

【発明の実施の形態】〔実施例1〕次に、本発明のパケ
ット分類装置の実施例を説明する。この実施例において
は、コンパイル機能がルールセットを予めドメイン記述
子と展開表に変換し、探索機能が、パケットのキーの値
及びドメイン記述子の値によって定まるアドレスの展開
表のエントリーのデータを読出し、そのデータの値によ
り次のキーの位置及びドメイン記述子のアドレスを決定
し、受信パケットのキーの値に従ってコンパイル機能が
生成したデータを辿り、結果データを出力する。これに
より、各キーが満たすべき条件とそれら全てを満たすパ
ケットに対するアクションとの組を定めたルールセット
及びパケットが与えられた時に、ルールセットから全て
の条件を満たすルールを見付け出すことができる。
DESCRIPTION OF THE PREFERRED EMBODIMENTS [Embodiment 1] Next, an embodiment of the packet classification device of the present invention will be described. In this embodiment, the compiling function converts the rule set into the domain descriptor and the expansion table in advance, and the search function reads the data of the expansion table entry at the address determined by the packet key value and the domain descriptor value. The position of the next key and the address of the domain descriptor are determined according to the value of the data, the data generated by the compiling function is traced according to the value of the key of the received packet, and the result data is output. Thus, when a rule set and a packet defining a set of conditions that each key should satisfy and an action for a packet that satisfies all of them are given, it is possible to find a rule that satisfies all the conditions from the rule set.

【0024】 ルールセットR={r1,r2 }として r1 :p1,0 〔x0 ≧2〕 p1,1 〔x1 =6〕 a12 :p2,0 〔3≦x0 ≦5〕 p2,1 〔x1 ≧5〕 a2 を例として、ドメイン記述子及び展開表の作成法を説明
する。ここで、pj,i はrj の第i述語(ルールrj
第i番目のキーに対応する述語)であり、xk は第k番
目のキーの値、aj はルールrj のアクションである。
As rule set R = {r 1 , r 2 }, r 1 : p 1,0 [x 0 ≧ 2] p 1,1 [x 1 = 6] a 1 r 2 : p 2,0 [3 ≦ x 0 ≦ 5] p 2,1 [x 1 ≧ 5] a 2 will be described as an example to describe a method of creating the domain descriptor and the expansion table. Here, p j, i is the (predicate corresponding to the i-th key rule r j) the i predicate r j, x k is the value of the k-th key, a j is the rule r j It is an action.

【0025】ドメイン記述子及び展開表は、ルールセッ
トRに対して或るキーの値xi に対する条件が真となる
ルール集合を返す関数sieve(R,i,xi ) の部分計算によ
って与えられる。例えば、関数sieve(R,0,x0)=sieve
({r1,r2 },0, x0)は
The domain descriptor and the expansion table are given by the partial calculation of the function sieve (R, i, x i ) which returns the rule set for which the condition for a certain key value x i is true for the rule set R. . For example, the function sieve (R, 0, x 0 ) = sieve
({R 1 , r 2 }, 0, x 0 ) is

【数1】 のように表される。この式は、各行の()内の条件が成立
する場合に結果としてその行の集合が返されることを意
味する。この関数sieve(R,0,x0)の部分計算とは、x0
の値が分かる前に上記計算を可能な限り進めておき、x
0 の値を用いなければできない残りの計算を簡単にして
おくことを意味する。以下では、部分計算の結果を sie
veR,0(x0)と表すこととする。
[Equation 1] It is expressed as. This expression means that if the condition in () of each row is satisfied, the set of rows is returned as a result. The partial calculation of this function sieve (R, 0, x 0 ) is x 0
Advance the above calculation as much as possible before knowing the value of
It means to simplify the rest of the calculations that can only be done with a value of 0 . In the following, the result of the partial calculation is sie
It is expressed as veR, 0 (x 0 ).

【0026】以下では、キーの長さが3ビットの場合に
ついて関数sieve(R,0,x0)の部分計算を例示する。この
場合、x0 のドメイン(定義域)D0 はD0 ={0,...,
7}である。図1はドメイン記述子の構成例を示す図で
ある。D0 は、p1,0 の取り得る値(T又はF)に従っ
て、図に示すように、2つのインターバルI0 1,0及びI
1 1,0に分割することができる。同様にp2,0 に従うと、
図に示すように、3つのインターバルI0 2,0、I1 2,0
びI2 2,0に分割することができる。図において、x0
ドメインを全てのインターバルの境界によって分割する
と、4つのサブドメインD0 0={0, 1}、D1 0
{2}、D2 0={3,4,5 }、D3 0={6, 7}ができる。
各サブドメインにおけるp1,0 及びp2,0 の値を調べる
と、x0 の値がそのサブドメイン内にある場合に、x1
の値にかかわらずパケットがマッチしないことが明らか
なルールが分かる。例えば、D0 0ではp1,0 及びp2,0
がいずれもFであるので、x1 の値にかかわらず、ルー
ルr1 及びr2 はいずれもマッチしない。図1のサブド
メインルールセットは、このようなルールを除外したル
ールの集合である。
In the following, a partial calculation of the function sieve (R, 0, x 0 ) will be exemplified for the case where the key length is 3 bits. In this case, the domain (domain) D 0 of the x 0 is D 0 = {0, ...,
7}. FIG. 1 is a diagram showing a configuration example of a domain descriptor. D 0 depends on the possible values of p 1,0 (T or F), as shown, in two intervals I 0 1,0 and I
It can be divided into 1 1,0 . Similarly, according to p 2,0 ,
As shown, it can be divided into three intervals, I 0 2,0 , I 1 2,0 and I 2 2,0 . In the figure, when the domain of x 0 is divided by the boundaries of all intervals, four subdomains D 0 0 = {0, 1}, D 1 0 =
{2}, D 2 0 = {3,4,5}, D 3 0 = {6, 7} can be obtained.
Examining the values of p 1,0 and p 2,0 in each subdomain, if the value of x 0 is within that subdomain, then x 1
We can see the rule that packets are not matched regardless of the value of. For example, in D 0 0 , p 1,0 and p 2,0
Are both F, no rules r 1 and r 2 match regardless of the value of x 1 . The subdomain rule set in FIG. 1 is a set of rules excluding such rules.

【0027】また、ドメイン記述子は、キーの値からサ
ブドメイン識別子を与えるデータであり、図1に示すよ
うに、サブドメイン識別子の系列を与える。即ち、図の
ベクトル〔0,0,1,2,2,2,3 〕がドメイン記述子となり、
例えば第3要素(このベクトルは第0要素から始まるの
で第4番目の要素)の値2がキーの値3に対するサブド
メイン識別子である。
The domain descriptor is data that gives a subdomain identifier from a key value, and gives a series of subdomain identifiers as shown in FIG. That is, the vector [0,0,1,2,2,2,3] in the figure becomes the domain descriptor,
For example, the value 2 of the third element (the fourth element because this vector starts from the 0th element) is the subdomain identifier for the value 3 of the key.

【0028】 図1から部分計算R0 = sieve{r1, r2},0(x0) はFrom FIG. 1, the partial calculation R 0 = sieve {r 1 , r 2 }, 0 (x 0 ) is

【数2】 のようになる。[Equation 2] become that way.

【0029】この式のR0 は、キーの取り得る値に対し
て、ルールセットRからパケットが全ての条件を満たす
可能性のないルールを除外してできるルールの集合を与
えている。展開表は、各集合に対応するドメイン記述子
のアドレスをエントリーとする表であるので、各集合に
ついて関数sieve(R0,1,x1)の部分計算を上記と同様に行
ってできるドメイン記述子のアドレスを並べた表を作成
すると展開表が得られる。これにより、コンパイル処理
では、図2に示すデータを作成する。このデータは sie
ve展開木と呼ばれる。図2の各ブロックにおいて、最初
の行はドメイン記述子であり、2行目以降は展開表であ
る。
R 0 of this equation gives a set of rules which can be obtained by excluding, from the rule set R, the rules in which the packet may not satisfy all the conditions, with respect to the possible values of the key. The expansion table is a table with the address of the domain descriptor corresponding to each set as an entry, so the domain description that can be obtained by performing a partial calculation of the function sieve (R 0 , 1, x 1 ) for each set in the same way as above The expansion table is obtained by creating a table in which the child addresses are arranged. As a result, in the compiling process, the data shown in FIG. 2 is created. This data is sie
It is called a ve expansion tree. In each block of FIG. 2, the first line is a domain descriptor, and the second and subsequent lines are expansion tables.

【0030】探索処理では、先ず受信パケットのキー0
の値に従って部分計算 sieve{r1,r2},0(x0)のドメイ
ン記述子を読出す。図2の sieve{r1, r2},0(x0)のブ
ロックにおいて、例えば、キー0の値が2の時、ドメイ
ン記述子の第2番目(最も右側が第0番目なので右から
3番目)の値である1をサブドメイン識別子として読出
す。次に、展開表の第1番目(最も上が0番目なので上
から2番目)の値として sieve{r1},1(x1)へのポイン
ターを読出す。更に、受信パケットのキー1の値に従っ
て sieve{r1},1(x1)のドメイン識別子を読出し、その
値に従って展開表を読出す。今、キー1の値が6である
とすると、サブドメイン識別子は1なので、展開表の第
1番目を読出しr1 へのポインターを得る。即ち、受信
パケットのキー0及び1の値がそれぞれ2及び6の場
合、このパケットはルールr1 にマッチするパケットで
あることを通知する。このようにキーの数(上の例の場
合は2)に相当する回数だけドメイン記述子及び展開表
のエントリーを読出すことにより、照合に成功するルー
ルを得ることができる。
In the search process, first, the key 0 of the received packet
The domain descriptor of the partial calculation sieve {r 1 , r 2 }, 0 (x 0 ) is read according to the value of. In the block of sieve {r 1 , r 2 }, 0 (x 0 ) in FIG. 2, for example, when the value of key 0 is 2, the second domain descriptor (the rightmost one is the 0th one, so it is 3 The value of 1) is read as the subdomain identifier. Next, a pointer to sieve {r 1 }, 1 (x 1 ) is read out as the first value (second from the top because the top is 0th) of the expansion table. Furthermore, the domain identifier of sieve {r 1 }, 1 (x 1 ) is read according to the value of key 1 of the received packet, and the expansion table is read according to that value. Now, assuming that the value of key 1 is 6, the subdomain identifier is 1, so the first in the expansion table is read and a pointer to r 1 is obtained. That is, when the values of the keys 0 and 1 of the received packet are 2 and 6, respectively, it is notified that this packet matches the rule r 1 . In this way, by reading the domain descriptor and the expansion table entry as many times as the number of keys (2 in the above example), a rule that succeeds in matching can be obtained.

【0031】〔実施例2〕他のコンパイル処理において
は、キーを8ビットの固定長の連続するビット列とす
る。この場合、パケットフィールド長が8ビットでない
場合には各フィールドに対する条件をキーの条件に変換
してできるルールを用いる。このとき、必要である場合
には、フィールドを結合し又は分割してキーの述語に変
換する。フィールドを複数のキーに分割する時には、1
つのルールが複数になる場合もある。以下にフラグビッ
ト、多バイトフィールド及び多倍長プレフィクスの各フ
ィールドについての結合及び分割の例を示す。
[Embodiment 2] In another compile process, a key is a continuous bit string having a fixed length of 8 bits. In this case, if the packet field length is not 8 bits, a rule that can be used by converting the condition for each field into a key condition is used. At this time, if necessary, the fields are combined or divided and converted into a key predicate. 1 when splitting a field into multiple keys
There may be multiple rules. The following is an example of combining and dividing flag bits, multi-byte fields, and multiple-length prefix fields.

【0032】フラグビットの場合、同一バイト長の複数
のビットをまとめて1つのキーにする。例えば、 r1 :p1,1 〔x1 =1〕 p1,2 〔x2 =0〕 a1 を r1':p1',1〔x1'=(10)2 〕 a1 とする。ここで、x1'のビット0はx2 、ビット1はx
1 である。
In the case of flag bits, a plurality of bits having the same byte length are put together into one key. For example, r 1 : p 1,1 [x 1 = 1] p 1,2 [x 2 = 0] a 1 as r 1 ′ : p 1 ′, 1 [x 1 ′ = (10) 2 ] a 1 To do. Here, bit 0 of the x 1 'is x 2, bit 1 x
Is 1 .

【0033】多バイトフィールドの場合、複数のキーに
分割する。例えば、 r1 :p1,1 〔x1 >300 〕 a1 を r1':p1',1〔x1'=1〕 p1',2〔x1">44〕 a11":p1",1〔x1'>1〕 p1",2〔x1"≧0〕 a1 とする。ここで、x1 は2バイトデータであって、x1'
はx1 の上位1バイト、x1"は下位1バイトである。
In the case of a multi-byte field, it is divided into a plurality of keys. For example, r 1 : p 1,1 [x 1 > 300] a 1 is replaced with r 1 ′ : p 1 ′, 1 [x 1 ′ = 1] p 1 ′, 2 [x 1 ″ > 44] a 1 r 1 " : P 1", 1 [x 1 ' > 1] p 1 ", 2 [x 1" ≥0] a 1 where x 1 is 2-byte data and x 1'
The upper 1 byte, x 1 of x 1 "is a lower one byte.

【0034】多倍長プレフィクスの場合、複数のキーに
分割し、不等式で表す。例えば、 r1 :p1,1 〔x1 =(112*)16 〕 a1 を r1':p1',1〔x1'=(11)16〕 p1',2〔(20)16≦x1"≦(2f)16〕 a1 とする。ここで、*はワイルドカードであり、x1 は2
バイトデータであって、x1'はx1 の上位1バイト、x
1"は下位1バイトである。
In the case of a multiple length prefix, it is divided into a plurality of keys and expressed by an inequality. For example, r 1 : p 1,1 [x 1 = (112 *) 16 ] a 1 is replaced by r 1 ′ : p 1 ′, 1 [x 1 ′ = (11) 16 ] p 1 ′, 2 [(20) 16 ≤ x 1 " ≤ (2f) 16 ] a 1 where * is a wild card and x 1 is 2
A byte data, x 1 'is the top 1 byte of x 1, x
1 " is the lower 1 byte.

【0035】〔実施例3〕更に他のコンパイル処理にお
いては、図3に示す構造のデータを作成する。図では、
キーの値を8ビット、メモリーの1語を32ビットとして
いる。探索処理では、図に示すように、キーの上位6ビ
ットの値によってドメイン記述子のメモリー語を指定
し、キーの下位2ビットの値によってその語内の位置を
指定する。このように、キーの値によって指定されて得
られる8ビットのデータがサブドメインの識別子にな
り、展開表のエントリーの位置を指定する。展開表のエ
ントリーは、次のドメイン記述子のアドレス又はルール
のアクションの情報の格納アドレスを保持する。
[Third Embodiment] In still another compilation process, data having the structure shown in FIG. 3 is created. In the figure,
The value of the key is 8 bits and one word in the memory is 32 bits. In the search process, as shown in the figure, the value of the upper 6 bits of the key specifies the memory word of the domain descriptor, and the value of the lower 2 bits of the key specifies the position within the word. In this way, the 8-bit data obtained by designating the key value becomes the subdomain identifier, which designates the position of the entry in the expansion table. The expansion table entry holds the address of the next domain descriptor or the storage address of the action information of the rule.

【0036】〔実施例4〕更に他のコンパイル処理にお
いては、図4に示す構造のデータを作成する。このデー
タは、ドメイン記述子として、図1の例のように、サブ
ドメイン識別子の値のベクトル〔0,0,1,2,2,2,3,3 〕を
保持していなくても、インターバルの境界を表す。即
ち、サブドメイン識別子が変化した場合は1でそうでは
ない場合は0のビット列〔0,0,1,1,0,0,1,0 〕を保持し
ておれば、サブドメイン識別子を求めることができるこ
とに基づいている。即ち、上記ビット列において、ビッ
ト0から各ビットまでの1の数からそのビットに対応す
るサブドメイン識別子が得られる。
[Fourth Embodiment] In still another compilation process, data having the structure shown in FIG. 4 is created. As shown in the example of Fig. 1, this data is an interval descriptor even if it does not hold a vector of subdomain identifier values [0,0,1,2,2,2,3,3]. Represents the boundary of. In other words, if the subdomain identifier has changed, if it holds a bit string of 0, and if not, if it holds a bit string [0,0,1,1,0,0,1,0], then obtain the subdomain identifier. It is based on what you can do. That is, in the above bit string, the subdomain identifier corresponding to the bit is obtained from the number of 1s from bit 0 to each bit.

【0037】図4は、32ビット語のメモリーにおいて、
1回の参照でサブドメイン識別子が得られるように構成
したデータ構造を示す。このドメイン記述子では、上記
ビット列を8ビットずつ分割してできるビットマップと
その先頭ビットのサブドメイン識別子の値を表すオフセ
ットとの対を用いている。この場合には、キーの上位4
ビットでドメイン記述子内の1語を選択し、ビット4が
1のときは上半語、0のときは下半語のオフセット及び
ビットマップを選択する。キーの下位3ビットでビット
マップのビット位置を選択する。ビットマップのビット
0から選択ビットまでにある1の数にオフセットを加え
た値がサブドメイン識別子になる。このデータ構造を用
いる場合には、ドメイン記述子のメモリーサイズは64バ
イトであり、図3の場合に比べて1/4になる。
FIG. 4 shows, in a 32-bit word memory,
3 shows a data structure configured to obtain a subdomain identifier with one reference. In this domain descriptor, a pair of a bitmap formed by dividing the above bit string by 8 bits and an offset representing the value of the sub domain identifier of the first bit is used. In this case, the top four keys
A bit selects one word in the domain descriptor, and when the bit 4 is 1, the upper half word is selected, and when the bit 4 is 0, the lower half word offset and bitmap are selected. Select the bit position of the bitmap with the lower 3 bits of the key. The value obtained by adding an offset to the number of 1s from bit 0 of the bitmap to the selected bit becomes the subdomain identifier. When this data structure is used, the memory size of the domain descriptor is 64 bytes, which is 1/4 of that in the case of FIG.

【0038】〔実施例5〕更に他のコンパイル処理にお
いては、図5に示す構造のデータを作成する。このデー
タは、サブドメイン数が4以下の場合に適用可能なイン
デックス形式のドメイン記述子のデータ構造である。こ
の場合には、サブドメインの境界を与えるキーの値を保
持する。探索処理では、キーの値を各境界の値と比較し
て、どの境界の間にあるかを求めることにより、サブド
メイン識別子が得られる。
[Fifth Embodiment] In still another compilation process, data having the structure shown in FIG. 5 is created. This data is a data structure of a domain descriptor in an index format applicable when the number of subdomains is 4 or less. In this case, it holds the value of the key that gives the subdomain boundaries. In the search process, the subdomain identifier is obtained by comparing the value of the key with the value of each boundary and determining which boundary the value is.

【0039】〔実施例6〕更に他のコンパイル処理にお
いては、サブドメインの数に従って図4又は図5に示す
構造のデータを作成する。更に、展開表のエントリー内
に、次のドメイン識別子のデータが図4の形式か図5の
形式かを示すフラグデータを保持させる。探索処理で
は、このフラグデータに従ってドメイン記述子のデータ
形式を判別し、前記実施例4又は実施例5の探索処理を
切替える。
[Sixth Embodiment] In still another compilation process, data having the structure shown in FIG. 4 or 5 is created according to the number of subdomains. Further, flag data indicating whether the data of the next domain identifier is in the format of FIG. 4 or the format of FIG. 5 is held in the entry of the expansion table. In the search process, the data format of the domain descriptor is discriminated according to this flag data, and the search process of the fourth or fifth embodiment is switched.

【0040】〔実施例7〕更に他のコンパイル処理にお
いては、ドメイン識別子及び展開表(両者を合わせてsi
eve と呼ぶ)を作成する際に、図6に示すように、次段
のsieve を共有させたデータを作成する。即ち、図1の
例でも存在するように、サブドメインが異なっても次段
のsieve の入力となるルールセットが等しい場合があ
る。コンパイル処理において、このようなサブドメイン
を検出し、展開表のエントリーの内容を同一にする。
[Embodiment 7] In still another compilation processing, the domain identifier and the expansion table (both are combined
(called eve) is created, as shown in FIG. 6, data in which the next sieve is shared is created. That is, as is the case with the example of FIG. 1, even if the subdomains are different, the rule sets that are the inputs of the next sieve may be the same. In the compilation process, such subdomains are detected and the contents of the expansion table entries are made the same.

【0041】〔実施例8〕更に他のコンパイル処理にお
いては、図7に示すように、展開表のエントリー数が1
であるようなsieve を除外して、そのエントリーの値を
前段の展開表のエントリーの値として保持させるデータ
を作成する。
[Embodiment 8] In still another compilation process, as shown in FIG. 7, the number of entries in the expansion table is 1
Exclude the sieve such as, and create the data that holds the value of that entry as the value of the entry in the expansion table in the previous stage.

【0042】〔実施例9〕更に他のコンパイル処理にお
いては、図8に示す命令語をエントリーとする展開表を
作成する。探索処理では、プロセッサを、図9のように
一次元アレイ状に並べて動作させる。各プロセッサは、
図に示すように、キーの値と命令語を入力とし、次段の
プロセッサに対する命令語を出力とする。この命令語は
展開表のエントリーである。
[Embodiment 9] In still another compiling process, a development table having the instruction word shown in FIG. 8 as an entry is created. In the search processing, the processors are arranged and operated in a one-dimensional array as shown in FIG. Each processor is
As shown in the figure, the value of the key and the command word are input, and the command word for the processor at the next stage is output. This command is an entry in the expansion table.

【0043】これらのプロセッサは以下のような手続に
従って動作する。 (1) ドメイン記述子の型、ドメイン記述子の格納アドレ
ス、キーの位置の指定、プロセッサの指定及び探索の終
了等を示すデータからなる命令語を外部から受信する。 (2) 命令語からドメイン記述子の型、ドメイン記述子の
格納アドレス、及びキーの位置の指定のフィールドを取
出す。 (3) キーの位置で指定されたキーの値を受取り、これを
k とする。 (4) ドメイン記述子の型に従ってxk に対応するドメイ
ン記述子の値(サブドメイン識別子の値)を読出す。こ
の時、ドメイン記述子の先頭アドレスは、命令語のアド
レスのフィールドによって与えられる。 (5) サブドメイン識別子の値に従って展開表のエントリ
ー(次の命令語)を読出す。 (6) 次の命令語のターミネータ又はプロセッサの位置が
1の時、次の命令語を出力して命令語の実行を終了し、
(1) に戻る。そうではない時、(2) に戻る。
These processors operate according to the following procedure. (1) An instruction word consisting of data indicating the type of the domain descriptor, the storage address of the domain descriptor, the designation of the key position, the designation of the processor, the end of the search, etc. is externally received. (2) Fetch fields for specifying the domain descriptor type, domain descriptor storage address, and key position from the command word. (3) Receive the value of the key specified by the key position and set it as x k . (4) Read the value of the domain descriptor (the value of the subdomain identifier) corresponding to x k according to the type of the domain descriptor. At this time, the start address of the domain descriptor is given by the address field of the instruction word. (5) Read the expansion table entry (next command word) according to the value of the subdomain identifier. (6) When the position of the terminator or processor of the next instruction word is 1, the next instruction word is output and the execution of the instruction word is finished,
Return to (1). If not, return to (2).

【0044】これらのプロセッサは、ローカルメモリー
としてドメイン記述子及び展開表を格納するチャンクメ
モリーを持つ。ドメイン記述子及び展開表のメモリーを
分割してドメイン記述子及び展開表のメモリーアクセス
をパイプライン化すると、プロセッサは1回のメモリー
アクセス毎に出力できるようになる。
These processors have a chunk memory for storing the domain descriptor and the expansion table as a local memory. When the memory of the domain descriptor and the expansion table is divided and the memory access of the domain descriptor and the expansion table is pipelined, the processor can output for each memory access.

【0045】プロセッサをキーの数だけ並べる場合は、
各プロセッサにそれぞれ1つのキーに対応するsieve の
実行を割付ける。コンパイラがプロセッサ位置の値を常
に1にセットしておくと、プロセッサは、上記手順(6)
で必ず手順(1) に戻るループを構成する。このとき、先
頭のプロセッサに sieve展開木の根のsieve のアドレス
を持つ命令語を入力すると、各プロセッサはそれぞれ1
つのキーを用いてsieve を実行し、最終段のプロセッサ
がルール識別子(パケットが実行可能の場合)又は0
(パケットが実行不可能の場合)をアドレスフィールド
に持つ命令語を出力する。図9に示すように、連続して
到着するパケットのキーの値を次々にプロセッサに与
え、先頭のプロセッサにパケット到着毎に命令語を与え
ると、システム全体では1sieve の実行時間の間隔でシ
ストリック動作をする。更に、プロセッサを2段のパイ
プラインで構成すると、1メモリーアクセスの時間間隔
でシストリック動作をさせることができる。
When arranging the processors by the number of keys,
Assign to each processor the execution of sieve that corresponds to one key each. If the compiler always sets the value of the processor position to 1, the processor will follow the procedure (6) above.
Always configure a loop that returns to step (1). At this time, if an instruction word having the address of the sieve of the root of the sieve expansion tree is input to the first processor, each processor will get 1
Executes sieve using one key, and the processor at the final stage uses the rule identifier (if the packet is executable) or 0
Outputs an instruction word that has (when the packet cannot be executed) in the address field. As shown in FIG. 9, when the key values of packets that arrive consecutively are given to the processors one after another and the command word is given to the head processor every time the packets arrive, the system as a whole is systolic at execution time intervals of 1 sieve. To work. Further, if the processor is configured by a pipeline of two stages, systolic operation can be performed at time intervals of one memory access.

【0046】プロセッサの命令語は、図8に示すよう
に、キーの位置及びプロセッサの位置を指定するフィー
ルドを具えているので、処理すべきキーの位置が異なる
複数のsieve を同一プロセッサに割付けることが可能で
ある。プロセッサの数又は各プロセッサのメモリー容量
が充分ではない場合には、次のような割付け法を採るこ
とができる。即ち、プロセッサの数をp、 sieve展開木
の根から葉に至るバス上のsieve の数をsとし、p<s
とすると、この場合には、根から順にs/pより大きい
最小の整数値に等しい個数のsieve を同じプロセッサに
割付けて行けばプロセッサ当たりの割付けsieve 数が平
均化される。
As shown in FIG. 8, the instruction word of the processor has a field for designating the position of the key and the position of the processor. Therefore, a plurality of sieves having different key positions to be processed are assigned to the same processor. It is possible. When the number of processors or the memory capacity of each processor is not sufficient, the following allocation method can be adopted. That is, let p be the number of processors and s be the number of sieves on the bus from the root to the leaves of the sieve expansion tree.
Then, in this case, if the number of sieves equal to the smallest integer greater than s / p is allocated to the same processor in order from the root, the number of allocated sieves per processor is averaged.

【0047】メモリーが各プロセッサに分散されている
ため、システム全体として sieve展開木の全チャンクデ
ータを保持できるメモリー容量がある場合でも、上記の
ような割付けをしようとする時に特定のプロセッサにお
いてメモリー不足のため割付けられないsieve が発生す
ることがある。このような場合には、実行時間を犠牲に
してそのsieve を他のプロセッサに割付けることができ
る。
Since the memory is distributed to each processor, even if the entire system has a memory capacity capable of holding all chunk data of the sieve expansion tree, a memory shortage occurs in a specific processor when the above allocation is attempted. Due to this, there may occur a sieve that cannot be allocated. In such a case, the sieve can be assigned to another processor at the expense of execution time.

【0048】[0048]

【発明の効果】上記のとおり、本発明によれば、以下の
効果を得ることができる。即ち、探索処理においてAC
Lを上から順番に調べる代わりにキーフィールドに対応
するドメイン識別子と展開表との組(sieve) を順番に調
べるので、調べるべきsieve の数はルールの数に依存し
ないため、ルールの数が多くなっても探索処理の時間が
長くなることはない。また、最長プレフィクス照合に従
う条件をルールに用いる場合でも、sieve を順番に調べ
るだけでよいため、バックトラックが生じたり又は余分
なポインターが生じたりして探索時間が長くなることは
ない。領域照合の場合でも、sieve を順番に調べるだけ
でよいため、そのままで用いることができる。従って、
本発明によれば、少ないハードウェア量で、ルールの数
が多い場合にも適用できるパケット分類装置を実現する
ことができる。
As described above, according to the present invention, the following effects can be obtained. That is, in the search process, AC
Instead of examining L in order from the top, the pairs of domain identifiers and expansion tables corresponding to the key fields (sieve) are examined in order, so the number of sieves to be examined does not depend on the number of rules, so the number of rules is large. However, the search processing time does not increase. Further, even when using a condition that conforms to the longest prefix matching in the rule, it is only necessary to check the sieves in order, so backtracking or extra pointers do not lengthen the search time. Even in the case of region matching, it is possible to use it as it is because it is only necessary to examine the sieves in order. Therefore,
According to the present invention, it is possible to realize a packet classification device that can be applied to a large number of rules with a small amount of hardware.

【図面の簡単な説明】[Brief description of drawings]

【図1】 実施例1におけるドメイン記述子の構成例の
細部を示す図である。
FIG. 1 is a diagram illustrating details of a configuration example of a domain descriptor according to a first embodiment.

【図2】 実施例1におけるドメイン記述子と展開表の
構成例を示す図である。
FIG. 2 is a diagram showing a configuration example of a domain descriptor and a development table in the first embodiment.

【図3】 実施例3におけるドメイン記述子と展開表の
構成例を示す図である。
FIG. 3 is a diagram showing a configuration example of a domain descriptor and a development table in the third embodiment.

【図4】 実施例4におけるドメイン記述子と展開表の
構成例を示す図である。
FIG. 4 is a diagram showing a configuration example of a domain descriptor and a development table in the fourth embodiment.

【図5】 実施例5におけるドメイン記述子の構成例を
示す図である。
FIG. 5 is a diagram showing a configuration example of a domain descriptor in the fifth embodiment.

【図6】 実施例7におけるドメイン記述子と展開表の
組の系列の構成例を示す図である。
FIG. 6 is a diagram showing a configuration example of a series of pairs of domain descriptors and expansion tables in the seventh embodiment.

【図7】 実施例8におけるドメイン記述子と展開表の
組の系列の構成例を示す図である。
FIG. 7 is a diagram showing a configuration example of a series of sets of domain descriptors and expansion tables in the eighth embodiment.

【図8】 実施例9における命令語の構成例を示す図で
ある。
FIG. 8 is a diagram showing a configuration example of an instruction word according to the ninth embodiment.

【図9】 実施例9におけるプロセッサアレイの構成例
を示す図である。
FIG. 9 is a diagram illustrating a configuration example of a processor array according to a ninth embodiment.

【図10】 従来のアクセス制御リストの例を示す図で
ある。
FIG. 10 is a diagram showing an example of a conventional access control list.

【図11】 従来のパトリシア木の例を示す図である。FIG. 11 is a diagram showing an example of a conventional Patricia tree.

【符号の説明】[Explanation of symbols]

r ルール R ルールセット p ルールの述語 x キーの値 I インターバル D ドメイン DD ドメイン記述子 UT 展開表 r rule R rule set p rule predicate the value of the x key I interval D domain DD domain descriptor UT expansion table

Claims (9)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 キーフィールドが満たすべき条件を定め
たルールの集合であるルールセットからパケットが全て
の条件を満たすルールを見つけ出すためのパケット分類
装置において、予めルールセットをドメイン記述子及び
展開表に変換するコンパイル機能、並びに、パケットの
キーの値及びドメイン記述子の値によって定まるアドレ
スに位置する展開表のエントリーの値によって次のキー
の位置及びドメイン記述子のアドレスを決定する探索機
能を具え、該探索機能が受信パケットのキーの値に従っ
て前記コンパイル機能が生成したデータを辿ることを特
徴とするパケット分類装置。
1. A packet classification device for finding a rule that a packet satisfies all conditions from a rule set, which is a set of rules defining conditions to be satisfied by a key field. A compile function for converting, and a search function for determining the position of the next key and the address of the domain descriptor according to the value of the entry of the expansion table located at the address determined by the value of the key of the packet and the value of the domain descriptor, The packet classification device, wherein the search function traces the data generated by the compiling function according to the value of the key of the received packet.
【請求項2】 コンパイル機能が、キーの長さが長い場
合に分割し、短い場合に連結することにより、キーを固
定長に変換する機能を具えることを特徴とする請求項1
に記載のパケット分類装置。
2. The compiling function has a function of converting a key into a fixed length by dividing the key when the length is long and connecting the keys when the length is short.
The packet classification device described in 1.
【請求項3】 コンパイル機能が、キーの全ての値につ
いて、対応する展開表のエントリーの識別子を保持する
ドメイン記述子を生成する機能を具え、探索機能が、キ
ーの値に基づいてドメイン記述子から展開表のエントリ
ーのアドレスを求める機能を具えることを特徴とする請
求項1又は2に記載のパケット分類装置。
3. The compiling function has a function of generating a domain descriptor holding an identifier of a corresponding expansion table entry for all values of the key, and the searching function has a domain descriptor based on the value of the key. 3. The packet classification device according to claim 1, further comprising a function for obtaining an address of an entry in the expansion table from the packet classification device.
【請求項4】 コンパイル機能が、キーの値を一定間隔
のグループに分け、各グループについて最小のキーに対
応する展開表のエントリーの識別子の値と展開表のエン
トリーが変化するか否かを表すビットマップデータとの
データ対を保持するドメイン記述子を生成する機能を具
え、探索機能が、キーの値に基づいてドメイン記述子の
データ対を解釈して展開表のエントリーのアドレスを求
める機能を具えることを特徴とする請求項1又は2に記
載のパケット分類装置。
4. The compiling function divides the key values into groups at regular intervals, and for each group, indicates whether the value of the identifier of the expansion table entry corresponding to the smallest key and the expansion table entry change. It has a function to generate a domain descriptor that holds a data pair with bitmap data, and a search function has the function of interpreting the data pair of the domain descriptor based on the value of the key to obtain the address of the expansion table entry. The packet classification device according to claim 1 or 2, further comprising:
【請求項5】 コンパイル機能が、展開表のエントリー
が少ない場合に、展開表のエントリーが変化するキーの
値からなるドメイン記述子を生成する機能を具え、探索
機能が、パケットのキーの値とドメイン記述子に保持さ
れているキーの値とを比較して展開表のエントリーのア
ドレスを求める機能を具えることを特徴とする請求項1
又は2に記載のパケット分類装置。
5. The compiling function has a function of generating a domain descriptor consisting of a key value of which the expansion table entry changes when the expansion table has a small number of entries, and the searching function includes a packet key value. 2. The method according to claim 1, further comprising a function of comparing the value of the key held in the domain descriptor with the address of the entry in the expansion table.
Or the packet classification device according to 2.
【請求項6】 コンパイル機能が請求項4に記載のコン
パイル機能及び請求項5に記載のコンパイル機能を具
え、サブドメインの数に従っていずれかに機能し、探索
機能が前記いずれかに機能に対応して展開表のエントリ
ーのアドレスを求める機能を具えることを特徴とする請
求項1又は2に記載のパケット分類装置。
6. The compile function comprises the compile function according to claim 4 and the compile function according to claim 5, wherein the compile function functions according to the number of subdomains, and the search function corresponds with the function according to any one of the above. 3. The packet classification device according to claim 1, further comprising a function of obtaining an address of an entry in the expansion table.
【請求項7】 コンパイル機能が、ルールセットからパ
ケットが全ての条件を満たす可能性のないルールを除外
してできるルールセットが同一の場合は、同一ドメイン
記述子にまとめた展開表を生成する機能を具え、探索機
能が、パケットのキー及び展開表を用いて次のキーの位
置及びドメイン記述子のアドレスを決定する機能を具え
ることを特徴とする請求項1乃至6のいずれか1項に記
載のパケット分類装置。
7. A function for compiling, when a rule set formed by excluding a rule in which a packet may not satisfy all conditions from the rule set is the same, and generating a development table summarized in the same domain descriptor. 7. The search function according to claim 1, further comprising the function of determining the position of the next key and the address of the domain descriptor by using the key of the packet and the expansion table. The described packet classification device.
【請求項8】 コンパイル機能が、展開表のエントリー
数が1の時に、そのエントリーの値を前段の展開表のエ
ントリーの値として保持させ、その展開表及びドメイン
記述子を除外する機能を具え、探索機能が、パケットの
キーの値と展開表を用いて次のキーの位置及びドメイン
記述子のアドレスを決定する機能を具えることを特徴と
する請求項1乃至7のいずれか1項に記載のパケット分
類装置。
8. The compiling function has a function of, when the number of entries in the expansion table is 1, holding the value of the entry as the value of the entry of the expansion table in the preceding stage, and excluding the expansion table and the domain descriptor, 8. The search function according to claim 1, wherein the search function has a function of determining the position of the next key and the address of the domain descriptor by using the key value of the packet and the expansion table. Packet classifier.
【請求項9】 探索機能が、ドメイン記述子の型、ドメ
イン記述子の格納アドレス、キーの位置の指定、プロセ
ッサの指定及び探索の終了等を示すデータからなる命令
語を解釈実行する機能を具えることを特徴とする請求項
1乃至7のいずれか1項に記載のパケット分類装置。
9. The search function has a function of interpreting and executing an instruction word including data indicating a domain descriptor type, a domain descriptor storage address, a key position designation, a processor designation, a search end, and the like. The packet classification device according to any one of claims 1 to 7, wherein
JP07132599A 1999-03-17 1999-03-17 Packet classifier Expired - Fee Related JP3443356B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP07132599A JP3443356B2 (en) 1999-03-17 1999-03-17 Packet classifier

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP07132599A JP3443356B2 (en) 1999-03-17 1999-03-17 Packet classifier

Publications (2)

Publication Number Publication Date
JP2000270021A JP2000270021A (en) 2000-09-29
JP3443356B2 true JP3443356B2 (en) 2003-09-02

Family

ID=13457304

Family Applications (1)

Application Number Title Priority Date Filing Date
JP07132599A Expired - Fee Related JP3443356B2 (en) 1999-03-17 1999-03-17 Packet classifier

Country Status (1)

Country Link
JP (1) JP3443356B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100337441C (en) * 2003-04-30 2007-09-12 华为技术有限公司 Method for table lookup in packet forwarding

Also Published As

Publication number Publication date
JP2000270021A (en) 2000-09-29

Similar Documents

Publication Publication Date Title
US10496680B2 (en) High-performance bloom filter array
US9984144B2 (en) Efficient lookup of TCAM-like rules in RAM
KR100477391B1 (en) Full match(fm) search algorithm implementation for a network processor
CN108370352B (en) High speed flexible packet classification using network processors
JP4452183B2 (en) How to create a programmable state machine data structure to parse the input word chain, how to use the programmable state machine data structure to find the resulting value corresponding to the input word chain, deep wire speed A method for performing packet processing, a device for deep packet processing, a chip embedding device, and a computer program including programming code instructions (method and device for deep packet processing)
US7984038B2 (en) Longest prefix match (LPM) algorithm implementation for a network processor
US7240040B2 (en) Method of generating of DFA state machine that groups transitions into classes in order to conserve memory
Kumar et al. Advanced algorithms for fast and scalable deep packet inspection
JP3485262B2 (en) Method and means for classifying data packets
KR100429142B1 (en) Software management tree implementation for a network processor
US20050083937A1 (en) IP address lookup method using pipeline binary tree, hardware architecture, and recording medium
US7317723B1 (en) Action based termination of multidimensional lookup
TW200301429A (en) A method of improving the lookup performance of tree-type knowledge base searches
CN100385880C (en) Packet classification apparatus and method using field level tries
US6697803B2 (en) Generating searchable data entries and applications therefore
CN111988231B (en) Mask quintuple rule matching method and device
US7535899B2 (en) Packet classification
US20070255676A1 (en) Methods and apparatus for performing tree-based processing using multi-level memory storage
JP3443356B2 (en) Packet classifier
KR100662254B1 (en) Apparatus and Method for Packet Classification in Router
CN107819887A (en) The detection method and device of network segment conflict
Matoušek et al. Memory efficient IP lookup in 100 GBPS networks
CN111353018A (en) Data processing method and device based on deep packet inspection and network equipment
US11929837B2 (en) Rule compilation schemes for fast packet classification
JP4151217B2 (en) Datagram transfer device

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090620

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090620

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100620

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees