[go: up one dir, main page]

JP2001168911A - Packet filter device - Google Patents

Packet filter device

Info

Publication number
JP2001168911A
JP2001168911A JP35025699A JP35025699A JP2001168911A JP 2001168911 A JP2001168911 A JP 2001168911A JP 35025699 A JP35025699 A JP 35025699A JP 35025699 A JP35025699 A JP 35025699A JP 2001168911 A JP2001168911 A JP 2001168911A
Authority
JP
Japan
Prior art keywords
packet
filter
condition
register
memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP35025699A
Other languages
Japanese (ja)
Inventor
Kenji Aoshima
健次 青島
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.)
Hitachi Cable Ltd
Original Assignee
Hitachi Cable Ltd
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 Hitachi Cable Ltd filed Critical Hitachi Cable Ltd
Priority to JP35025699A priority Critical patent/JP2001168911A/en
Publication of JP2001168911A publication Critical patent/JP2001168911A/en
Pending legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

(57)【要約】 【課題】 簡素な構成で、長大なフィルタ条件や複雑な
フィルタ条件が取り扱え、しかも高速処理が可能なパケ
ットフィルタ装置を提供する。 【解決手段】 入力されるパケットをアドレス、プロト
コルなどのフィルタ条件により選択的に通過させる機能
を備えたパケットフィルタにおいて、フィルタ条件を複
数部分に分割して保存するメモリ104を設けると共
に、前記メモリ104に保存されているフィルタ条件を
パケット入力の速度と同じ速度で読み出し、読み出した
フィルタ条件の分割部分とその比較対象である前記パケ
ットの分割部分とを比較し、全分割部分がフィルタ条件
に一致したパケットを通過させる回路をハードウェアで
構成した。
(57) [Problem] To provide a packet filter device capable of handling long or complex filter conditions with a simple configuration and capable of high-speed processing. SOLUTION: In a packet filter having a function of allowing an input packet to selectively pass according to filter conditions such as an address and a protocol, a memory 104 for dividing and storing filter conditions into a plurality of parts is provided, and the memory 104 is provided. Is read out at the same speed as the packet input speed, and the divided portion of the read out filter condition is compared with the divided portion of the packet to be compared, and all the divided portions match the filter condition. The circuit that passes the packet is configured by hardware.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、特定の条件に合致
したパケットを選択するパケットフィルタ装置に係り、
特に、簡素な構成で、長大なフィルタ条件や複雑なフィ
ルタ条件が取り扱え、しかも高速処理が可能なパケット
フィルタ装置に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a packet filter device for selecting a packet meeting a specific condition,
In particular, the present invention relates to a packet filter device having a simple configuration, capable of handling long or complex filter conditions, and capable of high-speed processing.

【0002】[0002]

【従来の技術】LANアナライザやRMONプローブ
は、ネットワーク上に流れるパケットを収集してパケッ
トの種類や頻度に関する統計を作成する装置であり、ト
ラフィックの監視やネットワーク上のトラブルの原因究
明などの目的で使用される。このような装置の機能の一
つとしてパケットキャプチャ機能がある。パケットキャ
プチャ機能は、ネットワーク上に流れるパケットをその
まま保存する機能である。保存したパケットを後で読み
出すことにより、パケットの内容を詳しく解析すること
ができる。
2. Description of the Related Art LAN analyzers and RMON probes are devices that collect packets flowing on a network and create statistics on the types and frequencies of the packets. The LAN analyzers and RMON probes are used for monitoring traffic and investigating the causes of network problems. used. One of the functions of such a device is a packet capture function. The packet capture function is a function of saving a packet flowing on a network as it is. By reading the stored packet later, the contents of the packet can be analyzed in detail.

【0003】しかし、ネットワーク上には様々な種類の
大量のパケットが流れているので、これらのパケットを
全て保存することは、装置の記憶容量や処理速度におい
て限界があるため、困難である。そこで、必要なパケッ
トだけを保存するためにパケットフィルタ機能を用い
る。
[0003] However, since a large amount of various types of packets are flowing on the network, it is difficult to store all of these packets due to limitations in the storage capacity and processing speed of the device. Therefore, a packet filter function is used to store only necessary packets.

【0004】パケットフィルタ機能は、特定のアドレ
ス、特定のプロトコルなどの条件によって取捨選択を行
う機能である。パケットフィルタ機能を実現するパケッ
トフィルタ装置には、使用用途によって様々な種類があ
るが、大きく分けて、CPUがソフトウェアを使用して
フィルタ処理を行うソフトフィルタと、CPUを使用せ
ずハードウェアのみで取捨判定を行うハードフィルタと
がある。
[0004] The packet filter function is a function of selecting a packet according to conditions such as a specific address and a specific protocol. There are various types of packet filter devices that realize the packet filter function, depending on the intended use. Broadly speaking, there are two types: a soft filter in which the CPU performs filter processing using software, and a hardware filter without using the CPU. There is a hard filter for performing discard judgment.

