JP2021034954A - Communication apparatus, control method, and program - Google Patents
Communication apparatus, control method, and program Download PDFInfo
- 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
Links
- 238000004891 communication Methods 0.000 title claims abstract description 106
- 238000000034 method Methods 0.000 title claims description 27
- 230000005540 biological transmission Effects 0.000 claims abstract description 20
- 230000006870 function Effects 0.000 claims description 22
- 238000004364 calculation method Methods 0.000 claims description 10
- 239000006185 dispersion Substances 0.000 abstract 1
- 238000007726 management method Methods 0.000 description 161
- 238000010586 diagram Methods 0.000 description 10
- 238000013523 data management Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
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.
特許文献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.
以下、添付図面を参照して本発明の実施形態を詳細に説明する。なお、以下の実施形態は本発明を限定するものではなく、また、実施形態で説明されている特徴の組み合わせの全てが本発明の解決手段に必須のものとは限らない。実施形態の構成は、本発明が適用される装置の仕様や各種条件(使用条件、使用環境等)によって適宜修正または変更され得る。本発明の技術的範囲は、特許請求の範囲によって確定されるのであって、以下の個別の実施形態によって限定されない。 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
CPU102は、OSやデバイスドライバを介して各ハードウェア構成部(103〜106)を統括的に制御し、通信装置100を制御する。
ROM103は、CPU102で実行されるOSやデバイスドライバ等の制御プログラムを格納している。
RAM104は、CPU102の主メモリおよびワークエリア等として機能し、プログラムやデータを一時記憶する。
The
The
The
通信デバイス105は、MAC(Media Access Control)モジュール107とPHY(Physical Layer)モジュール108を有し、Ethernet等のネットワーク111を介した通信相手装置との通信を行う。データの送受信は、CPU102によりネットワークドライバが実行され、これに応じてMACモジュール107が制御されることにより行われる。尚、本実施形態では、通信デバイス105は、Ethernetを介した通信を行うものとするが、これに替えて、無線LAN(Wi−Fi)等、IP通信可能な媒体を介して通信を行うことも可能である。
The
オフロード処理ハードウェア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
The DMAC 109 transfers the data stored in the
プロトコル処理ハードウェア110は、TCP/IP等の通信プロトコル処理を実行する機能を持ったハードウェアで、TCPやUDPのチェックサム計算、通信ヘッダ生成処理等を行う。
なお、図1に示した構成は一例であり、通信装置100は図1に示されていない構成要素を備えてもよい。例えば、通信装置100はタイマ管理部を備えてもよい。タイマ管理部は、所定時間が経過したかを管理する。また、図1には1つのCPU102しか示されていないが、複数のCPUを設けてもよい。あるいは、CPU102は1つまたは複数のプロセッサにより置換されてもよい。通信装置100がカメラの場合には、撮像部や表示部を備えてもよい。
The
The configuration shown in FIG. 1 is an example, and the
<通信装置の機能構成>
図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
The
プロトコルスタック202は、コネクション管理部203、第一バッファ管理データ生成部204、第一セグメント分割処理部205、第一プロトコル処理部206、ウィンドウ制御部207およびバッファ管理データフック部208を有する。
コネクション管理部203は、通信装置100の通信コネクションを管理する。例えば、コネクション管理部203は、アプリケーション200に対する通信コネクションのMSSやオフロード設定情報等のソケット情報やARP(Address Resolution Protocol)テーブルのエントリ情報等を管理する。ARPテーブルには、送信すべきセグメントデータのMACアドレスとIPアドレスが、エントリ情報として記憶される。
The
The
第一バッファ管理データ生成部204は、カーネル空間で使用する送信バッファの管理データを生成する。例えば、Linuxでは、struct sk_buffで定義される構造体を生成する。バッファ管理データは、カーネル空間のデータアドレスやソケット情報への参照、通信デバイス情報への参照等を含んでいる。
The first buffer management
第一セグメント分割処理部205は、ユーザ空間に存在するアプリケーション200からの送信データをMSS単位で分割しながらバッファ管理データが管理するカーネル空間の送信バッファに分割送信データをコピーする。送信バッファにコピーする分割送信データのデータサイズはウィンドウ制御部207で管理されているTCP送信ウィンドウサイズや輻輳ウィンドウサイズ等から決定される。また、TCPセッションでチェックサム計算のオフロード設定がされていない場合、TCPセグメントに対するチェックサム値がコピーの際に計算される。
第一プロトコル処理部206は、TCPやUDPのトランスポート層の処理、IPのネットワーク層の処理、具体的には各プロトコルのヘッダ生成処理を行う。
The first segment
The first
ウィンドウ制御部207は、TCP送信ウィンドウサイズおよび輻輳ウィンドウを管理する。
バッファ管理データフック部208は、第一プロトコル処理部206がIP処理をしている途中でバッファ管理データをフックして処理するコールバックを登録する機能を有する。例えば、Linuxでは、Netfilterと呼ばれるフレームワークで提供されるAPIを使ってバッファ管理データフック部208が実現される。ここで、バッファ管理データのフックとは、バッファ管理データの取得処理を意味する。
The
The buffer management
通信デバイス転送処理部209は、プロトコルスタック202で処理されたバッファ管理データを通信デバイス105に入力する機能を有する。通信デバイス転送処理部209には、通信デバイス105のドライバも含まれる。なお、通信デバイス105のドライバはOSカーネル201に含まれていてもよいし、後述する動的にロードするソフトウェア(以下、「動的ロードソフトウェア210」と称する)として実現してもよい。
The communication device
動的ロードソフトウェア210は、OSカーネル201の起動後に動的にロードされる。動的ロードソフトウェア210は、コールバック登録部211、バッファ管理データ処理判定部212、プロトコル処理返付部213、ソケット情報書き換え部214、第二バッファ管理データ生成部215および通信デバイス処理入力部216を有する。
コールバック登録部211は、バッファ管理データフック部208が提供する機能を用いて、バッファ管理データをIPプロトコル処理中にフックして処理するコールバックを登録する。つまり、本実施形態において、コールバック登録部211は、バッファ管理データをフックする機能を有する。
The
The
バッファ管理データ処理判定部212は、コールバック登録部211で登録されたコールバック内で、フックしたバッファ管理データの中身を解析し、処理判定を行う(バッファ管理データの処理の方法を決定する)。例えば、バッファ管理データ処理判定部212は、フックしたバッファ管理データを、フック元であるプロトコルスタック202の処理に戻すという判定(決定)をすることができる。また、バッファ管理データ処理判定部212は、フックしたバッファ管理データのソケット情報を書き換えるという判定をすることができる。さらに、バッファ管理データ処理判定部212は、フックしたバッファ管理データをオフロード処理するという判定をすることもできる。処理判定の詳細については図3を用いて後述する。
The buffer management data
プロトコル処理返付部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
ソケット情報書き換え部214は、バッファ管理データ処理判定部212においてフックしたバッファ管理データのソケット情報を書き換えると判定された場合、当該バッファ管理データのソケット情報を書き換える。書き換えるソケット情報は、例えば、MSSのキャッシュ値と、チェックサム計算をハードウェアオフロードする設定である。MSSのキャッシュ値を実際のMSS値よりも大きな値に設定することで、プロトコルスタック202の第一セグメント分割処理部205において分割されるセグメントデータサイズが大きくなる。これにより、一つのバッファ管理データで管理されるセグメントデータサイズが大きくなる。または、セグメントオフロードするように設定することでセグメントデータサイズを大きくしてもよい。セグメントオフロードするように設定する場合、最大セグメントサイズおよび最大セグメント数の設定も行う。また、チェックサム計算をハードウェアオフロードするように設定することで、第一セグメント分割処理部205においてコピーの際に発生するチェックサム計算処理がスキップされ、プロトコルスタック202の処理が軽減される。ソケット情報を書き換えたバッファ管理データはプロトコル処理返付部213によりプロトコルスタック202に戻される。ソケット情報を書き換えたコネクションについては、以降、大きなセグメントデータサイズでTCPチェックサム計算がされない状態のバッファ管理データが動的ロードソフトウェア210にフックされる。
When the socket
第二バッファ管理データ生成部215は、バッファ管理データ処理判定部212においてフックしたバッファ管理データのセグメント分割処理と通信プロトコル処理をハードウェアオフロードすると判定された場合に、バッファ管理データを生成する。生成するバッファ管理データの個数は、フックしたバッファ管理データが管理するセグメントデータサイズを実際のTCPセッションのMSSで割ることで算出する。割り切れずに余りが発生する場合は切り上げる。例えば、フックしたバッファ管理データが管理するセグメントデータサイズが15000Byteであり、MSSが1460Byteの場合、11個のバッファ管理データを生成する。また、第二バッファ管理データ生成部215は、生成したバッファ管理データおよびフックしたバッファ管理データをオフロード処理ハードウェア106に入力する。第二バッファ管理データ生成部215が生成したバッファ管理データは、OSカーネル201からフックしたバッファ管理データとは異なるので、第二のバッファ管理データと称してもよい。
The second buffer management
通信デバイス処理入力部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
オフロード処理ハードウェア106は、第二セグメント分割処理部217と第二プロトコル処理部218を有する。
第二セグメント分割処理部217は、DMACを備えており、フックしたバッファ管理データで管理されるセグメントデータのアドレスを読み出し元とし、セグメントデータを取得する。第二セグメント分割処理部217は、取得したセグメントデータを、MSS単位でセグメントデータをメモリコピーすることでセグメント分割処理を行う。より詳しくは、第二セグメント分割処理部217は、第二バッファ管理データ生成部215で生成した複数のバッファ管理データに対し、管理されるデータ領域を書き出し先としてMSS単位でセグメントデータをメモリコピーすることでセグメント分割処理を行う。
The
The second segment
第二プロトコル処理部218は、セグメント分割処理がなされたバッファ管理データに対して、TCP/IPのプロトコル処理を行う。フックしたバッファ管理データにプロトコル処理中のヘッダデータが含まれているので、第二プロトコル処理部218は、当該ヘッダデータに基づいて第二バッファ管理データ生成部215で生成した複数のバッファ管理データに対し、プロトコル処理を行う。例えば、IPヘッダについては、アドレス情報やプロトコル情報等はそのままコピーし、個々のバッファ管理データで異なる値(パケット長、識別子、チェックサム等)は計算および再入力を行う。TCPヘッダについては、ポート番号情報やコントロールフラグ等はそのままコピーし、シーケンス番号やチェックサム等は計算および再入力を行う。また、第二プロトコル処理部218はMACヘッダも生成する。フックしたバッファ管理データにはMACヘッダは付与されていないが、第二プロトコル処理部218は、APRテーブルの宛先デバイス情報から取得できる近傍エントリ情報に基づいてMACヘッダを生成する。例えば、Linuxにおいては、第二プロトコル処理部218はstruct neighbour構造体で管理される情報からMACヘッダを生成する。
The second
なお、本実施形態では、第二セグメント分割処理部217と第二プロトコル処理部218はオフロード処理ハードウェア106で実現しているが、ソフトウェアで実現してもよい。
また、図2に示した構成は一例であり、複数の機能部が1つの機能部に統合されてもよいし、いずれかの機能部が複数の機能部に分けられてもよい。さらに、図2に示した機能部に含まれる一部または全部の機能がハードウェア化されていてもよい。ハードウェア化は、例えばASIC(Application Specific Integrated Circuit)により実現される。
In the present embodiment, the second segment
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
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
In S302, the buffer management data
S303において、バッファ管理データ処理判定部212は、ソケット情報が書き換え済みか否かを判定する。具体的には、バッファ管理データ処理判定部212は、ソケット情報の中のMSSのキャッシュ値とハードウェアチェックサムオフロードフラグを確認する。ソケット情報が書き換え済みであればS304に進み、書き換え済みでなければS308に進む。
S304では、バッファ管理データ処理判定部212は、ARPテーブルを参照して、次に送信すべきセグメントデータに関する近傍エントリ情報があるかどうかを判定する。近傍エントリ情報がなければ(S304の判定結果がNoの場合)、第二プロトコル処理部218でMACヘッダが生成できないため、フックしたバッファ管理データをプロトコル処理に戻す(S306)。近傍エントリ情報があればS305に進む。
In S303, the buffer management data
In S304, the buffer management data
S305において、バッファ管理データ処理判定部212は、フックしたバッファ管理データのセグメントデータサイズがMSSよりも大きいかどうかを判定する。セグメントデータサイズがMSSよりも大きければS307に進み、MSS以下であればS306に進む。
S306において、バッファ管理データ処理判定部212は、フックしたバッファ管理データがオフロード処理対象ではなく、プロトコル処理に戻すと判定する。そして、バッファ管理データ処理判定部212は、当該バッファ管理データをプロトコル処理返付部213に送る。
In S305, the buffer management data
In S306, the buffer management data
S307において、バッファ管理データ処理判定部212は、フックしたバッファ管理データがオフロード処理対象であると判定する。そして、バッファ管理データ処理判定部212は、当該バッファ管理データを第二バッファ管理データ生成部215に送る。
S308において、バッファ管理データ処理判定部212は、フックしたバッファ管理データのソケット情報を書き換えると判定する。そして、バッファ管理データ処理判定部212は、当該バッファ管理データをソケット情報書き換え部214に送る。
In S307, the buffer management data
In S308, the buffer management data
<プロトコル処理後のバッファ管理データ>
図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
The
The
ヘッダデータ402は、セグメントデータ401に対して、第一プロトコル処理部206で処理中のヘッダデータである。ヘッダデータ402には、TCPヘッダおよびIPヘッダが付与されており、TCPチェックサム値は計算されていない状態を想定する。
バッファ管理データ403、404、405、406は、第二バッファ管理データ生成部215で生成されるバッファ管理データ(第二のバッファ管理データ)である。図4は、第二のバッファ管理データが4つの場合を示しているが、第二のバッファ管理データの数は4に限定されない。
The
The
セグメントデータ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
The
以上、本実施形態によれば、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
なお、図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
If the checksum calculation is turned off when S306 is executed, the protocol
<実施形態2>
実施形態1では、第二セグメント分割処理部217において、フックしたバッファ管理データ400が管理するセグメントデータ401を、バッファ管理データ403〜406が管理するセグメントデータ領域に分割しつつコピーした。実施形態2では、第二セグメント分割処理部217において、セグメントデータ401をコピーしない場合を説明する。以下の記載において、実施形態1と同様な構成、機能および処理については、同じ参照符号を付ける。
<Embodiment 2>
In the first embodiment, the second segment
ハードウェア構成については実施形態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
<通信装置の機能構成>
図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
The buffer management
<プロトコル処理後のバッファ管理データ>
図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
The
本実施形態では、コピーしたセグメントデータ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
Since the
以上、本実施形態によれば、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
本発明は、上述の実施形態の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.
前記所定の通信プロトコルによるプロトコル処理中に、前記セグメントデータを管理する第一の管理データを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.
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)
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 |
-
2019
- 2019-08-28 JP JP2019155592A patent/JP7387335B2/en active Active
Patent Citations (6)
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 |