Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP6891201B2 - Communication equipment, control methods and programs for communication equipment - Google Patents
[go: Go Back, main page]

JP6891201B2 - Communication equipment, control methods and programs for communication equipment - Google Patents

Communication equipment, control methods and programs for communication equipment Download PDF

Info

Publication number
JP6891201B2
JP6891201B2 JP2019027378A JP2019027378A JP6891201B2 JP 6891201 B2 JP6891201 B2 JP 6891201B2 JP 2019027378 A JP2019027378 A JP 2019027378A JP 2019027378 A JP2019027378 A JP 2019027378A JP 6891201 B2 JP6891201 B2 JP 6891201B2
Authority
JP
Japan
Prior art keywords
packet
header
payload
length
tcp
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.)
Active
Application number
JP2019027378A
Other languages
Japanese (ja)
Other versions
JP2020136883A (en
Inventor
浩二 中禮
浩二 中禮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2019027378A priority Critical patent/JP6891201B2/en
Publication of JP2020136883A publication Critical patent/JP2020136883A/en
Application granted granted Critical
Publication of JP6891201B2 publication Critical patent/JP6891201B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Description

本発明は、複数パケットを生成および送信可能な通信装置に関する。 The present invention relates to a communication device capable of generating and transmitting a plurality of packets.

ネットワーク通信において、TCP(Transmission Control Protocol)/IP(Internet Protocol)による通信が広く利用されている。このTCP/IPは、例えばカメラやスマートフォン等の端末から画像や動画をクラウドサーバへアップロードする等の大容量データ通信でも利用されているため、近年ではより高速で通信可能であることが要請されている。 In network communication, communication by TCP (Transmission Protocol) / IP (Internet Protocol) is widely used. Since this TCP / IP is also used for large-capacity data communication such as uploading images and videos from terminals such as cameras and smartphones to a cloud server, it has been required in recent years to be able to communicate at a higher speed. There is.

パケットを通信対向装置へ送信するTCP/IPプロトコル処理では、まず、アプリケーションからソケットAPIのsend()コールによって指定されたユーザデータが、送信バッファ(ネットワークバッファ)に転送される。次に、送信バッファに転送され格納されたユーザデータを、典型的にはユーザデータの送信単位であるMSS(Maximum Segment Size)で切り出す。切り出されたユーザデータ(ペイロード)に対してTCPヘッダおよびIPヘッダ等を付加することでパケットが生成される。 In the TCP / IP protocol process for transmitting a packet to a communication counterpart, first, the user data specified by the send () call of the socket API from the application is transferred to the transmission buffer (network buffer). Next, the user data transferred and stored in the transmission buffer is typically cut out by MSS (Maximum Segment Size), which is a transmission unit of user data. A packet is generated by adding a TCP header, an IP header, or the like to the cut out user data (payload).

上記のTCP/IPプロトコル処理に伴うCPU(Central Processing Unit)の負荷を軽減し、パケット送信処理を高速化する技術の1つに、TSO(TCP Segmentation Offload)処理がある。
このTSO処理では、上記のMSSに基づいたパケット単位でのTCP/IPプロトコル処理を行わない。すなわち、TSO処理では、送信バッファに転送されたユーザデータを送信単位であるMSSより大きなサイズで読み出してTCP/IPプロトコル処理を行った後にMSSに基づいてパケット単位に分割することで、複数のパケットを一度に生成する。TSO処理により複数のパケットを生成することで、パケットごとに実行していたTCP/IPプロトコル処理が、複数パケットに1回の実行に軽減されることとなり、CPUの負荷を軽減するとともにパケット送信処理を高速化することが実現できる。
TSO (TCP Segmentation Offload) processing is one of the technologies for reducing the load on the CPU (Central Processing Unit) associated with the above TCP / IP protocol processing and speeding up the packet transmission processing.
In this TSO processing, the TCP / IP protocol processing for each packet based on the above MSS is not performed. That is, in the TSO processing, the user data transferred to the transmission buffer is read out in a size larger than the MSS which is the transmission unit, TCP / IP protocol processing is performed, and then the user data is divided into packet units based on the MSS to divide a plurality of packets. Is generated at once. By generating multiple packets by TSO processing, the TCP / IP protocol processing that was executed for each packet is reduced to one execution for each multiple packet, reducing the load on the CPU and packet transmission processing. Can be realized at high speed.

また、複数パケットへの分割処理を、CPUにより実行されるソフトウエア処理から、例えばNIC(Network Interface Card)上に搭載されたハードウエアオフローダへオフロードして高速化することも可能である。
特許文献1は、TSO処理を利用するか否かを、パケットロスの有無やアプリケーションに応じて、TCPセッション(アプリケーション)単位で制御することの可能なTCP送信制御装置を開示する。
It is also possible to speed up the division process into a plurality of packets by offloading from the software process executed by the CPU to, for example, a hardware offloader mounted on a NIC (Network Interface Card).
Patent Document 1 discloses a TCP transmission control device capable of controlling whether or not to use TSO processing in units of TCP sessions (applications) depending on the presence or absence of packet loss and an application.

WO2010/073671号公報WO2010 / 0737671

ところで、TCPプロトコルでは、TCPオプションヘッダのペイロードへの付加を許容している。しかしながら、このTCPオプションヘッダをペイロードへ付加すべき場合に、単純にMSSに基づいて複数パケットへ分割すると、最大転送単位であるMTU(Maximum Transmission Unit)を超えるパケットが生成され得る。例えば、ペイロードサイズであるMSSが、最大転送単位であるMTUからTCPヘッダおよびIPヘッダのサイズを減じた値に設定されている場合、さらにTCPオプションヘッダが付加されることにより、IPパケット全体のサイズがMTUを超えてしまう。 By the way, the TCP protocol allows the addition of the TCP option header to the payload. However, when this TCP option header should be added to the payload, if it is simply divided into a plurality of packets based on the MSS, packets exceeding the maximum transfer unit MTU (Maximum Transmission Unit) may be generated. For example, when the payload size MSS is set to a value obtained by subtracting the TCP header and IP header sizes from the MTU which is the maximum transfer unit, the size of the entire IP packet is further added by adding the TCP option header. Exceeds MTU.

このようにMTUのサイズを超過したIPパケットは、一度に送信することができないため、IPフラグメンテーション処理が実行される。すなわち、MTUのサイズを超過したIPパケットは、送信側で複数のIPパケットに分割した後に送信され、受信側で受信された複数のIPパケットから元のIPパケットへ再構成しなければならない。
パケットの送信側および受信側でこうしたIPフラグメンテーション処理が付加されることで、通信スループットの低下を招いてしまう。
Since IP packets exceeding the MTU size in this way cannot be transmitted at one time, IP fragmentation processing is executed. That is, the IP packet exceeding the size of the MTU must be divided into a plurality of IP packets on the transmitting side and then transmitted, and the plurality of IP packets received on the receiving side must be reconstructed into the original IP packet.
The addition of such IP fragmentation processing on the transmitting side and the receiving side of the packet causes a decrease in communication throughput.

本発明は、上述の課題に鑑みてなされたものであり、通信スループットの低下を抑え、パケットをより効率的に送信することを目的とする。 The present invention has been made in view of the above-mentioned problems, and an object of the present invention is to suppress a decrease in communication throughput and to transmit packets more efficiently.

上記課題を解決するため、本発明に係る通信装置は、前記通信装置が送信するパケットに付加されるヘッダであって、TCP(Transmission Control Protocol)に係るヘッダのヘッダ長を取得する取得手段と、前記取得手段により取得された前記ヘッダ長と、前記パケットを送信するTCPコネクションにおけるMSS(Maximum Segment Size)とに基づいて、前記パケットに含めるペイロードのペイロード長を決定する決定手段と、所定のタイミングにおいて前記通信装置が送信しようとする送信データの長さが、前記決定手段により決定された前記ペイロード長よりも長い場合、第1のハードウェアを用いて、前記決定手段により決定された前記ペイロード長のペイロードを含む複数のパケットを生成する第1の生成手段と、前記送信データの長さが、前記決定手段により決定された前記ペイロード長よりも短い場合、前記第1のハードウェアとは異なる第2のハードウェアを用いてパケットを生成する第2の生成手段と、を有する。
In order to solve the above problems, the communication device according to the present invention is a header added to a packet transmitted by the communication device, and is an acquisition means for acquiring the header length of the header related to TCP (Transmission Control Protocol). A determination means for determining the payload length of the payload to be included in the packet based on the header length acquired by the acquisition means and the MSS (Maximum Segment Size) in the TCP connection for transmitting the packet, and at a predetermined timing. When the length of the transmission data to be transmitted by the communication device is longer than the payload length determined by the determination means, the first hardware is used to determine the payload length determined by the determination means. When the length of the transmission data is shorter than the payload length determined by the determination means, the first generation means for generating a plurality of packets including the payload is different from the first hardware. It has a second generation means for generating a packet using the hardware of the above .

本発明によれば、通信スループットの低下を抑え、パケットをより効率的に送信することができる。 According to the present invention, it is possible to suppress a decrease in communication throughput and transmit packets more efficiently.

本実施形態に係る通信装置1のハードウエアおよび機能構成の一例を示すブロック図A block diagram showing an example of the hardware and functional configuration of the communication device 1 according to the present embodiment. 実施形態1における通信装置1のネットワークバッファ34内におけるラージパケットの構成例を示す図The figure which shows the configuration example of the large packet in the network buffer 34 of the communication apparatus 1 in Embodiment 1. TCPオプションであるSACK(Selective ACK)が有効な場合のパケットおよびACKの送受信処理のシーケンスの一例を示す図The figure which shows an example of the sequence of the transmission / reception processing of a packet and ACK when the TCP option SACK (Selective ACK) is enabled. 通信装置1におけるパケット生成および送信処理のシーケンスの一例を示す図The figure which shows an example of the sequence of packet generation and transmission processing in communication apparatus 1. 実施形態1における通信装置1のパケット生成および送信処理の詳細処理手順の一例を示すフローチャートA flowchart showing an example of a detailed processing procedure of packet generation and transmission processing of the communication device 1 in the first embodiment. 実施形態2における通信装置1のパケット生成および送信処理の詳細処理手順の一例を示すフローチャートA flowchart showing an example of a detailed processing procedure of packet generation and transmission processing of the communication device 1 in the second embodiment. 実施形態2における通信装置1のネットワークバッファ34におけるラージパケットの構成例を示す図The figure which shows the configuration example of the large packet in the network buffer 34 of the communication apparatus 1 in Embodiment 2.

以下、添付図面を参照して、本発明を実施するための実施形態について詳細に説明する。なお、以下に説明する実施形態は、本発明の実現手段としての一例であり、本発明が適用される装置の構成や各種条件によって適宜修正又は変更されるべきものであり、本発明は以下の実施形態に必ずしも限定されるものではない。また、本実施形態で説明されている特徴の組み合わせの全てが本発明の解決手段に必須のものとは限らない。なお、同一の構成については、同じ符号を付して説明する。 Hereinafter, embodiments for carrying out the present invention will be described in detail with reference to the accompanying drawings. The embodiment described below is an example as a means for realizing the present invention, and should be appropriately modified or changed depending on the configuration of the device to which the present invention is applied and various conditions. It is not necessarily limited to the embodiment. Moreover, not all combinations of features described in the present embodiment are essential for the means of solving the present invention. The same configuration will be described with the same reference numerals.

以下、通信装置が、送信バッファのユーザデータから複数のパケットを一括生成する処理を実行する例を説明する。当該処理は例えば、TSO(TCP Segmentation Offload)を使用してオフロード実行されてよい。
また、パケット生成の際に送信データに付加されるヘッダは、TCPヘッダ、IPヘッダおよびEther(Ethernet(登録商標))ヘッダを含んでよい。これらTCpヘッダ、IPヘッダ、およびEtherヘッダのうち1つ以上を、以下、プロトコルヘッダともいう。プロトコルヘッダとは、通信プロトコル処理において処理されるヘッダである。IPヘッダおよびTCPヘッダは、以下、TCP/IPヘッダとも総称される。
Hereinafter, an example in which the communication device executes a process of collectively generating a plurality of packets from the user data in the transmission buffer will be described. The process may be performed offload using, for example, TSO (TCP Transmission Offload).
Further, the header added to the transmission data at the time of packet generation may include a TCP header, an IP header, and an Ethernet (registered trademark) header. One or more of these TCp headers, IP headers, and Ether headers are hereinafter also referred to as protocol headers. The protocol header is a header processed in the communication protocol process. The IP header and TCP header are also collectively referred to as TCP / IP headers below.

(実施形態1)
<本実施形態のハードウエアおよび機能構成>
図1は、本実施形態に係る通信装置のハードウエア構成および機能構成の一例を示す図である。
図1に示す通信装置1の各機能モジュールのうち、ソフトウエアにより実現される機能については、各機能モジュールの機能を提供するためのプログラムがROM等のメモリに記憶され、RAMに読み出してCPUが実行することにより実現される。ハードウエアにより実現される機能については、例えば、所定のコンパイラを用いることで、各機能モジュールの機能を実現するためのプログラムからFPGA上に自動的に専用回路を生成すればよい。FPGAとは、Field Programmable Gate Arrayの略である。また、FPGAと同様にしてGate Array回路を形成し、ハードウエアとして実現するようにしてもよい。また、ASIC(Application Specific Integrated Circuit)により実現するようにしてもよい。なお、図1に示した機能ブロックの構成は一例であり、複数の機能ブロックが1つの機能ブロックを構成するようにしてもよいし、いずれかの機能ブロックが複数の機能を行うブロックに分かれてもよい。
(Embodiment 1)
<Hardware and functional configuration of this embodiment>
FIG. 1 is a diagram showing an example of a hardware configuration and a functional configuration of a communication device according to the present embodiment.
Of the functional modules of the communication device 1 shown in FIG. 1, for the functions realized by software, a program for providing the functions of the functional modules is stored in a memory such as a ROM and read into the RAM by the CPU. It is realized by executing. For the functions realized by the hardware, for example, by using a predetermined compiler, a dedicated circuit may be automatically generated on the FPGA from the program for realizing the functions of each function module. FPGA is an abbreviation for Field Programmable Gate Array. Further, a Gate Array circuit may be formed in the same manner as the FPGA and realized as hardware. Further, it may be realized by ASIC (Application Specific Integrated Circuit). The configuration of the functional blocks shown in FIG. 1 is an example, and a plurality of functional blocks may constitute one functional block, or any of the functional blocks may be divided into blocks that perform a plurality of functions. May be good.

通信装置1は、主処理部2、および通信処理部3を備える。主処理部2は、各種アプリケーションを含む、通信装置1の全体の処理を実行する。通信処理部3は、例えばTCP/IP等の通信プロトコル処理を含む各種通信処理や制御を実行する。主処理部2および通信処理部3は、バスブリッジ4により相互接続されている。 The communication device 1 includes a main processing unit 2 and a communication processing unit 3. The main processing unit 2 executes the entire processing of the communication device 1 including various applications. The communication processing unit 3 executes various communication processes and controls including communication protocol processes such as TCP / IP. The main processing unit 2 and the communication processing unit 3 are interconnected by a bus bridge 4.

主処理部2は、メインCPU21、メインメモリ22、およびメインバス23を備える。
メインCPU21は、各種プログラムの実行を行うとともに、通信装置1の全体を制御する。メインCPU21により実行されるプログラムには、OS(Operating System)や各種アプリケーションが含まれる。
メインメモリ22は、メインCPU21や通信処理部3のサブCPU31が各処理を実行する上で必要となるデータやプログラムなどを格納する。このメインメモリ22は、例えば、DRAM(Dynamic Random Access Memory)等の半導体メモリで構成されてよい。
The main processing unit 2 includes a main CPU 21, a main memory 22, and a main bus 23.
The main CPU 21 executes various programs and controls the entire communication device 1. The program executed by the main CPU 21 includes an OS (Operating System) and various applications.
The main memory 22 stores data, programs, and the like necessary for the main CPU 21 and the sub CPU 31 of the communication processing unit 3 to execute each process. The main memory 22 may be composed of, for example, a semiconductor memory such as a DRAM (Dynamic Random Access Memory).

メインメモリ22内部には、メインCPU21によりユーザバッファ24が構成され、このユーザバッファ24にユーザデータが格納される。ユーザバッファ24は、メインCPU21の他、サブCPU31からもバスブリッジ4およびメインバス23を介してアクセス可能な領域とされる。ユーザバッファ23に格納されるユーザデータは、メインCPU21が通信装置1のアプリケーションからネットワーク5を介して通信対向装置へ送出したいデータを含む。以下、ユーザデータを、送信データ、または単に、データともいう。
メインバス24は、メインCPU21からメインメモリ22および通信処理部3へのアクセスおよびデータ転送、または通信処理部3からメインメモリ22へのアクセスおよびデータ転送などに使用される。
Inside the main memory 22, a user buffer 24 is configured by the main CPU 21, and user data is stored in the user buffer 24. The user buffer 24 is an area accessible from the sub CPU 31 as well as the main CPU 21 via the bus bridge 4 and the main bus 23. The user data stored in the user buffer 23 includes data that the main CPU 21 wants to send from the application of the communication device 1 to the communication opposite device via the network 5. Hereinafter, the user data is also referred to as transmission data or simply data.
The main bus 24 is used for access and data transfer from the main CPU 21 to the main memory 22 and the communication processing unit 3, access and data transfer from the communication processing unit 3 to the main memory 22 and the like.

通信処理部3は、サブCPU31、オンチップメモリ33、データ転送部35、パケット生成部36、LAN制御部37、WLAN制御部38、およびローカルバス39を備える。
サブCPU31は、各種通信処理に関するプログラムの実行を行う。サブCPU31により実行されるプログラムは、OSおよび通信プロトコル処理のための通信プロトコルスタックを含む。本実施形態では、通信プロトコル処理として、TCP/IPプロトコルスタックが実行される例を説明するが、他のプロトコルスタックであってもよい。
サブCPU31は、ペイロードサイズ決定部32を備える。
The communication processing unit 3 includes a sub CPU 31, an on-chip memory 33, a data transfer unit 35, a packet generation unit 36, a LAN control unit 37, a WLAN control unit 38, and a local bus 39.
The sub CPU 31 executes programs related to various communication processes. The program executed by the sub CPU 31 includes an OS and a communication protocol stack for communication protocol processing. In the present embodiment, an example in which the TCP / IP protocol stack is executed as the communication protocol process will be described, but other protocol stacks may be used.
The sub CPU 31 includes a payload size determining unit 32.

オンチップメモリ33は、例えば、ASICやFPGA内に構成される内部メモリである。オンチップメモリ33は、通信処理部3のサブCPU31、データ転送部35、パケット生成部36からアクセス可能なメモリである。このオンチップメモリ33は、例えばSRAM(Static Random Access Memory)等の半導体メモリで構成されてよく、これによりメインメモリ22より高速にアクセスされることが可能となる。また、オンチップメモリ33は、NIC(Network Interface Card)上に構成されるメモリデバイスであってもよい。 The on-chip memory 33 is, for example, an internal memory configured in an ASIC or FPGA. The on-chip memory 33 is a memory that can be accessed from the sub CPU 31, the data transfer unit 35, and the packet generation unit 36 of the communication processing unit 3. The on-chip memory 33 may be composed of a semiconductor memory such as a SRAM (Static Random Access Memory), for example, so that the on-chip memory 33 can be accessed at a higher speed than the main memory 22. Further, the on-chip memory 33 may be a memory device configured on a NIC (Network Interface Card).

オンチップメモリ33内部には、サブCPU31により複数のネットワークバッファ34が構成される。これらのネットワークバッファ34は、サブCPU31が通信対向装置との間で送受信されるデータを処理する際に使用される送信バッファである。
ネットワークバッファ34は、送信バッファが必要になったタイミングでオンチップメモリ33に動的に獲得され、データ送信処理が終了して不要になった際に開放される。また、ネットワークバッファ34はそれぞれ、データ領域とネクストバッファ領域を持つ。 各ネットワークバッファ34内のネクストバッファ領域に、別のネットワークバッファのアドレス(ポインタ)を指定する。これにより、複数のネットワークバッファを連結して各ネットワークバッファ34のサイズより大きい送信データをパケット生成部36へ受け渡すことができる。このネットワークバッファ34の詳細は図2を参照して後述する。
Inside the on-chip memory 33, a plurality of network buffers 34 are configured by the sub CPU 31. These network buffers 34 are transmission buffers used when the sub CPU 31 processes data transmitted / received to / from the communication opposing device.
The network buffer 34 is dynamically acquired in the on-chip memory 33 at the timing when the transmission buffer is needed, and is released when the data transmission process is completed and is no longer needed. Further, each of the network buffers 34 has a data area and a next buffer area. An address (pointer) of another network buffer is specified in the next buffer area in each network buffer 34. As a result, it is possible to concatenate a plurality of network buffers and pass transmission data larger than the size of each network buffer 34 to the packet generation unit 36. Details of the network buffer 34 will be described later with reference to FIG.

データ転送部35は、メインCPU21、サブCPU31およびパケット生成部36からの指示に従って、各種データ転送を実行することが可能である。データ転送部35は、例えば、メインメモリ22に格納されているデータを、パケット生成部36またはオンチップメモリ33へ転送する。なお、データ転送部35が実行する処理の全部または一部は、DMAC(Direct Memory Access Controller)に実装してオフロード実行されてもよい。 The data transfer unit 35 can execute various data transfers according to instructions from the main CPU 21, the sub CPU 31, and the packet generation unit 36. The data transfer unit 35 transfers, for example, the data stored in the main memory 22 to the packet generation unit 36 or the on-chip memory 33. In addition, all or a part of the processing executed by the data transfer unit 35 may be implemented in DMAC (Direct Memory Access Controller) and executed offload.

パケット生成部36は、サブCPU31から、複数パケット生成処理を実行させるため入力されるラージパケットに基づいて、ネットワークバッファ34に格納されているユーザデータ(ペイロード)をパケット化する。ラージパケットとは、サブCPU31からパケット生成部36に入力される、複数のネットワークバッファ34を連結して格納することができる大きいサイズの送信データである。 The packet generation unit 36 packetizes the user data (payload) stored in the network buffer 34 based on the large packet input from the sub CPU 31 to execute the plurality of packet generation processes. The large packet is large-sized transmission data input from the sub CPU 31 to the packet generation unit 36, which can concatenate and store a plurality of network buffers 34.

まず、パケット生成部36は、サブCPU31から入力される、ラージパケットを構成する先頭のネットワークバッファ34に格納されるTCP/IPのヘッダ情報に基づいて、複数のパケットのための複数のヘッダを生成する。具体的には、パケット生成部36は、先頭のネットワークバッファ34に格納されるラージパケットのTCP/IPヘッダを複製し、パケットごとに値が異なるフィールドを書き換えることで、複数のヘッダを生成する。 First, the packet generation unit 36 generates a plurality of headers for a plurality of packets based on the TCP / IP header information input from the sub CPU 31 and stored in the first network buffer 34 constituting the large packet. To do. Specifically, the packet generation unit 36 generates a plurality of headers by duplicating the TCP / IP header of the large packet stored in the first network buffer 34 and rewriting the fields having different values for each packet.

例えば、ヘッダ内のIPアドレス情報やポート番号情報は、ラージパケットのTCP/IPヘッダ内の値が複製されるが、TCPシーケンス番号は、パケット生成部36により書き換えられる。ラージパケットに含まれるTCPシーケンス番号は先頭パケットのシーケンス番号であるため、分割されたパケットの各ペイロードサイズから次パケット以降のシーケンス番号が計算されるからである。
パケット生成部36が生成した複数のヘッダは、パケット生成部36の内蔵メモリへ格納してもよく、オンチップメモリ33上にヘッダ格納用に獲得されたネットワークバッファ34へ格納してもよい。サブCPU31は、生成されたヘッダと、各ヘッダに対応するネットワークバッファ34上の送信データ(ペイロード)とを連結することにより、パケット生成部36を介してネットワークへ送信すべき複数のパケットを生成する。
For example, the IP address information and the port number information in the header are duplicated with the values in the TCP / IP header of the large packet, but the TCP sequence number is rewritten by the packet generation unit 36. This is because the TCP sequence number included in the large packet is the sequence number of the first packet, so the sequence numbers of the next and subsequent packets are calculated from each payload size of the divided packets.
The plurality of headers generated by the packet generation unit 36 may be stored in the built-in memory of the packet generation unit 36, or may be stored in the network buffer 34 acquired for header storage on the on-chip memory 33. The sub CPU 31 generates a plurality of packets to be transmitted to the network via the packet generation unit 36 by concatenating the generated header and the transmission data (payload) on the network buffer 34 corresponding to each header. ..

なお、パケット生成部36が実行する処理の全部または一部は、TSO(TCP Segmentation Offload)のオフローダに実装してオフロード実行することができる。このTSOは、例えばNIC上にハードウェアオフローダとして実装されてよい。
ローカルバス39は、通信処理部3の各機能ブロックを相互接続するとともに、メインバス23にバスブリッジ4を介して接続する。
All or part of the processing executed by the packet generation unit 36 can be implemented in an offloader of TSO (TCP Transmission Offload) and executed offload. This TSO may be implemented as a hardware offloader on the NIC, for example.
The local bus 39 interconnects the functional blocks of the communication processing unit 3 and connects to the main bus 23 via the bus bridge 4.

LAN(Local Area Network)制御部37は、ネットワーク5へ接続する有線通信インターフェースであり、パケットの送受信を実行する。このLAN制御部37は、伝送メディアのPHYレイヤおよびMACレイヤ(伝送メディア制御)のハードウェア回路を含む。例えば、LAN制御部37のインターフェースがEthernet(登録商標)である場合、LAN制御部37は、イーサネット(登録商標)NIC(Network Interface Card)に相当する。
WLAN(Wireless LAN)制御部38は、ネットワーク5に接続する無線通信インターフェースであり、パケットの送受信を実行する。このWLAN制御部38は、IEEE802.11a/b/g/n/ac等の無線LAN制御を実行するコントローラおよびRF(Radio Frequency)回路を含む。
パケット生成部36およびサブCPU31により生成された複数のパケットは、LAN制御部37やWLAN制御部38等の通信制御部に受け渡されて、ネットワーク5へ送出される。
The LAN (Local Area Network) control unit 37 is a wired communication interface that connects to the network 5, and executes transmission / reception of packets. The LAN control unit 37 includes a hardware circuit of a PHY layer and a MAC layer (transmission media control) of a transmission medium. For example, when the interface of the LAN control unit 37 is Ethernet (registered trademark), the LAN control unit 37 corresponds to an Ethernet (registered trademark) NIC (Network Interface Card).
The WLAN (Wireless LAN) control unit 38 is a wireless communication interface connected to the network 5 and executes transmission / reception of packets. The WLAN control unit 38 includes a controller that executes wireless LAN control such as IEEE802.11a / b / g / n / ac and an RF (Radio Frequency) circuit.
The plurality of packets generated by the packet generation unit 36 and the sub CPU 31 are passed to communication control units such as the LAN control unit 37 and the WLAN control unit 38, and are sent to the network 5.

<ペイロードサイズ決定処理>
サブCPU31のペイロードサイズ決定部32は、これから送信すべきパケットのTCP/IPプロトコルのオプションヘッダのサイズに基づいて、ラージパケットを複数のパケットに分割する際のデータ分割サイズを決定する。
具体的には、ペイロードサイズ決定部32は、MSS(Maximum Segment Size)から、TCPオプションヘッダのサイズを除いたサイズを、データ分割サイズとして決定する。MSSは、TCPセッション等の通信セッションの確立時に設定される、ユーザデータの送信単位(セグメント)の最大値、すなわち当該TCPセッションで送信可能な最大セグメントサイズである。通常、このMSSは、通信対向装置から当該装置が受信できるセグメントの最大値として、コネクション確立時にTCPオプションで通知される。
<Payload size determination process>
The payload size determination unit 32 of the sub CPU 31 determines the data division size when dividing a large packet into a plurality of packets based on the size of the option header of the TCP / IP protocol of the packet to be transmitted from now on.
Specifically, the payload size determination unit 32 determines the size obtained by excluding the size of the TCP option header from the MSS (Maximum Segment Size) as the data division size. The MSS is the maximum value of the transmission unit (segment) of user data set when establishing a communication session such as a TCP session, that is, the maximum segment size that can be transmitted in the TCP session. Normally, this MSS is notified by the TCP option when the connection is established as the maximum value of the segment that the device can receive from the communication opposite device.

サブCPU31は、パケット生成部36に複数パケット生成処理を実行させるための入力情報を生成する。サブCPU31はまた、パケット生成部36が複数のパケットのそれぞれに付加すべき複数のTCP/IPヘッダを複製により生成するためのTCP/IPヘッダの情報をパケット生成部36に入力する。
本実施形態では、パケット生成部36にパケット分割させるため入力される入力情報を、ラージパケットという。このラージパケットを複数のネットワークバッファ34を連結して生成し、パケット生成部36へ入力することで、パケット生成部36を介して、1つのラージパケットが分割された複数のパケットを生成することができる。
The sub CPU 31 generates input information for causing the packet generation unit 36 to execute a plurality of packet generation processes. The sub CPU 31 also inputs information on the TCP / IP header to the packet generation unit 36 for the packet generation unit 36 to generate a plurality of TCP / IP headers to be added to each of the plurality of packets by duplication.
In the present embodiment, the input information input for causing the packet generation unit 36 to divide the packet is referred to as a large packet. By generating this large packet by concatenating a plurality of network buffers 34 and inputting it to the packet generation unit 36, it is possible to generate a plurality of packets in which one large packet is divided via the packet generation unit 36. it can.

図2は、通信装置1のオンチップメモリ33のネットワークバッファ34上に、サブCPU31により構成される、ラージパケットの構成例を示す。
ラージパケットは、これから送信しようとする複数パケット分のペイロードと、このペイロードに対応する一組のTCPヘッダおよびIPヘッダとが連結されて成るTCP/IPパケットの構成を有する。
FIG. 2 shows a configuration example of a large packet configured by the sub CPU 31 on the network buffer 34 of the on-chip memory 33 of the communication device 1.
The large packet has a TCP / IP packet configuration in which a payload for a plurality of packets to be transmitted is concatenated with a set of TCP headers and IP headers corresponding to the payload.

図2に示すように、ラージパケットは、複数のネットワークバッファNB1〜NB4が連結された領域に格納される。TCP/IPヘッダが格納されるネットワークバッファNB1と、各ペイロードが格納されるネットワークバッファNB2〜NB4とは、それぞれ別個のバッファである。各ネットワークバッファNB1〜NB4に設けられたネクストバッファの領域に、当該バッファに連結されるべき次のバッファのアドレスを設定することで、複数のネットワークバッファNB1〜NB4が連結される。
なお、各ネットワークバッファNB1〜NB4は、必ずしもオンチップメモリ33上の連続する領域に配置される必要はない。また、図2には4つのネットワークバッファNB1〜NB4が図示されているが、ネットワークバッファの数は4つに限定されず、送信されるべきユーザデータ長やコネクションの情報等に基づいて適宜その数が決定されてよい。
As shown in FIG. 2, the large packet is stored in an area in which a plurality of network buffers NB1 to NB4 are concatenated. The network buffer NB1 in which the TCP / IP header is stored and the network buffers NB2 to NB4 in which each payload is stored are separate buffers. A plurality of network buffers NB1 to NB4 are concatenated by setting the address of the next buffer to be concatenated to the buffer in the area of the next buffer provided in each network buffer NB1 to NB4.
The network buffers NB1 to NB4 do not necessarily have to be arranged in a continuous area on the on-chip memory 33. Further, although four network buffers NB1 to NB4 are shown in FIG. 2, the number of network buffers is not limited to four, and the number of network buffers is appropriately increased based on the user data length to be transmitted, connection information, and the like. May be determined.

先頭のネットワークバッファNB1には、TCP/IPヘッダ(IPヘッダおよびTCPヘッダ)が格納される。先頭のネットワークバッファNB1にはまた、TCPオプションヘッダも格納される。図2では、TCP/IPヘッダに連続するTCPオプションヘッダとして、SACK(Selective ACK)ブロックのオプションヘッダが格納されている。
ラージパケットが持つTCP/IPヘッダに含まれる情報は、ラージパケットが複数のパケットに分割された際の先頭のパケットに対応した値となっている。また、ラージパケット内の複数のペイロードのそれぞれ(ペイロード1〜3)は、ペイロードサイズ決定部32により決定されたデータ分割サイズを最大値として、各ネットワークバッファNB2〜NB4に格納されている。
TCP / IP headers (IP header and TCP header) are stored in the first network buffer NB1. The TCP option header is also stored in the first network buffer NB1. In FIG. 2, the option header of the SACK (Selective ACK) block is stored as the TCP option header continuous with the TCP / IP header.
The information included in the TCP / IP header of the large packet is a value corresponding to the first packet when the large packet is divided into a plurality of packets. Further, each of the plurality of payloads (payloads 1 to 3) in the large packet is stored in each network buffer NB2 to NB4 with the data division size determined by the payload size determination unit 32 as the maximum value.

図2に示すラージパケットは、3パケット分のペイロードを含む。ペイロード1およびペイロード2は、ペイロードサイズ決定部32により決定されたデータ分割サイズに相当するサイズを有する。一方、ペイロード3は、ペイロードサイズ決定部32により決定されたデータ分割サイズに満たないサイズを有する。 The large packet shown in FIG. 2 includes a payload for three packets. The payload 1 and the payload 2 have a size corresponding to the data division size determined by the payload sizing unit 32. On the other hand, the payload 3 has a size less than the data division size determined by the payload size determination unit 32.

図2にTCPオプションヘッダとして図示されるSACKブロックは、TCPのオプションであるSACK(Selective ACK)が有効である場合に、ペイロードの前に付加されるTCPオプションヘッダの1つである。データ送信に応答する通常のACKは、ACK番号までのデータがすべて受信されたことを通知するが、一方、SACKを有効にしたACK(SACK)は、部分的にデータが受信されたことを通知することができる。SACKオプションを有効にして、SACKによりデータ受信の確認応答を送信することで、データの再送効率を上げることができる。 The SACK block shown as the TCP option header in FIG. 2 is one of the TCP option headers added before the payload when the TCP option SACK (Selective ACK) is enabled. A normal ACK that responds to data transmission notifies that all data up to the ACK number has been received, while an ACK (SACK) with SACK enabled notifies that data has been partially received. can do. Data retransmission efficiency can be improved by enabling the SACK option and transmitting a data reception acknowledgment by SACK.

図3は、TCPのオプションであるSACKが送信側および受信側の双方でサポートされており有効である場合の、データ受信およびACK送信のシーケンスの一例を示す。
データ送信側装置311から、5つの連続する送信データ(Seq=100、200、300、400)が対向するデータ受信側装置312に送信され、そのうち送信データ(Seq=300)がデータ受信側装置312に未達であるとする。
これに対して、データ受信側装置312が、SACKが有効である場合に、SACK(Ack=300、SLE=400、SRE=500)を送信したものとする。
この場合、データ送信側装置311は、Seq=300のデータのみを再送すればよく、データ受信側装置312にすでに受信された後続するSeq=400のデータは再送する必要がない。このため、SACKが無効である場合にSeq=300、およびSeq=400のデータのデータを再送しなければならないことと比較して、再送効率が向上する。
FIG. 3 shows an example of a data reception and ACK transmission sequence when the TCP option SACK is supported and enabled on both the transmit and receive sides.
Five consecutive transmission data (Seq = 100, 200, 300, 400) are transmitted from the data transmission side device 311 to the opposite data reception side device 312, of which the transmission data (Seq = 300) is the data reception side device 312. Is not reached.
On the other hand, it is assumed that the data receiving side device 312 transmits SACK (Ack = 300, SLE = 400, SRE = 500) when SACK is valid.
In this case, the data transmitting side device 311 need only retransmit the data of Seq = 300, and it is not necessary to retransmit the subsequent data of Seq = 400 already received by the data receiving side device 312. Therefore, the retransmission efficiency is improved as compared with having to retransmit the data of Seq = 300 and Seq = 400 when SACK is invalid.

SACKが有効である場合、パケットに付加されるべきTCPオプションヘッダとしてのSACKブロックが付加されるが、このSACKブロックのサイズ(SACKブロック長)は、データ受信側装置312のデータ受信状況により可変である。具体的には、SACKブロック長は、4+8*n(n=1〜4)バイトで算出されるため、TCPオプションヘッダのサイズは、+12バイトから+36バイトまで変動する。
このため、TCPオプションヘッダであるSACKブロックが付加されたために、IPパケット全体のサイズがネットワーク上の最大転送単位であるMTU(Maximum Transmission Unit)を超過してしまう場合がある。
When SACK is enabled, a SACK block as a TCP option header to be added to the packet is added, but the size of this SACK block (SACK block length) is variable depending on the data reception status of the data receiving side device 312. is there. Specifically, since the SACK block length is calculated in 4 + 8 * n (n = 1 to 4) bytes, the size of the TCP option header varies from +12 bytes to +36 bytes.
Therefore, since the SACK block, which is a TCP option header, is added, the size of the entire IP packet may exceed the MTU (Maximum Transmission Unit), which is the maximum transfer unit on the network.

例えば、MTUのサイズが1500バイトである場合に、MSSのサイズをTCP/IPパケット長の40バイトを減算した1460バイトとしているものとする。この場合、ペイロードをMSSのサイズで区切っていると、TCP/IPパケットにSACKブロックのTCPオプションヘッダが付加されることで、IPパケット全体のサイズがMTUを超えて、IPフラグメンテーションが発生する。すなわち、MTUのサイズを超過したIPパケットは、送信側で複数のIPパケットに分割した後に送信され、受信側で受信された複数のIPパケットから元のIPパケットへ再構成しなければならなず、通信スループットの低下を招いてしまう。
本実施形態では、このようなIPフラグメンテーションが発生しないように、サブCPU31のペイロードサイズ決定部32が、ペイロードサイズを決定する。
For example, when the MTU size is 1500 bytes, it is assumed that the MSS size is 1460 bytes obtained by subtracting 40 bytes of the TCP / IP packet length. In this case, if the payload is separated by the MSS size, the TCP option header of the SACK block is added to the TCP / IP packet, so that the size of the entire IP packet exceeds the MTU and IP fragmentation occurs. That is, an IP packet exceeding the MTU size must be divided into a plurality of IP packets on the transmitting side and then transmitted, and the plurality of IP packets received on the receiving side must be reconstructed into the original IP packet. , It causes a decrease in communication throughput.
In the present embodiment, the payload size determining unit 32 of the sub CPU 31 determines the payload size so that such IP fragmentation does not occur.

なお、上記では、ペイロードサイズ決定部32が、TCPオプションヘッダとしてのSACKブロック長に基づいて、MSSからSACKブロック長を減算してデータ分割サイズとして決定する例を説明したが、本実施形態はこれに限定されない。例えば、ペイロードサイズ決定部32は、SACKブロック以外のTCPオプションヘッダのヘッダ長を算出して、データ分割サイズを決定してもよく、IPオプションヘッダのヘッダ長を算出して、データ分割サイズを決定してもよい。例えば、ペイロードサイズ決定部32は、IPv6オプションヘッダとしてのホップバイホップルーティングヘッダのヘッダ長に基づいてデータ分割サイズを決定することができる。 In the above description, the payload size determination unit 32 subtracts the SACK block length from the MSS to determine the data division size based on the SACK block length as the TCP option header. Not limited to. For example, the payload size determination unit 32 may calculate the header length of the TCP option header other than the SACK block to determine the data division size, or calculate the header length of the IP option header to determine the data division size. You may. For example, the payload size determination unit 32 can determine the data division size based on the header length of the hop-by-hop routing header as the IPv6 option header.

<通信装置1のパケット生成および送信処理シーケンス例>
図4は、通信装置1がネットワーク5を介して通信対向装置へパケットを生成して送信する送信処理のシーケンスの一例を示す。
S41で、メインCPU21は、メインメモリ22内のユーザバッファ24へユーザデータを格納する。
S42で、メインCPU21は、アプリケーションからのユーザデータの送信要求として、ソケットAPIであるsend()を呼び出す。
S42でsend()の呼び出しが実行されると、サブCPU31は、パケット送信のため、データ転送処理を開始するが、まず、ユーザバッファ24からネットワークバッファ34へユーザデータをコピーする。
<Example of packet generation and transmission processing sequence of communication device 1>
FIG. 4 shows an example of a transmission processing sequence in which the communication device 1 generates and transmits a packet to the communication opposite device via the network 5.
In S41, the main CPU 21 stores user data in the user buffer 24 in the main memory 22.
In S42, the main CPU 21 calls send (), which is a socket API, as a request for transmitting user data from the application.
When the call of send () is executed in S42, the sub CPU 31 starts the data transfer process for packet transmission. First, the user data is copied from the user buffer 24 to the network buffer 34.

このユーザデータのネットワークバッファ34へのコピーを実行するため、S43で、サブCPU31は、まず、オンチップメモリ33のネットワークバッファ34用の領域から、ユーザデータ送信に必要なサイズ分のネットワークバッファ34を獲得する。複数のバッファを獲得する場合、獲得された複数のバッファは、バッファ情報のネクストバッファ領域に次バッファのアドレスを設定することにより全て連結された状態となる。
S44で、サブCPU31は、獲得されたネットワークバッファ34に対して、ユーザバッファ24からユーザデータをコピー(転送)するように、データ転送部35へ要求する。
ユーザデータのコピーを要求されたデータ転送部35は、S45で、ユーザバッファ24からユーザデータを読み出し、ラージパケットを生成するため、ネットワークバッファ34内の各バッファ領域へ分割して転送する。
In order to execute copying of the user data to the network buffer 34, in S43, the sub CPU 31 first transfers the network buffer 34 of the size required for user data transmission from the area for the network buffer 34 of the on-chip memory 33. Acquire. When a plurality of buffers are acquired, the acquired plurality of buffers are all concatenated by setting the address of the next buffer in the next buffer area of the buffer information.
In S44, the sub CPU 31 requests the data transfer unit 35 to copy (transfer) the user data from the user buffer 24 to the acquired network buffer 34.
In S45, the data transfer unit 35 requested to copy the user data reads the user data from the user buffer 24 and transfers the user data by dividing the user data into each buffer area in the network buffer 34 in order to generate a large packet.

S45のネットワークバッファ34へのデータ転送が完了すると、S46で、データ転送部35は、ユーザデータのデータ転送完了をサブCPU31へ通知する。
ユーザデータのネットワークバッファ34へのデータ転送完了が通知されると、S47で、サブCPU31は、これから送信すべきユーザデータの送信サイズを決定する。
TCPプロトコルにおける通信では、通信を行っているアプリケーションごとにコネクションが異なり、コネクションごとにウィンドウサイズ、MSS、通信対向装置からのデータ受信状況等が管理されている。
When the data transfer to the network buffer 34 in S45 is completed, the data transfer unit 35 notifies the sub CPU 31 of the completion of data transfer of the user data in S46.
When the completion of data transfer of the user data to the network buffer 34 is notified, in S47, the sub CPU 31 determines the transmission size of the user data to be transmitted from now on.
In the communication in the TCP protocol, the connection is different for each application communicating, and the window size, MSS, data reception status from the communication opposite device, etc. are managed for each connection.

本実施形態では、サブCPU31が各コネクションの管理を実行し、各コネクションのコネクション情報は、メインメモリ22に格納されている。
S47では、サブCPU31は、コネクション情報を参照して得られる送信ウインドウサイズ、輻輳ウィンドウサイズと、S45でネットワークバッファ34にコピーしたユーザデータのサイズを比較し、最も小さいサイズを送信サイズとして決定する。
S48で、サブCPU31は、複数パケットの生成処理を開始する。
In the present embodiment, the sub CPU 31 manages each connection, and the connection information of each connection is stored in the main memory 22.
In S47, the sub CPU 31 compares the transmission window size and the congestion window size obtained by referring to the connection information with the size of the user data copied to the network buffer 34 in S45, and determines the smallest size as the transmission size.
In S48, the sub CPU 31 starts the generation process of a plurality of packets.

具体的には、まず、サブCPU31内のペイロードサイズ決定部32により、ユーザデータからパケット生成部36に複数のパケットを一括生成させる際のデータ分割サイズを決定する。
ペイロードサイズ決定部32は、生成される複数のパケットが送信されるべきコネクションのコネクション情報を参照して、TCPオプションヘッダのサイズとMSSから、データ分割サイズを決定する。
ペイロードサイズ決定部32は、コネクション情報を参照し、TCPのSACKオプションが有効である場合は、通信対向装置からのデータ受信状況を確認して、SACKオプション長を算出する。
SACKオプションは、上述のとおり、通信相手からの送信データが部分的に受信できている場合に、受信できているデータ区間をAck番号等のパラメータにより通信相手に通知するTCPのオプションである。SACKを受信した通信相手は、SACKで通知されたデータ区間以外のデータのみを再送すればよいため、再送効率を上げることができる。
Specifically, first, the payload size determination unit 32 in the sub CPU 31 determines the data division size when the packet generation unit 36 collectively generates a plurality of packets from the user data.
The payload size determination unit 32 determines the data division size from the size of the TCP option header and the MSS by referring to the connection information of the connection to which the plurality of generated packets should be transmitted.
The payload size determination unit 32 refers to the connection information, and if the TCP SACK option is valid, confirms the data reception status from the communication opposite device and calculates the SACK option length.
As described above, the SACK option is a TCP option that notifies the communication partner of the received data section by a parameter such as an Ac number when the transmission data from the communication partner is partially received. Since the communication partner who has received the SACK only needs to retransmit the data other than the data section notified by the SACK, the retransmission efficiency can be improved.

ペイロードサイズ決定部32は、S48で、MSSからSACKオプション長を除いたサイズをデータ分割サイズとして決定する。サブCPU31は、送信データを、ペイロードサイズ決定部32により決定されたデータ分割サイズ分ずつ分割して、パケット生成部36に入力すべき入力情報であるラージパケットを生成する。
S49で、サブCPU31は、ネットワークバッファ34から、これからパケット生成部36により生成されるヘッダを格納するためのネットワークバッファ34を獲得する。
なお、S49でヘッダを格納するために獲得するネットワークバッファ34のデータエリアは、S43で獲得されるユーザデータを格納するネットワークバッファ34のデータエリアより小さいサイズに制限してもよい。
The payload size determination unit 32 determines in S48 the size obtained by subtracting the SACK option length from the MSS as the data division size. The sub CPU 31 divides the transmission data by the data division size determined by the payload size determination unit 32 to generate a large packet which is input information to be input to the packet generation unit 36.
In S49, the sub CPU 31 acquires the network buffer 34 for storing the header to be generated by the packet generation unit 36 from the network buffer 34.
The data area of the network buffer 34 acquired for storing the header in S49 may be limited to a size smaller than the data area of the network buffer 34 for storing the user data acquired in S43.

S50で、サブCPU31は、パケット生成部36へ、複数パケット生成処理を要求する。複数パケット生成処理は、TSO処理で実行されてよい。この複数パケット生成処理の要求は、パケット生成部36へラージパケットを指定することで実行され、一方、S48で通常パケットが生成されていた場合には、パケット生成部36への複数パケット生成要求は実行されない。
サブCPU31はさらに、パケット生成部36にTCP/IPヘッダを複製により生成させるための情報として、ラージパケットに対するTCP/IPヘッダの情報を生成してパケット生成部36へ受け渡す。本実施形態において、このラージパケットに対するTCP/IPヘッダの情報は、例えば、上記のTCPオプションヘッダとしてのSACKブロックの情報を含む。
パケット生成に必要な情報を設定した後、S50で、サブCPU31は、パケット生成部36へパケット生成要求を行う。
In S50, the sub CPU 31 requests the packet generation unit 36 to perform a plurality of packet generation processes. The multiple packet generation process may be executed by the TSO process. This request for multiple packet generation processing is executed by designating a large packet to the packet generation unit 36, while when a normal packet is generated in S48, the request for multiple packet generation to the packet generation unit 36 is executed. Not executed.
The sub CPU 31 further generates information on the TCP / IP header for the large packet and passes it to the packet generation unit 36 as information for causing the packet generation unit 36 to generate the TCP / IP header by duplication. In the present embodiment, the information of the TCP / IP header for this large packet includes, for example, the information of the SACK block as the above-mentioned TCP option header.
After setting the information necessary for packet generation, in S50, the sub CPU 31 makes a packet generation request to the packet generation unit 36.

S51で、パケット生成部36は、S50でサブCPU31から設定されたラージパケットを分割し、受け渡されたラージパケットに対するTCP/IPヘッダの情報から複数のTCP/IPヘッダを生成して、複数のパケットを生成する。
具体的には、パケット生成部36は、ヘッダ生成に必要な情報のうち、送信元、宛先IPアドレス、送信先、宛先ポート番号等、複数のパケット間で変化のないヘッダフィールドについては、全てラージパケットのヘッダを複製することでヘッダを生成する。
In S51, the packet generation unit 36 divides the large packet set from the sub CPU 31 in S50, generates a plurality of TCP / IP headers from the information of the TCP / IP header for the passed large packet, and generates a plurality of TCP / IP headers. Generate a packet.
Specifically, the packet generation unit 36 has a large header field such as a source, a destination IP address, a destination, and a destination port number that does not change between a plurality of packets among the information required for header generation. Generate a header by duplicating the packet header.

一方、パケット生成部36は、例えば、IPv4ヘッダにおけるチェックサム、データグラム長、TCPヘッダにおけるシーケンス番号、チェックサム等、複数のパケット間で変化するヘッダフィールドはラージパケットのヘッダから内容を変更する。なお、サブCPU31が生成する、ラージパケットに対するTCP/IPヘッダの情報は、テンプレートヘッダともいう。
本実施形態において、パケット生成部36がラージパケットのヘッダを複製して生成する複数のTCP/IPヘッダは、図2のネットワークバッファNB1に示されるラージパケットのヘッダと同様、TCPオプションヘッダ(SACKブロック)を含む。複数のパケットのすべてにTCPオプションヘッダであるSACKブロックが冗長に付加されることで、通信環境が悪い場合であってもデータ送受信の確実性が向上できる。
On the other hand, the packet generation unit 36 changes the contents of header fields that change between a plurality of packets, such as the checksum in the IPv4 header, the datagram length, the sequence number in the TCP header, and the checksum, from the header of the large packet. The TCP / IP header information for the large packet generated by the sub CPU 31 is also referred to as a template header.
In the present embodiment, the plurality of TCP / IP headers generated by the packet generation unit 36 by duplicating the header of the large packet are TCP option headers (SACK block) similar to the header of the large packet shown in the network buffer NB1 of FIG. )including. By redundantly adding the SACK block, which is a TCP option header, to all of a plurality of packets, the reliability of data transmission / reception can be improved even when the communication environment is poor.