【0005】まず、図4を用いてソフトフィルタを使用
したパケットフィルタ装置を説明する。図4に示される
ように、パケットフィルタ装置は、CPU401、プロ
グラム用メモリ402、パケットの受信制御やバッファ
メモリ404へのDMA転送などを行う通信制御LSI
403、パケットを格納するためのバッファメモリ40
4から構成されている。なお、図中に示す(1)(2)
(3)は、下記の手順に対応する。
First, a packet filter device using a soft filter will be described with reference to FIG. As shown in FIG. 4, the packet filter device includes a CPU 401, a program memory 402, a communication control LSI for performing packet reception control, DMA transfer to a buffer memory 404, and the like.
403, buffer memory 40 for storing packets
4. (1) (2) shown in the figure
(3) corresponds to the following procedure.

【0006】図4のパケットフィルタ装置におけるパケ
ットキャプチャ動作を説明する。
A packet capture operation in the packet filter device of FIG. 4 will be described.

【0007】(1)通信制御LSI403がパケットを
受信したら、CPU401は通信制御LSI403から
パケットを読み出す。
(1) When the communication control LSI 403 receives a packet, the CPU 401 reads the packet from the communication control LSI 403.

【0008】(2)プログラムに従ってフィルタ条件と
パケットとを比較し、パケット取捨判定を行う。
(2) Filter conditions are compared with the packet in accordance with the program to determine whether to discard the packet.

【0009】(3)パケットがフィルタ条件に合致した
場合は、パケットをバッファメモリ404に保存する。
(3) If the packet matches the filter condition, the packet is stored in the buffer memory 404.

【0010】この例以外にもパケットの読み出し方や保
存方法はいろいろあるが、ソフトフィルタの共通点は、
フィルタ条件がプログラムの中にあり、プログラムを実
行することによってパケットの取捨判定が行われること
である。
[0010] There are various methods of reading and storing packets other than this example.
The filter condition is in the program, and packet discarding is determined by executing the program.

【0011】次に、図5〜図7を用いてハードフィルタ
を使用したパケットフィルタ装置を説明する。
Next, a packet filter device using a hard filter will be described with reference to FIGS.

【0012】図5に示されるように、パケットフィルタ
装置は、CPU501、通信制御LSI502、バッフ
ァメモリ503、パケットフィルタLSI504から構
成されている。パケットフィルタ機能を持つハードウェ
アであるパケットフィルタLSI504は、パケットの
比較対象となる部分を検出するための比較対象検出部5
05、パケットの比較対象となる部分を格納するための
パケットレジスタ506、フィルタ条件を格納するため
のフィルタレジスタ507、上記フィルタ条件のうち比
較に必要のない部分をマスクするマスク条件を格納する
ためのマスクレジスタ508、前記3つのレジスタを比
較してパケット取捨判定結果を出力する比較回路50
9、バッファメモリ制御回路510から構成されてい
る。
As shown in FIG. 5, the packet filter device comprises a CPU 501, a communication control LSI 502, a buffer memory 503, and a packet filter LSI 504. A packet filter LSI 504, which is hardware having a packet filter function, includes a comparison target detection unit 5 for detecting a portion to be compared with a packet.
05, a packet register 506 for storing a portion to be compared with a packet, a filter register 507 for storing a filter condition, and a mask condition for masking a portion of the filter condition not required for comparison. A mask register 508, a comparison circuit 50 that compares the three registers and outputs a packet discard determination result
9, a buffer memory control circuit 510.

【0013】比較対象検出部505は、図6に示される
ように、入力したパケットのバイト数をカウントするバ
イトカウンタ601、パケットの先頭から何バイト目か
ら比較を開始するかを示すオフセットレジスタ602、
オフセットレジスタ602とバイトカウンタ601とを
比較し、一致したら比較開始信号を比較回路509に送
出する比較開始信号生成回路603を具備する。
As shown in FIG. 6, a comparison object detection unit 505 includes a byte counter 601 for counting the number of bytes of an input packet, an offset register 602 for indicating the number of bytes from the beginning of the packet to start comparison,
A comparison start signal generation circuit 603 is provided for comparing the offset register 602 and the byte counter 601 and sending a comparison start signal to the comparison circuit 509 when they match.

【0014】また、図7は比較回路509の内部回路の
一例であり、この回路は、パケットレジスタ506の1
番目からN番目までのビットとフィルタレジスタ507
の1番目からN番目までのビットとによりビット毎の排
他的論理和を取り、さらに各排他的論理和出力とマスク
レジスタ508の1番目からN番目までのビットとによ
りビット毎の論理積を取り、Nビット分の論理積出力の
論理和を取ったものをパケット取捨判定結果とするもの
である。従って、マスクレジスタ508のビットが1で
あるビットについてパケットレジスタ506とフィルタ
レジスタ507とが不一致であるビットがフィルタ条件
の全長(=Nビット)中に1つでもあれば、パケット取
捨判定結果は1(不一致)となる。
FIG. 7 shows an example of the internal circuit of the comparison circuit 509.
To the Nth bit and the filter register 507
The exclusive OR of each bit is obtained by using the first to Nth bits of the above, and the logical product of each bit is obtained by using each exclusive OR output and the first to Nth bits of the mask register 508. , N bits of the logical product output are taken as the packet discarding determination result. Therefore, if there is at least one bit in which the packet register 506 and the filter register 507 do not match with respect to the bit whose mask register 508 is 1 in the total length (= N bits) of the filter condition, the packet discarding determination result is 1 (Mismatch).

