JP4879728B2 - Search device and data processing device - Google Patents
Search device and data processing device Download PDFInfo
- Publication number
- JP4879728B2 JP4879728B2 JP2006356323A JP2006356323A JP4879728B2 JP 4879728 B2 JP4879728 B2 JP 4879728B2 JP 2006356323 A JP2006356323 A JP 2006356323A JP 2006356323 A JP2006356323 A JP 2006356323A JP 4879728 B2 JP4879728 B2 JP 4879728B2
- Authority
- JP
- Japan
- Prior art keywords
- search
- search processing
- processing circuit
- memory
- stage
- 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
Description
本発明は、検索用データベースの更新時に検索処理を中断することなく、検索の継続が可能な検索装置およびこの検索装置を備えたデータ処理装置に関するものである。 The present invention relates to a search device capable of continuing search without interrupting search processing when a search database is updated, and a data processing device including the search device.
通信分野においては、パケットのルーティングおよびパケット内の悪意あるコードの検出、また、情報分析分野においては、大量のデータの中からのパターン検出など、検索処理は、幅広い分野において多様な場面で利用されている。特に、近時の情報通信分野全般におけるデータ量の増大および処理の高度化に伴い、検索処理には、高速性、多機能性、さらにインテリジェンス性を備えた処理が求められ、これらの処理をオンデマンドでかつ動的に行うことが求められてきている。 Search processing is used in various fields in a wide range of fields, such as packet routing and detection of malicious code in packets in the communication field, and pattern detection from large amounts of data in the information analysis field. ing. In particular, with the recent increase in the amount of data and the sophistication of processing in the entire information communication field, search processing requires processing with high speed, multi-functionality, and intelligence. There is a need to do it on demand and dynamically.
例えば、特許文献1では、半導体メモリを使用して2分探索を実現する半導体集積回路が開示されており、メモリに格納された有効検索対象データの数の減少に応じて、2分探索を開始する半導体メモリ上のアドレスを適切に決定する手段を設けることにより、探索に要する処理サイクル数を減少させ、高速な検索処理を実現している。 For example, Patent Document 1 discloses a semiconductor integrated circuit that realizes a binary search using a semiconductor memory, and starts a binary search in response to a decrease in the number of effective search target data stored in the memory. By providing means for appropriately determining the address on the semiconductor memory, the number of processing cycles required for the search is reduced and high-speed search processing is realized.
また、非特許文献1では、バイナリ検索テーブルを使用したバイナリ検索を例に、テーブルで使用されるデータ構造によっては、検索時にテーブルの更新の実行が困難になることを指摘している。例えば、テーブルにおける項目の追加または削除を行う際には、テーブル全体を並べ直す処理が必要となり、このようなテーブルの更新時には、項目が移動したり変更されたりしているので、テーブルを使った検索の実行が困難になる。そして、その回避方法として、2つの方法を提案している。すなわち、第1の方法は、検索処理が少ない期間まで更新処理を延期し、テーブルの更新処理を行っている間は検索を停止する方法である。また、第2の方法は、2つのテーブルを用意し、一方のテーブルを検索用に使い、他方を更新用としてバックグランドでテーブルの更新を行う。そして、テーブルの更新が完了したら2つのテーブルを交換する方法である。 In Non-Patent Document 1, it is pointed out that execution of updating a table at the time of searching becomes difficult depending on the data structure used in the table, taking a binary search using a binary search table as an example. For example, when adding or deleting items in a table, it is necessary to rearrange the entire table. When updating such a table, items are moved or changed. Performing a search becomes difficult. And two methods are proposed as the avoidance method. That is, the first method is a method in which the update process is postponed until a period when the search process is small, and the search is stopped while the table update process is being performed. In the second method, two tables are prepared, one table is used for search, and the other is used for update, and the table is updated in the background. Then, when the table update is completed, the two tables are exchanged.
しかしながら、特許文献1に記載の従来技術によれば、検索用データベースのエントリ更新時において、検索データの入力を一旦停止する必要がある。そのため、エントリ更新時には、ノン・ストップな検索処理を実現できないという問題があった。 However, according to the prior art described in Patent Document 1, it is necessary to temporarily stop the input of search data when updating the search database entry. Therefore, there has been a problem that non-stop search processing cannot be realized at the time of entry update.
また、非特許文献1に記載の従来技術によれば、テーブルの更新処理を行う際に検索処理を停止する必要がある(上記第1の方法を参照)。そのため、突然、検索パフォーマンスが低下するという問題があった。また、2つのテーブルを用意する上記第2の方法では、テーブルにて使用されるデータ構造が2分探索木のようなツリー構造である場合に、検索処理中にテーブルを交換すると、それまで旧テーブルのツリー構造に基づいて検索を行った検索中のデータは、突然、新テーブルのツリー構造に適用されることになり、誤った検索結果が返ってくる。このように、検索中に、旧テーブル情報で検索中のデータを新テーブル情報では引き継げないという問題があった。 Further, according to the prior art described in Non-Patent Document 1, it is necessary to stop the search process when performing the table update process (see the first method). Therefore, there was a problem that the search performance suddenly deteriorated. In the second method of preparing two tables, if the data structure used in the table is a tree structure like a binary search tree, if the tables are exchanged during the search process, Data that is being searched based on the tree structure of the table is suddenly applied to the tree structure of the new table, and an incorrect search result is returned. In this way, during the search, there is a problem that the data being searched with the old table information cannot be transferred with the new table information.
本発明は、上記に鑑みてなされたものであって、検索用データベースのエントリ更新時においても検索処理を停止することなく検索処理の継続が可能な検索装置およびデータ処理装置を得ることを目的とする。 The present invention has been made in view of the above, and an object of the present invention is to provide a search device and a data processing device capable of continuing a search process without stopping the search process even when an entry of a search database is updated. To do.
上述した課題を解決し、目的を達成するために、本発明にかかる検索処理装置は、検索キーを入力としメモリ内に格納された検索用データベースを検索して検索結果を出力する検索装置であって、前記検索キーが入力される前段の検索処理回路と、この前段の検索処理回路の後段に設けられ、前記前段の検索処理回路の検索処理結果に基づいて、順次、検索処理を行う1または複数の後段の検索処理回路と、前記前段の検索処理回路が検索を行うための前記検索用データベースの一部が格納され、前記前段の検索処理回路に対応して設けられた前段の運用メモリと、この前段の運用メモリと対になって設けられ、前記検索用データベースの更新時まで待機を行う前段の待機メモリと、前記検索用データベースの残部が全体として格納されるように、前記各後段の検索処理回路が検索を行うためのデータがそれぞれ格納され、前記各後段の検索処理回路にそれぞれ対応して設けられた後段の運用メモリと、前記各後段の運用メモリと対になって設けられ、前記検索用データベースの更新時まで待機を行う後段の待機メモリと、前記検索用データベースの更新時に、更新後の検索用データベースを書き込むことにより前記前段および前記各後段の待機メモリの内容を更新するメモリ更新回路と、前記メモリ更新回路からの更新通知に基づいて、前記前段の検索処理回路が検索をするメモリを前記前段の運用メモリから前記前段の待機メモリへと切り替える前段の選択回路と、前記メモリ更新回路からの更新通知に基づいて、前記各後段の検索処理回路が検索をするメモリを前記各後段の運用メモリからそれと対になる前記各後段の待機メモリへと切り替える後段の選択回路と、を備え、前記前段の検索処理回路が検索処理に要する検索処理時間は、前記各後段の検索処理回路が検索処理に要する検索処理時間よりも長いことを特徴とする。 In order to solve the above-described problems and achieve the object, a search processing apparatus according to the present invention is a search apparatus that searches a search database stored in a memory using a search key as an input and outputs a search result. The search processing circuit of the preceding stage where the search key is input and the subsequent stage of the search processing circuit of the preceding stage, and sequentially performing the search processing based on the search processing result of the search processing circuit of the preceding stage 1 or A plurality of subsequent search processing circuits, a part of the search database for searching by the previous search processing circuit, and a previous operation memory provided corresponding to the previous search processing circuit; The standby memory provided in a pair with the operation memory of the preceding stage and waiting until the search database is updated and the remainder of the search database are stored as a whole. Each of the subsequent-stage search processing circuits stores data to be searched, and the subsequent-stage operation memory provided corresponding to each of the subsequent-stage search processing circuits, and the respective subsequent-stage operation memories. And a standby memory in a subsequent stage that waits until the search database is updated, and a standby memory in the previous stage and each subsequent stage by writing the updated search database when the search database is updated. A memory update circuit that updates the contents of the memory, and a memory that is searched by the search processing circuit in the previous stage based on an update notification from the memory update circuit, from the previous operation memory to the previous standby memory. Based on the update notification from the selection circuit and the memory update circuit, the memory to be searched by the search processing circuit in each subsequent stage is set as the memory in each subsequent stage. A post-stage selection circuit that switches from the main memory to each of the subsequent standby memories, and the search processing time required for the search process of the pre-stage search processing circuit is searched by each of the post-stage search processing circuits. It is characterized by being longer than the search processing time required for processing.
本発明によれば、前段の検索処理回路が検索処理に要する検索処理時間を、後段の検索処理回路が検索処理に要する検索処理時間よりも長くするように構成したので、検索用データベースの更新通知に基づいて、前段の検索処理回路が検索するメモリを前段の運用メモリから前段の待機メモリへと切り替え、さらに、前段の検索処理回路から検索途中のデータが後段の検索処理回路へ入力されない時間を利用して、後段の検索処理回路が検索するメモリを後段の運用メモリから後段の待機メモリへと切り替えることにより、検索動作中であっても検索動作を停止せずに、検索用データベースの更新をすることができる。 According to the present invention, the search processing circuit required for the search processing in the preceding stage is configured to be longer than the search processing time required for the search processing in the subsequent search processing circuit. Based on the above, the memory to be searched by the search processing circuit in the previous stage is switched from the operation memory in the previous stage to the standby memory in the previous stage, and the time during which data being searched from the search processing circuit in the previous stage is not input to the search processing circuit in the subsequent stage By switching the memory searched by the subsequent search processing circuit from the subsequent operation memory to the subsequent standby memory, the search database can be updated without stopping the search operation even during the search operation. can do.
以下に、本発明にかかる検索装置およびデータ処理装置の実施の形態を図面に基づいて詳細に説明する。なお、以下に示す実施の形態によりこの発明が限定されるものではない。 Embodiments of a search device and a data processing device according to the present invention will be described below in detail with reference to the drawings. The present invention is not limited to the embodiments described below.
実施の形態1.
図1は、本発明にかかる検索装置の実施の形態1を利用したネットワーク構成を示す図である。なお、本実施の形態では、データ処理装置としてのルータと、ルータに実装される検索装置を例として説明しているが、本発明の適用分野は通信分野に限定されるものではない。
Embodiment 1 FIG.
FIG. 1 is a diagram showing a network configuration using a first embodiment of a search device according to the present invention. In this embodiment, a router as a data processing device and a search device mounted on the router are described as examples. However, the application field of the present invention is not limited to the communication field.
図1に示すように、本実施の形態のネットワークは、ルータ1、PC(Personal Computer)端末2、インターネット3、サーバー群4、アクセスポイント5、無線端末6、イントラネット7、制御PC8、制御リンク9、およびリンク10から構成されている。ルータ1は、インターネット3、イントラネット7、およびサーバー群4とそれぞれリンク10により接続されており、ネットワーク間のパケットの転送などを行う。アクセスポイント5は、リンク10を介してインターネット3、またはイントラネット7に接続されている。PC端末2はリンク10を介して、また、無線端末6はアクセスポイント5を介して、それぞれ端末間の相互通信を行う。また、制御PC8は制御リンク9を介してルータ1に接続されており、ルータ1に対してデータベース更新用のデータ送信などを行う。
As shown in FIG. 1, the network of this embodiment includes a router 1, a PC (Personal Computer)
図2は、図1で示したルータ1の機能構成例を示す図である。図2に示すように、ルータ1は、送受信ユニット11、転送ユニット12、デバイス13、外部メモリ14、およびコントローラ15を含んで構成される。送受信ユニット11と転送ユニット12とは転送経路21で、また、転送ユニット12とデバイス13とは検索経路22で接続されており、デバイス13、外部メモリ14、およびコントローラ15は、それぞれ外部バス接続線24を介して外部バス23に接続されている。
FIG. 2 is a diagram illustrating a functional configuration example of the router 1 illustrated in FIG. 1. As shown in FIG. 2, the router 1 includes a transmission /
次に、各構成要素の機能について述べる。送受信ユニット11は、インターネット3、サーバー群4、およびイントラネット7にそれぞれリンク10を介して接続されている。図3は、Ethernet(登録商標)フレームのフォーマットを示す図である。送受信ユニット11は、リンク10から受信した図3に示すEthernet(登録商標)フレーム25からMAC(Media Access Control)ヘッダ26とFCS(FRAMe Check Sequence)28を取り除いたIPv4(Internet Protocol Version 4)パケット27を転送ユニット12に転送し、また、転送ユニット12から送られたIPv4パケット27に、MACヘッダ26とFCS28を付加してリンク10に送信する。
Next, the function of each component will be described. The transmission /
転送ユニット12は、受信したフレームから、そのフレームの転送に必要なルーティング情報を得るための検索処理に必要なデータ(以下、検索キーという)を抽出し、検索経路22を介してデバイス13へ検索キーを送る。また、デバイス13から検索経路22を介して検索結果(ルーティング情報)を受け取り、その検索結果に基づき、上記の受信したフレームを、転送経路21を介して送受信ユニット11へ転送する。
The
本実施の形態においては、転送ユニット12で抽出され、検索キーが抽出されるヘッダ情報には、ネットワーク層のヘッダに含まれる宛先・送信元アドレス、プロトコル、トータル長、識別子、フラグ、およびフラグメントオフセットと、トランスポート層のヘッダに含まれる宛先・送信元ポート番号、およびシーケンス番号(但し、TCPの場合のみ)と、が含まれる。以下、図3〜6を用いて検索キーについて説明する。
In the present embodiment, the header information extracted by the
なお、以下の例では、ネットワーク層で使用するプロトコルをIPv4とし、また、トランスポート層で使用するプロトコルをTCP(Transmission Control Protocol)またはUDP(User Datagram Protocol)として説明するが、これに限定されることなく、例えば、ネットワーク層で使用するプロトコルをIPv6(Internet Protocol Version 6)とし、また、トランスポート層で使用するプロトコルをRDP(Remote Desktop Protocol)としてもよい。 In the following example, the protocol used in the network layer is assumed to be IPv4, and the protocol used in the transport layer is assumed to be TCP (Transmission Control Protocol) or UDP (User Datagram Protocol), but is not limited thereto. For example, the protocol used in the network layer may be IPv6 (Internet Protocol Version 6), and the protocol used in the transport layer may be RDP (Remote Desktop Protocol).
図3に示すように、IPv4ヘッダ29、TCPヘッダ30、およびUDPヘッダ31は、Ethernet(登録商標)フレーム25にカプセル化されている。
As shown in FIG. 3, the
図4は、ネットワーク層のヘッダであるIPv4ヘッダのフォーマットを示す図である。IPv4ヘッダの先頭から3バイト目にTOS(Type of Service)フィールド32、4バイト目にトータル長(Total Length)33、5バイト目に識別子(Identification)34、7バイト目のうち上位3ビットがフラグ(Flag)35であり、7バイト目の下位5ビットと8バイト目がフラグメントオフセット(Fragment Offset)36、10バイト目にプロトコル(Protocol)37、13バイト目に送信元IPアドレス(Source Address)38、17バイト目に宛先IPアドレス(Destination Address)39が位置している。
FIG. 4 is a diagram showing a format of an IPv4 header which is a header of the network layer. The TOS (Type of Service)
図5は、トランスポート層のヘッダであるTCPヘッダのフォーマットを示す図である。TCPヘッダの先頭から1バイト目に送信元ポート番号(Source Port)40、3バイト目に宛先ポート番号(Destination Port)41、5バイト目にシーケンス番号(Sequence Number)42、9バイト目に確認応答番号(Acknowledgement Number)43が位置している。
FIG. 5 is a diagram illustrating a format of a TCP header that is a header of the transport layer.
図6は、トランスポート層のヘッダであるUDPヘッダのフォーマットを示す図である。UDPヘッダの1バイト目に送信元ポート番号(Source Port)44、3バイト目に宛先ポート番号(Destination Port)45が位置している。 FIG. 6 is a diagram illustrating a format of a UDP header that is a header of the transport layer. A source port number (Source Port) 44 is located in the first byte of the UDP header, and a destination port number (Destination Port) 45 is located in the third byte.
なお、本実施の形態では、パケットのトレーラーとしてEthernet(登録商標)フレームを用いた場合について説明したが、これに限定されるものではない。例えば、ATM(Asynchronous Transfer Mode)またはFDDI(Fiber-Distributed Data Interface)などを用いた場合にも同様に実施できる。 In this embodiment, the case where an Ethernet (registered trademark) frame is used as a packet trailer has been described. However, the present invention is not limited to this. For example, the present invention can be similarly implemented when ATM (Asynchronous Transfer Mode) or FDDI (Fiber-Distributed Data Interface) is used.
また、上記の検索キーの項目は一例であり、ルーティング情報を検索できる情報ではあれば、これに限らない。検索方法およびプロトコルによっては、上記の検索キー情報の項目の一部を用いない場合もあり、また、上記以外の項目(例えば、フローを識別するフィールドであるVLAN(Virtual Local Area Network)ID等)が含まれることもある。 Moreover, the item of said search key is an example, and if it is the information which can search routing information, it will not restrict to this. Depending on the search method and protocol, some of the search key information items may not be used, and items other than the above (for example, a VLAN (Virtual Local Area Network) ID that is a field for identifying a flow). May be included.
デバイス13は、外部メモリ14に記憶されたデータベースを外部バス23および外部バス接続線24を介して取得し、検索経路22から送出された検索キーをもとに、データベースに対して検索処理を行い、検索結果としてルーティング情報を得る。そして、デバイス13は、検索結果を、検索経路22を介して転送ユニット12に通知する。
The
外部メモリ14は、制御PC8から制御リンク9を介して送られたデータベースを記憶している。データベースは、検索キーを用いて、ルーティング情報を検索するためのもので、検索キーとルーティング情報の対応が含まれているものとする。
The
コントローラ15は、制御リンク9を介して制御PC8から送られるルータ1の外部からのデータを、ルータ1内の外部バス23で用いるデータフォーマットに変換する。
The controller 15 converts data from the outside of the router 1 sent from the
図7は、図2におけるデバイス13の内部構成を示す図であり、デバイス13は本実施の形態の検索装置である。図7に示すように、本実施の形態のデバイス13は、検索機能を有する前段の検索処理回路である検索処理回路51と、検索機能を有する後段の検索処理回路である検索処理回路52および検索処理回路53と、運用面にある内蔵RAM57、内蔵RAM58、内蔵RAM59、および内蔵RAM60と、待機面にある内蔵RAM61、内蔵RAM62、内蔵RAM63、および内蔵RAM64と、これらの内蔵RAM群に接続され、検索用データベースの更新要求に応じて待機面にある内蔵RAM群の内容の更新を行うRAM更新回路65と、内蔵RAM58および内蔵RAM62と接続され接続先の内蔵RAMの選択を行うRAM選択回路54と、内蔵RAM59および内蔵RAM63と接続され接続先の内蔵RAMの選択を行うRAM選択回路55と、内蔵RAM60および内蔵RAM64と接続され接続先の内蔵RAMの選択を行うRAM選択回路56と、RAM更新回路65からの更新通知を検索処理回路51、RAM選択回路54、RAM選択回路55、およびRAM選択回路56に通知する通知線66と、を含んで構成される。また、検索処理回路51は内蔵RAM57および内蔵RAM61と、検索処理回路52はRAM選択回路54と、検索処理回路53はRAM選択回路55およびRAM選択回路56と、それぞれ接続されている。次に、各構成要素の詳細について述べる。
FIG. 7 is a diagram showing an internal configuration of the
運用面にある内蔵RAM57、内蔵RAM58、内蔵RAM59、および内蔵RAM60には、検索用データベースが分割して格納されており、これらの内蔵RAM群にアクセスすることにより検索処理が行われる。待機面にある内蔵RAM57、内蔵RAM58、内蔵RAM59、および内蔵RAM60は、検索用データベースの更新時にその内容が更新され、更新後の検索用データベースが格納される。
A search database is divided and stored in the
図8は、検索処理回路51の内部構成を示す図である。図8に示すように、検索処理回路51は、検索経路22から入力された検索キーの出力先を2つの読み込みアドレス生成部から選択する選択回路77と、選択回路77の一方の出力先であると共に、選択回路77から出力された検索キーまたはラッチ71からの出力をもとに、内蔵RAM57における読み込み先のアドレスを生成し、読み込み先のアドレスを内蔵RAM57へ送出する読み込みアドレス生成部71と、内蔵RAM57における読み込み先のアドレスのデータを受信し、検索キーと読み込み先のアドレスのデータとの比較を行う読み込みデータ受信部72と、再度、内蔵RAM57へアクセスするときに、読み込みデータ受信部72にて得られた受信データを一時待ち合わせ、この受信データを読み込みアドレス生成部71へ送るラッチ73と、を含んでいる。
FIG. 8 is a diagram showing an internal configuration of the
さらに、図8に示すように、検索処理回路51は、選択回路77の他方の出力先である読み込みアドレス生成部74と、読み込みアドレス生成部74に接続された読み込みデータ受信部75およびラッチ76と、読み込みデータ受信部72および読み込みデータ受信部75からの検索処理結果が入力され、それを後段の検索処理回路52へ出力する多重化回路78と、を含んでいる。
Further, as shown in FIG. 8, the
次に、読み込みアドレス生成部74、読み込みデータ受信部75およびラッチ76について説明する。図7に示すように、いま、内蔵RAM57は運用面にあり、内蔵RAM61は待機面にある。ここで、運用面とは、検索処理回路からの読み込み先のアドレスを受け付け、該当するアドレスのデータを出力する内蔵RAMを指し、待機面とは、検索処理回路からの読み込み先のアドレスが入力されていない内蔵RAMのことを示す。したがって、内蔵RAM61が待機面から運用面になると、選択回路77は検索キーの出力先として読み込みアドレス生成部74を選択し、読み込みアドレス生成部74、読み込みデータ受信部75およびラッチ76の各処理により内蔵RAM61に格納された検索用データベースの検索が行われる。この検索処理は、上述の、読み込みアドレス生成部71、読み込みデータ受信部72およびラッチ73に基づいた検索処理と同様である。選択処理回路77は、通知線66に接続されており、通知線を介して得られたRAM更新回路からの更新通知に応じて、読み込みアドレス生成部の選択を行う。このように本実施の形態においては、検索処理回路51は、読み込みアドレス生成部71、読み込みデータ受信部72、およびラッチ73を有する検索処理回路と、読み込みアドレス生成部74、読み込みデータ受信部75、およびラッチ76を有する検索処理回路との、2系統の検索処理回路を備えている。
Next, the read
図9は、検索処理回路52内部の回路構成を示す図である。図9に示すように、検索処理回路52は、検索処理回路51の検索処理結果が入力され、この入力データをもとに内蔵RAMにおける読み込み先のアドレスを生成し、この読み込み先のアドレスをRAM選択回路54へ送出する読み込みアドレス送信部81と、RAM選択回路54から送られてきた読み込み先のアドレスのデータを受信し、検索キーと読み込み先のアドレスのデータとの比較を行い、検索処理結果を検索処理回路53へ出力する読み込みデータ受信部82と、を含んで構成されている。RAM選択回路54は、運用面にある内蔵RAMを選択するので、図7に示す例では、内蔵RAM58にアクセスして読み込み先のアドレスのデータを取得する。
FIG. 9 is a diagram showing a circuit configuration inside the
図10は、検索処理回路53内部の回路構成を示す図である。図10に示すように、検索処理回路53は、検索処理回路52の検索処理結果が入力され、この入力データをもとに内蔵RAMにおける読み込み先のアドレスを生成する読み込みアドレス送信部83と、この読み込みアドレス送信部83から送出された読み込み先のアドレスを、RAM選択回路55またはRAM選択回路56へ送出する選択回路85と、RAM選択回路55またはRAM選択回路56から送られてきたデータを多重化して出力する多重化回路86と、多重化回路86から出力された読み込み先のアドレスのデータを受信し、検索処理結果を検索経路22へ出力する読み込みデータ受信部84と、を含んで構成されている。RAM選択回路55およびRAM選択回路56は、それぞれ運用面にある内蔵RAMを選択するので、図7に示す例では、それぞれ内蔵RAM59および内蔵RAM60にアクセスして読み込み先のアドレスのデータを取得する。
FIG. 10 is a diagram showing a circuit configuration inside the
RAM更新回路65は、検索用データベースの更新時に、外部バス23を経由して送られてきたエントリデータを、待機面となっている内蔵RAM群へ書き込む回路である。図7では、待機面は内蔵RAM61、内蔵RAM62、内蔵RAM63、および内蔵RAM64となっている。さらに、RAM更新回路65は、通知線66を介して検索処理回路51、RAM選択回路54、RAM選択回路55、およびRAM選択回路56へエントリ変更を通知する。
The
なお、本実施の形態においては、図7に記載されているように、2ポートの入出力を備えた内蔵RAMを使用したが、これに限らず、他の入出力の形態を備えた内蔵RAMを使用することもできる。 In this embodiment, as shown in FIG. 7, the built-in RAM having two-port input / output is used. However, the present invention is not limited to this, and the built-in RAM having other input / output modes is used. Can also be used.
次に、検索用データベースのデータ構造と、この検索用データベースを、運用面となっている内蔵RAM57、内蔵RAM58、内蔵RAM59、および内蔵RAM60にどのように格納するのかについて説明する。本実施の形態における検索用データベースのデータ構造は、例えば、2分探索木のツリー構造である。図11は、本実施の形態で使用する検索用データベースのデータ構造の一例を示すと共に、エントリデータによって構成されたツリーが内蔵RAM内部でどのように構成されるのかを示す図である。図11に示すように、2分探索の起点となる深さ0におけるエントリデータから深さ4におけるエントリデータまで示されている。なお、エントリデータは黒丸で、エントリデータ間の関係はそれらを相互に接続する直線で示されている。内蔵RAM57では、深さ0から深さ2までのツリー情報が登録され、内蔵RAM58では、深さ3のツリー情報が、内蔵RAM59では、深さ4のツリー情報の内の左半分が、内蔵RAM60では、深さ4のツリー情報の内の右半分が、それぞれ登録されている。
Next, the data structure of the search database and how the search database is stored in the built-in
このように、本実施の形態においては、一つの大きなRAMにツリーのデータ構造全体を記憶するのではなく、複数個の小さなRAMにツリーの階層毎に分けて記憶する。特に、前段のRAMには、ツリー構造の起点を含むツリー構造の上段のデータ(すなわち、深さの浅いデータ)を格納し、後段のRAMには、ツリー構造の下段のデータ(すなわち、深さの深いデータ)を順次格納し、後段のRAMに格納するデータの段数を1段とすることにより、前段のRAMに格納するデータの段数である3段より少なくしている。このような構造により、例えば、ツリー最深部のエントリデータのみを変更する場合には、変更データを保持する内蔵RAM(内蔵RAM59および内蔵RAM60)のみを書き換えるだけでよいため、エントリ変更を検索処理に高速に反映することができる。
Thus, in the present embodiment, the entire data structure of the tree is not stored in one large RAM, but is stored in a plurality of small RAMs divided into tree hierarchies. In particular, the upper RAM stores the upper data of the tree structure including the starting point of the tree structure (that is, data having a shallow depth), and the lower RAM stores the lower data (that is, the depth) of the tree structure. Data) are sequentially stored, and the number of data stages stored in the subsequent RAM is reduced to one, thereby reducing the number of data stages stored in the previous RAM from three. With such a structure, for example, when only the entry data at the deepest part of the tree is changed, it is only necessary to rewrite the internal RAM (the
なお、図9に示すように、検索処理回路52の内部構成は、この検索処理回路52が検索のためにアクセスする内蔵RAM58に格納されたデータの構造(深さ3のツリー情報)に対応して、内蔵RAM58に一回アクセスして検索処理結果を出力するような内部構成となっている。また、検索処理回路53の内部構成も同様であり、検索処理回路53はそれぞれ内蔵RAM59または内蔵RAM56に一回アクセスして検索処理結果を出力するような内部構成となっている。一方、検索処理回路51は、深さ0から深さ2までのデータに対して深さごとに繰り返しアクセスして検索できるように、ラッチ73、74を備え、ラッチ73、74にて検索途中のデータが次にメモリにアクセスするためのタイミングを調整し、ループ処理を行う。
As shown in FIG. 9, the internal configuration of the
なお、本実施の形態においては、検索用データベースのデータ構造として2分探索木を使用しているが、これに限らず、他のデータ構造を使用した実施の形態を構成することができる。 In the present embodiment, the binary search tree is used as the data structure of the search database. However, the present invention is not limited to this, and embodiments using other data structures can be configured.
次に、本実施の形態の動作について説明する。ここで、内蔵RAM57、内蔵RAM58、内蔵RAM59、および内蔵RAM60には、任意のエントリによる検索用データベースが構築されているものとする。
Next, the operation of the present embodiment will be described. Here, it is assumed that a search database with arbitrary entries is constructed in the
まず、検索用データベースの更新時以外における、検索処理回路51、検索処理回路52、および検索処理回路53の動作について、図7〜図10を参照して説明する。まず、デバイス13には、検索経路22を介して検索キーが入力され、この検索キーは検索処理回路51に入力される。
First, operations of the
検索処理回路51に入力された検索キーは、選択回路77により、運用面にある内蔵RAM57にアクセス可能な読み込みアドレス生成部71に送られる。ここで、運用面と待機面との選択情報は、RAM更新回路65から通知線66を介して選択回路77に通知されている。読み込みアドレス生成部71は検索キーの入力を受けて、内蔵RAM57における読み込み先のアドレスを生成し、この読み込み先のアドレスを内蔵RAM57に送る。そして、読み込みデータ受信部72にて、内蔵RAM57から送られてきた読み込み先のアドレスのデータを取得する。読み込みデータ受信部72では、検索キーと取得された読み込み先のアドレスのデータとを比較し、検索キーに相当する検索結果が得られない場合には、さらに内蔵RAM57にアクセスして検索処理を継続する。すなわち、ラッチ73で読み込みデータ受信部72から得られたデータを待ち合わせ、次に、ラッチ73から出力された読み込み先のアドレスのデータをもとに、読み込みアドレス生成部71にて、次の読み込み先のアドレスを生成し、内蔵RAM57へ再度生成した読み込み先のアドレスを送る。そして、内蔵RAM57から送られてきた読み込み先のアドレスのデータを読み込みデータ受信部72にて取得する。このような動作を検索キーと検索対象データベースの構造(RAMに格納されているデータの段数等)に応じて複数回繰り返した後、読み込み先のアドレスのデータを検索処理結果として検索処理回路52へ出力する。図11に示すように、内蔵RAM57には、深さ2までのツリー構造のエントリデータが格納されていることから、検索処理回路51は、一般に、読み込みデータ受信部72にて取得されたデータから読み込み先のアドレスを生成し該当アドレスのデータを読み込む、という操作を2回行う。
The search key input to the
図12−1は、図8における選択回路77、読み込みアドレス生成部71、読み込みデータ受信部72、および多重化回路78での処理のタイミングを示すタイミングチャートである。図12−1においては、各ユニットの処理遅延、および内蔵RAMからのリードタイムを1クロックとした場合を示している。ツリーの深さ2までの検索をおこない、ループしたデータと、入力されてくるデータとの衝突を防ぐためには、検索キーを8クロック毎に入力することになる。すなわち、検索処理回路51は、検索キーの入力から多重化回路78にて検索処理結果を得るまでに8クロックを要する。なお、図12−1では、深さ0におけるアドレスの生成、そのアドレスのデータの取得過程は含まれておらず、2分探索木の探索の起点である深さ0におけるエントリデータと検索キーとの比較はアドレスの生成なしに行うことを仮定している。深さ0におけるアドレスの生成、そのアドレスのデータの取得過程を含めてもよいが、その分、検索処理時間が長くなる。
12A is a timing chart illustrating processing timings in the
次に、検索処理回路51から出力された検索処理結果は、検索処理回路52へ入力される。検索キーに相当する検索結果が既に得られている場合には、この検索処理結果は検索処理回路53へそのまま送られるが、検索処理の途中である場合には、検索処理回路52による検索処理が行われる。図9に示すように、読み込みアドレス送信部81は検索処理回路51からの出力を受けて、内蔵RAMにおける読み込み先のアドレスを生成し、この読み込み先のアドレスをRAM選択回路54へ送る。RAM選択回路54は、運用面にある内蔵RAM58を選択し、検索処理回路52にて生成された読み込み先のアドレスを内蔵RAM58へ送る。そして、内蔵RAM58から送られてきた読み込み先のアドレスのデータを読み込みデータ受信部82にて取得する。この取得されたデータは、図11における深さ3のエントリデータである。読み込みデータ受信部82にて取得された読み込み先のアドレスのデータは検索キーと比較される。そして、検索処理結果は、検索処理回路53へ送られる。
Next, the search processing result output from the
図12−2は、図9における読み込みアドレス送信部81および読み込みデータ受信部82での処理のタイミングを示すタイミングチャートである。図12−2においては、図12−1と同様に、各ユニットの処理遅延、および内蔵RAMからのリードタイムを1クロックとしている。図12−2に示すように、検索処理回路52における検索処理時間は、読み込みアドレス送信部81にて深さ2での検索処理結果を受けてから読み込みデータ送信部82にて深さ3での検索処理結果を受けるまでの3クロックであり、検索処理回路51のように、検索途中の結果をループせずに、1回のリード処理で検索を終了する。
FIG. 12-2 is a timing chart illustrating processing timings in the read
次に、検索処理回路52から出力された検索処理結果は、検索処理回路53へ入力される。検索キーに相当する検索結果が既に得られている場合には、この検索処理結果は検索経路22を介して出力される。検索処理の途中である場合には、検索処理回路53による検索処理が行われる。図10に示すように、読み込みアドレス送信部83は検索処理回路52からの出力を受けて、内蔵RAMにおける読み込み先のアドレスを生成し、この読み込み先のアドレスを選択回路85へ送る。選択回路85は、読み込み先のアドレスに応じてRAM選択回路55またはRAM選択回路56を選択し、読み込み先のアドレスを送出する。続いて、多重化回路86は、RAM選択回路55またはRAM選択回路56から送られてきた読み込み先のアドレスのデータを、読み込みデータ受信部84へ送り出す処理を行う。読み込みデータ受信部84にて取得されたデータは、検索処理結果として検索経路22を介して出力される。ここで、選択回路85がRAM選択回路55を選択した場合には、RAM選択回路55は運用面にある内蔵RAM59にアクセスし、図11に示す深さ4のツリーの左半分を検索する。また、選択回路85がRAM選択回路56を選択した場合には、RAM選択回路56は運用面にある内蔵RAM60にアクセスし、図11に示す深さ4のツリーの右半分を検索する。
Next, the search processing result output from the
図12−3は、図10における読み込みアドレス送信部83、選択回路85、検索回路からRAMへの経路におけるRAM選択回路55またはRAM選択回路56、RAMから検索回路への経路におけるRAM選択回路55またはRAM選択回路56、多重化回路86、および読み込みデータ受信84での処理のタイミングを示すタイミングチャートである。図12−3においては、図12−1と同様に、各ユニットの処理遅延、および内蔵RAMからのリードタイムを1クロックとしている。図12−3に示すように、検索処理回路53における検索処理時間は、読み込みアドレス生成部83にて深さ3での検索処理結果を受けてから読み込みデータ送信部84にて深さ4での検索処理結果を受けるまでの7クロックであり、検索処理回路51のように、検索途中の結果をループせずに、1回のリード処理で検索を終了する。また、読み込みアドレス生成部83には、深さ3での検索処理結果が8クロックごとに入力されている。これは、検索処理回路53には、前段からの検索処理結果が8クロックごとにパイプライン的に入力されるからである。
12-3 illustrates the read
次に、検索動作中における検索用データベースの更新方法について説明する。検索用データベースの更新時には、制御PC8からエントリが変更された新データベースのデータが制御リンク9を介してルータ1に送られる。コントローラ15は、制御PC8から送られてきた新データベースのデータを、制御リンク9上でのデータフォーマットから外部バス23上でのデータフォーマットに変換する。続いて、データフォーマットが変換された新データベースは、外部バス接続線24を介して外部メモリ14へ送られ、保持される。
Next, a method for updating the search database during the search operation will be described. When the search database is updated, data of the new database whose entry has been changed is sent from the
次に、制御PC8からルータ1内のデバイス13に検索用データベースの更新指示が送られると、外部バス接続線24を介してRAM更新回路65に対して更新指示が送られる。RAM更新回路65は、更新指示を受けて、待機面となっている内蔵RAM61、内蔵RAM62、内蔵RAM63、および内蔵RAM64に対して、外部メモリ14に保持されている新データベースを書き込み、新データベースの書き込みが終了すると、検索処理回路51、RAM選択回路54、RAM選択回路55、およびRAM選択回路56に通知線66を介して運用面の変更を指示する。
Next, when a search database update instruction is sent from the
運用面の変更が起きると、まず、検索処理回路51が検索に使用していた内蔵RAM57を内蔵RAM61へ変更するため、選択回路77において検索キーが入力されていない時間に、検索経路22から入力される検索キーの出力先を、読み込みアドレス生成部71から読み込みアドレス生成部74へ変更する。このように、検索処理回路51では、選択回路77により選択される2系統の検索処理回路を利用して、検索に使用する内蔵RAMの切り替えが行われる。
When the operational change occurs, first, the
なお、検索キーが1クロック分以上のビット幅を持つ場合、選択回路77による内蔵RAMの変更のタイミングは、検索キーが途中で切れて読み込みアドレス生成部71、または読み込みアドレス生成部74に送られないように、一続きの検索キーから次の検索キーへと検索キーの入力が途切れる間となる。
When the search key has a bit width of one clock or more, the timing of changing the internal RAM by the
次に、検索処理回路52では、図12−2に示すように、8クロックごとに深さ2での検索処理結果が入力されるので、検索処理回路51にて検索処理を行う内蔵RAMを切り替え後、新データベースによる検索処理結果が検索処理回路52に入力されるまでの間(7クロックの間)に、RAM選択回路54において読み込み先のアドレスの出力先を内蔵RAM58から内蔵RAM62へ変更し、新データベースによる検索をおこなう。このとき、内蔵RAMの切り替えによるデータベースの更新は、検索処理回路51と検索処理回路52の処理能力の速度差、言い換えると、単位時間あたりの検索処理回数の差、を利用して行っている。つまり、検索処理回路51では、検索途中の結果をループし同じ内蔵RAMにリードすることにより検索を行うのに対し、検索処理回路52では、検索処理の途中結果をループせずに、1回のリード処理で検索を終了しているため、検索処理回路52の検索処理能力の速度は、検索処理回路51の検索処理能力の速度を上回る。このような検索処理能力の速度差が存在すれば、前段の検索処理回路51から次のデータが入力されるまでの8クロックの間に、後段の検索処理回路52では検索処理を行うと共に、内蔵RAMの運用面と待機面との切り替えを行うことができる。図12−2に示すように、検索処理回路52における内蔵RAMの切り替えは、検索処理回路52が内蔵RAM58にアクセスして検索を行っている時間を除いて可能となっている。なお、図12−2では、メモリの切り替えが可能なメモリ切替可能時間を斜線で示している。
Next, in the
同様に、検索処理回路53では、検索処理回路51、検索処理回路52と順番に内蔵RAMを切り替え後、新データベースによる検索結果が検索処理回路53に入力されるまでの間(7クロックの間)に、RAM選択回路55およびRAM選択回路56において、読み込み先のアドレスの出力先を内蔵RAM59および内蔵RAM60から内蔵RAM63および内蔵RAM64へ変更し、次の更新指示があるまで、新データベースによる検索処理を行い続ける。このときも同様に、内蔵RAMの切り替えによるデータベースの更新は、検索処理回路51と検索処理回路53の処理能力の速度差を利用して行っている。すなわち、検索処理回路51では、検索途中の結果をループし同じ内蔵RAMにリードすることにより検索を行うのに対し、検索処理回路53では、検索処理の途中結果をループせずに、1回のリード処理で検索を終了しているため、検索処理回路53の検索処理能力の速度は、検索処理回路51の検索処理能力の速度を上回る。図12−3に示すように、検索処理回路53における内蔵RAMの切り替えは、検索処理回路53が内蔵RAM59または内蔵RAM60にアクセスして検索を行っている時間を除いて可能となっている。図12−3では、メモリの切り替えが可能なメモリ切替可能時間を斜線で示している。
Similarly, in the
本実施の形態によれば、前段と後段の検索処理回路の処理能力の速度差を利用し、前段の検索処理回路を上回る処理速度を有する後段の検索処理回路により、検索途中のデータが前段の検索処理回路から後段の検索処理回路へ入力されない時間を利用して新しいエントリ情報を有するメモリへ切り替えることにより、検索動作中であっても検索動作を停止せずに検索用データベースのエントリを更新することができる。 According to the present embodiment, by utilizing the speed difference between the processing capabilities of the search processing circuit of the preceding stage and the subsequent process, the search process circuit of the subsequent stage having a processing speed higher than that of the search process circuit of the previous stage allows the data being searched to be By switching to a memory having new entry information using a time not input from the search processing circuit to the subsequent search processing circuit, the search database entry is updated without stopping the search operation even during the search operation. be able to.
また、本実施の形態においては、検索用データベースのツリー構造を深さ毎に区切って複数個の内蔵RAM内に保持しているため、例えば、ツリー最深部のエントリデータのみを変更する場合には、その最深部のデータを保持する内蔵RAMのみを更新すればよく、エントリ更新を検索処理に高速に反映することができる。図13は、検索用データベースのツリーの最深部のみにエントリ更新がある場合を示す図であり、深さ4におけるエントリデータが更新される場合を示している。前述のように、この場合には深さ4におけるエントリデータを保持する内蔵RAM59および内蔵RAM60の内容を更新するだけでよいので、更新されたエントリを待機面にある内蔵RAM63および内蔵RAM64に書き込み、RAM選択回路55およびRAM選択回路56により、これらの待機面にある内蔵RAMを運用面に変更すればよい。なお、検索用データベースのデータ構造に基づいて内蔵RAMの一部のみを更新するなどの判断は、外部の制御PC8を介して行う。
In this embodiment, the tree structure of the search database is divided into depths and stored in a plurality of built-in RAMs. For example, when only the entry data at the deepest part of the tree is changed. Only the internal RAM that holds the deepest data needs to be updated, and the entry update can be reflected in the search process at high speed. FIG. 13 is a diagram illustrating a case where entry update is performed only in the deepest part of the tree of the search database, and illustrates a case where entry data at
また、本実施の形態においては、後段の検索処理回路の個数を2個とする例を示したが、これは図11に示すデータ構造を例に説明を行ったからであり、検索用データベースの構造と量に応じて、後段の検索処理回路を、適宜、任意個数設定することができ、また、これに応じて、内蔵RAMおよびRAM選択回路も適宜設定することができる。 In the present embodiment, an example in which the number of subsequent search processing circuits is two has been described. This is because the data structure shown in FIG. 11 has been described as an example, and the structure of the search database. Depending on the amount, the number of subsequent search processing circuits can be set as appropriate, and the built-in RAM and RAM selection circuit can also be set accordingly.
また、本実施の形態においては、後段の検索処理回路である検索処理回路52および検索処理回路53がそれぞれ運用面にある内蔵RAMにアクセスして検索を行う回数を1回としたが、これに限定されず、前段の検索処理回路である検索処理回路51が運用面にある内蔵RAMにアクセスして検索を行う回数よりも少なければ、任意の回数としてもよい。すなわち、この条件を満たせば、本実施の形態の効果を得ることができる。なお、この場合には、後段の検索処理回路の内部構造、後段の検索処理回路が検索のためにアクセスする内蔵RAMに格納されているデータ構造等は、アクセスの回数に依存して適宜設定される。
In the present embodiment, the
実施の形態2.
本発明にかかる検索装置およびデータ処理装置の実施の形態2について説明する。本実施の形態を利用したネットワーク構成例は、例えば、図1に示す実施の形態1におけるネットワーク構成と同様である。
A second embodiment of the search device and data processing device according to the present invention will be described. A network configuration example using this embodiment is the same as the network configuration in the first embodiment shown in FIG.
図14は、本実施の形態にかかるデータ処理装置としてのルータ1の内部構成を示す図である。図14に示すルータ1の内部構成と、図2に示す実施の形態1におけるルータ1の内部構成との違いは、図2におけるデバイス13が、図14ではデバイス73で置き換えられている点である。図14におけるその他の構成は、図2における構成と同様である。そのため、図14においては、図2と同一の構成物には同一の符号を付して、その詳細な説明を省略する。次に、図2との違いである検索装置としてのデバイス73の内部構成について述べる。
FIG. 14 is a diagram illustrating an internal configuration of the router 1 as the data processing apparatus according to the present embodiment. The difference between the internal configuration of the router 1 shown in FIG. 14 and the internal configuration of the router 1 in the first embodiment shown in FIG. 2 is that the
図15は、図14におけるデバイス73の内部構成を示す図である。図15に示すように、デバイス73は、RAM更新回路112と、検索キー分離回路101と、前段の検索処理回路である検索処理回路102および検索処理回路103と、検索処理回路102および検索処理回路103からの出力が多重化される検索キー多重化回路104と、後段の検索処理回路である検索処理回路105と、同じく後段の検索処理回路であると共に、検索処理回路105からの検索処理結果が入力される検索処理回路106と、RAM選択回路107、RAM選択回路108、およびRAM選択回路109と、運用面にある、内蔵RAM57および内蔵RAM121、内蔵RAM58および内蔵RAM122、内蔵RAM59および内蔵RAM123、ならびに内蔵RAM60および内蔵RAM124と、待機面にある、内蔵RAM61および内蔵RAM131、内蔵RAM62および内蔵RAM132、内蔵RAM63および内蔵RAM133、ならびに内蔵RAM64および内蔵RAM134と、RAM更新回路112から検索処理回路102および検索処理回路103に接続された通知線112と、を含んで構成される。次に、各構成要素の内部構成および動作について述べる。
FIG. 15 is a diagram showing an internal configuration of the
なお、本実施の形態においては、以下に説明するように、同時に2つの異なる検索キーを扱う例について述べるが、検索キーの個数は2つに限定されることはなく、同時に3つ以上の異なる検索キーを扱う実施の形態を実現することができる。 In the present embodiment, as described below, an example in which two different search keys are handled at the same time will be described. However, the number of search keys is not limited to two, and at least three different search keys can be simultaneously used. An embodiment that handles a search key can be realized.
検索キー分離回路101には検索経路22から検索キーが入力される。検索キー分離回路101は、後述する検索キーを2つに分離し、分離した検索キーの一方を検索処理回路102へ、他方を検索処理回路103へ送り出す回路である。このため、検索処理回路102および検索処理回路103は、検索キー分離回路101の後段に並列して設けられている。
A search key is input from the
図16は、検索経路22から検索キー分離回路101へ入力される検索キーのフォーマットの一例を示す図であり、検索キー600は検索キー601および検索キー602含んで構成されている。検索キー分離回路101は、検索キー610を検索キー601と検索キー602とに分離する。
FIG. 16 is a diagram illustrating an example of a format of a search key input from the
なお、本実施の形態においては、検索キー601を検索処理回路102へ、検索キー602を検索処理回路103へ送るという前提で説明を続けるが、この前提は本発明を限定するものではなく、検索キーの送り先を相互に入れ替えてもよい。
In the present embodiment, the description is continued on the assumption that the
図17は、検索処理回路102内部の回路構成を示す図である。図17に示すように、検索キー分離回路101から入力された検索キー601は、選択回路130にて読み込みアドレス生成部71へ送り出される。このとき、読み込みアドレス生成部71は運用面にある内蔵RAM57へ接続され、一方、読み込みアドレス生成部74は待機面にある内蔵RAM61へ接続されている。読み込みアドレス生成部71では、入力された検索キー601をもとに、内蔵RAM57における読み込み先のアドレスを生成して、内蔵RAM57へ読み込み先のアドレスを送り、内蔵RAM57から送られてきた読み込み先のアドレスのデータを読み込みデータ受信部72にて取得する。
FIG. 17 is a diagram showing a circuit configuration inside the
読み込みデータ受信部72では、取得された読み込み先のアドレスのデータと検索キー601とを比較し、検索キー601に相当する検索結果が得られない場合には、さらに内蔵RAM57にアクセスして検索処理を継続する。すなわち、ラッチ73で読み込みデータ受信部72からのデータを待ち合わせ、次に、ラッチ73から出力された読み込み先のアドレスのデータをもとに、読み込みアドレス生成部71にて、次の読み込み先のアドレスを生成し、内蔵RAM57へ再度生成した読み込み先のアドレスを送る。そして、内蔵RAM57から送られてきた読み込み先のアドレスのデータを読み込みデータ受信部72にて取得する。このような動作を任意回数繰り返した後、読み込み先のアドレスのデータを多重化回路131へ渡して多重化し、通知線111を介して送られてきた検索対象となる内蔵RAMを指定する指定情報(この場合は、内蔵RAM57を指定する指定情報)を付加して、後段の検索キー多重化回路104へ出力する。
The read
検索キー多重化回路104は、検索処理回路102および検索処理回路103から送られてきた検索処理結果を検索処理回路105へ送り出す処理を行う。ここで、検索処理回路103による検索処理も検索処理回路102と同様に行われるが、検索処理回路103が検索対象とする運用面の内蔵RAMは、内蔵RAM121である。
The search
図18は、検索処理回路105内部の回路構成を示す図である。図18に示すように、検索キー多重化回路104から出力された検索処理結果は、検索処理回路105へ入力され、検索途中である場合には、読み込みアドレス送信部141にて読み込み先のアドレスを生成し、検索処理回路102および検索処理回路103で付加された検索対象となる内蔵RAMを指定する指定情報と共に、生成された読み込み先のアドレスをRAM選択回路107へ送る。そして、RAM選択回路107から送られてきた読み込み先のアドレスのデータを読み込みデータ受信部142にて取得し、得られた検索処理結果を検索処理回路106へ出力する。
FIG. 18 is a diagram showing a circuit configuration inside the
RAM選択回路107では、検索処理回路105から送られてきた検索対象となる内蔵RAMを指定する指定情報をもとに、検索キー601による検索中のデータ(読み込み先のアドレス)に対しては内蔵RAM58を、検索キー602による検索中のデータ(読み込み先のアドレス)に対しては内蔵RAM122をそれぞれ選択し、各検索中のデータをそれぞれ選択された内蔵RAMへ送り、各内蔵RAMから該当アドレスのデータを読み出し、その結果を検索処理回路105へ出力する。
The
図19は、検索処理回路106内部の回路構成を示す図である。図19に示すように、検索処理回路105から出力された検索処理結果は、検索処理回路106へ入力され、検索処理結果が検索途中である場合には、読み込みアドレス送信部151にて読み込み先のアドレスを生成し、検索対象となる内蔵RAMを指定する指定情報と共にこの読み込み先のアドレスを選択回路153へ送る。選択回路153では、読み込み先のアドレスに応じてRAM選択回路108またはRAM選択回路109を選択する。例えば、RAM選択回路108が選択された場合には、RAM選択回路108は運用面となっている内蔵RAMを選択し、さらに、検索対象となる内蔵RAMを指定する指定情報に基づいて、読み込み先のアドレスを内蔵RAM59または内蔵RAM123へ送る。検索キー601による検索中のデータ(読み込み先のアドレス)に対しては内蔵RAM59が、検索キー602による検索中のデータ(読み込み先のアドレス)に対しては内蔵RAM123が選択される。同様に、RAM選択回路109が選択された場合には、RAM選択回路109は運用面となっている内蔵RAMを選択し、さらに、検索対象となる内蔵RAMを指定する指定情報に基づいて、読み込み先のアドレスを内蔵RAM60または内蔵RAM124へ送る。検索キー601による検索中のデータ(読み込み先のアドレス)に対しては内蔵RAM60が、検索キー602による検索中のデータ(読み込み先のアドレス)に対しては内蔵RAM124が選択される。続いて、読み込み先のアドレスのデータはRAM選択回路108またはRAM選択回路109を経て多重化回路154へ送られ、さらに、多重化回路154から読み込みデータ受信部152へ送られる。読み込みデータ受信部152にて取得されたデータは、検索処理結果として検索経路22を介してデバイス73から出力される。
FIG. 19 is a diagram showing a circuit configuration inside the
RAM更新回路112は、検索用データベースの更新時に、外部バス23を経由して送られてきたエントリデータを、待機面となっている内蔵RAM群へ書き込む回路である。図15では、待機面を、内蔵RAM61、内蔵RAM62、内蔵RAM63、内蔵RAM64、内蔵RAM132、内蔵RAM132、内蔵RAM133、および内蔵RAM134としている。さらに、RAM更新回路112は、エントリデータの更新指示を、通知線111を使って検索処理回路102および検索処理回路103へ通知する。
The
図20は、エントリデータによって構成されたツリーが各内蔵RAMの内部でどのように構成されるかを示した図である。図20に示すように、本実施の形態ではテーブル201とテーブル202からなる2つのテーブルを使用している。テーブル201では、内蔵RAM57に深さ0から深さ2までのツリー情報が登録されており、内蔵RAM58に深さ3のツリー情報が、内蔵RAM59に深さ4のツリー情報の左半分が、内蔵RAM60に深さ4のツリー情報の右半分が登録されている。テーブル202では、内蔵RAM121に深さ0から深さ2までのツリー情報が登録されており、内蔵RAM122に深さ3のツリー情報が、内蔵RAM123に深さ4のツリー情報の左半分が、内蔵RAM124に深さ4のツリー情報の右半分が登録されている。
FIG. 20 is a diagram showing how a tree configured by entry data is configured in each internal RAM. As shown in FIG. 20, in this embodiment, two tables including a table 201 and a table 202 are used. In the table 201, tree information from
本実施の形態における検索動作中の検索用データベースの更新方法は、実施の形態1と同様である。すなわち、本実施の形態においても、前段の検索処理回路では、検索途中の結果をループし、そのため、毎クロック検索結果が出力されない。一方、後段の検索処理回路では、内蔵RAMへ1回のリード処理で検索が終了する。そして、前段と後段の検索処理回路の処理能力の速度差を利用し、後段の検索処理回路に入力する検索途中のデータが毎クロックではないことを利用して、その間隙に後段の検索処理回路がアクセスする内蔵RAMの切り替えを行い、データベースの更新を行う。 The search database update method during the search operation in the present embodiment is the same as that in the first embodiment. That is, also in the present embodiment, the search processing circuit in the previous stage loops the result in the middle of the search, and therefore the search result for each clock is not output. On the other hand, in the search processing circuit at the subsequent stage, the search is completed by one read process to the built-in RAM. Then, using the speed difference between the processing capabilities of the search processing circuit of the preceding stage and the subsequent stage, and utilizing the fact that the data being searched to be input to the search processing circuit of the subsequent stage is not every clock, the search processing circuit of the subsequent stage is inserted in the gap. The built-in RAM to be accessed is switched, and the database is updated.
本実施の形態によれば、検索動作中であっても検索処理を停止せずに、検索用データベースのエントリの更新ができる。また、検索用データベースのツリー構造を深さ毎に区切って内蔵RAM内に保持しているため、例えば、ツリー最深部のエントリデータのみを変更する場合においては、その最深部のデータを保持する内蔵RAMのみを更新すればよく、エントリ更新を検索処理に高速に反映することができる。また、本実施の形態では、入力される検索キーが2つの分離可能な検索キーを含むことから、前段の検索処理回路が検索対象とする内蔵RAMを同じ内容のデータが保持された2つの内蔵RAMとし、後段の検索処理回路が検索対象とする内蔵RAMを同じ内容のデータが保持された2つの内蔵RAMとすることで、分離された2つの検索キーに対する検索処理を、前段および後段における2つの内蔵RAMに分散して行っている。このように、2つの異なる検索キーに対して、実施の形態1で使用するテーブル検索処理機能に加えて、もう一つのテーブル検索処理機能を付加して並列度を上げることで、検索処理速度を上げつつ、高速なエントリ更新機能を実現できる。 According to the present embodiment, the search database entry can be updated without stopping the search process even during the search operation. In addition, since the tree structure of the search database is stored in the built-in RAM divided by depth, for example, when only the entry data at the deepest part of the tree is changed, the built-in data that holds the deepest part of the data is stored. Only the RAM needs to be updated, and the entry update can be reflected in the search process at high speed. Further, in this embodiment, since the input search key includes two separable search keys, the two internal memories holding the same data are stored in the internal RAM targeted for the search processing circuit in the previous stage. By using the RAM and the built-in RAM to be searched by the subsequent-stage search processing circuit are two built-in RAMs that hold the same data, the search processing for the two separated search keys can be performed in the first and second stages. It is distributed over one built-in RAM. In this way, by adding another table search processing function to the two different search keys in addition to the table search processing function used in the first embodiment, the search processing speed can be increased. It is possible to realize a high-speed entry update function.
また、後段に配置された内蔵RAMに使用されていないものがあるときに、それを他の検索テーブル用に割り当てることにより、資源を有効利用して検索処理の高速化を実現することができる。 Further, when there is an unused internal RAM arranged in the subsequent stage, it is allocated to another search table, so that the search processing can be speeded up by effectively using resources.
以上のように、本発明にかかる検索装置はデータ検索を行うデータ処理において有用であり、特に、検索処理を中断させずに検索用のデータベースの更新を行う情報通信システムに適している。 As described above, the search device according to the present invention is useful in data processing that performs data search, and is particularly suitable for an information communication system that updates a search database without interrupting search processing.
1 ルータ
2 PC端末
3 インターネット
4 サーバー群
5 アクセスポイント
6 無線端末
7 イントラネット
8 制御PC
9 制御リンク
10 リンク
11 送受信ユニット
12 転送ユニット
13 デバイス
14 外部メモリ
15 コントローラ
22 検索経路
23 外部バス
24 外部バス接続線
25 Ethernet(登録商標)フレーム
26 MACヘッダ
27 IPv4パケット
28 FCS
29 IPv4ヘッダ
30 TCPヘッダ
31 UDPヘッダ
32 TOSフィールド
33 トータル長
34 識別子
35 フラグ
36 フラグメントオフセット
37 プロトコル
38 送信元IPアドレス
39 宛先IPアドレス
40 送信元ポート番号
41 宛先ポート番号
42 シーケンス番号
43 確認応答番号
44 送信元ポート番号
45 宛先ポート番号
51、52、53 検索処理回路
57、58、59、60、61、62、63、64 内蔵RAM
54、55、56 RAM選択回路
65 RAM更新回路
66 通知線
67 待機面
68 運用面
71、74 読み込みアドレス生成部
72、75、82、84 読み込みデータ受信部
73、76 ラッチ
77、85 選択回路
78、86 多重化回路
81、83 読み込みアドレス送信部
1
DESCRIPTION OF SYMBOLS 9
29
54, 55, 56
Claims (10)
前記検索キーが入力される前段の検索処理回路と、
この前段の検索処理回路の後段に設けられ、前記前段の検索処理回路の検索処理結果に基づいて、順次、検索処理を行う1または複数の後段の検索処理回路と、
前記前段の検索処理回路が検索を行うための前記検索用データベースの一部が格納され、前記前段の検索処理回路に対応して設けられた前段の運用メモリと、
この前段の運用メモリと対になって設けられ、前記検索用データベースの更新時まで、待機を行う前段の待機メモリと、
前記検索用データベースの残部が全体として格納されるように、前記各後段の検索処理回路が検索を行うためのデータがそれぞれ格納され、前記各後段の検索処理回路にそれぞれ対応して設けられた後段の運用メモリと、
前記各後段の運用メモリと対になって設けられ、前記検索用データベースの更新時まで、待機を行う後段の待機メモリと、
前記検索用データベースの更新時に、更新後の検索用データベースを書き込むことにより前記前段および前記各後段の待機メモリの内容を更新するメモリ更新回路と、
前記メモリ更新回路からの更新通知に基づいて、前記前段の検索処理回路が検索をするメモリを前記前段の運用メモリから前記前段の待機メモリへと切り替える前段の選択回路と、
前記メモリ更新回路からの更新通知に基づいて、前記各後段の検索処理回路が検索をするメモリを前記各後段の運用メモリからそれと対になる前記各後段の待機メモリへと切り替える後段の選択回路と、
を備え、
前記前段の検索処理回路が検索処理に要する検索処理時間は、前記各後段の検索処理回路が検索処理に要する検索処理時間よりも長いことを特徴とする検索装置。 A search device for inputting a search key and searching a search database stored in a memory and outputting a search result,
A search processing circuit in a previous stage where the search key is input;
One or a plurality of subsequent search processing circuits which are provided in the subsequent stage of the search processing circuit of the preceding stage and sequentially perform the search process based on the search processing result of the search processing circuit of the previous stage;
A part of the search database for the search processing circuit of the previous stage to store is stored, and an operation memory of the previous stage provided corresponding to the search processing circuit of the previous stage,
The standby memory provided in a pair with the previous operation memory, the standby memory of the previous stage for waiting until the update of the search database,
Data for the search processing circuit in each subsequent stage to search is stored so that the remainder of the search database is stored as a whole, and the subsequent stage provided corresponding to the search processing circuit in the subsequent stage, respectively. Operating memory,
A standby memory provided in a pair with each of the subsequent operation memories, which waits until the search database is updated;
A memory update circuit that updates the contents of the standby memory in the previous stage and the subsequent stage by writing the updated search database when the search database is updated;
Based on the update notification from the memory update circuit, the selection circuit in the previous stage that switches the memory to be searched by the search processing circuit in the previous stage from the operation memory in the previous stage to the standby memory in the previous stage;
A subsequent-stage selection circuit that switches a memory to be searched by each subsequent-stage search processing circuit from each subsequent-stage operation memory to each subsequent-stage standby memory based on an update notification from the memory update circuit; ,
With
A search apparatus characterized in that a search processing time required for the search processing by the search processing circuit in the preceding stage is longer than a search processing time required for the search processing circuit in each subsequent stage.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006356323A JP4879728B2 (en) | 2006-12-28 | 2006-12-28 | Search device and data processing device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006356323A JP4879728B2 (en) | 2006-12-28 | 2006-12-28 | Search device and data processing device |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2008165616A JP2008165616A (en) | 2008-07-17 |
JP4879728B2 true JP4879728B2 (en) | 2012-02-22 |
Family
ID=39694995
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2006356323A Expired - Fee Related JP4879728B2 (en) | 2006-12-28 | 2006-12-28 | Search device and data processing device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4879728B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6422677B2 (en) * | 2014-06-04 | 2018-11-14 | 株式会社ギデオン | Network relay device, DDoS protection method and load distribution method using the same |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH10190744A (en) * | 1996-12-26 | 1998-07-21 | Toshiba Corp | Information storage device |
JP2002157158A (en) * | 2000-11-20 | 2002-05-31 | Hitachi Ltd | Data management method for database system |
JP2003022209A (en) * | 2001-07-05 | 2003-01-24 | Nri & Ncc Co Ltd | Distributed server system |
JP4219607B2 (en) * | 2002-04-03 | 2009-02-04 | 三菱電機株式会社 | Data search apparatus and server update method |
-
2006
- 2006-12-28 JP JP2006356323A patent/JP4879728B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2008165616A (en) | 2008-07-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR102162730B1 (en) | Technologies for distributed routing table lookup | |
EP2544417B1 (en) | Communication system, path control apparatus, packet forwarding apparatus and path control method | |
US6683885B1 (en) | Network relaying apparatus and network relaying method | |
US6654701B2 (en) | Method and apparatus for measuring protocol performance in a data communication network | |
US6650642B1 (en) | Network relaying apparatus and network relaying method capable of high-speed routing and packet transfer | |
EP0993144B1 (en) | Packet relaying apparatus and method and circuit thereof | |
US7218632B1 (en) | Packet processing engine architecture | |
US10778721B1 (en) | Hash-based ACL lookup offload | |
JP6426879B2 (en) | Data packet transfer | |
JP4974078B2 (en) | Data processing device | |
CN108768866B (en) | Cross-card forwarding method and device for multicast message, network equipment and readable storage medium | |
CN106470158B (en) | Message forwarding method and device | |
JP3627697B2 (en) | Packet destination search system | |
Pontarelli et al. | Parallel d-pipeline: A cuckoo hashing implementation for increased throughput | |
JP2006313949A (en) | Packet transfer apparatus | |
WO2013006154A1 (en) | Traffic forwarding in a point multi-point link aggregation using a link selector data table | |
US6658003B1 (en) | Network relaying apparatus and network relaying method capable of high-speed flow detection | |
US7702882B2 (en) | Apparatus and method for performing high-speed lookups in a routing table | |
JP4879728B2 (en) | Search device and data processing device | |
JPWO2014125636A1 (en) | Communication device or packet transfer method | |
JP3949696B2 (en) | Protocol acceleration device | |
US20050044261A1 (en) | Method of operating a network switch | |
WO2015131617A1 (en) | Flow table processing method, device, openflow controller and openflow switch | |
JP5374290B2 (en) | Network relay device | |
JP2013038536A (en) | Semiconductor device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20090911 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20111031 |
|
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: 20111129 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20111130 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20141209 Year of fee payment: 3 |
|
LAPS | Cancellation because of no payment of annual fees |