JP5920698B2 - Data judgment device and data judgment program - Google Patents
Data judgment device and data judgment program Download PDFInfo
- Publication number
- JP5920698B2 JP5920698B2 JP2011273040A JP2011273040A JP5920698B2 JP 5920698 B2 JP5920698 B2 JP 5920698B2 JP 2011273040 A JP2011273040 A JP 2011273040A JP 2011273040 A JP2011273040 A JP 2011273040A JP 5920698 B2 JP5920698 B2 JP 5920698B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- address
- registration
- registration data
- stored
- 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
Links
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
- Communication Control (AREA)
Description
この発明は、入力された照合データが予め登録されている登録データ群中の登録データと一致するか否かを判定するデータ判定装置およびデータ判定プログラムに関するものである。 The present invention relates to a data determination device and a data determination program for determining whether or not input collation data matches registration data in a registered data group registered in advance.
ネットワークに接続された通信端末には、受信したパケットのフィルタリングを行うため、パケットフィルタ回路を搭載する端末がある。このパケットフィルタ回路は、受信したパケットに含まれるIPアドレスなどの照合データと、一致条件として事前に登録されている登録データ群中の登録データとを比較し、照合データと登録データとの一致/不一致を判定し、この判定結果に基づいてパケットの廃棄や透過等の処理を行う。ネットワークの大容量化に伴い、通信端末が送受信するパケット数が増加し、パケットフィルタ回路には、多量のパケットに対して判定を行うこと、すなわち高スループット化が求められている。 Communication terminals connected to the network include terminals equipped with a packet filter circuit for filtering received packets. This packet filter circuit compares collation data such as an IP address included in the received packet with registration data in a registered data group registered in advance as a matching condition, and matches / matches the collation data with the registration data. A mismatch is determined, and processing such as packet discard or transmission is performed based on the determination result. As the capacity of a network increases, the number of packets transmitted and received by a communication terminal increases, and the packet filter circuit is required to perform determination on a large number of packets, that is, to increase the throughput.
パケットフィルタ回路において、照合データと登録データとの一致/不一致を判定する方式の1つに線形探索方式(例えば、非特許文献1参照)がある。この線形探索方式は、照合データと登録データとを1つずつ照合し、照合データと登録データとが一致した場合は一致と判定し、照合データが何れの登録データとも一致しない場合は不一致と判定する。すなわち、線形探索方式は、照合データと全ての登録データとを照合した後で、不一致が判定される方式である。 In the packet filter circuit, there is a linear search method (see, for example, Non-Patent Document 1) as one of methods for determining matching / mismatching between verification data and registered data. In this linear search method, collation data and registration data are collated one by one, and if the collation data and registration data match, it is determined to match, and if the collation data does not match any registration data, it is determined to be disagreement. To do. That is, the linear search method is a method in which a mismatch is determined after collation data is collated with all registered data.
〔従来例1〕
線形探索方式を実装したパケットフィルタ回路の代表的な構成を図22に示す。このパケットフィルタ回路200は、バッファ回路201と一致判定回路202とから成る。
[Conventional example 1]
FIG. 22 shows a typical configuration of a packet filter circuit that implements the linear search method. The
バッファ回路201は、入力される判定要求信号とパケットをもとに、判定開始信号と照合データ(パケットの一部または全部からなるデータ)を、一致判定回路202に送る。一致判定回路202は、バッファ回路201からの照合データと一致条件として事前に登録されている登録データ群中の登録データとを比較して、一致の判定を行う。
The
一致判定回路202は、照合データと一致する登録データを検出した場合に、その時点でバッファ回路201に一致判定信号を出力する。全ての登録データとの照合を行っても、一致する登録データを検出できなかった場合には、バッファ回路201に不一致判定信号を出力する。
The
一致判定回路202からの一致判定信号/不一致判定信号はバッファ回路201に送られる。バッファ回路201は、一致判定信号が送られてくると、受信したパケットを透過し、不一致判定信号が送られてくると、受信したパケットを破棄する。
The match determination signal / mismatch determination signal from the
このような動作から分かるように、線形探索方式を実装したパケットフィルタ回路は、照合データと全ての登録データとを照合した後でなければ不一致と判定することができないため、一致判定に比べて不一致判定には時間を要する。通信端末におけるフィルタリング処理では、受信したパケットが不一致と判定される場合も多く、不一致判定に時間を要することがスループットを低下させる原因となっている。 As can be seen from these operations, the packet filter circuit that implements the linear search method can not be determined to be inconsistent unless collation data and all registered data are collated. Judgment takes time. In filtering processing at a communication terminal, received packets are often determined to be inconsistent, and the time required for inconsistency determination is a cause of lowering throughput.
パケットフィルタ回路において、照合データと登録データとの一致/不一致を判定する他の方式に、2分探索方式(例えば、非特許文献2参照)がある。この2分探索方式は、照合対象となる登録データを半分に絞り込んで行く方式である。この方式は、照合対象となる登録データを半分に絞り込んで行く方式であるため、照合対象となる登録データが線形探索方式に比べて減少し、一致を判定するまでの時間が短縮される。 In the packet filter circuit, there is a binary search method (for example, refer to Non-Patent Document 2) as another method for determining the match / mismatch between the verification data and the registered data. This binary search method is a method of narrowing the registration data to be collated to half. Since this method narrows down the registration data to be collated to half, the registration data to be collated is reduced as compared to the linear search method, and the time required to determine a match is shortened.
しかしながら、この方式も、照合対象となる全ての登録データとの照合が完了した後でなければ不一致を判定することができず、不一致判定に時間を要することになる。他にも、ハッシュ関数を用いた方式(例えば、非特許文献3参照)などもあるが、何れの方式もすべて、照合対象となる全ての登録データとの照合を完了した後で、不一致が判定される方式であるため、不一致の判定に時間を要することになる。 However, in this method, it is not possible to determine the mismatch unless the verification with all registered data to be verified is completed, and it takes time to determine the mismatch. There are other methods using a hash function (for example, see Non-Patent Document 3). However, all of these methods are judged to be inconsistent after completing collation with all registered data to be collated. Therefore, it takes time to determine the mismatch.
そこで、例えば特許文献1や非特許文献4に、照合データと全ての登録データとの照合を完了する前に不一致を判定するようにしたパケットフィルタ回路が提案されている。このパケットフィルタ回路では、一致判定回路に加えて、不一致判定回路を用いる。
In view of this, for example,
〔従来例2〕
図23に非特許文献4に示されたパケットフィルタ回路を示す。このパケットフィルタ回路300は、バッファ回路201と、一致判定回路202と、不一致判定回路203と、ORゲート204とから成る。
[Conventional example 2]
FIG. 23 shows a packet filter circuit disclosed in Non-Patent
バッファ回路201は、入力される判定要求信号とパケットをもとに、判定開始信号と照合データ(パケットの一部または全部からなるデータ)を、一致判定回路202および不一致判定回路203に送る。一致判定回路202は、バッファ回路201からの照合データと一致条件として事前に登録されている登録データ群中の登録データとを比較して、一致の判定を行う。一方、不一致判定回路203は、入力された照合データと予め登録されている登録データの有無情報(後述)とを比較して、不一致の判定を行う。
The
一致判定回路202は、照合データと一致する登録データを検出した場合に、その時点で一致判定信号を出力する。全ての登録データとの照合を行っても、一致する登録データを検出できなかった場合には、不一致判定信号を出力する。不一致判定回路203は、照合データと登録データの有無情報とを比較し、その照合データと一致する登録データがないと判定すると、不一致判定信号を出力する。一致判定回路202からの一致判定信号はバッファ回路201へ送られる。一致判定回路202からの不一致判定信号および不一致判定回路203からの不一致判定信号はORゲート204を介してバッファ回路201へ送られる。
When the
バッファ回路201は、一致判定信号が送られてくると、受信したパケットを透過し、不一致判定信号が送られてくると、受信したパケットを破棄する。そして、このパケットの処理後、バッファ回路201は、次のパケットの照合データと判定開始信号を出力し、一致判定回路202と不一致判定回路203は、そのパケットの判定処理に移行する。
The
このパケットフィルタ回路300の動作を図24を用いて説明する。図24は、不一致と判定される「パケット1」と一致と判定される「パケット2」が連続して入力される場合のタイミングチャートを示している。
The operation of the
先ず、バッファ回路201が「パケット1」の照合データと判定開始信号を、一致判定回路202と不一致判定回路203に出力する。一致判定回路202と不一致判定回路203は、判定開始信号を受けて、「パケット1」の判定処理を同時に開始する。不一致判定回路203は、「パケット1」の照合データと一致する登録データがないと判定すると、その時点で不一致判定信号を出力する。この不一致判定信号は、ORゲート204を介して、バッファ回路201へ与えられる。不一致判定回路203での一致する登録データがない旨の判定は短時間で行われる。
First, the
バッファ回路201は、不一致判定信号が送られてくると、一致判定回路202が判定途中であっても、受信した「パケット1」を廃棄する。「パケット1」の処理が終了すると、バッファ回路201は、「パケット2」の照合データと判定開始信号を出力する。これにより、一致判定回路202と不一致判定回路203で、「パケット2」の判定処理が同時に開始される。一致判定回路202は、「パケット2」の照合データと一致する登録データを検出すると、その時点で一致信号を出力する。この一致信号はバッファ回路201へ与えられる。バッファ回路201は、一致信号が送られてくると、受信した「パケット2」を透過させる。
When the mismatch determination signal is sent, the
以上の動作から分かるように、このパケットフィルタ回路300では、不一致判定回路203が一致判定回路202よりも先に不一致を判定することで、判定処理時間が短縮され、実効スループットが向上する。
As can be seen from the above operation, in the
〔不一致判定回路〕
パケットフィルタ回路300において、不一致判定回路203は、短時間で不一致を判定するために、メモリを用いて照合データと予め登録されている登録データの有無情報とを一度に比較して、不一致の判定を行う。
[Disagreement judgment circuit]
In the
不一致判定回路203に用いられるメモリの構成を図25に示す。このメモリMは、登録データの値をアドレスとして「一致(登録データ有り)」の判定を記憶し、それ以外のアドレスには「不一致(登録データ無し)」の判定を記憶する。図25では、登録データが「1」,「6」,「10」,「14」,「18」という5つの値である場合が示されている。この場合、メモリMのアドレスの「1」,「6」,「10」,「14」,「18」には「一致」の判定を格納し、それ以外のアドレスには「不一致」の判定を格納する。
The configuration of the memory used for the
このようなメモリMを用いることにより、照合時には、入力される照合データの値が読み出しアドレスとしてメモリMにアクセスされ、メモリMからは「一致」または「不一致」の判定が出力される。不一致判定回路203は、このメモリMからの出力をもとに、不一致を判定する。
By using such a memory M, at the time of collation, the value of the collation data that is input is accessed as a read address to the memory M, and a determination of “match” or “mismatch” is output from the memory M. The
図25に示したメモリMは、照合データが取り得る値の最大値と等しい容量が必要になる。つまり、照合データと登録データのビット長がnビットである場合、メモリMは2n個の判定を記憶することが必要になる。そこで、メモリの容量を削減するために、前述した非特許文献4には、nビットの照合データと登録データをmビットずつ、複数のメモリに分割して、並列に照合処理を行うことでメモリの容量を削減する手法が開示されている。
The memory M shown in FIG. 25 requires a capacity equal to the maximum value that the collation data can take. That is, if the bit length of the verification data and the registration data is n bits, the memory M needs to store 2 n determinations. Therefore, in order to reduce the memory capacity, the above-mentioned
図26はn=16、m=4の場合の例である。図26では、各登録データの上位4ビットをメモリM1に割り当て、次の4ビットをメモリM2に、更に次の4ビットをメモリM3に、下位4ビットをメモリM4に割り当てている。例えば、16ビットの「0x1234」と「0x4567」という2つの登録データを4つのメモリに分割して記憶する場合、4ビットずつに分割された各登録データを、図25と同様にして、各メモリに記憶する。ここで、「0x」は16進数表示であることを意味する。 FIG. 26 shows an example where n = 16 and m = 4. In FIG. 26, the upper 4 bits of each registered data are assigned to the memory M1, the next 4 bits are assigned to the memory M2, the next 4 bits are assigned to the memory M3, and the lower 4 bits are assigned to the memory M4. For example, when two registration data of 16 bits “0x1234” and “0x4567” are divided and stored in four memories, each registration data divided into four bits is stored in each memory in the same manner as in FIG. To remember. Here, “0x” means hexadecimal display.
「0x1234」という登録データの場合、メモリM1には上位4ビットの値である「0x1」をアドレスとして「一致」の判定を記憶する。メモリM2には次の4ビットの値である「0x2」のアドレスに、メモリM3には更に次の4ビットの値である「0x3」のアドレスに、そしてメモリM4には下位4ビットの値である「0x4」のアドレスに、「一致」の判定を記憶する。 In the case of registration data “0x1234”, the memory M1 stores “0x1”, which is the value of the upper 4 bits, as an address, and stores “match” determination. The memory M2 has the next 4-bit value “0x2”, the memory M3 has the next 4-bit value “0x3”, and the memory M4 has the lower 4-bit value. The determination of “match” is stored at a certain “0x4” address.
「0x4567」という登録データの場合も同様に、メモリM1には「0x4」のアドレスに、メモリM2には「0x5」のアドレスに、メモリM3には「0x6」のアドレスに、メモリM4には「0x7」のアドレスに、「一致」の判定を記憶する。これら以外の全てのアドレスには「不一致」の判定を記憶する。 Similarly, in the case of registration data “0x4567”, the memory M1 has an address “0x4”, the memory M2 has an address “0x5”, the memory M3 has an address “0x6”, and the memory M4 has “ The determination of “match” is stored at the address “0x7”. All other addresses are stored with a “mismatch” determination.
このように、nビットの登録データをmビットずつ、複数のメモリに分割して、「一致」/「不一致」の判定を記憶させることにより、メモリの容量を(n/m)2mに削減できる。 In this way, the n-bit registration data is divided into a plurality of memories in units of m bits and the determination of “match” / “mismatch” is stored, thereby reducing the memory capacity to (n / m) 2 m . it can.
不一致判定回路203のメモリを分割した構成とした場合、不一致判定時には、複数のメモリで並列に独立して照合を行い、どれか一つのメモリから不一致が出力されると照合データは不一致と判定される。例えば、図27に示すように、「0x1235」という照合データが入力された場合、メモリM1、メモリM2、メモリM3からは「一致」の判定が、メモリM4からは「不一致」の判定が出力され、照合データは不一致と判定される。
When the memory of the
しかし、照合データが不一致にもかかわらず不一致と判定できない場合がある。例えば、図28に示すように、「0x1237」という照合データが入力された場合、このデータは登録データではないので、不一致と判定されるべきであるが、全てのメモリM1〜M4(以下、このメモリを不一致テーブルと呼ぶ)は「一致」の判定を出力するため、一致と判定される。この場合、一致判定回路202が全ての登録データとの照合を行い、最終的に不一致と判定するため、誤った判定を行うことはない。
However, there are cases where it cannot be determined that there is a mismatch even though the collation data does not match. For example, as shown in FIG. 28, when collation data “0x1237” is input, since this data is not registered data, it should be determined that there is a mismatch, but all the memories M1 to M4 (hereinafter referred to as this data) The memory is referred to as a mismatch table), so that a “match” determination is output, so it is determined as a match. In this case, since the
〔一致判定回路〕
一致判定回路202には、前述したように、照合データと登録データとを順次照合していく線形探索方式や順次半分に絞り込んでゆく2分探索方式、ハッシュ探索方式法などを実装して用いることができる。いずれの方式を用いるにせよ、一致判定回路202には、登録データを記憶させておくメモリ(以下、このメモリを条件テーブルと呼ぶ)が必要であり、この条件テーブルから登録データを効率よく読み出すことにより照合データの一致/不一致を判定する。
[Match determination circuit]
As described above, the
しかしながら、上述した従来のパケットフィルタ回路200(図22)や300(図23)において、一致判定回路202における条件テーブルの作成には、予め各アドレスに対して書き込むべき登録データの一覧表を作成して、メモリに書き込むのが一般的である。通常、このデータ作成は、ソフトウェアで別途実行され、データが作成された後、メモリに書き込まれる。
However, in the above-described conventional packet filter circuit 200 (FIG. 22) or 300 (FIG. 23), in order to create the condition table in the
特に、一致判定回路202に加えて不一致判定回路203を設けたパケットフィルタ回路300では、不一致判定回路203における不一致テーブルの作成についても、一致判定回路202と同様にして、予め各アドレスに対して書き込むべきデータの一覧表を作成してメモリに書き込む必要があり、更には、登録データを変更した場合、改めて不一致テーブルへの「一致」/「不一致」の判定データや条件テーブルへの登録データを全て作成し直し、再度メモリに書き込む必要がある。
In particular, in the
このように、従来のパケットフィルタ回路では、別途テーブルを作成する必要があり、テーブルを作成するためのソフトウェアや事前にテーブルを作成する手間が必要であるという問題点があった。 As described above, in the conventional packet filter circuit, it is necessary to create a separate table, and there is a problem that software for creating the table and labor for creating the table in advance are required.
本発明は、このような課題を解決するためになされたもので、その目的とするところは、照合データと登録データとの一致/不一致の判定機能を利用することにより、一致/不一致を判定するためのテーブルを作成するためのソフトウェアや事前にテーブル作成する手間を不要とすることが可能なデータ判定装置およびデータ判定プログラムを提供することにある。 The present invention has been made to solve such a problem, and an object of the present invention is to determine a match / mismatch by using a match / mismatch determination function between matching data and registered data. It is an object of the present invention to provide a data determination apparatus and a data determination program that can eliminate the need to create software for creating a table and the trouble of creating a table in advance.
このような目的を達成するために、本願の請求項1に係る発明は、入力された照合データが予め登録されている登録データ群中の登録データと一致するか否かを判定するデータ判定装置において、登録データが格納される登録データ格納手段と、登録データ格納手段における登録データが格納されていないアドレスを含むアドレス情報を記憶するアドレス情報記憶手段と、登録データ格納手段に格納されている登録データと照合データとを比較し一致/不一致の判定結果を得る比較手段と、登録データ格納手段に格納されている登録データを更新する際に、登録データ格納手段に登録すべき登録候補のデータの入力を受けて、その登録候補のデータと登録データ格納手段に格納されている登録データとの比較を比較手段によって行わせ、不一致の判定結果が得られた場合、アドレス記憶手段に記憶されているアドレス情報に基づいて、入力された登録候補のデータを登録データとして登録データ格納手段に書き込む手段と、登録データ格納手段に格納されている登録データを更新する際に、登録データ格納手段から削除すべき削除候補のデータの入力を受けて、その削除候補のデータと登録データ格納手段に格納されている登録データとの比較を比較手段によって行わせ、一致の判定結果が得られた場合、アドレス記憶手段に記憶されているアドレス情報に基づいて、入力された削除候補のデータと一致する登録データを登録データ格納手段から削除する手段とを備えることを特徴とする。
In order to achieve such an object, the invention according to
この発明によれば、登録データ格納手段(条件テーブル)に格納されている登録データを更新する際に、登録データ格納手段に登録すべき登録候補のデータが入力されると、その登録候補のデータと登録データ格納手段に格納されている登録データとが比較手段(比較器)によって比較され、不一致の判定結果が得られると、アドレス記憶手段(レジスタ)に記憶されているアドレス情報(この場合、登録データが格納されていない空きアドレス)に基づいて、入力された登録候補のデータが登録データとして登録データ格納手段に書き込まれる。このようにして、本発明では、登録候補のデータが入力される毎に、その登録候補のデータが登録データ格納手段に格納されていなければ、次々に登録データとして登録データ格納手段の空きアドレスに書き込まれて行く。 According to this invention, when registration data stored in the registration data storage means (condition table) is updated, if registration candidate data to be registered in the registration data storage means is input, the registration candidate data And the registration data stored in the registration data storage means are compared by a comparison means (comparator), and when a determination result of mismatch is obtained, address information stored in the address storage means (register) (in this case, The input registration candidate data is written into the registration data storage means as registration data based on the empty address where no registration data is stored. In this way, according to the present invention, every time registration candidate data is input, if the registration candidate data is not stored in the registration data storage means, the registration data is successively stored as free data in the registration data storage means. Go written.
また、この発明によれば、登録データ格納手段(条件テーブル)に格納されている登録データを更新する際に、登録データ格納手段から削除すべき削除候補のデータが入力されると、その登録候補のデータと登録データ格納手段に格納されている登録データとが比較手段(比較器)によって比較され、一致の判定結果が得られると、アドレス記憶手段(レジスタ)に記憶されているアドレス情報(この場合、一致する登録データが格納されているアドレス)に基づいて、入力された削除候補のデータと一致する登録データが登録データ格納手段から削除される。このようにして、本発明では、削除候補のデータが入力される毎に、その削除候補のデータが登録データ格納手段に格納されていれば、次々にその削除候補のデータと一致する登録データが登録データ格納手段から削除されて行く。 According to the present invention, when the registration data stored in the registration data storage means (condition table) is updated, if the deletion candidate data to be deleted is input from the registration data storage means, the registration candidate And the registered data stored in the registered data storage means are compared by the comparing means (comparator), and when a coincidence determination result is obtained, the address information stored in the address storing means (register) In this case, the registered data that matches the input deletion candidate data is deleted from the registered data storage means on the basis of the address at which the matching registered data is stored. In this way, in the present invention, every time deletion candidate data is input, if the deletion candidate data is stored in the registered data storage means, registered data that matches the deletion candidate data one after another is stored. It is deleted from the registered data storage means.
本願の請求項2に係る発明は、請求項1に係る発明において、照合データの一部の情報をアドレスとして該アドレスの値を一部の情報として含んでいる登録データが登録データ格納手段に格納されているか否かを示す情報を格納した登録データ有無情報格納手段と、登録データ有無情報格納手段に格納されている情報に基づいて照合データが登録データ格納手段に格納されている登録データと一致していないことを判定する不一致判定手段と、登録データ有無情報格納手段に格納されている情報を更新する際に、登録データ有無情報格納手段に格納されている情報を全て削除した後、登録データ格納手段に格納されている登録データを読み出し、この読み出した登録データの一部の情報をアドレスとして登録データ有無情報格納手段にアクセスし、このアクセスした登録データ有無情報格納手段のアドレスに、当該アドレスの値を一部の情報として含んでいる登録データが登録データ格納手段に格納されていることを示す情報を書き込む手段とを備えることを特徴とする。
The invention according to
この発明によれば、登録データ有無情報格納手段(不一致テーブル)に格納されている情報の更新に際しては、登録データ有無情報格納手段に格納されている情報が全て削除された後、登録データ格納手段(条件テーブル)に格納されている登録データが読み出される。そして、この読み出された登録データの一部の情報をアドレスとして登録データ有無情報格納手段がアクセスされ、このアクセスした登録データ有無情報格納手段のアドレスに、当該アドレスの値を一部の情報として含んでいる登録データが登録データ格納手段に格納されていることを示す情報(「一致(登録データ有り)」)が書き込まれる。アクセスされなかったアドレスには登録データが登録データ格納手段に格納されていないことを示す情報(「不一致(登録データ無し)」)が残される。このようにして、本発明では、自動的に、登録データ有無情報格納手段のアドレスに、そのアドレスの値を一部の情報として含んでいる登録データが登録データ格納手段に格納されているか否かを示す情報が書き込まれて行く。 According to the present invention, when updating the information stored in the registration data presence / absence information storage means (mismatch table), after all the information stored in the registration data presence / absence information storage means is deleted, the registration data storage means The registered data stored in the (condition table) is read. Then, the registered data presence / absence information storage means is accessed using a part of the information of the read registration data as an address, and the value of the address is used as a part of the information of the accessed registration data presence / absence information storage means. Information indicating that the registration data included is stored in the registration data storage means (“match (with registration data)”) is written. Information indicating that the registration data is not stored in the registration data storage means (“mismatch (no registration data)”) remains at the address that has not been accessed. Thus, according to the present invention, whether or not registration data that includes the value of the address as a part of information is automatically stored in the registration data storage means in the address of the registration data presence / absence information storage means. The information indicating is going to be written.
本発明に係るデータ判定装置は、コンピュータによって実行されるプログラムとしても実現でき、プログラムを記録媒体に記憶することも、ネットワークを通して提供することも可能である。 The data determination apparatus according to the present invention can be realized as a program executed by a computer, and can be stored in a recording medium or provided through a network.
本発明によれば、登録データ格納手段に格納されている登録データを更新する際に、登録データ格納手段に登録すべき登録候補のデータの入力を受けて、その登録候補のデータと登録データ格納手段に格納されている登録データとの比較を比較手段によって行わせ、不一致の判定結果が得られた場合、アドレス記憶手段に記憶されているアドレス情報に基づいて、入力された登録候補のデータを登録データとして登録データ格納手段に書き込むようにしたので、また、登録データ格納手段に格納されている登録データを更新する際に、登録データ格納手段から削除すべき削除候補のデータの入力を受けて、その削除候補のデータと登録データ格納手段に格納されている登録データとの比較を比較手段によって行わせ、一致の判定結果が得られた場合、アドレス記憶手段に記憶されているアドレス情報に基づいて、入力された削除候補のデータと一致する登録データを登録データ格納手段から削除するようにしたので、登録候補のデータが入力される毎に、照合データと登録データとの一致/不一致の判定機能を利用して、次々に登録データ格納手段の空きアドレスに登録データとして書き込まれて行くものとなり、また、削除候補のデータが入力される毎に、照合データと登録データとの一致/不一致の判定機能を利用して、次々に削除候補のデータと一致する登録データが登録データ格納手段から削除されて行くものとなり、一致/不一致を判定するためのテーブルを作成するためのソフトウェアや事前にテーブル作成する手間を不要とすることが可能となる。 According to the present invention, when the registration data stored in the registration data storage means is updated, the registration candidate data to be registered in the registration data storage means is received, and the registration candidate data and the registration data storage are received. When the comparison result is compared with the registration data stored in the means and a determination result of inconsistency is obtained, the input registration candidate data is obtained based on the address information stored in the address storage means. Since the registration data is written in the registration data storage means, when the registration data stored in the registration data storage means is updated, the deletion data to be deleted is received from the registration data storage means. The comparison unit compares the deletion candidate data with the registration data stored in the registration data storage unit, and a match determination result is obtained. If, based on the address information stored in the address storage unit. Thus deletes the registration data matching the input data deletion candidate from the registered data storage means, every time the data of the registration candidate is input In addition, by using the matching / mismatching determination function between the collation data and the registered data, the data is sequentially written as registration data to the empty address of the registered data storage means , and deletion candidate data is input. Each time, using the matching / mismatching function between the matching data and the registered data, the registered data that matches the deletion candidate data is sequentially deleted from the registered data storage means, and the matching / mismatching is determined. Therefore, it is possible to eliminate the need for software for creating a table for creating a table and for creating a table in advance.
以下、本発明の実施の形態を図面に基づいて詳細に説明する。図1はこの発明に係るデータ判定装置を含むパケットフィルタ回路の一実施の形態を示す図である。 Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. FIG. 1 is a diagram showing an embodiment of a packet filter circuit including a data determination device according to the present invention.
このパケットフィルタ回路100は、バッファ回路101と、一致判定回路102と、不一致判定回路103と、ORゲート104とから成る。バッファ回路101には、判定要求信号とパケットが入力される。一致判定回路102と不一致判定回路103には、バッファ回路101からの判定開始信号と照合データに加えて、モード選択信号が入力される。
The
なお、本実施の形態の形態において、モード選択信号の設定によっては、入力される照合データは条件〔登録条件(登録候補のデータ)/削除条件(削除候補のデータ)〕と判断される。この点は後で詳述する。このパケットフィルタ回路100において、一致判定回路102と不一致判定回路103とが、本発明に係るデータ判定装置の主要な構成要素を成す。
In the embodiment, depending on the setting of the mode selection signal, the collation data to be input is determined as a condition [registration condition (registration candidate data) / deletion condition (deletion candidate data)]. This point will be described in detail later. In the
このパケットフィルタ回路100において、バッファ回路101は、入力される判定要求信号とパケットをもとに、判定開始信号と照合データ(パケットの一部または全部からなるデータ)を、一致判定回路102および不一致判定回路103に送る。一致判定回路102は、バッファ回路101からの照合データと一致条件として事前に登録されている登録データ群中の登録データと比較して、一致の判定を行う。一方、不一致判定回路103は、入力された照合データと予め登録されている登録データの有無情報とを比較して、不一致の判定を行う。
In this
一致判定回路102は、照合データと一致する登録データを検出した場合に、その時点で一致判定信号を出力する。全ての登録データとの照合を行っても、一致する登録データを検出できなかった場合には、不一致判定信号を出力する。不一致判定回路103は、照合データと登録データの有無情報とを比較し、その照合データと一致する登録データがないと判定すると、不一致判定信号を出力する。一致判定回路102からの一致判定信号はバッファ回路101へ送られる。一致判定回路102からの不一致判定信号および不一致判定回路103からの不一致判定信号はORゲート104を介してバッファ回路101へ送られる。
When the
バッファ回路101は、一致判定信号が送られてくると、受信したパケットを透過し、不一致判定信号が送られてくると、受信したパケットを破棄する。そして、このパケットの処理後、バッファ回路101は、次のパケットの照合データと判定開始信号を出力し、一致判定回路102と不一致判定回路103は、そのパケットの判定処理に移行する。
The
〔不一致判定回路の構成〕
不一致判定回路103の構成を図2に示す。不一致判定回路103は、ビット分割/選択回路103A、不一致テーブル103B1〜103B4、ANDゲート103C、処理部103D、及びインバータ103Eから成る。図2は、照合データの長さを32ビット長とし、8ビットずつ4分割にした例である。
[Configuration of mismatch judgment circuit]
The configuration of the
この実施の形態では、不一致テーブル103B(103B1〜103B4)はメモリで構成される。各登録データの上位8ビットを不一致テーブル103B1に割り当て、次の8ビットを不一致テーブル103B2に、更に次の8ビットを不一致テーブル103B3に、下位8ビットを不一致テーブル103B4に割り当てている。この例では、8ビットに分割しているので、不一致テーブル103Bは256ワード×1ビットの構成をとる。 In this embodiment, the mismatch table 103B (103B1 to 103B4) is configured by a memory. The upper 8 bits of each registered data are assigned to the mismatch table 103B1, the next 8 bits are assigned to the mismatch table 103B2, the next 8 bits are assigned to the mismatch table 103B3, and the lower 8 bits are assigned to the mismatch table 103B4. In this example, since it is divided into 8 bits, the mismatch table 103B has a configuration of 256 words × 1 bit.
不一致テーブル103B1のアドレスは登録データの上位8ビットの値に対応し、そのアドレスの値が登録データの対応する8ビットの値として含まれている場合、不一致テーブル103B1の対応するアドレスに「一致」の判定を書き込む。この例では「1」を割り当てる。登録データに含まれていなければ、「不一致」の判定を書き込む。この例では「0」を割り当てる。不一致テーブル103B2〜103B4についても同様である。 The address of the mismatch table 103B1 corresponds to the upper 8-bit value of the registration data, and when the address value is included as the corresponding 8-bit value of the registration data, “match” to the corresponding address of the mismatch table 103B1. Write the decision. In this example, “1” is assigned. If it is not included in the registered data, the determination of “mismatch” is written. In this example, “0” is assigned. The same applies to the mismatch tables 103B2 to 103B4.
不一致テーブル103B1の構成例を図3に示す。図3では、「登録条件1(登録データ1)」の上位8ビットの値は「1」であるので、不一致テーブル103B1のアドレス「1」に「1」(一致)が格納される。「登録条件2(登録データ2)」では、上位8ビットの値が「10」なので、不一致テーブル103B1のアドレス「10」に「1」(一致)が格納される。なお、「登録条件1(登録データ1)」および「登録条件2(登録データ2)」中の数字は、8ビット列の値を10進数で表したものである。 A configuration example of the mismatch table 103B1 is shown in FIG. In FIG. 3, since the value of the upper 8 bits of “registration condition 1 (registration data 1)” is “1”, “1” (match) is stored at address “1” of the mismatch table 103B1. In “registration condition 2 (registered data 2)”, since the value of the upper 8 bits is “10”, “1” (match) is stored at address “10” of the mismatch table 103B1. The numbers in “Registration condition 1 (registration data 1)” and “registration condition 2 (registration data 2)” are values of 8-bit strings expressed in decimal numbers.
〔不一致判定回路の基本動作〕
次に、不一致回路103の基本動作を説明する。バッファ回路101からの照合データは、ビット分割/選択回路103Aに送られる。バッファ回路101からの判定開始信号は処理部103Dに送られる。
[Basic operation of the mismatch judgment circuit]
Next, the basic operation of the
照合データが入力されると、ビット分割/選択回路103Aは、入力された照合データから各8ビットを選択して、上位8ビットを不一致テーブル103B1に、次の8ビットを不一致テーブル103B2へというように、各不一致テーブル103Bへ出力する。
When collation data is input, the bit division /
各不一致テーブル103Bでは、ビット分割/選択回路103Aから送られた各8ビットの値がアドレスとして入力され、そのアドレスに格納されているデータが読み出される。この各不一致テーブル103Bからの読出しは、判定開始信号を受けた処理部103Dの指示に従って行われる。
In each mismatch table 103B, each 8-bit value sent from the bit division /
この時、4つの不一致テーブル103Bから読み出されたデータに、一つでも「0」即ち「不一致」の判定があれば、ANDゲート103Cは不一致の判定である「0」を出力する。読み出されたデータが全て「1」、つまり全てが「一致」の判定であった場合には、ANDゲート103Cは一致の判定である「1」を出力する。このANDゲート103Cからの一致/不一致の判定は、インバータ103Eによって反転されて、ORゲート104(図1)を通過し、バッファ回路101へ送られる。
At this time, if any of the data read from the four mismatch tables 103B has a determination of “0”, that is, “mismatch”, the AND
この例では、上位8ビット、次の8ビットと言うように順次分割選択しているが、ビットの順序や各ビットの選択はこれに限るものではない。必要に応じて、任意の8ビットを選択的に抽出して各不一致テーブル103Bに出力するように構成することは容易である。また8ビットである必要も無い。 In this example, the upper 8 bits and the next 8 bits are selected and divided sequentially, but the order of bits and the selection of each bit are not limited to this. It is easy to configure so that arbitrary 8 bits are selectively extracted and output to each mismatch table 103B as necessary. There is no need for 8 bits.
〔一致判定回路の構成〕
次に、一致判定回路102の構成を図4に示す。一致判定回路102は、索引テーブル102A、条件テーブル102B、レジスタ群102C、比較器102D、セレクタ102E1〜102E3、及び処理部102F等から成る。索引テーブル102A、条件テーブル102Bは、本実施の形態ではメモリで構成される。また、この例において、照合データは32ビット長で、条件テーブル102Bには登録データを最大512個まで登録できるものとしている。
[Configuration of coincidence determination circuit]
Next, the configuration of the
条件テーブル102Bの構成を図5に示す。条件テーブル102Bは判定するための一致条件を登録データ(登録条件)として格納しておくテーブルである、この実施の形態では、登録データを最大512個登録できるものとしている。従って、条件テーブル102Bのワード数は512であり、このワードを指定するメモリのアドレスは9ビット長になる。 The configuration of the condition table 102B is shown in FIG. The condition table 102B is a table for storing matching conditions for determination as registration data (registration conditions). In this embodiment, a maximum of 512 pieces of registration data can be registered. Accordingly, the number of words in the condition table 102B is 512, and the address of the memory that designates this word is 9 bits long.
まず、512個の登録データを全32ビットの内の上位8ビットの値で分類する。上位8ビットの値が共通である登録データを1つのグループとみなす。例えば、上位8ビットの値が「a」の登録データが2つあるとすると、これを「条件a0」,「条件a1」で表す。以下では、これらを、簡単に「a0」,「a1」と表すこともある。「条件b0」,「条件c0」等も同様である。 First, 512 pieces of registration data are classified by the upper 8 bits of all 32 bits. Registration data having the same value of the upper 8 bits is regarded as one group. For example, if there are two pieces of registered data whose upper 8 bits are “a”, these are represented by “condition a0” and “condition a1”. Hereinafter, these may be simply expressed as “a0” and “a1”. The same applies to “condition b0”, “condition c0”, and the like.
条件テーブル102Bのデータは、4つのフィールドに分割される。第1のフィールドは1ビット幅で、そのワードが登録データを格納しているかどうかを表すビットである。これをVB(Valid Bit)と呼び、登録データが格納されているとき「1」、格納されていないとき「0」を割り当てる。 The data in the condition table 102B is divided into four fields. The first field is 1 bit wide and indicates whether or not the word stores registration data. This is called VB (Valid Bit), and “1” is assigned when registration data is stored, and “0” is assigned when it is not stored.
第2のフィールドをFLT(条件)フィールドと呼び、登録データを格納する。この実施の形態では、照合データを32ビットとしているので、32ビットがこのフィールドに割り当てられる。第3のフィールドには1ビットを割り当て、同じグループに属する登録データが、以降のアドレスに格納されているかどうかを表す。このビットをNF(Next Flag)フィールドと呼び、格納されていればNFフィールドに「1」を格納し、第4のフィールドであるNA(Next Address)フィールドに、次の登録データが格納されているアドレスを格納する。他のアドレスに同じグループに属する登録データが格納されていなければ、NFフィールドには「0」を格納し、NAフィールドには「0」を格納する。従って、NAフィールドは1ビット幅、NAフィールドは9ビット幅である。 The second field is called an FLT (condition) field and stores registration data. In this embodiment, since the verification data is 32 bits, 32 bits are assigned to this field. One bit is assigned to the third field to indicate whether registered data belonging to the same group is stored in the subsequent addresses. This bit is called an NF (Next Flag) field. If it is stored, “1” is stored in the NF field, and the next registration data is stored in the NA (Next Address) field, which is the fourth field. Stores an address. If registration data belonging to the same group is not stored in another address, “0” is stored in the NF field, and “0” is stored in the NA field. Therefore, the NA field is 1 bit wide and the NA field is 9 bits wide.
図5に示した条件テーブル102Bの内容について具体的に説明する。まず、第1行(条件テーブル102Bの0番地)はVB=1となっており、このアドレスには登録データが格納されていることを表す。この場合、その登録データはFLTフィールドに格納されており、「条件a0」であることが分かる。次のNFフィールドは「1」なので、上位8ビットが「a」である登録データが、まだこの条件テーブル102Bに格納されていることを示している。NAフィールドが「2」となっているので、次の登録データは条件テーブル102Bの2番地のところに格納されていることになる。そこで、2番地を見ると、VB=1となっており、FLTフィールドには「条件a1」が格納されていることが分かる。第3のフィールドである、NFフィールドは「0」となっており、このグループに属する登録データはこれ以上存在しないことが分かる。この場合、NAフィールドには「0」を割り当てる。「条件b」、「条件c」についても同様である。
The contents of the condition table 102B shown in FIG. 5 will be specifically described. First, the first row (
次に、アドレスの510番地について説明する。VB=0であるので、このアドレスには登録データは格納されていないことを表す。この場合、NFフィールドには「1」を設定し、NAフィールドには、以降のワードで登録データが格納されていない最初の空きアドレスが格納される。ここでは、「511」が格納されているので、次の空きアドレスは511番地であることを示す。FLTフィールドの値は任意である。
Next,
次に、索引テーブル102Aの構成を説明する。図6にその構成を示す。索引テーブル102Aは、照合データの上位8ビットの値をアドレスとするメモリである。従って256ワードからなる。各ワードは、1ビット幅のMF(Match Flag)フィールドと9ビット幅のIA(Index Address)フィールドからなる。索引テーブル102Aにおいて、例えばそのアドレス「a」には、上位8ビットの値が「a」である登録データが、条件テーブル102Bに格納されているかどうかの情報、およびそれに付随する情報が格納される。 Next, the configuration of the index table 102A will be described. FIG. 6 shows the configuration. The index table 102A is a memory whose address is the value of the upper 8 bits of the collation data. Therefore, it consists of 256 words. Each word includes a 1-bit wide MF (Match Flag) field and a 9-bit wide IA (Index Address) field. In the index table 102A, for example, the address “a” stores information indicating whether or not the registration data whose upper 8 bits are “a” is stored in the condition table 102B, and information associated therewith. .
索引テーブル102Aにおいて、アドレス「a」のフィールドMFの値は、上位8ビットの値が「a」である登録データが、条件テーブル102Bに存在しているか否かを示している。すなわち、アドレス「a」のフィールドMFの値が「1」であれば、上位8ビットの値が「a」である登録データが、条件テーブル102Bに存在していることを意味している。アドレス「a」のIAフィールドには、上位8ビットの値が「a」である登録データのうち、最初に比較される登録データが格納されている条件テーブル102Bのアドレスが格納される。上位8ビットの値が「a」である登録データが条件テーブル102Bに存在していなければ、索引テーブル102Aの「a」番地には、MF=0,IA=0を設定する。 In the index table 102A, the value of the field MF at the address “a” indicates whether or not the registration data whose upper 8 bits are “a” exists in the condition table 102B. That is, if the value of the field MF of the address “a” is “1”, it means that registered data whose upper 8 bits are “a” exists in the condition table 102B. In the IA field of the address “a”, the address of the condition table 102B in which the registration data to be compared first among the registration data whose upper 8 bits are “a” is stored. If registration data whose upper 8 bits are “a” does not exist in the condition table 102B, MF = 0 and IA = 0 are set in the “a” address of the index table 102A.
例えば、索引テーブル102Aのアドレス「0」をみるとMF=1になっているので、上位8ビットの値が「0」である登録データが条件テーブル102Bに存在していることを示している。IAフィールドの値は「1」となっているので、最初に比較される登録データは、条件テーブル102Bの1番地に格納されていることになる。
For example, when the address “0” in the index table 102A is viewed, MF = 1, indicating that registered data whose upper 8 bits are “0” exists in the condition table 102B. Since the value of the IA field is “1”, the first registered data to be compared is stored at
尚、索引テーブル102AのMFフィールドは不一致判定回路103の不一致テーブル103B1と同じである。従って、不一致判定回路103の不一致テーブル103B1は省略することもできる。或は、逆に索引テーブル102AのMFフィールドは削除し、不一致判定回路103の不一致テーブル103B1で代用することも可能である。
Note that the MF field of the index table 102A is the same as the mismatch table 103B1 of the
〔一致判定回路の基本動作〕
次に、一致判定回路102の基本動作を説明する。バッファ回路101からの照合データは、その全ビットが比較器102Dに、上位8ビットが索引テーブル102Aに送られる。バッファ回路101からの判定開始信号は処理部102Fに送られる。以下の処理動作は、判定開始信号を受けた処理部102Fの指示に従って行われる。
[Basic operation of coincidence determination circuit]
Next, the basic operation of the
今、照合データの上位8ビットの値が「a」であったとする。この場合、まず、図6に示す索引テーブル102Aの「a」番地がアクセスされ、データが読み出される。この例において、読み出されたデータのうちMFフィールドの値は「1」であるので、上位8ビットの値が「a」である登録データが条件テーブル102Bに存在していることが分かり、読み出されたデータのうちIAフィールドの値「0」が条件テーブル102Bに出力される。 Now, it is assumed that the value of the upper 8 bits of the collation data is “a”. In this case, first, the address “a” in the index table 102A shown in FIG. 6 is accessed, and the data is read out. In this example, since the value of the MF field is “1” in the read data, it can be seen that registered data whose upper 8 bits are “a” exists in the condition table 102B. Of the output data, the value “0” of the IA field is output to the condition table 102B.
図5の条件テーブル102Bでは、索引テーブル102Aから出力されたIAフィールドの値「0」が、今度は条件テーブル102Aのアドレス「0」として使用され、0番地のデータが読み出される。このとき、VB=1であるから、この登録データは有効であり、FLTフィールドのデータ、つまり登録データとして格納されている「条件a0」が比較器102Dに送られる。これにより、比較器102Dは、バッファ回路101からの照合データと「条件a0」とを比較し、一致/不一致を判定する。一致と判定すれば、判定処理は終了する。
In the condition table 102B of FIG. 5, the value “0” of the IA field output from the index table 102A is used as the address “0” of the condition table 102A, and data at
不一致と判定された場合は、条件テーブル102Bで読み出された0番地のNFフィールドの値を参照する。図5では、NF=1であるので、上位8ビットの値が「a」である登録データがまだ存在することが分かり、その登録データが格納されている条件テーブル102Bのアドレス「2(=NA)」を、自分自身である条件テーブル102Bのアドレスとして出力させる。これにより、条件テーブル102Bの2番地のFLTフィールドから「条件a1」が読み出され、比較器102Dに送られる。比較器102Dは、バッファ回路101からの照合データと「条件a1」とを比較し、一致/不一致を判定する。一致と判定すれば、判定処理は終了する。
When it is determined that they do not match, the value of the NF field at
不一致と判定された場合は、条件テーブル102Bの2番地のNFフィールドのデータを参照する。図5ではNF=0となっており、上位8ビットの値が「a」である登録データは他に存在しないと判定され、判定処理が終了する。判定処理が終了すると、次のパケットの処理に移行する。
If it is determined that they do not match, the data in the NF field at
〔各種テーブルの自動更新〕
次に、この一致判定回路102、不一致判定回路103を有したパケットフィルタ回路100で、本実施の形態の特徴的な機能である不一致テーブル103B、索引テーブル102A、条件テーブル102Bの自動更新機能について説明する。
[Automatic update of various tables]
Next, the automatic update function of the mismatch table 103B, the index table 102A, and the condition table 102B, which is a characteristic function of the present embodiment, in the
この自動更新機能は、パケットフィルタ回路100の照合データと登録データとの一致/不一致の判定機能を利用して、不一致テーブル103B、索引テーブル102A、条件テーブル102Bを自動的に生成或は削除をする機能である。図1におけるモード選択信号、図4におけるレジスタ群102Cは、この自動更新機能を実現するために設けられたものである。
This automatic update function automatically generates or deletes the mismatch table 103B, the index table 102A, and the condition table 102B using the matching / mismatch determination function between the matching data and the registration data of the
レジスタ群102Cの構成を図7に示す。レジスタ群102Cは、WADRレジスタ102C1、tmpレジスタ102C2、MCDレジスタ102C3、CADRレジスタ102C4、BADRレジスタ102C5から成る。WADRレジスタ102C1、tmpレジスタ102C2、MCDレジスタ102C3は1ビット幅のNFフィールド、9ビット幅のNAフィールドから成る。CADRレジスタ102C4、BADRレジスタ102C5は9ビット幅のNAフィールドのみから成る。
FIG. 7 shows the configuration of the
〔初期化モード〕
まず、初期化モードについて説明する。このモードは、不一致テーブル103B、索引テーブル102A、条件テーブル102B、レジスタ群102Cを初期化するものである。モード選択信号を初期化モードに設定し、クロックを入力するだけで自動的に初期化が行われる。この初期化はカウンタ等の小規模ハードウエアで実現できる。
(Initialization mode)
First, the initialization mode will be described. In this mode, the mismatch table 103B, the index table 102A, the condition table 102B , and the
図2に示した不一致判定回路103では、モード選択信号に従う処理動作を行わせるハードウェア構成を、処理部103Dに設けている。また、図4に示した一致判定回路102では、モード選択信号に従う処理動作を行わせるハードウェア構成を、処理部102Fに設けている。
In the
図8に初期化された不一致テーブル103B1〜103B4の状態を示す。処理部103Dは、モード選択信号が初期化モードとして入力されると、不一致テーブル103B1〜103B4の全てのアドレスに対して格納データを「0」すなわち「不一致」に設定する。
FIG. 8 shows the states of the mismatch tables 103B1 to 103B4 that have been initialized. When the mode selection signal is input as the initialization mode, the
図9(a),(b),(c)に初期化された索引テーブル102A、条件テーブル102B、レジスタ群102Cの状態を示す。処理部102Fは、モード選択信号が初期化モモードとして入力されると、索引テーブル102A、条件テーブル102B、レジスタ群102Cを初期化する。
FIGS. 9A, 9B, and 9C show the states of the index table 102A, the condition table 102B, and the
この初期化によって、索引テーブル102Aでは、全てのアドレスに対して「0」が格納される。条件テーブル102Bでは、全てのアドレスに対して、VBフィールドとFLTフィールドには「0」が設定される。NFフィールドはアドレス「511」に対してのみ「0」が設定され、それ以外のアドレスでは「1」が設定される。NAフィールドはアドレス「511」に対してのみ「0」が設定され、それ以外のアドレスにはそのアドレスより1大きい値が設定される。レジスタ群102Cでは、WADRレジスタ102C1のNFフィールドに「1」が設定され、それ以外には全て「0」が設定される。
By this initialization, “0” is stored for all addresses in the index table 102A. In the condition table 102B, “0” is set in the VB field and the FLT field for all addresses. In the NF field, “0” is set only for the address “511”, and “1” is set for other addresses. In the NA field, “0” is set only for the address “511”, and a
〔登録モード〕
次に、条件を登録する動作モードである登録モードについて説明する。モード選択信号を登録モードに設定し、順次、登録させたい条件(登録候補のデータ)を含むパケットをパケットフィルタ回路100に入力する。これにより、既に述べた一致判定回路102での一致/不一致の判定処理の動作に従って、入力された登録候補のデータが順次条件テーブル102Bに自動的に格納され、同時に付随するアドレス等が必要に応じて各テーブルに格納される。不一致判定回路103でも、入力された登録候補のデータについて、登録データの有無を示す情報が不一致テーブル103B1〜103B4に格納される。以下、この登録モードとした場合の具体的な動作について説明する。
[Registration mode]
Next, a registration mode that is an operation mode for registering conditions will be described. The mode selection signal is set to the registration mode, and packets including conditions (registration candidate data) to be registered are sequentially input to the
先ず、各テーブルが図8、図9のように初期化された状態で、最初の「条件a0」を登録する場合を説明する。登録候補のデータである「条件a0」を含むパケットがパケットフィルタ回路100に入力されると、バッファ回路101を経由して、「条件a0」が不一致判定回路103、一致判定回路102に入力される。最初の登録候補のデータであるから、不一致判定回路103、一致判定回路102は判定動作に従って、ともに不一致と判定する。一致判定回路102が不一致と判定した時点で、すなわち比較器102Dが不一致と判定した時点で、各種テーブルの更新が開始される。この登録モードでは不一致判定回路103の判定結果は無視される。
First, a case where the first “condition a0” is registered in a state where each table is initialized as shown in FIGS. 8 and 9 will be described. When a packet including “condition a0” that is registration candidate data is input to the
以下、図10を参照して、一致判定回路102の動作および各テーブルの更新手順を詳細に説明する。以下の(1)、(2)等の順序は図10中のそれに対応する。また、この動作はモード選択信号(登録モード)を受けた処理部102Fの指示に従って行われる。
Hereinafter, the operation of the
(1)「条件a0」は上位8ビットの値が「a」であるから、索引テーブル102Aの「a」番地がアクセスされる(図16:ステップS101)。この場合、「a」番地のMFフィールドは「0」なので、不一致と判定される(ステップS102のYES)。これにより、分岐(I)へ処理が移る(ステップS103)。分岐(I)のフローチャートを図17に示す。分岐(I)の処理では、レジスタ群102CのWADRレジスタ102C1のNAフィールドの値「0」が条件テーブル102Bに送られ、条件テーブル102Bの0番地のデータが読み出される(ステップS101)。
(1) Since the value of the upper 8 bits of “condition a0” is “a”, the address “a” in the index table 102A is accessed (FIG. 16: step S101). In this case, since the MF field at address “a” is “0”, it is determined that there is a mismatch (YES in step S102). Thereby, the processing moves to branch (I) (step S103). A flowchart of branch (I) is shown in FIG. In the branch (I) process, the value “0” of the NA field of the WADR register 102C1 of the
(2)条件テーブル102Bから読み出されたデータのうち、NF,NAフィールドの値をレジスタ群102Cのtmpレジスタ102C2に保存する(ステップS102)。従って、tmpレジスタ102C2の値(NF,NA)は(0,0)から(1,1)に更新される。
(2) Of the data read from the condition table 102B, the values of the NF and NA fields are stored in the tmp register 102C2 of the
(3)次に、レジスタ群102CのWADRレジスタ102C1のNF,NAフィールドの値を、それぞれ索引テーブル102Aの「a」番地のMFフィールド、IAフィールドにコピーする(ステップS203)。これにより、索引テーブル102Aの「a」番地の値(MF,IA)は(0,0)⇒(1、0)と更新される。
(3) Next, the values of the NF and NA fields of the WADR register 102C1 of the
(4)レジスタ群102CのWADRレジスタ102C1のNAフィールドには「0」即ち0番地が記憶されているので、この値をもとに条件テーブル102Bの0番地をアクセスし、各フィールド(VB,FLT,NF,NA)の値を(0,0,1,1)から(1、条件a0,0,0)と更新する(ステップS204)。これは、条件テーブル102Bの0番地は有効であり、登録データとして「条件a0」が格納されていることを表している。上位8ビットの値が「a」である条件は、まだ存在していないので、NF=0、NA=0と設定される。
(4) Since “0”, that is,
(5)最後に、tmpレジスタ102C2のNF,NAフィールドの値をWADRレジスタ102C1のNF,NAフィールドにコピーする(ステップS205)。これにより、WADRレジスタ102C1の値は(NF,NA)=(1,1)となり、次の登録に備えられる。この場合、次の登録時には、WADRレジスタ102C1のNAフィールドの値をアドレスとし、このアドレスで示される条件テーブル102Bの1番地に登録データが書き込まれることになる。 (5) Finally, the values of the NF and NA fields of the tmp register 102C2 are copied to the NF and NA fields of the WADR register 102C1 (step S205). As a result, the value of the WADR register 102C1 becomes (NF, NA) = (1, 1), and is prepared for the next registration. In this case, at the time of the next registration, the value of the NA field of the WADR register 102C1 is used as an address, and the registration data is written to address 1 of the condition table 102B indicated by this address.
以上の手順から、WADRレジスタ102C1のデータは、条件テーブル102Bにおいて、まだ登録データが書き込まれていない最小のアドレス、つまり空きアドレスの内最も小さいアドレスを意味していることが分かる。登録候補のデータを登録するときにはこのアドレスに書き込むことになる。初期化により、WADRレジスタ102C1のNAフィールドは「0」としているので、最初の登録データは0番地に格納されるように設定されていたことになる。従って、この例では、最初の「条件a0」が条件テーブル102Bの0番地に格納された訳である。また、WADRレジスタ102C1のNAフィールドの値を、索引テーブル102Aの「a」番地のIAフィールドにコピーすればよいことになる。
From the above procedure, it can be seen that the data in the WADR register 102C1 means the smallest address in the condition table 102B to which the registered data has not yet been written, that is, the smallest address among the free addresses. When registering registration candidate data, it is written to this address. Since the NA field of the WADR register 102C1 is set to “0” by initialization, the first registration data is set to be stored at
一方、不一致判定回路103では、ビット分割/選択回路103Aによって「条件a0」の各8ビットの値をアドレスとして、不一致テーブル103B1〜103B4のアドレスにデータ「1」が書き込まれる。これで、不一致テーブル103B1〜103B4の更新は完了する。この動作はモード選択信号(登録モード)を受けた処理部103Dの指示に従って行われる。新たな条件を登録するときにも、同じ動作をさせる。既に「1」が書かれていても、「1」を書き込むことになるが、なんら問題がないことは当然である。従って、以下では不一致テーブル103Bの更新については説明を省略する。
On the other hand, in the
次に、図11を参照して、「条件b0」を登録する場合を説明する。この例では、説明の都合上、b=1とする。これは「条件a0」の登録と基本的には同じである。従って、図16に示したステップS102のYESに応じて、分岐(I)へ移り(ステップS103)、図17に示した分岐(I)の処理が行われることになる。 Next, a case where “condition b0” is registered will be described with reference to FIG. In this example, b = 1 for convenience of explanation. This is basically the same as the registration of “condition a0”. Therefore, in response to YES in step S102 shown in FIG. 16, the process proceeds to branch (I) (step S103), and the process of branch (I) shown in FIG. 17 is performed.
(1)「条件b0」は上位8ビットの値が「1」であるから、索引テーブル102Aの1番地がアクセスされる(図16:ステップS101)。この場合、1番地のMFフィールドはMF=0なので、不一致と判定される(ステップS102のYES)。これにより、分岐(I)へ処理が移る(ステップS103)。分岐(I)の処理(図17)では、レジスタ群102CのWADRレジスタ102C1のNAフィールドの値「1」が条件テーブル102Bに送られ、条件テーブル102Bの1番地のデータが読み出される(ステップS101)。
(1) Since the value of the upper 8 bits of “condition b0” is “1”,
(2)条件テーブル102Bから読み出されたデータのうち、NF,NAフィールドの値をレジスタ群102Cのtmpレジスタ102C2に保存する。従って、tmpレジスタ102C2の値(NF,NA)は(1,1)から(1,2)に更新される。
(2) Of the data read from the condition table 102B, the values of the NF and NA fields are stored in the tmp register 102C2 of the
(3)次に、WADRレジスタ102C1のNF,NAフィールドの値を、それぞれ索引テーブル102Aの1番地のMF,IAフィールドにコピーする(ステップS203)。これにより、索引テーブル102Aの1番地の値(MF,IA)は(0,0)⇒(1、1)と更新される。
(3) Next, the values of the NF and NA fields of the WADR register 102C1 are copied to the MF and IA fields at
(4)WADRレジスタ102C1のNAフィールドには「1」即ち1番地が記憶されているので、この値をもとに条件テーブル102Bの1番地をアクセスし、各フィールド(VB,FLT,NF,NA)の値を(0,0,1,2)から(1、条件b0,0,0)と更新する(ステップS204)。
(4) Since the NA field of the WADR register 102C1 stores “1”, that is,
(5)最後に、tmpレジスタ102C2のNF,NAフィールドの値をWADRレジスタ102C1のNF,NAフィールドにコピーする(ステップS205)。これにより、WADRレジスタ102C1の値は(NF,NA)=(1,2)となり、次の登録に備えられる。この場合、次の登録時には、WADRレジスタ102C1のNAフィールドの値をアドレスとし、このアドレスで示される条件テーブル102Bの2番地に登録データが書き込まれることになる。 (5) Finally, the values of the NF and NA fields of the tmp register 102C2 are copied to the NF and NA fields of the WADR register 102C1 (step S205). As a result, the value of the WADR register 102C1 becomes (NF, NA) = (1, 2), and is prepared for the next registration. In this case, at the time of the next registration, the value of the NA field of the WADR register 102C1 is used as an address, and the registration data is written in the second address of the condition table 102B indicated by this address.
次に、登録モードの最後として、上位8ビットの値が「a」で、他のビットが異なる「条件a1」を登録する場合について説明する。 Next, as the last of the registration mode, a case will be described in which “condition a1” in which the value of the upper 8 bits is “a” and other bits are different.
この場合、上位8ビットの値が「a」なので、索引テーブル102Aの「a」番地をアクセスする。索引テーブル102Aの「a」番地のMFフィールドの値は「1」なので、一致と判定される。これにより、索引テーブル102AのIAフィールドの値「0」をもとに、条件テーブル102Bの0番地がアクセスされ、0番地から読み出された「条件a0」が比較器102Dに送られる。
In this case, since the value of the upper 8 bits is “a”, the address “a” in the index table 102A is accessed. Since the value of the MF field at address “a” in the index table 102A is “1”, it is determined that they match. Thereby, based on the value “0” of the IA field of the index table 102A, the 0 address of the condition table 102B is accessed, and the “condition a0” read from the 0 address is sent to the
比較器102Dには「条件a1」が入力されている。「条件a0」と「条件a1」は異なっているとしているので、比較器102Dは不一致と判定する。この場合、NF=0なので、上位8ビットの値が「a」である登録データは、これが最後であることを示している。この時点で、「条件a1」は登録されるべきデータと判断され、各テーブルの更新が開始される。もし、「条件a1」が「条件a0」が同じであれば、比較器102Dで一致と判定され、この時点で処理は終了する。
“Condition a1” is input to the
以下、この「条件a1」を登録する手順を、「条件a0」と「条件b0」が登録された時点のテーブルを出発点として、図12を参照して詳細に説明する。 Hereinafter, the procedure for registering “condition a1” will be described in detail with reference to FIG. 12, starting from a table at the time when “condition a0” and “condition b0” are registered.
(1)「条件a1」は上位8ビットの値が「a」であるから、索引テーブル102Aの「a」番地がアクセスされる(図16:ステップS101)。この場合、「a」番地のMFフィールドはMF=1なので(ステップS103のNO)、一致と判定される。これにより、「a」番地のIAフィールドの値「0」をアドレスとして(ステップS104)、条件テーブル102Bの0番地のデータがリードされる(ステップS105)。そして、リードされたデータの内、FLTフィールドのデータである「条件a0」が比較器102Dに送られ、入力されている「条件a1」と比較される(ステップS106)。この場合、比較器102Dは、不一致と判定する(ステップS106のNO)。
(1) Since the value of the upper 8 bits of “condition a1” is “a”, the address “a” in the index table 102A is accessed (FIG. 16: step S101). In this case, since the MF field of the address “a” is MF = 1 (NO in step S103), it is determined that they match. As a result, the value “0” in the IA field at address “a” is used as an address (step S104), and data at
(2)この時、読み出された条件テーブル102Bの「a」番地のNFフィールドの値は「0」なので(ステップS107のYES)、上位8ビットの値が「a」である登録データはこれが最後であることが分かる。この時点で、判定が終了し、「条件a1」が登録すべきデータであると判断される。これにより、分岐(II)へ処理が移る(ステップS108)。分岐(II)のフローチャートを図18に示す。分岐(II)の処理では、不一致と判定された最後の登録データ、この場合「条件a0」が格納されていた条件テーブル102Bのアドレス「0」をCADRレジスタ102C4に保存する(ステップS301)。 (2) At this time, since the value of the NF field at address “a” in the read condition table 102B is “0” (YES in step S107), this is the registered data whose upper 8 bits are “a”. It turns out that it is the last. At this point, the determination is completed, and it is determined that “condition a1” is data to be registered. Thereby, the processing moves to branch (II) (step S108). A flowchart of the branch (II) is shown in FIG. In the branch (II) process, the last registered data determined to be inconsistent, in this case, the address “0” of the condition table 102B storing “condition a0” is stored in the CADR register 102C4 (step S301).
(3)「条件a1」を格納すべき空きアドレスは、WADRレジスタ102C1のNAフィールドに格納されているので、この値「2」をもとに、条件テーブル102Bの2番地のデータを読み出し(ステップS302)、そのデータのうちNF,NAフィールドの値をtmpレジスタ102C2に保存する(ステップS303)。
(3) Since the empty address for storing “condition a1” is stored in the NA field of WADR register 102C1, the data at
(4)同じくWADRレジスタ102C1のNAフィールドの値をもとに、条件テーブル102Bの2番地にアクセスし、各フィールド(VB,FLT,NF,NA)の値を(0,0,1,3)から(1、条件a1,0,0)と更新する(ステップS304)。この場合、索引テーブル102Aの書き換えは必要ない。 (4) Similarly, based on the value of the NA field of the WADR register 102C1, the second address of the condition table 102B is accessed, and the value of each field (VB, FLT, NF, NA) is set to (0, 0, 1, 3). To (1, condition a1, 0, 0) (step S304). In this case, it is not necessary to rewrite the index table 102A.
(5)続いて、条件テーブル102Bで「条件a0」が格納されているところのNAフィールドの値を、「条件a1」が格納されているアドレスに変更する。この場合、「条件a0」を格納しているアドレスは、CADRレジスタ102C4に保存されているので、この値「0」を基に、条件テーブル102Bの0番地をアクセスし、WADRレジスタ102C1のNF,NAフィールドの値を、条件テーブル102BのNFフィールド,NAフィールドにコピーする(ステップS305)。 (5) Subsequently, the value of the NA field where “condition a0” is stored in the condition table 102B is changed to the address where “condition a1” is stored. In this case, since the address storing “condition a0” is stored in the CADR register 102C4, the address “0” in the condition table 102B is accessed based on this value “0”, and the NF, The value of the NA field is copied to the NF field and NA field of the condition table 102B (step S305).
(6)最後に、tmpレジスタ102C2のNFフィールド,NAフィールドの値をWADRレジスタ102C1のNFフィールド,NAフィールドにコピーし、次の空きアドレスとする(ステップS306)。これで、「条件a1」の登録が完了する。 (6) Finally, the values of the NF field and NA field of the tmp register 102C2 are copied to the NF field and NA field of the WADR register 102C1, and set as the next empty address (step S306). This completes the registration of “condition a1”.
図13(a),(b),(c)に「条件a0」、「条件b0」、「条件a1」の登録が完了した時点の索引テーブル102A、条件テーブル102B、レジスタ群102Cの状態を示す。
FIGS. 13A, 13B, and 13C show states of the index table 102A, the condition table 102B, and the
〔削除モード〕
次に、登録された条件を削除する動作モードである削除モードについて説明する。モード選択信号を削除モードに設定するとともに、削除したい条件(削除候補のデータ)を含むパケットをパケットフィルタ回路100に入力する。入力された削除候補のデータは既に登録されているはずなので、パケットフィルタ回路100は一致と判定する。この判定結果をもとに、各種テーブルを更新する。
[Delete Mode]
Next, a deletion mode that is an operation mode for deleting registered conditions will be described. The mode selection signal is set to the deletion mode, and a packet including a condition to be deleted (deletion candidate data) is input to the
例えば、図13の状態において、「条件a1」を削除するものとする。「条件a1」はバッファ回路101を経由して不一致判定回路103、一致判定回路102へ送られる。このモードにおいても不一致判定回路103の判定結果は考慮しない。この場合、一致判定回路102の索引テーブル102Aの「a」番地がアクセスされる。索引テーブル102Aの「a」番地のMFフィールドの値は「1」なので、一致と判定され、IAフィールドの値「0」を用いて、条件テーブル102Bの0番地がアクセスされる。0番地に格納されている「条件a0」が読み出され、入力されている「条件a1」と比較器102Dにおいて比較され、不一致と判定される。
For example, it is assumed that “condition a1” is deleted in the state of FIG. The “condition a1” is sent to the
このとき、0番地のNFフィールドの値は「1」であるので、上位8ビットの値が「a」である登録データがまだ存在する。条件テーブル102Bの0番地のNAフィールドの値を参照すると、NA=2なので、次に条件テーブル102Bの2番地がアクセスされる。これにより、2番地に格納されている「条件a1」が読み出され、入力されている「条件a1」と比較され、一致と判定される。一致と判定された時点で、この条件を削除することが決定される。この一致判定結果をもとに、索引テーブル102A、条件テーブル102Bを更新する。
At this time, since the value of the NF field at
この場合は、上位8ビットの値が「a」である「条件a0」が残っているので、索引テーブル102Aは書き換える必要はない。条件テーブル102Bでは、「条件a1」が格納されていたアドレスを空きアドレスとして、最終的にWADRレジスタ102C1に格納し、「条件a1」が格納されていたアドレスのNF,NAフィールドの値を、「条件a0」が格納されている番地のNF,NAフィールドにコピーすれば良い。付随して、適宜、他のフィールドのデータも書き換える。以下、この削除モードとした場合の具体的な動作について説明する。 In this case, since the “condition a0” whose upper 8 bits are “a” remains, the index table 102A need not be rewritten. In the condition table 102B, the address where “condition a1” is stored is finally stored in the WADR register 102C1 as an empty address, and the NF and NA field values of the address where “condition a1” is stored are “ What is necessary is just to copy to the NF and NA field of the address where "condition a0" is stored. Along with this, data in other fields is rewritten as appropriate. Hereinafter, a specific operation when the deletion mode is set will be described.
〔条件a1の削除〕
以下、「条件a1」を削除する場合の手順を、図13の状態を出発点とした図14を参照して詳細に説明する。ここでも、不一致判定回路103の判定結果は無視する。また、この実施の形態では、不一致判定回路103の不一致テーブル103Bは更新されないので、不一致判定回路103の動作については説明を省略し、一致判定回路102の動作および各テーブルの更新手順を説明する。この動作はモード選択信号(削除モード)を受けた処理部102Fの指示に従って行われる。
[Delete condition a1]
Hereinafter, the procedure for deleting “condition a1” will be described in detail with reference to FIG. 14 starting from the state of FIG. Again, the determination result of the
(1)「条件a1」はバッファ回路101を経由して一致判定回路102へ送られる。一致判定回路102の索引テーブル102Aの「a」番地のデータがリードされる(図19:ステップS401)。この場合、「a」番地のMFフィールドの値は「1」なので、一致と判定される(ステップS402のNO)。これにより、「a」番地のIAフィールドの値をアドレスとして(ステップS403)、条件テーブル102Bの0番地のデータがリードされる(ステップS404)。このときのアドレス「0」はCADRレジスタ102C4に保存される(ステップS403)。そして、リードされたデータの内、FLTフィールドのデータである「条件a0」が比較器102Dに送られ、入力されている「条件a1」と比較される(ステップS405)。この場合、比較器102Dは、不一致と判定する(ステップS405のNO)。
(1) “Condition a 1” is sent to the
(2)この時、条件テーブル102Bの0番地のNFフィールドの値は「1」なので(ステップS406のNO)、上位8ビットの値が「a」である登録データがまだ他に存在する。このため、0番地のNAフィールドの値「2」を参照して、次に条件テーブル102Bの2番地のデータがリードされる(ステップS407)。そして、リードされたデータの内、FLTフィールドのデータである「条件a1」が比較器102Dに送られ、入力されている「条件a1」と比較される(ステップS408)。この場合、比較器102Dは、一致と判定する(ステップS408のYES)。
(2) At this time, since the value of the NF field at
(3)一致と判定されたアドレスである「2」はCADRレジスタ102C4のNAフィールドに保存される(ステップS412)。同時に、CADRレジスタ102C4のNAフィールドの直前の値、即ち、一つ前に判定された登録データが格納されていた条件テーブル102Bのアドレス「0」は、BADRレジスタ102C5に移される(ステップS413)。 (3) “2”, which is the address determined to match, is stored in the NA field of the CADR register 102C4 (step S412). At the same time, the value immediately before the NA field of the CADR register 102C4, that is, the address “0” of the condition table 102B in which the registration data determined immediately before is stored is moved to the BADR register 102C5 (step S413).
(4)また、一致と判定された「条件a1」が格納されていた条件テーブル102Bの2番地のNF,NAフィールドの値をMCDレジスタ102C3に保存する(ステップS414)。そして、分岐(IV)の処理へ移る(ステップS415)。分岐(IV)の処理のフローチャートを図21に示す。
(4) Further, the values of the NF and NA fields at
(5)分岐(IV)の処理では、次に、CADRレジスタ102C4に保存されている一致と判定された「条件a1」が格納されていたアドレス「2」を用いて、条件テーブル102Bの2番地をアクセスし、この2番地のNF,NAフィールドに、WADRレジスタ102C1のNF,NAフィールドの値をコピーする。同時にVBフィールドの値を「1」→「0」,FLTフィールドの値を「条件a1」→「0」と書き換える(ステップS601)。これで、条件テーブル102Bの2番地は空きアドレスとなり、2番地の次の空きアドレスである3番地が設定されたことになる。 (5) In the branch (IV) processing, next, the second address of the condition table 102B is used by using the address “2” stored in the CADR register 102C4 and stored as the “condition a1”. And the values of the NF and NA fields of the WADR register 102C1 are copied to the NF and NA fields of the second address. At the same time, the value of the VB field is rewritten as “1” → “0”, and the value of the FLT field is rewritten as “condition a1” → “0” (step S601). As a result, the second address in the condition table 102B becomes a free address, and the third free address next to the second address is set.
(6)続いて、BADRレジスタ102C5に蓄えられているデータ「0」、即ち一つ前に判定を行った条件テーブル102Bのアドレスをもとに、条件テーブル102Bの0番地をアクセスし、0番地のNF,NAフィールドにMCDレジスタ102C3に保存されているNF,NAフィールドの値をコピーする(ステップS602)。
(6) Next, based on the data “0” stored in the BADR register 102C5, that is, the address of the condition table 102B that has been determined last time, the
続いて、tmpレジスタ102C2のNFフィールドの値を「1」に更新し、NAフィールドにCADRレジスタ102C4のNAフィールドの値をコピーする(ステップS603)。これにより、削除された「条件a1」が格納されていた番地のNF,NAフィールドの値を、「条件a0」が格納されている番地のNF,NAフィールドに移したことになる。 Subsequently, the value of the NF field of the tmp register 102C2 is updated to “1”, and the value of the NA field of the CADR register 102C4 is copied to the NA field (step S603). As a result, the value of the NF / NA field at the address where the deleted “condition a1” is stored is moved to the NF / NA field at the address where “condition a0” is stored.
(7)最後に、tmpレジスタ102C2のNF,NAフィールドの値をWADRレジスタ102C1のNF,NAフィールドにコピーして(ステップS604)、削除が完了する。WADRレジスタ102C1には、削除された登録データが格納されていた条件テーブル102Bのアドレスが保存され、次の空きアドレスとして使用される。 (7) Finally, the values of the NF and NA fields of the tmp register 102C2 are copied to the NF and NA fields of the WADR register 102C1 (step S604), and the deletion is completed. In the WADR register 102C1, the address of the condition table 102B in which the deleted registration data is stored is stored and used as the next empty address.
〔条件a0の削除〕
「条件a1」を削除する場合には、索引テーブル102Aを変更する必要は無かった。しかし、図13の状態で、最初に比較される「条件a0」を削除する場合は、索引テーブル102Aも変更しなければならない。この場合も、一致判定回路102の判定結果をもとに、各テーブルを更新することができる。
[Delete condition a0]
When deleting “condition a1”, there was no need to change the index table 102A. However, when the “condition a0” to be compared first in the state of FIG. 13 is deleted, the index table 102A must also be changed. Also in this case, each table can be updated based on the determination result of the
「条件a0」を削除する場合は、「条件a0」が格納されている条件テーブル102BのアドレスのNF,NAフィールドの値を索引テーブル102AのMF,IAフィールドに設定し、「条件a0」が格納されている条件テーブル102BのアドレスのNF,NAフィールドに現在の空きアドレス(WADRレジスタ102C1に格納されているアドレス)を移し、「条件a0」が格納されているアドレスをWADRレジスタ102C1に格納すればよい。 When deleting the “condition a0”, the NF and NA field values of the address of the condition table 102B storing the “condition a0” are set in the MF and IA fields of the index table 102A, and the “condition a0” is stored. If the current empty address (address stored in the WADR register 102C1) is moved to the NF and NA fields of the address in the condition table 102B that has been stored, and the address storing “condition a0” is stored in the WADR register 102C1 Good.
以下、図15を参照して、「条件a0」の削除の具体的な手順を説明する。ここでも、「条件a0」、「条件a1」、「条件b0」が登録されている状態(図13)を出発点とする。 Hereinafter, a specific procedure for deleting “condition a0” will be described with reference to FIG. Here again, the state (FIG. 13) in which “condition a0”, “condition a1”, and “condition b0” are registered is used as a starting point.
(1)「条件a0」はバッファ回路101を経由して一致判定回路102へ送られる。一致判定回路102の索引テーブル102Aの「a」番地のデータがリードされる(図19:ステップS401)。この場合、「a」番地のMFフィールドの値は「1」なので、一致と判定される(ステップS402のNO)。これにより、「a」番地のIAフィールドの値をアドレスとして(ステップS403)、条件テーブル102Bの0番地のデータがリードされる(ステップS404)。このときのアドレス「0」はCADRレジスタ102C4に保存される(ステップS403)。
(1) “Condition a 0” is sent to the
そして、リードされたデータの内、FLTフィールドのデータである「条件a0」が比較器102Dに送られ、入力されている「条件a0」と比較される(ステップS405)。この場合、比較器102Dは、一致と判定する(ステップS405のYES)。そして、一致と判定された条件テーブル102Bの0番地のNF,NAフィールドの値をMCDレジスタ102C3のNF,NAフィールドに保存し(ステップS410)、分岐(III)の処理へ移行する(ステップS411)。分岐(III)の処理のフローチャートを図20に示す。
Then, among the read data, “condition a0” which is data in the FLT field is sent to the
(2)分岐(III)の処理では、CADRレジスタ102C4のNAフィールドに保存されている一致と判定された条件のアドレス「0」を用いて、条件テーブル102Bの0番地をアクセスし、WADRレジスタ102C1のNF,NAフィールドの値(現在の空きアドレス)を、0番地のNF,NAフィールドにコピーする。また、VBフィールドの値を「1」→「0」,FLTフィールドの値を「条件a0」→「0」と書き換える(ステップS501)。この動作により、条件テーブル102Bの0番地は空きアドレス、0番地の次の空きアドレスは3番地と設定されたことになる。
(2) In the branch (III) process, the
(3)同時に、CADRレジスタ102C4のNAフィールドに保存されている、一致と判定された登録データが格納されていた条件テーブル102Bのアドレス「0」を、tmpレジスタ102C2のNAフィールドにコピーする。同時に、tmpレジスタ102C2のNFフィールドの値を1に設定する(ステップS502)。 (3) At the same time, the address “0” of the condition table 102B stored in the NA field of the CADR register 102C4 and storing the registered data determined to match is copied to the NA field of the tmp register 102C2. At the same time, the value of the NF field of the tmp register 102C2 is set to 1 (step S502).
(4)ついで、入力された登録データの上位8ビットの値である「a」を用いて、索引テーブル102Aの「a」番地をアクセスし、MCDレジスタ102C3のNF,NAフィールドに保存されているデータ、つまり削除された「条件a0」の次の「条件a1」が格納されている条件テーブル102Bのアドレスを、索引テーブル102AのMF,IAフィールドにコピーする(ステップS503)。 (4) Next, “a”, which is the upper 8 bits of the input registration data, is used to access the “a” address in the index table 102A and is stored in the NF and NA fields of the MCD register 102C3. The data, that is, the address of the condition table 102B storing the “condition a1” next to the deleted “condition a0” is copied to the MF and IA fields of the index table 102A (step S503).
(5)最後に、tmpレジスタ102C2のNF,NAフィールド値をWADRレジスタ102C1のNF,NAフィールドにコピーして(ステップS504)、「条件a0」の削除が完了する。WADRレジスタ102C1には、今削除された「条件a0」が格納されていた、条件テーブル102Bのアドレスである0番地が、格納されたことになる。次に、登録候補のデータを登録する場合は、条件テーブル102Bの0番地にそのデータが登録データとして格納されることになる。
(5) Finally, the NF and NA field values of the tmp register 102C2 are copied to the NF and NA fields of the WADR register 102C1 (step S504), and the deletion of the “condition a0” is completed. In the WADR register 102C1, the
〔リフレッシュモード〕
次に、リフレッシュモードについて説明する。上述した削除モードでは、不一致判定回路103の不一致テーブル103Bは更新されない。そのため、本来不一致であるはずのアドレスに、「一致」が設定されたまま残っている可能性がある。この状態の不一致テーブル103Bで通常の動作をさせると、本来不一致のパケットを一致と判定してしまうことになる。不一致判定回路103で一致と判定した場合には、最終的に一致判定回路102で判定されるため、判定結果に誤りは生じない。しかし、登録データの削除が積み重なると、一致判定回路102で最終判定されるパケットが増え、スループットが低下する可能性がある。それを防ぐため、条件テーブル102Bのデータをもとに不一致テーブル103Bの更新を行う。
[Refresh mode]
Next, the refresh mode will be described. In the above-described deletion mode, the mismatch table 103B of the
この動作は、モード選択信号をリフレッシュモードに設定することにより、このモード選択信号(リフレッシュモード)を受けた処理部102Fや103Dの指示に従って行われる。リフレッシュモードに設定されると、不一致テーブル103Bが図8のように初期化される。他のテーブルは変更されない。ついで、条件テーブル102Bの各番地のデータが順次読み出され、FLTフィールドのデータがビット分割選択回路103Aによって不一致テーブル103Bに送られる。
This operation is performed in accordance with instructions from the
この番地のVBフィールドの値を参照して、VB=1であれば、即ち登録された条件であると判断されると、各不一致テーブル103Bの対応するアドレスに、データ「1」を格納する。この動作が条件テーブル102Bの全てのアドレスに対して実行され、条件テーブル102Bに正しく対応した不一致テーブル103Bが構成される。このアドレスは8ビットのリングカウンタ等を用意することにより自動的に生成できる。 With reference to the value of the VB field at this address, if VB = 1, that is, if it is determined that the registered condition is satisfied, data “1” is stored in the corresponding address of each mismatch table 103B. This operation is executed for all addresses in the condition table 102B, and a mismatch table 103B that correctly corresponds to the condition table 102B is configured. This address can be automatically generated by preparing an 8-bit ring counter or the like.
これまで、モード選択信号の生成については、本発明においては本質的ではないので、詳細は触れなったが、モードの数に応じて適宜複数ビットを備えればよい。例えば、2ビットを用意し、(00)を通常のモード、(01)を登録モード、(10)を削除モード、(11)をリフレッシュモード、というように割り当てればよい。 Up to now, the generation of the mode selection signal is not essential in the present invention, and the details have been touched on, but a plurality of bits may be appropriately provided according to the number of modes. For example, two bits are prepared, and (00) is a normal mode, (01) is a registration mode, (10) is a deletion mode, and (11) is a refresh mode.
以上の説明から分かるように、本実施の形態によれば、パケットフィルタ回路100の照合データと登録データとの一致/不一致の判定動作およびそれを実現するハードウエアを利用して、パケットフィルタ回路100に含まれる各種のテーブルを自動的に作成、更新ができるようにしたため、テーブルを作成するためのソフトウェアや事前にテーブルを作成する手間が不要になった。
As can be seen from the above description, according to the present embodiment, the
なお、上述した実施の形態において、パケットフィルタ回路の各機能部は、CPU(中央演算装置)やメモリなどの記憶装置、インターフェースからなるコンピュータ(ハードウェア)にコンピュータプログラム(ソフトウェア)をインストールすることによって実現され、上述した各機能部は、上記のコンピュータの各種ハードウェア資源と上記コンピュータプログラムとが協働することによって実現される。 In the above-described embodiment, each functional unit of the packet filter circuit installs a computer program (software) in a computer (hardware) including a CPU (Central Processing Unit), a storage device such as a memory, and an interface. The functional units described above are realized by the various hardware resources of the computer and the computer program cooperating with each other.
また、上記のコンピュータプログラムは、コンピュータが読み取り可能な記録媒体や記憶装置に格納された状態で提供されても良く、電気通信回線を介して提供されても良い。 The computer program may be provided in a state stored in a computer-readable recording medium or storage device, or may be provided via an electric communication line.
〔実施の形態の拡張〕
本発明の実施の形態として一致判定回路102、不一致判定回路103を有するパケットフィルタ回路100について、各種テーブルの自動更新(登録・削除等)を説明したが、本発明はこの構成に限定されないことは言うまでも無い。
[Extension of the embodiment]
Although automatic update (registration / deletion, etc.) of various tables has been described for the
本発明の主旨は、パケットフィルタ回路100において、通常のパケットの判定動作およびそれを実現する回路を利用して、各種テーブルを自動的に更新する機能を実現することである。
The gist of the present invention is that the
例えば、図22に示した不一致判定回路を有さないパケットフィルタ回路200についても、図4に示したような構成を採用して、一致判定回路202における条件テーブルへの一致条件の登録や削除を行わせることが可能である。
For example, the
100…パケットフィルタ回路、101…バッファ回路、102…不一致判定回路、102A…索引テーブル、102B…条件テーブル、102C…レジスタ群、102C1…WADRレジスタ、102C2…tmPレジスタ、102C3…MCDレジスタ、102C4…CADRレジスタ、102C5…BADRレジスタ、102D…比較器、102E1〜102E3…セレクタ、102F…処理部、103…不一致判定回路、103A…ビット分割/選択回路、103(103B1〜103B4)…不一致テーブル、103C…ANDゲート、103D…処理部、103E…インバータ。
DESCRIPTION OF
Claims (3)
前記登録データが格納される登録データ格納手段と、
前記登録データ格納手段における前記登録データが格納されていないアドレスを含むアドレス情報を記憶するアドレス情報記憶手段と、
前記登録データ格納手段に格納されている登録データと前記照合データとを比較し一致/不一致の判定結果を得る比較手段と、
前記登録データ格納手段に格納されている登録データを更新する際に、前記登録データ格納手段に登録すべき登録候補のデータの入力を受けて、その登録候補のデータと前記登録データ格納手段に格納されている登録データとの比較を前記比較手段によって行わせ、不一致の判定結果が得られた場合、前記アドレス記憶手段に記憶されているアドレス情報に基づいて、前記入力された登録候補のデータを登録データとして前記登録データ格納手段に書き込む手段と、
前記登録データ格納手段に格納されている登録データを更新する際に、前記登録データ格納手段から削除すべき削除候補のデータの入力を受けて、その削除候補のデータと前記登録データ格納手段に格納されている登録データとの比較を前記比較手段によって行わせ、一致の判定結果が得られた場合、前記アドレス記憶手段に記憶されているアドレス情報に基づいて、前記入力された削除候補のデータと一致する登録データを前記登録データ格納手段から削除する手段と
を備えることを特徴とするデータ判定装置。 In the data determination device that determines whether or not the input verification data matches the registered data in the registered data group registered in advance,
Registration data storage means for storing the registration data;
Address information storage means for storing address information including an address where the registration data is not stored in the registration data storage means;
A comparison unit that compares the registration data stored in the registration data storage unit with the verification data to obtain a match / mismatch determination result;
When updating the registration data stored in the registration data storage means, the registration candidate data to be registered in the registration data storage means is input, and the registration candidate data and the registration data storage means are stored. If the comparison means performs comparison with the registered data and a determination result of inconsistency is obtained, the inputted registration candidate data is converted based on the address information stored in the address storage means. Means for writing in the registration data storage means as registration data ;
When updating the registration data stored in the registration data storage means, the deletion candidate data to be deleted is received from the registration data storage means, and the deletion candidate data and the registration data storage means are stored. If the comparison result is obtained by the comparison means and a coincidence determination result is obtained, based on the address information stored in the address storage means, the input deletion candidate data and And a means for deleting matching registration data from the registration data storage means .
前記照合データの一部の情報をアドレスとして該アドレスの値を一部の情報として含んでいる登録データが前記登録データ格納手段に格納されているか否かを示す情報を格納した登録データ有無情報格納手段と、
前記登録データ有無情報格納手段に格納されている情報に基づいて前記照合データが前記登録データ格納手段に格納されている登録データと一致していないことを判定する不一致判定手段と、
前記登録データ有無情報格納手段に格納されている情報を更新する際に、前記登録データ有無情報格納手段に格納されている情報を全て削除した後、前記登録データ格納手段に格納されている登録データを読み出し、この読み出した登録データの一部の情報をアドレスとして前記登録データ有無情報格納手段にアクセスし、このアクセスした登録データ有無情報格納手段のアドレスに、当該アドレスの値を一部の情報として含んでいる登録データが前記登録データ格納手段に格納されていることを示す情報を書き込む手段と
を備えることを特徴とするデータ判定装置。 In the data determination device according to claim 1,
Registered data presence / absence information storage storing information indicating whether or not registration data containing a part of information of the verification data as an address and the value of the address as part of information is stored in the registration data storage means Means,
A mismatch determination unit that determines that the verification data does not match the registration data stored in the registration data storage unit based on information stored in the registration data presence / absence information storage unit;
When updating the information stored in the registration data presence / absence information storage means, after deleting all the information stored in the registration data presence / absence information storage means, the registration data stored in the registration data storage means The registered data presence / absence information storage unit is accessed using a part of the read registration data as an address, and the value of the address is used as a part of the address of the accessed registration data presence / absence information storage unit. A data determination apparatus comprising: means for writing information indicating that registration data included is stored in the registration data storage means .
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2011273040A JP5920698B2 (en) | 2011-12-14 | 2011-12-14 | Data judgment device and data judgment program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2011273040A JP5920698B2 (en) | 2011-12-14 | 2011-12-14 | Data judgment device and data judgment program |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2013126058A JP2013126058A (en) | 2013-06-24 |
| JP5920698B2 true JP5920698B2 (en) | 2016-05-18 |
Family
ID=48777080
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2011273040A Expired - Fee Related JP5920698B2 (en) | 2011-12-14 | 2011-12-14 | Data judgment device and data judgment program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP5920698B2 (en) |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP3829794B2 (en) * | 2002-11-22 | 2006-10-04 | ソニー株式会社 | Information processing apparatus, server client system and method, and computer program |
| JP4720363B2 (en) * | 2005-08-19 | 2011-07-13 | パナソニック電工株式会社 | Filtering device |
| JP5139335B2 (en) * | 2009-01-14 | 2013-02-06 | 日本電信電話株式会社 | Data search device, data search method, and data search program |
-
2011
- 2011-12-14 JP JP2011273040A patent/JP5920698B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2013126058A (en) | 2013-06-24 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN110083601B (en) | Key value storage system-oriented index tree construction method and system | |
| CN109766341B (en) | Method, device and storage medium for establishing Hash mapping | |
| US9262312B1 (en) | Apparatus and methods to compress data in a network device and perform content addressable memory (CAM) processing | |
| US9871727B2 (en) | Routing lookup method and device and method for constructing B-tree structure | |
| US8868926B2 (en) | Cryptographic hash database | |
| CN102307149B (en) | IP (internet protocol) lookup method and device and route updating method and device | |
| US9306851B1 (en) | Apparatus and methods to store data in a network device and perform longest prefix match (LPM) processing | |
| CN101577662A (en) | Method and device for matching longest prefix based on tree form data structure | |
| US7805427B1 (en) | Integrated search engine devices that support multi-way search trees having multi-column nodes | |
| CN108134739B (en) | Route searching method and device based on index trie | |
| KR20200097050A (en) | Method for managing index | |
| US6839703B2 (en) | Information apparatus, table retrieval apparatus, table retrieval method, and recording medium | |
| CN108874987B (en) | Table entry management method and device and exchange chip | |
| JPH10257084A (en) | Method and system for parsing a frame header that routes data frames in a computer network | |
| US9292549B2 (en) | Method and system for index serialization | |
| CN118245640A (en) | Multimodal data verifiable query method and system based on blockchain | |
| CN111541617B (en) | A data flow table processing method and device for high-speed large-scale concurrent data flow | |
| JP5920698B2 (en) | Data judgment device and data judgment program | |
| US7154892B2 (en) | Method and apparatus for managing LPM-based CAM look-up table, and recording medium therefor | |
| US8886677B1 (en) | Integrated search engine devices that support LPM search operations using span prefix masks that encode key prefix length | |
| WO2016095450A1 (en) | Item updating method, device and storage medium on the basis of route searching | |
| CN117435912A (en) | Data packet index and retrieval method based on network data packet attribute value length characteristics | |
| CN102110117A (en) | Method and device for adding, searching and deleting longest match table entry of B-tree | |
| CN116774920A (en) | Ternary content addressing memory and its item management method | |
| CN111628935B (en) | Data packet classification method and device suitable for software-defined network |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20140901 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A821 Effective date: 20140901 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20150611 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20150818 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20151016 |
|
| 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: 20160329 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20160401 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 5920698 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313117 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
| LAPS | Cancellation because of no payment of annual fees |