JP2007215013A - Protocol processor and protocol processing method - Google Patents

Protocol processor and protocol processing method Download PDF

Info

Publication number
JP2007215013A
JP2007215013A JP2006034068A JP2006034068A JP2007215013A JP 2007215013 A JP2007215013 A JP 2007215013A JP 2006034068 A JP2006034068 A JP 2006034068A JP 2006034068 A JP2006034068 A JP 2006034068A JP 2007215013 A JP2007215013 A JP 2007215013A
Authority
JP
Japan
Prior art keywords
packet
checksum
data
fragmented
checksum value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2006034068A
Other languages
Japanese (ja)
Inventor
Shinichi Matsumoto
真一 松本
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2006034068A priority Critical patent/JP2007215013A/en
Publication of JP2007215013A publication Critical patent/JP2007215013A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Detection And Prevention Of Errors In Transmission (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To process a stationary packet and a non-stationary packet (fragment packet) at a high speed, using small circuit scale. <P>SOLUTION: This protocol processor has a control means for executing reassembly processing of fragmented packets and data checksum inspection processing of the reassembled packets, by using a checksum value stored in a checksum storage means and a checksum value stored in a packet header of the reassembled packets and this problem is solved by performing a checksum inspection by the control means, when it is decided that a received packet is a fragmented packet by a fragment inspection means and performing the checksum inspection by a checksum inspection means, when it is decided that the packet received is not the fragmented packet at the fragment inspection means. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明は、プロトコル処理装置及びプロトコル処理方法に関する。   The present invention relates to a protocol processing apparatus and a protocol processing method.

ネットワークを利用したデータ通信においては、TCP/IPをはじめとしたプロトコルを用いた手法が用いられる。このTCP/IPによる通信では、データを小単位に分割して、送受信に関連する各種情報をヘッダとして付加することにより、パケットと呼ばれるデータのかたまりで送受信を行っている。   In data communication using a network, a technique using a protocol such as TCP / IP is used. In this communication by TCP / IP, data is divided into small units, and various information related to transmission / reception is added as a header, whereby transmission / reception is performed in a block of data called a packet.

また、ネットワークプロトコルにおいては、OSI参照モデルに代表されるように、その処理単位が階層的に行われており、これに従ってパケットのデータ構造においてもそれぞれの処理単位に応じたヘッダ情報が階層的に付加されている。   Further, in the network protocol, as represented by the OSI reference model, the processing unit is hierarchically performed, and according to this, the header information corresponding to each processing unit is hierarchically included in the packet data structure. It has been added.

図1は、イーサネット(登録商標)におけるTCP/IPパケットのデータ構造を示す図である。図1においては、データの先頭からそれぞれ、イーサネット(登録商標)ヘッダ201、IPヘッダ202、TCPヘッダ203が順次付加されており、その後アプリケーションデータであるペイロードデータ204が続いている。   FIG. 1 is a diagram showing a data structure of a TCP / IP packet in Ethernet (registered trademark). In FIG. 1, an Ethernet (registered trademark) header 201, an IP header 202, and a TCP header 203 are sequentially added from the top of the data, followed by payload data 204 that is application data.

図2は、IPパケットのデータ構造を示す図である。図2において、301はIPヘッダ部、302はデータ部を示している。IPヘッダ部301には、ヘッダサイズやパケットサイズ、サービスタイプや識別子、また、送信元と送信先とのIPアドレス、及び303に示すヘッダチェックサム値、更に304に示すフラグ、305に示すフラグメントオフセット値等が格納されている。ヘッダチェックサム303は、IPヘッダ部301と、データ部302とが壊れていないことを保証するための16ビットのデータである。IPパケット受信処理においては、装置は、受信したパケットのIPヘッダ部301のチェックサム値を演算し、その結果と、ヘッダに格納されているヘッダチェックサム303との比較を行う。   FIG. 2 is a diagram illustrating a data structure of an IP packet. In FIG. 2, 301 indicates an IP header portion, and 302 indicates a data portion. The IP header section 301 includes a header size, a packet size, a service type, an identifier, an IP address between the transmission source and the transmission destination, a header checksum value indicated by 303, a flag indicated by 304, and a fragment offset indicated by 305. Stores values and so on. The header checksum 303 is 16-bit data for assuring that the IP header portion 301 and the data portion 302 are not broken. In the IP packet reception process, the apparatus calculates the checksum value of the IP header portion 301 of the received packet and compares the result with the header checksum 303 stored in the header.

フラグ304には、IPデータグラムのフラグメント処理を制御する3ビットのデータが格納されている。フラグメントオフセット305には、フラグメントされたデータが、オリジナルのIPデータグラムのどこに位置しているかを意味する13ビットのデータが格納されている。   The flag 304 stores 3-bit data that controls fragment processing of the IP datagram. The fragment offset 305 stores 13-bit data that indicates where the fragmented data is located in the original IP datagram.

図3は、TCPパケットのデータ構造を示す図である。図3において、401はTCPヘッダ部、402はデータ部を示している。TCPヘッダ部401には、送信元と送信先とのポート番号、シーケンス番号、各種フラグ、ヘッダ部とデータ部とを含む、403に示すチェックサム値等が格納されている。   FIG. 3 is a diagram illustrating a data structure of a TCP packet. In FIG. 3, 401 indicates a TCP header portion, and 402 indicates a data portion. The TCP header portion 401 stores a port number, a sequence number, various flags, a checksum value indicated by 403 including a header portion and a data portion, and the like.

チェックサム403は、TCPヘッダ部401とデータ部402とが壊れていないことを保証するための16ビットのデータである。TCPパケット受信処理においては、装置は、受信したパケットのTCPヘッダ部401と、データ部402とのチェックサム値を演算し、その結果と、ヘッダに格納されているチェックサム403との比較を行う。   The checksum 403 is 16-bit data for ensuring that the TCP header portion 401 and the data portion 402 are not broken. In the TCP packet reception process, the apparatus calculates the checksum value between the TCP header portion 401 and the data portion 402 of the received packet, and compares the result with the checksum 403 stored in the header. .

これらTCP/IPのプロトコル処理は従来ソフトウェアによって実装されてきた。しかしながら、例えばチェックサム値の演算等においては、パケット処理ごとに1500バイト程度の加算処理が必要となり、ソフトウェアでは演算に時間がかかるため通信のスループットを上げるのが困難になってくる。   These TCP / IP protocol processes have been conventionally implemented by software. However, for example, in the calculation of the checksum value or the like, an addition process of about 1500 bytes is required for each packet process, and it takes time for the calculation in software, so it is difficult to increase the communication throughput.

これを解決する手段として、特許文献1において、ハードウェアを利用してチェックサム値を短時間で生成するための回路が提案されている。   As means for solving this, Patent Document 1 proposes a circuit for generating a checksum value in a short time using hardware.

特開平9−134295号公報JP-A-9-134295

IPパケット処理を高速に実行する手段として、上述した特許文献1で提案されているようにハードウェアを用いる方法は、特に定常的なパケットの処理を行わせるだけにおいては、比較的簡単に実現させることができ、有効である。しかしながら、非定常的なパケットの処理までハードウェアに行わせようとすると、ハードウェアの回路規模が大きくなってしまう問題があった。   As a means for executing IP packet processing at high speed, the method using hardware as proposed in Patent Document 1 described above can be realized relatively simply, particularly by only performing routine packet processing. Can be effective. However, if the hardware tries to process non-stationary packets, there is a problem that the hardware circuit scale increases.

例えば、TCP/IPプロトコルにおいては、IPパケットがデータリンクで転送できる最大値(MTU)を超えたサイズのデータについては、必要に応じてフラグメンテーションと呼ばれるパケット分割を行う機能が決められている。ネットワークの中継を行うルーター等の機器では、受け取ったIPパケットが送り先のMTUより大きなサイズのパケットである場合には、フラグメント処理によってパケットを分割して送信する機能を持っている。   For example, in the TCP / IP protocol, for data having a size exceeding the maximum value (MTU) that an IP packet can be transferred through a data link, a function for performing packet division called fragmentation is determined as necessary. A device such as a router that relays a network has a function of dividing and transmitting a packet by fragment processing when the received IP packet is a packet having a size larger than the destination MTU.

このフラグメンテーションされたIPパケットを受信した場合は、全ての分割パケットが到着するのを待って、パケットの再組み立てを行い、上位のプロトコルに渡すことになる。   When this fragmented IP packet is received, the packet is reassembled after waiting for all the divided packets to arrive and passed to the upper protocol.

このフラグメントされたパケットの待ち合わせと再組み立てをハードウェアで実現する場合は、複雑なメモリ管理を行わなければならず回路構成が複雑になってしまう。また、ソフトウェアで処理される上位プロトコルが使用するメモリとは独立した専用のメモリも必要となるため、回路規模も大きくなる。   When the waiting and reassembly of the fragmented packet is realized by hardware, complicated memory management must be performed and the circuit configuration becomes complicated. In addition, since a dedicated memory independent from the memory used by the higher-level protocol processed by software is required, the circuit scale increases.

本発明は上記の問題点に鑑みなされたもので、定常的なパケット、及び否定常的なパケット(フラグメントパケット)を小さな回路規模で高速に処理することを目的とする。   The present invention has been made in view of the above problems, and an object of the present invention is to process a stationary packet and a non-stationary packet (fragment packet) at high speed with a small circuit scale.

そこで、上記問題を解決するため、本発明は、受信パケットのデータチェックサム計算を行うチェックサム演算手段と、前記チェックサム演算手段で求めたチェックサム値と、受信パケットのパケットヘッダに格納されているチェックサム値とを使用してデータチェックサム検査を行うチェックサム検査手段と、前記受信パケットが断片化されたパケットか否かを判断するフラグメント検査手段と、前記チェックサム演算手段で求めたチェックサム値を一時的に格納するチェックサム記憶手段と、断片化されたパケットの再組み立て処理、及び前記チェックサム記憶手段に格納されているチェックサム値と、前記再組み立てされたパケットのパケットヘッダに格納されているチェックサム値とを使用して再組み立てされたパケットのデータチェックサム検査処理を実行する制御手段と、を有し、前記フラグメント検査手段において前記受信パケットが断片化されたパケットであると判断された場合は、前記制御手段においてチェックサム検査を行い、前記フラグメント検査手段において前記受信パケットが断片化されたパケットでないと判断された場合は、前記チェックサム検査手段においてチェックサム検査を行うことを特徴とする。   Therefore, in order to solve the above problem, the present invention stores checksum calculation means for performing data checksum calculation of a received packet, a checksum value obtained by the checksum calculation means, and a packet header of the received packet. Checksum checking means for performing a data checksum check using a checksum value, a fragment checking means for determining whether or not the received packet is a fragmented packet, and a check obtained by the checksum calculation means Checksum storage means for temporarily storing the sum value, reassembly processing of the fragmented packet, checksum value stored in the checksum storage means, and packet header of the reassembled packet Data packet of the reassembled packet using the stored checksum value Control means for executing a checksum check process, and when the received packet is determined to be a fragmented packet by the fragment check means, the control means performs a checksum check, and the fragment check When the means determines that the received packet is not a fragmented packet, the checksum checking means performs a checksum check.

係る構成とすることにより、非定常的なパケットの処理は、制御手段が行い、定常的なパケットの処理は例えばハードウェアであるチェックサム演算手段や、フラグメント検査手段等が行う。よって、定常的なパケット、及び否定常的なパケットを小さな回路規模で高速に処理することができる。   With this configuration, non-stationary packet processing is performed by the control unit, and stationary packet processing is performed by, for example, hardware checksum calculation unit, fragment inspection unit, or the like. Therefore, stationary packets and non-stationary packets can be processed at high speed with a small circuit scale.

また、上記問題を解決するため、本発明は、プロトコル処理方法及びプログラムとしてもよい。   In order to solve the above problem, the present invention may be a protocol processing method and a program.

本発明によれば、定常的なパケット、及び否定常的なパケットを小さな回路規模で高速に処理することができる。   According to the present invention, stationary packets and non-stationary packets can be processed at high speed with a small circuit scale.

以下、本発明の実施形態について図面に基づいて説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

(実施形態1)
図4は、実施形態1に係る装置の全体構成を表すブロック図である。実施形態1では、ネットワークの物理層、データリンク層としてIEEE802.3に代表される有線LANの規格であるイーサネット(登録商標)を用いて説明する。また、ネットワーク層、トランスポート層としてTCP/IPプロトコルを用いて説明する。
(Embodiment 1)
FIG. 4 is a block diagram illustrating the overall configuration of the apparatus according to the first embodiment. In the first embodiment, description will be made using Ethernet (registered trademark) which is a standard of wired LAN represented by IEEE 802.3 as a physical layer and a data link layer of a network. Further, description will be made using the TCP / IP protocol as a network layer and a transport layer.

図4において、101はMAC(メディアアクセスコントロール)を示しており、ネットワーク上のイーサネット(登録商標)フレームは、まずMAC101で受信される。MAC101は、MACヘッダの情報に従って、物理層、データリンク層で提供されるプロトコル処理を実行し、MACヘッダを取り除いた後パケットデータを上位層へ受け渡す処理を行う。102はTCP(UDP)/IPデフレーマであり、MAC101によりMACヘッダが取り除かれたTCP/IPパケットを、MAC101より受け取り、IPヘッダ及びTCPヘッダデータを抽出する。   In FIG. 4, reference numeral 101 denotes a MAC (Media Access Control), and an Ethernet (registered trademark) frame on the network is first received by the MAC 101. The MAC 101 executes a protocol process provided in the physical layer and the data link layer according to the information of the MAC header, and performs a process of transferring packet data to an upper layer after removing the MAC header. A TCP (UDP) / IP deframer 102 receives a TCP / IP packet from which the MAC header has been removed by the MAC 101 from the MAC 101, and extracts the IP header and TCP header data.

抽出するIPヘッダ、TCPヘッダはそれぞれ図1、図2で説明した構造である。TCP(UDP)/IPデフレーマ102は、抽出したヘッダデータを後述するヘッダ情報解析部106へ送る。また、TCP(UDP)/IPデフレーマ102は、抽出したパケットデータを後述するチェックサム演算部103へ送る。   The extracted IP header and TCP header have the structures described with reference to FIGS. The TCP (UDP) / IP deframer 102 sends the extracted header data to the header information analysis unit 106 described later. Further, the TCP (UDP) / IP deframer 102 sends the extracted packet data to the checksum calculation unit 103 described later.

チェックサム演算部103は、TCP(UDP)/IPデフレーマ102からデータを受け取ると、TCPパケットのチェックサム値の計算を行う。   When the checksum calculation unit 103 receives data from the TCP (UDP) / IP deframer 102, it calculates a checksum value of the TCP packet.

チェックサム演算部103は、TCPパケットのチェックサム値の計算として、まず、送信先IPアドレス、送信元IPアドレス、パケット長、プロトコル番号から構成される擬似ヘッダを生成する。次に、チェックサム演算部103は、TCPヘッダ中のチェックサム領域に0を入れた後、擬似ヘッダ、TCPヘッダ、データ部分を全て16ビット単位で1の補数で足し合わせる。それから、チェックサム演算部103は、受信パケットバッファ104へデータを送り出す。受信パケットバッファ104は、受信したパケットデータを1パケット分格納する領域であり、受信パケットが正常なパケットでなかった場合にはデータを破棄する処理を行う。   The checksum calculation unit 103 first generates a pseudo header composed of a transmission destination IP address, a transmission source IP address, a packet length, and a protocol number as the calculation of the checksum value of the TCP packet. Next, after adding 0 to the checksum area in the TCP header, the checksum calculation unit 103 adds the pseudo header, the TCP header, and the data part by 1's complement in units of 16 bits. Then, the checksum calculation unit 103 sends data to the reception packet buffer 104. The reception packet buffer 104 is an area for storing received packet data for one packet, and performs processing to discard data when the reception packet is not a normal packet.

受信パケットバッファ104に格納されたデータが正常なパケットデータである場合には、前記データは、受信バッファ105中のデータバッファ105bへ書き込まれる。   When the data stored in the reception packet buffer 104 is normal packet data, the data is written into the data buffer 105 b in the reception buffer 105.

受信バッファ105は、RAM(ランダムアクセスメモリ)から構成されており、後述のCPU110によって管理されているメモリ領域である。そのため、パケットデータが書き込まれるメモリアドレスはCPU110によって予め指定される。受信バッファ105は、パケットディスクリプタ105a、データバッファ105bによって構成されている。   The reception buffer 105 is composed of a RAM (Random Access Memory), and is a memory area managed by a CPU 110 described later. Therefore, the memory address where the packet data is written is designated in advance by the CPU 110. The reception buffer 105 includes a packet descriptor 105a and a data buffer 105b.

データバッファ105bは、断片化されたメモリ領域の集合体であり、キュー構造となっている。パケットディスクリプタ105aは、データ領域を構成する断片化されたメモリ領域を、チェーンされたキュー構造として管理するための情報を格納する領域であり、より詳細なデータ構造については後述する。   The data buffer 105b is an aggregate of fragmented memory areas and has a queue structure. The packet descriptor 105a is an area for storing information for managing the fragmented memory area constituting the data area as a chained queue structure, and a more detailed data structure will be described later.

TCP(UDP)/IPデフレーマ102において抽出されたIPヘッダ、TCPヘッダデータは、ヘッダ情報解析部106によって、各種ヘッダの内容が解析された後、CPU110で処理される上位プトロコルであるTCPプロトコル制御へ渡される。解析されるヘッダの内容として、IPヘッダにおいては、パケット長、送信先及び送信元IPアドレス、識別子、フラグ、フラグメントオフセット、プロトコル番号、各種オプション等がある。また、解析されるヘッダの内容として、TCPヘッダにおいては、送信先及び送信元ポート番号、シーケンス番号、確認応答番号、コードビット、ウインドウサイズ、チェックサム値、各種オプション情報等がある。   The IP header and TCP header data extracted by the TCP (UDP) / IP deframer 102 are analyzed by the header information analysis unit 106 to the contents of the various headers, and then transferred to the TCP protocol control, which is a higher level protocol processed by the CPU 110. Passed. The contents of the header to be analyzed include a packet length, a transmission destination and a transmission source IP address, an identifier, a flag, a fragment offset, a protocol number, various options, etc. in the IP header. The contents of the header to be analyzed include a transmission destination and transmission source port number, a sequence number, an acknowledgment number, a code bit, a window size, a checksum value, various option information, and the like in the TCP header.

また、ヘッダ情報解析部106においてはIPヘッダのチェックサム値の演算も行い、演算結果がIPヘッダ中に書き込まれているチェックサム値と一致するか否かの検査を行い、検査結果についてもCPU101及び受信パケットバッファ104へ伝える。受信パケットバッファ104ではヘッダチェックサム値の不一致を検出すると受信パケットを破棄する処理を行う。   The header information analysis unit 106 also calculates the checksum value of the IP header, checks whether the calculation result matches the checksum value written in the IP header, and the CPU 101 also checks the check result. To the received packet buffer 104. The reception packet buffer 104 performs processing for discarding the reception packet when the mismatch of the header checksum value is detected.

ヘッダ情報解析部106は、IPヘッダのチェックサム値の計算として、IPヘッダ中のチェックサム領域に0を入れた後、IPヘッダ部を全て16ビット単位で1の補数で足し合わせる。   As the calculation of the checksum value of the IP header, the header information analysis unit 106 puts 0 in the checksum area in the IP header, and then adds up the IP header part by 1's complement in 16-bit units.

106aで示すチェックサム情報は、ヘッダ情報解析部106で解析されたTCPヘッダ情報の一つであり、送信先で計算し埋め込まれたパケットデータのチェックサム値である。また、106bで示すフラグ情報は、ヘッダ情報解析部106で解析されたIPヘッダ情報の一つであり、IPパケットのフラグメント処理を制御する情報(フラグメント制御情報)である。フラグ情報106bには、IPパケットをフラグメントしてもよいか否かを指示するための識別情報が含まれている。また、フラグ情報106bには、このIPパケットがフラグメントされているパケットか否か、またフラグメントされているパケットの場合、最後のフラグメントパケットか途中のフラグメントパケットかを識別する情報が含まれている。   The checksum information 106a is one of TCP header information analyzed by the header information analysis unit 106, and is a checksum value of packet data calculated and embedded at the transmission destination. The flag information 106b is one piece of IP header information analyzed by the header information analysis unit 106, and is information (fragment control information) for controlling fragment processing of an IP packet. The flag information 106b includes identification information for instructing whether or not the IP packet may be fragmented. Further, the flag information 106b includes information for identifying whether or not the IP packet is a fragmented packet, and in the case of a fragmented packet, the flag information 106b identifies whether it is the last fragment packet or an intermediate fragment packet.

フラグメント検査部107は、ヘッダ情報解析部106で解析されたフラグ情報106bを読み出し、IPパケットがフラグメントされたパケットか否かを判定する。また、フラグメント検査部107は、IPパケットがフラグメントされたパケットの場合、最後のフラグメントパケットか途中のフラグメントパケットかを検査する。フラグメント検査部107は、検査結果をCPU110及びセレクタ111へ伝える。   The fragment inspection unit 107 reads the flag information 106b analyzed by the header information analysis unit 106, and determines whether the IP packet is a fragmented packet. In addition, in the case where the IP packet is a fragmented packet, the fragment checking unit 107 checks whether it is the last fragment packet or an intermediate fragment packet. The fragment inspection unit 107 transmits the inspection result to the CPU 110 and the selector 111.

セレクタ111は、パケットが、フラグメントパケットの場合には、チェックサム演算部103で演算されたパケットのチェックサム値をチェックサム値一時記憶部108へ送り、フラグメントパケットでない場合には、チェックサム検査部109へ送る。   When the packet is a fragment packet, the selector 111 sends the checksum value of the packet calculated by the checksum calculation unit 103 to the checksum value temporary storage unit 108, and when the packet is not a fragment packet, the checksum check unit Send to 109.

チェックサム値一時記憶部108は、同一の識別子を持つフラグメントパケットが全て到着するまで、各パケットのチェックサム値を一時的に格納しておくメモリである。全てのパケットの到着が終了したら、記憶されているチェックサム値がCPU110によって読み出され、CPU110によるパケットの再組み立て処理と、チェックサム検査処理とに使用される。   The checksum value temporary storage unit 108 is a memory that temporarily stores the checksum value of each packet until all the fragment packets having the same identifier arrive. When the arrival of all the packets is completed, the stored checksum value is read by the CPU 110 and used for the packet reassembly process and the checksum check process by the CPU 110.

また、チェックサム検査部109は、チェックサム演算部103から送られた演算チェックサム値と、ヘッダ情報解析部106のチェックサム情報106aから送られたチェックサム値とを比較する。そして、チェックサム検査部109は、検査結果(比較結果)をCPU110及び受信パケットバッファ104へ伝える。   Also, the checksum checking unit 109 compares the calculation checksum value sent from the checksum calculation unit 103 with the checksum value sent from the checksum information 106a of the header information analysis unit 106. Then, the checksum inspection unit 109 transmits the inspection result (comparison result) to the CPU 110 and the reception packet buffer 104.

受信パケットバッファ104は、チェックサム値が不一致であることを示す検査結果を受け取ると、保持している受信パケットを破棄する処理を行う。   When receiving a test result indicating that the checksum values do not match, the received packet buffer 104 performs processing to discard the held received packet.

CPU110は、ヘッダ情報解析部106で解析されたIPヘッダ、TCPヘッダの各種情報、フラグメント検査部107の検査結果、チェックサム検査部109の検査結果を受け、これらの情報に基づいて、各種制御を行う。また、CPU110は、チェックサム値一時記憶部108に格納されているチェックサム値等の情報受け、この情報等にも基づいて、各種制御を行う。なお、制御としては、例えば、受信バッファ105中のパケットディスクリプタ105aの制御や、データ領域105bへのデータの読み出し、書き込み制御等がある。また、制御として、受信パケットバッファ104がパケットデータを書き込む際のメモリアドレスの指定制御、フラグメントされたパケットの再組み立て処理制御、上位プロトコルであるTCPプロトコル処理制御等がある。但し、CPU110の制御処理手順等の詳細については後述するフローチャートを使用して説明する。   The CPU 110 receives various information of the IP header and TCP header analyzed by the header information analysis unit 106, the inspection result of the fragment inspection unit 107, and the inspection result of the checksum inspection unit 109, and performs various controls based on these information. Do. In addition, the CPU 110 receives information such as a checksum value stored in the checksum value temporary storage unit 108, and performs various controls based on this information and the like. The control includes, for example, control of the packet descriptor 105a in the reception buffer 105, control of reading and writing data to the data area 105b, and the like. The control includes memory address designation control when the reception packet buffer 104 writes packet data, fragmented packet reassembly processing control, TCP protocol processing control that is a higher level protocol, and the like. However, details of the control processing procedure of the CPU 110 will be described with reference to a flowchart described later.

図5は、受信バッファ105の詳細なデータ構造を説明するための図である。なお、図5では、ある一つのパケットデータが受信バッファ105に格納されている場合のデータ構造を表している。   FIG. 5 is a diagram for explaining a detailed data structure of the reception buffer 105. FIG. 5 shows a data structure in the case where a single packet data is stored in the reception buffer 105.

図5において、501、502は105aで示されたパケットディスクリプタ、503、504は105bで示されたデータバッファである。データバッファ105bは、メモリ領域がある大きさの単位ごとに分割されており、受信バッファ105は、これら複数の分割領域の関連付けをパケットディスクリプタ105a中に記述されているデータによって管理するキュー構造となっている。   In FIG. 5, 501 and 502 are packet descriptors indicated by 105a, and 503 and 504 are data buffers indicated by 105b. The data buffer 105b is divided into units of a certain size, and the reception buffer 105 has a queue structure that manages the association of the plurality of divided areas with the data described in the packet descriptor 105a. ing.

501には、p_next1(501a)、p_data1(501b)、len1(501c)、pktlen1(501d)、p_buf1(501e)、size1(501f)、その他の情報1(501g)等のデータがそれぞれ含まれている。同様に、502には、p_next2(502a)、p_data2(502b)、len2(502c)、pktlen2(502d)、p_buf2(502e)、size2(502f)、その他の情報2(502g)等のデータがそれぞれ含まれている。   501 includes data such as p_next1 (501a), p_data1 (501b), len1 (501c), pktlen1 (501d), p_buf1 (501e), size1 (501f), and other information 1 (501g). . Similarly, 502 includes data such as p_next2 (502a), p_data2 (502b), len2 (502c), pktlen2 (502d), p_buf2 (502e), size2 (502f), and other information 2 (502g). It is.

また、503にはheader1(503a)、data1(503b)、504にはdata2(504a)がそれぞれ含まれており、これら503、504はそれぞれパケットデータを格納する分割領域の一つである。   Reference numeral 503 includes header1 (503a), data1 (503b), and 504 includes data2 (504a). These 503 and 504 are each one of divided areas for storing packet data.

503はパケットデータの先頭ブロックが格納されているデータバッファとして、503aで示すTCPヘッダ及びIPヘッダのデータ、及び503bで示すペイロードデータが含まれている。また504はパケットデータの続きのブロックが格納されているデータバッファであり、504a出示す続きのペイロードデータが含まれている。   Reference numeral 503 denotes a data buffer in which the first block of packet data is stored, and includes TCP header and IP header data indicated by 503a and payload data indicated by 503b. Reference numeral 504 denotes a data buffer in which subsequent blocks of packet data are stored, and includes subsequent payload data shown in 504a.

なお、図5では、一つのパケットが複数のデータバッファ(503,504)に分割して格納されている例を示しているが、通常は一つのパケットは一つのデータバッファに収められる場合が多い。但し、フラグメントされたパケットを受信した場合には、それぞれの分割パケットは異なる時間に到着するために、到着ごとに分割したブロックに格納して管理される。   FIG. 5 shows an example in which one packet is divided and stored in a plurality of data buffers (503, 504). Usually, one packet is often stored in one data buffer. . However, when a fragmented packet is received, since each divided packet arrives at a different time, it is stored and managed in a block divided for each arrival.

次に、パケットディスクリプタ501には、データバッファ503や、パケットデータ503a、503bに関連する各種情報及びパケットディスクリプタのキュー構造管理のための情報等が格納されている。   Next, the packet descriptor 501 stores data buffer 503, various information related to the packet data 503a and 503b, information for managing the queue structure of the packet descriptor, and the like.

p_next1(501a)は、次のブロックのパケットディスクリプタが存在する場合に次のパケットディスクリプタの先頭アドレスを示すポインタ情報であり、図5の例では502の領域の先頭アドレスが格納されている。次のパケットディスクリプタが存在しない、つまり、最後のブロックに対するパケットディスクリプタの場合は、NULLが格納される。   p_next1 (501a) is pointer information indicating the start address of the next packet descriptor when the packet descriptor of the next block exists. In the example of FIG. 5, the start address of the area 502 is stored. If there is no next packet descriptor, that is, a packet descriptor for the last block, NULL is stored.

p_data(501b)には、データバッファにおいて、このパケットディスクリプタの対象となるデータバッファ503において、実際に格納されているパケットデータ503a、503bの先頭を示すポインタであるアドレスが格納されている。またlen1(501c)には、パケットデータ503a、503bを合わせたデータ長が格納されている。pktlen1(501d)にはパケット全体のデータ長、つまり、503a、503b、504aの合計サイズが格納されている。この合計サイズは一つのパケットが複数ブロックで構成される場合には、先頭ブロックのパケットディスクリプタにのみ格納されるものである。   In the data buffer, p_data (501b) stores an address which is a pointer indicating the head of the packet data 503a and 503b actually stored in the data buffer 503 that is the target of the packet descriptor. In len1 (501c), the combined data length of the packet data 503a and 503b is stored. pktlen1 (501d) stores the data length of the entire packet, that is, the total size of 503a, 503b, and 504a. This total size is stored only in the packet descriptor of the first block when one packet is composed of a plurality of blocks.

次にp_buf1(501e)には、データバッファにおいて、このパケットディスクリプタの対象となるデータバッファ503の先頭を示すポインタであるアドレスが格納されている。またsize1(501f)には、データバッファ503のサイズが格納されている。   Next, p_buf1 (501e) stores an address which is a pointer indicating the head of the data buffer 503 to be the target of the packet descriptor in the data buffer. The size of the data buffer 503 is stored in size1 (501f).

その他の情報1(501g)には、その他パケットデータを管理するための情報、例えばデータバッファが複数の分割サイズをもって管理される場合にはそのブロックタイプ、次の識別子を持つパケットへのポインタ情報等が格納されている。   Other information 1 (501g) includes information for managing other packet data, for example, when the data buffer is managed with a plurality of division sizes, its block type, pointer information to a packet having the next identifier, etc. Is stored.

パケットディスクリプタ502には、データバッファ504や、パケットデータ504aに関連する各種情報及びパケットディスクリプタのキュー構造管理のための情報等が格納されている。   The packet descriptor 502 stores various information related to the data buffer 504 and packet data 504a, information for managing the queue structure of the packet descriptor, and the like.

502に格納されている情報の構成は501で説明した構成と同様であるが、pktlen2(502d)に示されるパケット全体のデータ長の情報は、502がパケットの先頭ブロックのパケットディスクリプタではないので、NULLが格納される。   The configuration of information stored in 502 is the same as the configuration described in 501, but the information on the data length of the entire packet indicated in pktlen2 (502d) is that 502 is not the packet descriptor of the first block of the packet. NULL is stored.

図6は、実施形態1のCPU110が実行するソフトウェアの制御を示すフローチャートである。なお、CPU110は、図6に示す処理を常に繰り返し、実行している。   FIG. 6 is a flowchart illustrating control of software executed by the CPU 110 according to the first embodiment. The CPU 110 always repeats and executes the process shown in FIG.

ステップS601において、CPU110は、パケットが受信されるのを待つ処理を行う。ステップS602において、CPU110は、パケットを受信したか否かを判定する。CPU110は、パケットを受信したと判定すると、ステップS603に進み、パケットを受信していないと判定すると、ステップS602の処理を繰り返す。   In step S601, the CPU 110 performs a process of waiting for a packet to be received. In step S602, CPU 110 determines whether a packet has been received. If CPU 110 determines that a packet has been received, the process proceeds to step S603. If CPU 110 determines that a packet has not been received, CPU 110 repeats the process of step S602.

ステップS603において、CPU110は、ヘッダ情報解析部106において算出されたパケットのIPヘッダのチェックサム検査結果(演算チェックサム値)を取得する。ステップS604において、CPU110は、ステップS603において取得した演算チェックサム値と、パケットのIPヘッダ中のチェックサム値とを比較して、受信したパケットが正常なパケットか否かを判定する。   In step S <b> 603, the CPU 110 acquires the checksum check result (calculation checksum value) of the IP header of the packet calculated by the header information analysis unit 106. In step S604, the CPU 110 compares the operation checksum value acquired in step S603 with the checksum value in the IP header of the packet to determine whether the received packet is a normal packet.

つまり、CPU110は、ステップS603において取得した演算チェックサム値と、パケットのIPヘッダ中のチェックサム値とが一致する場合は、正常なパケットであると判定し、ステップS605に進む。一方、CPU110は、ステップS603において取得した演算チェックサム値と、パケットのIPヘッダ中のチェックサム値とが一致しない場合は、正常なパケットでないと判定し、受信パケットバッファ104中に格納されたパケットデータを破棄する。そして、CPU110は、図6に示す処理を終了する。   That is, if the calculated checksum value acquired in step S603 matches the checksum value in the IP header of the packet, the CPU 110 determines that the packet is a normal packet and proceeds to step S605. On the other hand, if the calculated checksum value acquired in step S603 does not match the checksum value in the IP header of the packet, the CPU 110 determines that the packet is not a normal packet and stores the packet stored in the received packet buffer 104. Discard the data. Then, the CPU 110 ends the process shown in FIG.

ステップS605において、CPU110は、受信バッファ105のデータバッファ105b中に受信パケット用のデータバッファを確保する。そして、CPU110は、このデータバッファを受信パケットバッファ104からの書き込み用に割り当てる処理、及びこのデータバッファを管理する等のためのパケットディスクリプタ105aを生成する処理を行う。これらのデータバッファ、パケットディスクリプタは図5で説明したようなキュー構造で管理されるものである。   In step S605, the CPU 110 secures a data buffer for the received packet in the data buffer 105b of the reception buffer 105. The CPU 110 performs processing for assigning the data buffer for writing from the reception packet buffer 104 and processing for generating a packet descriptor 105a for managing the data buffer. These data buffers and packet descriptors are managed in the queue structure as described with reference to FIG.

続いて、ステップS606において、CPU110は、ヘッダ情報解析部106より、TCPヘッダに埋め込まれているチェックサム値等を含むパケットヘッダ情報を取得する。なお、このチェックサム値は、後述するチェックサム検査処理、或いはTCP制御等の上位プロトコル処理において利用される。   In step S606, the CPU 110 acquires packet header information including a checksum value embedded in the TCP header from the header information analysis unit 106. This checksum value is used in a checksum check process, which will be described later, or an upper protocol process such as TCP control.

続いて、ステップS607において、CPU110は、フラグメント検査部107より、検査結果、つまり、受信したIPパケットがフラグメントされているパケット(IPフラグメントパケット)か否かの情報を取得する。   Subsequently, in step S607, the CPU 110 acquires from the fragment inspection unit 107 information on the inspection result, that is, whether the received IP packet is a fragmented packet (IP fragment packet).

続いて、ステップS608において、CPU110は、ステップS607において取得した検査結果に基づいて、受信したIPパケットがIPフラグメントパケットか否かを判定する。CPU110は、受信したIPパケットがIPフラグメントパケットであると判定すると、ステップS614に進み、受信したIPパケットがIPフラグメントパケットでないと判定すると、ステップS609に進む。   Subsequently, in step S608, CPU 110 determines whether or not the received IP packet is an IP fragment packet based on the inspection result acquired in step S607. If the CPU 110 determines that the received IP packet is an IP fragment packet, the process proceeds to step S614. If the CPU 110 determines that the received IP packet is not an IP fragment packet, the process proceeds to step S609.

ステップS609において、CPU110は、チェックサム検査部109より、TCPパケットのチェックサムの検査結果を取得する。ここで、TCPパケットのチェックサムの検索結果とは、チェックサム演算部103で計算されたTCPパケットのチェックサム値と、ヘッダ情報解析部106でTCPヘッダから読み出されたチェックサム値とが一致するか否かの情報である。   In step S <b> 609, the CPU 110 acquires the checksum check result of the TCP packet from the checksum checker 109. Here, the check result of the TCP packet checksum matches the checksum value of the TCP packet calculated by the checksum calculation unit 103 and the checksum value read from the TCP header by the header information analysis unit 106. It is information on whether or not to do.

ステップS610において、CPU110は、ステップS609において取得したTCPパケットのチェックサムの検査結果に基づいて、正常なパケットか否かを判定する。CPU110は、正常なパケットであると判定すると、ステップS611に進み、正常なパケットでないと判定すると、ステップS613に進む。CPU110は、チェックサム演算部103で計算されたTCPパケットのチェックサム値と、ヘッダ情報解析部106でTCPヘッダから読み出されたチェックサム値とが一致していると、正常なパケットであると判定する。一方、CPU110は、チェックサム演算部103で計算されたTCPパケットのチェックサム値と、ヘッダ情報解析部106でTCPヘッダから読み出されたチェックサム値とが一致していないと、正常なパケットでないと判定する。   In step S610, the CPU 110 determines whether the packet is a normal packet based on the check result of the checksum of the TCP packet acquired in step S609. If the CPU 110 determines that the packet is a normal packet, the process proceeds to step S611. If the CPU 110 determines that the packet is not a normal packet, the process proceeds to step S613. The CPU 110 determines that the packet is a normal packet if the checksum value of the TCP packet calculated by the checksum calculation unit 103 matches the checksum value read from the TCP header by the header information analysis unit 106. judge. On the other hand, if the checksum value of the TCP packet calculated by the checksum calculation unit 103 does not match the checksum value read from the TCP header by the header information analysis unit 106, the CPU 110 is not a normal packet. Is determined.

受信パケットバッファ104中に格納されたパケットデータが破棄されるのに伴い、ステップS613において、CPU110は、ステップS605で受信パケット用に確保した受信バッファ105中のデータバッファやパケットディスクリプタをメモリ開放する。   As the packet data stored in the reception packet buffer 104 is discarded, in step S613, the CPU 110 releases the data buffer and packet descriptor in the reception buffer 105 reserved for the reception packet in step S605.

ステップS611において、CPU110は、受信バッファ105のコントロール処理を実行する。このコントロール処理は、受信バッファ105中のメモリブロックに書き込まれたパケットデータに対応して、パケットディスクリプタ中の各項目に数値を書き込む処理である。なお、この数値とは、受信したパケットのサイズや、メモリブロック中のアドレス、ヘッダ情報を参照して取得したパケット全体のデータ長等の情報、更に次のパケットのディスクリプタへのポインタアドレス等である。   In step S611, the CPU 110 executes control processing for the reception buffer 105. This control process is a process of writing a numerical value to each item in the packet descriptor corresponding to the packet data written in the memory block in the reception buffer 105. The numerical value is the size of the received packet, the address in the memory block, the information such as the data length of the entire packet obtained by referring to the header information, and the pointer address to the descriptor of the next packet. .

続いて、ステップS612において、CPU110は、上位プロトコルであるTCPの制御処理を実行する。TCPの制御処理の詳細な説明は割愛するが、コネクション管理、フロー制御、輻輳制御等が含まれる。   Subsequently, in step S612, the CPU 110 executes control processing for TCP, which is a higher level protocol. A detailed description of TCP control processing is omitted, but includes connection management, flow control, congestion control, and the like.

一方、ステップS614において、CPU110は、全てのフラグメントパケットが到着したか否か判定する。CPU110は、同一の識別子を持つIPパケットのフラグ304、及びフラグメントオフセット305に基づいて、全てのフラグメントパケットが到着したか否か判定する。   On the other hand, in step S614, the CPU 110 determines whether all the fragment packets have arrived. The CPU 110 determines whether all the fragment packets have arrived based on the flag 304 of the IP packet having the same identifier and the fragment offset 305.

CPU110は、全てのフラグメントパケットが到着したと判定すると、ステップS615に進み、全てのフラグメントパケットが到着していないと判定すると、ステップS619に進む。   If the CPU 110 determines that all fragment packets have arrived, the process proceeds to step S615. If the CPU 110 determines that all fragment packets have not arrived, the process proceeds to step S619.

ステップS619において、CPU110は、ステップS611と同様に、受信バッファ105のコントロール処理として、受信したパケットのサイズや、メモリブロック中のアドレスの書き込みを行う。また、CPU110は、先頭ブロックの受信の場合は、パケット全体のデータ長の書き込み、次のパケットのディスクリプタへのポインタアドレスの書き込み等を実行する。   In step S619, the CPU 110 writes the size of the received packet and the address in the memory block as control processing of the reception buffer 105, as in step S611. Further, when receiving the first block, the CPU 110 writes the data length of the entire packet, writes the pointer address to the descriptor of the next packet, and the like.

この受信バッファ105のコントロール処理をフラグメントパケットが到着する度に実行することにより、各データバッファ105bに格納されたフラグメントパケットを連続したデータとして扱うことができ、パケットの再組み立て処理を実行することができる。   By executing the control process of the reception buffer 105 each time a fragment packet arrives, the fragment packet stored in each data buffer 105b can be handled as continuous data, and the packet reassembly process can be executed. it can.

ステップS615において、CPU110は、チェックサム値一時記憶部108に記憶されている全てのパケットの演算チェックサム値を加算する処理を行う。この加算処理により再組み立て処理されたパケットのチェックサム値(データチェックサム)を求めることができる。   In step S615, the CPU 110 performs a process of adding the operation checksum values of all packets stored in the checksum value temporary storage unit 108. The checksum value (data checksum) of the reassembled packet can be obtained by this addition processing.

続いて、ステップS616において、CPU110は、ステップS615において求めた再組み立て処理されたパケットのチェックサム値と、TCPヘッダ中のチェックサム値と、を比較し、一致するか否かを判定する。CPU110は、ステップS615において求めた再組み立て処理されたパケットのチェックサム値と、TCPヘッダ中のチェックサム値と、が一致すると判定すると、ステップS611に進む。一方、CPU110は、ステップS615において求めた再組み立て処理されたパケットのチェックサム値と、TCPヘッダ中のチェックサム値と、が一致しないと判定すると、ステップS618に進む。   Subsequently, in step S616, the CPU 110 compares the checksum value of the reassembled packet obtained in step S615 with the checksum value in the TCP header, and determines whether or not they match. If the CPU 110 determines that the checksum value of the reassembled packet obtained in step S615 matches the checksum value in the TCP header, the process proceeds to step S611. On the other hand, if CPU 110 determines that the checksum value of the reassembled packet obtained in step S615 does not match the checksum value in the TCP header, the process proceeds to step S618.

ステップS618において、CPU110は、ステップS613と同様に、ステップS605で受信パケット用に確保した受信バッファ105中のデータバッファやパケットディスクリプタをメモリ開放する。   In step S618, as in step S613, the CPU 110 releases the data buffer and packet descriptor in the reception buffer 105 reserved for the reception packet in step S605.

(実施形態2)
実施形態1では、フラグメントされたパケットを検出した場合には、常にその再組み立て処理をCPU110で実行する例を用いて説明を行った。しかしながら、TCP/IPを用いたネットワークプロトコルにおいては、フラグメントされたパケットの到着順序は保証されていないが、送信されたパケットが複雑なネットワーク経路を通らなければ比較的先頭パケットから順番に到着する場合が多い。
(Embodiment 2)
In the first embodiment, when a fragmented packet is detected, the reassembly process is always executed by the CPU 110. However, in the network protocol using TCP / IP, the arrival order of fragmented packets is not guaranteed. However, if the transmitted packets do not pass through a complicated network path, they will arrive in order from the first packet. There are many.

フラグメントされたパケットを先頭から順次受信する場合においては、受信データをメモリ上に連続的に書き込むことができるため、この書き込み処理においては複雑なメモリ管理は必要なく、単純なアドレスのインクリメントだけでよい。よって、回路規模も大きくなることはない。   When sequentially receiving fragmented packets from the beginning, the received data can be written continuously into the memory, so this memory processing does not require complicated memory management and only a simple address increment is required. . Therefore, the circuit scale does not increase.

従って、実施形態2においては、フラグメントされたパケットを受信した場合にも、そのパケットが先頭ブロックから順番に到着している間は、ハードウェアにより自動的に受信バッファメモリに書き込む制御を行う。そして、到着順序が入れ替わったことを検出した時点で再組み立て処理をCPU100によって行う例を説明する。   Therefore, in the second embodiment, even when a fragmented packet is received, control is performed to automatically write to the reception buffer memory by hardware while the packet arrives in order from the first block. An example in which the CPU 100 performs the reassembly process when it is detected that the arrival order has been changed will be described.

図7は、実施形態2に係る装置の全体構成を表すブロック図である。実施形態2においても、ネットワークの物理層、データリンク層としてIEEE802.3に代表される有線LANの規格であるイーサネット(登録商標)を用いて説明する。また、ネットワーク層、トランスポート層としてTCP/IPプロトコルを用いて説明する。   FIG. 7 is a block diagram illustrating the overall configuration of the apparatus according to the second embodiment. Also in the second embodiment, description will be made using Ethernet (registered trademark), which is a standard of wired LAN represented by IEEE 802.3, as a physical layer and a data link layer of a network. Further, description will be made using the TCP / IP protocol as a network layer and a transport layer.

図7において、101のMAC(メディアアクセスコントロール)、102のTCP(UDP)/IPデフレーマは実施形態1と同様の制御を行う。TCP(UDP)/IPデフレーマ102によって抽出されたヘッダデータは、ヘッダ情報解析部106へ送られ、またパケットデータは、チェックサム演算部103へ送られる。ヘッダ情報解析部106、チェックサム演算部103もそれぞれ実施形態1と同様の制御を行う。   In FIG. 7, a MAC (Media Access Control) 101 and a TCP (UDP) / IP deframer 102 perform the same control as in the first embodiment. The header data extracted by the TCP (UDP) / IP deframer 102 is sent to the header information analysis unit 106, and the packet data is sent to the checksum calculation unit 103. The header information analysis unit 106 and the checksum calculation unit 103 also perform the same control as in the first embodiment.

受信パケットバッファ104及び受信バッファ105も実施形態1と同様にパケットデータを格納するメモリであり、受信バッファ105は図5で説明したようなキュー構造として管理されている。   The reception packet buffer 104 and the reception buffer 105 are also memories for storing packet data as in the first embodiment, and the reception buffer 105 is managed as a queue structure as described with reference to FIG.

TCP(UDP)/IPデフレーマ102において抽出されたIPヘッダ、TCPヘッダデータは、ヘッダ情報解析部106によって、各種ヘッダの内容が解析された後、CPU110で処理される上位プトロコルであるTCPプロトコル制御へ渡される。実施形態2におけるCPU110の処理手順等については後述のフローチャートで詳細に説明する。   The IP header and TCP header data extracted by the TCP (UDP) / IP deframer 102 are analyzed by the header information analysis unit 106 to the contents of the various headers, and then transferred to the TCP protocol control, which is a higher level protocol processed by the CPU 110. Passed. A processing procedure and the like of the CPU 110 in the second embodiment will be described in detail with reference to a flowchart described later.

フラグメント検査部707は、ヘッダ情報解析部106で解析されたフラグ情報106bを読み出し、IPパケットがフラグメントされたパケットか否かを判定する。また、フラグメント検査部707は、IPパケットがフラグメントされたパケットの場合、最後のフラグメントパケットか、途中のフラグメントパケットかを検査する。また、フラグメント検査部707は、IPパケットがフラグメントされたパケットの場合、フラグメントパケットが先頭から連続した順序で到着したフラグメントパケットか否か、連続した順序で到着していた場合、最後のフラグメントパケットか否かを検査する。フラグメント検査部707は、これらの検査結果をCPU110、又はセレクタ711へ伝える。   The fragment inspection unit 707 reads the flag information 106b analyzed by the header information analysis unit 106, and determines whether or not the IP packet is a fragmented packet. In addition, when the IP packet is a fragmented packet, the fragment inspection unit 707 inspects whether it is the last fragment packet or an intermediate fragment packet. In addition, the fragment inspection unit 707 determines whether the IP packet is a fragmented packet, whether the fragment packet has arrived in a sequential order from the beginning, and if the IP packet has arrived in a continuous order, determines whether it is the last fragment packet. Check for no. The fragment inspection unit 707 transmits these inspection results to the CPU 110 or the selector 711.

セレクタ711は、IPパケットが不連続に到着したフラグメントパケットであると判断された場合には、チェックサム演算部103において演算されたパケットのチェックサム値をチェックサム値一時記憶部708へ送る。また、セレクタ711は、IPパケットがフラグメントパケットでないと判断された場合には、チェックサム演算部103において演算されたパケットのチェックサム値を、セレクタ713を介してチェックサム検査部709へ送る。   When it is determined that the IP packet is a fragment packet that has arrived discontinuously, the selector 711 sends the checksum value of the packet calculated by the checksum calculation unit 103 to the checksum value temporary storage unit 708. When the selector 711 determines that the IP packet is not a fragment packet, the selector 711 sends the checksum value of the packet calculated by the checksum calculation unit 103 to the checksum check unit 709 via the selector 713.

また、セレクタ711は、先頭から連続した順序で到着したフラグメントパケットであると判断された場合には、チェックサム演算部103において演算されたパケットのチェックサム値をチェックサム加算部712へ送る。   If the selector 711 determines that the fragment packet has arrived in a sequential order from the beginning, the selector 711 sends the checksum value of the packet calculated by the checksum calculation unit 103 to the checksum addition unit 712.

チェックサム値一時記憶部708は、同一の識別子を持つフラグメントパケットが全て到着するまで、各パケットのチェックサム値を一時的に格納しておくメモリである。全てのパケットの到着が終了したら、記憶されているチェックサム値がCPU110によって読み出され、CPU110によるパケットの再組み立て処理と、チェックサム検査処理とに使用される。   The checksum value temporary storage unit 708 is a memory that temporarily stores the checksum value of each packet until all fragment packets having the same identifier arrive. When the arrival of all the packets is completed, the stored checksum value is read by the CPU 110 and used for the packet reassembly process and the checksum check process by the CPU 110.

連続したフラグメントパケットを受信した場合、チェックサム加算部712は、チェックサム値一時記憶部708に格納されているチェックサム値の内、同一の識別子を持つフラグメントパケットのチェックサム値を読み出す。そして、チェックサム加算部712は、チェックサム値を加算した後、再びチェックサム値一時記憶部708に書き込む制御を行う。つまり、連続したフラグメントパケットを受信している間は、これまで到着した同一識別子のパケットのチェックサム値の総和がチェックサム値一時記憶部708に記憶される。   When receiving successive fragment packets, the checksum adding unit 712 reads the checksum value of the fragment packet having the same identifier among the checksum values stored in the checksum value temporary storage unit 708. Then, the checksum adding unit 712 performs the control of adding the checksum value and then writing the checksum value temporarily storage unit 708 again. In other words, while receiving successive fragment packets, the sum of checksum values of packets having the same identifier that have arrived so far is stored in the checksum value temporary storage unit 708.

また、フラグメント検査部707において、連続したフラグメントパケットとして到着したパケットの内、最後のパケットであると検出された場合、セレクタ711は、その検出結果をセレクタ713に伝える。セレクタ713は、前記検出結果を受け取ると、チェックサム値一時記憶部708に格納されているチェックサム値をチェックサム検査部709に送り出す。また、セレクタ713は、前記検出結果以外の検出結果(又は前記検出結果以外の制御信号)を受け取ると、チェックサム演算部103で計算されたチェックサム値をチェックサム検査部709に送り出す。   Further, when the fragment inspection unit 707 detects that the packet is the last of the packets that have arrived as continuous fragment packets, the selector 711 informs the selector 713 of the detection result. Upon receiving the detection result, the selector 713 sends the checksum value stored in the checksum value temporary storage unit 708 to the checksum check unit 709. When the selector 713 receives a detection result other than the detection result (or a control signal other than the detection result), the selector 713 sends the checksum value calculated by the checksum calculation unit 103 to the checksum checking unit 709.

このような処理によって、チェックサム値一時記憶部708から送り出されるチェックサム値は、最終的にパケット全体のチェックサム値となり、このチェックサム値に対してチェックサム検査が行われる。   By such processing, the checksum value sent out from the checksum value temporary storage unit 708 finally becomes the checksum value of the entire packet, and the checksum check is performed on this checksum value.

フラグメント検査部707において、フラグメントされていないパケットであると判断された場合には、上述したようにチェックサム演算部103で演算されたチェックサム値がチェックサム検査部709に送られる。   When the fragment checking unit 707 determines that the packet is not fragmented, the checksum value calculated by the checksum calculating unit 103 is sent to the checksum checking unit 709 as described above.

チェックサム検査部709は、チェックサム演算部103から送られたチェックサム値と、ヘッダ情報解析部106のチェックサム情報106aから送られたチェックサム値とを比較し、検査結果をCPU110及び受信パケットバッファ104へ伝える。   The checksum checker 709 compares the checksum value sent from the checksum calculator 103 with the checksum value sent from the checksum information 106a of the header information analyzer 106, and compares the check result with the CPU 110 and the received packet. Tell the buffer 104.

受信パケットバッファ104はチェックサム値の不一致を検出すると受信パケットを破棄する処理を行う。   The reception packet buffer 104 performs processing for discarding the reception packet when the checksum value mismatch is detected.

CPU110は、ヘッダ情報解析部106で解析されたIPヘッダ、TCPヘッダの各種情報、フラグメント検査部707の検査結果、チェックサム検査部709の検査結果を受け、これらの情報に基づいて、各種制御を行う。また、CPU110は、チェックサム値一時記憶部708に格納されているチェックサム値等の情報受け、この情報等にも基づいて、各種制御を行う。なお、制御としては、例えば、受信バッファ105中のパケットディスクリプタ105aの制御や、データ領域105bへのデータの読み出し、書き込み制御等がある。また、制御として、受信パケットバッファ104がパケットデータを書き込む際のメモリアドレスの指定制御、フラグメントされたパケットの再組み立て処理制御、上位プロトコルであるTCPプロトコル処理制御等がある。但し、CPU110の制御処理手順等の詳細については後述するフローチャートを使用して説明する。   The CPU 110 receives various information of the IP header and TCP header analyzed by the header information analysis unit 106, the inspection result of the fragment inspection unit 707, and the inspection result of the checksum inspection unit 709, and performs various controls based on these information. Do. Further, the CPU 110 receives information such as a checksum value stored in the checksum value temporary storage unit 708, and performs various controls based on this information and the like. The control includes, for example, control of the packet descriptor 105a in the reception buffer 105, control of reading and writing data to the data area 105b, and the like. The control includes memory address designation control when the reception packet buffer 104 writes packet data, fragmented packet reassembly processing control, TCP protocol processing control that is a higher level protocol, and the like. However, details of the control processing procedure of the CPU 110 will be described with reference to a flowchart described later.

図8は、連続したフラグメントパケットを受信した場合に、データバッファ105b中のメモリブロックに書き込まれるデータの構造を示す図である。図8において、801はヘッダデータ部でありIPヘッダ情報が格納されている。802は、フラグメントされた最初のデータ部であり、TCPヘッダ等の上位プロトコルのヘッダ及びペイロードの一部が含まれる。801のデータと、802のデータとを合わせた部分が先頭のフラグメントパケットとして受信される。   FIG. 8 is a diagram showing the structure of data written to the memory block in the data buffer 105b when successive fragment packets are received. In FIG. 8, reference numeral 801 denotes a header data portion in which IP header information is stored. Reference numeral 802 denotes a fragmented initial data portion, which includes a header of a higher protocol such as a TCP header and a part of the payload. A portion obtained by combining the data 801 and the data 802 is received as the first fragment packet.

803は2番目のデータ部、804は3番目のデータ部を表わしており、803のデータと、804のデータとをそれぞれ受信する度に前のデータの後ろに追加されてデータバッファ105b中のメモリブロックに書き込まれる。   Reference numeral 803 denotes a second data portion, and 804 denotes a third data portion. Each time the data 803 and the data 804 are received, the data is added after the previous data and stored in the memory in the data buffer 105b. Written to the block.

図9は、実施形態2のCPU110が実行するソフトウェアの制御を示すフローチャートである。なお、CPU110は、図9に示す処理を常に繰り返し、実行している。   FIG. 9 is a flowchart illustrating control of software executed by the CPU 110 according to the second embodiment. The CPU 110 always repeats and executes the process shown in FIG.

ステップS901からステップS907までの処理は、実施形態1の図6に示したステップS601からステップS607までの処理と同様である。   The processing from step S901 to step S907 is the same as the processing from step S601 to step S607 shown in FIG. 6 of the first embodiment.

ステップS908において、CPU110は、ステップS907において取得した検査結果に基づいて、受信したIPパケットがIPフラグメントパケットか否かを判定する。CPU110は、受信したIPパケットがIPフラグメントパケットであると判定すると、ステップS920に進み、受信したIPパケットがIPフラグメントパケットでないと判定すると、ステップS909に進む。   In step S908, the CPU 110 determines whether the received IP packet is an IP fragment packet based on the inspection result acquired in step S907. If the CPU 110 determines that the received IP packet is an IP fragment packet, the process proceeds to step S920. If the CPU 110 determines that the received IP packet is not an IP fragment packet, the process proceeds to step S909.

ステップS909からステップS913までの処理は、実施形態1の図6に示したステップS609からステップS613までの処理と同様である。   The processing from step S909 to step S913 is the same as the processing from step S609 to step S613 shown in FIG. 6 of the first embodiment.

ステップS920において、CPU110は、ハードウェアによる再組み立て制御を行っているパケットデータか否か、つまり、連続して到着しているフラグメントパケットか否かを判定する。CPU110は、ハードウェアによる再組み立て制御を行っているパケットデータであると判定すると、ステップS921に進み、ハードウェアによる再組み立て制御を行っているパケットデータでないと判定すると、ステップS914に進む。   In step S920, the CPU 110 determines whether or not the packet data is being subjected to hardware reassembly control, that is, whether or not it is a continuously arriving fragment packet. If the CPU 110 determines that the packet data is subjected to hardware reassembly control, the process proceeds to step S921. If the CPU 110 determines that the packet data is not subjected to hardware reassembly control, the process proceeds to step S914.

ステップS921において、CPU110は、再組み立てが終了しているか否か、つまり、同一識別子パケットの最後のデータを受信して完成したパケットデータとして図8に示されるようなメモリブロックに書き込まれているパケットか否かを判定する。CPU110は、再組み立てが終了していると判定すると、ステップS909に進み、再組み立てが終了していないと判定すると、ステップS922に進む。CPU110は、フラグメント検査部707より出力された検査結果等に基づいて再組み立てが終了しているか否かを判定する。   In step S921, the CPU 110 determines whether or not the reassembly has been completed, that is, the packet written in the memory block as shown in FIG. 8 as the packet data completed by receiving the last data of the same identifier packet. It is determined whether or not. If the CPU 110 determines that the reassembly is complete, the process proceeds to step S909. If the CPU 110 determines that the reassembly is not complete, the process proceeds to step S922. The CPU 110 determines whether the reassembly has been completed based on the inspection result output from the fragment inspection unit 707 or the like.

ステップS922において、CPU110は、CPU110は、受信バッファ105のコントロール処理として、パケットのサイズやメモリブロック中のアドレスの更新処理を実行する。   In step S922, the CPU 110 executes update processing of the packet size and the address in the memory block as control processing of the reception buffer 105.

ステップS914からステップS919までの処理は、実施形態1の図6に示したステップS614からステップS619までの処理と同様である。   The processing from step S914 to step S919 is the same as the processing from step S614 to step S619 shown in FIG. 6 of the first embodiment.

(実施形態3)
上述した実施形態では、全てのフラグメントパケットに重複領域がない場合を例に説明を行った。このような場合では、CPU110が処理するチェックサム演算は、チェックサム値一時記憶部108に記憶されている各フラグメントパケットのチェックサム値を加算するだけで、再組み立てされたパケット全体のチェックサム値を求めることができた。
(Embodiment 3)
In the above-described embodiment, the case where there is no overlapping area in all fragment packets has been described as an example. In such a case, the checksum operation processed by the CPU 110 simply adds the checksum value of each fragment packet stored in the checksum value temporary storage unit 108, and the checksum value of the entire reassembled packet. I was able to ask.

しかしながら、複数のセグメントにまたがるネットワークにおいては、同じ識別子のフラグメントパケットが別の経路を経由し、装置に到着する場合や、再送によって同一のペイロードデータが異なるサイズのフラグメントパケットとして生成される場合も存在する。その結果、重複領域を持ったフラグメントパケットが装置に到着することになり、フラグメントパケットごとのチェックサム値を単純に加算するだけではパケット全体のチェックサム値を求めることができない場合も出てくる。   However, in a network spanning multiple segments, fragment packets with the same identifier may arrive at the device via different routes, or the same payload data may be generated as different size fragment packets by retransmission. To do. As a result, a fragment packet having an overlapping area arrives at the apparatus, and there may be a case where the checksum value of the entire packet cannot be obtained by simply adding the checksum value for each fragment packet.

実施形態3では、重複領域が存在するフラグメントパケットを受信した場合でも、CPU110において、チェックサム値の全ての再計算を行わないですむよう、処理を行う例を説明する。このような処理を行うことで、高速にチェックサム検査を行うことができる。   In the third embodiment, an example will be described in which processing is performed so that the CPU 110 does not have to recalculate all checksum values even when a fragment packet having an overlapping area is received. By performing such processing, a checksum check can be performed at high speed.

図10は、再送処理によって重複が発生しているフラグメントパケットの構成例を示す図である。図10において、1001aは送信時における元のパケットデータにおけるIPヘッダ部、1001bはペイロード部を表わしている。   FIG. 10 is a diagram illustrating a configuration example of fragment packets in which duplication occurs due to retransmission processing. In FIG. 10, 1001a represents the IP header portion in the original packet data at the time of transmission, and 1001b represents the payload portion.

また、1002a、1002b、1003a、1003b、1004a、1004bはそれぞれ、送信後に3分割としてフラグメントされたパケットの構成例であり、それぞれIPヘッダ及びペイロードを示している。   Reference numerals 1002a, 1002b, 1003a, 1003b, 1004a, and 1004b are configuration examples of packets that are fragmented into three pieces after transmission, and indicate an IP header and a payload, respectively.

更に、1005a、1005b、1006a、1006b、1007a、1007b、1008a、1008bはそれぞれ、受信側からのTCP再送要求により再送されたパケットの構成例で、それぞれIPヘッダ及びペイロードを示している。最初に送信したパケットとは違うネットワーク経路を経由したことにより、4分割としてフラグメントされたパケットとなっている。   Further, reference numerals 1005a, 1005b, 1006a, 1006b, 1007a, 1007b, 1008a, and 1008b are configuration examples of packets retransmitted in response to a TCP retransmission request from the receiving side, and indicate an IP header and a payload, respectively. By passing through a different network route from the packet transmitted first, the packet is fragmented into four parts.

図11は、重複したフラグメントパケットが生成された場合の受信パケットの構成例を示す図(その1)である。図11において、フラグメントパケットのうち「1101で示すパケット」、「1102で示すパケット」の順で受信した場合、ペイロードの重複領域は1103に示す範囲となり、重複領域は受信パケット1102の半分のサイズより小さい。   FIG. 11 is a diagram (part 1) illustrating a configuration example of a received packet when a duplicate fragment packet is generated. In FIG. 11, when the packet is received in the order of “packet indicated by 1101” and “packet indicated by 1102” in the order of the fragment packet, the overlapping area of the payload becomes the range indicated by 1103, and the overlapping area is smaller than half the size of the received packet 1102. small.

図12は、重複したフラグメントパケットが生成された場合の受信パケットの構成例を示す図(その2)である。図12において、フラグメントパケットのうち「1201で示すパケット」、「1202で示すパケット」、「1203で示すパケット」の順で受信した場合は、ペイロードの重複領域は1204に示す範囲となる。この重複領域は受信パケット1203の半分のサイズより大きい。   FIG. 12 is a diagram (part 2) of a configuration example of a received packet when a duplicate fragment packet is generated. In FIG. 12, when the fragment packets are received in the order of “packet indicated by 1201”, “packet indicated by 1202”, and “packet indicated by 1203”, the overlapping area of the payload becomes a range indicated by 1204. This overlapping area is larger than half the size of the received packet 1203.

図13は、実施形態3のCPU110が実行するソフトウェアの制御を示すフローチャートである。なお、CPU110は、図13に示す処理を常に繰り返し、実行している。   FIG. 13 is a flowchart illustrating control of software executed by the CPU 110 according to the third embodiment. The CPU 110 always repeats and executes the process shown in FIG.

ステップS1301からステップS1307までの処理は、実施形態1の図6に示したステップS601からステップS607までの処理と同様である。   The processing from step S1301 to step S1307 is the same as the processing from step S601 to step S607 shown in FIG. 6 of the first embodiment.

ステップS1308において、CPU110は、ステップS1307において取得した検査結果に基づいて、受信したIPパケットがIPフラグメントパケットか否かを判定する。CPU110は、受信したIPパケットがIPフラグメントパケットであると判定すると、ステップS1320に進み、受信したIPパケットがIPフラグメントパケットでないと判定すると、ステップS1309に進む。   In step S1308, the CPU 110 determines whether the received IP packet is an IP fragment packet based on the inspection result acquired in step S1307. If the CPU 110 determines that the received IP packet is an IP fragment packet, the process proceeds to step S1320. If the CPU 110 determines that the received IP packet is not an IP fragment packet, the process proceeds to step S1309.

ステップS1309からステップS1313までの処理は、実施形態1の図6に示したステップS609からステップS613までの処理と同様である。   The processing from step S1309 to step S1313 is the same as the processing from step S609 to step S613 shown in FIG. 6 of the first embodiment.

ステップS1320において、CPU110は、受信したフラグメントパケットのデータと、既に受信している同一識別子のフラグメントパケットのデータとに重複領域があるか否かを判定する。CPU110は、重複領域があると判定すると、ステップS1321に進み、重複領域がないと判定すると、ステップS1314に進む。   In step S1320, CPU 110 determines whether or not there is an overlap area between the received fragment packet data and the already received fragment packet data with the same identifier. If the CPU 110 determines that there is an overlapping area, the process proceeds to step S1321, and if it is determined that there is no overlapping area, the process proceeds to step S1314.

ステップS1321において、CPU110は、チェックサム値一時記憶部108に格納されているチェックサム値の補正処理を実行し、ステップS1314に進む。ステップS1321の処理の詳細は、後述する図14に示す。   In step S1321, the CPU 110 executes a correction process for the checksum value stored in the checksum value temporary storage unit 108, and the process proceeds to step S1314. Details of the processing in step S1321 are shown in FIG.

ステップS1314からステップS1319までの処理は、実施形態1の図6に示したステップS614からステップS619までの処理と同様である。   The processing from step S1314 to step S1319 is the same as the processing from step S614 to step S619 shown in FIG. 6 of the first embodiment.

図14は、チェックサム値の補正処理を示すフローチャートである。ステップS1401において、CPU110は、フラグメントパケットの重複領域のサイズを算出する処理を行う。このサイズの算出は、受信バッファ105中のパケットディスクリプタ105aに記述されている、受信したフラグメントパケットのパケット情報、及び受信したフラグメントパケットと同一識別子を持つフラグメントパケットのパケット情報を用いて行われる。   FIG. 14 is a flowchart showing a checksum value correction process. In step S1401, the CPU 110 performs processing for calculating the size of the overlapping area of fragment packets. The calculation of the size is performed using the packet information of the received fragment packet and the packet information of the fragment packet having the same identifier as the received fragment packet described in the packet descriptor 105a in the reception buffer 105.

続いて、ステップS1402において、CPU110は、算出したサイズが受信したフラグメントパケットのサイズの1/2以下か否かを判定する。CPU110は、算出したサイズが受信したフラグメントパケットのサイズの1/2以下であると判定すると、ステップS1403に進み、算出したサイズが受信したフラグメントパケットのサイズの1/2以下でないと判定すると、ステップS1407に進む。   Subsequently, in step S1402, the CPU 110 determines whether or not the calculated size is ½ or less of the size of the received fragment packet. If the CPU 110 determines that the calculated size is ½ or less of the size of the received fragment packet, the CPU 110 proceeds to step S1403. If the CPU 110 determines that the calculated size is not ½ or less of the size of the received fragment packet, The process proceeds to S1407.

ステップS1403において、CPU110は、受信したフラグメントパケットの内、重複している領域のデータのチェックサム値を算出する。続いて、ステップS1404において、CPU110は、チェックサム値一時記憶部108に格納されている受信したフラグメントパケットのチェックサム値を読み出す。   In step S1403, CPU 110 calculates the checksum value of the data in the overlapping area of the received fragment packet. In step S <b> 1404, the CPU 110 reads the checksum value of the received fragment packet stored in the checksum value temporary storage unit 108.

続いて、ステップS1405において、CPU110は、ステップS1404において読み出したチェックサム値から、ステップS1403において算出したチェックサム値を減算した値を求める。この処理によって、重複していない領域のデータのチェックサム値を求めることができる。続いて、ステップS1406において、CPU110は、ステップS1405において求めた値(チェックサム値)を再びチェックサム値一時記憶部108に書き戻す。   Subsequently, in step S1405, the CPU 110 obtains a value obtained by subtracting the checksum value calculated in step S1403 from the checksum value read in step S1404. By this process, the checksum value of the data in the non-overlapping area can be obtained. Subsequently, in step S1406, CPU 110 writes the value (checksum value) obtained in step S1405 back to checksum value temporary storage unit 108 again.

一方、ステップS1407において、CPU110は、受信したフラグメントパケットの内、重複していない領域のデータのチェックサム値を算出する。続いて、ステップS1408において、CPU110は、チェックサム値一時記憶部108に格納されている受信したフラグ面とパケットのチェックサム値を、ステップS1407において算出したチェックサム値に置き換える。   On the other hand, in step S1407, CPU 110 calculates a checksum value of data in a non-overlapping area in the received fragment packet. Subsequently, in step S1408, CPU 110 replaces the received flag surface and packet checksum value stored in checksum value temporary storage unit 108 with the checksum value calculated in step S1407.

上述したように、フラグメントパケットの重複領域が発生した場合にも、重複領域のみの演算処理と、非重複領域のみの演算処理とを切り替えると共に、チェックサム演算部103で演算されたチェックサム値を利用する。よって、ソフトウェアによりパケット領域全てのチェックサム値の再演算を行うことなく、高速にチェックサム検査を行うことができる。つまり、CPU110の演算量を削減することができる。   As described above, even when an overlapping area of fragment packets occurs, the calculation process of only the overlapping area and the calculation process of only the non-overlapping area are switched and the checksum value calculated by the checksum calculation unit 103 is changed. Use. Therefore, the checksum check can be performed at high speed without recalculating the checksum value of the entire packet area by software. That is, the calculation amount of the CPU 110 can be reduced.

定常的なパケット、及び否定常的なパケット(フラグメントパケット)を小さな回路規模で高速に処理することができる。   Regular packets and non-steady packets (fragment packets) can be processed at high speed with a small circuit scale.

以上、本発明の好ましい実施形態について詳述したが、本発明は係る特定の実施形態に限定されるものではなく、特許請求の範囲に記載された本発明の要旨の範囲内において、種々の変形・変更が可能である。   The preferred embodiments of the present invention have been described in detail above, but the present invention is not limited to such specific embodiments, and various modifications can be made within the scope of the gist of the present invention described in the claims.・ Change is possible.

イーサネット(登録商標)におけるTCP/IPパケットのデータ構造を示す図である。It is a figure which shows the data structure of the TCP / IP packet in Ethernet (trademark). IPパケットのデータ構造を示す図である。It is a figure which shows the data structure of an IP packet. TCPパケットのデータ構造を示す図である。It is a figure which shows the data structure of a TCP packet. 実施形態1に係る装置の全体構成を表すブロック図である。1 is a block diagram illustrating an overall configuration of an apparatus according to a first embodiment. 受信バッファ105の詳細なデータ構造を説明するための図である。4 is a diagram for explaining a detailed data structure of a reception buffer 105. FIG. 実施形態1のCPU110が実行するソフトウェアの制御を示すフローチャートである。3 is a flowchart illustrating control of software executed by a CPU 110 according to the first embodiment. 実施形態2に係る装置の全体構成を表すブロック図である。It is a block diagram showing the whole structure of the apparatus which concerns on Embodiment 2. FIG. 連続したフラグメントパケットを受信した場合に、データバッファ105b中のメモリブロックに書き込まれるデータの構造を示す図である。It is a figure which shows the structure of the data written in the memory block in the data buffer 105b when a continuous fragment packet is received. 実施形態2のCPU110が実行するソフトウェアの制御を示すフローチャートである。6 is a flowchart illustrating control of software executed by a CPU 110 according to the second embodiment. 再送処理によって重複が発生しているフラグメントパケットの構成例を示す図である。It is a figure which shows the structural example of the fragment packet in which duplication has generate | occur | produced by the resending process. 重複したフラグメントパケットが生成された場合の受信パケットの構成例を示す図(その1)である。FIG. 11 is a diagram (part 1) illustrating a configuration example of a received packet when a duplicate fragment packet is generated. 重複したフラグメントパケットが生成された場合の受信パケットの構成例を示す図(その2)である。FIG. 10 is a diagram (part 2) illustrating a configuration example of a received packet when a duplicate fragment packet is generated. 実施形態3のCPU110が実行するソフトウェアの制御を示すフローチャートである。10 is a flowchart illustrating control of software executed by a CPU 110 according to the third embodiment. チェックサム値の補正処理を示すフローチャートである。It is a flowchart which shows the correction process of a checksum value.

符号の説明Explanation of symbols

110 CPU
103 チェックサム演算部
105 受信バッファ
107 フラグメント検査部
109 チェックサム検査部
110 CPU
103 Checksum operation unit 105 Reception buffer 107 Fragment checking unit 109 Checksum checking unit

Claims (11)

受信パケットのデータチェックサム計算を行うチェックサム演算手段と、
前記チェックサム演算手段で求めたチェックサム値と、受信パケットのパケットヘッダに格納されているチェックサム値とを使用してデータチェックサム検査を行うチェックサム検査手段と、
前記受信パケットが断片化されたパケットか否かを判断するフラグメント検査手段と、
前記チェックサム演算手段で求めたチェックサム値を一時的に格納するチェックサム記憶手段と、
断片化されたパケットの再組み立て処理、及び前記チェックサム記憶手段に格納されているチェックサム値と、前記再組み立てされたパケットのパケットヘッダに格納されているチェックサム値とを使用して再組み立てされたパケットのデータチェックサム検査処理を実行する制御手段と、
を有し、
前記フラグメント検査手段において前記受信パケットが断片化されたパケットであると判断された場合は、前記制御手段においてチェックサム検査を行い、前記フラグメント検査手段において前記受信パケットが断片化されたパケットでないと判断された場合は、前記チェックサム検査手段においてチェックサム検査を行うことを特徴とするプロトコル処理装置。
Checksum calculation means for calculating the data checksum of the received packet;
Checksum checking means for performing a data checksum check using the checksum value obtained by the checksum calculation means and the checksum value stored in the packet header of the received packet;
Fragment checking means for determining whether the received packet is a fragmented packet;
Checksum storage means for temporarily storing the checksum value obtained by the checksum calculation means;
Fragmented packet reassembly process, checksum value stored in the checksum storage means, and reassembly using the checksum value stored in the packet header of the reassembled packet A control means for executing a data checksum check process of the received packet;
Have
When the received packet is determined to be fragmented by the fragment checking means, the control means performs a checksum check, and the fragment checking means determines that the received packet is not a fragmented packet. If so, the checksum checking means performs a checksum check.
少なくとも前記チェックサム演算手段、及び前記チェックサム検査手段は、専用の回路で構成されていることを特徴とする請求項1記載のプロトコル処理装置。   2. The protocol processing apparatus according to claim 1, wherein at least the checksum calculation means and the checksum checking means are configured by dedicated circuits. 前記受信パケットを格納するデータバッファと、複数の前記データバッファの連結に係る連結情報を格納する管理バッファと、を有する受信バッファ手段を更に有し、
断片化されたパケットを受信した場合、前記制御手段は、前記連結情報を用いて、同一の識別子を有するパケットが格納された前記データバッファを連結するように制御し、断片化されたパケットの再組み立て処理を行うことを特徴とする請求項1又は2記載のプロトコル処理装置。
A reception buffer means having a data buffer for storing the reception packet, and a management buffer for storing connection information related to the connection of the plurality of data buffers;
When the fragmented packet is received, the control means uses the concatenation information to control the concatenation of the data buffers in which packets having the same identifier are stored, and recycles the fragmented packet. 3. The protocol processing apparatus according to claim 1, wherein an assembly process is performed.
断片化されたパケットを、先頭から連続した順序で受信している間は、パケットを受信するごとに、パケットのデータチェックサム計算を行い、チェックサム値を積算していくチェックサム加算手段を更に有し、
断片化されたパケットを、先頭から後尾まで連続した順序で受信した場合、前記チェックサム検査手段は、前記チェックサム加算手段で求めたチェックサム値と、前記断片化されたパケットのパケットヘッダに格納されているチェックサム値とを使用してデータチェックサム検査を行い、
最初に受信した断片化されたパケットが先頭ではなかった場合、又は断片化されたパケットが連続した順序ではなくなった場合、前記制御手段は、断片化されたパケットの再組み立て処理を行うことを特徴とする請求項1乃至3何れか1項記載のプロトコル処理装置。
While receiving the fragmented packets in the sequential order from the beginning, each time a packet is received, a checksum addition means is further provided that performs a data checksum calculation of the packet and accumulates the checksum value. Have
When the fragmented packets are received in the sequential order from the head to the tail, the checksum checking means stores the checksum value obtained by the checksum adding means and the packet header of the fragmented packet. Data checksum check using the checksum value that is
When the first fragmented packet received is not at the beginning, or when the fragmented packets are not in a continuous order, the control means performs reassembly processing of the fragmented packets. The protocol processing device according to any one of claims 1 to 3.
前記制御手段は、断片化されたパケットの内、各パケットに重複する領域がある場合、重複する領域のデータ又は重複していない領域のデータを用いて、データチェックサム計算を行い、チェックサム値を求め、前記チェックサム値を用いて、前記チェックサム演算手段で求められたチェックサム値の補正を行うことを特徴とする請求項1乃至4何れか1項記載のプロトコル処理装置。   The control means performs a data checksum calculation using the data of the overlapping area or the data of the non-overlapping area when there is an overlapping area in each packet among the fragmented packets, and the checksum value 5. The protocol processing apparatus according to claim 1, wherein the checksum value obtained by the checksum calculation means is corrected using the checksum value. 前記制御手段は、前記重複する領域がパケット長の1/2より小さい場合には、重複する領域のデータを用いて、データチェックサム計算を行うことを特徴とする請求項5記載のプロトコル処理装置。   6. The protocol processing apparatus according to claim 5, wherein the control means performs data checksum calculation using data in the overlapping area when the overlapping area is smaller than ½ of the packet length. . 前記制御手段は、前記重複する領域がパケット長の1/2より大きい場合には、重複していない領域のデータを用いて、データチェックサム計算を行うことを特徴とする請求項5記載のプロトコル処理装置。   6. The protocol according to claim 5, wherein the control means performs data checksum calculation using data in a non-overlapping area when the overlapping area is larger than half of the packet length. Processing equipment. 前記制御手段は、前記チェックサム記憶手段に格納されている、前記チェックサム演算手段で求められたチェックサム値から、前記重複する領域のデータを用いてデータチェックサム計算を行い、求めたチェックサム値を減算し、前記チェックサム記憶手段に書き戻すことにより、重複していない領域のチェックサム値を求めることを特徴とする請求項6記載のプロトコル処理装置。   The control means performs data checksum calculation using the data of the overlapping area from the checksum value obtained by the checksum operation means stored in the checksum storage means, and obtains the obtained checksum 7. The protocol processing apparatus according to claim 6, wherein a checksum value of a non-overlapping area is obtained by subtracting the value and writing back to the checksum storage means. 前記制御手段は、前記チェックサム記憶手段に格納されている、前記チェックサム演算手段で求められたチェックサム値を、前記重複していない領域のデータを用いてデータチェックサム計算を行い、求めたチェックサム値に書き換えることにより、重複していない領域のチェックサム値を求めることを特徴とする請求項7記載のプロトコル処理装置。   The control means calculates the checksum value obtained by the checksum calculation means stored in the checksum storage means by performing data checksum calculation using data in the non-overlapping area. 8. The protocol processing apparatus according to claim 7, wherein a checksum value of a non-overlapping area is obtained by rewriting to a checksum value. プロトコル処理装置におけるプロトコル処理方法であって、
受信パケットのデータチェックサム計算を行うチェックサム演算ステップと、
前記チェックサム演算ステップにおいて求められたチェックサム値と、受信パケットのパケットヘッダに格納されているチェックサム値とを使用してデータチェックサム検査を行うチェックサム検査ステップと、
前記受信パケットが断片化されたパケットか否かを判断するフラグメント検査ステップと、
前記チェックサム演算ステップで求めたチェックサム値を一時的にチェックサム記憶手段に格納する格納ステップと、
断片化されたパケットの再組み立て処理、及び前記チェックサム記憶手段に格納されているチェックサム値と、前記再組み立てされたパケットのパケットヘッダに格納されているチェックサム値とを使用して再組み立てされたパケットのデータチェックサム検査処理を実行する制御ステップと、
を有し、
前記フラグメント検査ステップにおいて前記受信パケットが断片化されたパケットであると判断された場合は、前記制御ステップにおいてチェックサム検査を行い、前記フラグメント検査ステップにおいて前記受信パケットが断片化されたパケットでないと判断された場合は、前記チェックサム検査ステップにおいてチェックサム検査を行うことを特徴とするプロトコル処理方法。
A protocol processing method in a protocol processing device,
A checksum calculation step for calculating the data checksum of the received packet;
A checksum check step for performing a data checksum check using the checksum value obtained in the checksum calculation step and the checksum value stored in the packet header of the received packet;
Fragment inspection step for determining whether the received packet is a fragmented packet;
A storage step of temporarily storing the checksum value obtained in the checksum calculation step in a checksum storage means;
Fragmented packet reassembly process, checksum value stored in the checksum storage means, and reassembly using the checksum value stored in the packet header of the reassembled packet A control step for performing a data checksum check process of the received packet;
Have
If it is determined in the fragment checking step that the received packet is a fragmented packet, a checksum check is performed in the control step, and the received packet is determined not to be a fragmented packet in the fragment checking step. If so, a checksum check is performed in the checksum check step.
請求項10記載のプロトコル処理方法をコンピュータに実行させることを特徴とするプログラム。   A program for causing a computer to execute the protocol processing method according to claim 10.
JP2006034068A 2006-02-10 2006-02-10 Protocol processor and protocol processing method Pending JP2007215013A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006034068A JP2007215013A (en) 2006-02-10 2006-02-10 Protocol processor and protocol processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006034068A JP2007215013A (en) 2006-02-10 2006-02-10 Protocol processor and protocol processing method

Publications (1)

Publication Number Publication Date
JP2007215013A true JP2007215013A (en) 2007-08-23

Family

ID=38493038

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006034068A Pending JP2007215013A (en) 2006-02-10 2006-02-10 Protocol processor and protocol processing method

Country Status (1)

Country Link
JP (1) JP2007215013A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008092082A (en) * 2006-09-29 2008-04-17 Canon Inc Data receiver and data receiving method
JP2009278364A (en) * 2008-05-14 2009-11-26 Canon Inc Packet receiving apparatus and processing method of the same
JP2011041243A (en) * 2009-08-14 2011-02-24 Korea Electronics Telecommun Method and device for communicating in udp platform
JP2012156602A (en) * 2011-01-21 2012-08-16 Ricoh Co Ltd Information processing device, communication control method, and communication control system
CN106575118A (en) * 2014-08-22 2017-04-19 西门子股份公司 Detection of consistent steady-state behavior in process plants

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008092082A (en) * 2006-09-29 2008-04-17 Canon Inc Data receiver and data receiving method
JP2009278364A (en) * 2008-05-14 2009-11-26 Canon Inc Packet receiving apparatus and processing method of the same
US8473632B2 (en) 2008-05-14 2013-06-25 Canon Kabushiki Kaisha Packet receiving apparatus and processing method for the same
JP2011041243A (en) * 2009-08-14 2011-02-24 Korea Electronics Telecommun Method and device for communicating in udp platform
JP2012156602A (en) * 2011-01-21 2012-08-16 Ricoh Co Ltd Information processing device, communication control method, and communication control system
US8738999B2 (en) 2011-01-21 2014-05-27 Ricoh Company, Ltd. Information processing apparatus, communication control method, and communication control system
CN106575118A (en) * 2014-08-22 2017-04-19 西门子股份公司 Detection of consistent steady-state behavior in process plants

Similar Documents

Publication Publication Date Title
CN105794172B (en) The network equipment and method for handling message in the network device
US10374977B2 (en) Method and apparatus for stateless transport layer tunneling
US11425058B2 (en) Generation of descriptive data for packet fields
US7561573B2 (en) Network adaptor, communication system and communication method
CN102272716B (en) The SIMD of network packet processes
US7260631B1 (en) System and method for receiving iSCSI protocol data units
KR101726359B1 (en) An apparatus for analyzing a data packet, a data packet processing system and a method
US20110080912A1 (en) Tcp receiver acceleration
US7948979B2 (en) Programmable network interface card
US9912637B2 (en) Use of packet header extension for layer-3 direct server return
JP2007215013A (en) Protocol processor and protocol processing method
CN113783800B (en) Data packet processing method and device, computer equipment and readable storage medium
US20140105212A1 (en) Communications over multiple protocol interfaces in a computing environment
US20080104162A1 (en) DATA PROCESSING APPARATUS and DATA PROCESSING METHOD
US7606967B2 (en) Frame transfer method and apparatus
US8990422B1 (en) TCP segmentation offload (TSO) using a hybrid approach of manipulating memory pointers and actual packet data
US7747766B2 (en) System and method for recognizing offloaded packets
JP2007274056A (en) Datagram reassembling apparatus
US20200220952A1 (en) System and method for accelerating iscsi command processing
CN110383779B (en) Data processing apparatus, network system, packet sequence control circuit, and data processing method
US20060153215A1 (en) Connection context prefetch
US9553795B2 (en) Port switching method, analysis device, and recording medium
EP4169231A1 (en) Online application layer processing of network layer timestamps
CN107147578B (en) Information processing method and electronic equipment
CN109150584A (en) A method of being instructed based on SMID is that network packet classification provides acceleration support