【0015】図5のパケットフィルタ装置におけるパケ
ットキャプチャ動作を説明する。
The packet capture operation in the packet filter device of FIG. 5 will be described.

【0016】予めフィルタレジスタ507、マスクレジ
スタ508及びオフセットレジスタ602には、CPU
501により初期値を設定しておき、その後、(1)〜
(3)の手順を行う。
The filter register 507, mask register 508, and offset register 602 have a CPU
Initial values are set in accordance with 501, and thereafter, (1) to
Perform step (3).

【0017】(1)通信制御LSI502がパケットを
受信したら、パケットフィルタLSI504は、通信制
御LSI502からパケットを読み出し、バッファメモ
リ503にパケットを保存する。これと同時に、比較開
始信号生成回路603はオフセットレジスタ602とバ
イトカウンタ601とを比較し、もし一致したら、比較
開始信号を比較回路509に送出する。
(1) When the communication control LSI 502 receives a packet, the packet filter LSI 504 reads the packet from the communication control LSI 502 and stores the packet in the buffer memory 503. At the same time, the comparison start signal generation circuit 603 compares the offset register 602 with the byte counter 601 and sends a comparison start signal to the comparison circuit 509 if they match.

【0018】(2)比較開始信号を受け取った比較回路
509は、パケットレジスタ506、フィルタレジスタ
507、マスクレジスタ508を比較し、パケット取捨
判定結果をバッファメモリ制御回路510に通知する。
(2) Upon receiving the comparison start signal, the comparison circuit 509 compares the packet register 506, the filter register 507, and the mask register 508, and notifies the buffer memory control circuit 510 of the packet discard decision result.

【0019】(3)パケットを破棄する(通過させな
い)場合は、バッファメモリ503において、破棄する
パケットの上に次に受信したパケットを上書きする。
(3) When discarding (not passing) a packet, the buffer memory 503 overwrites the packet to be discarded with the next received packet.

【0020】[0020]

【発明が解決しようとする課題】前記したソフトフィル
タやハードフィルタには、それぞれ以下のような長所・
短所がある。
The above soft filter and hard filter have the following advantages, respectively.
There are disadvantages.

【0021】まず、ソフトフィルタは、ビット長が長大
なフィルタ条件を用いたフィルタ処理を簡単に実現で
き、また、異なる複数のフィルタ条件を組み合わせたよ
うな複雑なフィルタ条件を用いたフィルタ処理も簡単に
実現できる。即ち、長大なフィルタ条件や複雑なフィル
タ条件を取り扱うことができる。しかし、CPU401
は、フィルタ処理以外に様々な処理を行うため、フィル
タの処理速度だけを速くすることはできない。また、C
PU401の内部構造がフィルタ専用に作られてはいな
いので、ソフトフィルタの処理速度は非常に遅いものと
なる。このため、ネットワークのトラフィックが大きく
なると、フィルタ処理が間に合わなくなり、保存が必要
かどうか未判定のパケットが大量に破棄されてしまうこ
とになる。
First, the soft filter can easily realize a filter process using a filter condition having a long bit length, and can easily perform a filter process using a complex filter condition such as a combination of a plurality of different filter conditions. Can be realized. That is, a long or complicated filter condition can be handled. However, the CPU 401
Performs various processes other than the filtering process, so that the processing speed of the filter alone cannot be increased. Also, C
Since the internal structure of the PU 401 is not made exclusively for the filter, the processing speed of the soft filter becomes very slow. For this reason, when the traffic of the network increases, the filtering process cannot be performed in time, and a large number of packets that have not been determined to be stored are discarded.

【0022】一方、ハードフィルタは、ハードウェア処
理を行うので処理速度が速い。しかし、長大なフィルタ
条件や複雑なフィルタ条件を処理する回路を組むのは困
難であり、もしそのような回路が実現できても、回路規
模が非常に大きくなってしまう。
On the other hand, the processing speed of the hard filter is high because it performs hardware processing. However, it is difficult to form a circuit for processing a long filter condition or a complicated filter condition, and even if such a circuit can be realized, the circuit scale becomes very large.

【0023】そこで、本発明の目的は、上記課題を解決
し、簡素な構成で、長大なフィルタ条件や複雑なフィル
タ条件が取り扱え、しかも高速処理が可能なパケットフ
ィルタ装置を提供することにある。
SUMMARY OF THE INVENTION It is an object of the present invention to provide a packet filter device which solves the above-mentioned problems, has a simple configuration, can handle long or complex filter conditions, and can perform high-speed processing.