S52で、パケット生成部36は、生成した複数のヘッダをS49で獲得したネットワークバッファ34の領域へ格納するよう、データ転送部35に指示する。データ転送部35は、格納を指示された複数のヘッダをネットワークバッファ34へ格納する。
生成された複数のヘッダがネットワークバッファ34に格納されると、S53で、データ転送部35は、パケット生成部36へ、生成された複数のヘッダのネットワークバッファ34への格納(書き込み)完了を通知する。
In S52, the packet generation unit 36 instructs the data transfer unit 35 to store the generated plurality of headers in the area of the network buffer 34 acquired in S49. The data transfer unit 35 stores a plurality of headers instructed to be stored in the network buffer 34.
When the generated plurality of headers are stored in the network buffer 34, the data transfer unit 35 notifies the packet generation unit 36 of the completion of storage (writing) of the generated plurality of headers in the network buffer 34 in S53. To do.

複数のヘッダのネットワークバッファ34への格納完了を通知されると、パケット生成部36は、生成された各ヘッダと対応する各ペイロードとをそれぞれ連結してパケットを生成するために、バッファ情報を更新する。具体的には、パケット生成部36は、ヘッダが格納されたネットワークバッファ34の次バッファアドレスへ、ペイロードが格納されたアドレスを設定することで、1つのパケットを形成することができる。同様の処理を、パケット数分繰り返し実行する。これにより、複数のパケットが生成される。なお、複数のヘッダから複数のパケットを生成する上記処理は、パケット生成部36に替えてその全部または一部をサブCPU31により実行されてもよい。
S54で、パケット生成部36は、複数のヘッダの生成が完了したことをサブCPU31へ通知する。
When notified of the completion of storage of the plurality of headers in the network buffer 34, the packet generation unit 36 updates the buffer information in order to concatenate each generated header and each corresponding payload to generate a packet. To do. Specifically, the packet generation unit 36 can form one packet by setting the address in which the payload is stored in the next buffer address of the network buffer 34 in which the header is stored. The same process is repeatedly executed for the number of packets. As a result, a plurality of packets are generated. The above process of generating a plurality of packets from a plurality of headers may be executed by the sub CPU 31 in whole or in part instead of the packet generation unit 36.
In S54, the packet generation unit 36 notifies the sub CPU 31 that the generation of the plurality of headers has been completed.

