JP2021034954A - Communication apparatus, control method, and program - Google Patents

Communication apparatus, control method, and program Download PDF

Info

Publication number
JP2021034954A
JP2021034954A JP2019155592A JP2019155592A JP2021034954A JP 2021034954 A JP2021034954 A JP 2021034954A JP 2019155592 A JP2019155592 A JP 2019155592A JP 2019155592 A JP2019155592 A JP 2019155592A JP 2021034954 A JP2021034954 A JP 2021034954A
Authority
JP
Japan
Prior art keywords
management data
data
segment
communication device
protocol
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2019155592A
Other languages
Japanese (ja)
Other versions
JP7387335B2 (en
Inventor
駿 杉本
Shun Sugimoto
駿 杉本
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 JP2019155592A priority Critical patent/JP7387335B2/en
Publication of JP2021034954A publication Critical patent/JP2021034954A/en
Application granted granted Critical
Publication of JP7387335B2 publication Critical patent/JP7387335B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

To achieve dispersion on processing burden of transmission data with a simple structure.SOLUTION: A communication apparatus 100 transmitting a plurality of segment data obtained by dividing data to be transmitted on the basis of a prescribed communication protocol, comprises: acquisition means 208 of acquiring first management data for managing segment data from an OS (Operating System) Kernel during a protocol processing by the prescribed communication protocol; division means 217 of dividing each segment data when a segment size of each segment data managed by the first management data exceeds a prescribed size; generation means 215 of generating second management data managing each segment data divided by the division means; processing means 218 of performing the protocol processing to the second management data; and first transmission means 216 of transmitting the second management data protocol-processed by the processing means to the OS Kernel.SELECTED DRAWING: Figure 2

Description

本発明は、データ通信を行う通信装置に関する。 The present invention relates to a communication device that performs data communication.

TCP/IPのパケット化処理である、送信データのセグメント分割処理と、分割したセグメントのTCP/IPプロトコル処理とをハードウェアが行う技術がある。ここで、TCP/IPはTransmission Control Protocol/Internet Protocolの略である。 There is a technique in which hardware performs segment division processing of transmission data, which is TCP / IP packetization processing, and TCP / IP protocol processing of the divided segments. Here, TCP / IP is an abbreviation for Transmission Control Protocol / Internet Protocol.

特許文献1には、セグメント分割処理およびTCP/IPプロトコル処理をCPUと異なるハードウェアで処理する方法が記載されている。 Patent Document 1 describes a method of processing segment division processing and TCP / IP protocol processing with hardware different from that of the CPU.

特開2018−196053号公報Japanese Unexamined Patent Publication No. 2018-196053

特許文献1の方法は、通信デバイスに依存せずにTCP/IPパケット化をオフロード処理することができるが、OS(Operating System)カーネルのプロトコルスタックへの変更が伴う(例えば、OSのソースコードを変更する必要がある)。このような変更は保守性や品質面の観点から避けたいという要望がある。
本発明は、上記した課題に鑑みてなされたものであり、送信データの処理負担の分散を簡便な構成で実現できるようにすることを目的とする。
The method of Patent Document 1 can offload TCP / IP packetization independently of the communication device, but involves a change to the protocol stack of the OS (Operating System) kernel (for example, the source code of the OS). Need to be changed). There is a desire to avoid such changes from the standpoint of maintainability and quality.
The present invention has been made in view of the above problems, and an object of the present invention is to make it possible to distribute the processing load of transmitted data with a simple configuration.

上記目的を達成するために、本発明の1つの態様による通信装置は、送信すべきデータを分割して得た複数のセグメントデータを、所定の通信プロトコルに基づいて送信する通信装置であって、前記所定の通信プロトコルによるプロトコル処理中に、前記セグメントデータを管理する第一の管理データをOS(Operating System)カーネルから取得する取得手段と、前記第一の管理データにより管理されるセグメントデータのセグメントサイズが所定のサイズを超える場合、当該セグメントデータを分割する分割手段と、前記分割手段により分割されたセグメントデータを管理する第二の管理データを生成する生成手段と、前記第二の管理データに対して前記プロトコル処理を行う処理手段と、前記処理手段によりプロトコル処理された前記第二の管理データを、前記OSカーネルに送信する第1の送信手段と、を備える。 In order to achieve the above object, the communication device according to one aspect of the present invention is a communication device that transmits a plurality of segment data obtained by dividing data to be transmitted based on a predetermined communication protocol. An acquisition means for acquiring the first management data for managing the segment data from the OS (Operating System) kernel during protocol processing by the predetermined communication protocol, and a segment of the segment data managed by the first management data. When the size exceeds a predetermined size, the division means for dividing the segment data, the generation means for generating the second management data for managing the segment data divided by the division means, and the second management data. On the other hand, it includes a processing means for performing the protocol processing and a first transmission means for transmitting the second management data protocol-processed by the processing means to the OS kernel.

本発明によれば、送信データの処理負担の分散を簡便な構成で実現できる。 According to the present invention, it is possible to distribute the processing load of transmitted data with a simple configuration.

実施形態1に係る通信装置のハードウェア構成図。The hardware block diagram of the communication apparatus which concerns on Embodiment 1. FIG. 実施形態1に係る通信装置の機能構成図。The functional block diagram of the communication apparatus which concerns on Embodiment 1. FIG. 実施形態1に係るバッファ管理データ処理判定部の処理判定フロー図。FIG. 5 is a processing determination flow diagram of the buffer management data processing determination unit according to the first embodiment. 実施形態1に係るオフロード処理後のバッファ管理データを示す図。The figure which shows the buffer management data after the offload processing which concerns on Embodiment 1. 実施形態2に係る通信装置の機能構成図。The functional block diagram of the communication apparatus which concerns on Embodiment 2. FIG. 実施形態2に係るオフロード処理後のバッファ管理データを示す図。The figure which shows the buffer management data after the offload processing which concerns on Embodiment 2.

以下、添付図面を参照して本発明の実施形態を詳細に説明する。なお、以下の実施形態は本発明を限定するものではなく、また、実施形態で説明されている特徴の組み合わせの全てが本発明の解決手段に必須のものとは限らない。実施形態の構成は、本発明が適用される装置の仕様や各種条件(使用条件、使用環境等)によって適宜修正または変更され得る。本発明の技術的範囲は、特許請求の範囲によって確定されるのであって、以下の個別の実施形態によって限定されない。 Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings. It should be noted that the following embodiments do not limit the present invention, and not all combinations of features described in the embodiments are essential for the means for solving the present invention. The configuration of the embodiment may be appropriately modified or changed depending on the specifications of the apparatus to which the present invention is applied and various conditions (use conditions, use environment, etc.). The technical scope of the present invention is determined by the claims and is not limited by the following individual embodiments.

<実施形態1>
<通信装置のハードウェア構成>
図1は、本実施形態における通信装置100のハードウェア構成の一例を示す図である。通信装置100は、カメラ、プリンタ、スマートフォン、タブレット、PC(Personal Computer)、プロジェクタ等の通信機能を備えた装置である。通信装置100は、CPU102と、ROM103と、RAM104と、通信デバイス105と、オフロード処理ハードウェア106とを有する。システムバス101は、CPU102、ROM103、RAM104、通信デバイス105およびオフロード処理ハードウェア106を接続し、各種データの転送経路となる。CPUはCentral Processing Unitの略である。ROMはRead Only Memoryの略である。RAMはRandom Access Memoryの略である。
<Embodiment 1>
<Hardware configuration of communication device>
FIG. 1 is a diagram showing an example of the hardware configuration of the communication device 100 according to the present embodiment. The communication device 100 is a device having a communication function such as a camera, a printer, a smartphone, a tablet, a PC (Personal Computer), and a projector. The communication device 100 includes a CPU 102, a ROM 103, a RAM 104, a communication device 105, and offload processing hardware 106. The system bus 101 connects the CPU 102, the ROM 103, the RAM 104, the communication device 105, and the offload processing hardware 106, and serves as a transfer path for various data. CPU is an abbreviation for Central Processing Unit. ROM is an abbreviation for Read Only Memory. RAM is an abbreviation for Random Access Memory.

