JP2013176106A - Data communication device and communication program - Google Patents

Data communication device and communication program Download PDF

Info

Publication number
JP2013176106A
JP2013176106A JP2013081387A JP2013081387A JP2013176106A JP 2013176106 A JP2013176106 A JP 2013176106A JP 2013081387 A JP2013081387 A JP 2013081387A JP 2013081387 A JP2013081387 A JP 2013081387A JP 2013176106 A JP2013176106 A JP 2013176106A
Authority
JP
Japan
Prior art keywords
data
unit
reception
packet
completed
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
JP2013081387A
Other languages
Japanese (ja)
Other versions
JP5606575B2 (en
Inventor
Shingo Tanaka
中 信 吾 田
Takahiro Yamaura
浦 隆 博 山
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.)
Toshiba Corp
Original Assignee
Toshiba Corp
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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP2013081387A priority Critical patent/JP5606575B2/en
Publication of JP2013176106A publication Critical patent/JP2013176106A/en
Application granted granted Critical
Publication of JP5606575B2 publication Critical patent/JP5606575B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

PROBLEM TO BE SOLVED: To solve a problem of malfunction in session disconnection.SOLUTION: A data processing unit for performing transmission/reception with a transmitter through a network receives a series of data for each data to process the received data, in receiving the data. A control processing unit manages a session status of the data communication with the transmitter. An information storage unit stores the session status. A data reception completion determination unit determines whether or not the reception of all of the series of data have been completed, when reception of termination data of the series of data is detected. A data processing unit processes the data from the transmitter depending on the session status stored in the information storage unit. The control processing unit makes the session status transit to an end status, when it is determined that all of the series of data has been completed, and delays the transition of the session status until it is determined that all of the series of data has been completed, when it is determined that all of the series of data has not been completed.

Description

本発明は、データ通信装置および通信プログラムに関するものである。   The present invention relates to a data communication apparatus and a communication program.

インターネット等で広く用いられるTCP/IPなどのプロトコル処理は、従来主にCPU上で動作するソフトウェアにより実現されていた。しかしながら、近年のネットワーク高速化に伴い、CPUのTCP/IP処理負荷が増大しており、TCP/IP処理を専用のハードウェアによって行うTOE(TCP/IP Offload Engine)を用いることにより、高速な通信を実現する装置が提案されている。   Conventionally, protocol processing such as TCP / IP widely used in the Internet has been realized mainly by software operating on a CPU. However, as the network speed increases in recent years, the CPU's TCP / IP processing load has increased. By using a TOE (TCP / IP Offload Engine) that performs TCP / IP processing using dedicated hardware, high-speed communication is possible. An apparatus for realizing the above has been proposed.

米国公開2004/0078462公報US Publication 2004/0078462 特開2009‐77024公報JP 2009-77024

TOEは通常CPU上で動作するソフトウェアから制御されるが、ソフトウェアからの制御を考慮すると、データ送信の性能が出なかったり、セッションの切断が正しく動作しなかったりするなどの問題がある。   The TOE is normally controlled by software that runs on the CPU. However, considering the control from the software, there are problems such as poor data transmission performance and incorrect session disconnection.

本発明の一側面は、データ送信の性能が出ない問題、およびセッションの切断が正しく動作しない問題の少なくとも一方を解決することを目的とする。   An object of one aspect of the present invention is to solve at least one of a problem that data transmission performance is not achieved and a problem that session disconnection does not operate correctly.

本発明の一態様としてのデータ通信装置は、データの消失が検知された場合に送信側から前記データの再送を行うプロトコルを用いたデータ通信を行うデータ通信装置である。   A data communication apparatus according to an aspect of the present invention is a data communication apparatus that performs data communication using a protocol that retransmits the data from the transmission side when data loss is detected.

前記データ通信装置は、データ処理部と、制御処理部と、情報記憶部と、データ終端検出部と、データ受信完了判定部とを備える。   The data communication device includes a data processing unit, a control processing unit, an information storage unit, a data end detection unit, and a data reception completion determination unit.

前記データ処理部は、送信装置とネットワークを介して送受信し、受信においては一連のデータを前記データ毎に受信し、受信したデータを処理する。   The data processing unit transmits / receives data to / from a transmitting device via a network, and in reception, receives a series of data for each data, and processes the received data.

前記制御処理部は、前記送信装置とのデータ通信のセッション状態を管理する。   The control processing unit manages a session state of data communication with the transmission device.

前記情報記憶部は、前記セッション状態を記憶する。   The information storage unit stores the session state.

前記データ終端検出部は、前記一連のデータの末尾の終端データが受信されたことを検出する。   The data end detection unit detects that end data at the end of the series of data has been received.

前記データ受信完了判定部は、前記終端データの受信が検知されたとき、前記一連のデータの受信がすべて完了しているか否かを判定する。   The data reception completion determination unit determines whether reception of the series of data has been completed when reception of the termination data is detected.

前記データ処理部は、前記情報記憶部に記憶された前記セッション状態に応じて、前記送信装置からのデータを処理する。   The data processing unit processes data from the transmission device according to the session state stored in the information storage unit.

前記制御処理部は、前記データ受信完了判定部により前記一連のデータの受信がすべて完了していると判定されたとき、前記セッション状態を終了状態に遷移させ、完了していないと判定されたとき、完了したと判定されるまで、前記セッション状態の遷移を待機する。   The control processing unit transitions the session state to an end state when it is determined by the data reception completion determination unit that reception of the series of data has been completed, and when it is determined that the data has not been completed And waits for the transition of the session state until it is determined to be completed.

第1の実施形態に係るデータ送信装置の構成を概略的に示す図。1 is a diagram schematically showing a configuration of a data transmission device according to a first embodiment. FIG. プロトコルスタックとアプリケーションの間のデータの受け渡しでメモリコピーが行われる様子を示す図。The figure which shows a mode that a memory copy is performed by the delivery of the data between a protocol stack and an application. NICがアプリケーションバッファにダイレクトにデータを書き込む方式の説明図。Explanatory drawing of the method in which NIC writes data directly to the application buffer. 遅延確認応答を説明するための図。The figure for demonstrating a delay confirmation response. 第1の実施形態の動作を説明するための図。FIG. 6 is a diagram for explaining the operation of the first embodiment. アプリケーションデータとそれに対する確認応答の例を示す図。The figure which shows the example of application data and the confirmation response with respect to it. アプリケーションデータとそれに対する確認応答の別の例を示す図。The figure which shows another example of application data and the confirmation response with respect to it. 図1の装置にコピーサイズ特定部を追加した構成を示す図。FIG. 2 is a diagram showing a configuration in which a copy size specifying unit is added to the apparatus of FIG. 図8の装置に、送信レート測定部と遅延測定部を追加した構成を示す図。FIG. 9 is a diagram showing a configuration in which a transmission rate measurement unit and a delay measurement unit are added to the apparatus of FIG. 図1の装置にパケット送信指示部を追加した構成を示す図。FIG. 2 is a diagram showing a configuration in which a packet transmission instruction unit is added to the apparatus of FIG. パケット送信指示部の動作を説明するための図。The figure for demonstrating operation | movement of a packet transmission instruction | indication part. 図1の装置にバッファ管理部を追加した構成を示す図。FIG. 2 is a diagram showing a configuration in which a buffer management unit is added to the apparatus of FIG. 第2の実施形態に係るデータ通信装置の構成を概略的に示す図。FIG. 5 is a diagram schematically showing a configuration of a data communication apparatus according to a second embodiment. 図13の装置の動作を説明するためのフローチャート。14 is a flowchart for explaining the operation of the apparatus of FIG. 図13の装置の変形例を示す図。FIG. 14 is a view showing a modification of the apparatus of FIG. 第3の実施形態に係るデータ通信装置の構成を概略的に示す図。FIG. 10 is a diagram schematically showing a configuration of a data communication apparatus according to a third embodiment. 図16の装置の動作を説明するためのフローチャート。FIG. 17 is a flowchart for explaining the operation of the apparatus of FIG. 図16の装置の変形例を示す図。FIG. 17 is a diagram showing a modification of the apparatus in FIG. TCPのヘッダ構造を示す図。The figure which shows the header structure of TCP. TCPの状態名とその説明とを表した図。The figure showing the state name of TCP and its explanation. セッション情報の一例を示す図。The figure which shows an example of session information.

(第1の実施形態)
インターネット通信で使われている主要なプロトコルとしてTCP/IPがある。従来のTCP/IPは主にソフトウェア処理によって実現されており、たとえばパソコンや組み込み機器などのCPUによって動作する。このような場合、ネットワークとのデータのやりとりは、主にはMAC/PHY機能を備えるNIC(Network Interface Card)または専用ASICやFPGAなどのLSIによって実行される(以降はこれをNICで代表して説明する)。
(First embodiment)
TCP / IP is the main protocol used in Internet communications. Conventional TCP / IP is mainly realized by software processing, and operates by a CPU such as a personal computer or an embedded device. In such a case, data exchange with the network is mainly performed by a NIC (Network Interface Card) with a MAC / PHY function or an LSI such as a dedicated ASIC or FPGA (hereinafter this is represented by the NIC). explain).

受信の場合は、ネットワークから受信されたパケットはNICからメモリにDMA転送され、その後にCPUのプロトコルスタックソフトウェアによってプロトコル処理が行われる。送信の場合は、CPUのプロトコルスタックソフトウェアによってメモリ上に生成されたパケットが、NICによってDMA転送で読み出されてネットワークに送信される。通常CPUではプロトコル処理のほかにアプリケーション処理も実行しており、プロトコルスタックとアプリケーションの間のデータの受け渡しでメモリコピーが行われる。これらのデータの流れを図示すると図2のようになる。   In the case of reception, a packet received from the network is DMA-transferred from the NIC to the memory, and then protocol processing is performed by the CPU protocol stack software. In the case of transmission, a packet generated on the memory by the protocol stack software of the CPU is read out by the NIC by DMA transfer and transmitted to the network. Normally, the CPU executes application processing in addition to protocol processing, and memory copying is performed by passing data between the protocol stack and the application. The flow of these data is illustrated in FIG.

図2を見てわかるように、このような方式ではアプリケーションバッファとNICとの間でデータが一旦バッファリングされることになり、データがメモリ上を合計2往復することになる。そこで、プロトコル処理の一部をNICで行うことで、NICがアプリケーションバッファにダイレクトにデータを書き込む方式が従来、提案されている。この場合のデータの流れを図示すると図 3のようになる。こうすることによりデータの流れはメモリ上を1往復するだけになるので、データのコピーによる性能面・消費電力面でのオーバーヘッドを回避することができる。本処理は受信処理の例であるが、送信処理についても同様にメモリコピーを行わずに動作することが望ましい。   As can be seen from FIG. 2, in such a system, data is temporarily buffered between the application buffer and the NIC, and the data travels twice in total on the memory. Therefore, a method has been proposed in which a part of the protocol processing is performed by the NIC so that the NIC directly writes data to the application buffer. Figure 3 shows the data flow in this case. By doing so, the flow of data only makes one round trip on the memory, so it is possible to avoid the overhead in terms of performance and power consumption due to data copying. Although this processing is an example of reception processing, it is desirable that the transmission processing also operates without performing a memory copy.