S54で複数パケットの生成が完了すると、S55で、サブCPU31は、パケット送信処理を開始する。
S56で、サブCPU31は、複数のパケットを連結した送信要求をWLAN制御部38へ通知する。
複数パケットの送信要求が通知されたWLAN制御部38は、S57で、ネットワークバッファ34上に格納されている複数のパケット(パケット群)を読み出して、ネットワーク5へ送信する。
When the generation of the plurality of packets is completed in S54, the sub CPU 31 starts the packet transmission process in S55.
In S56, the sub CPU 31 notifies the WLAN control unit 38 of a transmission request in which a plurality of packets are concatenated.
The WLAN control unit 38 notified of the transmission request of a plurality of packets reads a plurality of packets (packet group) stored in the network buffer 34 in S57 and transmits the plurality of packets (packet group) to the network 5.

S58で、WLAN制御部38は、全てのパケットの送信を完了すると、パケット送信の完了をサブCPU31へ通知する。なお、上記ではWLAN制御部38によりパケットを送信する例を説明したが、これに替えてLAN制御部37が同様にパケット送信してもよい。
上記のS47からS58までの処理が、一連の複数のパケット生成および送信処理に相当する。ネットワークバッファ34へコピーされたユーザデータを全て送信するまで、S47からS58の処理は繰り返される。
ネットワークバッファ34へコピーされたユーザデータがすべてパケットとして送信されると、S59で、サブCPU31は、メインCPU21に対し、send()コールが成功した旨の応答を通知する。
In S58, when the WLAN control unit 38 completes the transmission of all the packets, the WLAN control unit 38 notifies the sub CPU 31 of the completion of the packet transmission. Although the example in which the WLAN control unit 38 transmits the packet has been described above, the LAN control unit 37 may similarly transmit the packet instead.
The above processes S47 to S58 correspond to a series of a plurality of packet generation and transmission processes. The processes S47 to S58 are repeated until all the user data copied to the network buffer 34 is transmitted.
When all the user data copied to the network buffer 34 is transmitted as a packet, in S59, the sub CPU 31 notifies the main CPU 21 of a response indicating that the send () call is successful.