CPU102は、OSやデバイスドライバを介して各ハードウェア構成部(103〜106)を統括的に制御し、通信装置100を制御する。
ROM103は、CPU102で実行されるOSやデバイスドライバ等の制御プログラムを格納している。
RAM104は、CPU102の主メモリおよびワークエリア等として機能し、プログラムやデータを一時記憶する。
The CPU 102 comprehensively controls each hardware component (103 to 106) via the OS and the device driver, and controls the communication device 100.
The ROM 103 stores control programs such as an OS and a device driver executed by the CPU 102.
The RAM 104 functions as a main memory of the CPU 102, a work area, and the like, and temporarily stores programs and data.

通信デバイス105は、MAC(Media Access Control)モジュール107とPHY(Physical Layer)モジュール108を有し、Ethernet等のネットワーク111を介した通信相手装置との通信を行う。データの送受信は、CPU102によりネットワークドライバが実行され、これに応じてMACモジュール107が制御されることにより行われる。尚、本実施形態では、通信デバイス105は、Ethernetを介した通信を行うものとするが、これに替えて、無線LAN(Wi−Fi)等、IP通信可能な媒体を介して通信を行うことも可能である。 The communication device 105 has a MAC (Medium Access Control) module 107 and a PHY (Physical Layer) module 108, and communicates with a communication partner device via a network 111 such as Ethernet. Data transmission / reception is performed by executing a network driver by the CPU 102 and controlling the MAC module 107 accordingly. In the present embodiment, the communication device 105 communicates via Ethernet, but instead, it communicates via a medium capable of IP communication such as a wireless LAN (Wi-Fi). Is also possible.

オフロード処理ハードウェア106は、DMAC(Direct Memory Access Controller)109とプロトコル処理ハードウェア110を有し、セグメント分割処理や通信プロトコル処理をCPUからオフロードする。
DMAC109は、RAM104に記憶されているデータを、プロトコル処理ハードウェア110に転送したり、逆にプロトコル処理ハードウェア110で処理したデータをRAM104に転送したりする。DMAC109によるデータ転送は、CPU102により制御される。なお、図1には1つのDMAC109しか示されていないが、オフロード処理ハードウェア106に複数のDMAC109を設けてもよい。複数のDMACとは、例えば、RAM104からデータを読み込むためのDMACと、RAM104にデータを書き込むためのDMACである。
The offload processing hardware 106 has a DMAC (Direct Memory Access Controller) 109 and a protocol processing hardware 110, and offloads segment division processing and communication protocol processing from the CPU.
The DMAC 109 transfers the data stored in the RAM 104 to the protocol processing hardware 110, and conversely transfers the data processed by the protocol processing hardware 110 to the RAM 104. The data transfer by the DMAC109 is controlled by the CPU 102. Although only one DMAC 109 is shown in FIG. 1, a plurality of DMAC 109s may be provided in the offload processing hardware 106. The plurality of DMACs are, for example, a DMAC for reading data from the RAM 104 and a DMAC for writing data to the RAM 104.

プロトコル処理ハードウェア110は、TCP/IP等の通信プロトコル処理を実行する機能を持ったハードウェアで、TCPやUDPのチェックサム計算、通信ヘッダ生成処理等を行う。
なお、図1に示した構成は一例であり、通信装置100は図1に示されていない構成要素を備えてもよい。例えば、通信装置100はタイマ管理部を備えてもよい。タイマ管理部は、所定時間が経過したかを管理する。また、図1には1つのCPU102しか示されていないが、複数のCPUを設けてもよい。あるいは、CPU102は1つまたは複数のプロセッサにより置換されてもよい。通信装置100がカメラの場合には、撮像部や表示部を備えてもよい。
The protocol processing hardware 110 is hardware having a function of executing communication protocol processing such as TCP / IP, and performs checksum calculation of TCP and UDP, communication header generation processing, and the like.
The configuration shown in FIG. 1 is an example, and the communication device 100 may include components not shown in FIG. For example, the communication device 100 may include a timer management unit. The timer management unit manages whether a predetermined time has elapsed. Further, although only one CPU 102 is shown in FIG. 1, a plurality of CPUs may be provided. Alternatively, the CPU 102 may be replaced by one or more processors. When the communication device 100 is a camera, it may include an imaging unit and a display unit.

<通信装置の機能構成>
図2は、本実施形態における通信装置100の機能構成の一例を示す図である。尚、本実施形態では、CPU102が実行するOSカーネル201はLinux(登録商標)を想定するが、OSカーネル201はLinuxに限定されない。
アプリケーション200は、ユーザアプリケーションである。アプリケーション200により、任意のサイズの、送信対象のアプリケーションデータ(送信データ)がプロトコルスタック202に入力される。尚、本実施形態では、アプリケーション200は、TCP/IPv4通信を行うアプリケーションとして説明するが、UDP通信を行うアプリケーションでもよいし、IPv6通信を行うアプリケーションでもよい。
<Functional configuration of communication device>
FIG. 2 is a diagram showing an example of the functional configuration of the communication device 100 in the present embodiment. In the present embodiment, the OS kernel 201 executed by the CPU 102 is assumed to be Linux (registered trademark), but the OS kernel 201 is not limited to Linux.
The application 200 is a user application. The application 200 inputs application data (transmission data) of an arbitrary size to the protocol stack 202. In the present embodiment, the application 200 will be described as an application that performs TCP / IPv4 communication, but may be an application that performs UDP communication or an application that performs IPv6 communication.

プロトコルスタック202は、コネクション管理部203、第一バッファ管理データ生成部204、第一セグメント分割処理部205、第一プロトコル処理部206、ウィンドウ制御部207およびバッファ管理データフック部208を有する。
コネクション管理部203は、通信装置100の通信コネクションを管理する。例えば、コネクション管理部203は、アプリケーション200に対する通信コネクションのMSSやオフロード設定情報等のソケット情報やARP(Address Resolution Protocol)テーブルのエントリ情報等を管理する。ARPテーブルには、送信すべきセグメントデータのMACアドレスとIPアドレスが、エントリ情報として記憶される。
The protocol stack 202 includes a connection management unit 203, a first buffer management data generation unit 204, a first segment division processing unit 205, a first protocol processing unit 206, a window control unit 207, and a buffer management data hook unit 208.
The connection management unit 203 manages the communication connection of the communication device 100. For example, the connection management unit 203 manages socket information such as MSS and offload setting information of the communication connection for the application 200, entry information of the ARP (Address Resolution Protocol) table, and the like. The MAC address and IP address of the segment data to be transmitted are stored as entry information in the ARP table.

第一バッファ管理データ生成部204は、カーネル空間で使用する送信バッファの管理データを生成する。例えば、Linuxでは、struct sk_buffで定義される構造体を生成する。バッファ管理データは、カーネル空間のデータアドレスやソケット情報への参照、通信デバイス情報への参照等を含んでいる。 The first buffer management data generation unit 204 generates management data of the transmission buffer used in the kernel space. For example, Linux creates a structure defined by strike sk_buff. The buffer management data includes a reference to a kernel space data address and socket information, a reference to communication device information, and the like.

第一セグメント分割処理部205は、ユーザ空間に存在するアプリケーション200からの送信データをMSS単位で分割しながらバッファ管理データが管理するカーネル空間の送信バッファに分割送信データをコピーする。送信バッファにコピーする分割送信データのデータサイズはウィンドウ制御部207で管理されているTCP送信ウィンドウサイズや輻輳ウィンドウサイズ等から決定される。また、TCPセッションでチェックサム計算のオフロード設定がされていない場合、TCPセグメントに対するチェックサム値がコピーの際に計算される。
第一プロトコル処理部206は、TCPやUDPのトランスポート層の処理、IPのネットワーク層の処理、具体的には各プロトコルのヘッダ生成処理を行う。
The first segment division processing unit 205 copies the divided transmission data to the transmission buffer in the kernel space managed by the buffer management data while dividing the transmission data from the application 200 existing in the user space in MSS units. The data size of the divided transmission data to be copied to the transmission buffer is determined from the TCP transmission window size and the congestion window size managed by the window control unit 207. If the checksum calculation offload setting is not set in the TCP session, the checksum value for the TCP segment is calculated at the time of copying.
The first protocol processing unit 206 performs TCP and UDP transport layer processing, IP network layer processing, and specifically, header generation processing for each protocol.