【0024】[0024]

【課題を解決するための手段】上記目的を達成するため
に本発明は、入力されるパケットをアドレス、プロトコ
ルなどのフィルタ条件により選択的に通過させる機能を
備えたパケットフィルタにおいて、フィルタ条件を複数
部分に分割して保存するメモリを設けると共に、前記メ
モリに保存されているフィルタ条件をパケット入力の速
度と同じ速度で読み出し、読み出したフィルタ条件の分
割部分とその比較対象である前記パケットの分割部分と
を比較し、全分割部分がフィルタ条件に一致したパケッ
トを通過させる回路をハードウェアで構成したものであ
る。
SUMMARY OF THE INVENTION In order to achieve the above object, the present invention provides a packet filter having a function of selectively passing an input packet according to filter conditions such as an address and a protocol. A memory for dividing and storing the filter conditions is provided, and the filter conditions stored in the memory are read out at the same speed as the packet input speed, and the read filter condition divided portions and the packet divided portions to be compared are compared. And a circuit for passing a packet whose divided portions match the filter condition is configured by hardware.

【0025】通過したパケットを保存するためのバッフ
ァメモリを設けてもよい。
A buffer memory for storing the passed packets may be provided.

【0026】前記メモリと前記ハードウェア回路とを複
数組設け、パケットがいずれかのメモリのフィルタ条件
に一致したとき、そのパケットを通過させてもよい。
A plurality of sets of the memory and the hardware circuit may be provided, and when a packet matches a filter condition of any one of the memories, the packet may be passed.

【0027】[0027]

【発明の実施の形態】以下、本発明の一実施形態を添付
図面に基づいて詳述する。
An embodiment of the present invention will be described below in detail with reference to the accompanying drawings.

【0028】図1に示されるように、本発明に係るパケ
ットフィルタ装置は、ネットワーク上に流れるパケット
を収集するデータ収集装置であり、CPU100、通信
制御LSI101、バッファメモリ102、パケットフ
ィルタLSI103及びフィルタメモリ104からな
る。本発明は、CPU100から書き込まれるフィルタ
条件及びマスク条件を複数部分に分割して保存するフィ
ルタメモリ104と、このフィルタメモリ104内のフ
ィルタ条件及びマスク条件をパケットと比較するための
論理回路を集積したパケットフィルタLSI103とを
備えることが特徴である。
As shown in FIG. 1, a packet filter device according to the present invention is a data collection device for collecting packets flowing on a network, and includes a CPU 100, a communication control LSI 101, a buffer memory 102, a packet filter LSI 103, and a filter memory. 104. The present invention integrates a filter memory 104 that divides a filter condition and a mask condition written from the CPU 100 into a plurality of portions and stores the filter condition and a mask condition, and a logic circuit for comparing the filter condition and the mask condition in the filter memory 104 with a packet. It is characterized by including a packet filter LSI 103.

【0029】パケットフィルタLSI103は、比較対
象となるパケットの分割部分を格納するためのパケット
レジスタ105、フィルタメモリ104を制御するため
のフィルタメモリ制御回路110、フィルタ条件の分割
部分を格納するためのフィルタレジスタ106、マスク
条件の分割部分を格納するためのマスクレジスタ10
7、上記3つのレジスタを比較してパケット取捨判定結
果を出力する比較回路108及び判定結果に基づいてバ
ッファメモリ102での上書きを操作するバッファメモ
リ制御回路109とからなる。このパケットフィルタL
SI103は、フィルタメモリ104に保存されている
フィルタ条件及びマスク条件をパケット入力の速度と同
じ速度で読み出し、読み出したフィルタ条件及びマスク
条件とその比較対象であるパケットとを複数回に分割し
て比較し、マスクされたビットを除く全ビットがフィル
タ条件に一致したパケットを通過させる。
The packet filter LSI 103 includes a packet register 105 for storing a divided portion of a packet to be compared, a filter memory control circuit 110 for controlling a filter memory 104, and a filter for storing a divided portion of a filter condition. Register 106, mask register 10 for storing divided parts of mask condition
7. A comparison circuit 108 for comparing the above three registers and outputting a packet discard judgment result, and a buffer memory control circuit 109 for operating overwriting in the buffer memory 102 based on the judgment result. This packet filter L
The SI 103 reads out the filter condition and the mask condition stored in the filter memory 104 at the same speed as the packet input speed, and divides the read out filter condition and the mask condition and the packet to be compared with the packet to be compared a plurality of times. Then, a packet in which all bits except the masked bits match the filter condition is passed.