<通信装置1のパケット送信処理フロー>
図5は、本実施形態において通信装置1のサブCPU31が実行および制御するパケット送信処理の処理手順の一例を示すフローチャートである。図5に示す処理は、図4に示すS43からS58の処理に相当する。図5のパケット送信処理は、例えば、アプリケーションからユーザデータの送信を指示されたことを契機に起動されてよいが、これに限定されない。
S501で、アプリケーションからソケットAPIのsend()の実行を介して呼び出されることにより、サブCPU31は、パケット送信処理を開始し、ユーザバッファ24からネットワークバッファ34へ、ユーザデータをコピーする(図4のS43からS46に相当)。
<Packet transmission processing flow of communication device 1>
FIG. 5 is a flowchart showing an example of a processing procedure of packet transmission processing executed and controlled by the sub CPU 31 of the communication device 1 in the present embodiment. The process shown in FIG. 5 corresponds to the processes S43 to S58 shown in FIG. The packet transmission process of FIG. 5 may be started, for example, when an application instructs to transmit user data, but the packet transmission process is not limited to this.
In S501, the sub CPU 31 starts the packet transmission process and copies the user data from the user buffer 24 to the network buffer 34 by being called from the application via the execution of the socket API send () (FIG. 4). Corresponds to S43 to S46).

