JP2004064648A - Packet processing method and apparatus - Google Patents

Packet processing method and apparatus Download PDF

Info

Publication number
JP2004064648A
JP2004064648A JP2002223439A JP2002223439A JP2004064648A JP 2004064648 A JP2004064648 A JP 2004064648A JP 2002223439 A JP2002223439 A JP 2002223439A JP 2002223439 A JP2002223439 A JP 2002223439A JP 2004064648 A JP2004064648 A JP 2004064648A
Authority
JP
Japan
Prior art keywords
packet
header
data
analysis
storage circuit
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.)
Granted
Application number
JP2002223439A
Other languages
Japanese (ja)
Other versions
JP3935021B2 (en
Inventor
Kiyoshi Ikeda
池田 清
Naoto Oka
岡 直人
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 Holdings Corp
Original Assignee
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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
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

Abstract

<P>PROBLEM TO BE SOLVED: To provide a packet processing method and apparatus which dispenses with high-performance CPUs prepared expressly for extracting information required for generating a new transmitting packet header and generating the transmitting packet header respectively. <P>SOLUTION: Packet analytic elements 100a, 100b-100N are configured in pipelines as many as the number corresponding to a kind of a received packet and/or packet analysis contents assigned in advance, the kind of the received packet is judged by comparing a data portion corresponding to the header with comparison information at a fixed cycle, a search table 40 is retrieved, and data corresponding to the header are updated as needed and outputted to the next stage. At the same time, the analysis result is succeeded to elements 100 on the next stage when the elements 100 on the next stage use the analysis result. <P>COPYRIGHT: (C)2004,JPO

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、2に記載の発明は、
受信パケットのヘッダを送信パケットのヘッダに変換するための検索データを検索テーブルに記憶し、
前記受信パケットの種類を判定するための比較情報を記憶し、
前記受信パケットのデータ区切りを検出し、ヘッダ相当データ部分とペイロード相当データ部分を分離し、
前記受信パケットの種類及び/又はあらかじめ割り当てたパケット解析内容に応じた数のパイプライン構成により、固定周期で前記パケット分離ステップにより分離された前記ヘッダ相当データ部分と前記比較情報記憶ステップにより記憶されている比較情報を比較して前記受信パケットの種類を判定するとともに、前記検索テーブルを検索して必要に応じて前記ヘッダ相当データを更新して次段に出力するとともに、当該解析結果を次段が使用する場合に次段に引き継ぎ、
前記1つ以上のパケット解析ステップの最終段からのヘッダ相当データと前記パケット分離ステップにより分離された前記ペイロード相当データ部分をシーケンシャルに結合して送信パケットとして出力する構成とした。
請求項1、2に記載の発明によれば、受信パケットヘッダ内の各フィールドの識別や、検索キー情報の抽出や、検索結果受信後の送信パケットヘッダ生成などの処理を受信パケットの種類に応じて何個のパケット解析エレメントで処理するか、また、それぞれのパケット解析エレメントにどのような処理をさせるのかを選択できるため、高性能なCPUを特に用意する必要がない。
【0014】
請求項3に記載の発明のパケット処理装置は、前記パケット解析エレメントの各々が、
前記受信パケット分離部から送出されたヘッダ相当データ部分を格納して格納完了後にパケット解析開始タイミング信号を出力するヘッダデータ記憶回路と、
当該パケット解析エレメントが実行するパケット解析プログラムを記憶するメモリと、
前記ヘッダデータ記憶回路から出力されたパケット解析開始タイミング信号をトリガとして前記メモリに記憶されたパケット解析プログラムの実行を開始するCPU及び特殊演算器とを備え、
前記固定周期の後に前記パケット解析プログラムの実行を完了してパケット解析完了タイミング信号を次段のエレメント又は更新パケット送信部に出力する構成とした。
請求項3に記載の構成によれば、パイプライン構成のパケット解析エレメント間の情報の引継ぎもあらかじめ決めたタイミング信号で行うことから特別なフラグ(レジスタ)及び処理を必要としないため、メモリサイズをすべて個別のパケット解析処理に割り当てることができる。
【0015】
請求項4に記載の発明は、前記パケット解析エレメントの各々がさらに、
前記パケット解析プログラムに応じてヘッダデータ記憶回路から異なる情報を抽出して記憶するため、及び前記比較情報と前記プログラム実行中に生成した一時的なデータを記憶するためのヘッダ編集記憶回路と、
前記パケット解析プログラムを実行したパケット解析結果を記憶するヘッダ解析結果記憶回路とを備え、
前記パケット解析完了タイミング信号に同期して前記ヘッダ解析結果記憶回路で記憶したデータを後段のパケット解析エレメントのヘッダ解析結果記憶回路へ出力する構成とした。
請求項4に記載の構成によれば、1つ以上のパケット解析エレメントにて構成した場合に、前段のパケット解析エレメントで抽出、解析した情報を重複して処理することがないので、プログラムの負荷分散が柔軟に対応でき、また、プログラム蓄積用メモリサイズをすべて個別のパケット解析処理に割り当てることができる。
【0016】
請求項5に記載の発明は、前記ヘッダ解析結果記憶回路が、
現ヘッダの解析をしている間に次のパケットを受信して前記現ヘッダの解析結果に次ヘッダの解析結果を上書きしないように2面で構成され、各面を前記パケット解析完了タイミング信号毎に切り替えて交互に記憶する構成とした。
請求項5に記載の構成によれば、次パケットの受信中でも、現パケットの解析結果情報を保持できるため、スループットが低下することなく、パケット解析結果情報を後段のパケット解析エレメントへ伝達できる。
【0017】
請求項6に記載の発明は、前記特殊演算器が、
前記パケット解析プログラムに含まれる特殊演算命令に基づいて、直接、前記ヘッダデータ記憶回路と、前記ヘッダ解析結果記憶回路と、前記ヘッダ編集記憶回路と比較情報記憶回路のいずれかからデータをあらかじめ決めたビット幅単位に読み出し、読み出したデータに対してパケット解析のための各種論理演算を行う構成とした。
請求項6に記載の構成によれば、特殊演算器がヘッダデータ記憶回路、ヘッダ解析結果記憶回路、ヘッダ編集記憶回路、比較情報記憶回路のデータを直接リード、ライトできることから、プログラムの変更つまり特殊演算命令の指示順序を変えることで、設計変更や機能追加を実現し、かつ高速なパケット処理を維持できる。
【0018】
請求項7に記載の発明は、前記特殊演算器がさらに、前記パケット解析プログラムに含まれる即値の論理演算を行う構成とした。
請求項7に記載の構成によれば、設計変更や機能追加を実現することができる。
【0019】
請求項8に記載の発明は、前記特殊演算命令が、前記ヘッダデータ記憶回路と、前記ヘッダ解析結果記憶回路と、前記ヘッダ編集記憶回路と前記比較情報記憶回路のいずれかのデータを直接リード、ライトするためのアクセス制御信号と、命令実行時に必要な各種イネーブル信号を含む構成とした。
請求項8に記載の構成によれば、特殊演算命令の実行に必要な情報をヘッダデータ記憶回路、ヘッダ解析結果記憶回路、ヘッダ編集記憶回路、比較情報記憶回路のデータを直接リード、ライトできるようにアドレスなどのアクセス制御信号を生成し、かつ命令実行時に必要な各種イネーブル信号を生成できる。
【0020】
請求項9に記載の発明は、前記ヘッダデータ記憶回路が、
パケット受信中に書き込まれる面と、前記CPU及び特殊演算器により解析されている面の2面構成で各パケットの前記ヘッダ相当データを交互に格納するヘッダレジスタを備えた構成とした。
請求項9に記載の構成によれば、現パケットの解析中でも、次パケットの受信を開始できるため、ワイヤースピードを維持しながら、パケット解析エレメント内CPU及び特殊演算器へヘッダ相当データを伝達し、かつ後段のパケット解析エレメント内のヘッダデータ記憶回路へデータを引き継ぐことができる。
【0021】
請求項10に記載の発明は、前記パケット分離部により分離された複数の受信パケットの各ペイロード相当データ部分を、前記最終段のエレメントの処理が終了するまで収容するペイロード収容部をさらに備え、前記ペイロード収容部は、前記複数のパケットのペイロード相当データを1つのペイロードデータ蓄積用メモリに格納してポインタにより管理する構成とした。
請求項10に記載の構成によれば、1つのメモリに対してパケット解析中のヘッダ相当データに対応する数分のポインタのみを管理しているため、複数の受信パケットの各ペイロードデータ収容用のメモリを必要とせずに低コストに装置を実現できる。
【0022】
請求項11に記載の発明は、前記検索テーブルを検索するために前記1つ以上のパケット解析エレメントが出力した検索キーを選択して前記検索テーブルに出力するとともに、前記検索キーに基づいて前記検索テーブルから出力された検索結果を前記検索キーを出力した前記パケット解析エレメントに出力する検索データセレクタをさらに有する構成とした。
請求項11に記載の構成によれば、複数のパケット解析エレメントで構成した場合に、検索データセレクタが、いずれのパケット解析エレメントからの検索キーでも受信でき、またいずれのパケット解析エレメントへも検索結果を送信できるので、複数のパケット解析エレメントでも検索テーブルとアクセスができ、プログラム処理の柔軟性が高くなる。
【0023】
請求項12に記載の発明は、前記検索データセレクタが、
前記検索テーブルに対する各エレメントの検索時間の違いに対応するためのキューを具備し、前記検索テーブルから出力された検索結果データを前記キューに蓄積し、出力先となるパケット解析エレメントからの指示により出力する構成とした。
請求項12に記載の構成によれば、検索データセレクタが検索テーブルからの検索結果データをFIFOで受信する場合に、検索テーブルの応答時間が変化してもパケット解析エレメントが必要なタイミングで検索結果データを受信できる。
【0024】
請求項13に記載の発明は、前記更新パケット送信部が、
前記最終段のパケット解析エレメントから送信指示が出力される場合に、ヘッダデータへの書換・挿入・削除指示に従ってヘッダ相当データの更新を行った上でペイロード収容部から続くペイロード相当データと結合してパケットとして送信し、
前記最終段のパケット解析エレメントから破棄指示が出力される場合に、ペイロード収容部へのペイロード読み出し制御信号を経由して破棄指示されたペイロード相当データと結合する予定であった読み出すべきポインタではなく、次に読み出すべきポインタを選択して次の読み出し指示まで保持する構成とした。
請求項13に記載の構成によれば、更新パケット送信部が、パケット解析エレメントでの解析結果に応じて、ヘッダデータ記憶回路を経由して記憶してきたヘッダ相当データから新たに生成されたヘッダとペイロード収容部とが記憶したペイロード相当データから新たな送信パケットを生成できる。
【0025】
請求項14に記載の発明は、初段のエレメントにおいて前記ヘッダデータ記憶回路に記憶されたヘッダ相当データと、前記ヘッダ編集記憶回路に記憶された一時的なデータと、前記ヘッダ解析結果記憶回路に記憶されたパケット解析結果の3系統のデータに対して各パケット毎に共通のシーケンシャルな番号を付与して最終段のエレメントに転送し、最終段のエレメントにおいて前記シーケンシャルな番号により同じパケットの前記3系統のデータを整合する構成とした。
請求項14に記載の構成によれば、パケット解析のために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]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a packet processing method and apparatus for mounting a newly generated header in a transmission packet in accordance with a header mounted in a reception packet, and more particularly, to a network for processing header analysis of a packet 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 a different header is provided for each type of packet (protocol).
[0003]
FIGS. 14A to 14H show examples of packets widely used in recent years. Packets are classified by type.
(A) DIX packet described in RFC194,
(B) RAW packet described in IEEE802.3,
(C) an LLC packet carrying the LLC information 405 described in IEEE 802.2;
(D) LLC + SNAP packet
And VLAN information 407 described in IEEE 802.1Q in the above four types of packets
(E) DIX + VLAN packet,
(F) RAW + VLAN packet,
(G) LLC + VLAN packet,
(H) LLC + SNAP + VLAN packet
And the packet processing apparatus is required to process these eight types of packets accurately and promptly.
[0004]
The Layer2 header (hereinafter, L2 header) of each packet includes MAC-DA information (destination MAC address) 401, MAC-SA information (source MAC address) 402, Type information 403, Length information 404, LLC information 405, SNAP Since the information 406 and the VLAN information 407 are mounted, and the L2 header is composed of a combination of the respective information, the length of the L2 header differs for each type of packet. In FIG. 14, such information is simply displayed as “MAC-DA”, “Type”, or the like.
[0005]
The packet has a payload 408 following the L2 header. In the case of an IPv4 packet, as shown in FIG. 15, Version information 701, header length information 702, TOS information 703, total length information 704, identification number Information 705, fragment information 706, TTL information 707, protocol number information 708, header checksum information 709, source IP address information 710, destination IP address information 711, and a Layer 3 header (hereinafter, L3 header) including option information 712. 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 have been rewritten. The newly generated MAC-DA information 401 needs to have a value corresponding to the transmission destination IP address information 711.
[0007]
Conventionally, as this type of device, a device having a configuration 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 of a 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 Information necessary for generating a transmission packet header included in the header is extracted and stored in a register 351, and a value corresponding to the information stored in the register 351 is stored in a register 352 with reference to a table 357 by a CPU 355. A new transmission packet header is generated by the CPU 356 according to the value stored in the register 352 and stored 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 the flag register for writable or readable.
[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. In addition, 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 length of the obtained L2 header;
A processing step of reading the 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 do it. Further, in the processing step of reading the L2 header, it is necessary for the CPU 354 to divide the L2 header into an amount of data that can be read at one time and to repeatedly read the data in several times.
[0009]
That is, the time required to detect the position of the destination IP address information 711 on the received packet depends on the amount of data that can be read by the CPU 354 at one time and the number of times that it can be read per unit time. Since the packet processing device requires the CPU 354 having higher performance, the cost of the product is increased. Similarly, the time required to write the transmission packet header to the register 353 depends on the amount of data that can be written by the CPU 356 at a time and the number of times that data can be written per unit time. Since the CPU 356 is required, the cost of the product is also increased (first problem).
[0010]
Further, between the CPUs 354, 355, and 356, the use of flag register information mounted in each of the registers 350, 351, 352, and 353 is notified and detected in a fixed cycle. For this reason, it is determined that the registers 350, 351, 352, and 353 are to be 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 and the product This leads to high costs (second problem).
[0011]
Further, in the conventional device, the register 351 and 352 that can be connected to the table 357 are changed depending on the processing load, for example, because the register 350 for reception, the registers 351 and 352 that can be connected to the table 357, and the register 353 used for transmission are fixed. You cannot change it if you want to. For this reason, there is a demand for a packet processing device capable of processing a packet equipped with not only the above-mentioned IPv4 header but also various types of headers represented by an IPv6 header and MPLS, and a new protocol is defined every day. There is a need for a packet processing apparatus that can be easily modified and changed in the future, and has high flexibility in design change (third problem).
[0012]
Therefore, in view of the first problem described above, the present invention particularly prepares a high-performance CPU for each of the information extraction processing required to generate a new transmission packet header and the transmission packet header generation processing. An object of the present invention is to provide a packet processing device that does not need to be provided.
Another object of the present invention is to provide a packet processing device having a memory size necessary only for analysis of a received packet in view of the second problem described above.
In view of the third problem described above, the present invention also facilitates modification and future function changes for a received packet equipped with not only an IPv4 header but also various types of headers represented by an IPv6 header and MPLS. Therefore, it is an object of the present invention to provide a packet processing apparatus that is highly flexible in design change.
[0013]
[Means for Solving the Problems]
The invention according to claims 1 and 2
Search data for converting a header of a received packet into a header of a transmitted packet is stored in a search table,
Storing comparison information for determining the type of the received packet,
Detecting a data break of the received packet, separating a header equivalent data portion and a payload equivalent data portion,
The header-equivalent data portion separated by the packet separation step in a fixed cycle and stored in the comparison information storage step by a pipeline configuration of a number corresponding to the type of the received packet and / or the packet analysis content assigned in advance. The type of the received packet is determined by comparing the comparison information, and the search table is searched to update the header-equivalent data as necessary, and output to the next stage. When using, take over to the next stage,
The header-equivalent data from the last stage of the one or more packet analysis steps and the payload-equivalent data part separated by the packet separation step are sequentially combined and output as a transmission packet.
According to the first and second aspects of the present invention, processes such as identification of each field in a received packet header, extraction of search key information, and generation of a transmitted packet header after receiving a search result are performed according to the type of the received packet. Therefore, it is possible to select how many packet analysis elements are to be processed and what processing is to be performed by each packet analysis element, so that it is not particularly necessary to prepare a high-performance CPU.
[0014]
According to a third aspect of the present invention, each of the packet analysis elements includes:
A header data storage circuit that stores a header-equivalent data portion transmitted from the received packet separation unit and outputs a packet analysis start timing signal after completion of storage;
A memory for storing a packet analysis program executed by the packet analysis element;
A CPU and a special arithmetic unit that start executing a packet analysis program stored in the memory with a packet analysis start timing signal output from the header data storage circuit as a trigger,
After the fixed period, execution of the packet analysis program is completed, and a packet analysis completion timing signal is output to the next element or the updated packet transmission unit.
According to the configuration of the third aspect, since information transfer between the packet analysis elements of the pipeline configuration is also performed by a predetermined timing signal, no special flag (register) and processing are required. All can be assigned to individual packet analysis processes.
[0015]
The invention according to claim 4, wherein each of the packet analysis elements further includes:
A header edit storage circuit for extracting and storing different information from the header data storage circuit according to the packet analysis program, and for storing the comparison information and temporary data generated during execution of the program;
A header analysis result storage circuit that stores a packet analysis result obtained by executing the packet analysis program,
The data stored in the header analysis result storage circuit is output to the header analysis result storage circuit of the subsequent packet analysis element in synchronization with the packet analysis completion timing signal.
According to the configuration of the fourth aspect, when one or more packet analysis elements are used, the information extracted and analyzed by the preceding packet analysis element is not redundantly processed, so that the program load is reduced. The distribution can be flexibly handled, and the memory size for storing the program can be all allocated to individual packet analysis processing.
[0016]
The invention according to claim 5, wherein the header analysis result storage circuit comprises:
While the analysis of the current header is performed, the next packet is received and the analysis result of the next header is not overwritten with the analysis result of the next header. And stored alternately.
According to the configuration of claim 5, 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.
[0017]
In the invention according to claim 6, the special operation unit includes:
Based on a special operation instruction included in the packet analysis program, data was directly determined in advance from any of the header data storage circuit, the header analysis result storage circuit, the header edit storage circuit, and the comparison information storage circuit. It is configured to read in bit width units and perform various logical operations for packet analysis on the read data.
According to the configuration described in claim 6, 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 the operation instructions, it is possible to implement a design change or add a function and maintain high-speed packet processing.
[0018]
The invention according to claim 7 is configured such that the special arithmetic unit further performs a logical operation of an immediate value included in the packet analysis program.
According to the configuration described in claim 7, it is possible to realize a design change and a function addition.
[0019]
The invention according to claim 8, wherein the special operation instruction directly reads any data of the header data storage circuit, the header analysis result storage circuit, the header edit storage circuit, and the comparison information storage circuit. The configuration includes an access control signal for writing and various enable signals necessary for executing the instruction.
According to the configuration described in claim 8, 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. An access control signal such as an address can be generated at the same time, and various enable signals required at the time of executing an instruction can be generated.
[0020]
In the invention according to claim 9, the header data storage circuit comprises:
A header is provided which alternately stores the header-equivalent data of each packet in a two-sided configuration including a side to be written during packet reception and a side analyzed by the CPU and the special arithmetic unit.
According to the configuration of claim 9, 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 and the special arithmetic unit in the packet analysis element while maintaining the wire speed, The data can be transferred to the header data storage circuit in the packet analysis element at the subsequent stage.
[0021]
The invention according to claim 10, further comprising a payload accommodating unit accommodating each payload-equivalent data portion of the plurality of received packets separated by the packet separating unit until the processing of the last-stage element is completed, The payload accommodating unit is configured to store the payload equivalent data of the plurality of packets in one payload data storage memory and manage the data by a pointer.
According to the configuration of the tenth aspect, since only one pointer corresponding to the header-equivalent data being analyzed in the packet is managed in one memory, each payload data of a plurality of received packets is accommodated. The device can be realized at low cost without requiring a memory.
[0022]
The invention according to claim 11, wherein the search key output by the one or more packet analysis elements to search the search table is selected and output to the search table, and the search is performed based on the search key. The apparatus further includes a search data selector for outputting a search result output from the table to the packet analysis element that has output the search key.
According to the configuration of claim 11, when the search data selector includes a plurality of packet analysis elements, the search data selector can receive a search key from any of the packet analysis elements, and the search result is output to any of the packet analysis elements. Can be transmitted, a plurality of packet analysis elements can access the search table, and the flexibility of the program processing is increased.
[0023]
According to a twelfth aspect of the present invention, the search data selector comprises:
A queue for responding to a difference in search time of each element with respect to the search table, storing search result data output from the search table in the queue, and outputting the data in response to an instruction from a packet analysis element serving as an output destination Configuration.
According to the configuration of the twelfth aspect, when the search data selector receives the search result data from the search table by FIFO, even if the response time of the search table changes, the search result is obtained at a timing when the packet analysis element is necessary. Can receive data.
[0024]
The invention according to claim 13 is characterized in that the update packet transmitting unit comprises:
When a transmission instruction is output from the packet analysis element at the last stage, the header-equivalent data is updated according to the rewrite / insert / delete instruction to the header data, and then combined with the subsequent payload-equivalent data from the payload accommodating unit. Send as a packet,
When a discard instruction is output from the packet analysis element at the last stage, it is not a pointer to be read that was to be combined with the payload equivalent data instructed to be discarded via the payload read control signal to the payload storage unit, The pointer to be read next is selected and held until the next read instruction.
According to the configuration of the thirteenth aspect, the updated packet transmitting unit, according to the analysis result of the packet analysis element, includes a header newly generated from the header equivalent data stored via the header data storage circuit. A new transmission packet can be generated from the payload equivalent data stored in the payload storage unit.
[0025]
According to a fourteenth aspect of the present invention, in the first-stage element, the header equivalent data stored in the header data storage circuit, the temporary data stored in the header edit storage circuit, and the header analysis result storage circuit A common sequential number is assigned to each packet for the three systems of data obtained as a result of the packet analysis and transferred to the last-stage element, and the three-system data of the same packet is transmitted to the last-stage element by the sequential number. The data is configured to be consistent.
According to the configuration described in claim 14, 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 for finally detecting the consistency in the packet analysis element, the reliability in the packet processing device can be improved.
[0026]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings. The packet processing apparatus according to the present invention shown in FIG. 1 schematically includes a received packet separation unit 10 and one or more packet analysis elements (hereinafter also simply referred to as elements) 100 (100a, 100b to 100N) configured by a pipeline. , A received packet payload accommodating unit (also simply referred to as a payload accommodating unit) 20, a search table 40, a search data selector 30, a comparison information storage circuit 50, and an update packet transmitting unit 60. Details are shown in FIGS.
[0027]
The reception packet separation unit 10 detects data breaks of the reception packet 1 having different formats, for example, as shown in FIGS. 14A to 14H, and separates the header-equivalent data 11 and the payload-equivalent data 12 from each other. To the packet analysis element 100 a and the payload accommodating unit 20.
[0028]
Each packet analysis element 100 stores the header-corresponding data 11 separated by the packet separation unit 10 and the data from the preceding 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 and the like. Next, by determining the presence / absence of Length information 404 or the like in the second element 100b, the data can be further divided into two groups. Since the packet type can be specified, the element 100 may be composed of three elements. Further, if the number of packet types to be determined increases in the future, the amount may be increased after the third element 100c. Here, each element 100 is configured to execute packet analysis and header conversion processing at a fixed cycle, and to pass the analysis result to the subsequent element 100 when the analysis result is used by the next stage.
[0029]
The search table 40 stores search data for converting the header of the received packet 1 into the header of the transmitted packet, and stores, for example, the correspondence between the MAC-DA information 401 and the destination IP address information 711. The search data selector 30 outputs the search key data 171a, 171b to 171N extracted from any one or more of the packet analysis elements 100a, 100b to 100N to the search table 40 as the search key data 31. The search result data 41 corresponding to the search key data 31 transmitted from the table 40 is selected by the search data selector 30. Any one of the search result data 32a, 32b to 32N is determined in advance by the packet analysis elements 100a, 100b. 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 the data is transmitted on the bus. The comparison information storage circuit 50 previously stores, for example, comparison information for determining packet types as shown in FIGS. 14A to 14H and stores the comparison information in the CPUs 110 a, 110 b to 110 N in each element 100. CPUs 110a, 141b-141N as read data (111a, 111b-111N) and (141a, 141b-141N) in accordance with access control signals 112a, 112b-112N from the decoder and access control signals 132a, 132b-132N from the decoders 130a, 130b-130N, respectively. 110b to 110N and output to the special operation units 140a and 140b to 140N.
[0031]
The update packet transmitting unit 60 includes a header-equivalent data 11 to be updated according to an instruction from the packet analysis element 100N corresponding to the last stage among the one or more packet analysis elements 100a and 100b to 100N, and a transmission waiting packet output from the payload accommodating unit 20. The payload data 21 is sequentially combined and output.
[0032]
<Received packet separation unit 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 separating unit 10 converts the received packet 1 into a predetermined bit width such as 8 bits (bits), 16 bits, or 32 bits. The data is fetched and rearranged in units of data starting from the transmission destination MAC address (MAC-DA) 401 as shown in FIG. 14, and it is assumed that an L2 header and an upper header as shown in FIGS. 14 and 15 are included. The header-equivalent data 11 is separated into two pieces of data, a header-equivalent data 11 of a predetermined data length and a payload-equivalent data 12 other than the data length. 20 respectively.
[0033]
<Packet analysis element 100>
The header equivalent data 11 separated by the received packet separation unit 10 is stored in the packet analysis element 100a at the first stage. The packet analysis element 100 is composed of one or more pipelines, and when composed of one, the packet analysis element 100a = 100N. In the case of two or more, the header equivalent data 11 stored in each packet analysis element 100 is used. Output to the packet analysis elements 100b, 100c to 100N or the update packet transmitting unit 60 at the subsequent stage 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 a bit string that can be analyzed by the packet analysis program among the header equivalent data 11 has been stored in the element 100. 152A, 152b to 152N are generated, and the packet analysis start timing signal 152a, 152b to 152N is used as a trigger to start executing the packet analysis program.
[0035]
In accordance with an access control signal from each packet analysis program, all packet analysis elements 100 are used in common to identify whether or not the information is required by the packet analysis program by comparing with information extracted from the header equivalent data 11 of the received packet 1. The comparison information storage circuit 50 generates comparison information required for the packet analysis program from the information stored and stored, thereby identifying and extracting data sequentially from the beginning of the data. The analysis is advanced to complete the execution of the packet analysis program for each packet analysis element 100, such as clarifying the format and extracting information from the search key data 31 and the search result data 41 as described later. The analysis result and header equivalent data 11 are passed to the packet analysis elements 100a, 100b to 100N (in one case, the same packet analysis element 100).
[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, which is the other data separated from the received packet separating unit 10, is stored in one or more pipelines. Through the packet analysis elements 100a, 100b to 100N having the structure, the payload-equivalent data 12 is held until the update packet transmitting unit 60 reads the data.
[0037]
The transmission destination of the transmission packet 61 with the new header is determined by 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 this 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 the search key data 31 to the search table 40. An entry (search result data) 41 corresponding to the key data 31 is transmitted to predetermined packet analysis elements 100a, 100b to 100N.
[0038]
<Update packet transmitting unit 60>
The update packet transmitting unit 60 reads the header equivalent data 11 to be updated according to the instruction from the packet analysis element 100N corresponding to the last stage among the packet analysis elements 100a and 100b to 100N under the control of the payload accommodating unit 20. When the final data is detected, the transmission-ready packet payload data 21 corresponding to the header-corresponding data 11 is read so as to be able to be sequentially combined, and the transmission packet 61 is output.
With the above-described configuration, 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 are processed by one or more packet analysis elements 100. , Or what processing to execute in each packet analysis element 100, that is, a packet analysis program to be executed can be selected.
[0039]
<< Detailed description of element 100 >>
The packet analysis elements 100a and 100b to 100N shown in FIG.
A received packet separation unit 10, header data storage circuits (simply referred to as header storage circuits) 150a, 150b to 150N (shown in detail in FIG. 5) for storing header-equivalent data 11 transmitted from the preceding element 100;
-Memories 120a, 120b to 120N storing a packet analysis program;
A CPU 110a that fetches, decodes, and executes each instruction of the packet analysis program stored in each of the memories 120a, 120b to 120N, and outputs special operation instruction instruction signals 115a, 115b to 115N from the fetched result; 110b to 110N,
Special operation instruction decode circuits (decoders) 130a, 130b to 130N (detailedly shown in FIG. 4) for decoding special operation instruction instruction signals 115a, 115b to 115N output from the CPUs 110a, 110b to 110N;
Special operation units 140a, 140b to 140N (detailed in FIG. 3) for executing the special operation instructions 133a, 133b to 133N decoded by the decoders 130a, 130b to 130N, respectively.
I have it.
[0040]
In the above configuration, when the header data storage circuits 150a, 150b to 150N can store a predetermined number of bits of the header-corresponding data 11, the packet analysis start timing signals 152a, 152b to 152N respectively output the special operation units 140a, 140b. To 140N. With this as a trigger, the CPUs 110a, 110b to 110N start executing the packet analysis program, and the special operation units 140a, 140b to 140N execute special operation instructions (special operation instruction decode signals 133a, 133b to 133N) in parallel. .
[0041]
At this time, the CPUs 110a, 110b to 110N use the access control signals 112a, 112b to 112N output to the header data storage circuits 150a, 150b to 150N to read the read data 111a, 111b to 111N and write data 113a, Writes 113b to 113N are performed, and the CPU 110a and 110b to 110N repeat transfer with the built-in general-purpose registers to execute various general-purpose operations. The decoders 130a, 130b to 130N decode the special operation instruction instruction signals 115a, 115b to 115N output from the CPUs 110a, 110b to 110N, respectively, and convert the special operation instructions 133a, 133b to 133N to the special operation units 140a, 140b to 140N. And the special operation data extraction access control signals 132a, 132b to 132N are generated and output to the header data storage circuits 150a, 150b to 150N and the comparison information storage circuit 50 via the bus.
[0042]
The header data storage circuits 150a, 150b to 150N respectively extract header extraction information from the stored header of the received packet 1 and output them as read data 141a, 141b to 141N via the bus to the special computing units 140a, 140b to 140N. . The comparison information storage circuit 50 extracts comparison information for comparison with the read data 141a, 141b to 141N (header extraction information) and outputs the same as read data 141a, b,... The special computing units 140a and 140b to 140N compare the header extraction information and the comparison information, and output state 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 status notification signals 142a, 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 two bytes of Type information, Length information or VLAN information. As a header extraction information, an access control signal 132a is output to the header data storage circuit 150a to extract the 19th and 20th bytes of the received packet 1, and a comparison information storage circuit is generated so as to generate 0800h indicating IPv4 as the comparison information. Similarly, when the match comparison result signal included in the status notification signal 142 indicates that the header extraction information and the comparison information match, the output from the header data storage circuit 150a is output from the access control signal 132a from the decoder 130a. Determines that received packet 1 is a DIX packet When the processing of the DIX packet is started from the packet analysis element 100 at the subsequent stage, and when a mismatch is indicated, the 19th and 20th bytes of the received packet 1 are the next two bytes of the Length information and the first two bytes of the VLAN information from the next time. A process for determining which one is started is started. Therefore, a plurality of formats of the received packet 1 can be determined, and a packet process according to the format of the determined received packet 1 can be performed.
[0044]
Although each packet analysis element 100 has a pipeline configuration, each has the same configuration and the same function. Therefore, by changing a packet analysis program mounted on each element 100, each packet analysis element 100 has the same configuration without changing hardware, and has a different configuration. Protocol header analysis can also be performed.
[0045]
With the above configuration, each packet analysis element 100 is simply compared with the configuration using only the general-purpose CPU 110. By combining the CPU 110 and the special operation unit 140, information is extracted from the header-equivalent data 11 and transferred 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 configuration is such that high-speed header analysis is possible.
[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. Header editing storage circuits 170a, 170b to 170N as locations for storing temporary data generated during execution, and header analysis result storage circuits 160a, 160b to 160N for storing packet analysis results obtained by executing a packet analysis program. I 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 normality of the MAC-DA 401 and the MAC-SA 402 shown in FIG. Depending on the values of the fields, it is possible to identify whether the received packet 1 is in the DIX format or the LLC + SNAP format.
[0048]
Therefore, the value "05DC" is stored in advance in the header edit storage circuit (also simply referred to as edit storage circuit) 170a, and the 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 compares the value “05DC” stored in the header edit storage circuit 170a with the later-described magnitude comparison instruction of the special operation unit 140a. When it is determined that the value of “0800” extracted from the header data storage circuit 140a is large, the DIX format can be specified. As a result, the header analysis result storage circuit (also simply referred to as an analysis result storage circuit) 160a Write a value indicating that the format was "DIX".
[0049]
Then, in synchronization with the packet analysis completion timing signal 153a, the information of the header analysis result storage circuit 160a is written to the subsequent packet analysis element 100b to the header analysis result storage circuit 160b. “05DC” in the header edit storage circuit 170a is used only by the packet analysis program of the packet analysis element 100a, and the special operation unit 140b of the packet analysis element 100b uses “DIX” written in the header analysis result storage circuit 160b. Based on the format information, it is assumed that the IP header is mounted on the 15th and subsequent bytes, and the field of the 15th byte is “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 preceding packet analysis element 100N-1 is not duplicated and the analysis processing is not performed by the latter packet analysis element 100N, so that 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, 150b to 150N of each element 100 shown in FIG. 1 stores the header-corresponding data 11 between predetermined fixed periods, and the packet analysis start timing signals 152a, 152b during the next fixed period. The CPU 110a, 110b to 110N and the special computing units 140a, 140b to 140N execute packet analysis processing in accordance with the respective packet analysis programs, starting from the base point of each of them, respectively. Processing.
[0052]
However, if packets can be received even during the packet analysis processing, the number of packets that can be processed per unit time increases, and the throughput improves. Therefore, even when there is a possibility that a packet may be received during the analysis of the header, the header data storage circuits 150a, 150b to 150N cause the CPUs 110a, 110b to 110N and the special arithmetic units 140a, 140b to 140N to respectively. The packet analysis completion timing signals 153a, 153b to 153N are received as a two-sided configuration so as not to overwrite the current analysis result being analyzed or the current analysis result being analyzed with the next analysis result obtained by newly analyzing the received packet 1. Plane and packet analysis plane are switched and selected alternately.
[0053]
According to the above-described configuration, the two sides of the header data storage circuits 150a, 150b to 150N are selected in a predetermined order for each packet analysis completion timing signal 153a, 153b to 153N and the information is held, so that the CPUs 110a, 110b to 110N and Even when the special computing units 140a, 140b to 140N are extracting information necessary for packet analysis, the newly received information can be stored without losing the information including the header of the previously received packet 1 already stored. Can be.
[0054]
<Detailed description of special computing unit 140>
As shown in detail in FIG. 3, the special operation unit 140 (140a to 140N) directly receives the special operation control unit 145, the special operation data control signal 141 and the special operation instruction decode signal 133 from the special operation instruction decode circuit 130, and Arithmetic operation unit group 146 that performs various processes on data 141 read out from header data storage circuit 150, header analysis result storage circuit 160, header edit storage circuit 170, and comparison information storage circuit 50 in predetermined bit width units. And a status notification unit 147 and a special calculation result data output unit 148. The operation unit group 146 receives 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 It includes a product section 1465, a logical sum section 1466, an adder section 1467, a bit shift section 1468, a bit-shifted logical sum section 1469, a checksum operation section 1470, and an indirect address data transfer section 1471.
[0055]
The one-to-many match comparison section 1461 includes first data and second data (a header data storage circuit 150, a comparison information storage circuit 50, a comparison information storage circuit 160, and an analysis result storage circuit 160) forming the special operation data control signal 141 (141a to 141N). The first data and the second data are compared at the beginning, and consecutive data are simultaneously compared. The magnitude comparison unit 1462 determines whether the first data is large or the second data is large for the bit width 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 extracted first data from one of the storage circuits 150, 50 to another storage circuit 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 different storage circuits 50 and 150.
[0056]
The logical product unit 1465, the logical sum unit 1466, and the adder unit 1467 perform logical sum, logical product, and addition of the first data and the second data, respectively. The bit shift unit 1468 performs a bit shift on the first data to the right or left indicated by the bit shift direction instruction signal 1333 by the number of bits specified by the second data. After the bit shift, the OR unit 1469 performs a logical OR of the data obtained by bit-shifting the first data by the number of bits specified by the immediate data 1335 in the direction indicated by the bit shift direction instruction signal 1333 by a combination operation. In the checksum operation unit 1470, the first data (first operand) represents a head pointer (origin), 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 specifying the second data as the address to the storage circuits 50 and 150 indicated by the first data.
[0057]
The state notifying unit 147 notifies the CPU 110 of the state of the comparison result executed by one of the comparison instructions (1461, 1462) in the operation unit group 146 and the packet analysis start timing signal 152 output from the header data storage circuit 150 to the CPU 110. Generated as a signal 142. The special operation result data output unit 143 generates write data 143 to be written to an address specified via the decode circuit 130 by an instruction (1463-1471) other than the comparison in the arithmetic unit group 146, and writes this to the header storage circuit 150. .
[0058]
With the above-described configuration, the special operation unit 140 is not the operation unit group 146 that only analyzes the headers illustrated in FIGS. 14 and 15. Can be used by changing the program, and the data can be directly extracted 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 taking the data into the CPU 110. A 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 branching of a program and comparison result determination.
[0059]
<Detailed Description of Special Operation Instruction Decode Circuit 130>
As shown in detail in FIG. 4, in the special operation instruction decoding circuit 130 constituting the decoder 130 in FIG. 1, the instruction instruction analysis unit 131 performs the read operation on the header data included in the special operation instruction instruction signal 115 from the CPU 110. The 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 the special operation execution result (write data) 143 are stored in the header data storage circuit 150, the header analysis result storage circuit 160, and the header. As one of the write destination addresses of the edit storage circuit 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 The special-operation data extraction access control signal 132 including 2, 1324, and 1326, the enable instruction signal 1331 for each instruction necessary for executing the special operation instruction, the bit mask signal 1332, and the bit shift direction instruction signal 1333 are compared in magnitude. The special operation instruction decode signal 133 including the direction instruction signal 1334 and the immediate data 1335 of the operand of the instruction described in the program can be output.
[0060]
With the above-described configuration, the special operation unit 140 includes a plurality of operation unit groups 146, but can perform a plurality of operations with 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, a header register pointer And 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 (143a to 143N) from the special operation unit 140 has been input, and has a two-sided 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-sided configuration including a side written during packet reception and a side analyzed by the CPU 110 and the special operation unit 140, and stores the header equivalent data 11 alternately by a packet analysis plane selection signal 1541 described later. .
[0063]
The packet analysis timing generation circuit 154
It is special that the header-corresponding data 11 of a predetermined number of bits is written to the header register 157 by using the input data detection notification signal 1562 generated from the header register write select circuit 156 as a trigger only when the header-corresponding data 11 is detected. A packet analysis start timing signal 152 to be notified to the arithmetic unit 140;
A packet analysis plane selection signal 1541 for selecting the reception packet write side and packet analysis (read) side of the header register 157;
A packet analysis completion timing signal 153 indicating the data transfer timing of the storage circuit 150 to the subsequent packet analysis element 100;
Generate.
[0064]
The header register read select circuit 158 generates a head register read pointer 1581 based on the data of the header register 157 with 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 the pointer information for accessing the header register 157 output from the CPU 110 to generate the header extraction information and the read or write enable signal 112, or generates the header extraction information from the special operation unit 140. The pointer information for accessing the header register 157 and the read or write enable signal 132 output to the header register 157 or the header register read / select circuit 158 for determining whether or not the packet is being analyzed are selected. Output.
[0065]
The header data storage circuit 150 having the above configuration will be described with reference to FIG. FIG. 11 shows an example in which the number of packet analysis elements 100 is three (#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 sequentially selected from the pointer 0 according to the write pointer 1561 from the header register write select circuit 156 in a predetermined bit width unit. The data H corresponding to the first header is stored in the plane-1.
Here, FIG. 11 shows only “H” as the header equivalent data, but “H + P # x” is actually the header equivalent data and has a “predetermined bit width”. The fixed time (fixed period) shown in FIG. 11 is “H + P # x” + α (α: minimum gap between packets of the Ethernet (R) standard). In FIG. 12, the data corresponding to the header is "H + P # x (part)", and the data corresponding to the payload is "P # x (remaining)".
[0066]
When the packet data storage in the header register 157 is completed, the packet analysis start timing signal 152 is output from the packet analysis timing generation circuit 154 to the special operation unit 140, and this timing generation also indicates that a fixed time has elapsed. After this, a new packet can be received, and when the header register write / select circuit 156 detects the new header equivalent data H, it selects the selection surface-2 of the header register 157 for which packet storage has been completed, and Header equivalent data H can be stored.
[0067]
The packet analysis start timing signal 152 for the first header equivalent data H + P # x triggers the CPU 110 and the special computing unit 140 in the packet analysis element to perform analysis. By outputting a packet analysis completion timing signal 153 indicating that analysis has been completed to the analysis result storage circuit 160, the packet analysis element 100 at the next stage is notified that the transfer preparation is completed. By generating the packet analysis completion timing signal 153 (153a to 153N) within a fixed time, the 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 correctly maintained.
From the reception of the packet to the completion of the packet analysis, the processing of the first header equivalent data H selects the selection plane -1 by the packet analysis plane selection signal 1541, and generates the packet analysis completion timing signal 153 to select the header register. The data H corresponding to the first header that has been analyzed at −1 is transferred to the subsequent packet analysis element 100 as takeover data 151. At this time, the storage of the second header equivalent data H stored in the selection plane-2 is also completed, the packet analysis start timing signal 152 is output, and the above operation is repeated every fixed time.
[0068]
In addition, it is possible to achieve both packet reception and packet analysis while arbitrating the contention between the header-equivalent data H from the received packet separation unit 10 and the write or read from the CPU 110 or the special arithmetic unit 140 during packet analysis.
Although not shown in the figure, a flag indicating the end of the packet is written in the header storage circuit 150 when storing the data corresponding to the header and the data corresponding to the payload. Thus, whether to read the payload-equivalent data after the header-equivalent data is determined based on whether or not the packet end flag is detected.
[0069]
<< Detailed Description of Payload Housing Unit 20 >>
As shown in detail in FIG. 6, the payload accommodating unit 20 includes a payload data storage memory (also simply referred to as a memory) 22 for storing the payload equivalent data 12, a payload data writing 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 reading circuit 27 are provided. The payload data writing circuit 23 generates an address for writing data to the payload data storage memory 22 and a write enable signal. 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 in association with the header equivalent data 11 analyzed by the packet analysis element 100 at the time of generating the transmission packet. .
[0070]
The pointer holding circuit 25 is composed of a plurality of registers (for the received packets # 1, # 2 to #Y in the figure) in order to hold the pointer value for each received packet on one payload data storage memory 22. ing. The read pointer generation circuit 26 generates a pointer value from the pointer that has just finished reading from the pointer holding circuit 25 to the write end pointer based on the payload read control signal 62 from the update packet transmitting unit 60. The payload data reading circuit 27 generates an address and a read enable signal for reading the payload equivalent data 12 from the payload data storage memory 22 by using the payload reading control signal 62 from the update packet transmitting unit 60 as a trigger.
[0071]
The payload accommodation unit 20 having the above configuration will be described with reference to FIG. FIG. 12 shows an example in which the number of packet analysis elements 100 is three (#a, #b, #c) with respect to the length of a packet stored separately in the header data storage circuit 150 and the payload accommodating unit 20. The received packet 1 is separated into a header equivalent data H (actually “H + P # x (partial)”) and a payload equivalent data P (actually “P # x (remaining)”) by the received packet separation unit 10. When the payload data writing circuit 23 detects the payload-equivalent data P, an address and a write enable signal are generated in order to write to the payload data storage memory 22 in a predetermined bit width unit, and are written in order from address 0.
[0072]
When the payload data P # 1 has been written into 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 payload data of the first header equivalent data H. Then, the data is stored (written) into the register for the first header equivalent data of the pointer holding circuit 25. Subsequently, the 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. The data is stored in the register of the pointer holding circuit 25. The third payload equivalent data P # 3 is similarly 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 header edit storage circuit 170c to the destination of the result obtained from the table search. An instruction to discard or discard the packet, or an instruction to insert or delete a VLAN, for example, is written, and in synchronization with the packet analysis completion timing signal 153c, the header control data 172N and the new header data 151N are updated together with the updated packet transmission unit 60. Output to
[0074]
The update packet transmitting 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 processing of the updated header data is completed to the end, the data corresponding to the following payload exists and is combined into one packet. A payload read control signal 62 is output.
[0075]
In accordance with the control signal 62, the read pointer generation circuit 26 reads the first header stored in the pointer holding circuit 25 from the pointer 0 via the payload data read circuit 27 so that the first payload equivalent data subsequent to the first header equivalent data can be read. An address up to the write end pointer value of the corresponding data is instructed to the payload data storage memory 22, and the data is read. 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 time the 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 stores the search key data 171a, 171b to 171N (any one) in 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 converts the search results 32a, 32b to N corresponding to the search key data 171 into 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 and an upper header, for example, when individual analysis is performed for each packet analysis element 100. Since the number of packet analysis elements changes, the search key data 171 is not always fixedly output from the determined packet analysis element 100, and a packet analysis program for generating the search key data 171 based on information obtained by packet analysis is implemented. The search key data 171 from the packet analysis element 100 is selected and output to the search table 40. Also, 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 stored in the search result reception FIFO 35, and the search result data 32 is not output until an instruction is given from the packet analysis element 100 as an output destination. For example, when generating an update header in 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 in the element 100c. It is possible to cope with processing time delays and differences in search times due to the multiple search key data 171.
[0079]
<< Detailed Description of Update Packet Transmitter 60 >>
As shown in detail in FIG. 8, the update packet transmitting unit 60 includes a control signal generating unit 63 that generates a payload read control signal 62 and a packet generating unit 64. The packet generation unit 64 issues an instruction to insert into header data output from the packet analysis element 100N (a = N in the case of one packet analysis element), which is the final stage among the one or more packet analysis elements 100a and 100b to 100N. In accordance with a signal 1721N, a delete instruction signal 1722N from the header data, a header control data 172N including a 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 are updated. Combine with cereal.
[0080]
With the above-described configuration, the update packet transmitting unit 60 synchronizes with the packet analysis completion timing signal 153 from the packet analysis element 100N, and takes over the takeover header data 151N, the insertion instruction signal 1721N from the header edit storage circuit 170N into the header data, and the header. The header control data 172N including the data deletion instruction signal 1722N 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, and if necessary, the transmission-waiting packet payload data 21 is combined and output as a transmission packet 61.
[0081]
<< Modified Example 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]
In order to analyze the header of the received packet 1, the sequential number comparison units 180N and 181N store the search key data 171 of the table search via the header data storage circuit 150, the header analysis result storage circuit 160, and the header edit storage circuit 170. Since one piece of received packet information is transmitted through three paths of sending and receiving a search result, the first-stage packet analysis element is used to detect that information of the same received packet is not aligned due to a failure in any one of the paths. A sequential number is assigned from 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 assigned to the last stage of the packet analysis element 100. With 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]
A transfer image of the sequential numbers having the above configuration will be described with reference to FIG. When the number of packet analysis elements 100 is three (#a, #b, #c), the search data selector 30 outputs the search key data 171a by the element 100a and receives the search result 32c by the element 100c. 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 also writes to the header analysis result storage circuit 160a. The sequential number #A is similarly written in the header data storage circuit 150a storing the header equivalent data based on this analysis result.
[0084]
Then, 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 combines the header equivalent data 11 with the header data storage circuit 150b, and the header analysis result storage circuit 160a stores the analysis result information. One of them is transferred to the analysis result storage circuit 160b, and the header edit storage circuit 170a does not directly transfer it to the edit storage circuit 170b, but transfers it 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 edit storage circuit 170c of the packet analysis element 100c. And outputs the #A value from the table route sequential number 173c.
[0085]
As described above, the elements 100a to 100b and the elements 100b to 100c take over between the elements 100 in synchronization with the packet analysis completion timing signal 153, and output the #A value from the sequential number 1571N of the path of the header data storage circuit 150. I do. The #A value is output from the sequential number 162N of the header data analysis result storage circuit 160 path. By comparing the sequential numbers of these routes, it is possible to detect that one packet information is normally transferred on three routes because all of them have the #A value.
[0086]
【The invention's effect】
As described above, according to the configuration of the first and second aspects, processes such as identification of each field in a received packet header, extraction of search key information, and generation of a transmission packet header after receiving a search result are 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 particularly high-performance CPU.
According to the configuration of the third aspect, since information transfer between the packet analysis elements of the pipeline configuration is also performed by a predetermined timing signal, no special flag (register) and processing are required. All can be assigned to individual packet analysis processes.
According to the configuration of the fourth aspect, when one or more packet analysis elements are used, the information extracted and analyzed by the preceding packet analysis element is not redundantly processed, so that the program load is reduced. The distribution can be flexibly handled, and the memory size for storing the program can be all allocated to individual packet analysis processing.
According to the configuration of claim 5, 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 described in claim 6, 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 the operation instructions, it is possible to implement a design change or add a function and maintain high-speed packet processing.
According to the configuration described in claim 7, it is possible to realize a design change and a function addition.
According to the configuration described in claim 8, 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. An access control signal such as an address can be generated at the same time, and various enable signals required at the time of executing an instruction can be generated.
According to the configuration of claim 9, 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 and the special arithmetic unit in the packet analysis element while maintaining the wire speed, The data can be transferred 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 one pointer corresponding to the header-equivalent data being analyzed in the packet is managed in one memory, each payload data of a plurality of received packets is accommodated. The device can be realized at low cost without requiring a memory.
According to the configuration of claim 11, when the search data selector includes a plurality of packet analysis elements, the search data selector can receive a search key from any of the packet analysis elements, and the search result is output to any of the packet analysis elements. Can be transmitted, a plurality of packet analysis elements can access the search table, and the flexibility of the program processing is increased.
According to the configuration of the twelfth aspect, when the search data selector receives the search result data from the search table by FIFO, even if the response time of the search table changes, the search result is obtained at a timing when the packet analysis element is necessary. Can receive data.
According to the configuration of the thirteenth aspect, the updated packet transmitting unit, according to the analysis result of the packet analysis element, includes a header newly generated from the header equivalent data stored via the header data storage circuit. A new transmission packet can be generated from the payload equivalent data stored in the payload storage unit.
According to the configuration described in claim 14, 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 for finally detecting the consistency in the packet analysis element, the reliability in the packet processing device can be improved.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a basic configuration of a packet processing device according to the present invention.
FIG. 2 is a block diagram showing a bus configuration in the packet analysis element of FIG. 1 in detail;
FIG. 3 is a block diagram showing a special operation unit in FIG. 1;
FIG. 4 is a block diagram showing a special operation instruction decode circuit in FIG. 1;
FIG. 5 is a block diagram showing a header data storage circuit in FIG. 1;
FIG. 6 is a block diagram showing a received packet payload accommodating unit in FIG. 1;
FIG. 7 is a block diagram showing a search data selector in FIG. 1;
FIG. 8 is a block diagram showing an update packet transmitting unit in FIG. 1;
FIG. 9 is a block diagram showing a modified example in which a sequential number comparison circuit is added to the packet analysis element in FIG.
FIG. 10 is an image diagram showing a sequential number comparison in FIG. 9;
FIG. 11 is a processing timing diagram when a minimum packet length and a minimum inter-packet gap are used by using three packet analysis elements according to the present invention.
FIG. 12 is a processing timing diagram when three packet analysis elements according to the present invention are used, and an arbitrary packet length and a gap between arbitrary packets are used.
FIG. 13 is a block diagram showing a conventional packet processing device.
FIG. 14 is a diagram showing a configuration of a lower layer header of a conventional packet.
FIG. 15 is a diagram showing a configuration of a conventional IPv4 header.
[Explanation of symbols]
1 Received packet
10 Received packet separation unit
11 Header equivalent data
12 payload equivalent data
20 Received packet payload storage
21 Transmission 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 read circuit
30 Search data selector
40 Search Table
50 Comparison information storage circuit
60 Update packet transmission unit
61 Transmission packet
62 Payload read control signal
63 Payload read control signal generator
64 packet generator
100, 100a, b, ..., N packet analysis elements
110a, b,..., N CPU
.., N CPU read data from the storage circuits 150 and 50
112a, b,..., N Storage circuits 150, 50 access control signals from CPU
113a, b,..., N Write data from storage circuits 150, 50 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 operation 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 status notification signal
143, 143a, b,..., N Write data to the storage circuits 150 and 50 of the special operation unit
145 Special operation control unit
146 arithmetic unit group
147 Status notification unit
148 Special operation result data output unit
150, 150a, b,..., N Header data storage circuit
151a, b, ..., N-element inherited 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 selection unit
160, 160a, b,..., N Analysis result storage circuit
161a, b, ..., N element takeover analysis result data
162N Header analysis result storage circuit path sequential number
170, 170a, b,..., N Header edit storage circuit
171, 171a, 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 instruction signal
1334 Size comparison direction instruction signal
1335 immediate data
1321 (for special operation) First address
1322 (for special operation) 1st write or read enable
1323 (for special operation) 2nd address
1324 (for special operation) 2nd 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 large and small comparison section
1463 Data transfer unit
1464 Partial data transfer unit
1465 AND
1466 OR
1467 Adder
1468 bit shift section
OR section after 1469 bit shift
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 (14)

受信パケットのヘッダを送信パケットのヘッダに変換するための検索データを検索テーブルに記憶する検索データ記憶ステップと、
前記受信パケットの種類を判定するための比較情報を記憶する比較情報記憶ステップと、
前記受信パケットのデータ区切りを検出し、ヘッダ相当データ部分とペイロード相当データ部分を分離する受信パケット分離ステップと、
前記受信パケットの種類及び/又はあらかじめ割り当てたパケット解析内容に応じた数でパイプライン構成され、固定周期で前記パケット分離ステップにより分離された前記ヘッダ相当データ部分と前記比較情報記憶ステップにより記憶されている比較情報を比較して前記受信パケットの種類を判定するとともに、前記検索テーブルを検索して必要に応じて前記ヘッダ相当データを更新して次段に出力するとともに、当該解析結果を次段が使用する場合に次段に引き継ぐ1つ以上のパケット解析ステップと、
前記1つ以上のパケット解析ステップの最終段からのヘッダ相当データと前記パケット分離ステップにより分離された前記ペイロード相当データ部分をシーケンシャルに結合して送信パケットとして出力する更新パケット送信ステップとを、
備えたパケット処理方法。
A search data storing step of 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 storage step of storing comparison information for determining the type of the received packet;
A received packet separation step of detecting a data segment of the received packet and separating a header equivalent data portion and a payload equivalent data portion;
A pipeline is formed with a number corresponding to the type of the received packet and / or a packet analysis content assigned in advance, and the header-equivalent data portion separated by the packet separation step at a fixed period and stored by the comparison information storage step. The type of the received packet is determined by comparing the comparison information, and the search table is searched to update the header-equivalent data as necessary, and output to the next stage. One or more packet analysis steps to take over to the next stage if used;
An update packet transmission step of sequentially combining the header-equivalent data from the last stage of the one or more packet analysis steps and the payload-equivalent data part separated by the packet separation step and outputting the combined data as a transmission packet;
Provided packet processing method.
受信パケットのヘッダを送信パケットのヘッダに変換するための検索データを記憶する検索テーブルと、
前記受信パケットの種類を判定するための比較情報を記憶する比較情報記憶部と、
前記受信パケットのデータ区切りを検出し、ヘッダ相当データ部分とペイロード相当データ部分を分離する受信パケット分離部と、
前記受信パケットの種類及び/又はあらかじめ割り当てたパケット解析内容に応じた数でパイプライン構成され、固定周期で前記パケット分離ステップにより分離された前記ヘッダ相当データ部分と前記比較情報記憶ステップにより記憶されている比較情報を比較して前記受信パケットの種類を判定するとともに、前記検索テーブルを検索して必要に応じて前記ヘッダ相当データを更新して次段に出力するとともに、当該解析結果を次段が使用する場合に次段に引き継ぐ1つ以上のパケット解析エレメントと、
前記1つ以上のパケット解析エレメントの最終段からのヘッダ相当データと前記パケット分離部により分離された前記ペイロード相当データ部分をシーケンシャルに結合して送信パケットとして出力する更新パケット送信部とを、
備えたパケット処理装置。
A search table for storing search data for converting a header of a received packet into a header of a transmitted packet;
A comparison information storage unit that stores comparison information for determining the type of the received packet;
A reception packet separation unit that detects a data segment of the reception packet and separates a header equivalent data portion and a payload equivalent data portion;
A pipeline is formed with a number corresponding to the type of the received packet and / or a packet analysis content allocated in advance, and the header-equivalent data portion separated by the packet separation step at a fixed period and stored by the comparison information storage step. The type of the received packet is determined by comparing the comparison information, and the search table is searched to update the header-equivalent data as needed, and output to the next stage. One or more packet analysis elements that take over to the next stage when used,
An update packet transmitting unit that sequentially combines the header-equivalent data from the last stage of the one or more packet analysis elements and the payload-equivalent data part separated by the packet separation unit and outputs the combined data as a transmission packet;
Equipped with a packet processing device.
前記パケット解析エレメントの各々は、
前記受信パケット分離部から送出されたヘッダ相当データ部分を格納して格納完了後にパケット解析開始タイミング信号を出力するヘッダデータ記憶回路と、
当該パケット解析エレメントが実行するパケット解析プログラムを記憶するメモリと、
前記ヘッダデータ記憶回路から出力されたパケット解析開始タイミング信号をトリガとして前記メモリに記憶されたパケット解析プログラムの実行を開始するCPU及び特殊演算器とを備え、
前記固定周期の後に前記パケット解析プログラムの実行を完了してパケット解析完了タイミング信号を次段のエレメント又は更新パケット送信部に出力することを特徴とする請求項2に記載のパケット処理装置。
Each of the packet analysis elements comprises:
A header data storage circuit that stores a header-equivalent data portion transmitted from the received packet separation unit and outputs a packet analysis start timing signal after completion of storage;
A memory for storing a packet analysis program executed by the packet analysis element;
A CPU and a special arithmetic unit that start executing a packet analysis program stored in the memory with a packet analysis start timing signal output from the header data storage circuit as a trigger,
The packet processing device according to claim 2, wherein after the fixed period, the execution of the packet analysis program is completed, and a packet analysis completion timing signal is output to a next element or an updated packet transmitting unit.
前記パケット解析エレメントの各々はさらに、
前記パケット解析プログラムに応じてヘッダデータ記憶回路から異なる情報を抽出して記憶するため、及び前記比較情報と前記プログラム実行中に生成した一時的なデータを記憶するためのヘッダ編集記憶回路と、
前記パケット解析プログラムを実行したパケット解析結果を記憶するヘッダ解析結果記憶回路とを備え、
前記パケット解析完了タイミング信号に同期して前記ヘッダ解析結果記憶回路で記憶したデータを後段のパケット解析エレメントのヘッダ解析結果記憶回路へ出力することを特徴とする請求項2に記載のパケット処理装置。
Each of the packet analysis elements further comprises:
A header edit storage circuit for extracting and storing different information from the header data storage circuit according to the packet analysis program, and for storing the comparison information and temporary data generated during execution of the program;
A header analysis result storage circuit that stores a packet analysis result obtained by executing the packet analysis program,
3. The packet processing device according to claim 2, wherein the data stored in the header analysis result storage circuit is output to a header analysis result storage circuit of a subsequent packet analysis element in synchronization with the packet analysis completion timing signal.
前記ヘッダ解析結果記憶回路は、
現ヘッダの解析をしている間に次のパケットを受信して前記現ヘッダの解析結果に次ヘッダの解析結果を上書きしないように2面で構成され、各面を前記パケット解析完了タイミング信号毎に切り替えて交互に記憶することを特徴とする請求項4に記載のパケット処理装置。
The header analysis result storage circuit,
While the analysis of the current header is performed, the next packet is received and the analysis result of the next header is not overwritten with the analysis result of the next header. 5. The packet processing apparatus according to claim 4, wherein the packet processing is switched and stored alternately.
前記特殊演算器は、
前記パケット解析プログラムに含まれる特殊演算命令に基づいて、直接、前記ヘッダデータ記憶回路と、前記ヘッダ解析結果記憶回路と、前記ヘッダ編集記憶回路と比較情報記憶回路のいずれかからデータをあらかじめ決めたビット幅単位に読み出し、読み出したデータに対してパケット解析のための各種論理演算を行うことを特徴とする請求項3から5のいずれか1つに記載のパケット処理装置。
The special computing unit is
Based on a special operation instruction included in the packet analysis program, data was directly determined in advance from any of the header data storage circuit, the header analysis result storage circuit, the header edit storage circuit, and the comparison information storage circuit. The packet processing apparatus according to claim 3, wherein the packet processing apparatus reads data in bit width units and performs various logical operations for packet analysis on the read data.
前記特殊演算器はさらに、前記パケット解析プログラムに含まれる即値の論理演算を行うことを特徴とする請求項3から6のいずれか1つに記載のパケット処理装置。The packet processing apparatus according to claim 3, wherein the special operation unit further performs a logical operation on an immediate value included in the packet analysis program. 前記特殊演算命令は、
前記ヘッダデータ記憶回路と、前記ヘッダ解析結果記憶回路と、前記ヘッダ編集記憶回路と前記比較情報記憶回路のいずれかのデータを直接リード、ライトするためのアクセス制御信号と、命令実行時に必要な各種イネーブル信号を含むことを特徴とする請求項6に記載のパケット処理装置。
The special operation instruction includes:
An access control signal for directly reading and writing data in any of the header data storage circuit, the header analysis result storage circuit, the header edit storage circuit, and the comparison information storage circuit; The packet processing device according to claim 6, further comprising an enable signal.
前記ヘッダデータ記憶回路は、パケット受信中に書き込まれる面と、前記CPU及び特殊演算器により解析されている面の2面構成で各パケットの前記ヘッダ相当データを交互に格納するヘッダレジスタを備えたことを特徴とする請求項3から7のいずれか1つに記載のパケット処理装置。The header data storage circuit includes a header register for alternately storing the header-equivalent data of each packet in a two-sided configuration including a side written during packet reception and a side analyzed by the CPU and the special arithmetic unit. The packet processing device according to claim 3, wherein: 前記パケット分離部により分離された複数の受信パケットの各ペイロード相当データ部分を、前記最終段のエレメントの処理が終了するまで収容するペイロード収容部をさらに備え、前記ペイロード収容部は、前記複数のパケットのペイロード相当データを1つのペイロードデータ蓄積用メモリに格納してポインタにより管理することを特徴とする請求項2から9のいずれか1つに記載のパケット処理装置。A payload accommodating unit for accommodating each payload-equivalent data portion of the plurality of received packets separated by the packet separating unit until the processing of the last-stage element is completed; The packet processing apparatus according to any one of claims 2 to 9, wherein the payload equivalent data is stored in one payload data storage memory and managed by a pointer. 前記検索テーブルを検索するために前記1つ以上のパケット解析エレメントが出力した検索キーを選択して前記検索テーブルに出力するとともに、前記検索キーに基づいて前記検索テーブルから出力された検索結果を前記検索キーを出力した前記パケット解析エレメントに出力する検索データセレクタをさらに有することを特徴とする請求項2から10のいずれか1つに記載のパケット処理装置。A search key output by the one or more packet analysis elements is selected to output the search table, and the selected search key is output to the search table. 11. The packet processing apparatus according to claim 2, further comprising a search data selector that outputs a search key to the packet analysis element that outputs a search key. 前記検索データセレクタは、
前記検索テーブルに対する各エレメントの検索時間の違いに対応するためのキューを具備し、前記検索テーブルから出力された検索結果データを前記キューに蓄積し、出力先となるパケット解析エレメントからの指示により出力することを特徴とする請求項10に記載のパケット処理装置。
The search data selector,
A queue for responding to a difference in search time of each element with respect to the search table, storing search result data output from the search table in the queue, and outputting the data in response to an instruction from a packet analysis element serving as an output destination The packet processing device according to claim 10, wherein
前記更新パケット送信部は、
前記最終段のパケット解析エレメントから送信指示が出力される場合に、ヘッダデータへの書換・挿入・削除指示に従ってヘッダ相当データの更新を行った上でペイロード収容部から続くペイロード相当データと結合してパケットとして送信し、
前記最終段のパケット解析エレメントから破棄指示が出力される場合に、ペイロード収容部へのペイロード読み出し制御信号を経由して破棄指示されたペイロード相当データと結合する予定であった読み出すべきポインタではなく、次に読み出すべきポインタを選択して次の読み出し指示まで保持することを特徴とする請求項2から12のいずれか1つに記載のパケット処理装置。
The update packet transmitting unit,
When a transmission instruction is output from the packet analysis element at the last stage, the header-equivalent data is updated according to the rewrite / insert / delete instruction to the header data, and then combined with the subsequent payload-equivalent data from the payload accommodating unit. Send as a packet,
When a discard instruction is output from the packet analysis element at the last stage, it is not a pointer to be read that was to be combined with the payload equivalent data instructed to be discarded via the payload read control signal to the payload storage unit, 13. The packet processing apparatus according to claim 2, wherein a pointer to be read next is selected and held until a next read instruction.
初段のエレメントにおいて前記ヘッダデータ記憶回路に記憶されたヘッダ相当データと、前記ヘッダ編集記憶回路に記憶された一時的なデータと、前記ヘッダ解析結果記憶回路に記憶されたパケット解析結果の3系統のデータに対してパケット毎に同じシーケンシャルな番号を付与して次段のエレメントに転送し、最終段のエレメントにおいて前記シーケンシャルな番号により同じパケットの前記3系統のデータを整合することを特徴とする請求項2から12のいずれか1つに記載のパケット処理装置。In the first stage element, there are three systems: header equivalent data stored in the header data storage circuit, temporary data stored in the header edit storage circuit, and packet analysis results stored in the header analysis result storage circuit. The same sequential number is assigned to data for each packet and transferred to the next-stage element, and the three-line data of the same packet is matched by the sequential number in the last-stage element. Item 13. The packet processing device according to any one of Items 2 to 12.
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 true JP2004064648A (en) 2004-02-26
JP3935021B2 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)

Cited By (2)

* 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
JP2015535410A (en) * 2012-10-18 2015-12-10 ゼットティーイー コーポレイション Method and apparatus for modifying and forwarding messages in a data communication network

Cited By (4)

* 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
US8125900B2 (en) 2005-01-27 2012-02-28 Fujitsu Limited Network equipment management device, network equipment management method, network equipment, and program used therein
JP2015535410A (en) * 2012-10-18 2015-12-10 ゼットティーイー コーポレイション Method and apparatus for modifying and forwarding messages in a data communication network
US9444915B2 (en) 2012-10-18 2016-09-13 Zte Corporation Method and device for modifying and forwarding message in data communication network

Also Published As

Publication number Publication date
JP3935021B2 (en) 2007-06-20

Similar Documents

Publication Publication Date Title
US10749800B2 (en) Apparatus and method of generating lookups and making decisions for packet modifying and forwarding in a software-defined network engine
US8867543B2 (en) In-line packet processing
US7283528B1 (en) On the fly header checksum processing using dedicated logic
CN102272716B (en) The SIMD of network packet processes
US7936758B2 (en) Logical separation and accessing of descriptor memories
JP4203979B2 (en) Packet processing device
US6976154B1 (en) Pipelined processor for examining packet header information
CN102055666A (en) Methods and apparatus related to a distributed switch fabric
US9391893B2 (en) Lookup engine for an information handling system
US8594092B2 (en) Packet relay method and device
US7212530B1 (en) Optimized buffer loading for packet header processing
CN113783800A (en) Data packet processing method and device, computer equipment and readable storage medium
US7773595B2 (en) System and method for parsing frames
US7436776B2 (en) Communication test device
JP3935021B2 (en) Packet processing method and apparatus
JP2007228227A (en) Communication device
JP4342128B2 (en) Packet processor and packet processor system
US7158520B1 (en) Mailbox registers for synchronizing header processing execution
CN110535847B (en) Network processor and stack processing method of network data
US9210093B2 (en) Alignment circuit and receiving apparatus
JP3233353B2 (en) Header processing device and header processing method
US9819585B1 (en) Making a flow ID for an exact-match flow table using a programmable reduce table circuit
JP2002335275A (en) Packet processing unit
Hua et al. Hardware accelerated decoding of fix/fast and book building of market data
JP2003046566A (en) Packet-processing unit and method

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