【0030】また、図2は比較回路108の一例であ
り、この回路は、レジスタ比較部201と結果結合部2
02とからなる。レジスタ比較部201では、パケット
レジスタ105の1番目からN番目までのビットとフィ
ルタレジスタ106の1番目からN番目までのビットと
によりビット毎の排他的論理和を取り、さらに各排他的
論理和出力とマスクレジスタ107の1番目からN番目
までのビットとによりビット毎の論理積を取り、これら
Nビット分の論理積出力による論理和を取ったものを比
較結果とするようになっている。結果結合部202で
は、比較開始前にフリップフロップ203にリセットを
かけておき、その後、レジスタ比較部201においてN
ビット分の比較が行われるたびに、レジスタ比較部20
1からの比較結果と前回までのフリップフロップ出力と
の論理和をフリップフロップ203に保存し、最終的に
フリップフロップ出力が比較結果となるように構成され
ている。従って、マスクレジスタ107のビットが1で
あるビットについてパケットレジスタ105とフィルタ
レジスタ106とが不一致であるビットがフィルタ条件
の全長(=比較回数×Nビット)中に1ビットでもあれ
ば、このパケットの取捨判定結果は1(不一致)とな
る。マスク条件のビットが1であるビットについてパケ
ットとフィルタ条件とが全長にわたって一致していれ
ば、このパケットの取捨判定結果は0(一致)となる。
FIG. 2 shows an example of the comparison circuit 108. This circuit includes a register comparison unit 201 and a result combination unit 2.
02. The register comparison unit 201 calculates an exclusive OR for each bit by using the first to Nth bits of the packet register 105 and the first to Nth bits of the filter register 106, and further outputs each exclusive OR. The logical AND of each bit is calculated by using the first and Nth bits of the mask register 107, and the logical sum of the logical product output of these N bits is obtained as the comparison result. The result combining unit 202 resets the flip-flop 203 before starting the comparison, and then the register comparing unit 201
Each time the comparison for bits is performed, the register comparison unit 20
The logical sum of the comparison result from 1 and the flip-flop output up to the previous time is stored in the flip-flop 203, and the flip-flop output is finally the comparison result. Therefore, if the bit in which the bit of the mask register 107 is 1 and the packet register 105 and the filter register 106 do not match each other is at least one bit in the total length of the filter condition (= the number of comparisons × N bits), then The discard judgment result is 1 (mismatch). If the packet and the filter condition for the bit whose mask condition bit is 1 match over the entire length, the result of discarding the packet is 0 (match).

【0031】図1のパケットフィルタ装置におけるパケ
ットキャプチャ動作を説明する。
The packet capture operation in the packet filter device of FIG. 1 will be described.

【0032】予めフィルタメモリ104にはCPU10
0よりフィルタ条件及びマスク条件の初期値を設定して
おく。その後、(1)〜(4)の手順を行う。なお、図
中に示す(1)〜(4)は、この手順に対応する。
The filter memory 104 has a CPU 10
Initial values of the filter condition and the mask condition are set from 0. Thereafter, the procedures of (1) to (4) are performed. (1) to (4) shown in the figure correspond to this procedure.

【0033】(1)通信制御LSI101がパケットを
受信したら、パケットフィルタLSI103は、通信制
御LSI101からパケットを読み出し、バッファメモ
リ102にパケットを保存する。これと同時に、パケッ
トをパケットレジスタ105に格納する。
(1) When the communication control LSI 101 receives a packet, the packet filter LSI 103 reads the packet from the communication control LSI 101 and stores the packet in the buffer memory 102. At the same time, the packet is stored in the packet register 105.

【0034】(2)さらに、フィルタメモリ制御回路1
10は、パケットを読み出す速度と同一の速度でフィル
タ条件及びマスク条件をフィルタメモリ104から読み
出し、これらフィルタ条件及びマスク条件をフィルタレ
ジスタ106及びマスクレジスタ107に格納する。
(2) Further, the filter memory control circuit 1
Reference numeral 10 reads the filter condition and the mask condition from the filter memory 104 at the same speed as the packet reading speed, and stores the filter condition and the mask condition in the filter register 106 and the mask register 107.

【0035】(3)パケットレジスタ105、フィルタ
レジスタ106、マスクレジスタ107のそれぞれに1
回分(Nビット)のパケット、フィルタ条件、マスク条
件が格納されると、比較回路108において、パケット
レジスタ105、フィルタレジスタ106、マスクレジ
スタ107を比較し、この比較結果を前回の比較結果に
結合する。この後、フィルタ条件の全長が終了するまで
(1)(2)(3)を繰り返す。そして、フィルタ条件
の全長が終了したら、フリップフロップ203が出力し
ている比較結果をバッファメモリ制御回路109に通知
する。
(3) Each of the packet register 105, the filter register 106, and the mask register 107 has 1
When the packet (N bits), the filter condition, and the mask condition are stored, the comparison circuit 108 compares the packet register 105, the filter register 106, and the mask register 107, and combines the comparison result with the previous comparison result. . Thereafter, (1), (2), and (3) are repeated until the entire length of the filter condition is completed. Then, when the total length of the filter condition is completed, the comparison result output from the flip-flop 203 is notified to the buffer memory control circuit 109.

