JP3935021B2 - Packet processing method and apparatus - Google Patents
Packet processing method and apparatus Download PDFInfo
- Publication number
- JP3935021B2 JP3935021B2 JP2002223439A JP2002223439A JP3935021B2 JP 3935021 B2 JP3935021 B2 JP 3935021B2 JP 2002223439 A JP2002223439 A JP 2002223439A JP 2002223439 A JP2002223439 A JP 2002223439A JP 3935021 B2 JP3935021 B2 JP 3935021B2
- Authority
- JP
- Japan
- Prior art keywords
- packet
- header
- data
- analysis
- packet analysis
- 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)
Description
【0001】
【発明の属する技術分野】
本発明は、受信パケットに搭載されたヘッダに応じて新たに生成したヘッダを送信パケットに搭載するパケット処理方法及び装置に関し、特に複数のプロトコルに対応したパケットのヘッダ解析を高速に処理するネットワークのLANスイッチに使用して好適なパケット処理方法及び装置に関する。
【0002】
【従来の技術】
デジタル通信の分野においては、情報を受け渡しの際にパケット通信が広く用いられている。パケットの先頭には、送信先に関する情報や情報の種類などを示すヘッダを搭載しており、パケット(プロトコル)の種類毎に異なるヘッダを有する。
【0003】
近来広く用いられているパケットの例を図14(a)〜(h)に示す。パケットは種類別に、
(a)RFC194記載のDIXパケット、
(b)IEEE802.3記載のRAWパケット、
(c)IEEE802.2記載のLLC情報405を搭載したLLCパケット及び
(d)LLC+SNAPパケット
と上述の4種のパケットにIEEE802.1Q記載のVLAN情報407を搭載した
(e)DIX+VLANパケット、
(f)RAW+VLANパケット、
(g)LLC+VLANパケット、
(h)LLC+SNAP+VLANパケット
の合計8種類があり、パケット処理装置にはこれら8種のパケットの正確、かつ速やかな処理が求められている。
【0004】
各々のパケットのLayer2ヘッダ(以下、L2ヘッダ)はMAC−DA情報( 送信先MACアドレス)401、MAC−SA情報(送信元MACアドレス)402、Type情報403、Length情報404、LLC情報405、SNAP情報406、VLAN情報407が搭載されており、L2ヘッダは各々の情報の組み合わせにより構成されているため、パケットの種類毎にL2ヘッダの長さが異なる。なお図14では、これらの情報を単に「MAC−DA」、「Type」などと簡略に表示している。
【0005】
パケットにはL2ヘッダに続きペイロード408が搭載されていて、IPv4パケットの場合、図15に示すように先頭から順に、Version情報701、ヘッダ長情報702、TOS情報703、トータル長情報704、識別番号情報705、フラグメント情報706、TTL情報707、プロトコル番号情報708、ヘッダチェックサム情報709、送信元IPアドレス情報710、送信先IPアドレス情報711、オプション情報712からなるLayer3ヘッダ(以下、L3 ヘッダ)が搭載されている。
【0006】
IPv4ルーティング機能を持つパケット処理装置の場合、上述のMAC−DA情報401、MAC−SA情報402、TTL情報707、ヘッダチェックサム情報709を書き換えた送信パケットヘッダを新たに生成する必要があり、特に新たに生成するMAC−DA情報401は、送信先IPアドレス情報711に応じた値にする必要がある。
【0007】
従来、この種の装置として、図13に示される特開平11−317783号公報に記載のパケット処理装置のような構成のものが使用されていた。同図において、レジスタ350はパケットの下位レイヤヘッダと上位レイヤヘッダとを含むパケットの先頭部分の情報を記憶するメモリであり、CPU354にてレジスタ350に記憶された受信パケットヘッダを解析し、受信パケットヘッダに含まれる送信パケットヘッダ生成に必要な情報を抽出してレジスタ351に格納し、CPU355にてテーブル357を参照してレジスタ351に格納された情報に対応する値をレジスタ352に格納し、レジスタ352に格納された値に応じてCPU356にて新たに送信パケットヘッダを生成し、レジスタ353に格納する構成となっている。このレジスタ350、351、352間でデータを受け渡すために、書き込み可能か、読み出し可能かのフラグ用レジスタを確認しながら、各プログラムの開始を判定していた。
【0008】
【発明が解決しようとする課題】
上述したように、L2ヘッダ及び上位レイヤヘッダの長さは、各パケットの種類により異なるので、従来のパケット処理装置が、受信パケットから送信先IPアドレス情報711を抽出してレジスタ351に格納するためには、CPU354は、
・L2ヘッダを読み込む処理ステップと、
・読み込んだL2ヘッダの長さを求める処理ステップと、
・求められたL2ヘッダの長さに応じて送信先IPアドレス情報711の位置を検知する処理ステップと、
・検知した位置から送信先IPアドレス情報711を読み込む処理ステップと、
・読み込んだ送信先IPアドレス情報711をレジスタ351に格納する処理ステップとを、
実行する必要がある。また、L2ヘッダを読み込む処理ステップでは、CPU354が1回で読み込みできるデータの量にL2ヘッダを分割し、数回に分けて繰り返し読み込む必要がある。
【0009】
すなわち、受信パケット上の送信先IPアドレス情報711の位置を検知するまでにかかる時間は、CPU354が1回あたりに読み込み可能なデータ量と単位時間あたりに読み込みできる回数とに依存し、高いスループットのパケット処理装置ほど高性能なCPU354を必要とするので、製品のコスト高を招いてしまう。同様に、レジスタ353への送信パケットヘッダの書き込みにかかる時間は、CPU356が1度に書き込みできるデータ量と、単位時間あたりに書き込みできる回数とに依存し、高いスループットのパケット処理装置ほど高性能なCPU356を必要とするので、やはり製品のコスト高を招いてしまう(第1の課題)。
【0010】
また、各CPU354、355、356間は、固定周期、かつレジスタ350、351、352、353毎に搭載したフラグレジスタ情報の使用可否を通知及び検出していた。このため、レジスタ350、351、352、353のリードと判定を行い、パケット解析以外の余分な処理ステップを必要とし、パケット解析を含むプログラムサイズが増大、つまりプログラム蓄積用メモリも増大して製品のコスト高を招いてしまう(第2の課題)。
【0011】
また従来装置では、受信用レジスタ350と、テーブル357と接続できるレジスタ351、352と、送信時に使用するレジスタ353が固定されているため、例えば処理負荷によってテーブル357と接続できるレジスタ351、352を変更したい場合にも変更ができない。このため、前述のIPv4ヘッダばかりでなく、IPv6ヘッダ、MPLSに代表される様々な種類のヘッダを搭載したパケットを処理できるパケット処理装置が求められていて、新たなプロトコルが日々定義されているので、修正変更や将来の機能変更が容易で、設計変更の柔軟性に富むパケット処理装置が望まれる(第3の課題)。
【0012】
よって本発明は、上述した第1の課題に鑑み、新たな送信パケットヘッダを生成するために必要な情報の抽出処理と、送信パケットヘッダの生成処理との各々に高性能なCPUを特に用意する必要がないパケット処理装置を提供することを目的とする。
本発明はまた、上述した第2の課題に鑑み、受信パケット解析のみに必要なメモリサイズのパケット処理装置を提供することを目的とする。
本発明はまた、上述した第3の課題に鑑み、IPv4ヘッダばかりでなく、IPv6ヘッダやMPLSに代表される様々な種類のヘッダを搭載した受信パケットに対して修正変更や将来の機能変更が容易で、設計変更の柔軟性に富むパケット処理装置を提供することを目的とする。
【0013】
【課題を解決するための手段】
請求項1に記載の発明は、
受信パケットのヘッダを送信パケットのヘッダに変換するための検索データを検索テーブルに記憶する検索データ記憶ステップと、
前記受信パケットの種類を判定するための比較情報を記憶する比較情報記憶ステップと、
前記受信パケットのデータ区切りを検出し、ヘッダ相当データ部分とペイロード相当データ部分を分離する受信パケット分離ステップと、
前記受信パケットの種類及び/又はあらかじめ割り当てたパケット解析内容に応じた数でパイプライン構成され、固定周期で前記受信パケット分離ステップにより分離された前記ヘッダ相当データ部分と前記比較情報記憶ステップにより記憶されている比較情報を比較して前記受信パケットの種類を判定するとともに、前記検索テーブルを検索して必要に応じて前記ヘッダ相当データを更新して次段に出力するとともに、当該解析結果を次段が使用する場合に次段に引き継ぐ1つ以上のパケット解析ステップと、
前記1つ以上のパケット解析ステップの最終段からのヘッダ相当データと前記受信パケット分離ステップにより分離された前記ペイロード相当データ部分を結合して送信パケットとして出力する更新パケット送信ステップとを、
備え、
前記パケット解析ステップの各々は、
前記受信パケット分離ステップにより分離されたヘッダ相当データ部分を格納して格納完了後にパケット解析開始タイミング信号を出力するヘッダデータ記憶ステップと、
パケット解析プログラムに応じて前記ヘッダデータ記憶ステップにより異なる情報を抽出して記憶するため、及び前記比較情報と前記パケット解析プログラム実行中に生成した一時的なデータを記憶するためのヘッダ編集記憶ステップと、
前記パケット解析プログラムを実行したパケット解析結果を記憶するヘッダ解析結果記憶ステップと、
汎用レジスタを用いて、前記ヘッダデータ記憶部から出力されたパケット解析開始タイミング信号をトリガとしてパケット解析プログラムの実行を開始する汎用演算ステップと、
前記パケット解析プログラムに含まれる特殊演算命令に基づいて、前記ヘッダデータ記憶ステップ、前記ヘッダ編集記憶ステップ、前記ヘッダ解析結果記憶ステップ又は前記比較情報記憶ステップの結果のデータを、直接、読み出し、読み出したデータに対してパケット解析のための論理演算を実行し、結果を前記ヘッダデータ記憶ステップ、前記ヘッダ編集記憶ステップ、前記ヘッダ解析結果記憶ステップ又は前記比較情報記憶ステップの結果のデータとして記憶する、特殊演算ステップとを、
有する、パケット処理方法である。
また請求項2に記載の発明は、
受信パケットのヘッダを送信パケットのヘッダに変換するための検索データを記憶する検索テーブルと、
前記受信パケットの種類を判定するための比較情報を記憶する比較情報記憶部と、
前記受信パケットのデータ区切りを検出し、ヘッダ相当データ部分とペイロード相当データ部分を分離する受信パケット分離部と、
前記受信パケットの種類及び/又はあらかじめ割り当てたパケット解析内容に応じた数でパイプライン構成され、固定周期で前記受信パケット分離部により
分離された前記ヘッダ相当データ部分と前記比較情報記憶部により記憶されている比較情報を比較して前記受信パケットの種類を判定するとともに、前記検索テーブルを検索して必要に応じて前記ヘッダ相当データを更新して次段に出力するとともに、当該解析結果を次段が使用する場合に次段に引き継ぐ1つ以上のパケット解析エレメントと、
前記1つ以上のパケット解析エレメントの最終段からのヘッダ相当データと前記受信パ ケット分離部により分離された前記ペイロード相当データ部分を結合して送信パケットとして出力する更新パケット送信部とを、備え、
前記パケット解析エレメントの各々は、
前記受信パケット分離部から送出されたヘッダ相当データ部分を格納して格納完了後にパケット解析開始タイミング信号を出力するヘッダデータ記憶部と、
パケット解析プログラムに応じて前記ヘッダデータ記憶部から異なる情報を抽出して記憶するため、及び前記比較情報と前記パケット解析プログラム実行中に生成した一時的なデータを記憶するためのヘッダ編集記憶部と、
前記パケット解析プログラムを実行したパケット解析結果を記憶するヘッダ解析結果記憶部と、
汎用レジスタを有し、前記ヘッダデータ記憶部から出力されたパケット解析開始タイミング信号をトリガとしてパケット解析プログラムの実行を開始する汎用演算器と、
前記パケット解析プログラムに含まれる特殊演算命令に基づいて、前記ヘッダデータ記憶部、前記ヘッダ編集記憶部、前記ヘッダ解析結果記憶部又は前記比較情報記憶部に対して、直接、データを読み出し、読み出したデータに対してパケット解析のための論理演算を実行し、結果を前記ヘッダデータ記憶部、前記ヘッダ編集記憶部、前記ヘッダ解析結果記憶部又は前記比較情報記憶部に対して、直接、書き込みする特殊演算器とを、
有する、パケット処理装置である。
請求項1、2に記載の発明によれば、受信パケットヘッダ内の各フィールドの識別や、検索キー情報の抽出や、検索結果受信後の送信パケットヘッダ生成などの処理を受信パケットの種類に応じて何個のパケット解析エレメントで処理するか、また、それぞれのパケット解析エレメントにどのような処理をさせるのかを選択できるため、高性能なCPUを特に用意する必要がない。
【0014】
請求項3に記載の発明のパケット処理装置は、前記パケット解析エレメントの各々が、
当該パケット解析エレメントが実行するパケット解析プログラムを記憶するメモリを備え、
前記固定周期の後に前記パケット解析プログラムの実行を完了してパケット解析完了タイミング信号を次段のエレメント又は更新パケット送信部に出力する構成とした。
請求項3に記載の構成によれば、パイプライン構成のパケット解析エレメント間の情報の引継ぎもあらかじめ決めたタイミング信号で行うことから特別なフラグ(レジスタ)及び処理を必要としないため、メモリサイズをすべて個別のパケット解析処理に割り当てることができる。
【0015】
請求項4に記載の発明は、前記パケット解析エレメントの各々がさらに、
前記パケット解析完了タイミング信号に同期して前記ヘッダ解析結果記憶部で記憶したデータを後段のパケット解析エレメントのヘッダ解析結果記憶部へ出力する構成とした。
請求項4に記載の構成によれば、1つ以上のパケット解析エレメントにて構成した場合に、前段のパケット解析エレメントで抽出、解析した情報を重複して処理することがないので、プログラムの負荷分散が柔軟に対応でき、また、プログラム蓄積用メモリサイズをすべて個別のパケット解析処理に割り当てることができる。
【0016】
請求項5に記載の発明は、前記ヘッダ解析結果記憶回路が、
現ヘッダの解析をしている間に次のパケットを受信して前記現ヘッダの解析結果に次ヘッダの解析結果を上書きしないように2面で構成され、各面を前記パケット解析完了タイミング信号毎に切り替えて交互に記憶する構成とした。
請求項5に記載の構成によれば、次パケットの受信中でも、現パケットの解析結果情報を保持できるため、スループットが低下することなく、パケット解析結果情報を後段のパケット解析エレメントへ伝達できる。
【0018】
請求項6に記載の発明は、前記特殊演算器がさらに、前記パケット解析プログラムに含まれる即値の論理演算を行う構成とした。
請求項6に記載の構成によれば、設計変更や機能追加を実現することができる。
【0019】
請求項7に記載の発明は、前記特殊演算命令は、前記ヘッダデータ記憶部と、前記ヘッダ解析結果記憶部と、前記ヘッダ編集記憶部と前記比較情報記憶部のいずれかのデータを直接リード、ライトするためのアクセス制御信号と、命令実行時に必要な各種イネーブル信号を含む構成とした。
請求項7に記載の構成によれば、特殊演算命令の実行に必要な情報をヘッダデータ記憶部、ヘッダ解析結果記憶部、ヘッダ編集記憶部、比較情報記憶部のデータを直接リード、ライトできるようにアドレスなどのアクセス制御信号を生成し、かつ命令実行時に必要な各種イネーブル信号を生成できる。
【0020】
請求項8に記載の発明は、前記ヘッダデータ記憶部は、パケット受信中に書き込まれる面と、前記汎用演算器及び特殊演算器により解析されている面の2面構成で各パケットの前記ヘッダ相当データを交互に格納するヘッダレジスタを備えた構成とした。
請求項8に記載の構成によれば、現パケットの解析中でも、次パケットの受信を開始できるため、ワイヤースピードを維持しながら、パケット解析エレメント内CPU及び特殊演算器へヘッダ相当データを伝達し、かつ後段のパケット解析エレメント内のヘッダデータ記憶回路へデータを引き継ぐことができる。
【0021】
請求項9に記載の発明は、前記受信パケット分離部により分離された複数の受信パケットの各ペイロード相当データ部分を、前記最終段のエレメントの処理が終了するまで収容するペイロード収容部をさらに備え、前記ペイロード収容部は、前記複数のパケットのペイロード相当データを1つのペイロードデータ蓄積用メモリに格納してポインタにより管理する構成とした。
請求項9に記載の構成によれば、1つのメモリに対してパケット解析中のヘッダ相当データに対応する数分のポインタのみを管理しているため、複数の受信パケットの各ペイロードデータ収容用のメモリを必要とせずに低コストに装置を実現できる。
【0022】
請求項10に記載の発明は、前記検索テーブルを検索するために前記1つ以上のパケット解析エレメントが出力した検索キーを選択して前記検索テーブルに出力するとともに、前記検索キーに基づいて前記検索テーブルから出力された検索結果を前記検索キーを出力した前記パケット解析エレメントに出力する検索データセレクタをさらに有する構成とした。
請求項10に記載の構成によれば、複数のパケット解析エレメントで構成した場合に、検索データセレクタが、いずれのパケット解析エレメントからの検索キーでも受信でき、またいずれのパケット解析エレメントへも検索結果を送信できるので、複数のパケット解析エレメントでも検索テーブルとアクセスができ、プログラム処理の柔軟性が高くなる。
【0023】
請求項11に記載の発明は、前記検索データセレクタが、
前記検索テーブルに対する各エレメントの検索時間の違いに対応するためのキューを具備し、前記検索テーブルから出力された検索結果データを前記キューに蓄積し、出力先となるパケット解析エレメントからの指示により出力する構成とした。
請求項11に記載の構成によれば、検索データセレクタが検索テーブルからの検索結果データをFIFOで受信する場合に、検索テーブルの応答時間が変化してもパケット解析エレメントが必要なタイミングで検索結果データを受信できる。
【0024】
請求項12に記載の発明は、前記更新パケット送信部が、
前記最終段のパケット解析エレメントから送信指示が出力される場合に、ヘッダデータへの書換・挿入・削除指示に従ってヘッダ相当データの更新を行った上でペイロード収容部から続くペイロード相当データと結合してパケットとして送信し、
前記最終段のパケット解析エレメントから破棄指示が出力される場合に、ペイロード収容部へのペイロード読み出し制御信号を経由して破棄指示されたペイロード相当データと結合する予定であった読み出すべきポインタではなく、次に読み出すべきポインタを選択して次の読み出し指示まで保持する構成とした。
請求項12に記載の構成によれば、更新パケット送信部が、パケット解析エレメントでの解析結果に応じて、ヘッダデータ記憶回路を経由して記憶してきたヘッダ相当データから新たに生成されたヘッダとペイロード収容部とが記憶したペイロード相当データから新たな送信パケットを生成できる。
【0025】
請求項13に記載の発明は、初段のエレメントにおいて前記ヘッダデータ記憶回路に記憶されたヘッダ相当データと、前記ヘッダ編集記憶回路に記憶された一時的なデータと、前記ヘッダ解析結果記憶回路に記憶されたパケット解析結果の3系統のデータに対して各パケット毎に共通のシーケンシャルな番号を付与して最終段のエレメントに転送し、最終段のエレメントにおいて前記シーケンシャルな番号により同じパケットの前記3系統のデータを整合する構成とした。
請求項13に記載の構成によれば、パケット解析のために1つの受信パケットから抽出された情報は3経路を経由するが、各経路で共通なシーケンシャル番号を付与して伝達されるため、その整合性を最終的に検出する比較回路をパケット解析エレメント内に搭載することにより、パケット処理装置内での信頼性向上を図ることができる。
【0026】
【発明の実施の形態】
以下、図面を参照して本発明の実施の形態について説明する。図1に示す本発明によるパケット処理装置は概略的に、受信パケット分離部10と、パイプラインで構成された1つ以上のパケット解析エレメント(以下単にエレメントともいう)100(100a、100b〜100N)と、受信パケットペイロード収容部(単にペイロード収容部ともいう)20と、検索テーブル40と、検索データセレクタ30と、比較情報記憶回路50と更新パケット送信部60とを具備しており、上記各部の詳細を図2〜図9に示している。
【0027】
受信パケット分離部10は、例えば図14(a)〜(h)に示すようにフォーマットの異なる受信パケット1のデータ区切りを検出してヘッダ相当データ11とペイロード相当データ12を分離し、それぞれを初段のパケット解析エレメント100aとペイロード収容部20に出力する。
【0028】
各パケット解析エレメント100はそれぞれ、パケット分離部10により分離されたヘッダ相当データ11、前段のエレメント100からのデータを格納してパケット種別の解析を行い、ヘッダを更新する。例えば図14(a)〜(h)に示す8種類のパケット種別を判定する場合には、最初のエレメント100aにおいてVLAN情報407などの有無を判定することにより2つにグループ分けすることができ、次いで2番目のエレメント100bにおいてLength情報404などの有無を判定することにより、さらに2つにグループ分けすることができ、次いで3番目のエレメント100cにおいてSNAP情報406などの有無を判定することにより1つのパケット種別を特定することができるので、エレメント100は3つで構成すればよい。また、将来、判定するパケット種別が増えた場合にはその分を3番目のエレメント100cの後段に増設すればよい。ここで、各エレメント100は固定周期で、パケット解析とヘッダ変換処理を実行するように構成され、当該解析結果を次段が使用する場合に後段のエレメント100に渡すように構成されている。
【0029】
検索テーブル40には、受信パケット1のヘッダを送信パケットのヘッダに変換するための検索データが格納され、例えばMAC−DA情報401と送信先IPアドレス情報711の対応関係などが格納されている。検索データセレクタ30はパケット解析エレメント100a、100b〜100Nの1つ以上のうち、いずれかから抽出された検索キーデータ171a、171b〜171Nを検索キーデータ31として検索テーブル40へ出力し、また、検索テーブル40から送出された、検索キーデータ31に対応する検索結果データ41を検索データセレクタ30にて選択した検索結果データ32a、32b〜32Nのいずれか1つをあらかじめ決めたパケット解析エレメント100a、100b〜100へ出力する。
【0030】
ここで、図2は各エレメント100内のバス構成を詳しく示し、符号111、112、113、141、142、132は、バス上を伝送されることを示している。比較情報記憶回路50は、あらかじめ、例えば図14(a)〜(h)に示すようなパケット種別を判定するための比較情報を記憶し、その比較情報を各エレメント100内のCPU110a、110b〜110Nからのアクセス制御信号112a、112b〜112Nとデコーダ130a、130b〜130Nからのアクセス制御信号132a、132b〜132Nに従い、それぞれリードデータ(111a、111b〜111N)、(141a、141b〜141N)としてCPU110a、110b〜110N、特殊演算器140a、140b〜140Nへ出力する。
【0031】
更新パケット送信部60は1つ以上のパケット解析エレメント100a、100b〜100Nのうち、最終段にあたるパケット解析エレメント100Nからの指示に従って更新するヘッダ相当データ11とペイロード収容部20から出力される送信待ちパケットペイロードデータ21をシーケンシャルに結合して出力する。
【0032】
<受信パケット分離部10>
図1に示すパケット処理装置は図14に示すような可変長な受信パケット1を受信して、受信パケット分離部10が受信パケット1を8bit(ビット)、16bit、32bitなどあらかじめ決めたビット幅で取り込み、図14に示すような送信先MACアドレス(MAC−DA)401から始まるデータの区切り単位に並べ替えて、図14、図15に示すようなL2ヘッダや上位ヘッダが含まれると推測されるあらかじめ決めたデータ長分のヘッダ相当データ11と、それ以外のペイロード相当データ12の2つのデータに分離し、ヘッダ相当データ11はパケット解析エレメント100aへ、ペイロード相当データ12は、受信パケットペイロード収容部20へそれぞれ出力する。
【0033】
<パケット解析エレメント100>
受信パケット分離部10にて分離したヘッダ相当データ11は、初段のパケット解析エレメント100aに格納される。パケット解析エレメント100は1つ以上のパイプラインで構成され、1つで構成する場合にはパケット解析エレメント100a=100Nとなり、2つ以上の場合は、各パケット解析エレメント100で格納したヘッダ相当データ11はあらかじめ決めた固定周期後に、後段のパケット解析エレメント100b、100c〜100N又は更新パケット送信部60へ出力する。
【0034】
パケット解析エレメント100a、100b〜100Nは、ヘッダ相当データ11を格納すると、エレメント100内部でヘッダ相当データ11のうち、パケット解析プログラムにより解析が行えるビット列が格納されたことを通知するパケット解析開始タイミング信号152a、152b〜152Nを生成し、このパケット解析開始タイミング信号152a、152b〜152Nをトリガにパケット解析プログラムを実行開始する。
【0035】
各パケット解析プログラムからアクセス制御信号に従い、受信パケット1のヘッダ相当データ11から抽出した情報と比較してパケット解析プログラムが必要とする情報か否かを識別するために、全パケット解析エレメント100が共通して記憶している情報から、パケット解析プログラムに必要な比較情報を比較情報記憶回路50が生成することで、データの先頭から順次データを識別、抽出する。解析を進め、フォーマットを明らかにしたり、後述のような検索キーデータ31や検索結果データ41からの情報抽出など各パケット解析エレメント100毎のパケット解析プログラムの実行を終え、あらかじめ決めた固定周期後に後段のパケット解析エレメント100a、100b〜100N(1つの場合は 、同一 パケット解析エレメント100)へ解析結果とヘッダ相当データ11を引き継ぐ。
【0036】
受信パケットペイロード収容部20は、受信パケット分離部10からのペイロード相当データ12を格納し、受信パケット分離部10から分離されたもう一方のデータであるヘッダ相当データ11が、1つ以上のパイプライン構造となっているパケット解析エレメント100a、100b〜100Nを経由し、更新パケット送信部60がリードするまでの間、ペイロード相当データ12を保持している。
【0037】
新たなヘッダを搭載した送信パケット61は、前述のようにパケット解析エレメント100a、100b〜100Nによる解析結果と、検索テーブル40の検索により送信先を決める。その際に、検索データセレクタ30は、パケット解析エレメント100a、100b〜100Nのいずれかがヘッダ相当データ11から抽出した検索キーデータ31を出力するので検索テーブル40へ出力し、また検索テーブル40が検索キーデータ31に該当するエントリ(検索結果データ)41をあらかじめ決めたパケット解析エレメント100a、100b〜100Nに送出する。
【0038】
<更新パケット送信部60>
更新パケット送信部60はペイロード収容部20の制御により、パケット解析エレメント100a、100b〜100Nのうち、最終段にあたるパケット解析エレメント100Nからの指示に従って更新するヘッダ相当データ11をリードし、ヘッダ相当データ11の最終データを検出すると、そのヘッダ相当データ11に対応する送信待ちパケットペイロードデータ21をシーケンシャルに結合できるようにリードして送信パケット61を出力する。
上述の構成により、ヘッダ相当データ11内の各フィールドの識別や検索キー情報の抽出や検索結果受信後の新ヘッダ生成などの各種処理を、1つ以上の何個のパケット解析エレメント100で処理するのか、それぞれのパケット解析エレメント100でどのような処理、つまりパケット解析プログラムを実行させるのかを選択できる。
【0039】
<<エレメント100の詳細な説明>>
図1に示すパケット解析エレメント100a、100b〜100Nはそれぞれ、
・受信パケット分離部10、前段のエレメント100から送出されたヘッダ相当データ11を格納するヘッダデータ記憶回路(単にヘッダ記憶回路ともいう)150a、150b〜150N(図5に詳しく示す)と、
・パケット解析プログラムを記憶しているメモリ120a、120b〜120Nと、
・メモリ120a、120b〜120Nにそれぞれ記憶されているパケット解析プログラムの各命令をフェッチ、デコード、実行し、また、フェッチした結果の中から特殊演算命令指示信号115a、115b〜115Nを出力するCPU110a、110b〜110Nと、
・CPU110a、110b〜110Nが出力する特殊演算命令指示信号115a、115b〜115Nをデコードする特殊演算命令デコード回路(デコーダ)130a、130b〜130N(図4に詳しく示す)と、
・デコーダ130a、130b〜130Nがそれぞれデコードした特殊演算命令133a、133b〜133Nを実行する特殊演算器140a、140b〜140N(図3に詳しく示す)とを、
具備している。
【0040】
上記構成において、ヘッダデータ記憶回路150a、150b〜150Nはそれぞれ、ヘッダ相当データ11のあらかじめ決めたビット数分を格納できた際にパケット解析開始タイミング信号152a、152b〜152Nを特殊演算器140a、140b〜140Nに出力する。これをトリガにCPU110a、110b〜110Nがパケット解析プログラムを実行開始し、また、並行して特殊演算器140a、140b〜140Nが特殊演算命令(特殊演算命令デコード信号133a、133b〜133N)を実行する。
【0041】
このとき、CPU110a、110b〜110Nはそれぞれ、ヘッダデータ記憶回路150a、150b〜150Nに対して出力するアクセス制御信号112a、112b〜112Nにより、読み出しデータ111a、111b〜111Nのリードと、書き込みデータ113a、113b〜113Nのライトを行い、また、CPU110a、110b〜110Nが内蔵する汎用レジスタと転送を繰り返し、各種汎用演算を実行する。また、デコーダ130a、130b〜130Nはそれぞれ、CPU110a、110b〜110Nが出力する特殊演算命令指示信号115a、115b〜115Nをデコードして特殊演算命令133a、133b〜133Nを特殊演算器140a、140b〜140Nに出力するとともに、特殊演算用データ抽出アクセス制御信号132a、132b〜132Nを生成してバスを介してヘッダデータ記憶回路150a、150b〜150Nと比較情報記憶回路50に出力する。
【0042】
ヘッダデータ記憶回路150a、150b〜150Nはそれぞれ、格納した受信パケット1のヘッダからヘッダ抽出情報を抽出してバスを介してリードデータ141a、141b〜141Nとして特殊演算器140a、140b〜140Nに出力する。比較情報記憶回路50は、このリードデータ141a、141b〜141N(ヘッダ抽出情報)と比較するための比較情報を抽出してバスを介してリードデータ141a、b、・・・、Nとして出力する。特殊演算器140a、1 40b〜140Nはそれぞれ、ヘッダ抽出情報と比較情報とを比較して、比較結果情報である状態通知信号142a、142b〜142NをCPU110a、110b〜110Nへ出力し、これにより、状態通知信号142a、142b〜142Nに応じ後段のパケット解析エレメント100に送信すべきパケットを判定するようになっている。
【0043】
ここで、図14に示すように、受信パケット1の19・20バイト目は、Type情報、Length情報又はVLAN情報の先頭2バイトのいずれかなので、例えばパケット解析プログラムにより特殊演算命令デコード回路130aがヘッダ抽出情報として、ヘッダデータ記憶回路150aへ受信パケット1の19・20バイト目を抽出するようにアクセス制御信号132aを出力し、かつ比較情報としてIPv4を示す0800hを生成するように比較情報記憶回路50が同様にデコーダ130aからのアクセス制御信号132aよりヘッダデータ記憶回路150aから出力させることで、状態通知信号142に含まれる一致比較結果信号がヘッダ抽出情報と比較情報の一致を示した場合には、受信パケット1をDIXパケットと判定して、後段のパケット解析エレメント100からDIXパケットの処理を開始し、また、不一致を示した場合には、次回から受信パケット1の19・20バイト目がLength情報とVLAN情報の先頭2バイトとのうちいずれなのかを判定する処理を開始するようになっており、したがって、受信パケット1の複数のフォーマットを判別でき、判別した受信パケット1のフォーマットに応じたパケットの処理ができる。
【0044】
また各パケット解析エレメント100はパイプライン構成としているが、それぞれは同一の構成、同一の機能を持つので、各エレメント100に搭載するパケット解析プログラムの変更により、ハードウェアの変更なく同一構成で、異なるプロトコルのヘッダ解析も行うことができる。
【0045】
上述の構成より、単に各パケット解析エレメント100を汎用CPU110のみの構成に比べ、CPU110と特殊演算器140を組み合わせたことにより、ヘッダ相当データ11から情報を抽出の上、CPU内蔵の汎用レジスタに転送してからのヘッダ解析でなく、直接ヘッダデータ記憶回路150から必要な情報を抽出することができるので高速なヘッダ解析が可能な構成になっている。
【0046】
さらに各パケット解析エレメント100はそれぞれ、パケット解析プログラムに応じてヘッダデータ記憶回路150毎に異なる情報を抽出することが必要となり、比較による情報識別のための比較情報をあらかじめ記憶させる場所及びパケット解析プログラム実行中に生成した一時的なデータを記憶する場所としてヘッダ編集記憶回路170a、170b〜170Nと、パケット解析プログラムを実行したパケット解析結果を記憶するヘッダ解析結果記憶回路160a、160b〜160Nとを具備する。
【0047】
例えばパケット解析エレメント100aがL2ヘッダの解析をし、パケット解析エレメント100bがIPヘッダの解析をする場合に、パケット解析プログラムにより図14に示すMAC−DA401、MAC−SA402の正常性を確認した次のフィールドの値がいくつかによって受信パケット1がDIX形式フォーマットか、LLC+SNAP形式フォーマットかを識別できる。
【0048】
そこで、ヘッダ編集記憶回路(単に編集記憶回路ともいう)170aにあらかじめ「05DC」という値を記憶させておき、ヘッダ編集記憶回路170bにはあらかじめ「4」という値を記憶させておく。パケット解析エレメント100aは、ヘッダデータ記憶回路150aから「0800」という値が抽出されると、特殊演算器140aの後述する大小比較命令でヘッダ編集記憶回路170aに記憶していた「05DC」に比べ、ヘッダデータ記憶回路140aから抽出された「0800」の値が大きいと判定すると、その結果DIXフォーマットであることが特定できているので、ヘッダ解析結果記憶回路(単に解析結果記憶回路ともいう)160aに「DIX」フォーマットであったことを示す値を書き込む。
【0049】
そしてパケット解析完了タイミング信号153aに同期して後段のパケット解析エレメント100bにヘッダ解析結果記憶回路160aの情報をヘッダ解析結果記憶回路160bへライトする。ヘッダ編集記憶回路170aの「05DC」は、パケット解析エレメント100aのパケット解析プログラムのみでしか使用せず、パケット解析エレメント100bの特殊演算器140bは、ヘッダ解析結果記憶回路160bにライトされた「DIX」フォーマット情報から、15バイト目以降にIPヘッダが搭載されていることとし、15バイト目のフィールドがversion情報の値がいくつかを識別するために、ヘッダ編集記憶回路170bに 記憶していた「4」と「一致比較」を実行する。
【0050】
上述の構成により、前段のパケット解析エレメント100N−1で抽出、解析した情報を重複して後段のパケット解析エレメント100Nにて解析処理を行われないため、各パケット解析エレメント100が 個別のパケット解析プログラ ムを効率的に構成できる。
【0051】
図1に示す各エレメント100のヘッダデータ記憶回路150a、150b〜150Nはそれぞれ、あらかじめ決めた固定周期間でヘッダ相当データ11を格納し、かつ次の固定周期間ではパケット解析開始タイミング信号152a、152b〜152Nをそれぞれ基点にCPU110a、110b〜110N及び特殊演算器140a、140b〜140Nにてそれぞれのパケット解析プログラムに応じてパケット解析処理を実行するが、固定周期の2倍分の時間で1つのパケット処理となる。
【0052】
しかし、パケット解析処理を行っている時間にもパケットを受信できれば、単位時間あたりに処理できるパケット数が増え、スループット向上となる。そこで、ヘッダの解析をしている間にパケットを受信する可能性がある場合にも、ヘッダデータ記憶回路150a、150b〜150Nはそれぞれ、CPU110a、110b〜110N及び特殊演算器140a、140b〜140Nが解析をしているか、又は解析していた現解析結果に、新たに受信パケット1の解析した次解析結果を上書きしないために2面構成としてパケット解析完了タイミング信号153a、153b〜153N毎にパケット受信面とパケット解析面を切り替えて交互に選択する。
【0053】
上述の構成により、ヘッダデータ記憶回路150a、150b〜150Nの2面を、パケット解析完了タイミング信号153a、153b〜153N毎に所定の順序で選択して情報を保持させるので、CPU110a、110b〜110N及び特殊演算器140a、140b〜140Nがパケット解析に必要な情報を抽出しているときでも、既に記憶した前の受信パケット1のヘッダを含む情報を失うことなく、新たに受信した情報を記憶させることができる。
【0054】
<特殊演算器140の詳細な説明>
図3に詳しく示すように特殊演算器140(140a〜140N)は、特殊演算制御部145と、特殊演算命令デコード回路130からの特殊演算用データ制御信号141と特殊演算命令デコード信号133に従い、直接ヘッダデータ記憶回路150とヘッダ解析結果記憶回路160とヘッダ編集記憶回路170と比較情報記憶回路50からあらかじめ決めたビット幅単位に読み出されたデータ141に対して各種の処理を行う演算器群146と、状態通知部147と特殊演算結果データ出力部148とを備える。演算器群146は命令毎のイネーブル指示信号1331で、それぞれの処理を実行する1対多種一致比較部1461と、大小比較部1462と、データ転送部1463と、一部データ転送部1464と、論理積部1465と、論理和部1466と、加算部1467と、ビットシフト部1468と、ビットシフト後論理和部1469と、チェックサム演算部1470と間接アドレスデータ転送部1471とを備える。
【0055】
1対多種一致比較部1461は、特殊演算用データ制御信号141(141a〜141N)を構成する第1データと第2データ(ヘッダデータ記憶回路150、比較情報記憶回路50、解析結果記憶回路160、編集記憶回路170のリードデータ)の比較や、第1データと第2データを先頭とし連続するデータとを同時に比較する。大小比較部1462は第1データと第2データにビットマスク信号1332でそれぞれ指定したビット幅に対して、第1データを大とするか、第2データを大とするかを大小比較方向指示信号1334に応じて比較する。データ転送部1463はいずれかの記憶回路150、50か抽出された第1データを異なる記憶回路50、150へ転送し、また、一部データ転送部1464は第1データのうちビットマスク信号1332で指定したビット幅のみを異なる記憶回路50、150へ転送する。
【0056】
論理積部1465と、論理和部1466と加算部1467はそれぞれ、第1データと第2データの論理和、論理積、加算を行う。ビットシフト部1468は第1データに対してビットシフト方向指示信号1333で示す右か左へ第2データで指示したビット数分のビットシフトを行う。ビットシフト後論理和部1469は組み合わせ演算で第1データをビットシフト方向指示信号1333が指示する方向に即値データ1335で指定したビット数分ビットシフトしたデータと第2データの論理和を行う。チェックサム演算部1470は第1データ(第1オペランド)が先頭ポインタ(起点)を表し、第2データ(第2オペランド)で指定したデータ長分を複数クロックをかけて加算していく。間接アドレスデータ転送部1471は第2データをアドレスとして指定した前記いずれかの記憶回路150、50から出力されたデータが示すアドレスのデータを第1データで示す記憶回路50、150へ転送する。
【0057】
状態通知部147は演算器群146内の比較命令(1461、1462)においていずれか1つ実行した比較結果、及びヘッダデータ記憶回路150から出力されるパケット解析開始タイミング信号152をCPU110への状態通知信号142として生成する。特殊演算結果データ出力部143は演算器群146内の比較以外の命令(1463〜1471)によりデコード回路130経由で指定されたアドレスへ書き込むライトデータ143を生成し、これをヘッダ記憶回路150に書き込む。
【0058】
上述の構成により、特殊演算器140は、図14や図15に示すヘッダを解析処理するだけの演算器群146でないため、その他上位レイヤのヘッダが処理対象となった場合も、演算器群146がプログラムの変更により使用でき、CPU110へデータを取り込むことなく、直接ヘッダデータ記憶回路150、ヘッダ解析結果記憶回路160、ヘッダ編集記憶回路170、比較情報記憶回路50からデータを抽出できるので、高速なパケット処理を維持しながらプログラムを実行できる。さらに状態通知信号142をCPU110へ出力することによりプログラムの分岐や比較結果判定を使用して次に実行すべきプログラムによりパケット解析ができる。
【0059】
<特殊演算命令デコード回路130の詳細な説明>
図4に詳しく示すように図1のデコーダ130を構成する特殊演算命令デコード回路130では、命令指示解析部131が、CPU110からの特殊演算命令指示信号115に含まれるリードアクセスの対象となるヘッダデータ記憶回路150又はヘッダ編集記憶回路170又は比較情報記憶回路50から抽出すべき情報のリードアドレス生成と、特殊演算実行結果(ライトデータ)143をヘッダデータ記憶回路150、ヘッダ解析結果記憶回路160、ヘッダ編集記憶回路170のいずれかの書き込み先アドレスとして、第1アドレス1321、第2アドレス1323、第3アドレス1325の3つのアドレスと、このアドレス1321、1323、1325のそれぞれに対応する第1、第2、第3ライト又はリードイネーブル信号1322、1324、1326を含む特殊演算用データ抽出アクセス制御信号132や、特殊演算命令実行時に必要な命令毎のイネーブル指示信号1331と、ビットマスク信号1332と、ビットシフト方向指示信号1333と、大小比較方向指示信号1334と、プログラムに記述されている命令のオペランドの即値データ1335とを含む特殊演算命令デコード信号133を出力できる。
【0060】
上述の構成により、特殊演算器140が、複数の演算器群146を内蔵しているが、共通なインタフェースで複数演算を行えるようにしている。
【0061】
<ヘッダデータ記憶回路150の詳細な説明>
図5に詳しく示すようにヘッダデータ記憶回路150は、ヘッダレジスタ書き込みセレクト回路156と、2面構成のヘッダレジスタ157と、パケット解析タイミング生成回路154と、ヘッダレジスタ読み出しセレクト回路158と、ヘッダレジスタポインタ選択部159とを備える。
【0062】
ヘッダレジスタ書き込みセレクト回路156は、ヘッダ相当データ11、又はパケット解析用CPU110からのライトデータ113又は特殊演算器140からのライトデータ143(143a〜143N)が入力されたことの検出、及び2面構成のヘッダレジスタ157の書き込み先レジスタ側を選択して書き込みポインタ1561を生成し、これをヘッダレジスタ157に出力する。ヘッダレジスタ157は、パケット受信中に書き込まれる面とCPU110や特殊演算器140により解析されている面の2面構成であり、ヘッダ相当データ11を後述のパケット解析面選択信号1541により交互に格納する。
【0063】
パケット解析タイミング生成回路154は、
・ヘッダ相当データ11を検出したときのみヘッダレジスタ書き込みセレクト回路156から生成される入力データ検出通知信号1562をトリガとしてあらかじめ決めたビット数のヘッダ相当データ11がヘッダレジスタ157へ書き込まれたことを特殊演算器140に通知するパケット解析開始タイミング信号152と、
・ヘッダレジスタ157の受信パケットライト側、パケット解析(リード)側の面選択をするパケット解析面選択信号1541と、
・後段のパケット解析エレメント100への記憶回路150のデータ引継ぎタイミングを示すパケット解析完了タイミング信号153とを、
生成する。
【0064】
ヘッダレジスタ読み出しセレクト回路158は、ヘッダレジスタ157のデータをパケット解析タイミング生成回路154からのパケット解析完了タイミング信号153にてヘッドレジスタ読み出しポインタ1581を生成してヘッダレジスタ157に格納されているデータを読み出す。ヘッダレジスタポインタ選択部159は、CPU110からヘッダ抽出情報を生成するために出力されたヘッダレジスタ157へアクセスするためのポインタ情報とリード又はライトイネーブル信号112、又は特殊演算器140からヘッダ抽出情報を生成するために出力されたヘッダレジスタ157へアクセスするためのポインタ情報とリード又はライトイネーブル信号132を、パケット解析中か否かを判定し選択するヘッダレジスタ書き込みセレクト回路156又はヘッダレジスタ読み出しセレクト回路158へ出力する。
【0065】
上述の構成のヘッダデータ記憶回路150を図11を例に説明する。図11はヘッダデータ記憶回路150のみに格納できるパケット長に対して、パケット解析エレメント100が3個(#a、#b、#c)の例を示す。受信パケット1のヘッダ相当データHを検出すると、ヘッダレジスタ157に対して、あらかじめ決めたビット幅単位に、ヘッダレジスタ書き込みセレクト回路156からの書き込みポインタ1561に従い、ポインタ0から順番にヘッダレジスタ157の選択面−1に第1ヘッダ相当データHを格納していく。
ここで、図11では、ヘッダ相当データとして「H」のみを示しているが、実際には「H+P#x」がヘッダ相当データであり、「あらかじめ決めたビット幅」である。また、図11に示す固定時間(固定周期)は、「H+P#x」+α(α:イーサネット(R)規格のパケット間最小ギャップ)である。また、図12では、ヘッダ相当データが「H+P#x(一部)」であり、ペイロード相当データが「P#x(残り)」である。
【0066】
ヘッダレジスタ157へのパケットデータ格納を完了すると、パケット解析タイミング生成回路154からパケット解析開始タイミング信号152を特殊演算器140に出力し、このタイミング生成は固定時間が経過したことも示す。これ以降新たなパケットを受信可能となり、新たなヘッダ相当データHをヘッダレジスタ書き込みセレクト回路156が検出すると、先にパケット格納完了となったヘッダレジスタ157の選択面−2を選択し、第2のヘッダ相当データHを格納できる。
【0067】
第1ヘッダ相当データH+P#xに対するパケット解析開始タイミング信号152をトリガに、パケット解析エレメント内のCPU110や特殊演算器140が解析を行う。解析を終えたことを示すパケット解析完了タイミング信号153を解析結果記憶回路160へ出力することにより、次段のパケット解析エレメント100へ転送準備ができたことを通知する。このパケット解析完了タイミング信号153(153a〜153N)を固定時間内で生成することにより、パケット解析タイミング生成回路154から生成するパケット解析開始タイミング信号152をトリガとする固定時間が周期的に繰り返され、パイプライン順序が正しく守れる。
パケット受信からパケット解析完了まで、第1ヘッダ相当データHの処理は選択面−1をパケット解析面選択信号1541にて選択しており、パケット解析完了タイミング信号153の生成により、ヘッダレジスタの選択面−1で解析し終えた第1ヘッダ相当データHを後段のパケット解析エレメント100へ引継ぎデータ151として転送する。このとき選択面−2へ格納していた第2ヘッダ相当データHも格納を完了し、パケット解析開始タイミング信号152を出力し、前記のような動作を固定時間毎に繰り返す。
【0068】
また受信パケット分離部10からのヘッダ相当データHと、パケット解析中にCPU110や特殊演算器140からのライトやリードの競合を調停しながら、パケットの受信とパケット解析を両立できる。
なお、図には示されていないが、ヘッダ記憶回路150には、ヘッダ相当データ及びペイロード相当データを格納する時に、パケットの終了を示すフラグを書き込む。これにより、パケット終了フラグを検出するか否かにより、ヘッダ相当データの後にペイロード相当データを読み出すか否かを判断している。
【0069】
<<ペイロード収容部20の詳細な説明>>
図6に詳しく示すようにペイロード収容部20は、ペイロード相当データ12を格納するペイロードデータ蓄積用メモリ(単にメモリともいう)22と、ペイロードデータ書き込み回路23と、ヘッダ対応ポインタ生成回路24と、ポインタ保持回路25と、リードポインタ生成回路26とペイロードデータ読み出し回路27とを備える。ペイロードデータ書き込み回路23はペイロードデータ蓄積用メモリ22へデータを書き込むためのアドレス、ライトイネーブル信号を生成する。ヘッダ対応ポインタ生成回路24は送信パケット生成時にパケット解析エレメント100で解析しているヘッダ相当データ11に対応させてペイロード相当データ12を格納(ライト)するために受信パケット毎に書き込み終了ポインタを生成する。
【0070】
ポインタ保持回路25は1つのペイロードデータ蓄積用メモリ22上の受信パケット毎のポインタ値を保持するために、複数のレジスタ(図の受信パケット#1用、#2用〜#Y用)により構成されている。リードポインタ生成回路26は更新パケット送信部60からのペイロード読み出し制御信号62をもとに、ポインタ保持回路25から直前に読み出し終了したポインタから書き込み終了ポインタまでのポインタ値を生成する。ペイロードデータ読み出し回路27は更新パケット送信部60からのペイロード読み出し制御信号62をトリガとしてペイロードデータ蓄積用メモリ22からペイロード相当データ12を読み出しするためのアドレスとリードイネーブル信号を生成する。
【0071】
上述の構成のペイロード収容部20を図12を例に説明する。図12はヘッダデータ記憶回路150及びペイロード収容部20に分けて格納するパケットの長さに対して、パケット解析エレメント100が3個(#a、#b、#c)の例を示す。受信パケット1は受信パケット分離部10でヘッダ相当データH(実際には「H+P#x(一部)」)とペイロード相当データP(実際には「P#x(残り)」)に分離され、ペイロードデータ書き込み回路23がペイロード相当データPを検出すると、あらかじめ決めたビット幅単位に、ペイロードデータ蓄積用メモリ22ヘライトするために、アドレスとライトイネーブル信号を生成し、アドレス0から順番にライトする。
【0072】
ペイロードデータP#1をペイロードデータ蓄積用メモリ22へ書き終えると、第1ヘッダ相当データ Hのペイロードデータであることを記憶するために、ヘッダ対応ポインタ生成回路24が書き込み終了時のアドレス値を抽出し、ポインタ保持回路25の第1ヘッダ相当データ用のレジスタへ記憶(ライト)する。続く第2ヘッダ相当データのペイロード相当データP#2を、第1ペイロード相当データP#1の書き込み終了時のアドレス値+1からライトし、書き込み終了時のアドレス値を、第2ヘッダ相当データ用のポインタ保持回路25のレジスタへ記憶する。第3ペイロード相当データP#3も同様に格納する。
【0073】
パケット解析エレメント#a、#b、#cによる第1ヘッダ相当データHの解析が終えると、パケット解析エレメント#cは、ヘッダ編集記憶回路170cへテーブル検索より得た結果の宛先にパケットを転送するか破棄するかの指示や、例えばVLAN挿入又は削除の指示をライトし、パケット解析完了タイミング信号153cに同期して、新たなヘッダとなったヘッダデータ151Nと共にヘッダ制御データ172Nを更新パケット送信部60へ出力する。
【0074】
更新パケット送信部60は、新たなヘッダデータへの挿入又は削除などのパケット更新処理をする。この更新ヘッダデータを最後まで処理を終了した際に、パケットの終わりを示すフラグが検出できない場合は、続くペイロード相当データが存在し、結合することで1つのパケットとなるので、ペイロード収容部20へペイロード読み出し制御信号62を出力する。
【0075】
この制御信号62に従い、第1ヘッダ相当データに続く第1ペイロード相当データを読み出せるようにリードポインタ生成回路26が、ペイロードデータ読み出し回路27経由でポインタ0からポインタ保持回路25に記憶した第1ヘッダ相当データの書き込み終了ポインタ値までのアドレスをペイロードデータ蓄積用メモリ22へ指示し、データを読み出す。ポインタ保持回路25に記憶されている書き込み終了ポインタ値まで読み出し終わると、リードポインタ生成回路26は、その際のアドレスを記憶し、次回ペイロード読み出し制御信号62を受け取るまで保持する。
ヘッダ制御データ172Nにパケット破棄指示が含まれていた場合は、図6に示すリードポインタ生成回路26は制御信号62に、ペイロード相当データ12を読み出さずに次に読み出しすべきポインタ保持値を選択する。
【0076】
<<検索データセレクタ30の詳細な説明>>
図7に詳しく示すように検索データセレクタ30は、検索キー選択部33と、検索結果送出部34と検索結果受信FIFO(キュー)35を具備する。検索キー選択部33はパケット解析エレメント100a、100b〜100Nのいずれか1つから出力された検索キーデータ171を受信し、検索テーブル40へ検索キーデータ171a、171b〜171N(いずれか1つ)を出力する。検索結果送出部34は検索テーブル40からの検索結果41をFIFO35を介して受信し、上記の検索キーデータ171に対応する検索結果32a、32b〜Nを、指定したパケット解析エレメント100a、100b〜100Nに出力する。
【0077】
上述の構成により、検索データセレクタ30は、パケット解析エレメント100毎にそれぞれ個別の解析を行った場合に、例えばMACアドレス解析のみのプログラムと、IPヘッダ及び上位ヘッダなども解析するプログラムでは必要となるパケット解析エレメント数が変わるため、必ず決まったパケット解析エレメント100から固定的に検索キーデータ171を出力するとは限らず、パケット解析による情報をもとに検索キーデータ171を生成するパケット解析プログラムを実装しているパケット解析エレメント100からの検索キーデータ171を選択して検索テーブル40へ出力する。また、その検索キーデータ171に対応する検索結果データ32を新ヘッダ生成のために使用するパケット解析エレメント100へのみ出力する。
【0078】
さらに、検索テーブル40から出力された検索結果データ41を検索結果受信FIFO35に蓄積し、出力先となるパケット解析エレメント100からの指示があるまで、検索結果データ32を出力しない。例えばパケット解析エレメント100a、100b、100cにて更新ヘッダを生成する場合、パケット解析エレメント100bから検索キーデータ171を送出し、エレメント100cで検索結果データ32を必要とする場合と、検索テーブル40自身の処理時間遅延、複数検索キーデータ171による検索時間の違いにも対応できる。
【0079】
<<更新パケット送信部60の詳細な説明>>
図8に詳しく示すように更新パケット送信部60は、ペイロード読み出し制御信号62を生成する制御信号生成部63とパケット生成部64とを具備する。パケット生成部64は1つ以上のパケット解析エレメント100a、100b〜100Nのうち最終段にあたるパケット解析エレメント100N(1つのパケット解析エレメントの場合は、a=N)から出力されるヘッダデータへの挿入指示信号1721Nと、ヘッダデータからの削除指示信号1722Nと、転送又は破棄指示信号1723Nを含むヘッダ制御データ172Nに従って、更新するヘッダ相当データ151Nと、ペイロード収容部20から読み出した送信待ちパケットペイロードデータ21をシリアルに結合する。
【0080】
上述の構成により、更新パケット送信部60は、パケット解析エレメント100Nからパケット解析完了タイミング信号153に同期して、引継ぎヘッダデータ151Nとヘッダ編集記憶回路170Nからヘッダデータへの挿入指示信号1721Nと、ヘッダデータからの削除指示信号1722Nと、転送又は破棄指示信号1723Nを含むヘッダ制御データ172Nを受信する。各種指示信号により引継ぎヘッダデータ151Nは、新たなヘッダへ更新し、送信待ちパケットペイロードデータ21が必要であれば結合を行い、送信パケット61として出力する。
【0081】
<<パケット解析エレメント100の変形例>>
図9に示すパケット解析エレメント100の変形例は、図1に示す構成に対してシーケンシャル番号比較回路(単に比較回路ともいう)180N、181Nが追加されている。
【0082】
シーケンシャル番号比較部180N、181Nは、受信パケット1のヘッダの解析を行うために、ヘッダデータ記憶回路150と、ヘッダ解析結果記憶回路160とヘッダ編集記憶回路170経由でテーブル検索の検索キーデータ171を送出して検索結果を受け取るという3つの経路にて1つの受信パケット情報を伝達するので、いずれか1経路での不具合により同一受信パケットの情報が揃わないことを検出するため、初段のパケット解析エレメント100aのパケット解析プログラムよりシーケンシャルな番号を付与し、パケット解析エレメント100の最終段に対して、ヘッダ解析結果記憶回路160経由で伝達されたシーケンシャル番号162Nとヘッダデータ記憶回路150経由で伝達されたシーケンシャル番号1571Nとの比較結果、及びヘッダ解析結果記憶回路160経由で伝達されたシーケンシャル番号162Nと検索テーブル40で伝達されたシーケンシャル番号173Nとの比較結果の2種類の比較結果を出力する。
【0083】
上述の構成よるシーケンシャル番号の転送イメージを図10を用いて説明する。パケット解析エレメント100が3段(#a、#b、#c)の場合、検索データセレクタ30は、エレメント100aが検索キーデータ171aを出力し、エレメント100cが検索結果32cを受信する。パケット解析エレメント100aのパケット解析プログラムが、受信パケット1の解析結果をヘッダ解析結果記憶回路160aにライトする際に、シーケンシャル番号#Aも同ヘッダ解析結果記憶回路160aにライトする。この解析結果のもとになるヘッダ相当データを記憶しているヘッダデータ記憶回路150aにも同様にシーケンシャル番号#Aをライトする。
【0084】
そしてヘッダ相当データ12から抽出した情報をもとに生成した検索キーデータ171にもシーケンシャル番号#Aをヘッダ編集記憶回路170a経由でライト、転送する。これらのシーケンシャル番号#Aは、パケット解析完了タイミング信号153aに同期して、ヘッダデータ記憶回路150aはヘッダ相当データ11と合わせてヘッダデータ記憶回路150bへ、ヘッダ解析結果記憶回路160aは解析結果情報の1つとして解析結果記憶回路160bへ転送し、ヘッダ編集記憶回路170aは編集記憶回路170bへ直接転送はなく、検索テーブル40への検索キーデータ171として転送する。検索キーデータ171に該当する検索結果データ32には検索キーデータ171に多重されていたシーケンシャル番号#Aを検索結果データ32にも多重されている値をパケット解析エレメント100cのヘッダ編集記憶回路170cにて抽出し、テーブル経路シーケンシャル番号173cから#A値を出力する。
【0085】
エレメント100aからエレメント100bへ、エレメント100bからエレメント100cへも前述と同様にパケット解析完了タイミング信号153に同期してエレメント100間で引き継ぎ、ヘッダデータ記憶回路150経路のシーケンシャル番号1571Nから#A値を出力する。ヘッダデータ解析結果記憶回路160経路のシーケンシャル番号162Nから#A値を出力する。これら各経路のシーケンシャル番号を比較し、すべて#A値であるために正常に3経路で1つのパケット情報を転送していることが検出できる。
【0086】
【発明の効果】
以上説明したように請求項1、2に記載の構成によれば、受信パケットヘッダ内の各フィールドの識別や、検索キー情報の抽出や、検索結果受信後の送信パケットヘッダ生成などの処理を受信パケットの種類に応じて何個のパケット解析エレメントで処理するか、また、それぞれのパケット解析エレメントにどのような処理をさせるのかを選択できるため、高性能なCPUを特に用意する必要がない。
請求項3に記載の構成によれば、パイプライン構成のパケット解析エレメント間の情報の引継ぎもあらかじめ決めたタイミング信号で行うことから特別なフラグ(レジスタ)及び処理を必要としないため、メモリサイズをすべて個別のパケット解析処理に割り当てることができる。
請求項4に記載の構成によれば、1つ以上のパケット解析エレメントにて構成した場合に、前段のパケット解析エレメントで抽出、解析した情報を重複して処理することがないので、プログラムの負荷分散が柔軟に対応でき、また、プログラム蓄積用メモリサイズをすべて個別のパケット解析処理に割り当てることができる。
請求項5に記載の構成によれば、次パケットの受信中でも、現パケットの解析結果情報を保持できるため、スループットが低下することなく、パケット解析結果情報を後段のパケット解析エレメントへ伝達できる。
請求項6に記載の構成によれば、特殊演算器がヘッダデータ記憶回路、ヘッダ解析結果記憶回路、ヘッダ編集記憶回路、比較情報記憶回路のデータを直接リード、ライトできることから、プログラムの変更つまり特殊演算命令の指示順序を変えることで、設計変更や機能追加を実現し、かつ高速なパケット処理を維持できる。
請求項7に記載の構成によれば、設計変更や機能追加を実現することができる。
請求項8に記載の構成によれば、特殊演算命令の実行に必要な情報をヘッダデータ記憶回路、ヘッダ解析結果記憶回路、ヘッダ編集記憶回路、比較情報記憶回路のデータを直接リード、ライトできるようにアドレスなどのアクセス制御信号を生成し、かつ命令実行時に必要な各種イネーブル信号を生成できる。
請求項9に記載の構成によれば、現パケットの解析中でも、次パケットの受信を開始できるため、ワイヤースピードを維持しながら、パケット解析エレメント内CPU及び特殊演算器へヘッダ相当データを伝達し、かつ後段のパケット解析エレメント内のヘッダデータ記憶回路へデータを引き継ぐことができる。
請求項10に記載の構成によれば、1つのメモリに対してパケット解析中のヘッダ相当データに対応する数分のポインタのみを管理しているため、複数の受信パケットの各ペイロードデータ収容用のメモリを必要とせずに低コストに装置を実現できる。
請求項11に記載の構成によれば、複数のパケット解析エレメントで構成した場合に、検索データセレクタが、いずれのパケット解析エレメントからの検索キーでも受信でき、またいずれのパケット解析エレメントへも検索結果を送信できるので、複数のパケット解析エレメントでも検索テーブルとアクセスができ、プログラム処理の柔軟性が高くなる。
請求項12に記載の構成によれば、検索データセレクタが検索テーブルからの検索結果データをFIFOで受信する場合に、検索テーブルの応答時間が変化してもパケット解析エレメントが必要なタイミングで検索結果データを受信できる。
請求項13に記載の構成によれば、更新パケット送信部が、パケット解析エレメントでの解析結果に応じて、ヘッダデータ記憶回路を経由して記憶してきたヘッダ相当データから新たに生成されたヘッダとペイロード収容部とが記憶したペイロード相当データから新たな送信パケットを生成できる。
請求項14に記載の構成によれば、パケット解析のために1つの受信パケットから抽出された情報は3経路を経由するが、各経路で共通なシーケンシャル番号を付与して伝達されるため、その整合性を最終的に検出する比較回路をパケット解析エレメント内に搭載することにより、パケット処理装置内での信頼性向上を図ることができる。
【図面の簡単な説明】
【図1】本発明によるパケット処理装置の基本構成を示すブロック図
【図2】図1のパケット解析エレメント内のバス構成を詳しく示すブロック図
【図3】図1中の特殊演算器を示すブロック図
【図4】図1中の特殊演算命令デコード回路を示すブロック図
【図5】図1中のヘッダデータ記憶回路を示すブロック図
【図6】図1中の受信パケットペイロード収容部を示すブロック図
【図7】図1中の検索データセレクタを示すブロック図
【図8】図1中の更新パケット送信部を示すブロック図
【図9】図1中のパケット解析エレメントにシーケンシャル番号比較回路を追加した変形例を示すブロック図
【図10】図9のシーケンシャル番号比較を示すイメージ図
【図11】本発明によるパケット解析エレメントを3個使用し、最小パケット長、かつ最小パケット間ギャップ時の処理タイミング図
【図12】本発明によるパケット解析エレメントを3個使用し、任意パケット長、かつ任意パケット間ギャップ時の処理タイミング図
【図13】従来のパケット処理装置を示すブロック図
【図14】従来のパケットの下位レイヤヘッダの構成を示す図
【図15】従来のIPv4ヘッダの構成を示す図
【符号の説明】
1 受信パケット
10 受信パケット分離部
11 ヘッダ相当データ
12 ペイロード相当データ
20 受信パケットペイロード収容部
21 送信待ちパケットペイロードデータ
22 ペイロードデータ蓄積用メモリ
23 ペイロードデータ書き込み回路
24 ヘッダ対応ポインタ生成回路
25 ポインタ保持回路
26 リードポインタ生成回路
27 ペイロードデータ読み出し回路
30 検索データセレクタ
40 検索テーブル
50 比較情報記憶回路
60 更新パケット送信部
61 送信パケット
62 ペイロード読み出し制御信号
63 ペイロード読み出し制御信号生成部
64 パケット生成部
100、100a、b、・・・、N パケット解析エレメント
110a、b、・・・、N CPU
111a、b、・・・、N 記憶回路150、50からのCPUリードデータ
112a、b、・・・、N CPUからの記憶回路150、50アクセス制御信号
113a、b、・・・、N CPUからの記憶回路150、50ライトデータ
115a、b、・・・、N 特殊演算命令指示信号
120a、b、・・・、N CPUのプログラム記憶メモリ
130a、b、・・・、N 特殊演算命令デコード回路(デコーダ)
131 命令指示解析部
132a、b、・・・、N 特殊演算用データ抽出アクセス制御信号
133a、b、・・・、N 特殊演算命令デコード信号
140、140a、b、・・・、N 特殊演算器
141、141a、b、・・・、N 特殊演算用データ制御信号(特殊演算器のヘッダデータ記憶回路150、比較情報記憶回路50からのリードデータ)
142a、b、・・・、N 状態通知信号
143、143a、b、・・・、N 特殊演算器の記憶回路150、50へのライトデータ
145 特殊演算制御部
146 演算器群
147 状態通知部
148 特殊演算結果データ出力部
150、150a、b、・・・、N ヘッダデータ記憶回路
151a、b、・・・、N エレメント間引継ヘッダデータ
152、152a、b、・・・、N パケット解析開始タイミング信号
153、153a、b、・・・、N パケット解析完了タイミング信号
154 パケット解析タイミング生成回路
156 ヘッダレジスタ書き込みセレクト回路
157 ヘッダレジスタ
158 ヘッダレジスタ読み出しセレクト回路
159 ヘッダレジスタポインタ選択部
160、160a、b、・・・、N 解析結果記憶回路
161a、b、・・・、N エレメント間引継解析結果データ
162N ヘッダ解析結果記憶回路経路シーケンシャル番号
170、170a、b、・・・、N ヘッダ編集記憶回路
171、171a、b、・・・、N 検索キーデータ
172a、b、・・・、N ヘッダ制御データ
1331 命令毎のイネーブル指示信号
1332 ビットマスク信号
1333 ビットシフト方向指示信号
1334 大小比較方向指示信号
1335 即値データ
1321 (特殊演算用)第1アドレス
1322 (特殊演算用)第1ライト又はリードイネーブル
1323 (特殊演算用)第2アドレス
1324 (特殊演算用)第2ライト又はリードイネーブル
1325 (特殊演算用)第3アドレス
1326 (特殊演算用)第3ライト又はリードイネーブル
1461 1対多種一致比較部
1462 大小比較部
1463 データ転送部
1464 一部データ転送部
1465 論理積部
1466 論理和部
1467 加算部
1468 ビットシフト部
1469 ビットシフト後論理和部
1470 チェックサム演算部
1471 間接アドレスデータ転送部
1541 パケット解析面選択信号
1561 ヘッダレジスタ書き込みポインタ
1571 ヘッダデータ記憶回路経路シーケンシャル番号
1581 ヘッダレジスタ読み出しポインタ
1721 ヘッダ挿入指示データ
1722 ヘッダ削除指示データ
1723 パケット転送破棄指示信号
173N 検索テーブル経路シーケンシャル番号[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a packet processing method and apparatus for mounting a newly generated header on a transmission packet in accordance with a header mounted on a received packet, and more particularly to a network for processing header analysis of packets corresponding to a plurality of protocols at high speed. The present invention relates to a packet processing method and apparatus suitable for use in a LAN switch.
[0002]
[Prior art]
In the field of digital communication, packet communication is widely used for transferring information. At the head of the packet, a header indicating information on the transmission destination, the type of information, and the like is mounted, and has a different header for each type of packet (protocol).
[0003]
Examples of packets that have been widely used recently are shown in FIGS. Packets by type
(A) DIX packet described in RFC194,
(B) RAW packet as described in IEEE 802.3,
(C) an LLC packet carrying
(D) LLC + SNAP packet
And
(E) DIX + VLAN packet,
(F) RAW + VLAN packet,
(G) LLC + VLAN packet,
(H) LLC + SNAP + VLAN packet
There are a total of eight types, and packet processing apparatuses are required to process these eight types of packets accurately and promptly.
[0004]
The
[0005]
The packet has an L2 header followed by a
[0006]
In the case of a packet processing device having an IPv4 routing function, it is necessary to newly generate a transmission packet header in which the above-described MAC-
[0007]
Conventionally, as this type of device, a device such as a packet processing device described in Japanese Patent Application Laid-Open No. 11-317783 shown in FIG. 13 has been used. In the figure, a
[0008]
[Problems to be solved by the invention]
As described above, since the lengths of the L2 header and the upper layer header differ depending on the type of each packet, the conventional packet processing apparatus extracts the destination IP address information 711 from the received packet and stores it in the
A processing step for reading the L2 header;
A processing step for determining the length of the read L2 header;
A processing step of detecting the position of the destination IP address information 711 according to the obtained length of the L2 header;
A processing step of reading destination IP address information 711 from the detected position;
A processing step of storing the read destination IP address information 711 in the
Need to run. Further, in the processing step of reading the L2 header, it is necessary to divide the L2 header into the amount of data that the
[0009]
That is, the time taken to detect the position of the destination IP address information 711 on the received packet depends on the amount of data that the
[0010]
In addition, between the
[0011]
In the conventional apparatus, the
[0012]
Therefore, in view of the first problem described above, the present invention particularly provides a high-performance CPU for each of the extraction processing of information necessary for generating a new transmission packet header and the generation processing of the transmission packet header. An object of the present invention is to provide a packet processing apparatus that is not necessary.
Another object of the present invention is to provide a packet processing apparatus having a memory size necessary only for received packet analysis in view of the second problem described above.
In addition, in view of the third problem described above, the present invention makes it easy to make corrections and future function changes not only for IPv4 headers but also for received packets equipped with various types of headers typified by IPv6 headers and MPLS. An object of the present invention is to provide a packet processing apparatus that is flexible in design change.
[0013]
[Means for Solving the Problems]
Claim1The described invention
Stores search data for converting received packet headers to transmitted packet headers in a search tableSearch data storage step to,
Stores comparison information for determining the type of the received packetComparison information storage step to,
Detects data breaks in the received packet and separates the header-equivalent data part and the payload-equivalent data partReceive packet separation step,
Number according to the type of the received packet and / or the packet analysis content assigned in advancesoPipeline configurationIs, With a fixed periodReceiveThe header equivalent data portion separated in the packet separation step and the comparison information stored in the comparison information storage step are compared to determine the type of the received packet, and the search table is searched as necessary. The header equivalent data is updated and output to the next stage, and the analysis result is passed to the next stage when the next stage uses it.One or more packet analysis steps,
Header equivalent data from the last stage of the one or more packet analysis steps, andReceiveData portion corresponding to the payload separated by the packet separation stepTieOutput as a send packetAn update packet transmission step,
Prepared,
Each of the packet analysis steps includes:
A header data storage step of storing the header equivalent data portion separated by the received packet separation step and outputting a packet analysis start timing signal after completion of the storage;
A header editing storage step for extracting and storing different information in the header data storage step according to a packet analysis program, and for storing the comparison information and temporary data generated during execution of the packet analysis program; ,
A header analysis result storage step for storing a packet analysis result obtained by executing the packet analysis program;
Using a general-purpose register, a general-purpose calculation step for starting execution of a packet analysis program triggered by a packet analysis start timing signal output from the header data storage unit;
Based on a special operation instruction included in the packet analysis program, the data of the result of the header data storage step, the header edit storage step, the header analysis result storage step or the comparison information storage step is directly read and read. A logical operation for packet analysis is performed on the data, and the result is stored as the result data of the header data storage step, the header edit storage step, the header analysis result storage step or the comparison information storage step. A calculation step,
A packet processing method.
The invention according to
A search table for storing search data for converting the header of the received packet into the header of the transmitted packet;
A comparison information storage unit for storing comparison information for determining the type of the received packet;
A received packet separator that detects a data delimiter of the received packet and separates a header equivalent data portion and a payload equivalent data portion;
The pipeline is configured with a number corresponding to the type of the received packet and / or the packet analysis content allocated in advance, and is received by the received packet separation unit at a fixed period.
The separated header equivalent data part and the comparison information stored in the comparison information storage unit are compared to determine the type of the received packet, and the search table is searched for the header equivalent data as necessary. One or more packet analysis elements that are passed on to the next stage when the next stage uses the analysis result,
Header equivalent data from the last stage of the one or more packet analysis elements and the reception parameter. An update packet transmitter that combines the payload-corresponding data parts separated by the packet separator and outputs them as transmission packets,
Each of the packet analysis elements includes:
A header data storage unit that stores a header equivalent data portion sent from the received packet separation unit and outputs a packet analysis start timing signal after the storage is completed;
A header editing storage unit for extracting and storing different information from the header data storage unit according to a packet analysis program, and for storing the comparison information and temporary data generated during execution of the packet analysis program; ,
A header analysis result storage unit for storing a packet analysis result obtained by executing the packet analysis program;
A general-purpose arithmetic unit having a general-purpose register and starting execution of a packet analysis program triggered by a packet analysis start timing signal output from the header data storage unit;
Based on a special operation instruction included in the packet analysis program, the header data storage unit, the header edit storage unit, the header analysis result storage unit, or the comparison information storage unit is directly read and read. A special operation that performs a logical operation for packet analysis on data and directly writes a result to the header data storage unit, the header edit storage unit, the header analysis result storage unit, or the comparison information storage unit With the calculator
A packet processing apparatus.
According to the first and second aspects of the invention, processing such as identification of each field in the received packet header, extraction of search key information, and generation of a transmission packet header after receiving the search result is performed according to the type of received packet. Therefore, it is not necessary to prepare a high-performance CPU because it is possible to select the number of packet analysis elements to be processed and the type of processing to be performed by each packet analysis element.
[0014]
In the packet processing device according to
ThisA memo that stores a packet analysis program executed by the packet analysis elementLiPrepared,
After the fixed period, the execution of the packet analysis program is completed, and a packet analysis completion timing signal is output to the next stage element or update packet transmitter.
According to the configuration of
[0015]
According to a fourth aspect of the present invention, each of the packet analysis elements further includes,
in frontThe header analysis result is stored in synchronization with the packet analysis completion timing signal.PartStores the header analysis result of the packet analysis element in the subsequent stage of the data stored inPartOutput.
According to the configuration of
[0016]
According to a fifth aspect of the present invention, the header analysis result storage circuit comprises:
While analyzing the current header, the next packet is received and the analysis result of the current header is not overwritten with the analysis result of the next header, and each surface is provided for each packet analysis completion timing signal. It was set as the structure which switches to and memorize | stores alternately.
According to the configuration of the fifth aspect, since the analysis result information of the current packet can be held even during reception of the next packet, the packet analysis result information can be transmitted to the subsequent packet analysis element without lowering the throughput.
[0018]
Claim6According to the invention described in (1), the special arithmetic unit further performs an immediate logical operation included in the packet analysis program.
Claim6According to the configuration described in (1), design change and function addition can be realized.
[0019]
Claim7In the invention described in (2), the special operation instruction is stored in the header data storage.PartAnd the header analysis result storagePartAnd the header editing memoryPartAnd the comparison information storagePartIn this configuration, an access control signal for directly reading or writing any one of the above data and various enable signals required at the time of instruction execution are used.
Claim7According to the configuration described in the above, the header data is stored in the information necessary for executing the special operation instruction.Part, Header analysis result storagePart, Header editing memoryPartComparison information storagePartIt is possible to generate an access control signal such as an address so that the data can be directly read and written, and to generate various enable signals necessary for executing the instruction.
[0020]
Claim8The invention described in (2), the header data storagePartThe surface written during packet reception, andGeneral-purpose computing unitAnd a header register that alternately stores the header equivalent data of each packet in a two-plane configuration of the plane being analyzed by the special arithmetic unit.
Claim8According to the configuration described above, since the reception of the next packet can be started even during the analysis of the current packet, the header equivalent data is transmitted to the CPU in the packet analysis element and the special arithmetic unit while maintaining the wire speed. Data can be transferred to the header data storage circuit in the packet analysis element.
[0021]
Claim9The invention described in the aboveReceiveA payload accommodating unit that accommodates each payload-corresponding data portion of the plurality of received packets separated by the packet separating unit until the processing of the last-stage element is completed, and the payload accommodating unit includes the plurality of packets. Payload equivalent data is stored in one payload data storage memory and managed by a pointer.
Claim9According to the configuration described in FIG. 1, since only a number of pointers corresponding to the header-corresponding data under packet analysis are managed for one memory, a memory for accommodating each payload data of a plurality of received packets is required. The device can be realized at low cost.
[0022]
Claim10According to the invention described in the above, the search key output from the one or more packet analysis elements is selected and output to the search table in order to search the search table, and output from the search table based on the search key And a search data selector for outputting the search result to the packet analysis element that has output the search key.
Claim10According to the configuration described in, when configured with a plurality of packet analysis elements, the search data selector can receive a search key from any packet analysis element, and can transmit a search result to any packet analysis element. Therefore, even a plurality of packet analysis elements can access the search table, increasing the flexibility of program processing.
[0023]
Claim11In the invention described in the above, the search data selector includes:
A queue for responding to a difference in search time of each element with respect to the search table is provided, search result data output from the search table is stored in the queue, and output according to an instruction from a packet analysis element as an output destination The configuration is as follows.
Claim11When the search data selector receives the search result data from the search table with the FIFO, the search result data is received at a timing when the packet analysis element is required even if the response time of the search table changes. it can.
[0024]
Claim12In the invention described in the above, the update packet transmitter
When a transmission instruction is output from the packet analysis element at the final stage, after updating the header equivalent data according to the rewrite / insertion / deletion instruction to the header data, Send it as a packet,
When a discard instruction is output from the packet analysis element in the final stage, it is not a pointer to be read that was scheduled to be combined with the payload equivalent data instructed to be discarded via the payload read control signal to the payload accommodating unit, The pointer to be read next is selected and held until the next read instruction.
Claim12According to the configuration described in the above, the update packet transmission unit newly generates a header and a payload accommodating unit from the header equivalent data stored via the header data storage circuit according to the analysis result in the packet analysis element. Can generate a new transmission packet from the payload equivalent data stored.
[0025]
Claim13According to the invention described in the above, the header equivalent data stored in the header data storage circuit in the first stage element, the temporary data stored in the header edit storage circuit, and the packet stored in the header analysis result storage circuit A common sequential number is assigned to each packet of the three systems of analysis results and transferred to the last stage element, and the three systems of data of the same packet are transferred by the sequential number in the last stage element. Consistent configuration.
Claim13According to the configuration described in the above, information extracted from one received packet for packet analysis passes through three routes, but is transmitted with a common sequential number assigned to each route. By mounting the comparison circuit to be finally detected in the packet analysis element, it is possible to improve the reliability in the packet processing device.
[0026]
DETAILED DESCRIPTION OF THE INVENTION
Embodiments of the present invention will be described below with reference to the drawings. 1 schematically shows a received packet separator 10 and one or more packet analysis elements (hereinafter also simply referred to as elements) 100 (100a, 100b to 100N) configured by pipelines. A received packet payload storage unit (also simply referred to as a payload storage unit) 20, a search table 40, a
[0027]
For example, as shown in FIGS. 14A to 14H, the reception packet separation unit 10 detects a data delimiter of the
[0028]
Each
[0029]
The search table 40 stores search data for converting the header of the received
[0030]
Here, FIG. 2 shows the bus configuration in each
[0031]
The update
[0032]
<Received packet separator 10>
The packet processing apparatus shown in FIG. 1 receives a variable-length received
[0033]
<
The header
[0034]
When the packet analysis elements 100a, 100b to 100N store the header
[0035]
In accordance with the access control signal from each packet analysis program, all
[0036]
The received packet
[0037]
The
[0038]
<Update
The update
With the above-described configuration, one or more
[0039]
<< Detailed Description of
The packet analysis elements 100a and 100b to 100N shown in FIG.
Received packet separation unit 10, header data storage circuits (also simply referred to as header storage circuits) 150 a, 150 b to 150 N (shown in detail in FIG. 5) that store header
-Memories 120a, 120b to 120N storing packet analysis programs;
CPU 110a which fetches, decodes and executes each instruction of the packet analysis program stored in each of the memories 120a and 120b to 120N, and outputs special operation instruction instruction signals 115a and 115b to 115N from the fetched results, 110b-110N,
Special operation instruction decode circuits (decoders) 130a and 130b to 130N (shown in detail in FIG. 4) for decoding the special operation instruction instruction signals 115a and 115b to 115N output from the CPUs 110a and 110b to 110N,
Special arithmetic units 140a and 140b to 140N (shown in detail in FIG. 3) that execute special arithmetic instructions 133a and 133b to 133N decoded by the decoders 130a and 130b to 130N, respectively.
It has.
[0040]
In the above configuration, the header data storage circuits 150a, 150b to 150N receive the packet analysis start timing signals 152a, 152b to 152N as special arithmetic units 140a, 140b when they can store a predetermined number of bits of the header
[0041]
At this time, the CPUs 110a, 110b to 110N respectively read the read data 111a, 111b to 111N, and write data 113a by the access control signals 112a, 112b to 112N output to the header data storage circuits 150a, 150b to 150N. 113b to 113N are written, and the CPU 110a and 110b to 110N repeatedly perform transfer with general purpose registers to execute various general purpose operations. The decoders 130a and 130b to 130N decode the special operation instruction instruction signals 115a and 115b to 115N output from the CPUs 110a and 110b to 110N, respectively, and convert the special operation instructions 133a and 133b to 133N into the special operation units 140a, 140b to 140N. Are output to the header data storage circuits 150a and 150b to 150N and the comparison
[0042]
Each of the header data storage circuits 150a and 150b to 150N extracts the header extraction information from the stored header of the received
[0043]
Here, as shown in FIG. 14, the 19th and 20th bytes of the received
[0044]
Each
[0045]
Compared to the configuration of the general-purpose CPU 110 alone, each
[0046]
Further, each
[0047]
For example, when the packet analysis element 100a analyzes the L2 header and the packet analysis element 100b analyzes the IP header, the packet analysis program confirms the normality of the MAC-
[0048]
Therefore, a value “05DC” is stored in advance in the header edit storage circuit (also simply referred to as an edit storage circuit) 170a, and a value “4” is stored in advance in the header edit storage circuit 170b. When the value “0800” is extracted from the header data storage circuit 150a, the packet analysis element 100a is compared with “05DC” stored in the header edit storage circuit 170a by a size comparison instruction described later of the special arithmetic unit 140a. If it is determined that the value of “0800” extracted from the header data storage circuit 140a is large, it can be specified that the format is the DIX format. Therefore, the header analysis result storage circuit (also simply referred to as an analysis result storage circuit) 160a is stored in the header analysis result storage circuit 160a. A value indicating that the format is “DIX” is written.
[0049]
Then, in synchronization with the packet analysis completion timing signal 153a, the information in the header analysis result storage circuit 160a is written to the header analysis result storage circuit 160b in the packet analysis element 100b in the subsequent stage. “05DC” of the header edit storage circuit 170a is used only by the packet analysis program of the packet analysis element 100a, and the special arithmetic unit 140b of the packet analysis element 100b uses “DIX” written to the header analysis result storage circuit 160b. From the format information, it is assumed that the IP header is mounted after the 15th byte, and the field of the 15th byte stores “4” stored in the header edit storage circuit 170b in order to identify some values of the version information. ”And“ Match comparison ”.
[0050]
With the above-described configuration, the information extracted and analyzed by the
[0051]
Each of the header data storage circuits 150a and 150b to 150N of each
[0052]
However, if packets can be received during the time during which packet analysis processing is performed, the number of packets that can be processed per unit time increases, resulting in improved throughput. Therefore, even when there is a possibility of receiving a packet while analyzing the header, the header data storage circuits 150a and 150b to 150N are respectively connected to the CPUs 110a and 110b to 110N and the special arithmetic units 140a and 140b to 140N. Packet analysis is received for each packet analysis completion timing signal 153a, 153b to 153N as a two-sided configuration in order not to overwrite the next analysis result newly analyzed for the received
[0053]
With the above configuration, the header data storage circuits 150a, 150b to 150N are selected in a predetermined order for each of the packet analysis completion timing signals 153a, 153b to 153N, and the information is held. Even when the special arithmetic units 140a and 140b to 140N extract information necessary for packet analysis, the newly received information is stored without losing information including the header of the previous received
[0054]
<Detailed description of special arithmetic unit 140>
As shown in detail in FIG. 3, the special arithmetic unit 140 (140a to 140N) directly follows the special arithmetic control unit 145, the special arithmetic
[0055]
The one-to-many
[0056]
A logical product unit 1465, a
[0057]
The status notification unit 147 notifies the CPU 110 of the comparison result executed by any one of the comparison instructions (1461, 1462) in the
[0058]
With the above-described configuration, the special arithmetic unit 140 is not the
[0059]
<Detailed Description of Special Operation
As shown in detail in FIG. 4, in the special arithmetic
[0060]
With the above-described configuration, the special arithmetic unit 140 includes a plurality of
[0061]
<Detailed Description of Header
As shown in detail in FIG. 5, the header
[0062]
The header register write select circuit 156 detects that the header
[0063]
The packet analysis timing generation circuit 154
Only when the header
A packet analysis
A packet analysis
Generate.
[0064]
The header register read
[0065]
The header
Here, in FIG. 11, only “H” is shown as the header equivalent data, but actually “H + P # x” is the header equivalent data, which is the “predetermined bit width”. Also, the fixed time (fixed period) shown in FIG. 11 is “H + P # x” + α (α: Ethernet (R) standard minimum gap between packets). In FIG. 12, the header equivalent data is “H + P # x (part)” and the payload equivalent data is “P # x (remaining)”.
[0066]
When the packet data storage in the
[0067]
Using the packet analysis start timing
From the packet reception to the packet analysis completion, the processing of the first header equivalent data H has selected the selection plane -1 with the packet analysis
[0068]
In addition, it is possible to achieve both packet reception and packet analysis while arbitrating write / read contention from the CPU 110 and the special arithmetic unit 140 during header analysis and the header equivalent data H from the received packet separation unit 10.
Although not shown in the figure, a flag indicating the end of the packet is written in the
[0069]
<< Detailed Description of
As shown in detail in FIG. 6, the
[0070]
The
[0071]
The
[0072]
When the payload
[0073]
When the analysis of the first header equivalent data H by the packet analysis elements #a, #b, and #c is completed, the packet analysis element #c transfers the packet to the destination of the result obtained from the table search to the header edit storage circuit 170c. Or an instruction to insert or delete VLAN, for example, and write the
[0074]
The update
[0075]
The first header stored in the
When the packet discard instruction is included in the
[0076]
<< Detailed Description of
As shown in detail in FIG. 7, the
[0077]
With the above-described configuration, the
[0078]
Further, the
[0079]
<< Detailed Description of
As shown in detail in FIG. 8, the update
[0080]
With the above-described configuration, the update
[0081]
<< Modification of
In the modified example of the
[0082]
Sequential
[0083]
The transfer image of the sequential number with the above configuration will be described with reference to FIG. When the
[0084]
The sequential number #A is also written and transferred to the search
[0085]
In the same manner as described above, the elements 100a to 100b and the elements 100b to 100c are also transferred between the
[0086]
【The invention's effect】
As described above, according to the configuration described in
According to the configuration of
According to the configuration of
According to the configuration of the fifth aspect, since the analysis result information of the current packet can be held even during reception of the next packet, the packet analysis result information can be transmitted to the subsequent packet analysis element without lowering the throughput.
According to the configuration of the sixth aspect, since the special arithmetic unit can directly read and write data in the header data storage circuit, the header analysis result storage circuit, the header edit storage circuit, and the comparison information storage circuit, By changing the instruction order of operation instructions, design changes and function additions can be realized, and high-speed packet processing can be maintained.
According to the structure of
According to the configuration of the eighth aspect, information necessary for executing the special operation instruction can be directly read and written from the header data storage circuit, the header analysis result storage circuit, the header edit storage circuit, and the comparison information storage circuit. In addition, an access control signal such as an address can be generated, and various enable signals necessary for executing instructions can be generated.
According to the configuration of claim 9, since the reception of the next packet can be started even during analysis of the current packet, the header equivalent data is transmitted to the CPU and special arithmetic unit in the packet analysis element while maintaining the wire speed, In addition, data can be taken over to the header data storage circuit in the packet analysis element at the subsequent stage.
According to the configuration of the tenth aspect, since only a number of pointers corresponding to the header-corresponding data under packet analysis are managed for one memory, each payload data for receiving a plurality of received packets is stored. A device can be realized at low cost without the need for a memory.
According to the configuration of
According to the configuration of
According to the configuration of claim 13, the update packet transmission unit is configured to generate a header newly generated from the header equivalent data stored via the header data storage circuit according to the analysis result of the packet analysis element. A new transmission packet can be generated from the payload equivalent data stored in the payload storage unit.
According to the configuration of claim 14, information extracted from one received packet for packet analysis passes through three paths, but is transmitted with a common sequential number assigned to each path. By mounting a comparison circuit for finally detecting consistency in the packet analysis element, it is possible to improve the reliability in the packet processing apparatus.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a basic configuration of a packet processing apparatus according to the present invention.
FIG. 2 is a block diagram showing in detail the bus configuration in the packet analysis element of FIG.
FIG. 3 is a block diagram showing a special arithmetic unit in FIG.
4 is a block diagram showing a special operation instruction decode circuit in FIG. 1. FIG.
FIG. 5 is a block diagram showing a header data storage circuit in FIG.
6 is a block diagram showing a received packet payload accommodating unit in FIG. 1;
7 is a block diagram showing a search data selector in FIG. 1. FIG.
FIG. 8 is a block diagram showing an update packet transmission unit in FIG.
FIG. 9 is a block diagram showing a modification in which a sequential number comparison circuit is added to the packet analysis element in FIG.
FIG. 10 is an image diagram showing the sequential number comparison of FIG. 9;
FIG. 11 is a processing timing chart when three packet analysis elements according to the present invention are used, the minimum packet length, and the minimum inter-packet gap.
FIG. 12 is a processing timing chart when three packet analysis elements according to the present invention are used, an arbitrary packet length, and an arbitrary inter-packet gap.
FIG. 13 is a block diagram showing a conventional packet processing apparatus.
FIG. 14 is a diagram illustrating a configuration of a lower layer header of a conventional packet
FIG. 15 is a diagram showing the configuration of a conventional IPv4 header
[Explanation of symbols]
1 Received packet
10 Received packet separator
11 Header equivalent data
12 Payload equivalent data
20 Received packet payload storage
21 Waiting packet payload data
22 Payload data storage memory
23 Payload data writing circuit
24 Header compatible pointer generation circuit
25 Pointer holding circuit
26 Read pointer generation circuit
27 Payload data reading circuit
30 Search data selector
40 Search table
50 Comparison information storage circuit
60 Update packet transmitter
61 Transmitted packets
62 Payload read control signal
63 Payload read control signal generator
64 packet generator
100, 100a, b, ..., N Packet analysis element
110a, b, ..., N CPU
111a, b,..., N CPU read data from
112a, b,...,
113a, b,...,
115a, b, ..., N Special operation instruction instruction signal
120a, b, ..., N CPU program storage memory
130a, b, ..., N Special operation instruction decode circuit (decoder)
131 Instruction instruction analysis unit
132a, b, ..., N Special operation data extraction access control signal
133a, b, ..., N Special operation instruction decode signal
140, 140a, b, ..., N Special arithmetic unit
141, 141a, b,..., N Special operation data control signal (read data from header
142a, b, ..., N state notification signal
143, 143a, b, ..., N Write data to the
145 Special calculation control unit
146 arithmetic unit group
147 Status notification part
148 Special operation result data output part
150, 150a, b,..., N header data storage circuit
151a, b, ..., N Inter-element takeover header data
152, 152a, b, ..., N Packet analysis start timing signal
153, 153a, b, ..., N Packet analysis completion timing signal
154 packet analysis timing generation circuit
156 Header register write select circuit
157 Header register
158 Header register read select circuit
159 Header register pointer selector
160, 160a, b,..., N analysis result storage circuit
161a, b, ..., N Inter-element takeover analysis result data
162N Header analysis result storage circuit path sequential number
170, 170a, b,..., N header edit memory circuit
171, 171 a, b,..., N Search key data
172a, b, ..., N Header control data
1331 Enable instruction signal for each instruction
1332 bit mask signal
1333 bit shift direction indication signal
1334 Large / small comparison direction indication signal
1335 immediate data
1321 First address for special operation
1322 (For special operation) First write or read enable
1323 Second address (for special operation)
1324 (For special operation) Second write or read enable
1325 (for special operation) 3rd address
1326 (for special operation) 3rd write or read enable
1461 One-to-Many Match Comparison Unit
1462 Comparison section
1463 data transfer unit
1464 Partial data transfer unit
1465 AND
1466 OR part
1467 Adder
1468 bit shift section
1469 Bitwise OR part
1470 Checksum calculation unit
1471 Indirect address data transfer unit
1541 Packet analysis plane selection signal
1561 Header register write pointer
1571 header data storage circuit path sequential number
1581 Header register read pointer
1721 Header insertion instruction data
1722 Header deletion instruction data
1723 Packet transfer discard instruction signal
173N Search table route sequential number
Claims (13)
前記受信パケットの種類を判定するための比較情報を記憶する比較情報記憶ステップと、
前記受信パケットのデータ区切りを検出し、ヘッダ相当データ部分とペイロード相当データ部分を分離する受信パケット分離ステップと、
前記受信パケットの種類及び/又はあらかじめ割り当てたパケット解析内容に応じた数でパイプライン構成され、固定周期で前記受信パケット分離ステップにより分離された前記ヘッダ相当データ部分と前記比較情報記憶ステップにより記憶されている比較情報を比較して前記受信パケットの種類を判定するとともに、前記検索テーブルを検索して必要に応じて前記ヘッダ相当データを更新して次段に出力するとともに、当該解析結果を次段が使用する場合に次段に引き継ぐ1つ以上のパケット解析ステップと、
前記1つ以上のパケット解析ステップの最終段からのヘッダ相当データと前記受信パケット分離ステップにより分離された前記ペイロード相当データ部分を結合して送信パケットとして出力する更新パケット送信ステップとを、
備え、
前記パケット解析ステップの各々は、
前記受信パケット分離ステップにより分離されたヘッダ相当データ部分を格納して格納完了後にパケット解析開始タイミング信号を出力するヘッダデータ記憶ステップと、
パケット解析プログラムに応じて前記ヘッダデータ記憶ステップにより異なる情報を抽出して記憶するため、及び前記比較情報と前記パケット解析プログラム実行中に生成した一時的なデータを記憶するためのヘッダ編集記憶ステップと、
前記パケット解析プログラムを実行したパケット解析結果を記憶するヘッダ解析結果記憶ステップと、
汎用レジスタを用いて、前記ヘッダデータ記憶部から出力されたパケット解析開始タイミング信号をトリガとしてパケット解析プログラムの実行を開始する汎用演算ステップと、
前記パケット解析プログラムに含まれる特殊演算命令に基づいて、前記ヘッダデータ記憶ステップ、前記ヘッダ編集記憶ステップ、前記ヘッダ解析結果記憶ステップ又は前記比較情報記憶ステップの結果のデータを、直接、読み出し、読み出したデータに対してパケット解析のための論理演算を実行し、結果を前記ヘッダデータ記憶ステップ、前記ヘッダ編集記憶ステップ、前記ヘッダ解析結果記憶ステップ又は前記比較情報記憶ステップの結果のデータとして記憶する、特殊演算ステップとを、
有する、パケット処理方法。A search data storage step for storing search data for converting a header of a received packet into a header of a transmitted packet in a search table;
A comparison information storing step for storing comparison information for determining the type of the received packet;
A received packet separating step for detecting a data delimiter of the received packet and separating a header equivalent data portion and a payload equivalent data portion;
The pipeline is configured by the number according to the type of the received packet and / or the packet analysis content assigned in advance, and is stored by the comparison information storage step and the header equivalent data portion separated by the received packet separation step at a fixed period. Comparing the received comparison information to determine the type of the received packet, searching the search table, updating the header-corresponding data as necessary, and outputting to the next stage. One or more packet analysis steps to take over to the next stage when
An update packet transmission step for outputting the payload corresponding data portions separated by the reception packet separation steps header corresponding data from the last stage of the one or more packet analysis step as forming combined and transmitted packets,
Prepared ,
Each of the packet analysis steps includes:
A header data storage step of storing the header equivalent data portion separated by the received packet separation step and outputting a packet analysis start timing signal after completion of the storage;
A header editing storage step for extracting and storing different information in the header data storage step according to a packet analysis program, and for storing the comparison information and temporary data generated during execution of the packet analysis program; ,
A header analysis result storage step for storing a packet analysis result obtained by executing the packet analysis program;
Using a general-purpose register, a general-purpose calculation step for starting execution of a packet analysis program triggered by a packet analysis start timing signal output from the header data storage unit;
Based on a special operation instruction included in the packet analysis program, the data of the result of the header data storage step, the header edit storage step, the header analysis result storage step or the comparison information storage step is directly read and read. A logical operation for packet analysis is performed on the data, and the result is stored as the result data of the header data storage step, the header edit storage step, the header analysis result storage step or the comparison information storage step. A calculation step,
A packet processing method.
前記受信パケットの種類を判定するための比較情報を記憶する比較情報記憶部と、
前記受信パケットのデータ区切りを検出し、ヘッダ相当データ部分とペイロード相当データ部分を分離する受信パケット分離部と、
前記受信パケットの種類及び/又はあらかじめ割り当てたパケット解析内容に応じた数でパイプライン構成され、固定周期で前記受信パケット分離部により分離された前記ヘッダ相当データ部分と前記比較情報記憶部により記憶されている比較情報を比較して前記受信パケットの種類を判定するとともに、前記検索テーブルを検索して必要に応じて前記ヘッダ相当データを更新して次段に出力するとともに、当該解析結果を次段が使用する場合に次段に引き継ぐ1つ以上のパケット解析エレメントと、
前記1つ以上のパケット解析エレメントの最終段からのヘッダ相当データと前記受信パケット分離部により分離された前記ペイロード相当データ部分を結合して送信パケットとして出力する更新パケット送信部とを、備え、
前記パケット解析エレメントの各々は、
前記受信パケット分離部から送出されたヘッダ相当データ部分を格納して格納完了後にパケット解析開始タイミング信号を出力するヘッダデータ記憶部と、
パケット解析プログラムに応じて前記ヘッダデータ記憶部から異なる情報を抽出して記憶するため、及び前記比較情報と前記パケット解析プログラム実行中に生成した一時的なデータを記憶するためのヘッダ編集記憶部と、
前記パケット解析プログラムを実行したパケット解析結果を記憶するヘッダ解析結果記憶部と、
汎用レジスタを有し、前記ヘッダデータ記憶部から出力されたパケット解析開始タイミング信号をトリガとしてパケット解析プログラムの実行を開始する汎用演算器と、
前記パケット解析プログラムに含まれる特殊演算命令に基づいて、前記ヘッダデータ記憶部、前記ヘッダ編集記憶部、前記ヘッダ解析結果記憶部又は前記比較情報記憶部に対して、直接、データを読み出し、読み出したデータに対してパケット解析のための論理演算を実行し、結果を前記ヘッダデータ記憶部、前記ヘッダ編集記憶部、前記ヘッダ解析結果記憶部又は前記比較情報記憶部に対して、直接、書き込みする特殊演算器とを、
有する、パケット処理装置。A search table for storing search data for converting the header of the received packet into the header of the transmitted packet;
A comparison information storage unit for storing comparison information for determining the type of the received packet;
A received packet separator that detects a data delimiter of the received packet and separates a header equivalent data portion and a payload equivalent data portion;
A pipeline is configured with a number corresponding to the type of the received packet and / or the packet analysis content allocated in advance, and is stored in the header equivalent data portion separated by the received packet separation unit at a fixed period and the comparison information storage unit. Comparing the received comparison information to determine the type of the received packet, searching the search table, updating the header-corresponding data as necessary, and outputting to the next stage. One or more packet analysis elements to take over to the next stage when
And an update packet transmission unit which outputs the payload corresponding data portions separated by the header corresponding data and the received packet separation section from the final stage of the one or more packet analysis element as sintering combined and transmitted packets, comprising,
Each of the packet analysis elements includes:
A header data storage unit that stores a header equivalent data portion sent from the received packet separation unit and outputs a packet analysis start timing signal after the storage is completed;
A header editing storage unit for extracting and storing different information from the header data storage unit according to a packet analysis program, and for storing the comparison information and temporary data generated during execution of the packet analysis program; ,
A header analysis result storage unit for storing a packet analysis result obtained by executing the packet analysis program;
A general-purpose arithmetic unit having a general-purpose register and starting execution of a packet analysis program triggered by a packet analysis start timing signal output from the header data storage unit;
Based on a special operation instruction included in the packet analysis program, the header data storage unit, the header edit storage unit, the header analysis result storage unit, or the comparison information storage unit is directly read and read. A special operation that performs a logical operation for packet analysis on data and directly writes a result to the header data storage unit, the header edit storage unit, the header analysis result storage unit, or the comparison information storage unit With the calculator
A packet processing apparatus.
当該パケット解析エレメントが実行するパケット解析プログラムを記憶するメモリを備え、
前記固定周期の後に前記パケット解析プログラムの実行を完了してパケット解析完了タイミング信号を次段のエレメント又は更新パケット送信部に出力することを特徴とする請求項2に記載のパケット処理装置。Each of the packet analysis elements includes :
Comprising a memory for storing the packet analysis program skilled the packet analysis element is executed,
3. The packet processing apparatus according to claim 2, wherein execution of the packet analysis program is completed after the fixed period, and a packet analysis completion timing signal is output to a next-stage element or an update packet transmission unit.
前記パケット解析完了タイミング信号に同期して前記ヘッダ解析結果記憶部で記憶したデータを後段のパケット解析エレメントのヘッダ解析結果記憶部へ出力することを特徴とする請求項3に記載のパケット処理装置。Each of the packet analysis elements further includes:
Packet processing apparatus according to claim 3, characterized in that for outputting data stored in synchronization with the prior SL packet analysis completion timing signal at the header analysis result storage unit to the header analysis result storage unit of the subsequent packet analysis element .
現ヘッダの解析をしている間に次のパケットを受信して前記現ヘッダの解析結果に次ヘッダの解析結果を上書きしないように2面で構成され、各面を前記パケット解析完了タイミング信号毎に切り替えて交互に記憶することを特徴とする請求項4に記載のパケット処理装置。The header analysis result storage unit
While analyzing the current header, the next packet is received and the analysis result of the current header is not overwritten with the analysis result of the next header. The packet processing device according to claim 4, wherein the packet processing device stores the information alternately.
前記ヘッダデータ記憶部と、前記ヘッダ解析結果記憶部と、前記ヘッダ編集記憶部と前記比較情報記憶部のいずれかのデータを直接リード、ライトするためのアクセス制御信号と、命令実行時に必要な各種イネーブル信号を含むことを特徴とする請求項2に記載のパケット処理装置。The special operation instruction is
The header data storage unit , the header analysis result storage unit , the access control signal for directly reading and writing data in any one of the header edit storage unit and the comparison information storage unit , and various types necessary for instruction execution The packet processing apparatus according to claim 2 , further comprising an enable signal.
前記検索テーブルに対する各エレメントの検索時間の違いに対応するためのキューを具備し、前記検索テーブルから出力された検索結果データを前記キューに蓄積し、出力先となるパケット解析エレメントからの指示により出力することを特徴とする請求項9に記載のパケット処理装置。The search data selector is
A queue for responding to a difference in search time of each element with respect to the search table is provided, search result data output from the search table is stored in the queue, and output according to an instruction from a packet analysis element as an output destination The packet processing device according to claim 9 .
前記最終段のパケット解析エレメントから送信指示が出力される場合に、ヘッダデータへの書換・挿入・削除指示に従ってヘッダ相当データの更新を行った上でペイロード収容部から続くペイロード相当データと結合してパケットとして送信し、
前記最終段のパケット解析エレメントから破棄指示が出力される場合に、ペイロード収容部へのペイロード読み出し制御信号を経由して破棄指示されたペイロード相当データと結合する予定であった読み出すべきポインタではなく、次に読み出すべきポインタを選択して次の読み出し指示まで保持することを特徴とする請求項2から11のいずれか1つに記載のパケット処理装置。The update packet transmitter is
When a transmission instruction is output from the packet analysis element at the final stage, after updating the header equivalent data according to the rewrite / insertion / deletion instruction to the header data, Send it as a packet,
When a discard instruction is output from the packet analysis element in the final stage, it is not a pointer to be read that was scheduled to be combined with the payload equivalent data instructed to be discarded via the payload read control signal to the payload accommodating unit, select the pointer to read next packet processing apparatus according to any one of claims 2 to 11, characterized in that hold up the next read instruction.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2002223439A JP3935021B2 (en) | 2002-07-31 | 2002-07-31 | Packet processing method and apparatus |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2002223439A JP3935021B2 (en) | 2002-07-31 | 2002-07-31 | Packet processing method and apparatus |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2004064648A JP2004064648A (en) | 2004-02-26 |
| JP3935021B2 true JP3935021B2 (en) | 2007-06-20 |
Family
ID=31943189
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2002223439A Expired - Fee Related JP3935021B2 (en) | 2002-07-31 | 2002-07-31 | Packet processing method and apparatus |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3935021B2 (en) |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP4571182B2 (en) * | 2005-01-27 | 2010-10-27 | 富士通株式会社 | NETWORK DEVICE MANAGEMENT DEVICE, NETWORK DEVICE MANAGEMENT METHOD, NETWORK DEVICE, PROGRAM USED FOR THEM, AND SYSTEM |
| CN103780481B (en) | 2012-10-18 | 2017-10-27 | 中兴通讯股份有限公司 | The method and device of message modification and forwarding in a kind of data communication network |
| CN113543265B (en) * | 2020-04-14 | 2024-07-19 | 四川海格恒通专网科技有限公司 | TDMA wireless ad hoc network service fast relay system and method |
-
2002
- 2002-07-31 JP JP2002223439A patent/JP3935021B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2004064648A (en) | 2004-02-26 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| KR102402176B1 (en) | Apparatus and method of generating lookups and making decisions for packet modifying and forwarding in software-defined network engine | |
| US7283528B1 (en) | On the fly header checksum processing using dedicated logic | |
| US7916632B1 (en) | Systems and methods for handling packet fragmentation | |
| JP4049863B2 (en) | MPEG2 transport stream packet parser system | |
| US7701941B2 (en) | Network switch with mutually coupled look-up engine and network processor | |
| US7782857B2 (en) | Logical separation and accessing of descriptor memories | |
| US20040030803A1 (en) | Performing lookup operations using associative memories optionally including modifying a search key in generating a lookup word and possibly forcing a no-hit indication in response to matching a particular entry | |
| US7680116B1 (en) | Optimized buffer loading for packet header processing | |
| US20040030802A1 (en) | Performing lookup operations using associative memories optionally including selectively determining which associative memory blocks to use in identifying a result and possibly propagating error indications | |
| JP4203979B2 (en) | Packet processing device | |
| US8594092B2 (en) | Packet relay method and device | |
| CN103368853A (en) | SIMD processing of network packets | |
| AU2003265288B2 (en) | Associative memory with enhanced capabilities | |
| US7239630B1 (en) | Dedicated processing resources for packet header generation | |
| JP3935021B2 (en) | Packet processing method and apparatus | |
| JP4342128B2 (en) | Packet processor and packet processor system | |
| US7158520B1 (en) | Mailbox registers for synchronizing header processing execution | |
| US7180893B1 (en) | Parallel layer 2 and layer 3 processing components in a network router | |
| JP3233353B2 (en) | Header processing device and header processing method | |
| US9210093B2 (en) | Alignment circuit and receiving apparatus | |
| JP2007228227A (en) | Communication device | |
| CN119071367B (en) | Data forwarding method and data forwarding system | |
| JP2002335275A (en) | Packet processing device | |
| CN121098790A (en) | Message processing methods, message processing devices, and network interface cards | |
| JP2012050052A (en) | Packet processor, packet processing method and communication apparatus |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20050615 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20061207 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20061212 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20070213 |
|
| 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: 20070313 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20070316 |
|
| R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| LAPS | Cancellation because of no payment of annual fees |