S502で、サブCPU31は、ネットワークバッファ34にコピーしたユーザデータにつき、これから送信する送信サイズを決定する(図4のS47に相当)。
S503で、サブCPU31は、アプリケーションからのsend()で使用されるTCPコネクションのコネクション情報を参照して、当該TCPコネクションにおいてSACKオプションが有効になっているか否かを判定する。SACKオプションの設定は、コネクション確立時に決定されており、当該コネクションのコネクション情報を参照することにより有効化されているか無効化されているかを判定することができる。
In S502, the sub CPU 31 determines the transmission size to be transmitted from the user data copied to the network buffer 34 (corresponding to S47 in FIG. 4).
In S503, the sub CPU 31 refers to the connection information of the TCP connection used in send () from the application, and determines whether or not the SACK option is enabled in the TCP connection. The setting of the SACK option is determined when the connection is established, and it can be determined whether the connection is enabled or disabled by referring to the connection information of the connection.

当該TCPコネクションでSACKオプションが有効になっている場合(S503:Y)、S504に進み、一方、SACKオプションが無効になっている場合(S503:N)、S504をスキップしてS505に進む。
S504で、サブCPU31は、TCPヘッダに付加されるSACKブロック長を算出する。SACKは通信対向装置から受信されたデータが不連続になっている場合に使用され、SACKブロック長は可変であって、SACKブロックはTCPヘッダに最大4つまで付加可能である。
なお、SACKオプションが有効であっても、通信対向装置から受信されたデータが連続して受信でている場合等、付加するべきSACKブロックがない場合、SACK長は0となる。
If the SACK option is enabled (S503: Y) in the TCP connection, the process proceeds to S504, while if the SACK option is disabled (S503: N), S504 is skipped and the process proceeds to S505.
In S504, the sub CPU 31 calculates the SACK block length added to the TCP header. SACK is used when the data received from the communication opposite device is discontinuous, the SACK block length is variable, and up to four SACK blocks can be added to the TCP header.
Even if the SACK option is valid, the SACK length is 0 when there is no SACK block to be added, such as when the data received from the communication opposite device is continuously received.