【0036】(4)バッファメモリ制御回路109の制
御により、パケットがフィルタ条件に合致しない場合
は、バッファメモリ102において、(1)で保存した
パケットの上に次に受信したパケットを上書きする。パ
ケットがフィルタ条件に合致する場合は、パケットがフ
ィルタを通過したことになるので、(1)で保存したパ
ケットとは異なる領域に次に受信したパケットを書き込
むか、(1)で保存したパケットを別のパケット収集用
のメモリに転送するなどして、(1)で保存したパケッ
トが後で読み出せるようにしておく。
(4) Under the control of the buffer memory control circuit 109, if the packet does not meet the filter condition, the buffer memory 102 overwrites the packet received in (1) with the next received packet. If the packet satisfies the filter condition, it means that the packet has passed the filter. Therefore, the next received packet is written in an area different from the packet saved in (1), or the packet saved in (1) is The packet stored in (1) can be read later by transferring it to another memory for collecting packets.

【0037】以上のパケットキャプチャ動作から分かる
ように、本発明のパケットフィルタ装置では、フィルタ
条件やマスク条件とパケットとの比較が論理回路で行わ
れるので、比較結果が瞬時に得られる。そして、フィル
タ条件やマスク条件の読み出しがパケットの読み出しと
同一速度で行われるので、比較用の各レジスタには、対
応する分割部分が格納されていることになり、読み出し
と同時に比較ができる。従って、フィルタ条件全長分の
比較が高速で行われることになる。また、従来のハード
フィルタでは、長いフィルタ条件を設定するためにはパ
ケットレジスタやフィルタレジスタの回路規模を大きく
する必要があったが、本発明のパケットフィルタ装置で
は、複数回に分割して比較を行うので、パケットレジス
タやフィルタレジスタの回路規模が小さくても長いフィ
ルタ条件を設定することができると共に、オフセットレ
ジスタやバイトカウンタが必要なくなり、回路規模を小
さくすることができる。
As can be seen from the above packet capture operation, in the packet filter device of the present invention, the comparison between the filter condition and the mask condition and the packet is performed by the logic circuit, so that the comparison result can be obtained instantaneously. Since the reading of the filter condition and the mask condition is performed at the same speed as the reading of the packet, the corresponding divided portion is stored in each register for comparison, and the comparison can be performed simultaneously with the reading. Therefore, the comparison for the entire length of the filter condition is performed at high speed. Further, in the conventional hard filter, it was necessary to increase the circuit scale of the packet register and the filter register in order to set a long filter condition. However, in the packet filter device of the present invention, the comparison is performed in a plurality of times. Therefore, even if the circuit scale of the packet register and the filter register is small, long filter conditions can be set, and the offset register and the byte counter are not required, so that the circuit scale can be reduced.

【0038】次に、本発明の他の実施形態を説明する。
図3に示したパケットフィルタ装置は、N個のパケット
フィルタLSI301−1〜301−Nと、N個のフィ
ルタメモリ302−1〜302−Nとを備えている。N
個のパケットフィルタLSI301−1〜301−Nは
連結配置され、各段のパケットフィルタLSIのパケッ
ト出力は、次段のパケットフィルタLSIのパケット入
力に接続され、最終段のパケットフィルタLSI301
−Nのパケット出力にはバッファメモリ303が接続さ
れている。また、各段のパケットフィルタLSI301
−1〜301−Nにはフィルタメモリ302−1〜30
2−Nが接続されている。最終段のパケットフィルタL
SI301−Nは、他のパケットフィルタLSIから比
較結果を受け取り、これら比較結果のうちいずれかがフ
ィルタ条件との一致を示していれば、そのパケットを取
り込む(通過させる)という判定をする。これにより、
異なる複数のフィルタ条件を設定し、いずれかのフィル
タ条件に一致したパケットを通過させるという高度なパ
ケットフィルタ機能を実現することができる。
Next, another embodiment of the present invention will be described.
The packet filter device illustrated in FIG. 3 includes N packet filter LSIs 301-1 to 301-N and N filter memories 302-1 to 302-N. N
Packet filter LSIs 301-1 to 301 -N are connected and arranged, and the packet output of each stage packet filter LSI is connected to the packet input of the next stage packet filter LSI, and the final stage packet filter LSI 301.
The buffer memory 303 is connected to the −N packet output. The packet filter LSI 301 of each stage
-1 to 301-N include the filter memories 302-1 to 30-30.
2-N is connected. Last stage packet filter L
The SI 301-N receives the comparison result from another packet filter LSI, and if any of the comparison results indicates a match with the filter condition, determines that the packet is to be captured (passed). This allows
It is possible to realize a sophisticated packet filter function of setting a plurality of different filter conditions and passing packets that match any of the filter conditions.

【0039】このように、フィルタメモリとパケットフ
ィルタLSIとを複数組設けて複数段の連結を行うこと
により、このパケットフィルタ装置では、容易に高度な
フィルタ条件を設定することができる。
As described above, by providing a plurality of sets of the filter memory and the packet filter LSI and connecting a plurality of stages, the packet filter device can easily set advanced filter conditions.

