JP6891201B2 - Communication equipment, control methods and programs for communication equipment - Google Patents
Communication equipment, control methods and programs for communication equipment Download PDFInfo
- 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
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).
ところで、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.
以下、添付図面を参照して、本発明を実施するための実施形態について詳細に説明する。なお、以下に説明する実施形態は、本発明の実現手段としての一例であり、本発明が適用される装置の構成や各種条件によって適宜修正又は変更されるべきものであり、本発明は以下の実施形態に必ずしも限定されるものではない。また、本実施形態で説明されている特徴の組み合わせの全てが本発明の解決手段に必須のものとは限らない。なお、同一の構成については、同じ符号を付して説明する。 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
通信装置1は、主処理部2、および通信処理部3を備える。主処理部2は、各種アプリケーションを含む、通信装置1の全体の処理を実行する。通信処理部3は、例えばTCP/IP等の通信プロトコル処理を含む各種通信処理や制御を実行する。主処理部2および通信処理部3は、バスブリッジ4により相互接続されている。
The
主処理部2は、メインCPU21、メインメモリ22、およびメインバス23を備える。
メインCPU21は、各種プログラムの実行を行うとともに、通信装置1の全体を制御する。メインCPU21により実行されるプログラムには、OS(Operating System)や各種アプリケーションが含まれる。
メインメモリ22は、メインCPU21や通信処理部3のサブCPU31が各処理を実行する上で必要となるデータやプログラムなどを格納する。このメインメモリ22は、例えば、DRAM(Dynamic Random Access Memory)等の半導体メモリで構成されてよい。
The
The
The
メインメモリ22内部には、メインCPU21によりユーザバッファ24が構成され、このユーザバッファ24にユーザデータが格納される。ユーザバッファ24は、メインCPU21の他、サブCPU31からもバスブリッジ4およびメインバス23を介してアクセス可能な領域とされる。ユーザバッファ23に格納されるユーザデータは、メインCPU21が通信装置1のアプリケーションからネットワーク5を介して通信対向装置へ送出したいデータを含む。以下、ユーザデータを、送信データ、または単に、データともいう。
メインバス24は、メインCPU21からメインメモリ22および通信処理部3へのアクセスおよびデータ転送、または通信処理部3からメインメモリ22へのアクセスおよびデータ転送などに使用される。
Inside the
The
通信処理部3は、サブCPU31、オンチップメモリ33、データ転送部35、パケット生成部36、LAN制御部37、WLAN制御部38、およびローカルバス39を備える。
サブCPU31は、各種通信処理に関するプログラムの実行を行う。サブCPU31により実行されるプログラムは、OSおよび通信プロトコル処理のための通信プロトコルスタックを含む。本実施形態では、通信プロトコル処理として、TCP/IPプロトコルスタックが実行される例を説明するが、他のプロトコルスタックであってもよい。
サブCPU31は、ペイロードサイズ決定部32を備える。
The communication processing unit 3 includes a
The
The
オンチップメモリ33は、例えば、ASICやFPGA内に構成される内部メモリである。オンチップメモリ33は、通信処理部3のサブCPU31、データ転送部35、パケット生成部36からアクセス可能なメモリである。このオンチップメモリ33は、例えばSRAM(Static Random Access Memory)等の半導体メモリで構成されてよく、これによりメインメモリ22より高速にアクセスされることが可能となる。また、オンチップメモリ33は、NIC(Network Interface Card)上に構成されるメモリデバイスであってもよい。
The on-
オンチップメモリ33内部には、サブCPU31により複数のネットワークバッファ34が構成される。これらのネットワークバッファ34は、サブCPU31が通信対向装置との間で送受信されるデータを処理する際に使用される送信バッファである。
ネットワークバッファ34は、送信バッファが必要になったタイミングでオンチップメモリ33に動的に獲得され、データ送信処理が終了して不要になった際に開放される。また、ネットワークバッファ34はそれぞれ、データ領域とネクストバッファ領域を持つ。 各ネットワークバッファ34内のネクストバッファ領域に、別のネットワークバッファのアドレス(ポインタ)を指定する。これにより、複数のネットワークバッファを連結して各ネットワークバッファ34のサイズより大きい送信データをパケット生成部36へ受け渡すことができる。このネットワークバッファ34の詳細は図2を参照して後述する。
Inside the on-
The network buffer 34 is dynamically acquired in the on-
データ転送部35は、メインCPU21、サブCPU31およびパケット生成部36からの指示に従って、各種データ転送を実行することが可能である。データ転送部35は、例えば、メインメモリ22に格納されているデータを、パケット生成部36またはオンチップメモリ33へ転送する。なお、データ転送部35が実行する処理の全部または一部は、DMAC(Direct Memory Access Controller)に実装してオフロード実行されてもよい。
The
パケット生成部36は、サブCPU31から、複数パケット生成処理を実行させるため入力されるラージパケットに基づいて、ネットワークバッファ34に格納されているユーザデータ(ペイロード)をパケット化する。ラージパケットとは、サブCPU31からパケット生成部36に入力される、複数のネットワークバッファ34を連結して格納することができる大きいサイズの送信データである。
The
まず、パケット生成部36は、サブCPU31から入力される、ラージパケットを構成する先頭のネットワークバッファ34に格納されるTCP/IPのヘッダ情報に基づいて、複数のパケットのための複数のヘッダを生成する。具体的には、パケット生成部36は、先頭のネットワークバッファ34に格納されるラージパケットのTCP/IPヘッダを複製し、パケットごとに値が異なるフィールドを書き換えることで、複数のヘッダを生成する。
First, the
例えば、ヘッダ内の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
The plurality of headers generated by the
なお、パケット生成部36が実行する処理の全部または一部は、TSO(TCP Segmentation Offload)のオフローダに実装してオフロード実行することができる。このTSOは、例えばNIC上にハードウェアオフローダとして実装されてよい。
ローカルバス39は、通信処理部3の各機能ブロックを相互接続するとともに、メインバス23にバスブリッジ4を介して接続する。
All or part of the processing executed by the
The
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)
The WLAN (Wireless LAN)
The plurality of packets generated by the
<ペイロードサイズ決定処理>
サブ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
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
In the present embodiment, the input information input for causing the
図2は、通信装置1のオンチップメモリ33のネットワークバッファ34上に、サブCPU31により構成される、ラージパケットの構成例を示す。
ラージパケットは、これから送信しようとする複数パケット分のペイロードと、このペイロードに対応する一組のTCPヘッダおよびIPヘッダとが連結されて成るTCP/IPパケットの構成を有する。
FIG. 2 shows a configuration example of a large packet configured by the
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-
先頭のネットワークバッファ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 (
図2に示すラージパケットは、3パケット分のペイロードを含む。ペイロード1およびペイロード2は、ペイロードサイズ決定部32により決定されたデータ分割サイズに相当するサイズを有する。一方、ペイロード3は、ペイロードサイズ決定部32により決定されたデータ分割サイズに満たないサイズを有する。
The large packet shown in FIG. 2 includes a payload for three packets. The
図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
On the other hand, it is assumed that the data receiving
In this case, the data transmitting
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
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
なお、上記では、ペイロードサイズ決定部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
FIG. 4 shows an example of a transmission processing sequence in which the
In S41, the
In S42, the
When the call of send () is executed in S42, the
このユーザデータのネットワークバッファ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
In S44, the
In S45, the
S45のネットワークバッファ34へのデータ転送が完了すると、S46で、データ転送部35は、ユーザデータのデータ転送完了をサブCPU31へ通知する。
ユーザデータのネットワークバッファ34へのデータ転送完了が通知されると、S47で、サブCPU31は、これから送信すべきユーザデータの送信サイズを決定する。
TCPプロトコルにおける通信では、通信を行っているアプリケーションごとにコネクションが異なり、コネクションごとにウィンドウサイズ、MSS、通信対向装置からのデータ受信状況等が管理されている。
When the data transfer to the network buffer 34 in S45 is completed, the
When the completion of data transfer of the user data to the network buffer 34 is notified, in S47, the
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
In S47, the
In S48, the
具体的には、まず、サブ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
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
In S49, the
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
The
After setting the information necessary for packet generation, in S50, the
S51で、パケット生成部36は、S50でサブCPU31から設定されたラージパケットを分割し、受け渡されたラージパケットに対するTCP/IPヘッダの情報から複数のTCP/IPヘッダを生成して、複数のパケットを生成する。
具体的には、パケット生成部36は、ヘッダ生成に必要な情報のうち、送信元、宛先IPアドレス、送信先、宛先ポート番号等、複数のパケット間で変化のないヘッダフィールドについては、全てラージパケットのヘッダを複製することでヘッダを生成する。
In S51, the
Specifically, the
一方、パケット生成部36は、例えば、IPv4ヘッダにおけるチェックサム、データグラム長、TCPヘッダにおけるシーケンス番号、チェックサム等、複数のパケット間で変化するヘッダフィールドはラージパケットのヘッダから内容を変更する。なお、サブCPU31が生成する、ラージパケットに対するTCP/IPヘッダの情報は、テンプレートヘッダともいう。
本実施形態において、パケット生成部36がラージパケットのヘッダを複製して生成する複数のTCP/IPヘッダは、図2のネットワークバッファNB1に示されるラージパケットのヘッダと同様、TCPオプションヘッダ(SACKブロック)を含む。複数のパケットのすべてにTCPオプションヘッダであるSACKブロックが冗長に付加されることで、通信環境が悪い場合であってもデータ送受信の確実性が向上できる。
On the other hand, the
In the present embodiment, the plurality of TCP / IP headers generated by the
S52で、パケット生成部36は、生成した複数のヘッダをS49で獲得したネットワークバッファ34の領域へ格納するよう、データ転送部35に指示する。データ転送部35は、格納を指示された複数のヘッダをネットワークバッファ34へ格納する。
生成された複数のヘッダがネットワークバッファ34に格納されると、S53で、データ転送部35は、パケット生成部36へ、生成された複数のヘッダのネットワークバッファ34への格納(書き込み)完了を通知する。
In S52, the
When the generated plurality of headers are stored in the network buffer 34, the
複数のヘッダのネットワークバッファ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
In S54, the
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
In S56, the
The
S58で、WLAN制御部38は、全てのパケットの送信を完了すると、パケット送信の完了をサブCPU31へ通知する。なお、上記ではWLAN制御部38によりパケットを送信する例を説明したが、これに替えてLAN制御部37が同様にパケット送信してもよい。
上記のS47からS58までの処理が、一連の複数のパケット生成および送信処理に相当する。ネットワークバッファ34へコピーされたユーザデータを全て送信するまで、S47からS58の処理は繰り返される。
ネットワークバッファ34へコピーされたユーザデータがすべてパケットとして送信されると、S59で、サブCPU31は、メインCPU21に対し、send()コールが成功した旨の応答を通知する。
In S58, when the
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
<通信装置1のパケット送信処理フロー>
図5は、本実施形態において通信装置1のサブCPU31が実行および制御するパケット送信処理の処理手順の一例を示すフローチャートである。図5に示す処理は、図4に示すS43からS58の処理に相当する。図5のパケット送信処理は、例えば、アプリケーションからユーザデータの送信を指示されたことを契機に起動されてよいが、これに限定されない。
S501で、アプリケーションからソケットAPIのsend()の実行を介して呼び出されることにより、サブCPU31は、パケット送信処理を開始し、ユーザバッファ24からネットワークバッファ34へ、ユーザデータをコピーする(図4のS43からS46に相当)。
<Packet transmission processing flow of
FIG. 5 is a flowchart showing an example of a processing procedure of packet transmission processing executed and controlled by the
In S501, the
S502で、サブCPU31は、ネットワークバッファ34にコピーしたユーザデータにつき、これから送信する送信サイズを決定する(図4のS47に相当)。
S503で、サブCPU31は、アプリケーションからのsend()で使用されるTCPコネクションのコネクション情報を参照して、当該TCPコネクションにおいてSACKオプションが有効になっているか否かを判定する。SACKオプションの設定は、コネクション確立時に決定されており、当該コネクションのコネクション情報を参照することにより有効化されているか無効化されているかを判定することができる。
In S502, the
In S503, the
当該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
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
S506で、サブCPU31は、S502で決定された送信サイズとS505で算出されたデータ分割サイズとを比較する。
送信サイズがデータ分割サイズより大きい場合(S506:Y)、S507に進んでラージパケットを生成する。一方、送信サイズがデータ分割サイズ以下である場合(S506:N)、すなわち、データ分割サイズで区切られるペイロード長以下である場合、S508に分岐して通常のパケットを生成して、S510へ進む。S508では、S502で決定された送信サイズに対応するユーザデータをペイロードとし、サブCPU31が、パケット生成部36を介さずに、ペイロードに対応するTCP/IPヘッダを付加することで通常のパケットを生成する。
In S506, the
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
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
Specifically, the
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
In S510, the
In S511, the
なお、図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
以上説明したように、本実施形態によれば、複数のパケットを一括生成する際に、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
実施形態2に係る通信装置1のハードウエア構成および機能構成は、図1に示される実施形態1と同様である。
実施形態2に係る通信装置1が実行するパケット生成および送信処理は、図4に示される実施形態1と同様である。
The hardware configuration and functional configuration of the
The packet generation and transmission processing executed by the
図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
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
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
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
本実施形態において、サブCPU31は、ヘッダ用のネットワークバッファ34に、TCPオプションヘッダであるSACKブロックを含まないTCP/IPヘッダを生成する。
一方、サブCPU31は、先頭ペイロード用のネットワークバッファ34には、まずTCPオプションヘッダであるSACKブロックを生成する。このSACKブロックに加えて、サブCPU31は、送信するユーザデータからS601で決定した先頭ペイロードのためのデータ分割サイズ分のユーザデータを区切ってペイロードとして生成する。
In the present embodiment, the
On the other hand, the
ヘッダ用のネットワークバッファ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
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
On the other hand, the
図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
The
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.
前記分割手段により分割された送信データを前記第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. ..
前記分割手段は、前記分割された送信データの各々を前記複数の領域の各々に格納することを特徴とする請求項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.
前記第1の生成手段は、前記第3の生成手段により生成された前記複数の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.
前記通信装置が送信するパケットに付加されるヘッダであって、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.
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)
| 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 |
-
2019
- 2019-02-19 JP JP2019027378A patent/JP6891201B2/en active Active
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 |