S505で、サブCPU31のペイロードサイズ決定部32は、データ分割サイズを算出する。データ分割サイズは、send()で使用されるTCPコネクションに設定されているMSSから、S504で算出されたSACKブロック長を減算することで算出することができる。なお、SACKオプションが無効であるTCPコネクションについては、当該TCPコネクションのMSSに設定された値をそのままデータ分割サイズとすればよい。 In S505, the payload size determination unit 32 of the sub CPU 31 calculates the data division size. The data division size can be calculated by subtracting the SACK block length calculated in S504 from the MSS set in the TCP connection used in send (). For a TCP connection for which the SACK option is invalid, the value set in the MSS of the TCP connection may be used as the data division size as it is.

S506で、サブCPU31は、S502で決定された送信サイズとS505で算出されたデータ分割サイズとを比較する。
送信サイズがデータ分割サイズより大きい場合(S506:Y)、S507に進んでラージパケットを生成する。一方、送信サイズがデータ分割サイズ以下である場合(S506:N)、すなわち、データ分割サイズで区切られるペイロード長以下である場合、S508に分岐して通常のパケットを生成して、S510へ進む。S508では、S502で決定された送信サイズに対応するユーザデータをペイロードとし、サブCPU31が、パケット生成部36を介さずに、ペイロードに対応するTCP/IPヘッダを付加することで通常のパケットを生成する。
In S506, the sub CPU 31 compares the transmission size determined in S502 with the data division size calculated in S505.
If the transmission size is larger than the data division size (S506: Y), the process proceeds to S507 to generate a large packet. On the other hand, when the transmission size is less than or equal to the data division size (S506: N), that is, when it is less than or equal to the payload length delimited by the data division size, it branches to S508 to generate a normal packet and proceeds to S510. In S508, the user data corresponding to the transmission size determined in S502 is used as the payload, and the sub CPU 31 generates a normal packet by adding the TCP / IP header corresponding to the payload without going through the packet generation unit 36. To do.

S506で送信サイズがデータ分割サイズより大きい場合、S507で、サブCPU31は、データ分割サイズに基づいて、ラージパケットを生成する。
具体的には、サブCPU31は、S502で決定された送信サイズに対応するユーザデータをペイロードとし、このペイロードに対応するTCP/IPヘッダを生成して付加することで、ラージパケットを生成する。なお、S506でラージパケットに付加されるTCPヘッダは、SACKオプションヘッダ(SACKブロック)を含む。
送信サイズは、ラージパケットのペイロードの全長となり、このペイロード全体を、図2に示すようにS505で算出されたデータ分割サイズ(ペイロードサイズ)によって複数のネットワークバッファ34それぞれで区切って、複数のパケットが生成される。
When the transmission size is larger than the data division size in S506, the sub CPU 31 generates a large packet based on the data division size in S507.
Specifically, the sub CPU 31 uses the user data corresponding to the transmission size determined in S502 as a payload, and generates and adds a TCP / IP header corresponding to this payload to generate a large packet. The TCP header added to the large packet in S506 includes a SACK option header (SACK block).
The transmission size is the total length of the payload of the large packet, and the entire payload is divided by each of the plurality of network buffers 34 by the data division size (payload size) calculated in S505 as shown in FIG. Generated.

S509で、サブCPU31は、S507で生成されたラージパケットをパケット生成部36に入力して、複数のパケットの一括生成処理を、例えばTSO処理により実行させる。パケット生成部36は、サブCPU31がS507で生成したラージパケットに付加されるTCP/IPヘッダを生成される複数のパケットの数だけ複製する。SACKオプションを含むTCP/IPヘッダは複製されて、複数のパケットのそれぞれに付加される。
S510で、サブCPU31は、S509で生成された複数のパケット、またはS508で生成された通常のパケットのいずれかを、例えばWLAN制御部38を介して外部へ送信する。
S511で、サブCPU31は、S501でネットワークバッファ34へコピーされたユーザデータ中に未送信のユーザデータが存在するか否かを判定する。未送信であるユーザデータがネットワークバッファ34中に存在する場合(S511:Y)、S502に戻ってS502からS511のパケット送信処理が実行される。一方、S501でネットワークバッファ34へコピーされたユーザデータがすべて送信されている場合、パケット送信処理を終了する。
In S509, the sub CPU 31 inputs the large packet generated in S507 to the packet generation unit 36, and causes a batch generation process of a plurality of packets to be executed by, for example, a TSO process. The packet generation unit 36 duplicates the TCP / IP header added to the large packet generated in S507 by the sub CPU 31 by the number of the plurality of packets to be generated. The TCP / IP header containing the SACK option is duplicated and added to each of the plurality of packets.
In S510, the sub CPU 31 transmits either a plurality of packets generated in S509 or a normal packet generated in S508 to the outside via, for example, the WLAN control unit 38.
In S511, the sub CPU 31 determines whether or not there is untransmitted user data in the user data copied to the network buffer 34 in S501. When untransmitted user data exists in the network buffer 34 (S511: Y), the process returns to S502 and the packet transmission processing from S502 to S511 is executed. On the other hand, when all the user data copied to the network buffer 34 in S501 is transmitted, the packet transmission process is terminated.

なお、図5のフローではパケット送信処理を開始した後、S504で、パケット生成処理を実行するごとに送信SACKブロック長を算出している。しかしながら本実施形態では、最初に生成すべきパケットに付加すべき送信SACKブロック長を一旦算出した後は、都度送信SACKブロック長を算出することなく、送信SACKブロック長を固定して使用してもよい。
具体的には、初回のパケット生成処理時のみに、MSSからSACKブロック長の最大値(例えば36バイト)を減算することで、データ分割サイズを算出し、初回に算出されたデータ分割サイズを使用してラージパケットを生成する。二回目以降のパケット生成処理では、データ分割サイズを再度算出することなく、初回で算出されたデータ分割サイズを使用すればよい。二回目以降のデータ分割サイズの算出を省略し、ラージパケット生成処理を簡易化することで、サブCPU31のパケット送信に係る負荷が軽減されるとともにパケット送信が高速化できる。
In the flow of FIG. 5, after starting the packet transmission process, the transmission SACK block length is calculated every time the packet generation process is executed in S504. However, in the present embodiment, after the transmission SACK block length to be added to the packet to be generated first is calculated once, the transmission SACK block length may be fixed and used without calculating the transmission SACK block length each time. Good.
Specifically, the data division size is calculated by subtracting the maximum value of the SACK block length (for example, 36 bytes) from the MSS only at the time of the first packet generation processing, and the data division size calculated at the first time is used. To generate a large packet. In the second and subsequent packet generation processes, the data division size calculated at the first time may be used without recalculating the data division size. By omitting the calculation of the data division size from the second time onward and simplifying the large packet generation process, the load related to the packet transmission of the sub CPU 31 can be reduced and the packet transmission can be speeded up.

以上説明したように、本実施形態によれば、複数のパケットを一括生成する際に、TCPオプションヘッダ長が付加されても、IPフラグメンテーションの発生が有効に防止された適切なペイロードサイズのパケットを生成することができる。 As described above, according to the present embodiment, when a plurality of packets are collectively generated, even if the TCP option header length is added, a packet having an appropriate payload size in which the occurrence of IP fragmentation is effectively prevented can be obtained. Can be generated.

(実施形態2)
以下、実施形態2を、図6および図7を参照して、上記の実施形態1と異なる点についてのみ詳細に説明する。実施形態1では、パケット生成部36が生成する複数のパケットのそれぞれについて同一のデータ分割サイズを算出した。これに対して、実施形態2では、先頭のパケットについて送信SACKブロック長を考慮してペイロードサイズを算出し、先頭のパケットに対してTCPオプションヘッダであるSACKブロックをTCP/IPヘッダに付加する。一方、2つ目以降のパケットについてはラージパケットをMSSで区切ってペイロードと生成し、TCPオプションヘッダであるSACKブロックはTCP/IPヘッダに付加されない。
(Embodiment 2)
Hereinafter, the second embodiment will be described in detail only with reference to FIGS. 6 and 7 and different from the above-described first embodiment. In the first embodiment, the same data division size was calculated for each of the plurality of packets generated by the packet generation unit 36. On the other hand, in the second embodiment, the payload size is calculated in consideration of the transmission SACK block length for the first packet, and the SACK block, which is a TCP option header, is added to the TCP / IP header for the first packet. On the other hand, for the second and subsequent packets, the large packet is separated by MSS and generated as a payload, and the SACK block, which is a TCP option header, is not added to the TCP / IP header.

