JP3935021B2 - Packet processing method and apparatus - Google Patents

Packet processing method and apparatus Download PDF

Info

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
Application number
JP2002223439A
Other languages
Japanese (ja)
Other versions
JP2004064648A (en
Inventor
清 池田
直人 岡
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Corp
Panasonic Holdings Corp
Original Assignee
Panasonic Corp
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Panasonic Corp, Matsushita Electric Industrial Co Ltd filed Critical Panasonic Corp
Priority to JP2002223439A priority Critical patent/JP3935021B2/en
Publication of JP2004064648A publication Critical patent/JP2004064648A/en
Application granted granted Critical
Publication of JP3935021B2 publication Critical patent/JP3935021B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

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】
請求項に記載の発明は、前記特殊演算器がさらに、前記パケット解析プログラムに含まれる即値の論理演算を行う構成とした。
請求項に記載の構成によれば、設計変更や機能追加を実現することができる。
【0019】
請求項に記載の発明は、前記特殊演算命令は、前記ヘッダデータ記憶と、前記ヘッダ解析結果記憶と、前記ヘッダ編集記憶と前記比較情報記憶のいずれかのデータを直接リード、ライトするためのアクセス制御信号と、命令実行時に必要な各種イネーブル信号を含む構成とした。
請求項に記載の構成によれば、特殊演算命令の実行に必要な情報をヘッダデータ記憶、ヘッダ解析結果記憶、ヘッダ編集記憶、比較情報記憶のデータを直接リード、ライトできるようにアドレスなどのアクセス制御信号を生成し、かつ命令実行時に必要な各種イネーブル信号を生成できる。
【0020】
請求項に記載の発明は、前記ヘッダデータ記憶は、パケット受信中に書き込まれる面と、前記汎用演算器及び特殊演算器により解析されている面の2面構成で各パケットの前記ヘッダ相当データを交互に格納するヘッダレジスタを備えた構成とした。
請求項に記載の構成によれば、現パケットの解析中でも、次パケットの受信を開始できるため、ワイヤースピードを維持しながら、パケット解析エレメント内CPU及び特殊演算器へヘッダ相当データを伝達し、かつ後段のパケット解析エレメント内のヘッダデータ記憶回路へデータを引き継ぐことができる。
【0021】
請求項に記載の発明は、前記受信パケット分離部により分離された複数の受信パケットの各ペイロード相当データ部分を、前記最終段のエレメントの処理が終了するまで収容するペイロード収容部をさらに備え、前記ペイロード収容部は、前記複数のパケットのペイロード相当データを1つのペイロードデータ蓄積用メモリに格納してポインタにより管理する構成とした。
請求項に記載の構成によれば、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 LLC information 405 described in IEEE 802.2;
(D) LLC + SNAP packet
And VLAN information 407 described in IEEE 802.1Q is mounted on the above four types of packets.
(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 Layer 2 header (hereinafter referred to as L2 header) of each packet is MAC-DA information (destination MAC address) 401, MAC-SA information (source MAC address) 402, Type information 403, Length information 404, LLC information 405, SNAP. The information 406 and the VLAN information 407 are mounted, and the L2 header is configured by a combination of each information. Therefore, the length of the L2 header is different for each packet type. In FIG. 14, these pieces of information are simply displayed as “MAC-DA”, “Type”, or the like.
[0005]
The packet has an L2 header followed by a payload 408. In the case of an IPv4 packet, as shown in FIG. 15, the version information 701, the header length information 702, the TOS information 703, the total length information 704, the identification number in order from the top. Layer 3 header (hereinafter referred to as L3 header) including information 705, fragment information 706, TTL information 707, protocol number information 708, header checksum information 709, transmission source IP address information 710, transmission destination IP address information 711, and option information 712 is included. It is installed.
[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-DA information 401, MAC-SA information 402, TTL information 707, and header checksum information 709 are rewritten. The newly generated MAC-DA information 401 needs to have a value corresponding to the destination IP address information 711.
[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 register 350 is a memory for storing information on the head portion of a packet including a lower layer header and an upper layer header of the packet. The CPU 354 analyzes the received packet header stored in the register 350 and receives the received packet. Information necessary for transmission packet header generation included in the header is extracted and stored in the register 351, and the CPU 355 refers to the table 357 and stores a value corresponding to the information stored in the register 351 in the register 352. The CPU 356 newly generates a transmission packet header according to the value stored in 352 and stores it in the register 353. In order to transfer data between the registers 350, 351, and 352, the start of each program is determined while checking a flag register indicating whether data can be written or read.
[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 register 351. The CPU 354
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 register 351;
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 CPU 354 can read at one time, and repeatedly read it in several times.
[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 CPU 354 can read at one time and the number of times it can be read per unit time. Since a packet processing device requires a CPU 354 with higher performance, the cost of the product is increased. Similarly, the time taken to write the transmission packet header to the register 353 depends on the amount of data that the CPU 356 can write at a time and the number of times that the data can be written per unit time. Since the CPU 356 is required, the cost of the product is also increased (first problem).
[0010]
In addition, between the CPUs 354, 355, and 356, notification and detection of whether or not the flag register information mounted for each of the registers 350, 351, 352, and 353 can be used has a fixed period. For this reason, it is determined that the registers 350, 351, 352, and 353 are read and an extra processing step other than the packet analysis is required, and the program size including the packet analysis is increased, that is, the program storage memory is also increased. Incurs high costs (second problem).
[0011]
In the conventional apparatus, the register 351 and 352 that can be connected to the table 357 is changed by the processing load, for example, because the register 351 and 352 that can be connected to the table 350 and the register 353 that is used at the time of transmission are fixed. You can't change it if you want. Therefore, there is a need for a packet processing apparatus that can process not only the IPv4 header described above but also various types of headers typified by IPv6 header and MPLS, and new protocols are defined every day. Therefore, a packet processing device that can be easily modified and changed in the future and has a high degree of flexibility in design change is desired (third problem).
[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 claim 2
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 claim 3, each of the packet analysis elements includes,
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 claim 3, since the transfer of information between the packet analysis elements of the pipeline configuration is also performed with a predetermined timing signal, no special flag (register) and processing are required. All can be assigned to individual packet analysis processing.
[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 claim 4, when configured with one or more packet analysis elements, the information extracted and analyzed by the packet analysis element in the previous stage is not processed redundantly. Distribution can be flexibly handled, and all memory sizes for storing programs can be assigned to individual packet analysis processes.
[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 search data selector 30, a comparison information storage circuit 50, and an update packet transmission unit 60. Details are shown in FIGS.
[0027]
For example, as shown in FIGS. 14A to 14H, the reception packet separation unit 10 detects a data delimiter of the reception packet 1 having a different format, separates the header equivalent data 11 and the payload equivalent data 12, and each of them is the first stage. To the packet analysis element 100a and the payload accommodating unit 20.
[0028]
Each packet analysis element 100 stores the header equivalent data 11 separated by the packet separation unit 10 and the data from the previous element 100, analyzes the packet type, and updates the header. For example, when the eight types of packets shown in FIGS. 14A to 14H are determined, the first element 100a can be divided into two groups by determining the presence or absence of the VLAN information 407, etc. Next, it can be further divided into two groups by determining the presence / absence of Length information 404 and the like in the second element 100b. Next, one element is determined by determining the presence / absence of SNAP information 406 and the like in the third element 100c. Since the packet type can be specified, the element 100 may be composed of three elements. In addition, if the number of packet types to be determined increases in the future, the amount may be added to the subsequent stage of the third element 100c. Here, each element 100 is configured to execute packet analysis and header conversion processing at a fixed period, and is configured to pass the analysis result to the subsequent element 100 when the next stage uses it.
[0029]
The search table 40 stores search data for converting the header of the received packet 1 into the header of the transmission packet. For example, the correspondence between the MAC-DA information 401 and the destination IP address information 711 is stored. The search data selector 30 outputs the search key data 171a and 171b to 171N extracted from any one or more of the packet analysis elements 100a and 100b to 100N as the search key data 31 to the search table 40. Packet analysis elements 100a and 100b in which any one of the search result data 32a and 32b to 32N selected from the search result data 41 corresponding to the search key data 31 sent from the table 40 by the search data selector 30 is determined. Output to ~ 100.
[0030]
Here, FIG. 2 shows the bus configuration in each element 100 in detail, and reference numerals 111, 112, 113, 141, 142, and 132 indicate that they are transmitted on the bus. The comparison information storage circuit 50 stores, for example, comparison information for determining the packet type as shown in FIGS. 14A to 14H in advance, and the comparison information is stored in the CPUs 110a and 110b to 110N in each element 100. CPU 110a, as read data (111a, 111b-111N), (141a, 141b-141N), respectively, in accordance with access control signals 112a, 112b-112N from decoder 130 and access control signals 132a, 132b-132N from decoders 130a, 130b-130N. 110b to 110N and special arithmetic units 140a and 140b to 140N.
[0031]
The update packet transmission unit 60 includes a header-equivalent data 11 to be updated in accordance with an instruction from the packet analysis element 100N corresponding to the final stage among the one or more packet analysis elements 100a and 100b to 100N, and a transmission waiting packet output from the payload storage unit 20. Payload data 21 is sequentially combined and output.
[0032]
<Received packet separator 10>
The packet processing apparatus shown in FIG. 1 receives a variable-length received packet 1 as shown in FIG. 14, and the received packet separator 10 converts the received packet 1 into a predetermined bit width such as 8 bits (16 bits), 32 bits, or the like. It is presumed that the L2 header and the upper header as shown in FIGS. 14 and 15 are included by taking in and rearranging the data into the data delimiter units starting from the transmission destination MAC address (MAC-DA) 401 as shown in FIG. The header equivalent data 11 corresponding to a predetermined data length and the other payload equivalent data 12 are separated into two data. The header equivalent data 11 is sent to the packet analysis element 100a, and the payload equivalent data 12 is received packet payload accommodating portion. Output to 20 respectively.
[0033]
<Packet analysis element 100>
The header equivalent data 11 separated by the received packet separation unit 10 is stored in the first-stage packet analysis element 100a. The packet analysis element 100 is composed of one or more pipelines. When the packet analysis element 100 is composed of one, the packet analysis element 100a = 100N, and in the case of two or more, the header equivalent data 11 stored in each packet analysis element 100 is obtained. Is output to the subsequent packet analysis elements 100b, 100c to 100N or the update packet transmitter 60 after a predetermined fixed period.
[0034]
When the packet analysis elements 100a, 100b to 100N store the header equivalent data 11, the packet analysis start timing signal for notifying that the bit string that can be analyzed by the packet analysis program is stored in the element 100 within the header equivalent data 11. 152a and 152b to 152N are generated, and the packet analysis program is started to be executed by using the packet analysis start timing signals 152a and 152b to 152N as a trigger.
[0035]
In accordance with the access control signal from each packet analysis program, all packet analysis elements 100 are common to identify whether or not the information is required by the packet analysis program in comparison with the information extracted from the header equivalent data 11 of the received packet 1. Then, the comparison information storage circuit 50 generates comparison information necessary for the packet analysis program from the stored information, so that the data is sequentially identified and extracted from the head of the data. The analysis is advanced, the format is clarified, the execution of the packet analysis program for each packet analysis element 100 such as information extraction from the search key data 31 and the search result data 41 as will be described later is finished, and the subsequent stage is performed after a predetermined fixed period. Packet analysis elements 100a, 100b to 100N (in the case of one, the same packet analysis element 100), the analysis result and the header equivalent data 11 are taken over.
[0036]
The received packet payload accommodating unit 20 stores the payload equivalent data 12 from the received packet separating unit 10, and the header equivalent data 11 that is the other data separated from the received packet separating unit 10 is one or more pipelines The payload equivalent data 12 is held until the update packet transmission unit 60 reads through the packet analysis elements 100a and 100b to 100N having the structure.
[0037]
The transmission packet 61 loaded with a new header determines the transmission destination based on the analysis result by the packet analysis elements 100a and 100b to 100N and the search of the search table 40 as described above. At that time, the search data selector 30 outputs the search key data 31 extracted from the header equivalent data 11 by any of the packet analysis elements 100a, 100b to 100N, and outputs it to the search table 40. An entry (search result data) 41 corresponding to the key data 31 is sent to predetermined packet analysis elements 100a and 100b to 100N.
[0038]
<Update packet transmitter 60>
The update packet transmission unit 60 reads the header equivalent data 11 to be updated according to the instruction from the packet analysis element 100N corresponding to the final stage among the packet analysis elements 100a and 100b to 100N under the control of the payload accommodating unit 20, and the header equivalent data 11 When the final data is detected, the transmission waiting packet payload data 21 corresponding to the header equivalent data 11 is read so as to be sequentially combined, and the transmission packet 61 is output.
With the above-described configuration, one or more packet analysis elements 100 process various processes such as identification of each field in the header equivalent data 11, extraction of search key information, and generation of a new header after receiving a search result. In other words, each packet analysis element 100 can select what kind of processing, that is, a packet analysis program to be executed.
[0039]
<< Detailed Description of Element 100 >>
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 equivalent data 11 sent from the preceding element 100,
-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 equivalent data 11, respectively. Output to ~ 140N. With this as a trigger, the CPUs 110a, 110b to 110N start executing the packet analysis program, and the special arithmetic units 140a, 140b to 140N execute special arithmetic instructions (special arithmetic instruction decode signals 133a, 133b to 133N) in parallel. .
[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 information storage circuit 50 via the bus.
[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 packet 1, and outputs it to the special arithmetic units 140a and 140b to 140N as read data 141a and 141b to 141N via the bus. . The comparison information storage circuit 50 extracts comparison information for comparison with the read data 141a, 141b to 141N (header extraction information), and outputs it as read data 141a, b,. The special arithmetic units 140a and 140b to 140N respectively compare the header extraction information and the comparison information, and output the status notification signals 142a and 142b to 142N, which are comparison result information, to the CPUs 110a and 110b to 110N. A packet to be transmitted to the subsequent packet analysis element 100 is determined according to the state notification signals 142a and 142b to 142N.
[0043]
Here, as shown in FIG. 14, the 19th and 20th bytes of the received packet 1 are any of the first 2 bytes of Type information, Length information, or VLAN information. As the header extraction information, the access control signal 132a is output so as to extract the 19th and 20th bytes of the received packet 1 to the header data storage circuit 150a, and the comparison information storage circuit generates 0800h indicating IPv4 as the comparison information. 50 is also output from the header data storage circuit 150a from the access control signal 132a from the decoder 130a, so that the match comparison result signal included in the status notification signal 142 indicates a match between the header extraction information and the comparison information. The received packet 1 is determined to be a DIX packet, and the subsequent packet When the DIX packet processing is started from the packet analysis element 100 and a mismatch is indicated, the 19th and 20th bytes of the received packet 1 from the next time are either Length information or the first 2 bytes of VLAN information. Therefore, a plurality of formats of the received packet 1 can be determined, and a packet process corresponding to the determined format of the received packet 1 can be performed.
[0044]
Each packet analysis element 100 has a pipeline configuration, but each has the same configuration and the same function. Therefore, by changing the packet analysis program installed in each element 100, the configuration is the same without changing hardware. Protocol header analysis can also be performed.
[0045]
Compared to the configuration of the general-purpose CPU 110 alone, each packet analysis element 100 is simply combined with the CPU 110 and the special arithmetic unit 140 to extract information from the header equivalent data 11 and transfer it to the general-purpose register built in the CPU. Since the necessary information can be directly extracted from the header data storage circuit 150 instead of the header analysis after that, the header analysis can be performed at a high speed.
[0046]
Further, each packet analysis element 100 needs to extract different information for each header data storage circuit 150 in accordance with the packet analysis program, and a location for storing comparison information for identifying information by comparison in advance and a packet analysis program Header editing storage circuits 170a and 170b to 170N are provided as locations for storing temporary data generated during execution, and header analysis result storage circuits 160a and 160b to 160N for storing packet analysis results obtained by executing the packet analysis program. To do.
[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-DA 401 and MAC-SA 402 shown in FIG. Depending on the value of the field, it is possible to identify whether the received packet 1 is in DIX format or LLC + SNAP format.
[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 packet analysis element 100N-1 in the preceding stage is duplicated and the analysis processing is not performed in the packet analysis element 100N in the subsequent stage. Therefore, each packet analysis element 100 has an individual packet analysis program. System can be configured efficiently.
[0051]
Each of the header data storage circuits 150a and 150b to 150N of each element 100 shown in FIG. 1 stores the header equivalent data 11 for a predetermined fixed period, and packet analysis start timing signals 152a and 152b for the next fixed period. The CPU 110a, 110b-110N and the special arithmetic units 140a, 140b-140N execute packet analysis processing according to the respective packet analysis programs with each of .about.152N as a base point. It becomes processing.
[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 packet 1 with the current analysis result that has been analyzed or has been analyzed Switch between the plane and the packet analysis plane and select them alternately.
[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 packet 1 that has already been stored. Can do.
[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 data control signal 141 and the special arithmetic instruction decode signal 133 from the special arithmetic instruction decode circuit 130. Arithmetic unit group 146 that performs various processes on data 141 read from the header data storage circuit 150, the header analysis result storage circuit 160, the header edit storage circuit 170, and the comparison information storage circuit 50 in a predetermined bit width unit. And a state notification unit 147 and a special calculation result data output unit 148. The arithmetic unit group 146 is an enable instruction signal 1331 for each instruction, and a one-to-many match comparison unit 1461, a magnitude comparison unit 1462, a data transfer unit 1463, a partial data transfer unit 1464, A product unit 1465, a logical sum unit 1466, an adder unit 1467, a bit shift unit 1468, a post-bit shift logical sum unit 1469, a checksum operation unit 1470, and an indirect address data transfer unit 1471 are provided.
[0055]
The one-to-many match comparison unit 1461 includes first data and second data (a header data storage circuit 150, a comparison information storage circuit 50, an analysis result storage circuit 160, a first calculation data control signal 141 (141a to 141N), Read data of the edit memory circuit 170), and the first data and the second data are headed and the continuous data are simultaneously compared. The magnitude comparison unit 1462 determines whether the first data is large or the second data is large with respect to the bit widths specified by the bit mask signal 1332 for the first data and the second data, respectively. Compare according to 1334. The data transfer unit 1463 transfers the first data extracted from any one of the storage circuits 150, 50 to the different storage circuits 50, 150, and the partial data transfer unit 1464 uses the bit mask signal 1332 of the first data. Only the designated bit width is transferred to the different storage circuits 50 and 150.
[0056]
A logical product unit 1465, a logical sum unit 1466, and an adder unit 1467 respectively perform logical sum, logical product, and addition of the first data and the second data. The bit shift unit 1468 shifts the first data by the number of bits indicated by the second data to the right or left indicated by the bit shift direction instruction signal 1333. The post-bit-shift logical sum unit 1469 performs a logical sum of the second data and the data shifted by the number of bits designated by the immediate data 1335 in the direction indicated by the bit shift direction instruction signal 1333 by the combination operation. In the checksum calculation unit 1470, the first data (first operand) represents the head pointer (starting point), and the data length specified by the second data (second operand) is added over a plurality of clocks. The indirect address data transfer unit 1471 transfers the data at the address indicated by the data output from any one of the storage circuits 150 and 50 designated with the second data as an address to the storage circuits 50 and 150 indicated by the first data.
[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 computing unit group 146 and the packet analysis start timing signal 152 output from the header data storage circuit 150. Generated as signal 142. The special operation result data output unit 143 generates write data 143 to be written to an address designated via the decode circuit 130 by an instruction (1463 to 1471) other than comparison in the arithmetic unit group 146, and writes this to the header storage circuit 150. .
[0058]
With the above-described configuration, the special arithmetic unit 140 is not the arithmetic unit group 146 that merely analyzes the header shown in FIG. 14 or FIG. Can be used by changing the program, and data can be extracted directly from the header data storage circuit 150, the header analysis result storage circuit 160, the header edit storage circuit 170, and the comparison information storage circuit 50 without fetching the data into the CPU 110. The program can be executed while maintaining packet processing. Further, by outputting the status notification signal 142 to the CPU 110, packet analysis can be performed by a program to be executed next using program branching or comparison result determination.
[0059]
<Detailed Description of Special Operation Instruction Decode Circuit 130>
As shown in detail in FIG. 4, in the special arithmetic instruction decoding circuit 130 constituting the decoder 130 of FIG. 1, the instruction instruction analysis unit 131 includes header data to be read access included in the special arithmetic instruction instruction signal 115 from the CPU 110. Read address generation of information to be extracted from the storage circuit 150, the header editing storage circuit 170, or the comparison information storage circuit 50, and a special operation execution result (write data) 143 are sent to the header data storage circuit 150, the header analysis result storage circuit 160, the header As write destination addresses of any one of the edit memory circuits 170, three addresses of a first address 1321, a second address 1323, and a third address 1325, and first and second addresses corresponding to the addresses 1321, 1323, and 1325, respectively. , Third write or read enable signal 13 2, 1324, 1326 including special operation data extraction access control signal 132, enable instruction signal 1331 for each instruction required when executing the special operation instruction, bit mask signal 1332, and bit shift direction instruction signal 1333 A special operation instruction decode signal 133 including a direction instruction signal 1334 and immediate data 1335 of an operand of an instruction described in the program can be output.
[0060]
With the above-described configuration, the special arithmetic unit 140 includes a plurality of arithmetic unit groups 146, but can perform a plurality of arithmetic operations using a common interface.
[0061]
<Detailed Description of Header Data Storage Circuit 150>
As shown in detail in FIG. 5, the header data storage circuit 150 includes a header register write select circuit 156, a two-sided header register 157, a packet analysis timing generation circuit 154, a header register read select circuit 158, and a header register pointer. A selection unit 159.
[0062]
The header register write select circuit 156 detects that the header equivalent data 11, the write data 113 from the packet analysis CPU 110 or the write data 143 (143 a to 143 N) from the special arithmetic unit 140 is input, and has a two-plane configuration. The write pointer 1561 is generated by selecting the write destination register side of the header register 157, and this is output to the header register 157. The header register 157 has a two-surface configuration, that is, a surface written during packet reception and a surface analyzed by the CPU 110 or the special arithmetic unit 140, and alternately stores the header equivalent data 11 by a packet analysis surface selection signal 1541 described later. .
[0063]
The packet analysis timing generation circuit 154
Only when the header equivalent data 11 is detected, the header equivalent data 11 having a predetermined number of bits is written to the header register 157 using the input data detection notification signal 1562 generated from the header register write select circuit 156 as a trigger. A packet analysis start timing signal 152 to be notified to the computing unit 140;
A packet analysis plane selection signal 1541 for selecting the plane of the received packet write side and the packet analysis (read) side of the header register 157;
A packet analysis completion timing signal 153 indicating the data takeover timing of the storage circuit 150 to the subsequent packet analysis element 100;
Generate.
[0064]
The header register read select circuit 158 generates the head register read pointer 1581 from the packet analysis completion timing signal 153 from the packet analysis timing generation circuit 154 and reads the data stored in the header register 157. . The header register pointer selection unit 159 generates pointer information and a read or write enable signal 112 for accessing the header register 157 output to generate header extraction information from the CPU 110, or header extraction information from the special arithmetic unit 140. To the header register write select circuit 156 or the header register read select circuit 158 for determining whether or not the packet analysis is in progress, the pointer information for accessing the header register 157 and the read or write enable signal 132 to be selected are selected. Output.
[0065]
The header data storage circuit 150 configured as described above will be described with reference to FIG. FIG. 11 shows an example in which there are three packet analysis elements 100 (#a, #b, #c) with respect to the packet length that can be stored only in the header data storage circuit 150. When the header equivalent data H of the received packet 1 is detected, the header register 157 is selected in order from the pointer 0 in accordance with the write pointer 1561 from the header register write select circuit 156 for the header register 157 in a predetermined bit width unit. The first header equivalent data H is stored in plane-1.
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 header register 157 is completed, a packet analysis start timing signal 152 is output from the packet analysis timing generation circuit 154 to the special arithmetic unit 140, and this timing generation also indicates that a fixed time has elapsed. Thereafter, when a new packet can be received and the header register write selection circuit 156 detects the new header equivalent data H, the selection plane-2 of the header register 157 that has completed packet storage is selected first, and the second Header equivalent data H can be stored.
[0067]
Using the packet analysis start timing signal 152 for the first header equivalent data H + P # x as a trigger, the CPU 110 and the special arithmetic unit 140 in the packet analysis element perform analysis. By outputting a packet analysis completion timing signal 153 indicating that the analysis has been completed to the analysis result storage circuit 160, the packet analysis element 100 at the next stage is notified that transfer preparation has been completed. By generating the packet analysis completion timing signal 153 (153a to 153N) within a fixed time, a fixed time triggered by the packet analysis start timing signal 152 generated from the packet analysis timing generation circuit 154 is periodically repeated. Pipeline order can be properly followed.
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 plane selection signal 1541, and the generation of the packet analysis completion timing signal 153 generates the header register selection plane. The first header equivalent data H that has been analyzed in −1 is transferred to the subsequent packet analysis element 100 as takeover data 151. At this time, the second header equivalent data H stored in the selection plane-2 is also stored, the packet analysis start timing signal 152 is output, and the above-described operation is repeated every fixed time.
[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 header storage circuit 150 when the header equivalent data and the payload equivalent data are stored. Thus, it is determined whether or not the payload equivalent data is read after the header equivalent data depending on whether or not the packet end flag is detected.
[0069]
<< Detailed Description of Payload Storage Unit 20 >>
As shown in detail in FIG. 6, the payload storage unit 20 includes a payload data storage memory (also simply referred to as a memory) 22 for storing payload equivalent data 12, a payload data write circuit 23, a header corresponding pointer generation circuit 24, a pointer A holding circuit 25, a read pointer generation circuit 26, and a payload data read circuit 27 are provided. The payload data writing circuit 23 generates an address and a write enable signal for writing data to the payload data storage memory 22. The header corresponding pointer generation circuit 24 generates a write end pointer for each received packet in order to store (write) the payload equivalent data 12 corresponding to the header equivalent data 11 analyzed by the packet analysis element 100 when the transmission packet is generated. .
[0070]
The pointer holding circuit 25 includes a plurality of registers (for received packets # 1 and # 2 to #Y in the figure) in order to hold pointer values for each received packet on one payload data storage memory 22. ing. Based on the payload read control signal 62 from the update packet transmission unit 60, the read pointer generation circuit 26 generates a pointer value from the pointer that has just been read from the pointer holding circuit 25 to the write end pointer. The payload data read circuit 27 generates an address and a read enable signal for reading the payload equivalent data 12 from the payload data storage memory 22 using the payload read control signal 62 from the update packet transmitter 60 as a trigger.
[0071]
The payload accommodating unit 20 having the above-described configuration will be described with reference to FIG. FIG. 12 shows an example in which there are three packet analysis elements 100 (#a, #b, #c) with respect to the packet length stored separately in the header data storage circuit 150 and the payload accommodating unit 20. Received packet 1 is separated into header-equivalent data H (actually “H + P # x (part)”) and payload-equivalent data P (actually “P # x (remaining)”) by received packet separator 10. When the payload data writing circuit 23 detects the payload equivalent data P, an address and a write enable signal are generated and written in order from address 0 in order to write to the payload data storage memory 22 in a predetermined bit width unit.
[0072]
When the payload data P # 1 has been written to the payload data storage memory 22, the header corresponding pointer generation circuit 24 extracts the address value at the end of the writing in order to store that the payload data is the first header equivalent data H. Then, it is stored (written) in the first header equivalent data register of the pointer holding circuit 25. The subsequent payload equivalent data P # 2 of the second header equivalent data is written from the address value +1 at the end of the writing of the first payload equivalent data P # 1, and the address value at the end of the writing is used for the second header equivalent data. Store in the register of the pointer holding circuit 25. Similarly, the third payload equivalent data P # 3 is stored.
[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 header control data 172N together with the header data 151N that became a new header in synchronization with the packet analysis completion timing signal 153c. Output to.
[0074]
The update packet transmission unit 60 performs packet update processing such as insertion or deletion into new header data. If the flag indicating the end of the packet cannot be detected when the update header data has been processed to the end, the subsequent payload-corresponding data exists and is combined into one packet. A payload read control signal 62 is output.
[0075]
The first header stored in the pointer holding circuit 25 from the pointer 0 via the payload data read circuit 27 by the read pointer generation circuit 26 so that the first payload equivalent data following the first header equivalent data can be read according to the control signal 62. The address up to the write end pointer value of the corresponding data is instructed to the payload data storage memory 22 to read the data. When reading to the write end pointer value stored in the pointer holding circuit 25 is completed, the read pointer generation circuit 26 stores the address at that time and holds it until the next payload read control signal 62 is received.
When the packet discard instruction is included in the header control data 172N, the read pointer generation circuit 26 shown in FIG. 6 selects the pointer holding value to be read next without reading the payload equivalent data 12 as the control signal 62. .
[0076]
<< Detailed Description of Search Data Selector 30 >>
As shown in detail in FIG. 7, the search data selector 30 includes a search key selection unit 33, a search result transmission unit 34, and a search result reception FIFO (queue) 35. The search key selection unit 33 receives the search key data 171 output from any one of the packet analysis elements 100a, 100b to 100N, and sends the search key data 171a, 171b to 171N (any one) to the search table 40. Output. The search result sending unit 34 receives the search result 41 from the search table 40 via the FIFO 35, and designates the search results 32a, 32b to N corresponding to the search key data 171 as the designated packet analysis elements 100a, 100b to 100N. Output to.
[0077]
With the above-described configuration, the search data selector 30 is necessary for a program that only analyzes a MAC address and a program that also analyzes an IP header, an upper header, and the like, for example, when performing individual analysis for each packet analysis element 100. Since the number of packet analysis elements changes, the search key data 171 is not necessarily output from the fixed packet analysis element 100, but a packet analysis program for generating the search key data 171 based on information by packet analysis is implemented. The search key data 171 from the packet analysis element 100 being selected is selected and output to the search table 40. Further, the search result data 32 corresponding to the search key data 171 is output only to the packet analysis element 100 used for generating a new header.
[0078]
Further, the search result data 41 output from the search table 40 is accumulated in the search result reception FIFO 35, and the search result data 32 is not output until there is an instruction from the packet analysis element 100 as the output destination. For example, when an update header is generated by the packet analysis elements 100a, 100b, and 100c, the search key data 171 is transmitted from the packet analysis element 100b and the search result data 32 is required by the element 100c, and the search table 40 itself It is possible to cope with a processing time delay and a difference in search time by the plural search key data 171.
[0079]
<< Detailed Description of Update Packet Transmitter 60 >>
As shown in detail in FIG. 8, the update packet transmission unit 60 includes a control signal generation unit 63 that generates a payload read control signal 62 and a packet generation unit 64. The packet generation unit 64 inserts instructions into the header data output from the packet analysis element 100N (a = N in the case of one packet analysis element) corresponding to the final stage among the one or more packet analysis elements 100a and 100b to 100N. In accordance with the header control data 172N including the signal 1721N, the deletion instruction signal 1722N from the header data, and the transfer or discard instruction signal 1723N, the header equivalent data 151N to be updated, and the transmission waiting packet payload data 21 read from the payload accommodating unit 20 Combine serially.
[0080]
With the above-described configuration, the update packet transmission unit 60 synchronizes with the packet analysis completion timing signal 153 from the packet analysis element 100N, the takeover header data 151N, the insertion instruction signal 1721N into the header data from the header edit storage circuit 170N, and the header. The header control data 172N including the deletion instruction signal 1722N from the data and the transfer or discard instruction signal 1723N is received. The takeover header data 151N is updated to a new header by various instruction signals, combined if necessary, and output as a transmission packet 61.
[0081]
<< Modification of Packet Analysis Element 100 >>
In the modified example of the packet analysis element 100 shown in FIG. 9, sequential number comparison circuits (also simply referred to as comparison circuits) 180N and 181N are added to the configuration shown in FIG.
[0082]
Sequential number comparison units 180N and 181N receive search key data 171 for table search via header data storage circuit 150, header analysis result storage circuit 160, and header edit storage circuit 170 in order to analyze the header of received packet 1. Since one received packet information is transmitted through three routes of sending and receiving a search result, the packet analysis element in the first stage is used to detect that the information of the same received packet is not prepared due to a failure in one of the routes. A sequential number is assigned by the packet analysis program 100a, and the sequential number 162N transmitted via the header analysis result storage circuit 160 and the sequential number transmitted via the header data storage circuit 150 are given to the final stage of the packet analysis element 100. With the number 1571N Compare results, and outputs two kinds of comparison result of the header analysis result storage circuit 160 compares the sequential number 173N transmitted in sequential number 162N and the search table 40 which is transmitted via the result.
[0083]
The transfer image of the sequential number with the above configuration will be described with reference to FIG. When the packet analysis element 100 has three stages (#a, #b, #c), the search data selector 30 outputs the search key data 171a and the element 100c receives the search result 32c. When the packet analysis program of the packet analysis element 100a writes the analysis result of the received packet 1 to the header analysis result storage circuit 160a, the sequential number #A is also written to the header analysis result storage circuit 160a. Similarly, the sequential number #A is written to the header data storage circuit 150a that stores the header equivalent data that is the basis of this analysis result.
[0084]
The sequential number #A is also written and transferred to the search key data 171 generated based on the information extracted from the header equivalent data 12 via the header edit storage circuit 170a. These sequential numbers #A are synchronized with the packet analysis completion timing signal 153a, the header data storage circuit 150a is sent to the header data storage circuit 150b together with the header equivalent data 11, and the header analysis result storage circuit 160a is the analysis result information. One is transferred to the analysis result storage circuit 160b, and the header edit storage circuit 170a is not directly transferred to the edit storage circuit 170b, but transferred as search key data 171 to the search table 40. In the search result data 32 corresponding to the search key data 171, the sequential number #A multiplexed in the search key data 171 is stored in the header editing storage circuit 170c of the packet analysis element 100c. And the #A value is output from the table path sequential number 173c.
[0085]
In the same manner as described above, the elements 100a to 100b and the elements 100b to 100c are also transferred between the elements 100 in synchronization with the packet analysis completion timing signal 153, and the #A value is output from the sequential number 1571N of the header data storage circuit 150 path. To do. The #A value is output from the sequential number 162N of the header data analysis result storage circuit 160 path. The sequential numbers of these routes are compared, and since all are #A values, it can be detected that one packet information is normally transferred through three routes.
[0086]
【The invention's effect】
As described above, according to the configuration described in claims 1 and 2, 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 received. Since it is possible to select the number of packet analysis elements to be processed according to the type of packet and the type of processing to be performed by each packet analysis element, it is not necessary to prepare a high-performance CPU.
According to the configuration of claim 3, since the transfer of information between the packet analysis elements of the pipeline configuration is also performed with a predetermined timing signal, no special flag (register) and processing are required. All can be assigned to individual packet analysis processing.
According to the configuration of claim 4, when configured with one or more packet analysis elements, the information extracted and analyzed by the packet analysis element in the previous stage is not processed redundantly. Distribution can be flexibly handled, and all memory sizes for storing programs can be assigned to individual packet analysis processes.
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 Claim 7, a design change and a function addition are realizable.
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 claim 11, when configured with a plurality of packet analysis elements, the search data selector can receive a search key from any packet analysis element, and the search result is sent to any packet analysis element. Therefore, even a plurality of packet analysis elements can access the search table, which increases the flexibility of program processing.
According to the configuration of claim 12, when the search data selector receives the search result data from the search table by the FIFO, the search result is obtained at a timing when the packet analysis element is necessary even if the response time of the search table changes. Can receive data.
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 storage circuits 150, 50
112a, b,..., N Memory circuit 150, 50 access control signal from CPU
113a, b,..., N Memory circuit 150, 50 write data from CPU
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 data storage circuit 150 and comparison information storage circuit 50 of special operation unit)
142a, b, ..., N state notification signal
143, 143a, b, ..., N Write data to the storage circuits 150, 50 of the special arithmetic unit
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.
前記パケット解析エレメントの各々はさらに
記パケット解析完了タイミング信号に同期して前記ヘッダ解析結果記憶で記憶したデータを後段のパケット解析エレメントのヘッダ解析結果記憶へ出力することを特徴とする請求項に記載のパケット処理装置。
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.
前記特殊演算器はさらに、前記パケット解析プログラムに含まれる即値の論理演算を行うことを特徴とする請求項3からのいずれか1つに記載のパケット処理装置。The special arithmetic unit further packet processing apparatus according to claims 3 to any one of the 5, characterized in that for performing a logical operation of immediate data included in the packet analysis program. 前記特殊演算命令は、
前記ヘッダデータ記憶と、前記ヘッダ解析結果記憶と、前記ヘッダ編集記憶と前記比較情報記憶のいずれかのデータを直接リード、ライトするためのアクセス制御信号と、命令実行時に必要な各種イネーブル信号を含むことを特徴とする請求項に記載のパケット処理装置。
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.
前記ヘッダデータ記憶は、パケット受信中に書き込まれる面と、前記汎用演算器及び特殊演算器により解析されている面の2面構成で各パケットの前記ヘッダ相当データを交互に格納するヘッダレジスタを備えたことを特徴とする請求項3からのいずれか1つに記載のパケット処理装置。The header data storage unit has a header register that alternately stores the header equivalent data of each packet in a two-plane configuration of a plane that is written during packet reception and a plane that is analyzed by the general-purpose arithmetic unit and the special arithmetic unit. packet processing apparatus according to any one of claims 3, characterized in that it comprises 6. 前記受信パケット分離部により分離された複数の受信パケットの各ペイロード相当データ部分を、前記最終段のエレメントの処理が終了するまで収容するペイロード収容部をさらに備え、前記ペイロード収容部は、前記複数のパケットのペイロード相当データを1つのペイロードデータ蓄積用メモリに格納してポインタにより管理することを特徴とする請求項2からのいずれか1つに記載のパケット処理装置。A payload accommodating unit that accommodates each payload-corresponding data portion of the plurality of received packets separated by the received packet separating unit until the processing of the final stage element is completed, and the payload accommodating unit includes the plurality of payload accommodating units packet processing apparatus according to any one of claims 2 to 8, characterized in that managed by the pointer contains the payload corresponding data packets into one payload data storage memory. 前記検索テーブルを検索するために前記1つ以上のパケット解析エレメントが出力した検索キーを選択して前記検索テーブルに出力するとともに、前記検索キーに基づいて前記検索テーブルから出力された検索結果を前記検索キーを出力した前記パケット解析エレメントに出力する検索データセレクタをさらに有することを特徴とする請求項2からのいずれか1つに記載のパケット処理装置。The search key output from the one or more packet analysis elements is selected to search the search table, and the search key is output to the search table. The search result output from the search table based on the search key is packet processing apparatus according to any one of further comprising a retrieval data selector for outputting the packet analysis element search outputting the key claim 2, wherein the 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.
初段のエレメントにおいて前記ヘッダデータ記憶に記憶されたヘッダ相当データと、前記ヘッダ編集記憶に記憶された一時的なデータと、前記ヘッダ解析結果記憶に記憶されたパケット解析結果の3系統のデータに対してパケット毎に同じシーケンシャルな番号を付与して次段のエレメントに転送し、最終段のエレメントにおいて前記シーケンシャルな番号により同じパケットの前記3系統のデータを整合することを特徴とする請求項2から11のいずれか1つに記載のパケット処理装置。Three systems of header equivalent data stored in the header data storage unit , temporary data stored in the header edit storage unit , and packet analysis results stored in the header analysis result storage unit in the first stage element The same sequential number is assigned to each data packet and transferred to the next stage element, and the three systems of data of the same packet are matched by the sequential number in the last stage element. Item 12. The packet processing device according to any one of Items 2 to 11 .
JP2002223439A 2002-07-31 2002-07-31 Packet processing method and apparatus Expired - Fee Related JP3935021B2 (en)

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)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006080069A1 (en) 2005-01-27 2006-08-03 Fujitsu Limited Network device management device, network device management method, network device, and program used therein
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

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
US7936758B2 (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
US20060106977A1 (en) Performing lookup operations on associative memory entries
US8594092B2 (en) Packet relay method and device
US9083641B2 (en) Method and apparatus for improving packet processing performance using multiple contexts
CN113783800B (en) Data packet processing method and device, computer equipment and readable storage medium
US7239630B1 (en) Dedicated processing resources for packet header generation
JP3935021B2 (en) Packet processing method and apparatus
US7158520B1 (en) Mailbox registers for synchronizing header processing execution
JP4342128B2 (en) Packet processor and packet processor system
US7180893B1 (en) Parallel layer 2 and layer 3 processing components in a network router
US9210093B2 (en) Alignment circuit and receiving apparatus
JP3233353B2 (en) Header processing device and header processing method
JP2002335275A (en) Packet processing unit
US20040190509A1 (en) Processing frame bits
CN115237374A (en) Chip, method for processing data and computer equipment
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