【0040】[0040]

【発明の効果】本発明は次の如き優れた効果を発揮す
る。
The present invention exhibits the following excellent effects.

【0041】(1)パケットとフィルタ条件との比較を
ハードウェア回路で行うようにしたので、高速処理が可
能になる。
(1) Since the comparison between the packet and the filter condition is performed by a hardware circuit, high-speed processing becomes possible.

【0042】(2)複数部分に分割して保存しているフ
ィルタ条件を複数回で比較するので、回路規模が小さく
できる。
(2) Since the filter conditions divided into a plurality of parts and stored are compared a plurality of times, the circuit scale can be reduced.

【0043】(3)複数部分に分割して保存しているフ
ィルタ条件を複数回で比較するので、長大なフィルタ条
件を設定できる。
(3) Since the filter conditions divided into a plurality of parts and stored are compared a plurality of times, a long filter condition can be set.

【0044】(4)パケットフィルタ機能を持つハード
ウェア回路を複数段に連結することにより、高度なフィ
ルタ条件が設定できるようになる。
(4) By connecting hardware circuits having a packet filter function in a plurality of stages, advanced filter conditions can be set.

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

【図1】本発明の一実施形態を示すパケットフィルタ装
置の回路図である。
FIG. 1 is a circuit diagram of a packet filter device according to an embodiment of the present invention.

【図2】本発明による比較回路の回路図である。FIG. 2 is a circuit diagram of a comparison circuit according to the present invention.

【図3】本発明の他の実施形態によるパケットフィルタ
装置の部分回路図である。
FIG. 3 is a partial circuit diagram of a packet filter device according to another embodiment of the present invention.

【図4】従来のソフトフィルタを使用したパケットフィ
ルタ装置の回路図である。
FIG. 4 is a circuit diagram of a conventional packet filter device using a soft filter.

【図5】従来のハードフィルタを使用したパケットフィ
ルタ装置の回路図である。
FIG. 5 is a circuit diagram of a conventional packet filter device using a hard filter.

【図6】図5のパケットフィルタ装置の比較対象検出部
の回路図である。
6 is a circuit diagram of a comparison target detection unit of the packet filter device of FIG.

【図7】図5のパケットフィルタ装置の比較回路の回路
図である。
FIG. 7 is a circuit diagram of a comparison circuit of the packet filter device of FIG. 5;

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

100 CPU 101 通信制御LSI 102 バッファメモリ 103 パケットフィルタLSI 104 フィルタメモリ 105 パケットレジスタ 106 フィルタレジスタ 107 マスクレジスタ 108 比較回路 109 バッファメモリ制御回路 110 フィルタメモリ制御回路 REFERENCE SIGNS LIST 100 CPU 101 communication control LSI 102 buffer memory 103 packet filter LSI 104 filter memory 105 packet register 106 filter register 107 mask register 108 comparison circuit 109 buffer memory control circuit 110 filter memory control circuit

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 入力されるパケットをアドレス、プロト
コルなどのフィルタ条件により選択的に通過させる機能
を備えたパケットフィルタ装置において、フィルタ条件
を複数部分に分割して保存するメモリを設けると共に、
前記メモリに保存されているフィルタ条件をパケット入
力の速度と同じ速度で読み出し、読み出したフィルタ条
件の分割部分とその比較対象である前記パケットの分割
部分とを比較し、全分割部分がフィルタ条件に一致した
パケットを通過させる回路をハードウェアで構成したこ
とを特徴とするパケットフィルタ装置。
1. A packet filter device having a function of selectively passing an input packet according to a filter condition such as an address and a protocol, and a memory for dividing and storing the filter condition into a plurality of portions.
The filter condition stored in the memory is read out at the same speed as the packet input speed, and the divided portion of the read out filter condition is compared with the divided portion of the packet to be compared, and all the divided portions are included in the filter condition. A packet filter device, wherein a circuit for passing matched packets is constituted by hardware.
【請求項2】 通過したパケットを保存するためのバッ
ファメモリを設けたことを特徴とする請求項1記載のパ
ケットフィルタ装置。
2. The packet filter device according to claim 1, further comprising a buffer memory for storing the passed packets.
【請求項3】 前記メモリと前記ハードウェア回路とを
複数組設け、パケットがいずれかのメモリのフィルタ条
件に一致したとき、そのパケットを通過させることを特
徴とする請求項2記載のパケットフィルタ装置。
3. The packet filter device according to claim 2, wherein a plurality of sets of the memory and the hardware circuit are provided, and when a packet matches a filter condition of any one of the memories, the packet is passed. .
JP35025699A 1999-12-09 1999-12-09 Packet filter device Pending JP2001168911A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP35025699A JP2001168911A (en) 1999-12-09 1999-12-09 Packet filter device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP35025699A JP2001168911A (en) 1999-12-09 1999-12-09 Packet filter device

Publications (1)

Publication Number Publication Date
JP2001168911A true JP2001168911A (en) 2001-06-22