実施形態2に係る通信装置1のハードウエア構成および機能構成は、図1に示される実施形態1と同様である。
実施形態2に係る通信装置1が実行するパケット生成および送信処理は、図4に示される実施形態1と同様である。
The hardware configuration and functional configuration of the communication device 1 according to the second embodiment are the same as those of the first embodiment shown in FIG.
The packet generation and transmission processing executed by the communication device 1 according to the second embodiment is the same as that of the first embodiment shown in FIG.

図6は、本実施形態において、通信装置1のサブCPU31が制御するパケット生成および送信処理の詳細処理手順の一例を示すフローチャートである。
S501〜S504の各処理は、図5に示す実施形態1のS501〜S504の各処理と同様である。
S504でTCPオプションヘッダとして付加されるべき送信SACK長を算出した後、S601で、通信装置1のサブCPU31は、ラージパケットの先頭のペイロードについて、データ分割サイズを算出して、S506へ進む。具体的算出方法は、実施形態1において、図5のS505でサブCPU31が算出するデータ分割サイズの算出方法と同一である。ただし、本実施形態では、S601で算出されたデータ分割サイズは、ラージパケットの先頭のペイロードにのみ適用される。
FIG. 6 is a flowchart showing an example of a detailed processing procedure of packet generation and transmission processing controlled by the sub CPU 31 of the communication device 1 in the present embodiment.
Each process of S501 to S504 is the same as each process of S501 to S504 of the first embodiment shown in FIG.
After calculating the transmission SACK length to be added as the TCP option header in S504, the sub CPU 31 of the communication device 1 calculates the data division size for the payload at the beginning of the large packet in S601, and proceeds to S506. The specific calculation method is the same as the data division size calculation method calculated by the sub CPU 31 in S505 of FIG. 5 in the first embodiment. However, in the present embodiment, the data division size calculated in S601 is applied only to the payload at the beginning of the large packet.

S506の処理は、図5に示す実施携帯1のS506の処理と同様である。
S506で、S502で決定された送信サイズがS601で算出されたデータ分割サイズより大きいと判定されると(S506:Y)、S602で、サブCPU31は、ラージパケットのヘッダと先頭ペイロードを生成する。
The processing of S506 is the same as the processing of S506 of the implementation mobile phone 1 shown in FIG.
When it is determined in S506 that the transmission size determined in S502 is larger than the data division size calculated in S601 (S506: Y), in S602, the sub CPU 31 generates a large packet header and a head payload.

本実施形態において、サブCPU31は、ヘッダ用のネットワークバッファ34に、TCPオプションヘッダであるSACKブロックを含まないTCP/IPヘッダを生成する。
一方、サブCPU31は、先頭ペイロード用のネットワークバッファ34には、まずTCPオプションヘッダであるSACKブロックを生成する。このSACKブロックに加えて、サブCPU31は、送信するユーザデータからS601で決定した先頭ペイロードのためのデータ分割サイズ分のユーザデータを区切ってペイロードとして生成する。
In the present embodiment, the sub CPU 31 generates a TCP / IP header that does not include the SACK block, which is a TCP option header, in the network buffer 34 for the header.
On the other hand, the sub CPU 31 first generates a SACK block, which is a TCP option header, in the network buffer 34 for the head payload. In addition to this SACK block, the sub CPU 31 divides the user data for the data division size for the head payload determined in S601 from the user data to be transmitted and generates it as a payload.

ヘッダ用のネットワークバッファ34は、先頭ペイロード用のネットワークバッファ34へ、ヘッダ用のネットワークバッファ34のネクストバッファ領域に先頭ペイロード用のネットワークバッファ34のアドレス(ポインタ)を指定することにより連結される。
S603で、サブCPU31は、ラージパケットの2つ目以降のペイロードを生成する。これら2つ目以降のペイロードについて、ネットワークバッファ34ごとにユーザデータ(ラージパケット)をMSSで区切ってパケットを生成する。
先頭ペイロード用のネットワークバッファ34と、2つ目以降のペイロード用のネットワークバッファ34の間も、ネクストバッファ領域へ次のネットワークバッファ34のアドレスを指定することにより連結される。残りの送信すべきユーザデータのすべてについてMSSで区切ってパケットを生成することで、ラージパケットの生成が完了する。
The network buffer 34 for the header is connected to the network buffer 34 for the head payload by designating the address (pointer) of the network buffer 34 for the head payload in the next buffer area of the network buffer 34 for the header.
In S603, the sub CPU 31 generates the second and subsequent payloads of the large packet. For these second and subsequent payloads, user data (large packets) are separated by MSS for each network buffer 34 to generate packets.
The network buffer 34 for the first payload and the network buffer 34 for the second and subsequent payloads are also concatenated by designating the address of the next network buffer 34 to the next buffer area. The generation of large packets is completed by generating packets separated by MSS for all the remaining user data to be transmitted.

図7は、S602およびS603の処理を経てネットワークバッファ34に生成されるラージパケットの構成の一例を示す。
図7を参照して、ヘッダ用のネットワークバッファNB1には、TCPオプションヘッダを含まないTCP/IPヘッダが生成されている。先頭ペイロード用のネットワークバッファNB2には、TCPオプションヘッダであるSACKブロックと、先頭ペイロード用のデータ分割サイズで区切られたペイロード1が格納されている。
一方、2つ目のネットワークバッファNB3、3つ目のネットワークバッファNB4には、MSSで区切られたペイロード2、ペイロード3がそれぞれ格納されている。
FIG. 7 shows an example of the configuration of a large packet generated in the network buffer 34 through the processes of S602 and S603.
With reference to FIG. 7, a TCP / IP header that does not include a TCP option header is generated in the network buffer NB1 for the header. The network buffer NB2 for the first payload stores the SACK block, which is a TCP option header, and the payload 1 separated by the data division size for the first payload.
On the other hand, the payload 2 and the payload 3 separated by the MSS are stored in the second network buffer NB3 and the third network buffer NB4, respectively.

図6に戻り、S509で、サブCPU31は、S603で生成されたラージパケットをパケット生成部36へ入力し、複数パケットの一括生成処理を実行させる。
パケット生成部36は、S602でサブCPU31により生成されたヘッダ(TCP/IPヘッダ)を生成する。このため、本実施形態では、パケット生成部36は、TCPオプションヘッダであるSACKブロックを含まないTCP/IPヘッダを複製して、各パケットへ付加する。結果として、先頭のペイロードのネットワークバッファ34(図7のNB1)のみ、TCP/IPヘッダに続いて、TCPオプションヘッダであるSACKブロックが付加されることになる。一方、先頭以外のペイロードのネットワークバッファ34には、TCPオプションヘッダであるSACKブロックは付加されない。
S508〜S511までの各処理は、図5に示すS508〜S511までの処理と同様である。
Returning to FIG. 6, in S509, the sub CPU 31 inputs the large packet generated in S603 to the packet generation unit 36, and causes the batch generation process of a plurality of packets to be executed.
The packet generation unit 36 generates a header (TCP / IP header) generated by the sub CPU 31 in S602. Therefore, in the present embodiment, the packet generation unit 36 duplicates the TCP / IP header that does not include the SACK block, which is the TCP option header, and adds it to each packet. As a result, only the network buffer 34 (NB1 in FIG. 7) of the first payload is added with the SACK block, which is a TCP option header, following the TCP / IP header. On the other hand, the SACK block, which is a TCP option header, is not added to the network buffer 34 of the payload other than the beginning.
Each process of S508 to S511 is the same as the process of S508 to S511 shown in FIG.

以上説明したように、本実施形態によれば、複数のパケットを一括生成する際に、先頭パケットにのみSACKブロックを付加しつつ、2つ目以降のパケットについてはSACKブロック長を考慮する場合より長いMSSでユーザデータを区切ることができる。したがって、IPフラグメンテーションの発生を有効に防止しつつ、2つ目以降のパケットをより長いペイロード長で生成することができるため、パケット送信のスループットが向上する。また、パケット受信側におけるSACKの受信処理の負荷も軽減される。 As described above, according to the present embodiment, when a plurality of packets are collectively generated, the SACK block is added only to the first packet, and the SACK block length is taken into consideration for the second and subsequent packets. User data can be separated by a long MSS. Therefore, the second and subsequent packets can be generated with a longer payload length while effectively preventing the occurrence of IP fragmentation, so that the throughput of packet transmission is improved. In addition, the load of SACK reception processing on the packet receiving side is also reduced.

また、本発明は、上述の実施形態の一部または1以上の機能を実現するプログラムによっても実現可能である。すなわち、そのプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータ(またはCPUやMPU等)における1つ以上のプロセッサがプログラムを読出し実行する処理により実現可能である。また、そのプログラムをコンピュータ可読な記録媒体に記録して提供してもよい。
また、コンピュータが読みだしたプログラムを実行することにより、実施形態の機能が実現されるものに限定されない。例えば、プログラムの指示に基づき、コンピュータ上で稼働しているオペレーティングシステム(OS)などが実際の処理の一部または全部を行い、その処理によって上記した実施形態の機能が実現されてもよい。
The present invention can also be realized by a program that realizes a part or one or more functions of the above-described embodiment. That is, it can be realized by supplying the program to the system or device via a network or storage medium, and reading and executing the program by one or more processors in the computer (or CPU, MPU, etc.) of the system or device. is there. Further, the program may be recorded and provided on a computer-readable recording medium.
Further, the function of the embodiment is not limited to the one realized by executing the program read by the computer. For example, the operating system (OS) running on the computer may perform a part or all of the actual processing based on the instruction of the program, and the function of the above-described embodiment may be realized by the processing.

1…通信装置、2…主処理部、3…通信処理部、4…バスブリッジ、5…ネットワーク、21…メインCPU、22…メインメモリ、23…メインバス、24…ユーザバッファ、31…サブCPU、32…ペイロードサイズ決定部、33…オンチップメモリ、34…ネットワークバッファ、35…データ転送部、36…パケット生成部、37…LAN制御部、38…WLAN制御部、39…ローカルバス 1 ... Communication device, 2 ... Main processing unit, 3 ... Communication processing unit, 4 ... Bus bridge, 5 ... Network, 21 ... Main CPU, 22 ... Main memory, 23 ... Main bus, 24 ... User buffer, 31 ... Sub CPU , 32 ... payload size determination unit, 33 ... on-chip memory, 34 ... network buffer, 35 ... data transfer unit, 36 ... packet generation unit, 37 ... LAN control unit, 38 ... WLAN control unit, 39 ... local bus

Claims (16)