ウィンドウ制御部207は、TCP送信ウィンドウサイズおよび輻輳ウィンドウを管理する。
バッファ管理データフック部208は、第一プロトコル処理部206がIP処理をしている途中でバッファ管理データをフックして処理するコールバックを登録する機能を有する。例えば、Linuxでは、Netfilterと呼ばれるフレームワークで提供されるAPIを使ってバッファ管理データフック部208が実現される。ここで、バッファ管理データのフックとは、バッファ管理データの取得処理を意味する。
The window control unit 207 manages the TCP transmission window size and the congestion window.
The buffer management data hook unit 208 has a function of registering a callback for hooking and processing buffer management data while the first protocol processing unit 206 is performing IP processing. For example, in Linux, the buffer management data hook unit 208 is realized by using the API provided by the framework called Netfilter. Here, the buffer management data hook means the buffer management data acquisition process.

通信デバイス転送処理部209は、プロトコルスタック202で処理されたバッファ管理データを通信デバイス105に入力する機能を有する。通信デバイス転送処理部209には、通信デバイス105のドライバも含まれる。なお、通信デバイス105のドライバはOSカーネル201に含まれていてもよいし、後述する動的にロードするソフトウェア(以下、「動的ロードソフトウェア210」と称する)として実現してもよい。 The communication device transfer processing unit 209 has a function of inputting the buffer management data processed by the protocol stack 202 to the communication device 105. The communication device transfer processing unit 209 also includes a driver for the communication device 105. The driver of the communication device 105 may be included in the OS kernel 201, or may be realized as dynamically loaded software (hereinafter, referred to as “dynamic loading software 210”) described later.

動的ロードソフトウェア210は、OSカーネル201の起動後に動的にロードされる。動的ロードソフトウェア210は、コールバック登録部211、バッファ管理データ処理判定部212、プロトコル処理返付部213、ソケット情報書き換え部214、第二バッファ管理データ生成部215および通信デバイス処理入力部216を有する。
コールバック登録部211は、バッファ管理データフック部208が提供する機能を用いて、バッファ管理データをIPプロトコル処理中にフックして処理するコールバックを登録する。つまり、本実施形態において、コールバック登録部211は、バッファ管理データをフックする機能を有する。
The dynamic loading software 210 is dynamically loaded after the OS kernel 201 is started. The dynamic load software 210 includes a callback registration unit 211, a buffer management data processing determination unit 212, a protocol processing return unit 213, a socket information rewriting unit 214, a second buffer management data generation unit 215, and a communication device processing input unit 216. ..
The callback registration unit 211 registers a callback to be hooked and processed during the IP protocol processing by using the function provided by the buffer management data hook unit 208. That is, in the present embodiment, the callback registration unit 211 has a function of hooking the buffer management data.

バッファ管理データ処理判定部212は、コールバック登録部211で登録されたコールバック内で、フックしたバッファ管理データの中身を解析し、処理判定を行う(バッファ管理データの処理の方法を決定する)。例えば、バッファ管理データ処理判定部212は、フックしたバッファ管理データを、フック元であるプロトコルスタック202の処理に戻すという判定(決定)をすることができる。また、バッファ管理データ処理判定部212は、フックしたバッファ管理データのソケット情報を書き換えるという判定をすることができる。さらに、バッファ管理データ処理判定部212は、フックしたバッファ管理データをオフロード処理するという判定をすることもできる。処理判定の詳細については図3を用いて後述する。 The buffer management data processing determination unit 212 analyzes the contents of the hooked buffer management data in the callback registered by the callback registration unit 211 and makes a processing determination (determines the method of processing the buffer management data). .. For example, the buffer management data processing determination unit 212 can determine (determine) that the hooked buffer management data is returned to the processing of the protocol stack 202 which is the hook source. Further, the buffer management data processing determination unit 212 can determine that the socket information of the hooked buffer management data is rewritten. Further, the buffer management data processing determination unit 212 can also determine that the hooked buffer management data is offloaded. The details of the processing determination will be described later with reference to FIG.

プロトコル処理返付部213は、バッファ管理データ処理判定部212においてフックしたバッファ管理データをプロトコルスタック202の処理に戻すと判定された場合、当該バッファ管理データをプロトコルスタック202に戻す。あるいは、プロトコル処理返付部213は、ソケット情報書き換え部214でソケット情報を書き換えたバッファ管理データをプロトコルスタック202に戻す。例えば、Netfilterフレームワークにおいては、コールバックの返り値としてNF_ACCEPTで定義された定数を返すことでプロトコルスタック202の処理に戻す。 When it is determined that the buffer management data hooked by the buffer management data processing determination unit 212 is returned to the processing of the protocol stack 202, the protocol processing return unit 213 returns the buffer management data to the protocol stack 202. Alternatively, the protocol processing return unit 213 returns the buffer management data whose socket information has been rewritten by the socket information rewriting unit 214 to the protocol stack 202. For example, in the Netfilter framework, the processing of the protocol stack 202 is returned by returning the constant defined in NF_ACCEPT as the return value of the callback.

ソケット情報書き換え部214は、バッファ管理データ処理判定部212においてフックしたバッファ管理データのソケット情報を書き換えると判定された場合、当該バッファ管理データのソケット情報を書き換える。書き換えるソケット情報は、例えば、MSSのキャッシュ値と、チェックサム計算をハードウェアオフロードする設定である。MSSのキャッシュ値を実際のMSS値よりも大きな値に設定することで、プロトコルスタック202の第一セグメント分割処理部205において分割されるセグメントデータサイズが大きくなる。これにより、一つのバッファ管理データで管理されるセグメントデータサイズが大きくなる。または、セグメントオフロードするように設定することでセグメントデータサイズを大きくしてもよい。セグメントオフロードするように設定する場合、最大セグメントサイズおよび最大セグメント数の設定も行う。また、チェックサム計算をハードウェアオフロードするように設定することで、第一セグメント分割処理部205においてコピーの際に発生するチェックサム計算処理がスキップされ、プロトコルスタック202の処理が軽減される。ソケット情報を書き換えたバッファ管理データはプロトコル処理返付部213によりプロトコルスタック202に戻される。ソケット情報を書き換えたコネクションについては、以降、大きなセグメントデータサイズでTCPチェックサム計算がされない状態のバッファ管理データが動的ロードソフトウェア210にフックされる。 When the socket information rewriting unit 214 determines to rewrite the socket information of the buffer management data hooked by the buffer management data processing determination unit 212, the socket information rewriting unit 214 rewrites the socket information of the buffer management data. The socket information to be rewritten is, for example, the cache value of MSS and the setting for hardware offloading the checksum calculation. By setting the cache value of the MSS to a value larger than the actual MSS value, the segment data size to be divided in the first segment division processing unit 205 of the protocol stack 202 becomes large. As a result, the segment data size managed by one buffer management data becomes large. Alternatively, the segment data size may be increased by setting the segment to be offloaded. When setting to offload segments, also set the maximum segment size and the maximum number of segments. Further, by setting the checksum calculation to be hardware offloaded, the checksum calculation process generated at the time of copying is skipped in the first segment division processing unit 205, and the process of the protocol stack 202 is reduced. The buffer management data in which the socket information has been rewritten is returned to the protocol stack 202 by the protocol processing return unit 213. For the connection whose socket information has been rewritten, the buffer management data in a state where the TCP checksum calculation is not performed with a large segment data size is subsequently hooked to the dynamic load software 210.

第二バッファ管理データ生成部215は、バッファ管理データ処理判定部212においてフックしたバッファ管理データのセグメント分割処理と通信プロトコル処理をハードウェアオフロードすると判定された場合に、バッファ管理データを生成する。生成するバッファ管理データの個数は、フックしたバッファ管理データが管理するセグメントデータサイズを実際のTCPセッションのMSSで割ることで算出する。割り切れずに余りが発生する場合は切り上げる。例えば、フックしたバッファ管理データが管理するセグメントデータサイズが15000Byteであり、MSSが1460Byteの場合、11個のバッファ管理データを生成する。また、第二バッファ管理データ生成部215は、生成したバッファ管理データおよびフックしたバッファ管理データをオフロード処理ハードウェア106に入力する。第二バッファ管理データ生成部215が生成したバッファ管理データは、OSカーネル201からフックしたバッファ管理データとは異なるので、第二のバッファ管理データと称してもよい。 The second buffer management data generation unit 215 generates buffer management data when it is determined in the buffer management data processing determination unit 212 that the segment division processing and the communication protocol processing of the buffer management data hooked by the buffer management data processing determination unit 212 are to be hardware offloaded. The number of buffer management data to be generated is calculated by dividing the segment data size managed by the hooked buffer management data by the MSS of the actual TCP session. If it is not divisible and a remainder occurs, round it up. For example, when the segment data size managed by the hooked buffer management data is 15000 bytes and the MSS is 1460 bytes, 11 buffer management data are generated. Further, the second buffer management data generation unit 215 inputs the generated buffer management data and the hooked buffer management data to the offload processing hardware 106. Since the buffer management data generated by the second buffer management data generation unit 215 is different from the buffer management data hooked from the OS kernel 201, it may be referred to as the second buffer management data.