Family

ID=18409279

Family Applications (1)

Application Number Title Priority Date Filing Date
JP35025699A Pending JP2001168911A (en) 1999-12-09 1999-12-09 Packet filter device

Country Status (1)

Country Link
JP (1) JP2001168911A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006087832A1 (en) * 2005-02-18 2006-08-24 Duaxes Corporation Data processing device
JP2007537626A (en) * 2004-04-19 2007-12-20 ザ・リージェンツ・オブ・ザ・ユニバーシティ・オブ・カリフォルニア Programmable hardware for deep packet filtering
JP2008544728A (en) * 2005-06-30 2008-12-04 インテル コーポレイション Stateful packet content matching mechanism
WO2008152962A1 (en) * 2007-06-15 2008-12-18 Autonetworks Technologies, Ltd. Relay connection unit
US7865474B2 (en) 2005-05-20 2011-01-04 Duaxes Corporation Data processing system
US8073855B2 (en) 2005-03-28 2011-12-06 Duaxes Corporation Communication control device and communication control system
US8336092B2 (en) 2005-02-18 2012-12-18 Duaxes Corporation Communication control device and communication control system
RU2795295C1 (en) * 2022-06-14 2023-05-02 Акционерное общество "Научно-производственное предприятие "Цифровые решения" Method for filtering network traffic based on rules with a mask during packet switching

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007537626A (en) * 2004-04-19 2007-12-20 ザ・リージェンツ・オブ・ザ・ユニバーシティ・オブ・カリフォルニア Programmable hardware for deep packet filtering
JP4755175B2 (en) * 2004-04-19 2011-08-24 ザ・リージェンツ・オブ・ザ・ユニバーシティ・オブ・カリフォルニア Programmable hardware for deep packet filtering
WO2006087832A1 (en) * 2005-02-18 2006-08-24 Duaxes Corporation Data processing device
CN101147381B (en) * 2005-02-18 2011-07-27 Duaxes株式会社 Data processing device
US8336092B2 (en) 2005-02-18 2012-12-18 Duaxes Corporation Communication control device and communication control system
US8073855B2 (en) 2005-03-28 2011-12-06 Duaxes Corporation Communication control device and communication control system
US7865474B2 (en) 2005-05-20 2011-01-04 Duaxes Corporation Data processing system
JP2008544728A (en) * 2005-06-30 2008-12-04 インテル コーポレイション Stateful packet content matching mechanism
WO2008152962A1 (en) * 2007-06-15 2008-12-18 Autonetworks Technologies, Ltd. Relay connection unit
JP2008312024A (en) * 2007-06-15 2008-12-25 Auto Network Gijutsu Kenkyusho:Kk Relay connection unit
US8081643B2 (en) 2007-06-15 2011-12-20 Autonetworks Technologies, Ltd. Relay connection unit
RU2795295C1 (en) * 2022-06-14 2023-05-02 Акционерное общество "Научно-производственное предприятие "Цифровые решения" Method for filtering network traffic based on rules with a mask during packet switching

Similar Documents

Publication Publication Date Title
EP1545058B1 (en) Apparatus for collecting information on use of a packet network
US7468979B2 (en) Layer-1 packet filtering
US6526066B1 (en) Apparatus for classifying a packet within a data stream in a computer network
US20050276230A1 (en) Communication statistic information collection apparatus
EP1157502B1 (en) Method and apparatus for early random discard of packets
US5909564A (en) Multi-port ethernet frame switch
US6260073B1 (en) Network switch including a switch manager for periodically polling the network ports to determine their status and controlling the flow of data between ports
US6233246B1 (en) Network switch with statistics read accesses
US6430626B1 (en) Network switch with a multiple bus structure and a bridge interface for transferring network data between different buses
EP1718008B1 (en) Gateway apparatus and routing method
US7924863B2 (en) Device and method for processing data chunks
CN102334314B (en) Method for Collocating Controller Area Network Data Payloads
US20040174813A1 (en) Method and apparatus for controlling network data congestion
EP1044406A4 (en) METHOD AND DEVICE FOR TREATING DATA FRAME PROCESSING IN A NETWORK
US11151073B1 (en) Augmenting data plane functionality with field programmable integrated circuits
US6892287B1 (en) Frame reassembly in an ATM network analyzer
CN115733832B (en) Computing devices, message receiving methods, programmable network interface cards (NICs) and storage media
WO2014000819A1 (en) A method of and network server for detecting data patterns in an input data stream
JP2001168911A (en) Packet filter device
US20030012139A1 (en) Network monitor system, data amount counting method and program for use in the system
CN115884001A (en) Data acquisition and transmission system and method based on ZYNQ chip
CN110297785A (en) A kind of finance data flow control apparatus and flow control method based on FPGA
JP2001069173A (en) Packet filter mechanism
JPH09507994A (en) Apparatus and method for selectively storing error statistics
JP2003218907A (en) Processor configured to reduce memory requirements for fast routing and switching of packets