通信装置であって、
前記通信装置が送信するパケットに付加されるヘッダであって、TCP(Transmission Control Protocol)に係るヘッダのヘッダ長を取得する取得手段と、
前記取得手段により取得された前記ヘッダ長と、前記パケットを送信するTCPコネクションにおけるMSS(Maximum Segment Size)とに基づいて、前記パケットに含めるペイロードのペイロード長を決定する決定手段と、
所定のタイミングにおいて前記通信装置が送信しようとする送信データの長さが、前記決定手段により決定された前記ペイロード長よりも長い場合、第1のハードウェアを用いて、前記決定手段により決定された前記ペイロード長のペイロードを含む複数のパケットを生成する第1の生成手段と、
前記送信データの長さが、前記決定手段により決定された前記ペイロード長よりも短い場合、前記第1のハードウェアとは異なる第2のハードウェアを用いてパケットを生成する第2の生成手段と、
を有することを特徴とする通信装置。
It ’s a communication device,
A header added to a packet transmitted by the communication device, and an acquisition means for acquiring the header length of the header related to TCP (Transmission Control Protocol).
A determination means for determining the payload length of the payload to be included in the packet based on the header length acquired by the acquisition means and the MSS (Maximum Segment Size) in the TCP connection for transmitting the packet.
When the length of the transmission data to be transmitted by the communication device at a predetermined timing is longer than the payload length determined by the determination means, it is determined by the determination means using the first hardware. A first generation means for generating a plurality of packets including a payload of the payload length, and
When the length of the transmission data is shorter than the payload length determined by the determination means, the second generation means for generating the packet using the second hardware different from the first hardware. ,
A communication device characterized by having.
前記ヘッダ長は、他の通信装置から前記TCPコネクションを介して送信されるデータの受信状況に基づいて決定される長さであることを特徴とする請求項1に記載の通信装置。 The communication device according to claim 1, wherein the header length is a length determined based on a reception status of data transmitted from another communication device via the TCP connection. 前記決定手段は、前記TCPコネクションを確立した際に前記ペイロード長を決定することを特徴とする請求項1に記載の通信装置。 The communication device according to claim 1, wherein the determination means determines the payload length when the TCP connection is established. 前記ヘッダ長は、TCPオプションヘッダのヘッダ長であることを特徴とする請求項1から3のいずれか1項に記載の通信装置。 The communication device according to any one of claims 1 to 3, wherein the header length is the header length of the TCP option header. 前記TCPオプションヘッダは、TCPのSACK(Selective ACK)オプションのためのヘッダであることを特徴とする請求項4に記載の通信装置。 The communication device according to claim 4, wherein the TCP option header is a header for the SACK (Selective ACK) option of TCP. 前記決定手段は、前記MSSからTCPオプションヘッダのヘッダ長を減算することにより、前記ペイロード長を決定することを特徴とする請求項4または5に記載の通信装置。 The communication device according to claim 4 or 5, wherein the determination means determines the payload length by subtracting the header length of the TCP option header from the MSS. 前記決定手段は、前記決定手段により決定された前記ペイロード長のペイロードにTCPヘッダを付加したパケット長が、MTU(Maximum Transmission Unit)を超えないよう、前記ペイロード長を決定することを特徴とする請求項1から5のいずれか1項に記載の通信装置。 The determination means is characterized in that the payload length is determined so that the packet length obtained by adding the TCP header to the payload of the payload length determined by the determination means does not exceed the MTU (Maximum Transmission Unit). Item 2. The communication device according to any one of Items 1 to 5. 前記決定手段により決定された前記ペイロード長に基づいて送信データを分割する分割手段と、
前記分割手段により分割された送信データを前記第1の生成手段へ入力する入力手段と、
を更に有し、
前記第1の生成手段は、前記入力手段により入力された前記分割された送信データを用いて複数のパケットを生成することを特徴とする請求項1から7のいずれか1項に記載の通信装置。
A dividing means for dividing transmission data based on the payload length determined by the determining means, and a dividing means.
An input means for inputting transmission data divided by the dividing means to the first generation means, and
With more
The communication device according to any one of claims 1 to 7, wherein the first generation means generates a plurality of packets using the divided transmission data input by the input means. ..
前記第1の生成手段は、前記分割された送信データを用いて、前記ペイロード長のペイロードを含む複数のパケットを生成することを特徴とする請求項8に記載の通信装置。 The communication device according to claim 8, wherein the first generation means uses the divided transmission data to generate a plurality of packets including a payload having the payload length. 前記第1の生成手段は、前記分割された送信データを用いて、前記ペイロード長のペイロードを含むパケットと、前記MSSのペイロードを含むパケットと、を生成することを特徴とする請求項8に記載の通信装置。 The first generation means according to claim 8, wherein the divided transmission data is used to generate a packet including a payload having the payload length and a packet including the payload of the MSS. Communication device. 複数の領域を有する送信バッファを更に有し、
前記分割手段は、前記分割された送信データの各々を前記複数の領域の各々に格納することを特徴とする請求項8から10のいずれか1項に記載の通信装置。
It also has a transmit buffer with multiple areas
The communication device according to any one of claims 8 to 10, wherein the dividing means stores each of the divided transmission data in each of the plurality of regions.
所定のTCP/IP(Internet Protocol)ヘッダを複製することにより、複数のTCP/IPヘッダを生成する第の生成手段を更に有し、
前記第1の生成手段は、前記第の生成手段により生成された前記複数のTCP/IPヘッダを用いて複数のパケットを生成することを特徴とする請求項1から11のいずれか1項に記載の通信装置。
It further has a third generation means of generating a plurality of TCP / IP headers by duplicating a predetermined TCP / IP (Internet Protocol) header.
The first generation means according to any one of claims 1 to 11, wherein a plurality of packets are generated by using the plurality of TCP / IP headers generated by the third generation means. The communication device described.
前記第1の生成手段により生成されたパケットを、前記TCPコネクションを介して送信する送信手段を更に有することを特徴とする請求項1から12のいずれか1項に記載の通信装置。 The communication device according to any one of claims 1 to 12, further comprising a transmission means for transmitting a packet generated by the first generation means via the TCP connection. 前記決定手段は、前記第2のハードウェアを用いて前記パケットに含めるペイロードのペイロード長を決定することを特徴とする請求項1から13のいずれか1項に記載の通信装置。The communication device according to any one of claims 1 to 13, wherein the determination means uses the second hardware to determine the payload length of the payload to be included in the packet. 第1のハードウェアと第2のハードウェアとを有する通信装置の制御方法であって、
前記通信装置が送信するパケットに付加されるヘッダであって、TCP(Transmission Control Protocol)に係るヘッダのヘッダ長を取得するステップと、
取得された前記ヘッダ長と、前記パケットを送信するTCPコネクションにおけるMSS(Maximum Segment Size)とに基づいて、前記パケットに含めるペイロードのペイロード長を決定するステップと、
所定のタイミングにおいて前記通信装置が送信しようとする送信データの長さが、決定された前記ペイロード長よりも長い場合、前記第1のハードウェアを用いて、決定された前記ペイロード長のペイロードを含む複数のパケットを生成するステップと、
前記送信データの長さが、決定された前記ペイロード長よりも短い場合、前記第1のハードウェアとは異なる前記第2のハードウェアを用いてパケットを生成するステップと、
を含むことを特徴とする通信装置の制御方法。
A control method for a communication apparatus which have a the first hardware and second hardware,
A step of acquiring the header length of a header related to TCP (Transmission Control Protocol), which is a header added to a packet transmitted by the communication device, and
A step of determining the payload length of the payload to be included in the packet based on the acquired header length and the MSS (Maximum Segment Size) in the TCP connection for transmitting the packet.
When the length of the transmission data to be transmitted by the communication device at a predetermined timing is longer than the determined payload length, the first hardware is used to include the payload of the determined payload length. Steps to generate multiple packets and
When the length of the transmitted data is shorter than the determined payload length, a step of generating a packet using the second hardware different from the first hardware, and a step of generating a packet.
A method of controlling a communication device, which comprises.
コンピュータを、請求項1から1のいずれか1項に記載の通信装置の各手段として機能させるためのプログラム。 Computer program to function as each unit of the communication apparatus according to any one of claims 1 1 4.
JP2019027378A 2019-02-19 2019-02-19 Communication equipment, control methods and programs for communication equipment Active JP6891201B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019027378A JP6891201B2 (en) 2019-02-19 2019-02-19 Communication equipment, control methods and programs for communication equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019027378A JP6891201B2 (en) 2019-02-19 2019-02-19 Communication equipment, control methods and programs for communication equipment

Publications (2)

Publication Number Publication Date
JP2020136883A JP2020136883A (en) 2020-08-31
JP6891201B2 true JP6891201B2 (en) 2021-06-18

Family

ID=72263746

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019027378A Active JP6891201B2 (en) 2019-02-19 2019-02-19 Communication equipment, control methods and programs for communication equipment

Country Status (1)

Country Link
JP (1) JP6891201B2 (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4942375B2 (en) * 2006-03-27 2012-05-30 株式会社ソニー・コンピュータエンタテインメント Network processing equipment
JP2008113327A (en) * 2006-10-31 2008-05-15 Matsushita Electric Ind Co Ltd Network interface device
JP5768683B2 (en) * 2011-11-28 2015-08-26 富士通株式会社 Reception data processing method, communication apparatus, and program
JP5942706B2 (en) * 2012-08-29 2016-06-29 富士通株式会社 Monitoring device, monitoring program, and monitoring method
JP6963411B2 (en) * 2017-05-19 2021-11-10 キヤノン株式会社 Communication equipment, communication methods, and programs
JP2019016842A (en) * 2017-07-04 2019-01-31 キヤノン株式会社 Communication device and control method

Also Published As

Publication number Publication date
JP2020136883A (en) 2020-08-31

Similar Documents

Publication Publication Date Title
US12132663B2 (en) Technologies for protocol-agnostic network packet segmentation
US11336297B2 (en) DMA transfer apparatus, method of controlling the same, communication apparatus, method of controlling the same, and non-transitory computer-readable storage medium
JP6963411B2 (en) Communication equipment, communication methods, and programs
US20250112872A1 (en) Establishing connections in a computer network supporting a remote direct memory access (rdma) protocol
JP6234236B2 (en) Communication device
EP3319297A1 (en) Network interface device and host processing device
US20230062831A1 (en) Communication apparatus and control method thereof, and storage medium
JP6891201B2 (en) Communication equipment, control methods and programs for communication equipment
JP2018142853A (en) Communication method, communication device, and program
JP2019114947A (en) Communication device, control method of communication device, and program
JP2019165423A (en) Communication device, method for controlling communication device, and program
JP6675189B2 (en) Communication device, control method thereof, and program
JP2017038297A (en) Communication device, communication method and communication system
JP2019201249A (en) Communication device, communication device control method, and program
JP2020178182A (en) Communication equipment, control methods and programs for communication equipment
JP6279970B2 (en) Processor, communication apparatus, communication system, communication method, and computer program
JP6873953B2 (en) Communication equipment, control methods and programs for communication equipment
JP7321913B2 (en) Communication device, control method and program
US20230208913A1 (en) In-order streaming in-network computation
US20240171504A1 (en) Multi-path architecture for hardware offloading
JP2019016842A (en) Communication device and control method
JP6568571B2 (en) Data transfer device, data transfer method, and communication device
JP2026005543A (en) Communication device, control method thereof, and program
JP2017085378A (en) COMMUNICATION DEVICE AND METHOD, COMPUTER PROGRAM
JP2022161570A (en) Communication device, communication method and program

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20191219

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20191219

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20201208

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210202

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20210526

R151 Written notification of patent or utility model registration

Ref document number: 6891201

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: R3D03