通信デバイス処理入力部216は、オフロード処理ハードウェア106においてセグメント分割処理および通信プロトコル処理がなされたバッファ管理データ(第二のバッファ管理データ)を、通信デバイス転送処理部209に入力する。つまり、通信デバイス処理入力部216は、第二のバッファ管理データを、フック元であるOSカーネル201に送信する。第二のバッファ管理データの入力は、OSカーネル201の機能を用いて行われる。例えば、Linuxにおいては、dev_queue_xmit()を呼び出すことで、第二のバッファ管理データを入力する。フックしたバッファ管理データは、この段階で解放する。例えば、Linuxにおいては、通信デバイス処理入力部216は、フックしたバッファ管理データをkfree_skb()により解放する。また、通信デバイス処理入力部216が、全ての第二のバッファ管理データを通信デバイス転送処理部209に入力し終わると、コールバック関数の一連の処理が終わる。動的ロードソフトウェア210(通信デバイス処理入力部216)は、プロトコルスタック202に、フックしたバッファ管理データをコールバック関数内で処理した旨の信号(コールバックの返り値)を送る。例えば、Netfilterフレームワークにおいては、コールバックの返り値としてNF_STOLENで定義された定数を送る。 The communication device processing input unit 216 inputs the buffer management data (second buffer management data) subjected to the segment division processing and the communication protocol processing in the offload processing hardware 106 to the communication device transfer processing unit 209. That is, the communication device processing input unit 216 transmits the second buffer management data to the OS kernel 201 which is the hook source. The input of the second buffer management data is performed using the function of the OS kernel 201. For example, in Linux, the second buffer management data is input by calling dev_queue_xmit (). The hooked buffer management data is released at this stage. For example, in Linux, the communication device processing input unit 216 releases the hooked buffer management data by kfree_skb (). Further, when the communication device processing input unit 216 finishes inputting all the second buffer management data into the communication device transfer processing unit 209, a series of processing of the callback function ends. The dynamic load software 210 (communication device processing input unit 216) sends a signal (callback return value) to the protocol stack 202 to the effect that the hooked buffer management data has been processed in the callback function. For example, in the Netfilter framework, a constant defined by NF_STORLEN is sent as the return value of the callback.

オフロード処理ハードウェア106は、第二セグメント分割処理部217と第二プロトコル処理部218を有する。
第二セグメント分割処理部217は、DMACを備えており、フックしたバッファ管理データで管理されるセグメントデータのアドレスを読み出し元とし、セグメントデータを取得する。第二セグメント分割処理部217は、取得したセグメントデータを、MSS単位でセグメントデータをメモリコピーすることでセグメント分割処理を行う。より詳しくは、第二セグメント分割処理部217は、第二バッファ管理データ生成部215で生成した複数のバッファ管理データに対し、管理されるデータ領域を書き出し先としてMSS単位でセグメントデータをメモリコピーすることでセグメント分割処理を行う。
The offload processing hardware 106 has a second segment division processing unit 217 and a second protocol processing unit 218.
The second segment division processing unit 217 includes a DMAC, and acquires segment data by using the address of the segment data managed by the hooked buffer management data as a read source. The second segment division processing unit 217 performs the segment division processing by copying the acquired segment data in memory in MSS units. More specifically, the second segment division processing unit 217 memory-copies the segment data in MSS units with the managed data area as the write destination for the plurality of buffer management data generated by the second buffer management data generation unit 215. By doing so, the segment division process is performed.

第二プロトコル処理部218は、セグメント分割処理がなされたバッファ管理データに対して、TCP/IPのプロトコル処理を行う。フックしたバッファ管理データにプロトコル処理中のヘッダデータが含まれているので、第二プロトコル処理部218は、当該ヘッダデータに基づいて第二バッファ管理データ生成部215で生成した複数のバッファ管理データに対し、プロトコル処理を行う。例えば、IPヘッダについては、アドレス情報やプロトコル情報等はそのままコピーし、個々のバッファ管理データで異なる値(パケット長、識別子、チェックサム等)は計算および再入力を行う。TCPヘッダについては、ポート番号情報やコントロールフラグ等はそのままコピーし、シーケンス番号やチェックサム等は計算および再入力を行う。また、第二プロトコル処理部218はMACヘッダも生成する。フックしたバッファ管理データにはMACヘッダは付与されていないが、第二プロトコル処理部218は、APRテーブルの宛先デバイス情報から取得できる近傍エントリ情報に基づいてMACヘッダを生成する。例えば、Linuxにおいては、第二プロトコル処理部218はstruct neighbour構造体で管理される情報からMACヘッダを生成する。 The second protocol processing unit 218 performs TCP / IP protocol processing on the buffer management data that has been segmented. Since the hooked buffer management data includes the header data being processed by the protocol, the second protocol processing unit 218 can use the second buffer management data generation unit 215 to generate a plurality of buffer management data based on the header data. On the other hand, protocol processing is performed. For example, for the IP header, address information, protocol information, etc. are copied as they are, and different values (packet length, identifier, checksum, etc.) are calculated and re-entered in each buffer management data. For the TCP header, the port number information, control flag, etc. are copied as they are, and the sequence number, checksum, etc. are calculated and re-entered. The second protocol processing unit 218 also generates a MAC header. Although the MAC header is not added to the hooked buffer management data, the second protocol processing unit 218 generates the MAC header based on the neighborhood entry information that can be obtained from the destination device information of the APR table. For example, in Linux, the second protocol processing unit 218 generates a MAC header from the information managed by the strike neighbor structure.

なお、本実施形態では、第二セグメント分割処理部217と第二プロトコル処理部218はオフロード処理ハードウェア106で実現しているが、ソフトウェアで実現してもよい。
また、図2に示した構成は一例であり、複数の機能部が1つの機能部に統合されてもよいし、いずれかの機能部が複数の機能部に分けられてもよい。さらに、図2に示した機能部に含まれる一部または全部の機能がハードウェア化されていてもよい。ハードウェア化は、例えばASIC(Application Specific Integrated Circuit)により実現される。
In the present embodiment, the second segment division processing unit 217 and the second protocol processing unit 218 are realized by the offload processing hardware 106, but may be realized by software.
Further, the configuration shown in FIG. 2 is an example, and a plurality of functional units may be integrated into one functional unit, or any of the functional units may be divided into a plurality of functional units. Further, some or all the functions included in the functional unit shown in FIG. 2 may be hardwareized. Hardware implementation is realized by, for example, an ASIC (Application Specific Integrated Circuit).

<バッファ管理データ処理判定部の判定フロー>
図3は、本実施形態におけるバッファ管理データ処理判定部212の判定フロー図である。バッファ管理データ処理判定部212は、プロトコルスタック202からフックしたバッファ管理データを解析し、処理の方法を決定する。図3において、SはStepの略である。図3の処理は、例えば、図1のCPU102がROM103に記憶されたプログラムを読み出して実行することにより行われる。
<Judgment flow of buffer management data processing judgment unit>
FIG. 3 is a determination flow diagram of the buffer management data processing determination unit 212 in the present embodiment. The buffer management data processing determination unit 212 analyzes the buffer management data hooked from the protocol stack 202 and determines the processing method. In FIG. 3, S is an abbreviation for Step. The process of FIG. 3 is performed, for example, by the CPU 102 of FIG. 1 reading and executing the program stored in the ROM 103.