しかしながら、このように送信処理において単純にコピーを省くと、アプリケーションAPIとしてSocket APIを前提とした場合に問題が生じる。Socket APIはアプリケーションデータを一度に一つしか指定できないという制約がある。
具体的には、図4に示すように、アプリケーションがsend()関数を呼んであるアプリケーションデータを指定すると、その関数が返らないと、次のsend()関数を呼ぶことができない。このため、その関数が返るまで、次のアプリケーションデータの送信指示を行うことができない。それに対して、アプリケーションデータを指定されたプロトコルスタック側は、send()関数を返してしまうとそのアプリケーションデータは開放される可能性があるため、データを完全に送信し終わる、すなわち、アプリケーションデータの最後データの確認応答が返ってくるまで、データを再送する可能性があるため、send()関数を返すことができない(注:図2に示した構成ではスタックのバッファにコピーを行ってデータを保持しておくため、送信が終わっていない段階でsend()関数を返すことができる)。
確認応答が遅れる理由としては、例えば、(A)受信装置が遅延確認応答(後述)を行っている場合、(B)受信装置との間のネットワークの往復遅延が大きい場合、(C)受信装置の処理速度が遅い場合、などが挙げられる。このような場合、send()関数を返すタイミングが遅くなり、結果的に無通信時間が発生し、伝送レートが無駄に低下してしまう。
However, if copying is simply omitted in the transmission process as described above, a problem occurs when the socket API is assumed as the application API. The Socket API has the restriction that only one application data can be specified at a time.
Specifically, as shown in FIG. 4, if the application specifies application data that calls the send () function, the next send () function cannot be called unless the function is returned. Therefore, the next application data transmission instruction cannot be performed until the function returns. On the other hand, if the protocol stack side that has specified application data returns the send () function, the application data may be released. The send () function cannot be returned until the last data acknowledgment is returned, so the send () function cannot be returned. (Note: In the configuration shown in Fig. 2, the data is copied to the stack buffer. (The send () function can be returned when the transmission is not finished.)
The reason why the confirmation response is delayed is, for example, when (A) the receiving device makes a delay confirmation response (described later), (B) when the round-trip delay of the network with the receiving device is large, (C) the receiving device When the processing speed of is slow. In such a case, the return timing of the send () function is delayed, resulting in a no-communication time, resulting in a wasteful reduction in the transmission rate.

以上の問題を解決する本発明の実施形態を図1に示す。図1は基本的な構成を示すものであり、代表的な例としてはPC、サーバ、ASIC、FPGA(Field Programmable Gate Array)などで実現される。図1の装置は、例えばTCP/IPプロトコルをはじめとする通信プロトコルに基づいて、対向する受信装置からデータのシーケンス番号に基づいた確認応答を受けながら、連続したデータ送信を行うデータ送信装置である。   An embodiment of the present invention that solves the above problems is shown in FIG. FIG. 1 shows a basic configuration, and a typical example is realized by a PC, a server, an ASIC, an FPGA (Field Programmable Gate Array), and the like. The apparatus in FIG. 1 is a data transmission apparatus that performs continuous data transmission while receiving an acknowledgment based on a data sequence number from an opposite reception apparatus based on a communication protocol such as the TCP / IP protocol. .

このデータ送信装置は、データ送信指示部101、パケット送信指示部102、データ記憶部103、データ読み出し部104、ヘッダ生成部105、パケット生成部106、ネットワークI/F部107、確認応答受信部108、パケット再送指示部109、データコピー部110、送信完了判定部111で構成される。   The data transmission apparatus includes a data transmission instruction unit 101, a packet transmission instruction unit 102, a data storage unit 103, a data reading unit 104, a header generation unit 105, a packet generation unit 106, a network I / F unit 107, and an acknowledgment response reception unit 108. The packet retransmission instruction unit 109, the data copy unit 110, and the transmission completion determination unit 111.

データ送信指示部101は、アプリケーションデータの送信を指示するデータ送信指示を生成する。   The data transmission instruction unit 101 generates a data transmission instruction that instructs transmission of application data.

パケット送信指示部102は、データ送信指示に基づいて、パケット毎の送信を連続的にわせるパケット送信指示を生成する。   The packet transmission instruction unit 102 generates a packet transmission instruction for continuously transmitting each packet based on the data transmission instruction.

データ記憶部103は、送信するアプリケーションデータを記憶するデータ記憶領域と、一時バッファ領域(以下、一時バッファ)とを有する。   The data storage unit 103 has a data storage area for storing application data to be transmitted and a temporary buffer area (hereinafter referred to as a temporary buffer).

データ読み出し部104は、パケット送信指示を受け、データ記憶部103のデータ記憶領域からアプリケーションデータを1パケット分読み出す。   In response to the packet transmission instruction, the data reading unit 104 reads one packet of application data from the data storage area of the data storage unit 103.

ヘッダ生成部105は、パケット送信指示を受け、送信するパケットに含まれるデータのシーケンス番号情報を含むヘッダを生成する。   The header generation unit 105 receives a packet transmission instruction and generates a header including sequence number information of data included in the packet to be transmitted.

パケット生成部106は、生成されたヘッダと読み出されたデータからパケットを生成する。   The packet generation unit 106 generates a packet from the generated header and the read data.

ネットワークI/F部107は、生成したパケットのネットワークへの送信、及び、ネットワークからのパケットの受信を行う。   The network I / F unit 107 transmits the generated packet to the network and receives the packet from the network.

確認応答受信部108は、送信したパケットのデータのうち、どのデータまで受信されたかを示す確認応答シーケンス番号情報を含む確認応答パケットを受信する。   The confirmation response receiving unit 108 receives the confirmation response packet including the confirmation response sequence number information indicating how much of the transmitted packet data has been received.

パケット再送指示部109は、受けた確認応答シーケンス番号情報から再送するデータを特定し、データ読み出し部104とヘッダ生成部105に、特定したデータのパケット送信指示を行う。   The packet retransmission instruction unit 109 identifies data to be retransmitted from the received acknowledgment response sequence number information, and instructs the data reading unit 104 and the header generation unit 105 to transmit a packet of the identified data.

データコピー部110は、データ読み出し部104がデータを読み出した際、そのデータがアプリケーションデータの終端から数えて所定のバイト数以内のデータの場合、読み出したデータをデータ記憶部103にコピーとして保存する。   When the data reading unit 104 reads data, the data copying unit 110 stores the read data as a copy in the data storage unit 103 when the data is data within a predetermined number of bytes from the end of the application data. .

送信完了判定部111は、データ読み出し部104がアプリケーションデータの終端までデータを読み出し、かつ、前記アプリケーションデータの終端から数えて所定のバイト数以内のバイトに相当する確認応答シーケンス番号情報を含む確認応答を受信したとき、アプリケーションデータの送信完了を判定し、送信完了をデータ送信指示部101に通知する。送信完了が判定されると、次に送信するアプリケーションデータが、データ記憶部103のデータ記憶領域に上書きされる。   The transmission completion determination unit 111 reads the data until the end of the application data by the data reading unit 104, and includes a confirmation response sequence number information corresponding to bytes within a predetermined number of bytes counted from the end of the application data Is received, the transmission completion of the application data is determined, and the transmission completion is notified to the data transmission instruction unit 101. When transmission completion is determined, application data to be transmitted next is overwritten in the data storage area of the data storage unit 103.

一例として、データ送信指示部101はデータ送信装置のホストCPU上のアプリケーションソフトウェア、データ記憶部103はSDRAMなどの外部メモリ、それ以外の部分についてはNIC、ASIC、FPGAなどホストCPUとは別のハードウェアで実現される形態が考えられるが、その限りではない。たとえば当該それ以外の部分がソフトウェアにより実現されてもよい。   As an example, the data transmission instruction unit 101 is application software on the host CPU of the data transmission device, the data storage unit 103 is an external memory such as SDRAM, and the other parts are hardware other than the host CPU such as NIC, ASIC, and FPGA. Although the form implement | achieved by hardware is considered, it is not the limitation. For example, the other part may be realized by software.

具体的な処理の流れは次のようになる。まず、データ送信指示部101が、送信したいアプリケーションデータを、例えばメモリ上の先頭アドレスと長さ(アドレス0x42000000、長さ1MBなど)を指定して、パケット送信指示部102に指示を出す。これは例えば、Socket APIのsend()関数などで実現される。   The specific processing flow is as follows. First, the data transmission instructing unit 101 instructs the packet transmission instructing unit 102 to specify application data to be transmitted, for example, by specifying the start address and length (address 0x42000000, length 1 MB, etc.) on the memory. This is realized by, for example, the send () function of the Socket API.

パケット送信指示部102は、指定されたアプリケーションデータを先頭から1パケットのデータ長(例えばTCPの最大セグメントサイズ。1460バイトなど)毎に切り出す。パケット送信指示部102は、切り出したデータの先頭アドレス、長さ、先頭データのシーケンス番号などを指定して、ヘッダ生成部105にヘッダ生成指示、データ読み出し部104にデータ読み出し指示を、連続的に出す。   The packet transmission instruction unit 102 cuts out designated application data for each packet data length (for example, the maximum segment size of TCP, 1460 bytes, etc.) from the top. The packet transmission instruction unit 102 designates the start address, length, sequence number of the start data, and the like of the extracted data, and continuously generates a header generation instruction to the header generation unit 105 and a data read instruction to the data reading unit 104. put out.

例えばシーケンス番号が1から始まる場合、1パケット目の指示はアドレス0x42000000、長さ1460バイト、先頭データ(バイト)のシーケンス番号1とあらわされる。これは、シーケンス番号1から始まる長さ1460バイトのバイト列、という意味であり、実際にはシーケンス番号1〜1460のデータを指示していることになる。2パケット目の指示はアドレス0x420005b4、長さ1460バイト、シーケンス番号1461となり、3パケット目の指示はアドレス0x42000b68、長さ1460バイト、シーケンス番号2921、となる。なお、ここではシーケンス番号がバイト毎に1ずつ付与される例を示しているが、本発明はこの限りではない。   For example, if the sequence number starts from 1, the instruction for the first packet is expressed as address 0x42000000, length 1460 bytes, sequence number 1 of the first data (byte). This means a byte string having a length of 1460 bytes starting from sequence number 1, and actually indicates data of sequence numbers 1 to 1460. The second packet instruction is address 0x420005b4, length 1460 bytes, sequence number 1461, and the third packet instruction is address 0x42000b68, length 1460 bytes, sequence number 2921. Here, an example is shown in which one sequence number is assigned to each byte, but the present invention is not limited to this.

また、アプリケーションデータが1MB( = 1024×1024バイト)だとすると、1024×1024 / 1460 = 718余り296なので、718パケット目まで上記と同様に長さが1460バイトとなり、最後の719パケット目は長さ296バイトとなる。すなわち、最後の719パケット目の指示はアドレス0x420ffed8、長さ296バイト、シーケンス番号1048281、となる。   If the application data is 1MB (= 1024 x 1024 bytes), 1024 x 1024/1460 = 718 remainder 296, so the length is 1460 bytes up to the 718th packet, and the last 719th packet has a length of 296. It becomes a byte. That is, the instruction of the last 719th packet is address 0x420ffed8, length 296 bytes, sequence number 1048281.

ヘッダ生成部105は、このような指示に基づいて指定されたシーケンス番号を含むTCP/IPヘッダをプロトコル仕様に基づいて生成する。データ読み出し部104は、指定されたアドレスから指定された長さだけデータ記憶部103からデータを読み出す。ヘッダ生成部105は、生成したヘッダをパケット生成部106に渡し、データ読み出し部104は、読み出したデータを、後段のパケット生成部106に渡す。   The header generation unit 105 generates a TCP / IP header including a sequence number designated based on such an instruction based on the protocol specification. The data reading unit 104 reads data from the data storage unit 103 for a specified length from a specified address. The header generation unit 105 passes the generated header to the packet generation unit 106, and the data reading unit 104 passes the read data to the subsequent packet generation unit 106.

パケット生成部106はそれらを結合してパケットを生成し、さらにチェックサムなどをヘッダに付加してネットワークI/F部107に渡す。ネットワークI/F部107は、そのパケットをネットワークの先の受信装置に向けて送信する。   The packet generation unit 106 combines them to generate a packet, adds a checksum and the like to the header, and passes them to the network I / F unit 107. The network I / F unit 107 transmits the packet toward a receiving device on the network.

送信されたパケットが受信装置によって受信されると、受信装置はプロトコル仕様に基づき、受信したことの確認応答を返す。つまり、受信したデータの次に期待するデータのシーケンス番号を確認応答シーケンス番号として確認応答パケットに含め、送信装置に応答する。   When the transmitted packet is received by the receiving device, the receiving device returns an acknowledgment of reception based on the protocol specification. That is, the sequence number of the expected data next to the received data is included in the acknowledgment packet as the acknowledgment sequence number, and responds to the transmitting apparatus.

送信装置はその確認応答パケットを受け、確認応答シーケンス番号を見ることで、そのシーケンス番号より手前のデータは受信装置に到達したことを確認することができる。   The transmitting device receives the acknowledgment packet and looks at the acknowledgment sequence number, thereby confirming that the data before the sequence number has reached the receiving device.

もしネットワーク上でパケットが損失した場合は、受信装置では離散したシーケンス番号のパケットを受信することになる。その場合、例えばTCP/IPのプロトコル仕様では、受信装置は連続して受信した最後のデータのシーケンス番号の次に期待するデータのシーケンス番号を応答する。   If a packet is lost on the network, the receiving device receives a packet with a discrete sequence number. In this case, for example, in the TCP / IP protocol specification, the receiving apparatus responds with the sequence number of the expected data next to the sequence number of the last data received continuously.

たとえば、まずシーケンス番号1、長さ1460バイトのパケットを受信して確認応答シーケンス番号1461を応答し、その後にシーケンス番号1461、長さ1460バイトのパケットを受信して確認応答シーケンス番号2921を応答したとする。その次には、シーケンス番号2921のパケットの受信が期待される。しかし、このパケットがネットワーク上で損失して、その次のパケットであるシーケンス番号4381、長さ1460バイトのパケットを受信したとする。この場合は、あくまで連続して受信したのはシーケンス番号2920までのデータなので、確認応答シーケンス番号2921の確認応答パケットを応答することになる。   For example, first, a packet with a sequence number of 1 and a length of 1460 bytes was received and an acknowledgment sequence number 1461 was responded. Then, a packet of sequence number 1461 and a length of 1460 bytes was received and an acknowledgment sequence number of 2921 was returned. And Next, reception of the packet with the sequence number 2921 is expected. However, it is assumed that this packet is lost on the network, and the next packet with a sequence number of 4381 and a length of 1460 bytes is received. In this case, since the data received up to the sequence number 2920 is continuously received, the confirmation response packet having the confirmation response sequence number 2921 is returned.

すると、その後の後続パケットが受信装置に到達しても、受信装置からの確認応答パケットに含まれる確認応答シーケンス番号は全て2921なので、確認応答シーケンス番号2921の確認応答パケットが重複することになる。   Then, even if subsequent subsequent packets arrive at the receiving device, all of the confirmation response sequence numbers included in the confirmation response packet from the receiving device are 2921. Therefore, the confirmation response packets with the confirmation response sequence number 2921 are duplicated.

送信装置は、この重複した確認応答シーケンス番号を検知することで、そのシーケンス番号で始まるパケットがネットワーク上で損失したことを検知することができる。つまり、前述のパケット再送指示部109は、この重複した確認応答シーケンス番号のパケットを再送するパケットとして特定し、そのシーケンス番号2921の再送指示を出す。   The transmitting apparatus can detect that a packet starting with the sequence number is lost on the network by detecting the duplicate acknowledgment sequence number. That is, the packet retransmission instruction unit 109 described above identifies the packet with the duplicate acknowledgment sequence number as a packet to be retransmitted, and issues a retransmission instruction for the sequence number 2921.

具体的には、アドレス0x42000b68(シーケンス番号2921と開始シーケンス番号1との差をアプリケーションデータの先頭アドレス0x42000000に加算して算出)、長さ1460バイト、シーケンス番号2921、として出す。そして、ヘッダ生成部105、データ読み出し部104、パケット生成部106、ネットワークI/F部107はこの指示に基づいて、先と同様に再送パケットをネットワークに送信する。   Specifically, the address 0x42000b68 (calculated by adding the difference between the sequence number 2921 and the start sequence number 1 to the start address 0x42000000 of the application data), the length 1460 bytes, and the sequence number 2921 is output. Based on this instruction, the header generation unit 105, the data reading unit 104, the packet generation unit 106, and the network I / F unit 107 transmit a retransmission packet to the network in the same manner as described above.

再送パケットの特定方法に関しては上記の限りではなく、その他には例えば一定時間の間確認応答が返ってこなければ、その時点で受信している最大の確認応答シーケンス番号を再送パケットのシーケンス番号として特定する方法なども挙げられる。これらの再送パケットの特定方式はほんの一例であり、TCP/IPなどのプロトコル仕様に基づいて特定されるこれ以外の特定方式も本発明の実施形態に適用できるものとする。これらの特定方式自体は本発明の実施形態とは無関係であり、また本発明の実施形態を限定するものではない。   The method for specifying the retransmission packet is not limited to the above. For example, if no acknowledgment is returned for a certain period of time, the maximum acknowledgment sequence number received at that time is specified as the sequence number of the retransmission packet. The method of doing is also mentioned. These retransmitted packet specifying methods are merely examples, and other specific methods specified based on protocol specifications such as TCP / IP are also applicable to the embodiment of the present invention. These specific methods are not related to the embodiment of the present invention, and do not limit the embodiment of the present invention.

また、確認応答受信部108はパケットの受信時に動作することから、典型的にはその他の機能部によるパケットの送信処理とは非同期に行われる。よって、確認応答受信部108が受けた確認応答シーケンス番号の情報は、確認応答パケットを受信した時点で確認応答受信部108によっていったん不図示のメモリ等に記憶される形態も可能である。この場合、送信完了判定部111、パケット再送指示部109、その他パケット送信時に確認応答シーケンス番号の情報を参照する全ての機能部は、このメモリ等を読みだすことで確認応答シーケンス番号の情報を取得する。   Further, since the acknowledgment receiving unit 108 operates when receiving a packet, it is typically performed asynchronously with packet transmission processing by other functional units. Therefore, the confirmation response sequence number information received by the confirmation response receiving unit 108 may be temporarily stored in a memory or the like (not shown) by the confirmation response receiving unit 108 when the confirmation response packet is received. In this case, the transmission completion determination unit 111, the packet retransmission instruction unit 109, and all other functional units that refer to the information on the acknowledgment sequence number at the time of packet transmission acquire the information on the acknowledgment sequence number by reading this memory or the like. To do.

以上のようにして、アプリケーションデータを直接読み出しながらパケット送信、確認応答に基づくパケット再送が行われる。最終的にアプリケーションデータの最後のバイトの次のバイトに対応する確認応答シーケンス番号を含む確認応答パケットを受信した時点で、全てのデータを相手に送達できたことを確認できる。   As described above, packet transmission is performed while directly reading application data, and packet retransmission based on an acknowledgment is performed. Finally, when an acknowledgment packet including an acknowledgment sequence number corresponding to the byte next to the last byte of application data is received, it can be confirmed that all data has been delivered to the other party.

しかしながら、最後のバイトの次のバイトに対応する確認応答シーケンス番号を含む確認応答パケットの受信は、前述のように遅れる場合がある(図4参照)。これは、前述した(A)の遅延確認応答によるものである。(A)の遅延確認応答とは、例えばTCP/IPにおけるDelayed ACKに相当する。受信装置がデータパケットを受け取るたびに確認応答を行うのは必ずしも必要ではないことから、通信負荷及び送受信装置の処理負荷を減らすため、2パケット分のデータを受ける毎に2パケット分まとめて確認応答を出すことである。遅延確認応答では、最後の送信データが2パケットであり、かつこれら2パケットのセグメント長が、最大セグメント長のときは、遅延なく確認応答が返されるが、最後の送信データが1パケットのとき、もしくは2パケットの場合の最後のパケットのセグメント長が最大セグメント長未満のときは、仕様により確認応答が遅延するという特徴がある。   However, reception of an acknowledgment packet including an acknowledgment sequence number corresponding to the byte following the last byte may be delayed as described above (see FIG. 4). This is due to the delay confirmation response (A) described above. The delay confirmation response (A) corresponds to, for example, Delayed ACK in TCP / IP. Since it is not always necessary to receive an acknowledgment every time a receiving device receives a data packet, every two packets of data are acknowledged together in order to reduce the communication load and the processing load of the transmitting / receiving device. Is to issue. In the delayed acknowledgment, when the last transmission data is 2 packets and the segment length of these 2 packets is the maximum segment length, an acknowledgment is returned without delay, but when the last transmission data is 1 packet, Alternatively, when the segment length of the last packet in the case of two packets is less than the maximum segment length, there is a feature that the confirmation response is delayed depending on the specification.

そこで本発明の実施形態では、それを完全に待つことをせずに送信完了を判定し、次のアプリケーションデータの送信を実行可能とするように動作する。これを図 5を用いて詳細に説明する。図5は送信するデータ列を示したものであり、右向きにシーケンス番号が増加していくように記載している。   Therefore, in the embodiment of the present invention, the transmission completion is determined without waiting for it completely, and the next application data can be transmitted. This will be described in detail with reference to FIG. FIG. 5 shows a data string to be transmitted, which is described so that the sequence number increases in the right direction.

まず、データ送信指示部101がアプリケーションデータ(1)(太線部)を指定する。すると、パケット送信指示部102が図のようにデータを7つのパケット分に分割して順次パケット送信指示を出す。この送信指示に基づいて、データ読み出し部104がパケット毎にデータ記憶部(メモリ)103からデータの読み出しを行い、ヘッダ生成部105がヘッダの生成を行い、パケット生成部106がこれらのデータおよびヘッダに基づきパケットを生成し、ネットワークIF部107を介して送信する。   First, the data transmission instruction unit 101 designates application data (1) (thick line portion). Then, the packet transmission instruction unit 102 divides the data into seven packets as shown in the figure, and sequentially issues packet transmission instructions. Based on this transmission instruction, the data reading unit 104 reads data from the data storage unit (memory) 103 for each packet, the header generation unit 105 generates a header, and the packet generation unit 106 generates these data and header. Based on the above, a packet is generated and transmitted via the network IF unit 107.

ここで、データ読み出し部104は、読み出すデータがアプリケーションデータの終端から所定の長さ(この場合は2パケット分のデータの長さ)以内の場合、そのデータを再送のために一時的にデータ記憶部103のアプリケーションデータが格納されている領域(データ記憶領域)とは別の領域(一時バッファ)に記憶する。つまり、図5に示すように、データコピー部110が、データ読み出し部104により読み出されたデータを、アプリケーションデータが格納されている領域とは別の領域(例えば0x60000000)の一時バッファ(2)にコピー(3)する。   Here, when the data to be read is within a predetermined length from the end of the application data (in this case, the length of data for two packets), the data reading unit 104 temporarily stores the data for retransmission. The data is stored in an area (temporary buffer) different from the area (data storage area) where the application data of the unit 103 is stored. In other words, as shown in FIG. 5, the data copying unit 110 converts the data read by the data reading unit 104 into a temporary buffer (2) in an area (for example, 0x60000000) different from the area where the application data is stored. Copy to (3).

以上の動作と並行して受信装置からの確認応答パケットを順次受信する。受信したパケットに含まれる確認応答シーケンス番号が、先程一時バッファにコピーしたデータの先頭のデータに対応するシーケンス番号以上の値になった場合、コピーしたデータより小さいシーケンス番号のデータ(ここでは現在のアプリケーションデータのうちコピーをしていないデータに相当)は受信側に対して全て送達できたことを確認できたことになる。したがって、その時点で送信完了判定部111がアプリケーションデータの送信完了を判定し、データ送信指示部101に通知する。これは、例えばSocket APIのsend()関数で送信指示が行われた場合、そのsend()関数が返ることをもって通知される。   In parallel with the above operations, the acknowledgment packets from the receiving device are sequentially received. If the acknowledgment sequence number included in the received packet is greater than or equal to the sequence number corresponding to the first data copied to the temporary buffer, the data with the sequence number smaller than the copied data (here, the current It was confirmed that all of the application data (corresponding to data not copied) could be delivered to the receiving side. Therefore, at that time, the transmission completion determination unit 111 determines the completion of transmission of application data and notifies the data transmission instruction unit 101 of the completion. For example, when a send instruction is issued by the send () function of the Socket API, this is notified when the send () function returns.

すると、データ送信指示部101は次のアプリケーションデータ(5)(図5の三本線部)を再びsend()関数を呼ぶなどして指定し、パケット送信指示部102はそのデータを同様にパケットに分割して送信指示を出す。次のアプリケーションは、データ記憶部103のデータ記憶領域に書き込まれる。これは、1つ前のアプリケーションデータと同じ領域に書き込まれる場合もあるし、別の領域に書き込まれる場合もある。   Then, the data transmission instruction unit 101 designates the next application data (5) (three lines in FIG. 5) by calling the send () function again, and the packet transmission instruction unit 102 similarly converts the data into a packet. Divide and send instructions. The next application is written in the data storage area of the data storage unit 103. This may be written in the same area as the previous application data, or may be written in another area.

ここで、受信装置からの確認応答によって再送を行う際、図の(6)以降のシーケンス番号のデータを再送する場合は、データ読み出し部104は次のアプリケーションデータ(6)からデータを直接読みだし、(6)より手前のシーケンス番号のデータを再送する場合は、データ読み出し部104は先程コピーしたデータが記憶されている一時バッファ(2)からデータを読み出す。   Here, when retransmitting the data in response to the confirmation response from the receiving device, when retransmitting the data of the sequence numbers after (6) in the figure, the data reading unit 104 directly reads the data from the next application data (6). When retransmitting the data with the sequence number before (6), the data reading unit 104 reads the data from the temporary buffer (2) in which the previously copied data is stored.

このように動作することで、全てのデータをコピーすることなく、受信装置からの確認応答が遅れた場合でも、それを待たずして次のアプリケーションデータの送信を行うことができる。結果的に無通信時間の少ない連続的なデータ送信が可能となり、データ送信の高速化を、低消費電力で実現することができる。   By operating in this way, even when the confirmation response from the receiving apparatus is delayed without copying all the data, the next application data can be transmitted without waiting. As a result, continuous data transmission with little no-communication time becomes possible, and high-speed data transmission can be realized with low power consumption.

なお、以上の例ではアプリケーションデータの終端から2パケット分の長さのデータを一時バッファにコピーする例を示したが、この長さに関してはこの限りではない。   In the above example, an example in which data of a length of two packets from the end of the application data is copied to the temporary buffer is shown, but this length is not limited to this.

確認応答が遅延する理由として、前述の通り、(A)受信装置が遅延確認応答を行っている場合、(B)受信装置との間のネットワークの往復遅延が大きい場合、(C)受信装置の処理速度が遅い場合、などが挙げられる。   As described above, the reason why the acknowledgment response is delayed is as follows. (A) When the receiving device is making a delay acknowledgment, (B) When the round-trip delay of the network with the receiving device is large, (C) If the processing speed is slow, etc.

(A)の遅延確認応答とは、前述したように、TCP/IPにおけるDelayed ACK等に相当し、通信負荷及び送受信装置の処理負荷を減らすため、2パケット分のデータを受ける毎に2パケット分まとめて確認応答を出すことである。この場合、ネットワーク上でパケットが損失しなかった場合、いかなるアプリケーションデータのサイズでも、ワーストケースで必ずデータの最後から2パケット分より時間的に前のパケットの確認応答は遅延されずに返ってくる。したがって、送信装置では必ず2パケット分のデータをコピーして、この分の確認応答を待たずして次のアプリケーションデータを送信するように動作すれば、常に遅延確認応答の影響を受けずにデータ送信を行うことができる。   As described above, the delay confirmation response in (A) corresponds to Delayed ACK in TCP / IP, etc., and reduces the communication load and the processing load of the transmission / reception device in order to reduce the communication load by 2 packets each time data is received. It is to send a confirmation response collectively. In this case, if the packet is not lost on the network, the acknowledgment of the packet that is earlier than the last two packets from the end of the data is always returned without delay regardless of the size of any application data. . Therefore, if the transmitting device always copies two packets of data and does not wait for the confirmation response, and sends the next application data, the data is always unaffected by the delayed confirmation response. You can send.

これをもう少し詳しく説明すると次のようになる。図6はアプリケーションデータとそれに対する確認応答(実線矢印)の様子である。通常はこのように最後のパケットが最大セグメントサイズより短いが、この場合、コピーするのは最大セグメントサイズ×1+最後の短いパケット分(点線矢印の長さ分)になる。   This is explained in more detail as follows. FIG. 6 shows the application data and the confirmation response (solid arrow). Normally, the last packet is shorter than the maximum segment size in this way, but in this case, the maximum segment size × 1 + the last short packet (the length of the dotted arrow) is copied.

以上はパケットの個数が偶数個の場合だが、図 7のようにパケットの数が奇数個の場合は、最後の短いパケットだけの確認応答が遅れることになるので、このような場合は最後の1パケットだけコピーすればよい。   The above is for the case where the number of packets is an even number. However, if the number of packets is an odd number as shown in FIG. 7, the confirmation response for only the last short packet will be delayed. You only need to copy the packet.

このようにパケット数の偶奇によって当にコピーすべきサイズは最後の2パケットであったり、最後の1パケットであったりするが、簡単にはワーストケースとして最後の2パケットをコピーしておけば常に遅延の影響を受けずに済む。より最適には、以上のいずれになるかを予測して、1パケットでよい場合は1パケットだけコピーするように動作することが望ましい。このような判断のもとに、コピーするデータサイズを特定するコピーサイズ特定部112を備えた構成を図 8に示す。図1と同一名称の要素には同一の符号を付して、拡張された処理を除き、重複する説明を省略する。コピーサイズ特定部112は、パケット数の偶奇を判断し、偶数の場合は最後の2パケット、奇数の場合は最後の1パケットのみコピーすることを決定し、データコピー部110に通知する。あるいは、偶数の場合は最後の2パケット分のデータ長、奇数の場合は最後の1パケットのデータ長を特定し、特定したデータ長をデータコピー部110に通知する。データコピー部110は、通知された情報にしたがって、コピーを行う。   In this way, the size that should be copied due to the odd / even number of packets is the last 2 packets or the last 1 packet, but as a worst case it is always possible to copy the last 2 packets It is not affected by delay. More optimally, it is desirable to predict which one of the above will occur, and to operate so as to copy only one packet when one packet is sufficient. FIG. 8 shows a configuration including a copy size specifying unit 112 for specifying the data size to be copied based on such a determination. Elements having the same names as those in FIG. 1 are denoted by the same reference numerals, and redundant description is omitted except for extended processing. The copy size specifying unit 112 determines whether the number of packets is even or odd, determines that only the last two packets are copied when the number is even, and copies only the last one packet when the number is odd, and notifies the data copy unit 110 of the copy. Alternatively, if the number is even, the data length of the last two packets is specified. If the number is odd, the data length of the last one packet is specified, and the specified data length is notified to the data copy unit 110. The data copy unit 110 performs copying according to the notified information.

また、以上は前述の確認応答が遅れる理由(A)の場合に対応した形態だが、(B)受信装置との間のネットワークの往復遅延が大きい場合、(C)受信装置の処理速度が遅い場合、に対応に対しては、以下の形態が可能である。送信装置において、直ちに返ってくる偶数パケット目の確認応答の、対応するデータを送信した時間からの経過時間、すなわち、確認応答の遅延時間と、現在のデータ送信ビットレートを測定する。そして、これら遅延時間とデータ送信ビットレートの積に応じたデータサイズを、前述の1パケット分または2パケット分のサイズへ、さらに加えたサイズだけをコピーする。積に応じたデータサイズとしては、当該積の値そのものでもよいし、あるいは、最大セグメント長×2が当該積の値以上のときは、最大セグメント長×2でよい。当該最大セグメント長×2が当該積の値未満のときは、当該積の値未満で、最大セグメント長×2の倍数の最大値、あるいは当該積の値以上で、最大セグメント長×2の倍数の最小値でもよい。送信完了判定では、追加コピーされたデータの確認応答を待たずして、送信完了を判定することができる。   Also, the above is a form corresponding to the reason (A) that the confirmation response is delayed as described above, but (B) when the round-trip delay of the network with the receiving device is large, (C) when the processing speed of the receiving device is slow In response to the above, the following modes are possible. In the transmission apparatus, the elapsed time from the time when the corresponding response of the even-numbered packet immediately returned is transmitted, that is, the delay time of the acknowledgment, and the current data transmission bit rate are measured. Then, the data size corresponding to the product of the delay time and the data transmission bit rate is further copied to the size of one packet or two packets described above. The data size corresponding to the product may be the value of the product itself, or may be the maximum segment length × 2 when the maximum segment length × 2 is equal to or greater than the value of the product. When the maximum segment length x 2 is less than the product value, it is less than the product value and is the maximum multiple of the maximum segment length x 2, or the product value greater than or equal to the maximum segment length x 2 It may be the minimum value. In the transmission completion determination, the transmission completion can be determined without waiting for the confirmation response of the additionally copied data.

確認応答の遅延時間を測定する遅延測定部113、送信ビットレートの測定を行う送信レート測定部114を備えた構成を図9に示す。図8と同一名称の要素には同一の符号を付して、拡張された処理を除き、重複する説明を省略する。遅延測定部113は、パケット生成部がパケットをネットワークI/F部に渡してから確認応答が受信されるまでの遅延時間を、直ちに返ってくる偶数パケット目について測定する。送信レート測定部114は、パケット生成部106により生成されるパケットの送信を観測することで、データ送信における単位時間当たりの送信データ長さを測定することで、送信ビットレートを得る。コピーサイズ特定部112は、これら遅延時間と送信ビットレートとに基づき、追加してコピーするサイズを特定し、特定したサイズを、前述したデータサイズ(たとえば2パケット分)に加算した値だけ、コピーを行う。送信完了判定部111は、全てのデータのパケットを送信し、かつ、コピーするデータの先頭バイトのシーケンス番号以上を示す確認応答を受信した時点で、送信完了を判定する。このような形態によって、(B)や(C)の遅延が加わっても、その影響を受けずに連続したデータ送信を実現できる。   FIG. 9 shows a configuration including a delay measuring unit 113 that measures the delay time of the confirmation response and a transmission rate measuring unit 114 that measures the transmission bit rate. Elements having the same names as those in FIG. 8 are denoted by the same reference numerals, and redundant description is omitted except for extended processing. The delay measurement unit 113 measures the delay time from when the packet generation unit passes the packet to the network I / F unit until the confirmation response is received for the even-numbered packet that returns immediately. The transmission rate measuring unit 114 obtains a transmission bit rate by measuring the transmission data length per unit time in the data transmission by observing the transmission of the packet generated by the packet generation unit 106. Based on the delay time and the transmission bit rate, the copy size specifying unit 112 specifies the size to be additionally copied, and copies only the value obtained by adding the specified size to the data size (for example, 2 packets) described above. I do. The transmission completion determination unit 111 determines transmission completion when it transmits all the data packets and receives an acknowledgment indicating the sequence number of the first byte or more of the data to be copied. With such a configuration, even if the delays (B) and (C) are added, continuous data transmission can be realized without being affected by the delay.

次に、データ送信がさらに進んだ場合の処理について述べる。以上の例では、あるアプリケーションデータの送信に引き続き、その次のアプリケーションデータの送信が実行される処理について説明した。   Next, processing when data transmission further proceeds will be described. In the above example, the process in which the transmission of the next application data is executed following the transmission of certain application data has been described.

この「次のアプリケーションデータ」の送信が進んでその終端に近づくと、最初のアプリケーションデータの送信と同様に、やがて一時バッファへのデータコピーを行うことになる。しかしながら、この時点で最初のアプリケーションデータの最後のデータ(=最初のアプリケーションデータをコピーした一時バッファ上の最後のデータ)に対する確認応答(つまり図5において(6)のシーケンス番号の確認応答)が返ってきていない場合、依然としてその一時バッファのデータを再送する可能性があることから、一時バッファ上のデータを残しておく必要がある。   When the transmission of the “next application data” proceeds and approaches its end, data is eventually copied to the temporary buffer in the same manner as the transmission of the first application data. However, at this point, the confirmation response to the last data of the first application data (= the last data on the temporary buffer to which the first application data was copied) (that is, the confirmation response of the sequence number (6) in FIG. 5) is returned. If not, the data in the temporary buffer may still be retransmitted, so it is necessary to leave the data in the temporary buffer.

よって、その状態で次のアプリケーションデータの一時バッファへのコピーを実行してしまうと、一時バッファ上のデータが次のアプリケーションデータによって上書きされてしまうため、その後に最初のアプリケーションデータの再送を行った場合、本来とは異なるデータを再送してしまうという問題が生じる。この問題を回避する形態を図10に示す。   Therefore, if the next application data is copied to the temporary buffer in that state, the data on the temporary buffer will be overwritten by the next application data. In this case, there arises a problem that data different from the original is retransmitted. A form that avoids this problem is shown in FIG.

図10は図1に加え、パケット送信指示部102のパケット送信指示を一時的に止めさせるパケット送信抑制部115を備えている。図1と同一名称の要素には同一の符号を付して、拡張された処理を除き、重複する説明を省略する。   FIG. 10 includes, in addition to FIG. 1, a packet transmission suppression unit 115 that temporarily stops the packet transmission instruction of the packet transmission instruction unit 102. Elements having the same names as those in FIG. 1 are denoted by the same reference numerals, and redundant description is omitted except for extended processing.

図 11は 図 5と(1)〜(6)まで同じであり、アプリケーションデータ(5)の一時バッファへのコピーの開始時点を示す(7)が加わっている。   FIG. 11 is the same as (1) to (6) in FIG. 5, with the addition of (7) indicating the start point of copying application data (5) to the temporary buffer.

上述のように次のアプリケーションデータの送信がこの(7)まで到達したとする。このとき、パケット送信抑制部115は、その前のアプリケーションデータの最後のデータ(6)の確認応答が返ってきていない間は、パケット送信指示部102にパケット送信を一時的に止めさせる。確認応答が返ってきたら、パケット送信を再開させる。このように動作することで、一時バッファに残っているひとつ前のアプリケーションデータを、現在のアプリケーションデータで上書きすることがなくなるので、上述の問題を回避することが出来る。   As described above, it is assumed that transmission of the next application data has reached this (7). At this time, the packet transmission suppressing unit 115 causes the packet transmission instructing unit 102 to temporarily stop packet transmission while the confirmation response of the last data (6) of the previous application data is not returned. When the confirmation response is returned, the packet transmission is resumed. By operating in this way, the previous application data remaining in the temporary buffer is not overwritten with the current application data, so that the above-mentioned problem can be avoided.

より最適には次のようにしてもよい。データ(6)の確認応答が返ってきていなくても、データ(6)より1パケット手前の確認応答が返ってきている場合は、一時バッファ内の2パケット分のうち最初の1パケット目のデータは送達が確認できたことになるので再送は不要となり、データを解放してよいことを意味する。よって、この場合は(7)のパケット送信を行い、そのパケットのデータを一時バッファの1パケット目の領域にコピーし、(7)より次のパケットの送信に達した時に、パケット送信指示を止めさせるように動作してもよい。   More optimally, it may be as follows. Even if the confirmation response for data (6) is not returned, if the confirmation response is one packet before data (6), the first packet data of the two packets in the temporary buffer Means that since the delivery has been confirmed, retransmission is unnecessary and the data can be released. Therefore, in this case, the packet transmission of (7) is performed, the packet data is copied to the first packet area of the temporary buffer, and the packet transmission instruction is stopped when the transmission of the next packet from (7) is reached. It may operate to

しかしながら、以上のような送信抑制は性能を少なからず低下させる場合がある。例えばアプリケーションデータが、一時バッファへのコピーサイズより小さい場合に顕著である。なぜなら、この場合アプリケーションデータは全て一時バッファにコピーすることになるので、つまりはこの時点でひとつ前のアプリケーションデータの最後のデータの確認応答が返ってきていない場合は、全くデータを送信できなくなる。このような場合でも性能を低下させないようにするには、より複雑な一時バッファの管理を行うことが望ましい。その場合の形態を図 12に示す。図 12は図 10に加え、一時バッファの管理を行うバッファ管理部を備えている。図10と同一名称の要素には同一の符号を付して、拡張された処理を除き、重複する説明を省略する。   However, transmission suppression as described above may degrade the performance. For example, this is remarkable when the application data is smaller than the copy size to the temporary buffer. This is because all application data is copied to the temporary buffer in this case, that is, if no confirmation response of the last data of the previous application data is returned at this time, no data can be transmitted. In order to prevent the performance from being degraded even in such a case, it is desirable to manage more complicated temporary buffers. Figure 12 shows the configuration in that case. FIG. 12 includes a buffer management unit for managing temporary buffers in addition to FIG. Elements having the same names as those in FIG. 10 are denoted by the same reference numerals, and redundant description is omitted except for extended processing.

バッファ管理部116の動作の一例としては、複数の一時バッファおよびそのアドレス情報を管理する形態が考えられる。例えば一時バッファ1〜8の8つの一時バッファを持っていたとすると、最初のアプリケーションデータのコピーは一時バッファ1を用い、次のアプリケーションデータのコピーは一時バッファ2を用い、その次のアプリケーションデータのコピーは一時バッファ3を用い、というように用いることで、確認応答が全く返ってこない段階でも8つのアプリケーションデータの送信を可能とする。また、1つ目のアプリケーションデータの最後のデータの確認応答が返ってくれば、1つ目の一時バッファを解放して9つめのアプリケーションデータのコピーに使用するなど、順次使いまわすことが出来る。   As an example of the operation of the buffer management unit 116, a form in which a plurality of temporary buffers and their address information are managed can be considered. For example, if you have 8 temporary buffers 1 to 8, temporary application 1 uses temporary buffer 1 and next application data uses temporary buffer 2 and the next application data copy. By using the temporary buffer 3, it is possible to transmit eight application data even when no confirmation response is returned. Also, if an acknowledgment of the last data of the first application data is returned, the first temporary buffer can be released and used for copying the ninth application data, and so on.

あくまでも一時バッファの個数は有限なので、それが枯渇した時点でパケット送信を抑制する動作は必要だが、このような複数の一時バッファの管理を行うことで、確認応答を待たずして複数のアプリケーションデータの送信を行うことができ、ひいては前述の性能低下を軽減することが出来る。   Since the number of temporary buffers is limited, it is necessary to suppress packet transmission when it is depleted, but by managing multiple temporary buffers like this, multiple application data can be sent without waiting for confirmation responses. Can be transmitted, and as a result, the aforementioned performance degradation can be reduced.

もう一つの例としては、コピーするデータを連結させる形態が考えられる。アプリケーションデータが一時バッファへのコピーサイズより小さい場合に性能の低下が顕著になる場合について説明したが、例えばこの場合、最初のアプリケーションデータのコピーを先頭から行い、それに後続して同じ一時バッファに次のアプリケーションデータのコピーを行う。   As another example, a form in which data to be copied is linked is conceivable. The case where the performance degradation is noticeable when the application data is smaller than the copy size to the temporary buffer has been described. For example, in this case, the first application data is copied from the beginning, and then the same temporary buffer is next copied. Copy the application data.

例えば最初のアプリケーションデータのコピーが1000バイトで、次のアプリケーションデータが3バイトだった場合、この3バイトのコピーを同じ一時バッファの1001〜1003バイト目に対して行う。さらに次のアプリケーションデータが15バイトだった場合、やはり同じ一時バッファの1004〜1018バイト目に対してコピーを行う。この状態で最初のアプリケーションデータのコピーの最初のデータのシーケンス番号を先頭としたパケットの再送を行う場合、簡単にはこれら1018バイトを全て読みだして連結したパケットを送信する。   For example, when the first copy of application data is 1000 bytes and the next application data is 3 bytes, the 3 bytes are copied to the 1001st to 1003rd bytes of the same temporary buffer. If the next application data is 15 bytes, the data is copied to the 1004th to 1018th bytes of the same temporary buffer. In this state, when retransmitting a packet starting with the sequence number of the first data of the first copy of the application data, all these 1018 bytes are read out and a concatenated packet is transmitted.

実際にネットワークで損失したのは最初の1000バイトだけであり、その後ろの18バイトは受信装置にすでに到達している可能性があるが、その場合は受信装置によってその18バイトが破棄されるだけであり、特に問題とはならない場合がある。   Only the first 1000 bytes were actually lost on the network, and the subsequent 18 bytes may have already reached the receiving device, in which case the receiving device simply discards the 18 bytes. It may not be a problem.

以上のように、このような動作でも確認応答を待たずして複数のアプリケーションデータの送信を行うことができ、ひいては前述の性能低下を軽減することが出来る。なお、どこからどこまでが1パケットの塊かの情報(例えばこの場合だと1000バイト、3バイト、15バイトという情報)を別途保持して、この情報をもとに、先ほど説明した再送において1000バイトのみのパケットを再送してもよい。   As described above, even in such an operation, a plurality of application data can be transmitted without waiting for a confirmation response, and the above-described performance degradation can be reduced. In addition, information on where one packet is from (for example, information of 1000 bytes, 3 bytes, and 15 bytes in this case) is kept separately, and based on this information, only 1000 bytes in the retransmission explained earlier May be retransmitted.

(第2の実施形態)(FIN受信時の構成)
インターネット等で広く用いられるTCP/IPなどのプロトコル処理は、従来主にCPU上で動作するソフトウェアにより実現されていた。しかしながら、近年のネットワーク高速化に伴い、CPUのTCP/IP処理負荷が増大しており、TCP/IP処理を専用のハードウェアによって行うTOE(TCP/IP Offload Engine)を用いることにより、高速な通信を実現する装置が提案されている。
(Second embodiment) (FIN reception configuration)
Conventionally, protocol processing such as TCP / IP widely used in the Internet has been realized mainly by software operating on a CPU. However, as the network speed increases in recent years, the CPU's TCP / IP processing load has increased. By using a TOE (TCP / IP Offload Engine) that performs TCP / IP processing using dedicated hardware, high-speed communication is possible. An apparatus for realizing the above has been proposed.

従来のデータ通信装置には、低速処理用の通信アダプタと高速処理用の通信アダプタを備え、アルゴリズムが複雑なTCPセッション接続および切断用のパケット処理のみを低速処理用の通信アダプタで実行し、映像データなどを含んだペイロード伝送用のパケット処理のみを高速アダプタで実行するものがあった。しかし、この装置では、ネットワーク上でロスなどが発生し、データの再送が発生している場合に、セッションを切断するためのコントロールフラグにFINがセットされたセグメント(以下、FINセグメント)を受信した時に問題があった。低速アダプタではFINセグメントを受信すると、セッション状態をCLOSE-WAITに遷移させるが、上記のようにデータの再送が発生している間にこの状態遷移を行うと、高速処理用の通信アダプタで、再送データを受信できなくなる問題があった。   A conventional data communication device is equipped with a communication adapter for low-speed processing and a communication adapter for high-speed processing. Only TCP session connection and disconnection packet processing with complicated algorithms is executed by the communication adapter for low-speed processing. Some high-speed adapters execute only packet processing for payload transmission including data. However, this device receives a segment (hereinafter referred to as the FIN segment) in which FIN is set in the control flag for disconnecting the session when data is retransmitted due to loss on the network. Sometimes there was a problem. When the low-speed adapter receives the FIN segment, the session state transitions to CLOSE-WAIT. However, if this state transition occurs while data retransmission is occurring as described above, the communication adapter for high-speed processing There was a problem that data could not be received.

以下、このような問題を解消する第2の実施形態について詳細に説明する。   Hereinafter, a second embodiment for solving such a problem will be described in detail.

図 13は、本発明の第2の実施形態に係わるデータ通信装置を示すブロック図である。
この第2の実施形態に係わるデータ通信装置は、クライアントからネットワークを介してTCPによりコンテンツを受信してストレージに保存したり、逆にストレージに蓄積されたコンテンツをネットワーク経由でクライアントに送信したりするコンテンツ蓄積サーバである。
FIG. 13 is a block diagram showing a data communication apparatus according to the second embodiment of the present invention.
The data communication apparatus according to the second embodiment receives content from the client via the network via TCP and stores it in the storage, or conversely transmits the content accumulated in the storage to the client via the network. It is a content storage server.

このサーバは、CPU201、システムメモリ202、ストレージ203、TOE204から構成され、それぞれはローカルバスや、PCI Express などのバスで接続される。   This server includes a CPU 201, a system memory 202, a storage 203, and a TOE 204, which are connected by a local bus or a bus such as PCI Express.

CPU201は制御処理部215を備えている。TOE204は、データ処理部211と、データ終端検出部212と、データ受信完了判定部213と、データ終端受信完了通知部214と、情報共有部216とを備えている。   The CPU 201 includes a control processing unit 215. The TOE 204 includes a data processing unit 211, a data end detection unit 212, a data reception completion determination unit 213, a data end reception completion notification unit 214, and an information sharing unit 216.

データ処理部211は、ネットワーク220を介してデータを送受信するための処理を行う。具体的に、データ処理部211は、相手装置からネットワークを介して一連のデータをデータ毎に受信する。   The data processing unit 211 performs processing for transmitting and receiving data via the network 220. Specifically, the data processing unit 211 receives a series of data for each data from the counterpart device via the network.

データ終端検出部212は、受信したデータに含まれるデータ終端情報(FINフラグ)を検出する。データ終端情報は、データ通信の終了指示に相当する。一連のデータの末尾の終端データが、このデータ終端情報を含んでいる。   The data end detection unit 212 detects data end information (FIN flag) included in the received data. The data end information corresponds to a data communication end instruction. The end data at the end of the series of data includes this data end information.

データ受信完了判定部213は、データ終端情報が検出されると、一連のデータの全データの受信が完了したか否かを判定する。   When data end information is detected, the data reception completion determination unit 213 determines whether reception of all data in a series of data is completed.

データ終端受信完了通知部214は、データ終端までの全データの受信が完了したと判定されると、通信相手の機器に対して全データの受信が完了したと通知するよう、データ処理部211に指示する。   When it is determined that reception of all data up to the end of data has been completed, the data end reception completion notifying unit 214 notifies the data processing unit 211 to notify the communication partner device that reception of all data has been completed. Instruct.

制御処理部215は、データ通信における自端末の状態(セッションの状態)を制御する。   The control processing unit 215 controls the state of the terminal itself (session state) in data communication.

情報共有部216は、制御処理部215とデータ処理部211で共有する、セッション情報を保持する。セッション情報は、制御処理部215で制御されるセッション状態も含んでいる。データ処理部211は、情報共有部216で保持されるセッション情報に基づき、データ通信を行う。たとえばデータ処理部211は、セッション状態がESTABLISHEDである間は、相手装置からのデータを受信するが、CLOSE-WAIT 1であるときは、データの受信を行わない。   The information sharing unit 216 holds session information shared by the control processing unit 215 and the data processing unit 211. The session information includes a session state controlled by the control processing unit 215. The data processing unit 211 performs data communication based on the session information held by the information sharing unit 216. For example, the data processing unit 211 receives data from the counterpart device while the session state is ESTABLISHED, but does not receive data when it is CLOSE-WAIT 1.

本装置は、RFC793で定義されるTCPを用いて通信を行う。図 19にTCPのヘッダ構造を示す。   This device communicates using TCP defined in RFC793. Figure 19 shows the TCP header structure.

本装置を用いてクライアントからネットワークを介してコンテンツをストレージに蓄積する例について説明する。   An example in which content is stored in a storage from a client via a network using this apparatus will be described.

まず、本装置では、各部の初期化処理などの後、CPU201の制御処理部215にて、TCPのセッション確立を行うための準備を行う。TCPのセッション状態一覧を図20の表に示す。本装置はサーバとして動作するため、例えば50000番などのあらかじめ決められたポート番号でTCPのセッション情報を作成し、その状態をLISTENに設定にする。なお図中の「ローカルユーザ」は、本装置のCPUで動作するアプリケーション等を意味する。図21の表にセッション情報の例を示す。このセッション情報をセッション毎に情報共有部216に保持する。なお、セッション情報はIPアドレスとポート番号を使って、ハッシュリストを作成し、合致するセッションの探索を高速化してもよい。   First, in this apparatus, after initialization processing of each unit, the control processing unit 215 of the CPU 201 prepares for establishing a TCP session. A list of TCP session states is shown in the table of FIG. Since this apparatus operates as a server, TCP session information is created with a predetermined port number such as 50000, and the state is set to LISTEN. “Local user” in the figure means an application or the like that runs on the CPU of this apparatus. An example of session information is shown in the table of FIG. This session information is held in the information sharing unit 216 for each session. Note that the session information may use a IP address and a port number to create a hash list to speed up the matching session search.

このように準備を行った状態で、他の通信装置(以降、相手装置とする)からTCPの接続要求が行われる。TCPでは、スリーウェイハンドシェイクと呼ばれる手順にて接続確立を行う。相手装置からは、例えばOSの割り当てた使用していないポート番号を始点ポート番号に設定し、終点ポート番号に本装置の待ち受けポート番号50000を設定し、シーケンス番号、データオフセット、ウィンドウサイズ、チェックサム、緊急ポインタを適切に設定し、コントロールフラグにはSYNのみを立てたTCPセグメント(以下、SYNセグメントと呼ぶ)が送信される。   With this preparation, a TCP connection request is made from another communication device (hereinafter referred to as a partner device). In TCP, connection is established by a procedure called three-way handshake. From the partner device, for example, set the unused port number assigned by the OS as the start port number, set the standby port number 50000 of this device as the end port number, sequence number, data offset, window size, checksum Then, a TCP segment (hereinafter referred to as SYN segment) in which only the SYN is set in the control flag is transmitted with the emergency pointer set appropriately.

ネットワークを介してこれを受信した本装置では、まずデータ処理部211で、TCPの下位層プロトコルの受信処理を行う。ここで、下位層のプロトコルとは、例えば、物理層およびデータリンク層はEthernet(R)であり、ネットワーク層はIPv4(Internet Protocol version 4)である。下位層プロトコルの処理が行われた後、TCPの受信処理を行う。   In this apparatus that has received this via the network, the data processing unit 211 first performs reception processing of the TCP lower layer protocol. Here, the lower layer protocol is, for example, Ethernet (R) for the physical layer and the data link layer, and IPv4 (Internet Protocol version 4) for the network layer. After the lower layer protocol processing is performed, TCP reception processing is performed.

TCPの受信処理では、まずTCPのチェックサムが正しいかどうかの判別を行い、セグメントが壊れていないことを確認する。セグメントが壊れていないことを確認した後、セッション情報の探索を行う。   In the TCP reception process, first, it is determined whether the TCP checksum is correct, and it is confirmed that the segment is not broken. After confirming that the segment is not broken, search for session information.

本装置では、CPU201とTOE204で協調してTCP/IPの処理を行うため、セッションの情報を情報共有部216にて共有している。この情報共有部216は、TOE204内のSRAM(Static Random Access Memory)で実現してもよいし、システムメモリ上で実現してもよい。   In this apparatus, since the CPU 201 and the TOE 204 perform TCP / IP processing in cooperation, the information sharing unit 216 shares session information. The information sharing unit 216 may be realized by an SRAM (Static Random Access Memory) in the TOE 204 or may be realized on a system memory.

データ処理部211は、受信したセグメントのコントロールフラグフィールドを確認する。また、データ処理部211は、受信したTCPセグメントの始点IPアドレス、終点IPアドレス、始点ポート、終点ポートに合致するセッションが情報共有部216に存在するかどうか、また、そのセッション状態の確認を行う。   The data processing unit 211 confirms the control flag field of the received segment. In addition, the data processing unit 211 confirms whether or not there is a session in the information sharing unit 216 that matches the start point IP address, end point IP address, start point port, and end point port of the received TCP segment, and the session state thereof. .

受信したセグメントと合致するセッションが存在し、セグメントに含まれるデータが受信ウィンドウ範囲内にある場合、データ処理部211はシステムメモリ202にデータを書き込み、ストレージ203にデータを保存し、RCV_NXTやRCV_WNDなどのセッション情報更新処理を行い、相手装置に対してコントロールフラグにACKをセットしたセグメント(ACKセグメント)を送信する。   If there is a session that matches the received segment and the data contained in the segment is within the reception window range, the data processing unit 211 writes the data to the system memory 202, saves the data to the storage 203, RCV_NXT, RCV_WND, etc. Session information update processing is performed, and a segment (ACK segment) in which ACK is set in the control flag is transmitted to the partner apparatus.

ただし、データ処理部211は、セッション情報のRCV_SHUTがセットされている場合は、セグメントにデータが含まれていてもデータの処理は行わない。さらに、データ処理部211は以下の条件のいずれかに当てはまる場合、フレームを制御処理部215に渡し、制御処理部215で処理を行う。
・セッションの状態がSYN-RECEIVED(以下、SYN-RECV)である
・セッション情報のRCV_SHUTがセットされている
・受信したセグメントが、送信したFINセグメントに対するACKである
・受信したセグメントのコントロールフラグに、RST、SYN、FINのいずれかがセットされている
RCV_SHUTは以降のセグメントの受信を禁止するものである。制御処理部215にてセッションを切断する際のオプションとして送信のみを禁止するか、受信のみを禁止するか、送受ともに禁止するかを指定できる。この時、受信を禁止した場合にRCV_SHUTがセットされる。
However, when the session information RCV_SHUT is set, the data processing unit 211 does not process the data even if the segment includes data. Further, the data processing unit 211 passes the frame to the control processing unit 215 and performs processing in the control processing unit 215 when any of the following conditions is satisfied.
-Session status is SYN-RECEIVED (hereinafter SYN-RECV)-Session information RCV_SHUT is set-The received segment is an ACK for the sent FIN segment-In the control flag of the received segment, Either RST, SYN, or FIN is set
RCV_SHUT prohibits subsequent segment reception. The control processing unit 215 can specify whether to prohibit only transmission, only reception, or both transmission and reception as options when disconnecting the session. At this time, RCV_SHUT is set when reception is prohibited.

制御処理部215は、セッション情報に合致しなかったTCPの処理を行う機能を備えており、クライアントからのSYNセグメントを受信した場合には、情報共有部216のセッション情報から、セッション状態がLISTEN状態で、かつ始点IPアドレス、終点IPアドレス、終点ポートが合致するセッションを探索する。   The control processing unit 215 has a function for processing TCP that does not match the session information. When a SYN segment is received from the client, the session state is set to the LISTEN state from the session information of the information sharing unit 216. And search for a session that matches the start point IP address, end point IP address, and end point port.

合致するものがなければ、コントロールフラグにRSTを立てたTCPセグメントを送信することをデータ処理部211に指示する。   If there is no match, the data processing unit 211 is instructed to transmit a TCP segment with the control flag set to RST.

一方、合致するセッションがあれば、セッション状態をSYN-RECVに変更し、初期化したシーケンス番号と、1増加させた確認応答番号、ウィンドウサイズ等の情報をセッション情報として保存する。   On the other hand, if there is a matching session, the session state is changed to SYN-RECV, and the information such as the initialized sequence number, the acknowledgment number increased by 1 and the window size is stored as session information.

その後、コントロールフラグにSYNとACKを立てたTCPセグメント(以下、SYN-ACKと呼ぶ)を送信することをデータ処理部211に指示する。   Thereafter, the data processing unit 211 is instructed to transmit a TCP segment (hereinafter referred to as SYN-ACK) in which SYN and ACK are set in the control flag.

クライアントでは、このSYN-ACKセグメントを受信すると、これに対するACKセグメントを送信する。   When the client receives this SYN-ACK segment, it transmits an ACK segment corresponding to the SYN-ACK segment.

これを受信したデータ処理部211では、下位層プロトコルの処理を行った後、TCPのチェックサムを計算し、セグメントが壊れていなければ、セッションの探索を行う。探索により、合致するセッション情報が見つかり、そのセッション状態はSYN-RECVであるので、フレームをCPUの制御処理部215に渡す。制御処理部215では、SYNに対するACKセグメントであることを認識し、セッション状態をESTABLISHED状態に変更する。   Upon receiving this, the data processing unit 211 performs a lower layer protocol process, calculates a TCP checksum, and searches for a session if the segment is not broken. As a result of the search, matching session information is found, and since the session state is SYN-RECV, the frame is passed to the control processing unit 215 of the CPU. The control processing unit 215 recognizes that it is an ACK segment for SYN, and changes the session state to the ESTABLISHED state.

なお、SYN-RECIEVED状態またはSYN-SENT状態で、SYNセグメントに対するACKセグメントを受信してESTABLISHED状態に変化させる時のみ、TOE204側で確認応答番号を1増加させ、セッションの状態をESTABLISHED状態に変化させる特定状態制御処理部(図示なし)を備えてもよい。特定状態制御処理部を備えることで、CPUの動作速度が十分でない場合にも、データセグメントを取りこぼすことなく、通信を行うことが可能となる。   Only in the SYN-RECIEVED state or SYN-SENT state, when the ACK segment for the SYN segment is received and changed to the ESTABLISHED state, the confirmation response number is incremented by 1 on the TOE 204 side and the session state is changed to the ESTABLISHED state. A specific state control processing unit (not shown) may be provided. By providing the specific state control processing unit, it is possible to perform communication without missing a data segment even when the operation speed of the CPU is not sufficient.

状態がESTABLISHED状態になると、クライアントからデータの送信が行われる。このデータの転送では、データを含むTCPセグメントが送信され、それを受信した本装置では、データ処理部211で、下位層プロトコルとTCPのチェックサム計算を行い、情報共有部216からセッションを探索する。この場合、合致するセッションが見つかり、セグメントに含まれるデータが受信ウィンドウの範囲内であれば、情報共有部216のRCV_NXTやRCV_WNDといったセッション情報を更新し、データをシステムメモリ202上に書き込み、ストレージ203に保存する。また、さらに、受信したデータに対するACKセグメントを生成し、ネットワークを介して、クライアントに送信する。   When the state becomes the ESTABLISHED state, data is transmitted from the client. In this data transfer, a TCP segment including data is transmitted, and in this apparatus that has received it, the data processing unit 211 performs a checksum calculation of the lower layer protocol and TCP, and searches for a session from the information sharing unit 216. . In this case, if a matching session is found and the data included in the segment is within the range of the reception window, the session information such as RCV_NXT and RCV_WND of the information sharing unit 216 is updated, the data is written on the system memory 202, and the storage 203 Save to. Further, an ACK segment for the received data is generated and transmitted to the client via the network.

図 14は、本発明の第2の実施形態に係わるデータ通信装置の動作を示すフローチャートである。   FIG. 14 is a flowchart showing the operation of the data communication apparatus according to the second embodiment of the present invention.

クライアントでは、送信すべきデータが全て送信されると、セッションを切断するため、コントロールフラグにFINをセットしたセグメントを生成し、送信する。   When all of the data to be transmitted is transmitted, the client generates a segment with FIN set in the control flag and transmits it to disconnect the session.

データ処理部211ではクライアントからのセグメントを受信し、下位層のプロトコル処理を行った後、TCPのチェックサム計算を行い、情報共有部216から合致するセッションの探索を行う(S101)。この場合、セッションの状態がESTABLISHEDのものが見つかる。続いて、シーケンス番号が受信ウィンドウ内であるかの確認と、確認応答番号の確認を行い、データが受信ウィンドウの範囲内であれば、情報共有部216のセッション情報のうち、RCV_NXTや、RCV_WNDといった値を更新し、システムメモリ202にデータを書き出し、ストレージ203にデータを保存する。また、相手装置にACKセグメントを送信する。   The data processing unit 211 receives a segment from the client, performs lower layer protocol processing, performs TCP checksum calculation, and searches for a matching session from the information sharing unit 216 (S101). In this case, a session whose status is ESTABLISHED is found. Next, it is confirmed whether the sequence number is within the reception window and the confirmation response number, and if the data is within the range of the reception window, among the session information of the information sharing unit 216, RCV_NXT, RCV_WND, etc. The value is updated, the data is written to the system memory 202, and the data is stored in the storage 203. Also, an ACK segment is transmitted to the partner apparatus.

データ終端検出部212によりコントロールフラグにFINがセットされたセグメントの受信が検出されたか判断し(S102)、検出されないときは(S102のNO)、ステップS201に戻る。   The data end detection unit 212 determines whether or not reception of a segment whose FIN is set in the control flag has been detected (S102). If not detected (NO in S102), the process returns to step S201.

FINがセットされたセグメントの受信が検出されると(S102のYES)、情報共有部216のセッション情報のFIN_RECVエントリに、FINを受信したことを設定する(S103)。また、FIN_SEQにFINセグメントに含まれる最後のデータのシーケンス番号を記憶させる(S103)。   When reception of a segment in which FIN is set is detected (YES in S102), the fact that FIN has been received is set in the FIN_RECV entry of the session information of the information sharing unit 216 (S103). Further, the sequence number of the last data included in the FIN segment is stored in FIN_SEQ (S103).

データ受信完了判定部213は情報共有部216からセッション情報のRCV_NXTと、FIN_SEQを読み出し、RCV_NXTがFIN_SEQに達したかどうかを判定する(S104)。この時に、まだRCV_NXTがFIN_SEQに達していない場合は(S104のNO)、新たなセグメントを受信する度に、データ処理部211からデータ受信完了判定部213に通知を行い、データ受信完了の判定を行う。
データ終端が検出され、データ受信が完了したら(S104のYES)、制御処理部215に通知を行い、また、FINセグメントに対するACKセグメントを送信するようデータ終端受信完了通知部214がデータ処理部211に指示する(S105)。また制御処理部215が、状態をESTABLISHEDからCLOSE-WAITに遷移させる(S106)。なお、このときの確認応答番号はFINを1byte分のデータとして扱い、FIN_SEQ+1の値を確認応答番号として送信する。
The data reception completion determination unit 213 reads the session information RCV_NXT and FIN_SEQ from the information sharing unit 216, and determines whether RCV_NXT has reached FIN_SEQ (S104). At this time, if RCV_NXT has not yet reached FIN_SEQ (NO in S104), every time a new segment is received, the data processing unit 211 notifies the data reception completion determination unit 213 to determine whether the data reception has been completed. Do.
When the data end is detected and the data reception is completed (YES in S104), the control processing unit 215 is notified, and the data end reception completion notifying unit 214 notifies the data processing unit 211 to transmit the ACK segment for the FIN segment. Instruct (S105). Also, the control processing unit 215 changes the state from ESTABLISHED to CLOSE-WAIT (S106). Note that the confirmation response number at this time treats FIN as 1-byte data and transmits the value of FIN_SEQ + 1 as the confirmation response number.

上記のACKセグメントをクライアントで受信すると、クライアント側のセッション切断が完了し、ハーフクローズ状態となる。サーバでは、完了を検知してFINセグメントの送信を行い、クライアントからFINに対するACKセグメントが返ってきたら、サーバでのセッションの切断が完了する。   When the above ACK segment is received by the client, the session disconnection on the client side is completed and a half-closed state is entered. The server detects the completion and transmits the FIN segment. When the client returns an ACK segment for the FIN, the server disconnects the session.

なお、上記では、TOE204内にデータ受信完了判定部213を備える場合で説明を行ったが、図 15のようにCPU205内にデータ受信完了判定部216を備える構成をとることもできる。この場合、データ処理部211から割り込みにより新たにセグメントが到着したことをデータ受信完了判定部216に通知する。その都度、データ受信完了判定部216では、情報共有部216からセッション情報のRCV_NXTとFIN_SEQを読み出し、RCV_NXTがFIN_SEQに達していれば制御処理部215に通知し、制御処理部215は状態遷移を行う。   In the above description, the case where the TOE 204 includes the data reception completion determination unit 213 has been described. However, a configuration in which the data reception completion determination unit 216 is included in the CPU 205 as illustrated in FIG. In this case, the data processing unit 211 notifies the data reception completion determination unit 216 that a new segment has arrived by interruption. In each case, the data reception completion determination unit 216 reads the RCV_NXT and FIN_SEQ of the session information from the information sharing unit 216, notifies the control processing unit 215 if RCV_NXT has reached FIN_SEQ, and the control processing unit 215 performs state transition. .

また、データ処理部211からデータ受信完了判定部213に割り込みによる通知を行わない構成をとることもできる。この場合、データ受信完了判定部213は、例えば10msなどの一定間隔で情報共有部216のセッション情報のRCV_NXTとFIN_SEQの値を比較し、RCV_NXTがFIN_SEQに達した場合に、制御処理部215に通知することができる。   Further, it is possible to adopt a configuration in which the data processing unit 211 does not notify the data reception completion determination unit 213 by interruption. In this case, the data reception completion determination unit 213 compares the RCV_NXT and FIN_SEQ values of the session information of the information sharing unit 216 at regular intervals such as 10 ms, and notifies the control processing unit 215 when RCV_NXT reaches FIN_SEQ. can do.

また、上記において、データ処理部211から制御処理部215にフレームを渡す手段としては、割り込みとレジスタ、共有メモリを用いて実現してもよい。例えば、フレームの格納場所のポインタを示すエントリで構成されたリングバッファを作成し、TOE204のレジスタを介して制御処理部215とデータ処理部211で処理が完了したインデックス番号を通知しあうようにし、割り込みでイベントの発生を通知する。   In the above, the means for passing a frame from the data processing unit 211 to the control processing unit 215 may be realized using an interrupt, a register, and a shared memory. For example, a ring buffer configured with an entry indicating a pointer to the storage location of the frame is created, and the control processing unit 215 and the data processing unit 211 notify the index number of the processing completed via the register of the TOE 204, Notify event occurrence by interrupt.

なお、相手機器が、FINセグメント以外の全セグメントに対するACKセグメントの受信を確認した後にFINセグメントの送信を行うようにすれば、本装置でFINセグメントを受信した後、全セグメントを受信したかどうかの判定を行う必要がなくなり、開発コストを低減させることができる。   In addition, if the partner device transmits the FIN segment after confirming the reception of the ACK segment for all segments other than the FIN segment, whether or not all segments have been received after receiving the FIN segment with this device. It is not necessary to make a determination, and the development cost can be reduced.

このように、第2の実施形態に係わるデータ通信装置によれば、ネットワーク上でロスなどが発生し、データの再送が発生している場合において、FINセグメントを受信した時にも、全データの受信を完了してからセッションの状態遷移(ESTABLISHED→CLOSE-WAIT 1)を行うため、再送データをもれなく受信することが可能となる。   As described above, according to the data communication apparatus according to the second embodiment, even when a FIN segment is received when loss or the like occurs on the network and data is retransmitted, all data is received. Since the session state transition (ESTABLISHED → CLOSE-WAIT 1) is performed after completing the process, it is possible to receive all the retransmission data.

(第3の実施形態)(FIN送信時の構成)
インターネット等で広く用いられるTCP/IPなどのプロトコル処理は従来、主にCPU上で動作するソフトウェアにより実現されていた。しかしながら、近年のネットワーク高速化に伴い、CPUのTCP/IP処理負荷が増大しており、TCP/IP処理を専用のハードウェアによって行うTOE(TCP/IP Offload Engine)を用いることにより、高速な通信を実現する装置が提案されている。
(Third embodiment) (FIN transmission configuration)
Conventionally, protocol processing such as TCP / IP widely used in the Internet or the like has been realized mainly by software operating on a CPU. However, as the network speed increases in recent years, the CPU's TCP / IP processing load has increased. By using a TOE (TCP / IP Offload Engine) that performs TCP / IP processing using dedicated hardware, high-speed communication is possible. An apparatus for realizing the above has been proposed.

従来のデータ通信装置には、低速処理用の通信アダプタと高速処理用の通信アダプタを備え、アルゴリズムが複雑なTCPセッション接続および切断用のパケット処理のみを低速処理用の通信アダプタで実行し、映像データなどを含んだペイロード伝送用のパケット処理のみを高速アダプタで実行するものがあった。   A conventional data communication device is equipped with a communication adapter for low-speed processing and a communication adapter for high-speed processing. Only TCP session connection and disconnection packet processing with complicated algorithms is executed by the communication adapter for low-speed processing. Some high-speed adapters execute only packet processing for payload transmission including data.

しかし、FINセグメントの送信において、低速処理用の通信アダプタと高速処理用の通信アダプタが非同期に動作するため、FINセグメントの送信時に問題が発生しうる。   However, in the transmission of the FIN segment, since the communication adapter for low speed processing and the communication adapter for high speed processing operate asynchronously, a problem may occur when the FIN segment is transmitted.

FINセグメントは1バイトデータとして扱われるが、受信側のウィンドウサイズが1バイト以上あると判断して、低速処理用の通信アダプタが、FINセグメントを送信した場合、実際にはウィンドウサイズがゼロであったとき、フロー制御に違反したセグメントを送信してしまう。   The FIN segment is handled as 1-byte data, but if the receiving side's window size is determined to be 1 byte or more and the communication adapter for low-speed processing sends the FIN segment, the window size is actually zero. The segment that violated the flow control will be transmitted.

また、FINセグメントに対するACKセグメントを送信する際、受信側の高速処理用の通信アダプタからデータが送信され続けていると、低速処理用の通信アダプタは、正しい確認応答番号を算出できなくなる。   In addition, when transmitting an ACK segment for the FIN segment, if data is continuously transmitted from the communication adapter for high-speed processing on the receiving side, the communication adapter for low-speed processing cannot calculate a correct confirmation response number.

さらに送信側の高速処理用の通信アダプタが、低速アダプタとは別のハードウェアで生成されたデータを、低速アダプタとは独立に受信側にデータを送信し続けている状況でFINセグメントを送信しようとすると、FINセグメントに付与するシーケンス番号を正しく算出できなくなる。   In addition, let's send the FIN segment in a situation where the communication adapter for high-speed processing on the sending side continues to send data generated by hardware separate from the low-speed adapter to the receiving side independently of the low-speed adapter. Then, the sequence number assigned to the FIN segment cannot be calculated correctly.

以下、これらの問題を解消する第3の実施形態について詳細に説明する。   Hereinafter, a third embodiment for solving these problems will be described in detail.

図 16は、本発明の第3の実施形態に係わるデータ通信装置を示すブロック図である。   FIG. 16 is a block diagram showing a data communication apparatus according to the third embodiment of the present invention.

この第3の実施形態に係わるデータ通信装置は、テレビ電話サーバであり、クライアントからの映像を表示(音声もスピーカーから出力)し、ビデオカメラで撮影した映像(マイクから入力音声を含む)をクライアントに送信する。   The data communication apparatus according to the third embodiment is a videophone server, displays video from the client (audio is also output from the speaker), and captures video (including input audio from the microphone) captured by the video camera. Send to.

この装置は、CPU301、システムメモリ302、マイク付のビデオカメラ303、スピーカー付のディスプレイ304、TOE305から構成され、それぞれはローカルバスや、PCI Expressなどのバスや、IEEE1394、HDMI(High-Definition Multimedia Interface)などで接続される。なお、ディスプレイのコントローラやデコーダ、エンコーダーについては省略している。CPU301では、映像表示に関わるアプリケーションが動作する。   This device consists of a CPU 301, a system memory 302, a video camera 303 with a microphone, a display 304 with speakers, and a TOE 305, each of which includes a local bus, a bus such as PCI Express, IEEE1394, HDMI (High-Definition Multimedia Interface) ) Etc. Note that the display controller, decoder, and encoder are omitted. In the CPU 301, an application related to video display operates.

CPU301は制御処理部312を備えている。TOE305は、データ処理部311と、制御処理部312と、情報共有部313と、データ終端設定部314と、データ終端送信判定部315とを備えている。   The CPU 301 includes a control processing unit 312. The TOE 305 includes a data processing unit 311, a control processing unit 312, an information sharing unit 313, a data end setting unit 314, and a data end transmission determination unit 315.

データ処理部311は、ネットワーク320を介してデータを送受信するための処理を行う。   The data processing unit 311 performs processing for transmitting and receiving data via the network 320.

制御処理部312は、データ通信における自端末の状態(セッションの状態)を制御する。   The control processing unit 312 controls the state of the terminal (session state) in data communication.

情報共有部313は、制御処理部312とデータ処理部313で共有するセッションの情報を保持する。セッションの情報は、上記セッション状態や、フロー制御で使うフロー制御情報(たとえばウィンドウサイズ)といった情報も含む。   The information sharing unit 313 holds session information shared between the control processing unit 312 and the data processing unit 313. The session information includes information such as the session state and flow control information (for example, window size) used in flow control.

データ終端設定部314は、データ送信の完了(セッションの終了)を通知する終端通知データ(FINセグメント)を生成し、データ処理部311に終端通知データの送信を指示する。   The data termination setting unit 314 generates termination notification data (FIN segment) for notifying completion of data transmission (end of session), and instructs the data processing unit 311 to transmit termination notification data.

データ終端送信判定部315は、情報共有部313のフロー制御情報に基づき、終端通知データを相手装置に送信可能かどうかを判定する。   The data end transmission determination unit 315 determines whether or not the end notification data can be transmitted to the partner apparatus based on the flow control information of the information sharing unit 313.

以下では、TCPによりクライアントからネットワークを介して映像データを送信し、その映像データが表す映像を本装置のサーバ側で表示し、また同一のTCPセッションでサーバから映像データをクライアントに送信する例について説明する。   In the following example, video data is transmitted from a client via a network using TCP, the video represented by the video data is displayed on the server side of the apparatus, and video data is transmitted from the server to the client in the same TCP session. explain.

セッション確立までは前記第2の実施形態と同様であるため、説明を省略する。セッション確立後、状態がESTABLISHED状態になると、クライアントからサーバに対して、映像が送信される。   Since the process until the session is established is the same as that of the second embodiment, description thereof is omitted. After the session is established, when the state changes to the ESTABLISHED state, video is transmitted from the client to the server.

受信されたデータは、第2の実施形態と同様にデータ処理部211で処理され、システムメモリ302を介してディスプレイ304に映像が表示される。一方、本サーバからは同一のTCPセッションを用いてネットワーク320を介し、クライアントへビデオカメラ303で撮影した映像のデータを送信する。   The received data is processed by the data processing unit 211 as in the second embodiment, and an image is displayed on the display 304 via the system memory 302. On the other hand, this server transmits video data captured by the video camera 303 to the client via the network 320 using the same TCP session.

クライアントにおいて、データが受信されるとクライアントは、データ受信を正常に完了したことを通知するため、コントロールフラグにACKをセットし、正常受信したシーケンス番号を確認応答番号に設定したセグメントを送信する。   In the client, when data is received, the client transmits a segment in which ACK is set in the control flag and the sequence number that has been normally received is set as the confirmation response number in order to notify that data reception has been completed normally.

図 17は、本発明の第3の実施形態に係わるデータ通信装置のセッション切断動作を示すフローチャートである。   FIG. 17 is a flowchart showing a session disconnection operation of the data communication apparatus according to the third embodiment of the present invention.

通話を終了する場合、TCPセッションを切断するため、コントロールフラグにFINをセットしたFINセグメントを送信する必要がある。以下、サーバから通話を切断する場合を例にして説明を行う。   When terminating a call, it is necessary to send a FIN segment with FIN set in the control flag to disconnect the TCP session. Hereinafter, the case where the call is disconnected from the server is described as an example.

まずビデオカメラに対して、CPU301で動作するアプリケーションは、撮影した映像の出力を止めるように指示する。次に、制御処理部312は、情報共有部313のセッションの状態を、ESTABLISHEDからFIN-WAIT-1に変更する(S201)。   First, the application operating on the CPU 301 instructs the video camera to stop outputting the captured video. Next, the control processing unit 312 changes the session state of the information sharing unit 313 from ESTABLISHED to FIN-WAIT-1 (S201).

次に、データ終端送信判定部315は、情報共有部313からセッション情報を読み出し、送信ウィンドウサイズSND_WND(フロー制御情報)が、0であるか否かを判定する(S202)。TCPにおいて、FINフラグは1byte分のデータとみなされるため、SND_WNDが0となっているとFINセグメントを送信することができない。よって、このデータ終端送信判定部315は、ウィンドウサイズが1byte以上あるかどうかで、FINセグメントの送信が可能かどうかを判定する。   Next, the data end transmission determination unit 315 reads the session information from the information sharing unit 313, and determines whether or not the transmission window size SND_WND (flow control information) is 0 (S202). In TCP, since the FIN flag is regarded as data of 1 byte, if the SND_WND is 0, the FIN segment cannot be transmitted. Therefore, the data end transmission determination unit 315 determines whether the FIN segment can be transmitted based on whether the window size is 1 byte or more.

可能であれば、データ終端設定部314は、データ処理部311に対して、コントロールフラグにFINをセットしたセグメント(FINセグメント)を送信するように指示する。指示を受けたデータ処理部311では、情報共有部313のセッション情報のRCV_NXTとSND_NXTを読み出してそれぞれ、確認応答番号とシーケンス番号に設定して、FINセグメントを送信する(S205)。   If possible, the data end setting unit 314 instructs the data processing unit 311 to transmit a segment (FIN segment) in which FIN is set in the control flag. Upon receiving the instruction, the data processing unit 311 reads the session information RCV_NXT and SND_NXT of the information sharing unit 313, sets the confirmation response number and the sequence number, respectively, and transmits the FIN segment (S205).

一方、送信可能でない場合は、送信ウィンドウが開くまで待つ処理を行う(S203、S204のNO)。すなわち、相手装置からウィンドウアップデート通知があるまで、データ処理部311で受信データを処理し、自装置の送信ウィンドウサイズが更新されたら(S204のYES)、再度判定を行う(S202)。   On the other hand, if transmission is not possible, a process of waiting until the transmission window opens is performed (NO in S203 and S204). That is, the received data is processed by the data processing unit 311 until there is a window update notification from the counterpart device. When the transmission window size of the own device is updated (YES in S204), the determination is performed again (S202).

このように、本実施形態を用いることで、TOE内部でウィンドウサイズを検査し、FINセグメントを生成するため、相手装置のウィンドウサイズを適正に反映したFINセグメントを送信できる。よって、FINセグメントがウィンドウサイズ不足により受信されないといった問題は防止される。   As described above, by using this embodiment, the window size is inspected inside the TOE and the FIN segment is generated, so that the FIN segment appropriately reflecting the window size of the partner apparatus can be transmitted. Therefore, the problem that the FIN segment is not received due to insufficient window size is prevented.

また、相手装置からデータを受信していて情報共有部313のセッション情報のRCV_NXTが常に変化している場合においても、FINセグメントの確認応答番号を正しく設定することができる。   Even when data is received from the counterpart device and the RCV_NXT of the session information of the information sharing unit 313 is constantly changing, the confirmation response number of the FIN segment can be set correctly.

また、上記実施形態ではサーバからのデータ送信を停止した上で、FINセグメントを送信する場合を示したが、データ送信を継続している状態で、FINセグメントを送信するようにしてもよい。この場合でも、TOE 内部でシーケンス番号を設定するため、FINセグメントのシーケンス番号を正しく設定できる。   In the above embodiment, the case where the FIN segment is transmitted after the data transmission from the server is stopped has been described. However, the FIN segment may be transmitted while the data transmission is continued. Even in this case, since the sequence number is set inside the TOE, the sequence number of the FIN segment can be set correctly.

上記では、FINを送信する場合について説明したが、データ終端設定部314を用いてコントロールフラグにRSTをセットしたセグメントを送信してもよい。RSTの場合、送信ウィンドウサイズの確認は不要なため、データ終端送信判定部315での判定は常に真となる。   In the above description, the case where the FIN is transmitted has been described. However, a segment in which the control flag is set to RST may be transmitted using the data end setting unit 314. In the case of RST, since it is not necessary to check the transmission window size, the determination at the data end transmission determination unit 315 is always true.

また、図 18に示すようにデータ終端設定部314およびデータ終端送信判定部315をTOE305ではなく、CPU301が備えてもよい。この場合、送信ウィンドウサイズが変化した際に、データ処理部311からの割り込みによりデータ終端送信判定部315に通知されるようにして、FINセグメントの送信が可能かを、判定するようにしてもよい。また、データ終端送信判定部315が、タイマなどを用い、一定間隔で情報共有部313から送信ウィンドウサイズを読み出し、送信可能か判定してもよい。   In addition, as shown in FIG. 18, the data end setting unit 314 and the data end transmission determination unit 315 may be provided in the CPU 301 instead of the TOE 305. In this case, when the transmission window size changes, the data end transmission determination unit 315 may be notified by an interrupt from the data processing unit 311 to determine whether the FIN segment can be transmitted. . Further, the data end transmission determination unit 315 may use a timer or the like to read the transmission window size from the information sharing unit 313 at regular intervals and determine whether transmission is possible.

以上、本発明の実施の形態について説明した。本発明は上述した実施形態そのままに限定されるものではなく、実施段階ではその要旨を逸脱しない範囲で構成要素を変形して具体化できる。また、上記実施形態に開示されている複数の構成要素の適宜な組み合わせにより、種々の発明を形成できる。例えば、実施形態に示される全構成要素から幾つかの構成要素を削除してもよい。さらに、異なる実施形態にわたる構成要素を適宜組み合わせてもよい。   The embodiment of the present invention has been described above. The present invention is not limited to the above-described embodiments as they are, and can be embodied by modifying the components without departing from the scope of the invention in the implementation stage. In addition, various inventions can be formed by appropriately combining a plurality of components disclosed in the embodiment. For example, some components may be deleted from all the components shown in the embodiment. Furthermore, constituent elements over different embodiments may be appropriately combined.

また、上述した実施形態で説明した装置の少なくとも一部は、ハードウェアで構成してもよいし、ソフトウェアで構成してもよい。また、装置の少なくとも一部の機能を実現するプログラムを、フレキシブルディスクやCD-ROM等の記録媒体に収納し、コンピュータに読み込ませて実行させてもよい。記録媒体は、磁気ディスクや光ディスク等の着脱可能なものに限定されず、ハードディスク装置やメモリなどの固定型の記録媒体でもよい。   In addition, at least a part of the device described in the above-described embodiment may be configured by hardware or software. Further, a program that realizes at least a part of the functions of the apparatus may be stored in a recording medium such as a flexible disk or a CD-ROM, and read and executed by a computer. The recording medium is not limited to a removable medium such as a magnetic disk or an optical disk, but may be a fixed recording medium such as a hard disk device or a memory.

また、装置の少なくとも一部の機能を実現するプログラムを、インターネット等の通信回線(無線通信も含む)を介して頒布してもよい。さらに、同プログラムを暗号化したり、変調をかけたり、圧縮した状態で、インターネット等の有線回線や無線回線を介して、あるいは記録媒体に収納して頒布してもよい。   Further, a program that realizes at least a part of the functions of the apparatus may be distributed via a communication line (including wireless communication) such as the Internet. Further, the program may be distributed in a state where the program is encrypted, modulated or compressed, and stored in a recording medium via a wired line such as the Internet or a wireless line.

Claims (3)

データの消失が検知された場合に送信側から前記データの再送を行うプロトコルを用いたデータ通信を行うデータ通信装置であって
送信装置とネットワークを介して送受信し、受信においては一連のデータを前記データ毎に受信し、受信したデータを処理するデータ処理部と、
前記送信装置とのデータ通信のセッション状態を管理する制御処理部と、
前記セッション状態を記憶する情報記憶部と、
前記一連のデータの末尾の終端データが受信されたことを検出するデータ終端検出部と、
前記終端データの受信が検知されたとき、前記一連のデータの受信がすべて完了しているか否かを判定するデータ受信完了判定部と、
を備え、
前記データ処理部は、前記情報記憶部に記憶された前記セッション状態に応じて、前記送信装置からのデータを処理し、
前記制御処理部は、前記データ受信完了判定部により前記一連のデータの受信がすべて完了していると判定されたとき、前記セッション状態を終了状態に遷移させ、完了していないと判定されたとき、完了したと判定されるまで、前記セッション状態の遷移を待機する
データ通信装置。
A data communication device that performs data communication using a protocol that retransmits the data from the transmission side when data loss is detected, and transmits / receives data to / from the transmission device via a network, A data processing unit that receives each data and processes the received data;
A control processing unit for managing a session state of data communication with the transmission device;
An information storage unit for storing the session state;
A data end detection unit for detecting that end data at the end of the series of data has been received;
A data reception completion determination unit that determines whether or not reception of the series of data has been completed when reception of the termination data is detected;
With
The data processing unit processes data from the transmission device according to the session state stored in the information storage unit,
The control processing unit transitions the session state to an end state when it is determined by the data reception completion determination unit that reception of the series of data has been completed, and when it is determined that the data has not been completed A data communication device that waits for the transition of the session state until it is determined that the session has been completed.
前記データ受信完了判定部により前記一連のデータの受信が完了したと判定されたとき、前記送信装置に対して前記受信が完了したとの通知データを送信するデータ終端受信完了通知部
をさらに備えたことを特徴とする請求項1に記載のデータ通信装置。
When the data reception completion determination unit determines that the reception of the series of data has been completed, the data reception completion notification unit further transmits notification data indicating that the reception has been completed to the transmission device. 2. The data communication apparatus according to claim 1, wherein:
データの消失が検知された場合に送信側から前記データの再送を行うプロトコルを用いたデータ通信を行うためのデータ通信装置に実行させる通信プログラムであって、
送信装置とネットワークを介して送受信し、受信においては一連のデータを前記データ毎に受信し、受信したデータを処理するデータ処理ステップと、
前記送信装置とのデータ通信のセッション状態を管理し、前記セッション状態を情報記憶部に書き込む制御処理ステップと、
前記一連のデータの末尾の終端データが受信されたことを検出するデータ終端検出ステップと、
前記終端データの受信が検知されたとき、前記一連のデータの受信がすべて完了しているか否かを判定するデータ受信完了判定ステップと、
を備え、
前記データ処理ステップは、前記情報記憶部に記憶された前記セッション状態に応じて、前記送信装置からのデータを処理し、
前記制御処理ステップは、前記データ受信完了判定ステップにより前記一連のデータの受信がすべて完了していると判定されたとき、前記セッション状態を終了状態に遷移させ、完了していないと判定されたとき、完了したと判定されるまで、前記セッション状態の遷移を待機する、通信プログラム。
A communication program to be executed by a data communication apparatus for performing data communication using a protocol for retransmitting the data from the transmission side when loss of data is detected,
A data processing step of transmitting and receiving data via a network with a transmission device, receiving a series of data for each of the data, and processing the received data;
A control processing step of managing a session state of data communication with the transmission device and writing the session state in an information storage unit;
A data end detection step for detecting that end data at the end of the series of data has been received;
A data reception completion determination step for determining whether or not reception of the series of data has been completed when reception of the termination data is detected;
With
The data processing step processes data from the transmission device according to the session state stored in the information storage unit,
When it is determined that the reception of the series of data is all completed by the data reception completion determination step, the control processing step transitions the session state to the end state, and when it is determined that the reception is not completed. A communication program that waits for the transition of the session state until it is determined to be completed.
JP2013081387A 2013-04-09 2013-04-09 Data communication apparatus and communication program Active JP5606575B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013081387A JP5606575B2 (en) 2013-04-09 2013-04-09 Data communication apparatus and communication program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013081387A JP5606575B2 (en) 2013-04-09 2013-04-09 Data communication apparatus and communication program

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2011042605A Division JP5361924B2 (en) 2011-02-28 2011-02-28 Data transmission device, data communication device, and communication program

Publications (2)

Publication Number Publication Date
JP2013176106A true JP2013176106A (en) 2013-09-05
JP5606575B2 JP5606575B2 (en) 2014-10-15

Family

ID=49268561

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013081387A Active JP5606575B2 (en) 2013-04-09 2013-04-09 Data communication apparatus and communication program

Country Status (1)

Country Link
JP (1) JP5606575B2 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007142582A (en) * 2005-11-15 2007-06-07 Canon Inc Data communication device, data communication method, program, and storage medium
JP2008278410A (en) * 2007-05-07 2008-11-13 Oki Electric Ind Co Ltd Communication system, communication device, communication method, and communication program
JP2009088962A (en) * 2007-09-28 2009-04-23 Panasonic Corp Communication adapter, communication device, and communication method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007142582A (en) * 2005-11-15 2007-06-07 Canon Inc Data communication device, data communication method, program, and storage medium
JP2008278410A (en) * 2007-05-07 2008-11-13 Oki Electric Ind Co Ltd Communication system, communication device, communication method, and communication program
JP2009088962A (en) * 2007-09-28 2009-04-23 Panasonic Corp Communication adapter, communication device, and communication method

Also Published As

Publication number Publication date
JP5606575B2 (en) 2014-10-15

Similar Documents

Publication Publication Date Title
JP5361924B2 (en) Data transmission device, data communication device, and communication program
CN109936510B (en) Multi-path RDMA transport
JP5258938B2 (en) Communication device
US10009445B2 (en) Avoiding unwanted TCP retransmissions using optimistic window adjustments
US20130250767A1 (en) Method and Device for Data Transmission
US8341453B2 (en) Transmission apparatus that transmits data according to a protocol, and method for measuring time in the transmission apparatus
US9071525B2 (en) Data receiving apparatus, data receiving method, and program storage medium
JPWO2008023656A1 (en) Communication device
JP2006211632A (en) Detection method of crc inspection error out of range
US11968260B2 (en) Network interface card, message sending and receiving method, and storage apparatus
WO2004110013A1 (en) Packet communication device
WO2018137218A1 (en) Data transmission method, data receiving device, and data sending device
JP5606575B2 (en) Data communication apparatus and communication program
JP5592301B2 (en) Client device, communication system, survival confirmation method, and program
CN109714135B (en) Data packet transmission method and device
JP2013179615A (en) Data communication device and communication program
CN103607311A (en) System and method for reestablishing TCP connection seamlessly
US7213074B2 (en) Method using receive and transmit protocol aware logic modules for confirming checksum values stored in network packet
WO2021057672A1 (en) Sequence number synchronization method and apparatus
CN113300967A (en) RDMA (remote direct memory Access) network transmission method and device and RDMA network communication system
US20170265103A1 (en) Communication device, communication method, and non-transitory computer readable medium
JP6568571B2 (en) Data transfer device, data transfer method, and communication device
JP2012049883A (en) Communication device and packet processing method
JP2008099139A (en) Communication method
KR20180130152A (en) Mediatioin appratus mediating communication betwwen server and client

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20131209

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20131213

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140212

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: 20140729

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140826

R151 Written notification of patent or utility model registration

Ref document number: 5606575

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151