S301において、バッファ管理データ処理判定部212は、フックしたバッファ管理データのIPヘッダからトランスポート層の通信プロトコルを確認し、オフロード処理対象の通信プロトコルか否かを判定する。本実施形態ではTCPプロトコルのみオフロード処理するものとして説明する。つまり、S301の判定は、通信プロトコルの種類に基づいて行われる。トランスポート層の通信プロトコルがTCPプロトコルであれば(S301の判定結果がYesの場合)S302に進み、TCPプロトコルでなければS306に進む。
S302において、バッファ管理データ処理判定部212は、フックしたバッファ管理データのTCPヘッダからポート番号を確認し、オフロード処理対象のポート番号かどうかを判定する。対象ポート番号であればS303に進み、対象ポート番号でなければS306に進む。なお、ポート番号によるフィルタリングは無くてもよい(つまりS302は省略してもよい)が、例えば、特定のアプリケーションのみオフロード処理を行いたい場合はS302を実行する。S302を実行するためには、オフロード処理を行いたいアプリケーションで使用するポート番号を予め入力しておく。
In S301, the buffer management data processing determination unit 212 confirms the communication protocol of the transport layer from the IP header of the hooked buffer management data, and determines whether or not the communication protocol is the target of offload processing. In the present embodiment, only the TCP protocol will be described as being offloaded. That is, the determination of S301 is performed based on the type of communication protocol. If the communication protocol of the transport layer is the TCP protocol (when the determination result of S301 is Yes), the process proceeds to S302, and if it is not the TCP protocol, the process proceeds to S306.
In S302, the buffer management data processing determination unit 212 confirms the port number from the TCP header of the hooked buffer management data, and determines whether or not the port number is the target of offload processing. If it is the target port number, the process proceeds to S303, and if it is not the target port number, the process proceeds to S306. Note that filtering by port number may not be necessary (that is, S302 may be omitted), but for example, when offload processing is desired to be performed only for a specific application, S302 is executed. In order to execute S302, the port number used by the application to be offloaded is input in advance.

S303において、バッファ管理データ処理判定部212は、ソケット情報が書き換え済みか否かを判定する。具体的には、バッファ管理データ処理判定部212は、ソケット情報の中のMSSのキャッシュ値とハードウェアチェックサムオフロードフラグを確認する。ソケット情報が書き換え済みであればS304に進み、書き換え済みでなければS308に進む。
S304では、バッファ管理データ処理判定部212は、ARPテーブルを参照して、次に送信すべきセグメントデータに関する近傍エントリ情報があるかどうかを判定する。近傍エントリ情報がなければ(S304の判定結果がNoの場合)、第二プロトコル処理部218でMACヘッダが生成できないため、フックしたバッファ管理データをプロトコル処理に戻す(S306)。近傍エントリ情報があればS305に進む。
In S303, the buffer management data processing determination unit 212 determines whether or not the socket information has been rewritten. Specifically, the buffer management data processing determination unit 212 confirms the MSS cache value and the hardware checksum offload flag in the socket information. If the socket information has been rewritten, the process proceeds to S304, and if the socket information has not been rewritten, the process proceeds to S308.
In S304, the buffer management data processing determination unit 212 refers to the ARP table and determines whether or not there is neighborhood entry information regarding the segment data to be transmitted next. If there is no neighborhood entry information (when the determination result in S304 is No), the MAC header cannot be generated by the second protocol processing unit 218, so the hooked buffer management data is returned to the protocol processing (S306). If there is neighborhood entry information, proceed to S305.

S305において、バッファ管理データ処理判定部212は、フックしたバッファ管理データのセグメントデータサイズがMSSよりも大きいかどうかを判定する。セグメントデータサイズがMSSよりも大きければS307に進み、MSS以下であればS306に進む。
S306において、バッファ管理データ処理判定部212は、フックしたバッファ管理データがオフロード処理対象ではなく、プロトコル処理に戻すと判定する。そして、バッファ管理データ処理判定部212は、当該バッファ管理データをプロトコル処理返付部213に送る。
In S305, the buffer management data processing determination unit 212 determines whether or not the segment data size of the hooked buffer management data is larger than the MSS. If the segment data size is larger than the MSS, the process proceeds to S307, and if the segment data size is smaller than the MSS, the process proceeds to S306.
In S306, the buffer management data processing determination unit 212 determines that the hooked buffer management data is not the offload processing target and returns to the protocol processing. Then, the buffer management data processing determination unit 212 sends the buffer management data to the protocol processing return unit 213.

S307において、バッファ管理データ処理判定部212は、フックしたバッファ管理データがオフロード処理対象であると判定する。そして、バッファ管理データ処理判定部212は、当該バッファ管理データを第二バッファ管理データ生成部215に送る。
S308において、バッファ管理データ処理判定部212は、フックしたバッファ管理データのソケット情報を書き換えると判定する。そして、バッファ管理データ処理判定部212は、当該バッファ管理データをソケット情報書き換え部214に送る。
In S307, the buffer management data processing determination unit 212 determines that the hooked buffer management data is the offload processing target. Then, the buffer management data processing determination unit 212 sends the buffer management data to the second buffer management data generation unit 215.
In S308, the buffer management data processing determination unit 212 determines that the socket information of the hooked buffer management data is rewritten. Then, the buffer management data processing determination unit 212 sends the buffer management data to the socket information rewriting unit 214.

<プロトコル処理後のバッファ管理データ>
図4は、第二セグメント分割処理部217におけるセグメントデータのコピー(複製)および分割と、第二プロトコル処理部218におけるプロトコル処理後のバッファ管理データを示した図である。
バッファ管理データ400はプロトコルスタック202からフックしたバッファ管理データである。
セグメントデータ401はバッファ管理データ400で管理されるセグメントデータである。セグメントデータ401はMSSを超えるセグメントサイズの場合にオフロード処理対象となる。
<Buffer management data after protocol processing>
FIG. 4 is a diagram showing copy (duplicate) and division of segment data in the second segment division processing unit 217 and buffer management data after protocol processing in the second protocol processing unit 218.
The buffer management data 400 is buffer management data hooked from the protocol stack 202.
The segment data 401 is the segment data managed by the buffer management data 400. The segment data 401 is subject to offload processing when the segment size exceeds the MSS.

ヘッダデータ402は、セグメントデータ401に対して、第一プロトコル処理部206で処理中のヘッダデータである。ヘッダデータ402には、TCPヘッダおよびIPヘッダが付与されており、TCPチェックサム値は計算されていない状態を想定する。
バッファ管理データ403、404、405、406は、第二バッファ管理データ生成部215で生成されるバッファ管理データ(第二のバッファ管理データ)である。図4は、第二のバッファ管理データが4つの場合を示しているが、第二のバッファ管理データの数は4に限定されない。
The header data 402 is header data being processed by the first protocol processing unit 206 with respect to the segment data 401. It is assumed that the header data 402 is provided with a TCP header and an IP header, and the TCP checksum value is not calculated.
The buffer management data 403, 404, 405, and 406 are buffer management data (second buffer management data) generated by the second buffer management data generation unit 215. FIG. 4 shows a case where the second buffer management data is four, but the number of the second buffer management data is not limited to four.

セグメントデータ407、408、409、410は、第二セグメント分割処理部217においてセグメントデータ401を分割して得られるセグメントデータであって、バッファ管理データ403、404、405、406で管理するセグメントデータ領域にコピーされる。バッファ管理データ403〜406の数は、セグメントデータ407〜410の数と同じである。
ヘッダデータ411、412、413、414は、ヘッダデータ402に基づいて生成され、セグメントデータ407、408、409、410に付けられるヘッダデータである。より詳しくは、第二プロトコル処理部218でプロトコル処理されたバッファ管理データ403〜406が管理するデータヘッダ411〜414には、ヘッダデータ402に基づいて生成されたTCPヘッダとIPヘッダが付与される。そして、ヘッダデータ411〜414には、ARPテーブルの近傍エントリ情報から得られるMACヘッダも付与される。ヘッダデータ402および411〜414は通信ヘッダと称してもよい。
The segment data 407, 408, 409, and 410 are segment data obtained by dividing the segment data 401 by the second segment division processing unit 217, and are segment data areas managed by the buffer management data 403, 404, 405, and 406. Is copied to. The number of buffer management data 403 to 406 is the same as the number of segment data 407 to 410.
The header data 411, 421, 413, 414 are header data generated based on the header data 402 and attached to the segment data 407, 408, 409, 410. More specifically, the TCP header and the IP header generated based on the header data 402 are added to the data headers 411 to 414 managed by the buffer management data 403 to 406 protocol-processed by the second protocol processing unit 218. .. Then, a MAC header obtained from the neighborhood entry information of the ARP table is also added to the header data 411 to 414. The header data 402 and 411-414 may be referred to as communication headers.

以上、本実施形態によれば、OSカーネル201のプロトコルスタック202が処理中のMSSを超えるセグメントデータサイズのバッファ管理データ400をフックする。フックしたバッファ管理データ400のセグメントデータ401をオフロード処理によりセグメント分割してデータコピーを行う。データコピーしたセグメントデータ407〜410を持ち、通信プロトコル処理をした新たなバッファ管理データ403〜406を生成する。そして、新たに生成したバッファ管理データ403〜406をOSカーネル201の通信デバイス転送処理部209に戻す。この一連の処理により、OSカーネル201とは異なる動的にロードしたソフトウェア210でセグメント分割処理および通信プロトコル処理を、通信デバイス105に依存せず、OSカーネル201の変更もせずに実行することができる。よって、送信データの処理負担の分散を簡便な構成で実現できる。 As described above, according to the present embodiment, the protocol stack 202 of the OS kernel 201 hooks the buffer management data 400 having a segment data size exceeding the MSS being processed. The segment data 401 of the hooked buffer management data 400 is segmented by offload processing and data is copied. It has segment data 407 to 410 that have been copied, and generates new buffer management data 403 to 406 that has undergone communication protocol processing. Then, the newly generated buffer management data 403 to 406 are returned to the communication device transfer processing unit 209 of the OS kernel 201. By this series of processing, the segment division processing and the communication protocol processing can be executed by the dynamically loaded software 210 different from the OS kernel 201 without depending on the communication device 105 and without changing the OS kernel 201. .. Therefore, it is possible to distribute the processing load of the transmitted data with a simple configuration.

なお、図3のS302で使用するポート番号は、宛先/送信元ポート番号である。また、ポート番号の代わりに宛先IPアドレスを使用して、オフロード処理対象の宛先IPアドレスであればS303に進むようにしてもよい。
また、バッファ管理データ処理判定部212は、TCPウインドウスケールのシフトカウント(3ウエイシェイクハンド後)が、所定値(例えば、1)以上であれば、フックしたバッファ管理データのソケット情報を書き換えるという判定をしてもよい。
S306を実行した時点で、チェックサム計算がオフになっているならば、プロトコル処理返付部213は、チェックサム計算を行ってから、当該バッファ管理データをプロトコルスタック202に戻してもよい。この場合、プロトコル処理返付部213は、バッファ管理データをIP層に戻す。
The port number used in S302 in FIG. 3 is a destination / source port number. Further, the destination IP address may be used instead of the port number, and if the destination IP address is the target of offload processing, the process may proceed to S303.
Further, the buffer management data processing determination unit 212 determines that if the shift count (after 3 way shake hands) of the TCP window scale is a predetermined value (for example, 1) or more, the socket information of the hooked buffer management data is rewritten. You may do.
If the checksum calculation is turned off when S306 is executed, the protocol processing return unit 213 may perform the checksum calculation and then return the buffer management data to the protocol stack 202. In this case, the protocol processing return unit 213 returns the buffer management data to the IP layer.

<実施形態2>
実施形態1では、第二セグメント分割処理部217において、フックしたバッファ管理データ400が管理するセグメントデータ401を、バッファ管理データ403〜406が管理するセグメントデータ領域に分割しつつコピーした。実施形態2では、第二セグメント分割処理部217において、セグメントデータ401をコピーしない場合を説明する。以下の記載において、実施形態1と同様な構成、機能および処理については、同じ参照符号を付ける。
<Embodiment 2>
In the first embodiment, the second segment division processing unit 217 copies the segment data 401 managed by the hooked buffer management data 400 while dividing it into the segment data areas managed by the buffer management data 403 to 406. In the second embodiment, the case where the segment data 401 is not copied in the second segment division processing unit 217 will be described. In the following description, the same reference numerals are given to the same configurations, functions, and processes as those in the first embodiment.

ハードウェア構成については実施形態1(図1)と同様であるため説明を省略する。また、バッファ管理データ処理判定部212の判定フローについては図3と同様であるため説明を省略する。 Since the hardware configuration is the same as that of the first embodiment (FIG. 1), the description thereof will be omitted. Further, since the determination flow of the buffer management data processing determination unit 212 is the same as that in FIG. 3, the description thereof will be omitted.

<通信装置の機能構成>
図5は、実施形態2における通信装置100の機能構成の一例を示す図である。実施形態1(図2)と異なる部分のみ説明する。実施形態2の動的ロードソフトウェア210は、図2の構成と比較すると、バッファ管理データ管理部500をさらに備えている。
バッファ管理データ管理部500は、第二バッファ管理データ生成部215で生成されたバッファ管理データをクローンし、動的ロードソフトウェア210内で管理する。クローンは、セグメントデータ(図4の符号407〜410)自体をコピーする処理を行うのではなく、当該セグメントデータへの参照を持ったバッファ管理データを生成する処理を行う。例えば、Linuxにおいては、skb_clone()により、バッファ管理データ(クローン)が生成される。また、バッファ管理データ管理部500は、管理しているバッファ管理データについて、現在の確認応答番号(ACK番号、シーケンス番号)から当該バッファ管理データが不要かどうかを確認し、不要であれば解放する。解放可否確認のタイミングはコールバックが呼ばれた際に毎回確認してもよいし、コールバックの任意の回数毎に確認してもよし、所定時間経過毎に確認してもよい。
<Functional configuration of communication device>
FIG. 5 is a diagram showing an example of the functional configuration of the communication device 100 according to the second embodiment. Only the part different from the first embodiment (FIG. 2) will be described. The dynamic load software 210 of the second embodiment further includes a buffer management data management unit 500 as compared with the configuration of FIG.
The buffer management data management unit 500 clones the buffer management data generated by the second buffer management data generation unit 215 and manages it in the dynamic load software 210. The clone does not perform a process of copying the segment data (reference numerals 407 to 410 in FIG. 4) itself, but performs a process of generating buffer management data having a reference to the segment data. For example, in Linux, buffer management data (clone) is generated by skb_clone (). Further, the buffer management data management unit 500 confirms whether or not the buffer management data is unnecessary from the current acknowledgment number (ACK number, sequence number) of the managed buffer management data, and releases the buffer management data if it is unnecessary. .. The timing of confirming whether or not the release is possible may be confirmed every time the callback is called, every arbitrary number of callbacks, or every predetermined time elapses.

<プロトコル処理後のバッファ管理データ>
図6は、本実施形態における第二セグメント分割処理部217におけるセグメントデータの分割、および第二プロトコル処理部218におけるプロトコル処理後のバッファ管理データを示した図である。
バッファ管理データ400、セグメントデータ401、ヘッダデータ402、バッファ管理データ403〜406、ヘッダデータ411〜414については実施形態1における図4と同様であるため説明を省略する。
<Buffer management data after protocol processing>
FIG. 6 is a diagram showing segment data division by the second segment division processing unit 217 in the present embodiment and buffer management data after protocol processing by the second protocol processing unit 218.
The buffer management data 400, the segment data 401, the header data 402, the buffer management data 403 to 406, and the header data 411 to 414 are the same as those in FIG. 4, and thus the description thereof will be omitted.

本実施形態では、コピーしたセグメントデータ407〜410(図4)を用いるのではなく、セグメントデータ参照600、601、602、603を用いる。セグメントデータ参照600、601、602、603は、それぞれバッファ管理データ403、404、405、406のフラグメントされたデータ参照であり、セグメントデータ401をMSSで分割したデータの先頭アドレスを指す。セグメントデータ参照600、601、602、603は、メモリアドレス情報であり、それぞれ対応するバッファ管理データ403、404、405、406に格納されている。セグメントデータ参照600〜603は、第二セグメント分割処理部217により、バッファ管理データ403〜406へ格納される。
バッファ管理データ403〜406のヘッダデータ411〜414とセグメントデータ401は連続領域に存在しないため、通信デバイス105への転送時にGather機能を用いて連結する。そのため、本実施形態では、通信デバイス転送処理部209がGather機能を備えているとする。
In this embodiment, instead of using the copied segment data 407 to 410 (FIG. 4), the segment data references 600, 601, 602, and 603 are used. The segment data references 600, 601, 602, and 603 are fragmented data references of the buffer management data 403, 404, 405, and 406, respectively, and refer to the start address of the data obtained by dividing the segment data 401 by the MSS. The segment data references 600, 601, 602, and 603 are memory address information, and are stored in the corresponding buffer management data 403, 404, 405, and 406, respectively. The segment data references 600 to 603 are stored in the buffer management data 403 to 406 by the second segment division processing unit 217.
Since the header data 411 to 414 of the buffer management data 403 to 406 and the segment data 401 do not exist in the continuous area, they are connected by using the Gather function at the time of transfer to the communication device 105. Therefore, in the present embodiment, it is assumed that the communication device transfer processing unit 209 has a Gather function.

以上、本実施形態によれば、OSカーネル201のプロトコルスタック202が処理中のMSSを超えるセグメントデータサイズのバッファ管理データ400をフックする。フックしたバッファ管理データ400のセグメントデータ401をオフロード処理によりセグメント分割する。分割したセグメントデータへの参照411〜414を持ち、通信プロトコル処理をした新たなバッファ管理データ403〜406を生成する。新たに生成したバッファ管理データ403〜406をOSカーネル201の通信デバイス転送処理部209に戻す。これにより、OSカーネル201とは異なる動的にロードしたソフトウェア210でセグメント分割処理および通信プロトコル処理を、通信デバイス105に依存せず、OSカーネル201の変更もせずに実行することができる。また、セグメントデータのコピーをしないので、実施形態1と比較して、オフロード処理における負荷が軽減される。 As described above, according to the present embodiment, the protocol stack 202 of the OS kernel 201 hooks the buffer management data 400 having a segment data size exceeding the MSS being processed. The segment data 401 of the hooked buffer management data 400 is segmented by offload processing. It has references 411 to 414 to the divided segment data, and generates new buffer management data 403 to 406 that have been processed by the communication protocol. The newly generated buffer management data 403 to 406 are returned to the communication device transfer processing unit 209 of the OS kernel 201. As a result, the dynamically loaded software 210 different from the OS kernel 201 can execute the segment division processing and the communication protocol processing without depending on the communication device 105 and without changing the OS kernel 201. Further, since the segment data is not copied, the load in the offload processing is reduced as compared with the first embodiment.

本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワークまたは記憶媒体を介してシステムまたは装置に供給し、そのシステムまたは装置のコンピュータにおける1つ以上のプロセッサがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。 The present invention supplies a program that realizes one or more functions of the above-described embodiment to a system or device via a network or storage medium, and one or more processors in the computer of the system or device reads and executes the program. It can also be realized by the processing to be performed. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.

100…通信装置、106…オフロード処理ハードウェア、201…OSカーネル、202…プロトコルスタック、208…バッファ管理データフック部、212…バッファ管理データ処理判定部、213…プロトコル処理返付部、214…ソケット情報書き換え部、215…第二バッファ管理データ生成部、217…第二セグメント分割処理部、218…第二プロトコル処理部、400…バッファ管理データ、401…セグメントデータ、403〜406…バッファ管理データ、407〜410…セグメントデータ 100 ... communication device, 106 ... offload processing hardware, 201 ... OS kernel, 202 ... protocol stack, 208 ... buffer management data hook unit, 212 ... buffer management data processing judgment unit, 213 ... protocol processing return unit, 214 ... socket Information rewriting unit, 215 ... Second buffer management data generation unit, 217 ... Second segment division processing unit, 218 ... Second protocol processing unit, 400 ... Buffer management data, 401 ... Segment data, 403 to 406 ... Buffer management data, 407 to 410 ... Segment data

Claims (18)

送信すべきデータを分割して得た複数のセグメントデータを、所定の通信プロトコルに基づいて送信する通信装置であって、
前記所定の通信プロトコルによるプロトコル処理中に、前記セグメントデータを管理する第一の管理データをOS(Operating System)カーネルから取得する取得手段と、
前記第一の管理データにより管理されるセグメントデータのセグメントサイズが所定のサイズを超える場合、当該セグメントデータを分割する分割手段と、
前記分割手段により分割されたセグメントデータを管理する第二の管理データを生成する生成手段と、
前記第二の管理データに対して前記プロトコル処理を行う処理手段と、
前記処理手段によりプロトコル処理された前記第二の管理データを、前記OSカーネルに送信する第1の送信手段と、
を備えることを特徴とする通信装置。
A communication device that transmits a plurality of segment data obtained by dividing data to be transmitted based on a predetermined communication protocol.
An acquisition means for acquiring the first management data for managing the segment data from the OS (Operating System) kernel during protocol processing by the predetermined communication protocol.
When the segment size of the segment data managed by the first management data exceeds a predetermined size, a dividing means for dividing the segment data and a dividing means.
A generation means for generating a second management data for managing the segment data divided by the division means, and a generation means.
A processing means for performing the protocol processing on the second management data, and
A first transmission means for transmitting the second management data protocol-processed by the processing means to the OS kernel, and
A communication device characterized by comprising.
前記第一の管理データは、前記セグメントデータを管理すると共に、前記第一の管理データが管理するセグメントデータのソケット情報を管理し、
前記通信装置は、
前記第一の管理データにより管理されるセグメントデータのセグメントサイズが前記所定のサイズを超えるように前記ソケット情報を書き換える書き換え手段と、
前記ソケット情報を書き換えた前記第一の管理データを前記OSカーネルに送信する第2の送信手段と、
をさらに備えることを特徴とする請求項1に記載の通信装置。
The first management data manages the segment data and also manages the socket information of the segment data managed by the first management data.
The communication device is
A rewriting means for rewriting the socket information so that the segment size of the segment data managed by the first management data exceeds the predetermined size.
A second transmission means for transmitting the first management data in which the socket information is rewritten to the OS kernel, and
The communication device according to claim 1, further comprising.
前記書き換え手段は、前記ソケット情報にセグメントデータのオフロードを行う設定をすることを特徴とする請求項2に記載の通信装置。 The communication device according to claim 2, wherein the rewriting means is set to offload the segment data to the socket information. 前記第一の管理データが管理するセグメントデータのセグメントサイズとソケット情報の少なくとも一方に基づいて、前記第一の管理データを前記OSカーネルに送信するか、前記書き換え手段により前記ソケット情報を書き換えるか、前記分割手段により前記セグメントデータを分割するかを決定する決定手段をさらに備えることを特徴とする請求項2または3に記載の通信装置。 Whether to send the first management data to the OS kernel or rewrite the socket information by the rewriting means based on at least one of the segment size and the socket information of the segment data managed by the first management data. The communication device according to claim 2 or 3, further comprising a determining means for determining whether to divide the segment data by the dividing means. 前記処理手段は、前記第一の管理データに対して行われた通信プロトコル処理によって生成された通信ヘッダに基づいて、前記第二のバッファ管理データによって管理されるセグメントデータの通信ヘッダを生成することを特徴とする請求項2から4のいずれか1項に記載の通信装置。 The processing means generates a communication header of segment data managed by the second buffer management data based on the communication header generated by the communication protocol processing performed on the first management data. The communication device according to any one of claims 2 to 4, wherein the communication device is characterized. 前記生成手段により生成される前記第二の管理データの数は、前記分割手段による分割により得られるセグメントデータの数と同じであることを特徴とする請求項2から5のいずれか1項に記載の通信装置。 The second item according to any one of claims 2 to 5, wherein the number of the second management data generated by the generation means is the same as the number of segment data obtained by the division by the division means. Communication device. 前記分割手段は、前記分割により得られるセグメントデータを、それぞれ対応する前記第二の管理データのセグメントデータ領域にコピーすることを特徴とする請求項6に記載の通信装置。 The communication device according to claim 6, wherein the division means copies the segment data obtained by the division into the corresponding segment data area of the second management data. 前記分割手段は、前記分割により得られるセグメントデータのメモリアドレス情報を、前記第二の管理データに格納することを特徴とする請求項6に記載の通信装置。 The communication device according to claim 6, wherein the division means stores the memory address information of the segment data obtained by the division in the second management data. 前記書き換え手段は、前記ソケット情報にチェックサム計算をオフロードで行う設定をすることにより、前記第一の管理データに対するプロトコル処理でチェックサム計算処理が行われないようにすることを特徴とする請求項2から8のいずれか1項に記載の通信装置。 The claim is characterized in that the rewriting means is set to perform the checksum calculation offload in the socket information so that the checksum calculation process is not performed in the protocol process for the first management data. Item 2. The communication device according to any one of Items 2 to 8. 前記取得手段は、前記OSカーネルが備えている機能を用いて、前記第一の管理データを取得することを特徴とする請求項1から9のいずれか1項に記載の通信装置。 The communication device according to any one of claims 1 to 9, wherein the acquisition means acquires the first management data by using the function provided in the OS kernel. 前記第2の送信手段は、前記OSカーネルが備えている機能を用いて、前記第一の管理データを前記OSカーネルに送信することを特徴とする請求項2から10のいずれか1項に記載の通信装置。 The second method according to any one of claims 2 to 10, wherein the second transmission means transmits the first management data to the OS kernel by using the function provided in the OS kernel. Communication device. 前記第1の送信手段は、前記通信装置のOSカーネルが備えている機能を用いて、前記第二の管理データを前記OSカーネルに送信することを特徴とする請求項1から11のいずれか1項に記載の通信装置。 Any one of claims 1 to 11, wherein the first transmission means transmits the second management data to the OS kernel by using a function provided in the OS kernel of the communication device. The communication device described in the section. 前記分割手段および前記処理手段は、前記OSカーネルと異なるソフトウェアの機能、または、前記通信装置のCPUと異なるハードウェアの機能により実現されることを特徴とする請求項1から12のいずれか1項に記載の通信装置。 One of claims 1 to 12, wherein the dividing means and the processing means are realized by a software function different from that of the OS kernel or a hardware function different from that of the CPU of the communication device. The communication device described in. 前記書き換え手段、前記第1の送信手段および前記第2の送信手段は、前記OSカーネルと異なるソフトウェアの機能により実現されることを特徴とする請求項2から9のいずれか1項に記載の通信装置。 The communication according to any one of claims 2 to 9, wherein the rewriting means, the first transmitting means, and the second transmitting means are realized by a function of software different from that of the OS kernel. apparatus. 前記決定手段は、前記第一の管理データが管理するセグメントデータのセグメントサイズと、前記ソケット情報と、前記所定の通信プロトコルの種類と、宛先のポート番号と、送信元ポート番号と、ARP(Address Resolution Protocol)テーブルのエントリ情報と、宛先IPアドレスと、TCP(Transmission Control Protocol)ウインドウスケールのシフトカウントの少なくとも一つに基づいて、前記決定をすることを特徴とする請求項4に記載の通信装置。 The determining means includes a segment size of segment data managed by the first management data, the socket information, the type of the predetermined communication protocol, a destination port number, a source port number, and ARP (Addless). The communication device according to claim 4, wherein the determination is made based on at least one of the entry information of the Resolution Protocol) table, the destination IP address, and the shift count of the TCP (Transmission Protocol) window scale. .. 前記所定の通信プロトコルは、TCP/IPプロトコルであることを特徴とする請求項1から15のいずれか1項に記載の通信装置。 The communication device according to any one of claims 1 to 15, wherein the predetermined communication protocol is a TCP / IP protocol. 送信すべきデータを分割して得た複数のセグメントデータを、所定の通信プロトコルに基づいて送信する通信装置の制御方法であって、
前記所定の通信プロトコルによるプロトコル処理中に、前記セグメントデータを管理する第一の管理データをOSカーネルから取得するステップと、
前記第一の管理データにより管理されるセグメントデータのセグメントサイズが所定のサイズを超える場合、当該セグメントデータを分割するステップと、
前記分割するステップにより分割されたセグメントデータを管理する第二の管理データを生成するステップと、
前記第二の管理データに対して前記プロトコル処理を行うステップと、
前記プロトコル処理を行うステップによりプロトコル処理された前記第二の管理データを、前記OSカーネルに送信するステップと、
を有することを特徴とする制御方法。
It is a control method of a communication device that transmits a plurality of segment data obtained by dividing data to be transmitted based on a predetermined communication protocol.
A step of acquiring the first management data for managing the segment data from the OS kernel during protocol processing by the predetermined communication protocol, and
When the segment size of the segment data managed by the first management data exceeds a predetermined size, the step of dividing the segment data and the step of dividing the segment data
A step of generating a second management data for managing the segment data divided by the division step, and a step of generating the second management data.
The step of performing the protocol processing on the second management data and
A step of transmitting the second management data protocol-processed by the step of performing the protocol processing to the OS kernel, and a step of transmitting the protocol-processed data to the OS kernel.
A control method characterized by having.
コンピュータを請求項1から16のいずれか1項に記載の通信装置として動作させるためのプログラム。 A program for operating a computer as a communication device according to any one of claims 1 to 16.
JP2019155592A 2019-08-28 2019-08-28 Communication device, control method and program Active JP7387335B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019155592A JP7387335B2 (en) 2019-08-28 2019-08-28 Communication device, control method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019155592A JP7387335B2 (en) 2019-08-28 2019-08-28 Communication device, control method and program

Publications (2)

Publication Number Publication Date
JP2021034954A true JP2021034954A (en) 2021-03-01
JP7387335B2 JP7387335B2 (en) 2023-11-28

Family

ID=74676662

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019155592A Active JP7387335B2 (en) 2019-08-28 2019-08-28 Communication device, control method and program

Country Status (1)

Country Link
JP (1) JP7387335B2 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006005878A (en) * 2004-06-21 2006-01-05 Fujitsu Ltd Control method for communication system, communication control apparatus, and program
JP2008507201A (en) * 2004-07-14 2008-03-06 インターナショナル・ビジネス・マシーンズ・コーポレーション Apparatus and method for supporting connection establishment in network protocol processing offload
JP2010097252A (en) * 2008-10-14 2010-04-30 Canon Inc Inter-processor communication method, multiprocessor system, and processor
JP2014071478A (en) * 2012-09-27 2014-04-21 Toshiba Corp Information processor, and off-loading method of instruction
US8990422B1 (en) * 2011-06-21 2015-03-24 Netlogic Microsystems, Inc. TCP segmentation offload (TSO) using a hybrid approach of manipulating memory pointers and actual packet data
JP2018196053A (en) * 2017-05-19 2018-12-06 キヤノン株式会社 Communication device, communication method, and program

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006005878A (en) * 2004-06-21 2006-01-05 Fujitsu Ltd Control method for communication system, communication control apparatus, and program
JP2008507201A (en) * 2004-07-14 2008-03-06 インターナショナル・ビジネス・マシーンズ・コーポレーション Apparatus and method for supporting connection establishment in network protocol processing offload
JP2010097252A (en) * 2008-10-14 2010-04-30 Canon Inc Inter-processor communication method, multiprocessor system, and processor
US8990422B1 (en) * 2011-06-21 2015-03-24 Netlogic Microsystems, Inc. TCP segmentation offload (TSO) using a hybrid approach of manipulating memory pointers and actual packet data
JP2014071478A (en) * 2012-09-27 2014-04-21 Toshiba Corp Information processor, and off-loading method of instruction
JP2018196053A (en) * 2017-05-19 2018-12-06 キヤノン株式会社 Communication device, communication method, and program

Also Published As

Publication number Publication date
JP7387335B2 (en) 2023-11-28

Similar Documents

Publication Publication Date Title
JP5074872B2 (en) Protocol processing apparatus and control method
JP2022079634A (en) Communication relay device and data relay method
US11336297B2 (en) DMA transfer apparatus, method of controlling the same, communication apparatus, method of controlling the same, and non-transitory computer-readable storage medium
WO2019076068A1 (en) Data transmission method, server, unloading card, and storage medium
JP7387335B2 (en) Communication device, control method and program
JP5915314B2 (en) Communication device
JP6758858B2 (en) Communication equipment, communication methods and programs
US20230062831A1 (en) Communication apparatus and control method thereof, and storage medium
WO2017219777A1 (en) Packet processing method and device
JP2016012801A (en) Communication apparatus, communication system, and communication apparatus control method
US10911983B2 (en) Packet load generation device and packet load generation method
WO2019188986A1 (en) Information processing device, information processing method, and information processing program
JP6279970B2 (en) Processor, communication apparatus, communication system, communication method, and computer program
JP6800514B2 (en) Communication equipment, its control method, and programs
WO2018142866A1 (en) Transfer device, transfer method and program
JP6891201B2 (en) Communication equipment, control methods and programs for communication equipment
WO2018150481A1 (en) Data control method for distributed processing system, and distributed processing system
WO2023238326A1 (en) Switch
JP2019165423A (en) Communication device, method for controlling communication device, and program
JP7321913B2 (en) Communication device, control method and program
JP6568571B2 (en) Data transfer device, data transfer method, and communication device
JP2019066969A (en) Information processing apparatus and information processing program
JP2017163346A (en) Communication device, method and program
JP2024018734A (en) Communication processing device and communication method
JP2021087172A (en) Communication device, communication method, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20220706

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20230425

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20230516

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20230710

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20231115

R151 Written notification of patent or utility model registration

Ref document number: 7387335

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151