JP5960186B2 - Virtual channel construction system, virtual channel construction method, and virtual channel construction program - Google Patents

Virtual channel construction system, virtual channel construction method, and virtual channel construction program Download PDF

Info

Publication number
JP5960186B2
JP5960186B2 JP2014076807A JP2014076807A JP5960186B2 JP 5960186 B2 JP5960186 B2 JP 5960186B2 JP 2014076807 A JP2014076807 A JP 2014076807A JP 2014076807 A JP2014076807 A JP 2014076807A JP 5960186 B2 JP5960186 B2 JP 5960186B2
Authority
JP
Japan
Prior art keywords
virtual
virtual machine
external process
guest
buffer queue
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2014076807A
Other languages
Japanese (ja)
Other versions
JP2015197874A (en
Inventor
益谷 仁士
仁士 益谷
佳宏 中島
佳宏 中島
健史 木下
健史 木下
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2014076807A priority Critical patent/JP5960186B2/en
Publication of JP2015197874A publication Critical patent/JP2015197874A/en
Application granted granted Critical
Publication of JP5960186B2 publication Critical patent/JP5960186B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

仮想マシンが動作可能なホストオペレーティングシステムにおいて、仮想マシン内で動作するゲストOSが自仮想マシン外に存在する、外部プロセスとの専用仮想通信路を構築するシステムおよび、仮想通信路の制御方法に関する。   The present invention relates to a system for constructing a dedicated virtual communication path with an external process in which a guest OS operating in a virtual machine exists outside the own virtual machine and a method for controlling the virtual communication path in a host operating system capable of operating a virtual machine.

仮想マシンを構成する技術としてLinux(登録商標)とKVM(kernel−based virtual machine)で構成されたハイパーバイザー環境がよく知られている。この環境では、KVMモジュールが組み込まれたホストOS(物理サーバ上にインストールされたOSをホストOSと呼ぶ)がハイパーバイザーとしてカーネル空間(と呼ばれるユーザ空間とは異なるメモリ領域で)動作し、この環境においてユーザ空間にて仮想マシンが動作し、その仮想マシン内にゲストOS(仮想マシン上にインストールされたOSをゲストOSと呼ぶ)が動作する。   A hypervisor environment configured with Linux (registered trademark) and KVM (kernel-based virtual machine) is well known as a technology for configuring a virtual machine. In this environment, a host OS in which a KVM module is incorporated (an OS installed on a physical server is called a host OS) operates as a hypervisor in a kernel space (in a memory area different from a user space called), and this environment , A virtual machine operates in the user space, and a guest OS (an OS installed on the virtual machine is called a guest OS) operates in the virtual machine.

ゲストOSが動作する仮想マシンはホストOSが動作する物理サーバとは異なり、(イーサーネットカードデバイスなどに代表される)ネットワークデバイスを含むすべてのハードウェアが、ハードウェアからゲストOSへの割り込み処理やゲストOSからハードウェアへの書き込みに必要なレジスタ制御といった本来物理ハードウェアが実施すべき通知や処理がソフトウェアで擬似的に模倣されるため、性能がホストOS環境に比べ、低いことが一般的である。   Unlike a physical server on which a host OS operates, a virtual machine on which a guest OS operates is configured such that all hardware including a network device (typically represented by an Ethernet card device) performs interrupt processing from the hardware to the guest OS. Since notifications and processing that should be originally performed by physical hardware such as register control necessary for writing from the guest OS to the hardware are simulated in software, the performance is generally lower than that of the host OS environment. is there.

この性能劣化において、特にゲストOSから自仮想マシン外に存在するホストOSや外部プロセスに対して、ハードウェアの模倣を削減し、高速かつ統一的なインタフェースにより通信の性能と汎用性を向上させる技術として、Virtioというデバイスの抽象化技術、つまり準仮想化技術が開発されており、すでにLinux(登録商標)を始め、FreeBSD(登録商標)など多くの汎用OSに組み込まれ、現在利用されている。   In this performance degradation, technology that reduces imitation of hardware and improves communication performance and versatility through a high-speed and uniform interface, especially from the guest OS to the host OS and external processes that exist outside the virtual machine. As an example, a device abstraction technology called Virtual, that is, a para-virtualization technology has been developed, and has already been incorporated into many general-purpose OSs such as Linux (registered trademark) and FreeBSD (registered trademark) and is currently used.

<Virtioの仕組み>
Virtioでは、コンソール、ファイル入出力、ネットワーク通信といったデータ入出力に関して、転送データの単一方向の転送用トランスポートとして、リングバッファで設計されたキューによるデータ交換とキューのオペレーションを以て定義している。そして、virtioのキューの仕様を利用して、それぞれのデバイスに適したキューの個数と大きさをゲストOS起動時に用意することにより、ゲストOSと自仮想マシン外部との通信を、ハードウェアエミュレーションを実施せずにキューによるオペレーションだけで実現することができる。詳細な仕様については、非特許文献1に記載されている。
<How Virtio works>
In relation to data input / output such as console, file input / output, and network communication, Virtual defines data exchange by a queue designed by a ring buffer and queue operation as a transport for unidirectional transfer of transfer data. By using the virtual queue specifications, the number and size of queues suitable for each device are prepared when the guest OS is started, so that communication between the guest OS and the outside of the virtual machine can be performed by hardware emulation. It can be realized only by an operation by a queue without performing it. Detailed specifications are described in Non-Patent Document 1.

具体的には、PCIデバイスとして仮想マシン内にコンソール、ファイル入出力、ネットワーク通信それぞれに対しVirtioデバイスが存在し(コンソールはvirtio−console、ファイル入出力はvirtio−blk、ネットワークはvirtio−netと呼ばれるデバイスとそれに対応するOSが持つドライバがvirtioキューで定義されている)、ゲストOS起動時に、ゲストOSと相手側とのデータの受け渡し端点(送受信端点)を2つ作り、データ送受信の親子関係を構築する。多くの場合、親子関係は仮想マシン側(子側)とゲストOS(親側)で構成する。   Specifically, a virtual device exists as a PCI device for the console, file input / output, and network communication in the virtual machine (console is called virtual-console, file input / output is called virtual-blk, and network is called virtual-net). The device and the driver of the corresponding OS are defined in the virtual queue), and when the guest OS starts up, two data transfer endpoints (transmission / reception endpoints) between the guest OS and the other party are created, and the data transmission / reception parent-child relationship is established To construct. In many cases, the parent-child relationship is configured by the virtual machine side (child side) and the guest OS (parent side).

図1に示すように、子側は仮想マシン内のデバイスの構成情報として存在し、それぞれのデータ領域のサイズと必要とする端点の組み合わせの個数、デバイスの種別を親側に要求する。親側は子側の要求に従い、必要な分のデータを貯蓄し受け渡すための共有バッファキューのためのメモリを割り当て確保し、子側がアクセスできるようにそのアドレス番地を子側に返す。データの受け渡しに必要とされる共有バッファキューのオペレーションについては、Virtioではすべて共通であり、親側、子側両方合意済みとして実行される(Virtioキューのオペレーションについては後述の<Virtioキューの操作>を参考にすること)。さらに共有バッファキューの大きさも両方合意済みとする(つまりデバイスごとに決まっている)。これにより、子側にアドレスを伝えるだけで、親側、子側の双方が共有するキューを操作することが可能となる。   As shown in FIG. 1, the child side exists as the configuration information of the device in the virtual machine, and requests the parent side the size of each data area, the number of required combinations of endpoints, and the type of device. In accordance with the request from the child side, the parent side allocates and secures a memory for a shared buffer queue for storing and transferring necessary data and returns the address address to the child side so that the child side can access it. The operations of the shared buffer queue required for data transfer are all common in the Virti, and are executed as agreed on both the parent side and the child side (the operation of the Virio queue will be described later) For reference). It is also assumed that the size of the shared buffer queue is agreed upon (that is, it is determined for each device). As a result, it is possible to operate a queue shared by both the parent side and the child side only by transmitting the address to the child side.

Virtioにおいて用意する共有バッファキューは単一方向用として用意されるため、例えば、virtio−netデバイスと呼ばれる仮想ネットワークデバイスでは送信用、受信用、コントロール用の3つのリングバッファで構成される。親と子の通信は、共有バッファキューへの書き込みとバッファ更新通知により実現し、リングバッファに書き込んだ後、相手側に通知する。相手側は通知を受けると、どの共有バッファキューにどの程度新規のデータが入っているのかをVirtioの共通オペレーションを利用して確認し、新規のバッファ領域を取り出す。これにより、親から子または子から親へのデータの受け渡しが成立する。   Since the shared buffer queue prepared in the Virtual is prepared for a single direction, for example, a virtual network device called a virtual-net device includes three ring buffers for transmission, reception, and control. The communication between the parent and the child is realized by writing to the shared buffer queue and the buffer update notification, writing to the ring buffer, and notifying the other party. When the other party receives the notification, it confirms how much new data is stored in which shared buffer queue by using the common operation of Virtual, and takes out a new buffer area. This establishes data transfer from the parent to the child or from the child to the parent.

以上のように、親子でお互いデータ交換用のリングバッファとそれぞれのリングバッファ用のオペレーション方法(Virtioで共通)を共有することにより、ハードウェアエミュレーションを必要としない、ゲストOSと外部との通信を実現する。これにより、従来のハードウェアエミュレーションに比べ、ゲストOSと外部とのデータの送受信を高速に実現することが可能である。   As described above, by sharing the ring buffer for exchanging data with each other and the operation method for each ring buffer (common in Virti) between the parent and child, communication between the guest OS and the outside that does not require hardware emulation is possible. Realize. As a result, data transmission / reception between the guest OS and the outside can be realized at higher speed than conventional hardware emulation.

<Virtioキューの操作>
(共有バッファキューの構成)
親側(例:ゲストOS)と子側(例:仮想マシン)が共有する共有バッファキューについて説明する。共有バッファキューは、非特許文献1に記載の仕様の通りであるが、本発明の動作(実施例)を説明するにあたり、キュー構成とキュー操作に関するオペレーションを前提とするため、本節にて説明する。共有バッファキューは既に述べたように親側から子側、または子側から親側への単一方向で利用するものであり、図2の通り次の要素で構成される(本発明はネットワークデバイスに関するものであり、データ転送用のキューを送信用、受信用の2つとする(virtio−netの仕様の通りである))。
<Virtual Queue Operation>
(Configuration of shared buffer queue)
A shared buffer queue shared by the parent side (example: guest OS) and the child side (example: virtual machine) will be described. The shared buffer queue is as described in Non-Patent Document 1, but will be described in this section because it presupposes operations related to queue configuration and queue operation when describing the operation (example) of the present invention. . As described above, the shared buffer queue is used in a single direction from the parent side to the child side or from the child side to the parent side, and includes the following elements as shown in FIG. The data transfer queue has two queues for transmission and reception (as in the specification of virtual-net).

・ディスクリプタポインタ列
転送データを保存する各ディスクリプタを参照するためのポインタ。ディスクリプタは転送データの参照アドレスと、その長さ、転送フラグ(本発明では特に重要ではないため説明は省略する)、後続データがある場合のディスクリプタのポインタの4つで構成される(図2)。
Descriptor pointer string Pointer for referring to each descriptor that stores transfer data. The descriptor is composed of four reference addresses of transfer data, its length, a transfer flag (the description is omitted because it is not particularly important in the present invention), and a descriptor pointer when there is subsequent data (FIG. 2). .

・availリング
availリングでは、ヘッダ、availインデックス(availidx)、availリング列、used_event の4つの要素からなる。ヘッダについては本発明では特に重要ではないので省略する。availリング列はそれぞれインデックスが順番に割り振られたリングバッファからなり(図においては0番からインデックスを割り当てている)、それぞれのバッファにはゲストOS側が確保し用意したディスクリプタの番号がインデックスの順番に従って記載される。availインデックスは現在消費済みのavailリング列の最終インデックスをゲストOSが記載する。used_eventについても本発明には特に重要ではないので省略する。
-Avail ring In an avail ring, it consists of four elements, a header, an avail index (availidx), an avail ring string, and a used_event. The header is omitted because it is not particularly important in the present invention. The avail ring sequence is composed of ring buffers in which indexes are assigned in order (in the figure, indexes are assigned from the number 0), and the descriptor numbers prepared and prepared by the guest OS side are assigned to the buffers according to the order of the indexes. be written. In the avail index, the guest OS describes the final index of the avail ring column that is currently consumed. Since used_event is not particularly important for the present invention, it is omitted.

・usedリング
usedリングでは、ヘッダ、usedインデックス(usedidx)、usedリング列、avail_eventの4つの要素から成る。ヘッダは本発明では特に重要ではないので省略する。usedリング列はそれぞれインデックスが順番に振られたリングバッファからなり、ゲストOSが用意したavailリング列より、仮想マシンがインデックス順に取り出したディスクリプタ番号を順番にリングに書き込んだものである。usedインデックスは現在消費済みのusedリング列の最終インデックスを仮想マシンが記載する。avail_eventについても本発明には特に重要ではないので省略する。
Used ring The used ring includes four elements: a header, a used index (usedidx), a used ring sequence, and an available_event. The header is omitted because it is not particularly important in the present invention. Each used ring column is composed of a ring buffer in which indexes are assigned in order, and descriptor numbers taken out by the virtual machine in the order of the index from the avail ring column prepared by the guest OS are sequentially written in the ring. In the used index, the virtual machine describes the final index of the used ring sequence that has been consumed. Since “avail_event” is not particularly important for the present invention, it is omitted.

・last_avail_idx
このインデックス値は、子側が保持する値であり、最終的に取り出し回収したavailリングのavailインデックス値となる。親側がアップデートしたavail_idxと、last_avail_idxを比較することで、アップデートされたavailリングの個数を子側が知ることができる。
・ Last_avail_idx
This index value is a value held on the child side, and becomes an avail index value of an avail ring that is finally extracted and collected. The child side can know the number of updated avail rings by comparing the avail_idx updated by the parent side with the last_avail_idx.

・last_used_idx
このインデックス値は、親側が保持する値であり、最終的に取り出し回収したusedリングのusedインデックス値となる。子側がアップデートしたused_idxと、last_used_idxを比較することで、アップデートされたusedリングの個数を親側が知ることができる。
・ Last_used_idx
This index value is a value held by the parent side and is a used index value of the used ring that is finally extracted and collected. By comparing the used_idx updated by the child side with the last_used_idx, the parent side can know the number of updated used rings.

(親側(例:ゲストOS)から子側(例:仮想マシン)へのデータ転送)
親側から子側へのデータ転送は送信専用のキューを利用する。初期状態では、ディスクリプタ、availリング列、usedリング列が図3の通り初期化された状態である。転送時ゲストOSはデータ1つを仮想マシン側に転送する場合、図4の通り、availリングの先頭に確保したディスクリプタ番号(S−1)を記入する。Sはリング列のサイズとする。ディスクリプタS−1はゲストOSによって転送用データで埋められる。そして、ゲストOSはavailidxを0に進める。その後、ゲストOSは仮想マシン側にavailリング更新通知を送付する。
(Data transfer from parent side (eg guest OS) to child side (eg virtual machine))
Data transmission from the parent side to the child side uses a queue dedicated to transmission. In the initial state, the descriptor, the available ring sequence, and the used ring sequence are initialized as shown in FIG. When transferring one piece of data to the virtual machine side, the guest OS writes the descriptor number (S-1) secured at the head of the avail ring as shown in FIG. S is the size of the ring row. The descriptor S-1 is filled with transfer data by the guest OS. Then, the guest OS advances availidx to 0. Thereafter, the guest OS sends an avail ring update notification to the virtual machine side.

図5において、仮想マシンは更新通知を受け、availリング列をチェックする。このとき、ゲストOSがどの程度、availリング列に書き込んだのかリングの個数を調べるために、仮想マシン側でlast_avail_idxを管理している。last_avail_idxは初期値であり、availidx とlast_avail_idxを比較して、データ1個がavailリングに入れられていることを仮想マシンが認識する。仮想マシンはインデックス0番のリングからディスクリプタ番号を見つけ(S−1)、ディスクリプタS−1を参照して、ゲストOSが書き込んだ転送データを回収する。availリングからデータを回収した後、回収した分だけ、usedリング列を次のようにアップデートする。   In FIG. 5, the virtual machine receives the update notification and checks the avail ring string. At this time, last_avail_idx is managed on the virtual machine side in order to check the number of rings written by the guest OS to the avail ring string. The last_avail_idx is an initial value, and the virtual machine recognizes that one piece of data is included in the avail ring by comparing the availidx and the last_avail_idx. The virtual machine finds the descriptor number from the ring with index 0 (S-1), and refers to the descriptor S-1 to collect the transfer data written by the guest OS. After collecting the data from the avail ring, the used ring row is updated as follows for the collected amount.

仮想マシン側はavailリングから1つずつ回収するたびに、usedidxの値をインクリメントしながら、availリングに書き込まれていたディスクリプタ番号をusedリングに書き込んでいく。書き込み後、usedidxを1つずつインクリメントする。仮想マシンがusedリング列のアップデートが終了すると、last_avail_idxを0にアップデートして、usedリング更新通知を利用して、ゲストOSに通知する。   Each time the virtual machine collects one from the avail ring, it writes the descriptor number written in the avail ring to the used ring while incrementing the value of usedidx. After writing, usedidx is incremented by one. When the virtual machine finishes updating the used ring queue, it updates last_avail_idx to 0 and notifies the guest OS using the used ring update notification.

図6において、ゲストOSは仮想マシンから通知を受けて、usedidxとゲストOSが管理するlast_used_idxからusedリング0番に記載されているディスクリプタ番号が参照するデータ領域を解放するとともに、last_used_idxを0に変更する。   In FIG. 6, the guest OS receives a notification from the virtual machine, releases the data area referred to by the descriptor number described in the used ring number 0 from usedidx and last_used_idx managed by the guest OS, and changes last_used_idx to 0. To do.

以上のようにして、availリング列とusedリング列をそれぞれリングバッファとして循環利用しながら、データ転送を実現する。   As described above, data transfer is realized while circularly using the avail ring sequence and the used ring sequence as ring buffers.

(子側(例:仮想マシン)から親側(例:ゲストOS)へのデータ転送)
子側から親側へのデータ転送は、受信専用キューを利用する。親側から子側への転送の初期状態とは異なり、子側から親側へ送信する場合は、利用可能なavailリング列に確保済みディスクリプタをできるだけ多く用意する。
(Data transfer from child side (example: virtual machine) to parent side (example: guest OS))
Data transfer from the child side to the parent side uses a reception-only queue. Unlike the initial state of transfer from the parent side to the child side, when transmitting from the child side to the parent side, as many reserved descriptors as possible are prepared in the available avail ring string.

図7において、受信専用キューを用意するときに、全ディスクリプタをavailリング列に書き込み、availidxをS−1に進めた状態とする。   In FIG. 7, when a receive-only queue is prepared, all descriptors are written to the avail ring queue, and availidx is advanced to S-1.

図8において、仮想マシンがデータをゲストOSに転送する場合、利用可能なavailリング列から取り出す。例えば、1つのデータを転送する場合、last_avail_idxが初期化されていることからavailリング0番を参照し、ディスクリプタS−1を利用して、転送用データを書き込む。last_avail_idxは0にアップデートする。その後、usedidxが初期化されていることから、usedリング0番に利用したディスクリプタ番号S−1を記載して、usedidxを0にアップデートした後、usedリング更新通知をゲストOSに送信する。   In FIG. 8, when the virtual machine transfers data to the guest OS, it is taken out from the available avail ring queue. For example, when transferring one piece of data, since last_avail_idx is initialized, the avail ring 0 is referred to and the transfer data is written using the descriptor S-1. Last_avail_idx is updated to 0. After that, since usedidx is initialized, the descriptor number S-1 used for the used ring 0 is described, and after the usedidx is updated to 0, a used ring update notification is transmitted to the guest OS.

図9において、ゲストOSは仮想マシンからusedリング更新通知を受けて、usedidxとゲストOSが管理するlast_used_idxからusedリング0番に記載されているディスクリプタ番号が参照するデータ領域を転送データとして回収するとともに解放し、last_used_idxを0に変更する。   In FIG. 9, the guest OS receives a used ring update notification from the virtual machine, and collects the data area referred to by the descriptor number described in the used ring number 0 from usedidx and last_used_idx managed by the guest OS as transfer data. Release and change last_used_idx to 0.

以上のようにして、あらかじめゲストOS側でディスクリプタが確保された状態でavailリング列とusedリング列をそれぞれリングバッファとして循環利用しながら、仮想マシンからゲストOSへのデータ転送を実現する。   As described above, data transfer from the virtual machine to the guest OS is realized while circularly using the avail ring sequence and the used ring sequence as ring buffers in a state where the descriptor is secured in advance on the guest OS side.

以上のとおり、ゲストOSから仮想マシン側への転送(ゲストOSから見ると送信)、仮想マシン側からゲストOS側への転送(ゲストOSから見ると受信)について、説明した。これらをまとめた図が、図10である。   As described above, the transfer from the guest OS to the virtual machine side (transmission when viewed from the guest OS) and the transfer from the virtual machine side to the guest OS side (reception when viewed from the guest OS) have been described. FIG. 10 shows a summary of these.

<Virtioを利用したゲストOSと自仮想マシン外部との通信方法について>
仮想マシン内のゲストOSが外部と通信する場合は、子側が外部と接続し、子側が外部と親側の中継役としてデータを送受信する必要がある。例えば、ゲストOSとホストOS間の通信がその例の1つである。ここで、外部をホストOSとした場合、既存の通信方法として2パターン存在する。
<Communication method between guest OS using Virtual and outside of own virtual machine>
When the guest OS in the virtual machine communicates with the outside, the child side needs to connect to the outside, and the child side needs to transmit and receive data as a relay role between the outside and the parent side. For example, communication between a guest OS and a host OS is one example. Here, when the outside is a host OS, there are two patterns as existing communication methods.

第1の方法(以下、外部通信方式1と呼ぶ)は、仮想マシン内に子側の端点を構築し、ゲストOSと仮想マシン間の通信と、ホストOSが提供する通信端点(通常、tap/tunデバイスと呼ばれる)を、仮想マシン内で接続することにより以下のとおりの接続を構築し、ゲストOSからホストOSへの通信を実現する。
(参1)[構築される接続]

Figure 0005960186
In the first method (hereinafter referred to as external communication method 1), a child-side endpoint is constructed in a virtual machine, communication between the guest OS and the virtual machine, and a communication endpoint provided by the host OS (usually tap / By connecting a device called a “tun device” in the virtual machine, the following connection is established, and communication from the guest OS to the host OS is realized.
(Reference 1) [Connections to be built]
Figure 0005960186

このとき、ゲストOSはtapドライバやホストOSが動作するカーネル空間というメモリ領域とは異なる権限を持つユーザ空間というメモリ領域で動作しているため、ゲストOSからホストOSへの通信には最低1回メモリコピーが発生してしまう(図12)。 At this time, since the guest OS operates in a memory area called a user space having a different authority from a memory area called a kernel space where the tap driver and the host OS operate, communication from the guest OS to the host OS is performed at least once. Memory copy occurs (FIG. 12).

第2の方法(以下、外部通信方式2と呼ぶ)は、これを解決する手段として、vhost−netという技術が存在する。vhost−netでは一度仮想マシン内で構築された親側の構成情報(共有バッファキューの大きさ、キューの数、識別子、リングバッファへアクセスするための先頭アドレス情報など)をホストOS内部のvhost−netドライバにコピーし、子側の端点の情報をホスト内部に構築することにより、共有バッファキューの操作をゲストOSとホストOS間で直接実施することを可能とする技術である。これにより、コピーは実質0回で済むようになり、Virtio−netに比べ、コピー回数が1回少ない分、外部通信方式1と比較し、より高速にデータ転送が実現できる。   In the second method (hereinafter referred to as external communication method 2), there is a technique called vhost-net as means for solving this. In vhost-net, the parent-side configuration information (the size of the shared buffer queue, the number of queues, the identifier, the head address information for accessing the ring buffer, etc.) once built in the virtual machine is stored in the vhost- internal host OS. This is a technique that allows a shared buffer queue operation to be directly performed between a guest OS and a host OS by copying to a net driver and constructing information on the child side endpoints inside the host. As a result, copying can be performed only 0 times, and compared with the external communication method 1, data transfer can be realized at a higher speed compared to the external communication method 1 because the number of times of copying is one less than that of the virtual-net.

http://ozlabs.org/〜rusty/virtio−spec/virtio−0.9.5.pdf(2014年3月10日検索)http: // ozlabs. org / ~ rusty / virtio-spec / virtio-0.9.5. pdf (searched on March 10, 2014) http://www.intel.co.jp/content/www/jp/ja/communications/communications−packet−processing−brief.html(2014年3月10日検索)http: // www. intel. co. jp / content / www / jp / ja / communications / communications-packet-processing-brief. html (retrieved on March 10, 2014)

Virtioでは、ゲストOSと仮想マシン(またはその先に存在するホストOS)間を結ぶ、同一物理サーバ内の仮想通信路を構築するトランスポートの抽象化技術として考えられた。ただし、外部との通信を考慮する場合は、仮想マシンと外部との接続を考慮する必要がある。   In Virtual, it was considered as a transport abstraction technology for constructing a virtual communication path in the same physical server that connects a guest OS and a virtual machine (or a host OS existing ahead). However, when considering communication with the outside, it is necessary to consider the connection between the virtual machine and the outside.

既存の方式では、外部通信方式1と外部通信方式2が開発されており、ホストOSとの通信を基本としている。この場合、データ転送性能向上のためにはホストOSを経由した通信をできるだけ高速にするために、コピー回数を少なくすることが課題として挙げられる。この課題に対し、既に述べたようにvhost−netという実質ゼロコピーを実現する技術が考えられている。   In the existing system, an external communication system 1 and an external communication system 2 have been developed and are based on communication with the host OS. In this case, in order to improve data transfer performance, a problem is to reduce the number of copies in order to make communication via the host OS as fast as possible. In order to deal with this problem, as described above, a technique for realizing a real zero copy called vhost-net is considered.

近年、ソフトウェア実装による通信アプリケーションのスループット向上のためにホストOSを経由しないバイパス高速化技術(例えば、非特許文献2のインテルDPDK)が考えられており、これにより物理ホスト内の構成は従来、中継機能を持つ仮想スイッチなどのホストOS側で実装されていたものが、外部プロセスで実装され、仮想マシンとともに同じプロセスで動作するケースが多くなる。しかし、vhost−netはプロセス間通信について考慮されておらず、従来の通り、tapデバイスを利用することにより、実質コピーが最低1回発生することになる(課題1)(図13を参照のこと)。   In recent years, in order to improve the throughput of communication applications by software implementation, bypass high-speed technology (for example, Intel DPDK in Non-Patent Document 2) that does not pass through the host OS has been considered, and the configuration in the physical host has been conventionally relayed. In many cases, what is implemented on the host OS side, such as a virtual switch having a function, is implemented in an external process and operates in the same process together with the virtual machine. However, vhost-net does not consider inter-process communication, and, as before, using a tap device causes a real copy to occur at least once (Problem 1) (see FIG. 13). ).

また、前述のとおり、ホストOSをバイパスするケースでは、仮想マシンと外部プロセス間の通信が多くなると同時に、メンテナンスやエラーによって、各プロセスを接続先へ影響がなく、切り替えや再起動等のユースケースが必ず発生する。しかし、vhost−netはキュー操作のみゲストOSとホストOS間で共有することを目的に設計されており、ホストOS上でモジュールとして動作することから、モジュールエラーやモジュールが削除される等の障害系のイベントに対する対処機能が仮想マシンの通信デバイス側、vhost−netのホストOSモジュール側両方に備わっていない(課題2)(図13を参照のこと)。   As described above, in the case of bypassing the host OS, communication between the virtual machine and external processes increases, and at the same time, maintenance and errors do not affect each connection destination, and use cases such as switching and restarting Always occurs. However, vhost-net is designed for the purpose of sharing only the queue operation between the guest OS and the host OS, and operates as a module on the host OS, so that a fault system such as a module error or a module is deleted. Is not provided on both the communication device side of the virtual machine and the host OS module side of the vhost-net (Problem 2) (see FIG. 13).

そこで、本発明は、上記2つの課題を解決するために、バイパス高速化技術において仮想マシンと外部プロセスとの間の通信のスループットを向上でき、障害系のイベントに対する対処機能を有する仮想通信路構築システム、仮想通信路構築方法、及び仮想通信路構築プログラムを提供することを目的とする。   Therefore, in order to solve the above two problems, the present invention can improve the throughput of communication between a virtual machine and an external process in the bypass high-speed technology, and has a virtual communication path construction having a function for dealing with a failure type event. It is an object to provide a system, a virtual communication path construction method, and a virtual communication path construction program.

上記目的を達成するために、本願発明は、外部プロセス側と仮想マシン側を仮想通信路で直接接続するとともに、接続相手の状態を検知し、相手の状態に応じて再接続する機能を備えることとした。   In order to achieve the above object, the present invention has a function of directly connecting an external process side and a virtual machine side via a virtual communication path, detecting a connection partner state, and reconnecting according to the partner state. It was.

具体的には、本発明に係る仮想通信路構築システムは、
仮想マシン及び前記仮想マシン外に形成された外部プロセスが動作可能なホストOSを有する物理マシンと、
前記仮想マシン内で動作するゲストOSに、前記仮想マシンと前記外部プロセスとを直接接続する仮想通信路を構築させる通信路構築手段と、
を備える。
Specifically, the virtual communication path construction system according to the present invention is:
A physical machine having a virtual machine and a host OS capable of operating an external process formed outside the virtual machine;
A communication path constructing means for constructing a virtual communication path for directly connecting the virtual machine and the external process to the guest OS operating in the virtual machine;
Is provided.

具体的には、本発明に係る仮想通信路構築方法は、
仮想マシン及び前記仮想マシン外に形成される外部プロセスが動作可能なホストOSを有する物理マシン上に、前記仮想マシン及び前記外部プロセスを形成する仮想マシン形成手順と、
前記仮想マシン内で動作するゲストOSに、前記仮想マシンと前記外部プロセスとを直接接続する仮想通信路を構築させる仮想通信路構築手順と
を行う。
Specifically, the virtual communication path construction method according to the present invention is:
A virtual machine forming procedure for forming the virtual machine and the external process on a physical machine having a virtual machine and a host OS capable of operating an external process formed outside the virtual machine;
A virtual communication path construction procedure for constructing a virtual communication path for directly connecting the virtual machine and the external process to the guest OS operating in the virtual machine is performed.

本発明は、外部プロセス側と仮想マシン側を直接接続することができるため、メモリコピー回数とコンテキストスイッチ切り替え回数を外部通信方式1、2に対し少なくすることができ、高速にデータ転送を実現することができる。従って、本発明は、バイパス高速化技術において仮想マシンと外部プロセスとの間の通信のスループットを向上できる仮想通信路構築システム、及び仮想通信路構築方法を提供することができる。   In the present invention, since the external process side and the virtual machine side can be directly connected, the number of times of memory copy and context switch switching can be reduced compared to the external communication methods 1 and 2, and high-speed data transfer is realized. be able to. Therefore, the present invention can provide a virtual communication path construction system and a virtual communication path construction method capable of improving the throughput of communication between a virtual machine and an external process in the bypass acceleration technology.

本発明に係る仮想通信路構築システムの前記通信路構築手段は、
前記仮想マシンと前記ゲストOSとの間のデータ転送用として形成された共有バッファキューについて、メモリ操作で前記共有バッファキューのデータ転送先を前記外部プロセスへ拡張して前記仮想通信路を構築するとともに、前記ゲストOSと前記外部プロセスとの間の通信に関する手続きを実現させる共有バッファキュー拡張用プロトコル機能を有することを特徴とする。
The communication path construction means of the virtual communication path construction system according to the present invention is:
For the shared buffer queue formed for data transfer between the virtual machine and the guest OS, the data transfer destination of the shared buffer queue is extended to the external process by a memory operation, and the virtual communication path is constructed. And a shared buffer queue expansion protocol function for realizing a procedure related to communication between the guest OS and the external process.

本発明に係る仮想通信路構築方法の前記仮想通信路構築手順は、
前記仮想マシンと前記ゲストOSとの間のデータ転送用として形成された共有バッファキューについて、メモリ操作で前記共有バッファキューのデータ転送先を前記外部プロセスへ拡張して前記仮想通信路を構築するとともに、前記ゲストOSと前記外部プロセスとの間の通信に関する手続きを実現させる共有バッファキュー拡張ステップを有することを特徴とする。
The virtual communication path construction procedure of the virtual communication path construction method according to the present invention is:
For the shared buffer queue formed for data transfer between the virtual machine and the guest OS, the data transfer destination of the shared buffer queue is extended to the external process by a memory operation, and the virtual communication path is constructed. And a shared buffer queue extending step for realizing a procedure related to communication between the guest OS and the external process.

本発明は、仮想デバイスとゲストOS間の共有バッファキューで実現されるデータ転送と同様に、ゲストOSと外部プロセス間のデータ転送を共有バッファキューのメモリ操作で実現する。   The present invention realizes data transfer between a guest OS and an external process by a memory operation of the shared buffer queue, similarly to data transfer realized by a shared buffer queue between the virtual device and the guest OS.

本発明に係る仮想通信路構築システムの前記通信路構築手段は、
前記仮想通信路の状態を検知する接続状態検知機能と、
前記仮想通信路の状態をそれぞれ前記ゲストOSと前記外部プロセス上の処理ロジックに通知する接続状態通知機能と、
それぞれの前記通信デバイスが通信断のときに定期的に通信先と再接続する再接続機能と、
をさらに有することを特徴とする。
The communication path construction means of the virtual communication path construction system according to the present invention is:
A connection state detection function for detecting the state of the virtual communication path;
A connection status notification function for notifying the status of the virtual communication path to the processing logic on the guest OS and the external process, respectively;
A reconnection function that periodically reconnects to the communication destination when each of the communication devices is disconnected,
It further has these.

本発明に係る仮想通信路構築方法の前記仮想通信路構築手順は、
前記仮想通信路の状態を検知する接続状態検知ステップと、
前記仮想通信路の状態をそれぞれ前記ゲストOSと前記外部プロセス上の処理ロジックに通知する接続状態通知ステップと、
それぞれの前記通信デバイスが通信断のときに定期的に通信先と再接続する再接続ステップと、
をさらに有することを特徴とする。
The virtual communication path construction procedure of the virtual communication path construction method according to the present invention is:
A connection state detection step for detecting the state of the virtual communication path;
A connection state notification step of notifying the guest OS and the processing logic on the external process, respectively, of the state of the virtual communication path;
A reconnection step of periodically reconnecting to the communication destination when each of the communication devices is disconnected;
It further has these.

さらに、本発明は、想マシン、外部プロセスそれぞれの通信デバイスが、お互い接続相手の状態に関し、状態変化を検知し、自身内部へ通知することにより、ゲストOSや外部プロセス内部の処理ロジックに対し、障害発生やメンテナンスなどの事象に対処する機会を創出することができる。また、本発明は、仮想マシン、外部プロセスは切断状態に陥ったときに、正しく状態を把握できることにより、それを契機として、接続相手を切り替える動作に移ることができる。従って、本発明は、バイパス高速化技術において障害系のイベントに対する対処機能を有する仮想通信路構築システム、及び仮想通信路構築方法を提供することができる。   Furthermore, according to the present invention, the communication devices of the virtual machine and the external process each detect the change in the state of the other party's connection, and notify the inside thereof of the guest OS and the processing logic inside the external process. Opportunities can be created to deal with events such as failures and maintenance. Further, according to the present invention, when a virtual machine or an external process falls into a disconnected state, the state can be correctly grasped, and the operation can be switched to the operation of switching the connection partner using that as a trigger. Therefore, the present invention can provide a virtual communication path construction system and a virtual communication path construction method having a function to cope with a failure-type event in the bypass high-speed technology.

本発明に係る仮想通信路構築プログラムは、仮想マシン及び前記仮想マシン外に形成される外部プロセスが動作可能なホストOSを有する物理マシンに、請求項4から6のいずれかに記載の仮想通信路構築方法を実現させる。   The virtual communication path construction program according to the present invention provides a virtual communication path according to any one of claims 4 to 6 in a physical machine having a virtual machine and a host OS capable of operating an external process formed outside the virtual machine. Realize the construction method.

仮想マシン及び前記仮想マシン外に形成される外部プロセスが動作可能なホストOSを有する物理マシンに、前記仮想通信路構築プログラムを動作させることで前記仮想通信路構築方法を実現できる。   The virtual communication path construction method can be realized by operating the virtual communication path construction program on a physical machine having a virtual machine and a host OS capable of operating an external process formed outside the virtual machine.

本発明は、バイパス高速化技術において仮想マシンと外部プロセスとの間の通信のスループットを向上でき、障害系のイベントに対する対処機能を有する仮想通信路構築システム、仮想通信路構築方法、及び仮想通信路構築プログラムを提供することができる。   The present invention relates to a virtual communication path construction system, a virtual communication path construction method, and a virtual communication path that can improve the throughput of communication between a virtual machine and an external process in the bypass high-speed technology, and have a function to cope with a failure-type event A construction program can be provided.

Virtio−netデバイスの送受信端点の構成を説明する図である。<A>は、親側の端点であり、リングバッファメモリ領域を作成し、子側にそのアドレスを教えて、親子でデータにアクセスできるようにする。<B>は、子側の端点であり、親側に必要なリングバッファの大きさと個数を要求する。ゲストOS起動時にその要求にあわせて、ドライバが親側を用意する。子側は、親側が用意したリングバッファメモリ領域のアクセスのためのアドレスが親側から通知される。It is a figure explaining the structure of the transmission / reception end point of a Virtual-net device. <A> is an end point on the parent side, creates a ring buffer memory area, teaches the address to the child side, and allows the parent and child to access the data. <B> is an end point on the child side, and requests the size and number of ring buffers necessary for the parent side. When the guest OS starts up, the driver prepares the parent side according to the request. On the child side, an address for accessing the ring buffer memory area prepared by the parent side is notified from the parent side. Virtioキューの構成 を説明する図である。It is a figure explaining the structure of a Virtual queue. ゲストから仮想マシンへのデータ転送時のVirtioキューのオペレーションを説明する図である。It is a figure explaining operation of a Virtual queue at the time of data transfer from a guest to a virtual machine. ゲストから仮想マシンへのデータ転送時のVirtioキューのオペレーションを説明する図である。It is a figure explaining operation of a Virtual queue at the time of data transfer from a guest to a virtual machine. ゲストから仮想マシンへのデータ転送時のVirtioキューのオペレーションを説明する図である。It is a figure explaining operation of a Virtual queue at the time of data transfer from a guest to a virtual machine. ゲストから仮想マシンへのデータ転送時のVirtioキューのオペレーションを説明する図である。It is a figure explaining operation of a Virtual queue at the time of data transfer from a guest to a virtual machine. 仮想マシンからゲストOSへのデータ転送時のVirtioキューのオペレーションを説明する図である。It is a figure explaining operation of a Virtual queue at the time of data transfer from a virtual machine to a guest OS. 仮想マシンからゲストOSへのデータ転送時のVirtioキューのオペレーションを説明する図である。It is a figure explaining operation of a Virtual queue at the time of data transfer from a virtual machine to a guest OS. 仮想マシンからゲストOSへのデータ転送時のVirtioキューのオペレーションを説明する図である。It is a figure explaining operation of a Virtual queue at the time of data transfer from a virtual machine to a guest OS. Virtioキューの操作と通知(接続先がtapデバイスの場合)を説明する図である。It is a figure explaining operation and notification (when a connection destination is a tap device) of a Virtual queue. TAPデバイスを使った外部通信方式1を説明する図である。It is a figure explaining the external communication system 1 using a TAP device. vhost−netドライバを使った外部通信方式2を説明する図である。It is a figure explaining the external communication system 2 using a vhost-net driver. vhost−netを利用した仮想マシンと外部プロセス間通信を説明する図である。It is a figure explaining the communication between a virtual machine and external processes using vhost-net. 本発明に係る仮想通信路構築システムにおける新機能と構成概要を説明する図である。It is a figure explaining the new function and composition outline in the virtual channel construction system concerning the present invention. 本発明に係る仮想通信路構築方法における仮想マシンとゲストOSの起動シーケンスを説明する図である。It is a figure explaining the starting sequence of the virtual machine and guest OS in the virtual communication path construction method which concerns on this invention. 本発明に係る仮想通信路構築システムの具体的な構成図を説明する図である。It is a figure explaining the specific block diagram of the virtual communication path construction system which concerns on this invention. 外部プロセスのvirtqueueデバイスにおける送信用・受信用共有バッファキュー管理部2における管理データを説明する図である。この図の例では、送信用バッファキュー、受信用バッファキューはそれぞれ1つずつ。またそれぞれのサイズは省略しているがデフォルト256である。It is a figure explaining the management data in the shared buffer queue management part for transmission / reception in the virtual queue device of the external process. In the example of this figure, there is one transmission buffer queue and one reception buffer queue. Each size is omitted but default 256. 共有バッファキュー拡張用プロトコルのシグナリングの制御メッセージシーケンスとフォーマットを説明する図である。It is a figure explaining the control message sequence and format of signaling of the protocol for shared buffer queue expansion. 外部プロセス(サーバ側)の制御メッセージ受信フローチャートを説明する図である。It is a figure explaining the control message reception flowchart of an external process (server side). 外部プロセスの起動と状態シーケンスを説明する図である。It is a figure explaining starting of an external process and a state sequence. キューの操作と通知(接続先が外部プロセスの場合)を説明する図である。It is a figure explaining queue operation and notification (when a connection destination is an external process). キューの操作と通知(接続先が外部プロセスの場合)を説明する図である。It is a figure explaining queue operation and notification (when a connection destination is an external process). ゲストOS、仮想マシン、及び外部プロセスの動作パターンと状態遷移パターンを説明する図である。It is a figure explaining the operation pattern and state transition pattern of a guest OS, a virtual machine, and an external process. ベーシック認証を利用した接続を説明する図である。It is a figure explaining the connection using basic authentication. ダイジェスト認証を利用した接続を説明する図である。It is a figure explaining the connection using digest authentication. SSL認証を利用した接続を説明する図である。It is a figure explaining the connection using SSL authentication. 本発明を適用したNFVとSDNを利用した仮想BRASネットワークノードのモデルを説明する図である。It is a figure explaining the model of the virtual BRAS network node using NFV and SDN to which the present invention is applied.

添付の図面を参照して本発明の実施形態を説明する。以下に説明する実施形態は本発明の実施例であり、本発明は、以下の実施形態に制限されるものではない。なお、本明細書及び図面において符号が同じ構成要素は、相互に同一のものを示すものとする。   Embodiments of the present invention will be described with reference to the accompanying drawings. The embodiments described below are examples of the present invention, and the present invention is not limited to the following embodiments. In the present specification and drawings, the same reference numerals denote the same components.

<本発明の概要>
本発明に係る「仮想通信路構築システム及び仮想通信路構築方法」は、ゲストOSと外部プロセス間の通信路構築システムおよびその制御方法である。本発明は、仮想マシンおよび外部プロセスがそれぞれ具備する通信デバイス(通信インタフェース)への新規機能追加を対象とする(図14を参照。)。
<Outline of the present invention>
The “virtual communication path construction system and virtual communication path construction method” according to the present invention is a communication path construction system between a guest OS and an external process and a control method thereof. The present invention is directed to adding new functions to communication devices (communication interfaces) respectively included in a virtual machine and an external process (see FIG. 14).

本発明は、仮想マシン及び前記仮想マシン外に形成された外部プロセスが動作可能なホストOSを有する物理マシンと、前記仮想マシン内で動作するゲストOSに、前記仮想マシンと前記外部プロセスとを直接接続する仮想通信路を構築させる通信路構築手段と、を備える仮想通信路構築システムである。そして、前記通信路構築手段は、前記仮想マシンと前記ゲストOSとの間のデータ転送用として形成された共有バッファキューについて、メモリ操作で前記共有バッファキューのデータ転送先を前記外部プロセスへ拡張して前記仮想通信路を構築するとともに、前記ゲストOSと前記外部プロセスとの間の通信に関する手続きを実現させる共有バッファキュー拡張用プロトコル機能を有することを特徴とする。   The present invention directly connects the virtual machine and the external process to a physical machine having a virtual machine and a host OS capable of operating an external process formed outside the virtual machine, and a guest OS operating in the virtual machine. A virtual communication path construction system comprising: a communication path construction means for constructing a virtual communication path to be connected. Then, the communication path construction unit extends the data transfer destination of the shared buffer queue to the external process by a memory operation for the shared buffer queue formed for data transfer between the virtual machine and the guest OS. And a shared buffer queue expansion protocol function for constructing the virtual communication path and realizing a procedure related to communication between the guest OS and the external process.

前記物理マシンで仮想通信路構築プログラムを実行することで、前記物理マシンに仮想マシン及び前記仮想マシン外に形成される外部プロセスが動作可能なホストOSを有する物理マシン上に、前記仮想マシン及び前記外部プロセスを形成する仮想マシン形成手順と、前記仮想マシン内で動作するゲストOSに、前記仮想マシンと前記外部プロセスとを直接接続する仮想通信路を構築させる仮想通信路構築手順を実現することができる。このとき、前記仮想通信路構築手順は、前記仮想マシンと前記ゲストOSとの間のデータ転送用として形成された共有バッファキューについて、メモリ操作で前記共有バッファキューのデータ転送先を前記外部プロセスへ拡張して前記仮想通信路を構築するとともに、前記ゲストOSと前記外部プロセスとの間の通信に関する手続きを実現させる共有バッファキュー拡張ステップを有することを特徴とする。   By executing a virtual communication path construction program on the physical machine, the virtual machine and the physical machine having a host OS capable of operating an external process formed outside the virtual machine and the virtual machine on the physical machine Realizing a virtual machine formation procedure for forming an external process and a virtual communication path construction procedure for causing a guest OS operating in the virtual machine to construct a virtual communication path for directly connecting the virtual machine and the external process it can. At this time, in the virtual communication path construction procedure, with respect to the shared buffer queue formed for data transfer between the virtual machine and the guest OS, the data transfer destination of the shared buffer queue is transferred to the external process by a memory operation. The virtual communication path is expanded to construct a shared buffer queue extending step for realizing a procedure related to communication between the guest OS and the external process.

具体的にはゲストOSと仮想マシンとのデータ転送用の共有バッファキューによるデータ転送を仮想マシンの通信先である外部プロセスへ拡張し、仮想マシンと外部プロセス間での共有バッファキューのメモリ操作によりデータ送受信を実現とする。   Specifically, the data transfer by the shared buffer queue for data transfer between the guest OS and the virtual machine is extended to the external process that is the communication destination of the virtual machine, and the memory operation of the shared buffer queue between the virtual machine and the external process is performed. Data transmission / reception is realized.

前記通信路構築手段は、
前記仮想通信路の状態を検知する接続状態検知機能と、
前記仮想通信路の状態をそれぞれ前記ゲストOSと前記外部プロセス上の処理ロジックに通知する接続状態通知機能と、
それぞれの前記通信デバイスが通信断のときに定期的に通信先と再接続する再接続機能と、
をさらに有する。
The communication path construction means includes
A connection state detection function for detecting the state of the virtual communication path;
A connection status notification function for notifying the status of the virtual communication path to the processing logic on the guest OS and the external process, respectively;
A reconnection function that periodically reconnects to the communication destination when each of the communication devices is disconnected,
It has further.

前記仮想通信路構築手順は、
前記仮想通信路の状態を検知する接続状態検知ステップと、
前記仮想通信路の状態をそれぞれ前記ゲストOSと前記外部プロセス上の処理ロジックに通知する接続状態通知ステップと、
それぞれの前記通信デバイスが通信断のときに定期的に通信先と再接続する再接続ステップと、
をさらに有する。
The virtual channel construction procedure is:
A connection state detection step for detecting the state of the virtual communication path;
A connection state notification step of notifying the guest OS and the processing logic on the external process, respectively, of the state of the virtual communication path;
A reconnection step of periodically reconnecting to the communication destination when each of the communication devices is disconnected;
It has further.

共有バッファキューによる接続では、仮想マシンと外部プロセスが障害やメンテナンスなどの理由により、それぞれ独立して動作を停止させた場合も、接続相手(仮想マシンまたは外部プロセス)の動作に影響がないように(ハングアップ等が発生しないように)、仮想マシン内と外部プロセスが利用する通信デバイス(通信インタフェース)はそれぞれ次の機能を持つ。
(a)通信接続確立手続き、キューの操作モード交換手続き、バッファキューの更新通知手続き、接続終了手続きを実現する共有バッファキュー拡張用プロトコル機能
(b)通信確立中の接続状態検知機能
(c)通信確立中の接続状態通知機能
ここで、接続状態通知機能とは、通信が確立した場合に仮想マシン内部または外部プロセス内部へインタフェースアップの状態通知する機能、及び通信が切断した(またはされた)場合にインタフェースダウンの状態通知する機能である。
(d)切断状態では、再度通信先へ定期的に接続する再接続機能
In the connection using the shared buffer queue, even if the virtual machine and external process are stopped independently for reasons such as failure or maintenance, the operation of the connection partner (virtual machine or external process) is not affected. Each communication device (communication interface) used by the virtual machine and the external process has the following functions (so as not to hang up).
(A) Communication connection establishment procedure, queue operation mode exchange procedure, buffer queue update notification procedure, connection buffer detection protocol function for realizing connection termination procedure (b) Connection state detection function during communication establishment (c) Communication Established connection status notification function Here, the connection status notification function is a function for notifying the interface up status to the inside of the virtual machine or the external process when communication is established, and when communication is disconnected (or done) This is a function to notify the status of interface down.
(D) Reconnect function that periodically connects to the communication destination again in the disconnected state

さらに、本発明では次の拡張が可能である。
・外部プロセスと仮想マシン間の接続プロトコル
・他のバッファ方式
・ネットワーク以外のファイル入出力やコンソール入出力といった共有バッファキューで実現可能な入出力方式
Further, the present invention can be extended as follows.
・ Connection protocol between external process and virtual machine ・ Other buffer method ・ I / O method that can be realized by shared buffer queue such as file I / O and console I / O other than network

以下に具体的な実施例を説明する。   Specific examples will be described below.

<実施例1>
実施例1においては、親側と子側間で既に説明したVirtioで定義された共有バッファキューのオペレーションを前提とする。
<Example 1>
The first embodiment is premised on the operation of the shared buffer queue defined in the already-described description between the parent side and the child side.

(1)仮想マシンと外部プロセスとの接続構成図
図16を用いて本発明の構成について記載する。
[構成1]
本実施例の仮想通信路構築システムは、
[接続状態管理部1]11、[受信データ更新通知部1]12、[受信データバッファキュー設定部1]13、[デバイス動作・フィーチャ設定部1]14、[送信データバッファキュー設定部1]15、[送信データ更新通知部1]16及び[デバイス種別登録部1]17から構成される仮想通信デバイスを表現し、ゲストOS側に仮想通信デバイスへのアクセスとゲストOS側で作成される共有バッファキューの情報を仮想デバイス側へ伝達するための[通信デバイスインタフェース部]10と、
[通信デバイスインタフェース部]10の[受信データバッファキュー設定部1]13、[デバイス動作・フィーチャ設定部1]14及び[送信データバッファキュー設定部1]15を介して設定される共有バッファキューの送信・受信それぞれのバッファキューの種類、大きさ、個数を管理する[送信用・受信用共有バッファキュー管理部1]20と、
仮想マシン起動時に起動オプションを処理する[基本設定処理部1]30と、
[接続状態通知機能部1]41、[接続状態検知機能部1]42、[接続・通信処理基本部1]43、[共有バッファキュー拡張用プロトコル処理部1]44及び[基本設定管理部1]45からなる[通信部(クライアント)]40と、
を備えた、起動オプションに指定されるファイル記述子で指定される接続先に接続する機能を備える、仮想マシン側の[通信デバイス1]100(virtio−net−ipcデバイスと呼ぶ)、並びに
[接続状態管理部2]51、[受信データ出力部2]52、[受信データ通知部2]53、[デバイス動作・フィーチャ設定部2]54、[送信データ入力部2]55、[送信データ通知部2]56及び[デバイス種別登録部2]57から構成される、外部プロセスへ通信インタフェースを提供する、インタフェース部50と、
[受信用共有バッファキュー処理部2]61、[送信用・受信用共有バッファキュー管理部2]62及び[送信用共有バッファキュー処理部2]63からなるゲストOSで作成された共有バッファキューにメモリアクセスし、共有バッファキューを操作可能とする共有バッファキュー操作部60と、
外部プロセス起動時に起動オプションを処理する[基本設定処理部2]70と、
[接続状態通知機能部2]81、[接続状態検知機能部2]82、[接続・通信処理基本部2]83、[共有バッファキュー拡張用プロトコル処理部2]84及び[基本設定管理部2]85からなる[通信部(サーバ)]80と、
を備えた、起動オプションに指定されるファイル記述子で指定される接続先に接続する機能を備える、外部プロセス側の[通信デバイス]200
で構成される。
(1) Connection configuration diagram of virtual machine and external process The configuration of the present invention will be described with reference to FIG.
[Configuration 1]
The virtual channel construction system of the present embodiment is
[Connection state management unit 1] 11, [Reception data update notification unit 1] 12, [Reception data buffer queue setting unit 1] 13, [Device operation / feature setting unit 1] 14, [Transmission data buffer queue setting unit 1] 15, a virtual communication device composed of [transmission data update notification unit 1] 16 and [device type registration unit 1] 17 is expressed, and access to the virtual communication device on the guest OS side and sharing created on the guest OS side [Communication device interface unit] 10 for transmitting buffer queue information to the virtual device side;
[Communication device interface unit] 10 [Reception data buffer queue setting unit 1] 13, [Device operation / feature setting unit 1] 14 and [Transmission data buffer queue setting unit 1] 15 [Transmission / reception shared buffer queue manager 1] 20 for managing the type, size, and number of buffer queues for transmission and reception,
[Basic setting processing unit 1] 30 for processing a startup option when the virtual machine is started,
[Connection state notification function unit 1] 41, [Connection state detection function unit 1] 42, [Connection / communication processing basic unit 1] 43, [Shared buffer queue extension protocol processing unit 1] 44 and [Basic setting management unit 1] ] [Communication part (client)] 40 consisting of 45;
[Communication device 1] 100 (referred to as a virtual-net-ipc device) on the virtual machine side having a function of connecting to a connection destination specified by a file descriptor specified by a start option, and [Connection Status management unit 2] 51, [Reception data output unit 2] 52, [Reception data notification unit 2] 53, [Device operation / feature setting unit 2] 54, [Transmission data input unit 2] 55, [Transmission data notification unit] 2] 56 and [device type registration unit 2] 57, which provide a communication interface to an external process,
In the shared buffer queue created by the guest OS comprising the [Reception shared buffer queue processing unit 2] 61, [Transmission / reception shared buffer queue management unit 2] 62 and [Transmission shared buffer queue processing unit 2] 63 A shared buffer queue operation unit 60 that allows memory access and operation of the shared buffer queue;
[Basic setting processing unit 2] 70 for processing a start option when starting an external process;
[Connection state notification function unit 2] 81, [Connection state detection function unit 2] 82, [Connection / communication processing basic unit 2] 83, [Shared buffer queue extension protocol processing unit 2] 84, and [Basic setting management unit 2] ] [Communication unit (server)] 80 consisting of 85;
[Communication device] 200 on the external process side having a function of connecting to the connection destination specified by the file descriptor specified by the activation option.
Consists of.

[構成2]
[送信用・受信用共有バッファキュー管理部1]20は、ゲストOSに[受信データバッファキュー設定部1]13、[デバイス動作・フィーチャ設定部1]14、[送信データバッファキュー設定部1]15を提供することにより、共有バッファキュー情報をゲストOSから取得し、その情報を管理することを可能とする。
[Configuration 2]
[Transmission / Reception Shared Buffer Queue Management Unit 1] 20 is connected to the guest OS by [Reception Data Buffer Queue Setting Unit 1] 13, [Device Operation / Feature Setting Unit 1] 14, and [Transmission Data Buffer Queue Setting Unit 1]. By providing 15, the shared buffer queue information can be acquired from the guest OS and the information can be managed.

[構成3]
[通信デバイスインタフェース部]10は、ゲストOSに[接続状態管理部1]11を提供し、[接続・通信処理基本部1]43と[接続状態検知機能部1]42と[接続状態通知機能部1]41とが連携して、ゲストOSに対し、インタフェース状態のオン/オフを認識させることのできる機能を備える。
[Configuration 3]
[Communication device interface unit] 10 provides [Connection state management unit 1] 11 to the guest OS, [Connection / communication processing basic unit 1] 43, [Connection state detection function unit 1] 42, and [Connection state notification function] Unit 1] 41 cooperates with the guest OS to enable the interface state to be recognized as on / off.

[構成4]
[送信用・受信用共有バッファキュー管理部1]20と[共有バッファキュー拡張用プロトコル処理部1]44は、連携して外部プロセスに共有バッファキュー情報を提供する初期化シーケンス、設定シーケンス、更新通知シーケンス、及び終了シーケンスを実行可能なプロトコルを具備する。各シーケンスについては後述する。
[Configuration 4]
[Transmission / Reception Shared Buffer Queue Manager 1] 20 and [Shared Buffer Queue Extension Protocol Processor 1] 44 cooperate to provide an external process with shared buffer queue information, an initialization sequence, a setting sequence, and an update. A protocol capable of executing a notification sequence and an end sequence is provided. Each sequence will be described later.

[構成5]
[通信デバイスインタフェース部]10の動作が割り込み有りの場合、[受信データ更新通知部1]12、[送信データ更新通知部1]16及び[共有バッファキュー拡張用プロトコル処理部1]4420は、連携して外部プロセスにバッファキュー内容の更新の通知を更新通知シーケンスに従って実施する。
[Configuration 5]
When the operation of the [communication device interface unit] 10 is interrupted, the [reception data update notification unit 1] 12, the [transmission data update notification unit 1] 16, and the [shared buffer queue extension protocol processing unit 1] 4420 are linked. Then, the buffer queue contents are notified to the external process according to the update notification sequence.

[構成6]
[通信デバイスインタフェース部]10の動作が割り込みなし(ポーリングモード)の場合、[通信デバイス1]100は、[受信データ更新通知部1]12及び[送信データ更新通知部1]16を利用せずに仮想マシンのデバイスドライバ側がポーリングモードで動作することにより、外部プロセスとの転送データ(送受信ともに)やり取りすることができる。
[Configuration 6]
When the operation of the [communication device interface unit] 10 is no interrupt (polling mode), the [communication device 1] 100 does not use the [reception data update notification unit 1] 12 and the [transmission data update notification unit 1] 16. Furthermore, when the device driver side of the virtual machine operates in the polling mode, transfer data (both transmission and reception) can be exchanged with an external process.

[構成7]
[送信用・受信用共有バッファキュー管理部1]は、管理する共有するバッファキューの種別・個数・サイズ情報をバージョン番号にマッピングし、そのバージョン情報をもとに仮想マシンと外部プロセス間で共有バッファキューの構成情報を共有することを可能とする。
[Configuration 7]
[Transmission / Reception Shared Buffer Queue Management Unit 1] maps the type / number / size information of the shared buffer queue to be managed to the version number and shares it between the virtual machine and the external process based on the version information It is possible to share buffer queue configuration information.

[構成8]
[デバイス種別登録部1]17は、仮想マシン起動時の様々なオプション情報を処理する[基本設定処理部1]とそれら情報から共有バッファキュー種別に対応したデバイス情報を登録することができる。[基本設定管理部1]4530は、そのオプション情報すべてを管理することができる。
[Configuration 8]
The [device type registration unit 1] 17 can register [basic setting processing unit 1] that processes various option information when the virtual machine is activated and device information corresponding to the shared buffer queue type from the information. [Basic setting management unit 1] 4530 can manage all the option information.

[構成10]
[通信デバイス1]100は、仮想マシンから取得したデータ転送モード(割り込み有り/割り込み無し(ポーリングモード))やデバイスフィーチャ情報を、[送信用・受信用共有バッファキュー管理部2]62を通して、[デバイス動作・フィーチャ設定部2]54に提供することにより、共有バッファキューの動作モードとフィーチャ情報を外部プロセスに通知する。これにより外部プロセスがゲストOSと外部プロセス間の仮想通信路を認識可能となる。
[Configuration 10]
The [communication device 1] 100 sends the data transfer mode (with interrupt / without interrupt (polling mode)) and device feature information acquired from the virtual machine through the [transmit / receive shared buffer queue manager 2] 62 [ By providing the information to the device operation / feature setting unit 2] 54, the operation mode and feature information of the shared buffer queue are notified to the external process. As a result, the external process can recognize the virtual communication path between the guest OS and the external process.

[構成11]
割り込みありの動作の場合に、仮想マシンからの転送データを受信する場合、更新通知シーケンスで通知される更新通知を[共有バッファキュー拡張用プロトコル処理部2]84が処理し、[受信用共有バッファキュー処理部2]61が[受信インタフェース]に転送データを転送し、かつ、転送データがあった旨を[受信データ通知部2]53に通知する。
[Configuration 11]
In the case of an operation with an interrupt, when receiving transfer data from the virtual machine, the [shared buffer queue expansion protocol processing unit 2] 84 processes the update notification notified in the update notification sequence, and [reception shared buffer] The queue processing unit 2] 61 transfers the transfer data to the [Reception interface], and notifies the [Reception data notification unit 2] 53 that the transfer data exists.

[構成12]
割り込みなし(ポーリングモード)の動作の場合に、仮想マシンからの転送データを受信する場合、[受信用共有バッファキュー処理部2]61は、[受信データ通知部2]53を利用せずに、[受信データ出力部2]52からのデータ取得要求に従い共有バッファキュー処理を実施し、ポーリングモードで転送データを受信する。
[Configuration 12]
In the case of an operation without interruption (polling mode), when receiving transfer data from the virtual machine, [Reception Shared Buffer Queue Processing Unit 2] 61 does not use [Reception Data Notification Unit 2] 53, [Received data output unit 2] The shared buffer queue processing is performed in accordance with the data acquisition request from 52, and the transfer data is received in the polling mode.

[構成13]
割り込みありの動作の場合に、外部プロセスから仮想マシンへ転送データを送信する場合、[送信データ入力部2]55が転送データを受け取り、[送信用共有バッファキュー処理部2]63が共有バッファキュー処理を実行した後、[共有バッファキュー拡張用プロトコル処理部2]84は、仮想マシン側へ更新通知を送信し、送信データの受け取り完了通知が必要な場合は[送信データ通知部2]56を通して、処理ロジックへ通知する。
[Configuration 13]
When the transfer data is transmitted from the external process to the virtual machine in the operation with the interrupt, the [transmission data input unit 2] 55 receives the transfer data, and the [transmission shared buffer queue processing unit 2] 63 receives the shared buffer queue. After executing the processing, the [shared buffer queue extension protocol processing unit 2] 84 transmits an update notification to the virtual machine side, and if a transmission data reception completion notification is required, it passes through the [transmission data notification unit 2] 56. , Notify the processing logic.

[構成14]
割り込みなし(ポーリングモード)の動作の場合に、外部プロセスから仮想マシンからの転送データを送信する場合、[送信データ通知部2]56を利用せずに、処理ロジックから[送信データ入力部2]55へ入力された転送データについて[送信用共有バッファキュー処理部2]63が共有バッファキュー処理を実施し、[共有バッファキュー拡張用プロトコル処理部2]84は、ポーリングモードで転送データを仮想マシン側へ送信する。
[Configuration 14]
When the transfer data from the virtual machine is transmitted from an external process in the case of an operation without interruption (polling mode), the [transmission data input unit 2] is executed from the processing logic without using the [transmission data notification unit 2] 56. [Transmission shared buffer queue processing unit 2] 63 performs shared buffer queue processing on the transfer data input to 55, and [Shared buffer queue extension protocol processing unit 2] 84 transfers the transfer data to the virtual machine in the polling mode. To the side.

[構成15]
外部プロセスは、[接続・通信処理基本部2]83と[接続状態検知機能部2]82と[接続状態通知機能部2]81とが連携して、外部プロセスの処理ロジックに対し、インタフェース状態のオン/オフを認識させることのできる機能を備える。
[Configuration 15]
In the external process, the [connection / communication processing basic unit 2] 83, the [connection state detection function unit 2] 82, and the [connection state notification function unit 2] 81 cooperate to provide an interface state to the processing logic of the external process. It has a function that can recognize the on / off state.

[構成16]
[送信用・受信用共有バッファキュー管理部2]62と[共有バッファキュー拡張用プロトコル処理部2]84は、互いに連携して、初期化シーケンス、設定シーケンス、更新通知シーケンス、及び終了シーケンスを通して仮想マシンから提供される共有バッファキュー情報を取得可能なプロトコルを具備する。
[Configuration 16]
[Transmission / Reception Shared Buffer Queue Management Unit 2] 62 and [Shared Buffer Queue Extension Protocol Processing Unit 2] 84 cooperate with each other to virtually perform the initialization sequence, the setting sequence, the update notification sequence, and the end sequence. A protocol capable of acquiring shared buffer queue information provided from a machine is provided.

[構成17]
[送信用・受信用共有バッファキュー管理部2]62は、仮想マシンから受信する共有バッファキューのバージョン情報をバッファキューの種別・個数・サイズ情報に分解・マッピングして管理し、バージョン情報をもとに仮想マシンと外部プロセス間で共有バッファキューの構成情報を共有する。
[Configuration 17]
[Transmission / Reception Shared Buffer Queue Management Unit 2] 62 manages the version information of the shared buffer queue received from the virtual machine by decomposing and mapping it into the type / number / size information of the buffer queue, and managing the version information. The shared buffer queue configuration information is shared between the virtual machine and the external process.

[構成18]
[基本設定処理部2]70は、外部プロセス起動時の様々なオプション情報を処理する。[デバイス種別登録部2]57は、それら情報から共有バッファキュー種別に対応したデバイス情報を登録することができる。[基本設定管理部2]85は、オプション情報すべてを管理することができる。
[Configuration 18]
[Basic setting processing unit 2] 70 processes various option information when the external process is activated. [Device type registration unit 2] 57 can register device information corresponding to the shared buffer queue type from the information. [Basic setting management unit 2] 85 can manage all option information.

次に、図15のフローチャートと図16の各機能部の記載を交えながら、仮想通信路構築システムの動作について説明する。   Next, the operation of the virtual communication path construction system will be described with reference to the flowchart of FIG. 15 and the description of each functional unit of FIG.

(2)仮想マシンと外部プロセスとの接続方法
本発明は、仮想マシンと外部プロセス間で共有バッファキューのメモリ共有によるデータ転送を実現する手段として、それぞれの通信デバイスであるvirtio−net−ipcデバイスとvirtqueueデバイス間をIPC(Inter Process Communication)を使って接続を実現する。
(2) Method for Connecting Virtual Machine and External Process The present invention provides a virtual-net-ipc device as a communication device as means for realizing data transfer by sharing a shared buffer queue between a virtual machine and an external process. And the virtual queue device are connected using IPC (Inter Process Communication).

IPCでは実装方法として多種多様に存在するが、実施例1では、多くのOSで対応しているソケット(または、UNIX(登録商標)ドメインソケットとする)を利用する。ソケットでは、ファイル記述子を利用して接続を確立する。   In IPC, there are a wide variety of mounting methods. In the first embodiment, a socket (or a UNIX (registered trademark) domain socket) supported by many OSs is used. A socket establishes a connection using a file descriptor.

仮想マシン側は、クライアントとして動作する。仮想マシンは起動時に引数として、外部プロセスと接続する仮想マシンの仮想ネットワークデバイスとしてvirtio−netデバイスの識別子、外部プロセスへの接続に利用するファイル記述子(ここでは、socketpathとする)、外部プロセスへの再接続インターバル(ここでは、cintervalとする。)、仮想マシンと外部プロセスの組み合わせを一意に認識するためのノードIDの4つの引数を組み合わせとして起動する(図15のS101)。クライアントノード名はオプションである。
(参2)[仮想マシンの起動時引数]

Figure 0005960186
The virtual machine side operates as a client. As a virtual machine, the virtual machine device is connected to the external process as a virtual network device identifier as a virtual network device identifier, a file descriptor used for connection to the external process (here, socketpath), and the external process. And a reconnection interval (in this case, “interval”), and a combination of four arguments of node IDs for uniquely recognizing a combination of a virtual machine and an external process (S101 in FIG. 15). The client node name is optional.
(Reference 2) [Virtual machine startup arguments]
Figure 0005960186

起動後、[基本設定処理部1]において、virtio−netデバイスの識別子と、socketpath記述子(ファイルパス)とを両方確認し、両方が設定されていた場合は、[デバイス種別登録部1]17に対し、virtio−netデバイスとして登録する。一方で、外部接続先をソケットとするvirtio−net−ipcデバイスとして[基本設定管理部1]45に登録する(図15のS102)。また、起動オプションはすべて、[基本設定管理部1]45に情報登録される。   After startup, the [basic setting processing unit 1] checks both the identifier of the virtual-net device and the socket path descriptor (file path). If both are set, [device type registration unit 1] 17 Is registered as a virtual-net device. On the other hand, it is registered in [basic setting management unit 1] 45 as a virtual-net-ipc device having an external connection destination as a socket (S102 in FIG. 15). All activation options are registered in the [basic setting management unit 1] 45.

ここで、ゲストOSが起動していなければゲストOSを起動させる(図15のS121)。ゲストOSは、物理マシンのメモリ内に共有バッファキュー用の領域を確保する(図15のS122)。ゲストOSは、仮想マシンとの間で共有バッファキューの情報及び通信デバイスの機能(フィーチャ)について交換を実施し(図15のS123)、起動を完了する(図15のS124)。   If the guest OS is not activated, the guest OS is activated (S121 in FIG. 15). The guest OS secures an area for the shared buffer queue in the physical machine memory (S122 in FIG. 15). The guest OS exchanges the information of the shared buffer queue and the function (feature) of the communication device with the virtual machine (S123 in FIG. 15), and completes the activation (S124 in FIG. 15).

仮想マシン起動後、外部プロセスとの接続が確立し、後述する設定が正しく完了するまでは、ゲストOSに仮想デバイスの状態を通知する[接続状態管理部1]11ではインタフェースはダウンの状態のままである。   After the virtual machine is started, until the connection with the external process is established and the setting described later is correctly completed, the interface remains down in the [connection state management unit 1] 11 that notifies the guest OS of the state of the virtual device. It is.

仮想マシンは起動時、[デバイス種別登録部1]17にvirtio−netデバイスとして登録することで、ゲストOS側からはvirtio−netデバイスとして認識するため、ゲストOS側では起動時にvirtio−netデバイスに対応したvirtio−netドライバを起動させる(しかし、仮想マシンの通信デバイスとしてはvirtio−net−ipcデバイスとして動作する)(図15のS102))。   The virtual machine is registered as a virtual-net device in the [device type registration unit 1] 17 at startup, so that the guest OS recognizes it as a virtual-net device. The corresponding virtual-net driver is activated (but operates as a virtual-net-ipc device as a virtual machine communication device) (S102 in FIG. 15)).

[デバイス種別登録部1]17へ登録が完了した後、[基本設定管理部1]45に設定されたsocketpathが示すファイルパスを[接続・通信処理基本部1]43に設定し、接続先を登録することにより(図15のS103)、接続を試みる(図15のS104)。   After registration in [device type registration unit 1] 17 is completed, the file path indicated by the socket path set in [basic setting management unit 1] 45 is set in [connection / communication processing basic unit 1] 43, and the connection destination is set. By registering (S103 in FIG. 15), connection is attempted (S104 in FIG. 15).

外部プロセスが接続不能な状態の場合(図15のS105において“No”)、仮想マシンの起動オプションで指定された時間待ち(図15のS114)、再度接続を試みる(図15のS104)。   When the external process cannot be connected (“No” in S105 in FIG. 15), it waits for the time specified by the virtual machine activation option (S114 in FIG. 15) and tries to connect again (S104 in FIG. 15).

外部プロセスが接続可能な状態の場合(図15のS105において“Yes”)、socketpathに従って直接ソケットを介して[接続・通信処理基本部1]43により接続が確立する。以後、外部プロセスとは図18に示す通りのシーケンスをフェーズに従って実施する(図15のS106)。また、仮想マシンのvirtio−net−ipcデバイスと外部プロセスのvirtqueueデバイス間のメッセージ交換においては、図18に示す制御メッセージフォーマットを利用する。   If the external process is in a connectable state (“Yes” in S105 in FIG. 15), the connection is established by the [connection / communication processing basic unit 1] 43 via a direct socket according to socketpath. Thereafter, with the external process, the sequence as shown in FIG. 18 is executed according to the phase (S106 in FIG. 15). In the message exchange between the virtual-net-ipc device of the virtual machine and the virtual queue device of the external process, the control message format shown in FIG. 18 is used.

[共有バッファキュー拡張用プロトコル処理部1]44は、[基本設定管理部1]45によりノードID、クライアントノード名(オプション)と、[送信用・受信用共有バッファキュー管理部1]からバッファキューの構成を示すバージョン番号から、初期化メッセージを構成し、[接続・通信処理基本部1]43を介して、仮想マシン側から外部プロセス側へ送信する(図15のS106))。   The [shared buffer queue extension protocol processing unit 1] 44 receives the node ID and client node name (option) from the [basic setting management unit 1] 45, and the buffer queue from the [transmission / reception shared buffer queue management unit 1]. An initialization message is configured from the version number indicating the configuration of the above, and is transmitted from the virtual machine side to the external process side via the [connection / communication processing basic unit 1] 43 (S106 in FIG. 15)).

以下、仮想マシン側のvirtio−net−ipcデバイスをクライアント、外部プロセス側のvirtqueueデバイスをサーバとも呼ぶ。
(参3)[初期化メッセージ]

Figure 0005960186
Hereinafter, the virtual-net-ipc device on the virtual machine side is also called a client, and the virtual queue device on the external process side is also called a server.
(Reference 3) [Initialization message]
Figure 0005960186

サーバは、クライアントからの制御メッセージ(初期化メッセージ)を受信できる状態へ遷移し、制御メッセージの受信を開始する(図19のS201、S202)。   The server makes a transition to a state in which a control message (initialization message) from the client can be received, and starts receiving the control message (S201 and S202 in FIG. 19).

サーバ側はクライアントと同様に、[接続・通信処理基本部2]83を介して、[共有バッファキュー拡張用プロトコル処理部2]84により、制御メッセージが処理され、メッセージ種別が初期化メッセージであることを確認し、バージョン番号とノードIDを確認する(図19のS203)。   On the server side, like the client, the control message is processed by the [shared buffer queue extension protocol processing unit 2] 84 via the [connection / communication processing basic unit 2] 83, and the message type is the initialization message. The version number and the node ID are confirmed (S203 in FIG. 19).

外部プロセスも後述の通り、起動時に[基本設定処理部2]を介して、[基本設定管理部2]85でノードIDが管理されているため、外部プロセスのvirtqueueデバイスの持っているノードIDとサポートするバージョン番号を比較する(図15のS107、図19のS203)。   As will be described later, since the node ID is managed by the [basic setting management unit 2] 85 via the [basic setting processing unit 2] at the time of startup, the external process also has the node ID possessed by the virtual queue device of the external process. The supported version numbers are compared (S107 in FIG. 15 and S203 in FIG. 19).

ノードIDとバージョン番号の2つの情報がマッチしていれば(図15のS107において“Yes”、図19のS203において“Yes”)、設定メッセージおよび終了メッセージ受信状態へ遷移する(図15のS108及び図19のS204)。一方、ノードIDとバージョン番号の2つの情報がマッチしていなければ(図15のS107において“No”、図19のS203において“No”)、接続が確立しないため(図19のS211)、クライアント側は再接続状態へ遷移する(図15のS114)。再接続は、[基本設定管理部1]45で管理されるcinterval値を確認し、その値の時間間隔で再接続を繰り返し試行する(cintervalが0またはマイナス値に設定されていれば、再接続は繰り返さない)。   If the two information of the node ID and version number match (“Yes” in S107 in FIG. 15 and “Yes” in S203 in FIG. 19), the state transits to the setting message and end message reception state (S108 in FIG. 15). And S204 in FIG. 19). On the other hand, if the two pieces of information of the node ID and the version number do not match (“No” in S107 of FIG. 15, “No” in S203 of FIG. 19), the connection is not established (S211 of FIG. 19). The side transitions to the reconnection state (S114 in FIG. 15). For reconnection, confirm the cinterval value managed by the [basic setting management unit 1] 45, and repeatedly try reconnection at the time interval of the value (if cinterval is set to 0 or a negative value, reconnection is performed. Does not repeat).

初期化メッセージ処理が正常に終了すると(図15のS108)、仮想マシン側は設定メッセージを送信するフェーズに移行する。また、外部プロセス側は、設定メッセージである制御メッセージを受信するフェーズへ移行する。   When the initialization message processing ends normally (S108 in FIG. 15), the virtual machine side proceeds to a phase for sending a setting message. Further, the external process side proceeds to a phase of receiving a control message that is a setting message.

設定メッセージでは、初期化メッセージで利用した情報に加え、ゲストOSから提供される共有バッファキューにアクセスするためのアドレス情報が必要となる。よって、ゲストOSが起動しているか否かを確認する(図15のS109)。具体的には、[共有バッファキュー拡張用プロトコル処理部1]44は[送信用・受信用共有バッファキュー管理部1]にゲストOSから設定される共有バッファキューの種別・先頭アドレス・個数・サイズが設定されているかどうか問い合わせる。   In the setting message, in addition to the information used in the initialization message, address information for accessing the shared buffer queue provided from the guest OS is required. Therefore, it is confirmed whether or not the guest OS is activated (S109 in FIG. 15). Specifically, the [shared buffer queue extension protocol processing unit 1] 44 sets the type, head address, number, and size of the shared buffer queue set by the guest OS in the [transmission / reception shared buffer queue management unit 1]. Queries whether is set.

当該事項が設定されていなければ(図15のS109において“No”)、ゲストOSが起動していないと判断して、[送信用・受信用共有バッファキュー管理部1]からの共有バッファキューの設定完了通知を待つ(図15のS110、S110)。当該事項の設定が完了していれば(図15のS109において“Yes”)、ゲストOSからの共有バッファキューの先頭アドレス情報を取得できるため、[共有バッファキュー拡張用プロトコル処理部1]44はそれら情報を設定メッセージに追加して、外部プロセス(サーバ側)へ下記の内容で設定メッセージを送信する(図15のS112)。
(参4)[設定メッセージ]

Figure 0005960186
If the item is not set (“No” in S109 in FIG. 15), it is determined that the guest OS is not activated, and the shared buffer queue of the transmission / reception shared buffer queue management unit 1 is determined. Wait for the setting completion notification (S110, S110 in FIG. 15). If the setting of the item has been completed (“Yes” in S109 in FIG. 15), the shared buffer queue start address information from the guest OS can be acquired. The information is added to the setting message, and the setting message is transmitted to the external process (server side) with the following contents (S112 in FIG. 15).
(Reference 4) [Setting message]
Figure 0005960186

[送信用・受信用共有バッファキュー管理部1]への共有バッファキューの情報登録はゲストOS側から、[受信データバッファキュー設定部1]13を介して受信バッファキューの個数とサイズの情報が、[デバイス動作・フィーチャ設定部1]14を介してデバイスフィーチャやデバイスの動作モード(割り込み有りか無し)が、[送信データバッファキュー設定部1]15を介して送信バッファキューの個数とサイズが、それぞれ実施される。   Information on the number and size of the reception buffer queue is registered from the guest OS side via the [Reception data buffer queue setting unit 1] 13 from the guest OS side. [Device operation / feature setting unit 1] 14 through the device feature and device operation mode (with or without interruption), and [Transmission data buffer queue setting unit 1] 15 through the number and size of transmission buffer queues. , Respectively.

サーバ側は設定メッセージを受信する(図19のS205)と、初期化メッセージと同様に、[接続・通信処理基本部2]83を介して、[共有バッファキュー拡張用プロトコル処理部2]84にて、バージョン番号、ノードID、メッセージ種別を確認する(図19のS206、S207)。   When the server receives the setting message (S205 in FIG. 19), the [connection / communication processing basic unit 2] 83 passes through the [shared buffer queue extension protocol processing unit 2] 84 via the [connection / communication processing basic unit 2] 83 in the same manner as the initialization message. The version number, node ID, and message type are confirmed (S206 and S207 in FIG. 19).

受信した制御メッセージのノードIDとバージョン番号がマッチしなければ(図19のS206において“No”)、接続を切断する(図19のS211)。受信した制御メッセージのノードIDとバージョン番号がマッチすれば(図19のS206において“Yes”)、制御メッセージが設定メッセージであるか否かを確認する(図19のS207)。   If the node ID and the version number of the received control message do not match (“No” in S206 of FIG. 19), the connection is disconnected (S211 of FIG. 19). If the node ID and the version number of the received control message match (“Yes” in S206 in FIG. 19), it is confirmed whether or not the control message is a setting message (S207 in FIG. 19).

制御メッセージが設定メッセージである場合(図19のS207において“Yes”)、共有バッファキューのアドレス情報、virtio−net−ipcデバイスのフィーチャ情報、動作モードを確認し(図19のS209)、値がセットされ、かつ動作モードについては割り込み有効か無効どちらかの値が設定されていれば、設定を完了する(図19のS210)。   When the control message is a setting message (“Yes” in S207 in FIG. 19), the address information of the shared buffer queue, the feature information of the virtual-net-ipc device, and the operation mode are confirmed (S209 in FIG. 19). If the value is set and the interrupt is enabled or disabled for the operation mode, the setting is completed (S210 in FIG. 19).

これら情報は、サーバ側の[送信用・受信用共有バッファキュー管理部2]62に管理される。このとき、バージョン番号に対応する、バッファキュー種別(virtioキュー)と、バッファキュー先頭アドレス、送信バッファキューの個数とサイズ情報、受信バッファキューの個数とサイズ情報とに分解されて登録される(図17)。このバージョン情報については後述の(3)で説明する。   These pieces of information are managed by the [transmission / reception shared buffer queue management unit 2] 62 on the server side. At this time, a buffer queue type (virtual queue) corresponding to the version number, a buffer queue head address, the number and size information of transmission buffer queues, and the number and size information of reception buffer queues are decomposed and registered (FIG. 17). This version information will be described later in (3).

なお、メッセージ種別が設定メッセージ以外で終了メッセージでない場合(図19のS207において“No”、S208において“No”)、及び共有バッファキューのアドレス情報、virtio−net−ipcデバイスのフィーチャ情報、動作モードが含まれていない場合(図19のS209において“No”)は、設定メッセージの受信を待つ(図19のS204)。また、図19のS208でメッセージ種別が終了メッセージであれば、接続を切断する。   When the message type is not a setting message and is not an end message (“No” in S207 of FIG. 19, “No” in S208), address information of the shared buffer queue, feature information of the virtual-net-ipc device, and operation mode Is not included (“No” in S209 of FIG. 19), the reception of a setting message is awaited (S204 of FIG. 19). If the message type is an end message in S208 of FIG. 19, the connection is disconnected.

これらの情報を使い、[送信用・受信用共有バッファキュー管理部2]62では、さらに仮想マシン上のゲストOSの共有バッファキューにアクセスするために、メモリマッピングを使い、内部で共有バッファキュー管理用変数として、送信用バッファキュー変数と受信用バッファキュー変数にそれぞれアドレス情報をマッピングさせる(図17)。   Using these pieces of information, the [sending / receiving shared buffer queue manager 2] 62 uses memory mapping to access the shared buffer queue of the guest OS on the virtual machine, and internally manages the shared buffer queue. As transmission variables, address information is mapped to transmission buffer queue variables and reception buffer queue variables, respectively (FIG. 17).

仮想マシン側は設定メッセージの結果の応答を受け(図18、図19)、[共有バッファキュー拡張用プロトコル処理部1]44は[接続状態通知機能部1]41を介して、[接続状態管理部1]11にリンクアップ状態を登録する。これにより、ゲストOSは通信デバイス(virtio−net−ipcデバイス)のリンクアップを認識する(図15のS113)。なお、ゲストOSは、リンクアップ状態を確認する際に(図15のS125)、リンクアップの登録が無ければ、仮想マシンがリンクアップ登録するまで待つ(図15のS127、S128)。   The virtual machine side receives the response of the result of the setting message (FIGS. 18 and 19), and the [shared buffer queue extension protocol processing unit 1] 44 [connection state management function] 1 via the [connection state notification function unit 1] 41 Part 1] 11 to register the link-up state. Thereby, the guest OS recognizes the link-up of the communication device (virtio-net-ipc device) (S113 in FIG. 15). Note that when checking the link-up state (S125 in FIG. 15), the guest OS waits until the virtual machine performs link-up registration if there is no link-up registration (S127 and S128 in FIG. 15).

外部プロセス側も同様に設定完了後、[共有バッファキュー拡張用プロトコル処理部2]84は[接続状態通知機能部2]81を介して、リンクアップ状態を登録する。これにより、通信デバイス(virtqueueデバイス)の状態をリンクダウン状態からリンクアップ状態に切り替え、外部プロセスの処理ロジックからデータ通信可能な状態へ切り替える。外部プロセス側の設定については後述の(7)で説明する。   Similarly, after the setting is completed on the external process side, the [shared buffer queue expansion protocol processing unit 2] 84 registers the link-up state via the [connection state notification function unit 2] 81. As a result, the state of the communication device (virtqueue device) is switched from the link-down state to the link-up state, and the processing logic of the external process is switched to a state where data communication is possible. The setting on the external process side will be described in (7) described later.

(3)バージョン番号の解釈について
バージョン番号は、「バッファキュー種別」、「キューの個数」、「それぞれキューのサイズ」の組み合わせで表現される。キューは送信用、受信用ともに同じ個数であり、且つそれぞれのキューサイズも同一とする。
(3) Interpretation of version number The version number is expressed by a combination of “buffer queue type”, “number of queues”, and “each queue size”. The number of queues is the same for both transmission and reception, and the queue sizes are also the same.

例えば、キュー種別4ビット、キュー個数12ビット、キューサイズ16ビットとし、‘0001’の4ビットをvirtioキュー種別に割り当てるとする。この場合、図17に記載のとおり、デフォルトのvirtioキューの構成とすると、送受信用キューは1つずつあり、サイズは256であるため、バージョン番号は次のように表現される。
(参5)[バージョン番号]

Figure 0005960186
For example, assume that the queue type is 4 bits, the queue number is 12 bits, the queue size is 16 bits, and 4 bits of “0001” are assigned to the vital queue type. In this case, as shown in FIG. 17, when the default virtue queue is configured, since there is one transmission / reception queue and the size is 256, the version number is expressed as follows.
(Reference 5) [Version number]
Figure 0005960186

(4)メッセージタイプ依存データフィールド
図18の制御メッセージフォーマットにおいて、メッセージタイプ依存データフィールドは、設定メッセージと更新通知メッセージにて以下の値で利用される。なお、フィーチャ情報は(5)に後述する。
(参6)[メッセージタイプ依存データフィールド]

Figure 0005960186
(4) Message Type Dependent Data Field In the control message format of FIG. 18, the message type dependent data field is used with the following values in the setting message and the update notification message. The feature information will be described later in (5).
(Reference 6) [Message type dependent data field]
Figure 0005960186

(5)Virtio−net−ipcデバイスのフィーチャ情報と動作モードの合意プロセス
フィーチャ情報は、ゲストOSのvirtio−netドライバがサポートするチェックサムオフロードなどの機能と、virtio−net−ipcデバイスがサポートする機能とがゲストOS起動時に折衝され、合意されたものが、最終的なフィーチャ情報として確立する。このフィーチャ情報はVirtioのSpecの通りであるため省略する(詳細は、非特許文献1を参照。)。
(5) Feature information of virtual-net-ipc device and consensus process of operation mode Feature information is supported by functions such as checksum offload supported by virtual-net driver of guest OS and virtual-net-ipc device. Functions are negotiated when the guest OS is started, and what is agreed upon is established as final feature information. This feature information is the same as the spec of Virio, and is therefore omitted (see Non-Patent Document 1 for details).

このフィーチャ情報の合意はゲストOSと仮想マシンと外部プロセス3者が同時に実施可能であればよいが、ゲストOSと仮想マシン間の合意が優先されるため、ゲストOSと仮想マシン間で初期に合意した情報をバージョン情報に変換し、外部プロセスに一方的に強制することで3者合意プロセスをスキップしている。よって、外部プロセス側はすべてのフィーチャに対応することを前提としている。   This feature information agreement is acceptable as long as the guest OS, virtual machine, and external process can be executed at the same time. However, since the agreement between the guest OS and the virtual machine takes precedence, the agreement between the guest OS and the virtual machine is initially agreed. The three-party agreement process is skipped by converting the converted information into version information and unilaterally forcing it to an external process. Thus, it is assumed that the external process side supports all features.

一方、動作モードについては、親側から子側へのavailリング更新通知の有効/無効、子側から親側へのusedリング更新通知の有効/無効の設定が可能である。更新通知がオフの場合は、相手側がポーリングモードで動作し、更新通知なしで自発的に転送データを回収することを示す。仮想マシンのvirtio−net−ipcデバイス、ゲストOSのvirtio−netドライバ、外部プロセスのvirtqueueデバイスは両モードに対応している。この更新通知は、ゲストOSと仮想マシン、仮想マシンと外部プロセスの2区間で発生するが、virtio−net−ipcデバイスとvirtio−netドライバ、virtqueueデバイスは両モードに対応しているため、別々に設定が可能である。しかし、本発明では、ゲストOSと仮想マシン間で折衝し合意した動作モードを外部プロセスにそのまま伝達することとしている。つまり2区間とも同じ動作になる。   On the other hand, the operation mode can be set to enable / disable the avail ring update notification from the parent side to the child side and enable / disable the used ring update notification from the child side to the parent side. When the update notification is off, it indicates that the other party operates in the polling mode and collects transfer data spontaneously without an update notification. The virtual machine's virtual-net-ipc device, the guest OS's virtual-net driver, and the external process's virtual queue device support both modes. This update notification occurs in the two sections of guest OS and virtual machine, virtual machine and external process, but the virtual-net-ipc device, the virtual-net driver, and the virtual queue device are compatible with both modes. Setting is possible. However, in the present invention, the operation mode negotiated and agreed between the guest OS and the virtual machine is directly transmitted to the external process. That is, the same operation is performed in both sections.

(6)仮想マシンと外部プロセスとの切断方法
上記(2)において、仮想マシンと外部プロセスとの接続後、仮想マシン側の[共有バッファキュー拡張用プロトコル処理部1]44または外部プロセス側の[共有バッファキュー拡張用プロトコル処理部2]84からそれぞれ[接続・通信処理基本部1]43、[接続・通信処理基本部2]83を介して、終了メッセージを相手に送付することにより、切断を実現する。このとき、外部プロセスは、図19の初期化メッセージや設定メッセージと同様に、バージョン番号、ノードIDを確認する(図19のS206)。これらがマッチしていれば、接続終了状態となる(図19のS207、S208、図15のS115、図20のS312)。
(6) Method for Disconnecting Virtual Machine from External Process In (2) above, after the connection between the virtual machine and the external process, [Shared Buffer Queue Extension Protocol Processing Unit 1] 44 on the virtual machine side or [ Disconnection is sent from the shared buffer queue extension protocol processing unit 2] 84 to the other party via the [connection / communication processing basic unit 1] 43 and the [connection / communication processing basic unit 2] 83, respectively. Realize. At this time, the external process confirms the version number and the node ID in the same manner as the initialization message and setting message in FIG. 19 (S206 in FIG. 19). If they match, the connection is terminated (S207 and S208 in FIG. 19, S115 in FIG. 15, and S312 in FIG. 20).

仮想マシン側は切断状態に遷移した場合、仮想マシン側が動作していれば再度接続を試みる(図15のS104)が、仮想マシン自体が終了してしまった場合は当然、再接続は実施しない。   When the virtual machine side transitions to the disconnected state, if the virtual machine side is operating, connection is attempted again (S104 in FIG. 15). However, if the virtual machine itself is terminated, naturally reconnection is not performed.

外部プロセス側も同様であり、外部プロセスが動作していれば接続待ち状態となるが(図20のS303)、外部プロセス自体終了していれば再接続待ち状態にはならず、そのまま終了する。   The same applies to the external process side. If the external process is operating, the connection wait state is entered (S303 in FIG. 20), but if the external process itself is terminated, the reconnection wait state is not entered, and the process is terminated.

(7)外部プロセスの起動シーケンス
外部プロセスは、通信デバイスとしてvirtqueueデバイスをインタフェースとして起動する(図16)。
(7) External Process Startup Sequence The external process starts up using a virtualqueue device as an interface as a communication device (FIG. 16).

virtqueueデバイスは子側の共有バッファキューのオペレーション機能を図16に記載の、[受信用共有バッファキュー処理部2]61と[送信用・受信用共有バッファキュー管理部2]62と[送信用共有バッファキュー処理部2]63により有し、動作モードは前述の通り、割り込みモード及びポーリングモードをサポートするものである。   The virtual queue device has the operation function of the shared buffer queue on the child side as shown in FIG. 16, [Reception Shared Buffer Queue Processing Unit 2] 61, [Transmission / Reception Shared Buffer Queue Management Unit 2] 62, and [Transmission Shared]. The buffer queue processing unit 2] 63 has an operation mode that supports the interrupt mode and the polling mode as described above.

外部プロセスの起動シーケンスは図20のとおりである。外部プロセスの起動は仮想マシンやゲストOSとは独立である。外部プロセスは起動指示に従って、起動を完了させる(図20のS310、S311)とともに、通信デバイスとのリンクアップを開始する。   The startup sequence of the external process is as shown in FIG. The activation of the external process is independent of the virtual machine or guest OS. The external process completes the activation in accordance with the activation instruction (S310, S311 in FIG. 20) and starts linkup with the communication device.

外部プロセス起動時、virtqueueデバイス識別子と仮想マシン起動時と同様に接続先としてsocketpath、さらに接続の対を認識するためのノードIDの3つの引数が渡される(図20のS301)。サーバのノード名はオプションである。
(参7)[外部プロセスの起動オプション]

Figure 0005960186
When an external process is activated, a virtual queue device identifier and socketpath as a connection destination are passed as in the case of activation of a virtual machine, and further, a node ID for recognizing a connection pair is passed (S301 in FIG. 20). The server node name is optional.
(Reference 7) [External process startup options]
Figure 0005960186

外部プロセスはこれらの起動オプション情報を指定されると、図16の外部プロセス側に記載の[基本設定処理部2]はこれらのパラメータを識別し、[基本設定管理部2]85に登録する。そして、[デバイス種別登録部2]57に登録し、デバイス種別が外部プロセス側の処理ロジックから認識できるようにする(図20のS302)。   When the external process is designated with these startup option information, the [basic setting processing unit 2] described on the external process side in FIG. 16 identifies these parameters and registers them in the [basic setting management unit 2] 85. Then, the device type is registered in [device type registration unit 2] 57 so that the device type can be recognized from the processing logic on the external process side (S302 in FIG. 20).

次に、[基本設定処理部2]はsocketpathで示されるファイルパスを[接続・通信処理基本部2]83に設定し、[接続・通信処理基本部2]83は仮想マシン側からの接続待ち状態で起動する(図20のS303)。この状態では、外部プロセスの処理ロジックで確認することのできる[接続状態管理部2]51においてインタフェースはダウンの状態のままである。   Next, [basic setting processing unit 2] sets the file path indicated by socketpath in [connection / communication processing basic unit 2] 83, and [connection / communication processing basic unit 2] 83 waits for a connection from the virtual machine side. It starts in a state (S303 in FIG. 20). In this state, the interface remains down in the [connection state management unit 2] 51 that can be confirmed by the processing logic of the external process.

図20のS304のとおり、仮想マシンからの接続があると、[接続・通信処理基本部2]83を介して、[共有バッファキュー拡張用プロトコル処理部2]84が初期メッセージを識別し、メッセージタイプが初期化メッセージで、且つ、ノードIDが[基本設定管理部2]85で管理するノードIDと等しく、サポートしているバージョンであるかと確認する(図20のS305)。   As shown in S304 of FIG. 20, when there is a connection from the virtual machine, the [shared buffer queue extension protocol processing unit 2] 84 identifies the initial message via the [connection / communication processing basic unit 2] 83, and the message It is confirmed that the type is an initialization message and the node ID is the same as the node ID managed by the [basic setting management unit 2] 85 and is a supported version (S305 in FIG. 20).

条件が満たされていない場合、サーバ側は再接続状態へ遷移する(図20のS305において“No”)。条件が満たされている場合、初期化メッセージ処理が正常に終了し、接続が確立する(図20のS306)。仮想マシン側は設定メッセージを送信するフェーズに移行し、外部プロセスは、設定メッセージ受信フェーズへ移行する(図19のS204)。   If the condition is not satisfied, the server side transitions to a reconnection state (“No” in S305 of FIG. 20). If the condition is satisfied, the initialization message process ends normally and the connection is established (S306 in FIG. 20). The virtual machine side shifts to a phase for sending a setting message, and the external process shifts to a setting message reception phase (S204 in FIG. 19).

その後、仮想マシン側からの設定メッセージを待ち受ける(図20のS307、S308)。設定メッセージにおいても同様に、メッセージタイプとノードIDとバージョン番号を確認し、マッチしていれば、設定メッセージに含まれる、バージョン番号、共有バッファキューのアドレス情報、virtio−net−ipcデバイスのフィーチャ情報、動作モードを確認し、値がセットされ、かつ動作モードについては割り込み有効か無効どちらかの値が設定されていれば、設定を完了する(図19のS210、図20のS309)。これらの設定内容は[共有バッファキュー拡張用プロトコル処理部2]84から[送信用・受信用共有バッファキュー管理部2]62に設定・登録される。   Thereafter, it waits for a setting message from the virtual machine side (S307 and S308 in FIG. 20). Similarly, in the setting message, the message type, the node ID, and the version number are confirmed. If they match, the version number, the shared buffer queue address information, and the feature information of the virtual-net-ipc device are included in the setting message. When the operation mode is confirmed, a value is set, and the interrupt is enabled or disabled for the operation mode, the setting is completed (S210 in FIG. 19 and S309 in FIG. 20). These setting contents are set / registered from [Shared Buffer Queue Extension Protocol Processing Unit 2] 84 to [Transmission / Reception Shared Buffer Queue Management Unit 2] 62.

その後、[送信用・受信用共有バッファキュー管理部2]62では、登録内容を確認し、バージョン番号と共有バッファキューのアドレス情報より、図17に記載のとおり、共有バッファキューを管理するための各種変数と作成する。本内容は上記(2)に説明済みであるため詳説を割愛する。   Thereafter, the [transmission / reception shared buffer queue management unit 2] 62 confirms the registered contents, and manages the shared buffer queue as shown in FIG. 17 from the version number and the address information of the shared buffer queue. Create with various variables. Since this content has already been described in (2) above, a detailed description is omitted.

共有バッファキューの管理情報が[送信用・受信用共有バッファキュー管理部2]62にて作成されると、[接続状態通知機能部2]81を通して、[接続状態管理部2]51にリンクアップ状態を登録する。   When the shared buffer queue management information is created in [transmission / reception shared buffer queue management unit 2] 62, it is linked up to [connection state management unit 2] 51 through [connection state notification function unit 2] 81 Register the state.

これを受け、外部プロセスは通信デバイスが利用可能状態になったことを認識する。   In response, the external process recognizes that the communication device has become available.

(8)仮想マシンと外部プロセス接続後のゲストOSから外部プロセスへのデータ送受信について(共有バッファキューの操作について)
共有バッファキューの操作については、virtioをベースとするため、従来の技術の<Virtioキューの操作>で説明したものと全く同じである。本発明により、キュー操作の子側の実施者が、仮想マシン上の通信デバイスから図16に記載の外部プロセス上のvirtqueueデバイスに切り替わったと考えることができる。
(8) Data transmission / reception from the guest OS to the external process after connecting the virtual machine to the external process (Operation of shared buffer queue)
Since the operation of the shared buffer queue is based on “virtio”, it is exactly the same as that described in the <Operation of Virtual Queue> in the prior art. According to the present invention, it can be considered that the implementer on the child side of the queue operation has switched from the communication device on the virtual machine to the virtualqueue device on the external process illustrated in FIG.

ただし、動作モードが割り込み有りの場合の共有バッファキューの更新通知はvirtio−net−ipcデバイスとvirtqueueデバイス間のソケットを経由するため、共有バッファキューの通常のオペレーションに手順が1つ多くなる。つまり、動作モードにおいて、割り込みが有効である場合、図18のとおり、共有バッファキューの更新通知が仮想マシン側と外部プロセス側間で送付することになる(図21)。   However, since the shared buffer queue update notification when the operation mode is interrupted passes through the socket between the virtual-net-ipc device and the virtualqueue device, one procedure is added to the normal operation of the shared buffer queue. In other words, when the interrupt is valid in the operation mode, as shown in FIG. 18, a shared buffer queue update notification is sent between the virtual machine side and the external process side (FIG. 21).

一方、動作モードが割り込み無効である場合は、図18に示す更新通知は発生しない。virtio−net−ipcデバイスとvirtqueueデバイスにてポーリングモードで動作し、キューのアップデートが有った場合自発的にアップデートのあったキューの転送データを回収する(図22)。   On the other hand, when the operation mode is disabled, the update notification shown in FIG. 18 does not occur. The virtual-net-ipc device and the virtualqueue device operate in a polling mode, and when there is a queue update, the transfer data of the queue that has been updated spontaneously is collected (FIG. 22).

<割り込みモードの場合の処理>
(ゲストOSから仮想マシンを通して、外部プロセスへ送信する場合)
図16と図21を利用し説明する。
<Processing in interrupt mode>
(When sending from a guest OS to an external process through a virtual machine)
This will be described with reference to FIGS. 16 and 21. FIG.

1.availにディスクリプタを積む
ゲストOSはavailに送信データをディスクリプタに入れて積む
2.仮想マシンへ通知
ゲストOSは仮想マシンの通信デバイスへ通知。つまり、virtio−net−ipcデバイスの[共有バッファキュー拡張用プロトコル処理部1]44は[送信データ更新通知部1]16を通じて、更新があった旨を把握する。
3.外部プロセスへ通知
virtio−net−ipcデバイスは外部プロセスへ通知する。つまり、[共有バッファキュー拡張用プロトコル処理部1]44は、外部プロセスのvirtqueueデバイスへ送信用キューのavailの更新通知メッセージを送信。
4.外部プロセスは更新通知を受信し、availを確認し、ディスクリプタを回収
(a)virtqueueデバイスの[共有バッファキュー拡張用プロトコル処理部2]84において、更新メッセージ内の受信用キューの更新であることを知る。
(b)[共有バッファキュー拡張用プロトコル処理部2]84は[受信用共有バッファキュー処理部2]61に更新通知を知らせる。
(c)[受信用共有バッファキュー処理部2]61は更新のあった、ディスクリプタを回収し、[受信データ通知部2]53に受信したことを通知する。
(d)処理ロジックからは、[受信データ出力部2]52を通して、データを取得できるようになる
5.usedに回収したディスクリプタを積む
[受信用共有バッファキュー処理部2]61は[共有バッファキュー拡張用プロトコル処理部2]84にusedに回収したディスクリプタを積んだことを知らせる。
6.usedのアップデートを通知
[共有バッファキュー拡張用プロトコル処理部2]84は更新メッセージを仮想マシン側のvirtio−net−ipcデバイスに送信。
7.ゲストOSへusedのアップデートを通知
virtio−net−ipcデバイスの[共有バッファキュー拡張用プロトコル処理部1]44が更新メッセージを受信し、[送信データ更新通知部1]16にusedのアップデートを通知。
8.usedから外部プロセスが積んだディスクリプタを回収
ゲストOSは[送信データ更新通知部1]16により、更新通知を受信し、usedから外部プロセスが積んだディスクリプタを回収する。
1. 1. The descriptor is loaded on avail. The guest OS puts the transmission data on the avail and puts it in the descriptor. Notification to virtual machine The guest OS notifies the communication device of the virtual machine. That is, the [shared buffer queue expansion protocol processing unit 1] 44 of the virtual-net-ipc device grasps that there is an update through the [transmission data update notification unit 1] 16.
3. Notification to external process The virtual-net-ipc device notifies the external process. That is, the [shared buffer queue expansion protocol processing unit 1] 44 transmits an update notification message for the availability of the transmission queue to the virtual queue device of the external process.
4). The external process receives the update notification, confirms the availability, and collects the descriptor. (A) In the [shared buffer queue extension protocol processing unit 2] 84 of the virtualqueue device, it is determined that the reception queue is updated in the update message. know.
(B) The [shared buffer queue expansion protocol processing unit 2] 84 notifies the [reception shared buffer queue processing unit 2] 61 of the update notification.
(C) [Reception shared buffer queue processing unit 2] 61 collects the updated descriptor and notifies [Reception data notification unit 2] 53 of the reception.
(D) Data can be acquired from the processing logic through the [Received data output unit 2] 52. The collected descriptor is stacked in the “used shared buffer queue processing unit 2” 61 and informs the “shared buffer queue expansion protocol processing unit 2” 84 that the descriptor that has been used is stacked.
6). Notification of used update [Shared buffer queue expansion protocol processing unit 2] 84 transmits an update message to the virtual-net-ipc device on the virtual machine side.
7). Notification of used update to guest OS [Shared buffer queue extension protocol processing unit 1] 44 of the virtual-net-ipc device receives the update message and notifies [transmission data update notification unit 1] 16 of the used update.
8). Collecting descriptors loaded by external processes from used The guest OS receives an update notification through [transmission data update notification unit 1] 16 and collects descriptors loaded by external processes from used.

(外部プロセスから、ゲストOSへ送信する場合)
図16と図21を利用して説明する。
(When sending from an external process to the guest OS)
This will be described with reference to FIGS.

1.availにディスクリプタを積む
(a)初期状態では外部プロセスが送信データを詰め込むための、ディスクリプタを仮想マシン側が用意しておく。つまり、ゲストOSが[受信データバッファキュー設定部1]13と[送信データバッファキュー設定部1]15を利用してvirtio−net−ipcデバイスの[送信用・受信用共有バッファキュー管理部1]へ共有バッファキューの個数・サイズ情報を通知する前に完了済みである。
(b)以後、初期状態以降は、手順9で回収したディスクリプタをavailに積むことを示す。
2.仮想マシンへ通知
(a)初期状態では発生しない。
(b)初期状態以降は、ゲストOSは[受信データ更新通知部1]12を通じて、[共有バッファキュー拡張用プロトコル処理部1]44に、更新があった旨を通知する。
3.外部プロセスへ通知
[共有バッファキュー拡張用プロトコル処理部1]44は、外部プロセスのvirtqueueデバイスへ受信用キューのavailの更新通知メッセージを送信。
4.availから利用可能な、ディスクリプタを回収
(a)外部プロセスの処理ロジックから[送信インタフェース]の[送信データ入力部2]55に送信データを送る。
(b)[送信用共有バッファキュー処理部2]63は[送信用・受信用共有バッファキュー管理部2]62から、外部プロセスが送信用で利用するキュー情報(仮想マシンから見ると受信キュー)を参照し、ディスクリプタを用意する。
5.ディスクリプタに転送データを積む
[送信用共有バッファキュー処理部2]63は転送データをディスクリプタにつめる。
6.usedに回収したディスクリプタを積む
[送信用共有バッファキュー処理部2]63は[共有バッファキュー拡張用プロトコル処理部2]84にusedに回収したディスクリプタを積んだことを知らせる。
7.usedのアップデートを通知
[共有バッファキュー拡張用プロトコル処理部2]84は更新メッセージを仮想マシン側のvirtio−net−ipcデバイスに送信。
8.ゲストOSへusedのアップデートを通知。
virtio−net−ipcデバイスの[共有バッファキュー拡張用プロトコル処理部1]44が更新メッセージを受信し、[受信データ更新通知部1]12にusedのアップデートを通知。
9.usedから外部プロセスが積んだディスクリプタを回収
(a)ゲストOSは[受信データ更新通知部1]12により、更新通知を受信し、usedから外部プロセスが積んだディスクリプタを取り出す。
(b)ディスクリプタには転送データが含まれるので、そのデータを取得するとともに、ディスクリプタを解放する(回収する)。
1. (a) In the initial state, the virtual machine side prepares a descriptor for an external process to pack transmission data. That is, the guest OS uses the [Reception Data Buffer Queue Setting Unit 1] 13 and the [Transmission Data Buffer Queue Setting Unit 1] 15 to [Transmission / Reception Shared Buffer Queue Management Unit 1] of the virtual-net-ipc device. It has been completed before notifying the number and size information of the shared buffer queue.
(B) Hereinafter, after the initial state, the descriptors collected in the procedure 9 are to be stacked on the avail.
2. Notification to virtual machine (a) Does not occur in the initial state.
(B) After the initial state, the guest OS notifies the [shared buffer queue extension protocol processing unit 1] 44 of the update through the [received data update notification unit 1] 12.
3. Notification to External Process [Shared Buffer Queue Extension Protocol Processing Unit 1] 44 transmits an update notification message for the availability of the reception queue to the virtual queue device of the external process.
4). Collect the descriptor that can be used from avail. (a) Send transmission data from the processing logic of the external process to [transmission data input unit 2] 55 of [transmission interface].
(B) [Transmission shared buffer queue processing unit 2] 63 receives queue information used by the external process for transmission from [Transmission / reception shared buffer queue management unit 2] 62 (reception queue when viewed from the virtual machine). And prepare a descriptor.
5. The transfer data is accumulated in the descriptor [the transmission shared buffer queue processing unit 2] 63 packs the transfer data in the descriptor.
6). The collected descriptor is stacked in the “used shared buffer queue processing unit 2” 63 and informs the “shared buffer queue expansion protocol processing unit 2” 84 that the used descriptor has been loaded.
7). Notification of used update [Shared buffer queue expansion protocol processing unit 2] 84 transmits an update message to the virtual-net-ipc device on the virtual machine side.
8). Notification of used update to guest OS.
The [shared buffer queue expansion protocol processing unit 1] 44 of the virtual-net-ipc device receives the update message and notifies the [reception data update notification unit 1] 12 of the used update.
9. Collecting descriptors loaded by external processes from used (a) The guest OS receives an update notification by [Received data update notification unit 1] 12 and extracts the descriptors loaded by external processes from used.
(B) Since the descriptor contains transfer data, the data is acquired and the descriptor is released (collected).

<ポーリングモード(割り込みなし)の場合の処理>
ゲストOSと外部プロセスはそれぞれ、ポーリングモードで動作するため、virtio−net−ipcデバイスおよびvirtqueueデバイスを介した、更新メッセージは中継されない。
<Processing in polling mode (no interrupt)>
Since the guest OS and the external process each operate in the polling mode, the update message is not relayed via the virtual-net-ipc device and the virtualqueue device.

(ゲストOSから仮想マシンを通して、外部プロセスへ送信する場合)
図16と図22を利用し説明する。
(When sending from a guest OS to an external process through a virtual machine)
This will be described with reference to FIGS. 16 and 22.

1.availにディスクリプタを積む
ゲストOSはavailに送信データをディスクリプタに入れて積む
2.availを確認し、ディスクリプタを回収
[受信用共有バッファキュー処理部2]61はポーリングモードで、availの更新を確認する。更新があった場合、ディスクリプタを回収し、[受信データ出力部2]52を通して、転送データを取得できるように、保持しておく。
3.usedに回収したディスクリプタを積む
[受信用共有バッファキュー処理部2]61は[共有バッファキュー拡張用プロトコル処理部2]84にusedに回収したディスクリプタを積む。
4.usedから外部プロセスが積んだディスクリプタを回収
ゲストOSはポーリングモードで、usedの状態を確認し、usedの更新があった場合、外部プロセスが積んだディスクリプタを回収する。
1. 1. The descriptor is loaded on avail. The guest OS puts the transmission data on the avail and puts it in the descriptor. Confirm avail and collect descriptor [Reception shared buffer queue processing unit 2] 61 confirms the update of avail in the polling mode. When there is an update, the descriptor is collected and held so that the transfer data can be acquired through the [Received data output unit 2] 52.
3. The collected descriptor is stacked in the “used shared buffer queue processing unit 2” 61 and the descriptor collected in the “used” shared buffer queue expansion protocol processing unit 2 84 is stacked.
4). Collecting descriptors loaded by external process from used Guest OS checks the status of used in polling mode, and if used is updated, collects descriptors loaded by external process.

(外部プロセスから、ゲストOSへ送信する場合)
図16と図22を利用して説明する。
1.availにディスクリプタを積む
(a)初期状態では外部プロセスが送信データを詰め込むための、ディスクリプタを仮想マシン側が用意しておく。つまり、ゲストOSが[受信データバッファキュー設定部1]13と[送信データバッファキュー設定部1]15を利用してvirtio−net−ipcデバイスの[送信用・受信用共有バッファキュー管理部1]へ共有バッファキューの個数・サイズ情報を通知する前に完了済みである。
(b)以後、初期状態以降は、手順5で回収したディスクリプタをavailに積むことを示す。
2.availから利用可能な、ディスクリプタを回収
(a)外部プロセスの処理ロジックから[送信インタフェース]の[送信データ入力部2]55に送信データを送る。
(b)[送信用共有バッファキュー処理部2]63は[送信用・受信用共有バッファキュー管理部2]62から、外部プロセスが送信用で利用するキュー情報(仮想マシンから見ると受信キュー)を参照し、ディスクリプタを用意する。
3.ディスクリプタに転送データを積む
[送信用共有バッファキュー管理部2]は転送データをディスクリプタにつめる。
4.usedに回収したディスクリプタを積む
[送信用共有バッファキュー処理部2]63は回収したディスクリプタをusedに積む。
5.usedから外部プロセスが積んだディスクリプタを回収
(a)ゲストOSはポーリングモードで動作し、更新通知なしでusedを確認し、更新があった場合、外部プロセスが積んだディスクリプタを取り出す。
(b)ディスクリプタには転送データが含まれるので、そのデータを取得するとともに、ディスクリプタを解放する(回収する)。
(When sending from an external process to the guest OS)
This will be described with reference to FIGS. 16 and 22.
1. (a) In the initial state, the virtual machine side prepares a descriptor for an external process to pack transmission data. That is, the guest OS uses the [Reception Data Buffer Queue Setting Unit 1] 13 and the [Transmission Data Buffer Queue Setting Unit 1] 15 to [Transmission / Reception Shared Buffer Queue Management Unit 1] of the virtual-net-ipc device. It has been completed before notifying the number and size information of the shared buffer queue.
(B) Hereinafter, after the initial state, the descriptor collected in the procedure 5 is to be stacked on the avail.
2. Collect the descriptor that can be used from avail. (a) Send transmission data from the processing logic of the external process to [transmission data input unit 2] 55 of [transmission interface].
(B) [Transmission shared buffer queue processing unit 2] 63 receives queue information used by the external process for transmission from [Transmission / reception shared buffer queue management unit 2] 62 (reception queue when viewed from the virtual machine). And prepare a descriptor.
3. The transfer data is accumulated in the descriptor [the shared buffer queue manager for transmission 2] packs the transfer data in the descriptor.
4). The collected descriptor is stacked in the “used shared buffer queue processing unit 2” 63 and the recovered descriptor is stacked in the “used”.
5. Collecting descriptors loaded by external process from used (a) Guest OS operates in polling mode, confirms used without update notification, and if updated, fetches descriptor loaded by external process.
(B) Since the descriptor contains transfer data, the data is acquired and the descriptor is released (collected).

(9)仮想マシンとゲストOSの起動シーケンス
図15に記載の通りであり、仮想マシンが起動し、ゲストOSが起動してvirtio−netドライバが起動するときに、フィーチャ情報についてvirtio−net−ipcデバイスと折衝を行い、さらに動作モードをお互い設定した上で送信用、受信用の共有バッファキューをゲストOSが作成し、共有バッファキューの個数・サイズ・先頭アドレス情報をvirtio−net−ipcデバイスに通知する。
(9) Virtual Machine and Guest OS Startup Sequence As shown in FIG. 15, when the virtual machine is started, the guest OS is started, and the virtual-net driver is started, the feature information is virtual-net-ipc. After negotiating with the device and setting the operation mode to each other, the guest OS creates a shared buffer queue for transmission and reception, and the number, size, and top address information of the shared buffer queue are stored in the virtual-net-ipc device. Notice.

この通知は、上記(2)に記載のとおり、ゲストOSがvirtio−net−ipcデバイスとのインタフェースである、[受信データバッファキュー設定部1]13、[デバイス動作・フィーチャ設定部1]14、[送信データバッファキュー設定部1]15を通して、[送信用・受信用共有バッファキュー管理部1]に通知し設定することで実現する。   As described in the above (2), the notification is made by the guest OS being an interface with the virtual-net-ipc device, [Reception data buffer queue setting unit 1] 13, [Device operation / feature setting unit 1] 14, This is realized by notifying and setting the [transmission / reception shared buffer queue management unit 1] through the [transmission data buffer queue setting unit 1] 15.

以上のように、通常のオペレーションを想定した場合の動作およびシーケンスについて説明した。しかし、図23に示すように、外部プロセス、仮想マシン、及びゲストOSが状態遷移パターン(D1〜D9)において、お互い独立して動作に不具合を発生させない通知のしくみが必要である。次節以降、その方式について説明する。   As described above, the operation and sequence when a normal operation is assumed have been described. However, as shown in FIG. 23, it is necessary to have a notification mechanism in which external processes, virtual machines, and guest OSs do not cause problems in their operation independently in the state transition patterns (D1 to D9). The method will be described in the following sections.

・状態遷移パターン(D1)
状態遷移パターン(D1)では、仮想マシンだけが起動、停止する状態遷移について取り扱う。このパターンでは、仮想マシンの異常終了を考慮しなければ行けないがそもそも接続先の外部プロセスやゲストOSが存在しないため、影響を与える存在がいない。よって、このケースでは動作への影響は考慮する必要はない。
-State transition pattern (D1)
The state transition pattern (D1) deals with state transitions in which only the virtual machine is started and stopped. In this pattern, it is necessary to consider abnormal termination of the virtual machine, but there is no external process or guest OS to connect to, so there is no influence. Therefore, in this case, it is not necessary to consider the influence on the operation.

・状態遷移パターン(D2)
このケースでは、仮想マシンが起動中でゲストOSが停止中と、仮想マシンが起動中でゲストOSが起動中の場合の2つの状態の遷移である。この状態で、ゲストOSが異常終了した場合の対処が必要である。具体的には、ゲストOSが確保した共有バッファキューのメモリ領域が確保されたまま解放されずに異常終了するケースである。この場合は、そのメモリ領域が解放されずに残ってしまうが、この問題については、既存のvirtio−netデバイス含めvirtioの共有バッファキューで実現されたvirtioデバイスすべてに共通する問題である。また、外部プロセスが起動していないため、動作に影響を与えるという観点では考慮する必要はない。
-State transition pattern (D2)
In this case, there are two state transitions when the virtual machine is activated and the guest OS is stopped, and when the virtual machine is activated and the guest OS is activated. In this state, it is necessary to take measures when the guest OS is abnormally terminated. Specifically, this is a case where the memory area of the shared buffer queue secured by the guest OS is abnormally terminated without being released. In this case, the memory area remains without being released, but this problem is a problem common to all the virtual devices realized by the shared shared buffer queue including the existing virtual-net device. Further, since the external process is not started, there is no need to consider from the viewpoint of affecting the operation.

・状態遷移パターン(D3)
このパターンでは、仮想マシンとゲストOSが起動中で、外部プロセスが停止と動作の状態を遷移するケースである。このケースでは、外部プロセスが異常終了したケースを取り扱う。この場合、IPCを利用しているため、IPCの終了通知を仮想マシン側は検知することができ、終了処理を仮想マシン側で実施することができる。つまり、(i)仮想マシン側で終了を検知、(ii)仮想マシン側からゲストOSへリンクダウンを通知、(iii)ゲストOSがリンクダウンを認識、することにより外部プロセスの影響でゲストOSは通常のリンクダウン処理として扱うことができる。その他の問題として、外部プロセス異常終了時に共有バッファキューが初期化されない問題が残るが、これはVitioデバイスすべてで共通する問題である。
-State transition pattern (D3)
In this pattern, the virtual machine and the guest OS are running, and the external process transitions between a stopped state and an operating state. In this case, a case where the external process is abnormally terminated is handled. In this case, since the IPC is used, the virtual machine side can detect the IPC end notification, and the end process can be performed on the virtual machine side. In other words, (i) the termination is detected on the virtual machine side, (ii) the link down is notified from the virtual machine side to the guest OS, and (iii) the guest OS recognizes the link down, so that the guest OS is affected by an external process. It can be handled as normal link-down processing. As another problem, there remains a problem that the shared buffer queue is not initialized when the external process ends abnormally. This is a problem common to all the Vio devices.

・状態遷移パターン(D4)
このパターンでは、仮想マシンとゲストOSが停止中であり、外部プロセスの異常終了のみを対処がターゲットとなる。この状態では外部プロセス側の異常終了は相手側が存在しないため、影響は与えない。
・ State transition pattern (D4)
In this pattern, the virtual machine and guest OS are stopped, and only the abnormal termination of the external process is targeted. In this state, abnormal termination on the external process side has no effect because the other party does not exist.

・状態遷移パターン(D5)
このパターンでは、外部プロセスが起動し、virtqueueデバイスがサーバとして接続待ち状態になっている状態で、仮想マシンが起動および停止する状態遷移について、仮想マシンが異常終了した場合について説明する。仮想マシンが異常終了した場合は、外部プロセスのvirtqueueデバイスと仮想マシン側のvirtio−net−ipcデバイスとのコネクションが切断されるだけであり、共有バッファキューの情報を交換する前であるため、異常終了後、外部プロセスのvirtqueueデバイスが再度待ち状態に入るため、特に外部プロセスの動作に仮想マシンの異常終了動作が影響を与えることはない。
・ State transition pattern (D5)
In this pattern, a case will be described in which a virtual machine is abnormally terminated with respect to a state transition in which a virtual machine is started and stopped while an external process is started and a virtual queue device is in a connection waiting state as a server. If the virtual machine terminates abnormally, the connection between the virtual queue device of the external process and the virtual-net-ipc device on the virtual machine side is simply disconnected, and it is before the information of the shared buffer queue is exchanged. Since the virtual queue device of the external process enters the waiting state again after the termination, the abnormal termination operation of the virtual machine does not particularly affect the operation of the external process.

・状態遷移パターン(D6)
このパターンでは、外部プロセスと仮想マシンが起動している状態で、ゲストOSの起動と終了の状態遷移中に、ゲストOSが異常終了した場合について説明する。ゲストOSが異常終了前に仮想マシン側のvirtio−net−ipcデバイスにゲストOSが確保した共有バッファキューの情報を提供していた場合、共有バッファキューで利用するメモリ領域も解放されない状態でゲストOSが異常終了してしまうため、外部プロセス側はその異常終了がわからない状態で共有バッファキューに書き込んでしまう。この問題については、既存のvirtio−netデバイス含めvirtioの共有バッファキューで実現されたvirtioデバイスすべてに共通する問題である。
-State transition pattern (D6)
In this pattern, a case will be described in which the guest OS is abnormally terminated while the external process and the virtual machine are activated and the guest OS is activated and terminated. If the guest OS provided information about the shared buffer queue secured by the guest OS to the virtual-net-ipc device on the virtual machine side before abnormal termination, the guest OS is not released even if the memory area used by the shared buffer queue is not released. Will end abnormally, and the external process will write to the shared buffer queue without knowing the abnormal end. This problem is common to all the virtual devices implemented with the shared buffer queue of the virtual including the existing virtual-net device.

・状態遷移パターン(D7)
このパターンでは、仮想マシンだけが起動している状態(virtio−net−ipcデバイスが定期的に接続を繰り返している状態)、において外部プロセスが停止状態と起動状態間を遷移するケースについて取り扱う。このケースでは、外部プロセス側と仮想マシン側ではIPCでの接続が完了しただけであり、共有バッファキューの情報については交換していない状態であるため、外部プロセスの異常終了に対しても、仮想マシン側は再度、再接続状態に遷移するだけであり、仮想マシンの状態に影響を与えるものではない。
State transition pattern (D7)
This pattern deals with a case where an external process transitions between a stopped state and an activated state in a state where only the virtual machine is activated (a state in which the virtual-net-ipc device is repeatedly connected). In this case, the connection by the IPC has only been completed on the external process side and the virtual machine side, and the information on the shared buffer queue has not been exchanged. The machine side only transitions to the reconnection state again, and does not affect the state of the virtual machine.

・状態遷移パターン(D8)
このパターンでは、仮想マシンとゲストOSが起動している状態で、両方異常終了するケースを取り扱う。この状態では、影響を与える対象の外部プロセスは起動していないため、当然動作に対して影響を与えない。よって、この状態遷移では動作の影響を考慮する必要はない。
・ State transition pattern (D8)
In this pattern, a case where both the virtual machine and the guest OS are activated and abnormally ends is handled. In this state, the external process to be affected is not started, so it naturally does not affect the operation. Therefore, it is not necessary to consider the influence of operation in this state transition.

・状態遷移パターン(D9)
このパターンでは、仮想マシンとゲストOSと外部プロセスがすべて起動している状態で、仮想マシンとゲストOSが同時に異常終了するケースを取り扱う。この場合、仮想マシンのvirtio−net−ipcデバイスと外部プロセスのvirtqueueデバイスはIPCで接続しているため、外部プロセス側は異常終了を検知でき、検知するとともに、共有バッファキュー操作を停止することができるため、外部プロセス側へはリンクダウン通知として外部プロセスへも正常に状態変更通知が可能である。これにより、この異常終了においても適切に処理することが可能である。
-State transition pattern (D9)
This pattern handles a case where the virtual machine and the guest OS are abnormally terminated at the same time while all of the virtual machine, the guest OS, and the external process are activated. In this case, since the virtual-net-ipc device of the virtual machine and the virtual queue device of the external process are connected by IPC, the external process side can detect abnormal termination and can detect and stop the shared buffer queue operation. Therefore, it is possible to notify the external process side of the status change normally as a link down notification to the external process. Thereby, it is possible to appropriately process even in the abnormal end.

・その他の状態遷移
仮想マシンとゲストOSと外部プロセスがすべて動作している状態ですべて異常終了してしまうケースでは、すべて動作が終了するため、お互い影響を与えるケースは発生しない。よって、その他の状態遷移についても考慮する必要はない。
-Other state transitions In the case where all of the virtual machines, the guest OS, and the external processes are operating abnormally, all the operations are terminated, so that no cases that affect each other occur. Therefore, there is no need to consider other state transitions.

<実施例2>
実施例1では、ユニックスドメインソケットを利用したIPCを利用した接続を取り上げた。IPCにおいてはユニックスドメインソケット以外に、ファイルパス指定によるIPCの手法としてパイプ、メッセージキュー、INETソケットが存在し、本発明では、起動オプションに接続種別を設定することで接続手法について切り替えることが可能である。
<Example 2>
In the first embodiment, the connection using the IPC using the Unix domain socket is taken up. In IPC, there are pipes, message queues, and INET sockets as IPC methods by specifying file paths in addition to Unix domain sockets. In the present invention, connection methods can be switched by setting the connection type in the start option. is there.

以上のように、接続手段はこれらの各実装方法で異なるが、上記指定の接続手段を用いて接続を確立した後、初期化メッセージを含む仮想マシンと外部プロセス間でやり取りされる共有バッファキューに関するすべての手順は、制御メッセージフォーマット及びシーケンス(図18)を含み、実施例1に説明の手順と全く同じである。   As described above, the connection means differs depending on each of these mounting methods. However, after establishing the connection using the specified connection means, the connection means relates to the shared buffer queue exchanged between the virtual machine including the initialization message and the external process. All procedures include the control message format and sequence (FIG. 18), and are exactly the same as those described in the first embodiment.

ただし、起動時に与えるオプションについては、それぞれの接続手段によって異なるため、実施例2において実施例1と異なる箇所のみ以下の通り、記載する(それ以外の手段に関する実施手順は実施例1と同じであるため、省略する。)   However, since the options given at the time of activation differ depending on the respective connection means, only the parts different from the first embodiment in the second embodiment are described as follows (the procedure for the other means is the same as the first embodiment). Therefore, it is omitted.)

<接続手段:パイプ>
パイプを接続手段とする場合、仮想マシン側の起動オプションは下記の通り、socketpathではなくfifopathとして、ファイル記述子を指定して起動する。
(参8)[仮想マシンの起動時引数]

Figure 0005960186
外部プロセス側も同様のファイル記述子を指定することで接続できるようにする。
(参9)[外部プロセスの起動オプション]
Figure 0005960186
それ以外のオプションについては実施例1と同じである。 <Connecting means: pipe>
When a pipe is used as a connection means, the activation option on the virtual machine side is activated by designating a file descriptor as fifopath instead of socketpath as follows.
(Reference 8) [Virtual machine startup arguments]
Figure 0005960186
The external process side can be connected by specifying the same file descriptor.
(Reference 9) [External process startup options]
Figure 0005960186
Other options are the same as those in the first embodiment.

<接続手段:メッセージキュー>
メッセージキューを接続手段とする場合、仮想マシン側の起動オプションは下記の通り、socketpathではなくmsgqpathとして、ファイル記述子を指定して起動する。
(参10)[仮想マシンの起動時引数]

Figure 0005960186
外部プロセス側も同様のファイル記述子を指定することで接続できるようにする。
(参11)[外部プロセスの起動オプション]
Figure 0005960186
それ以外のオプションについては実施例1と同じである。 <Connection means: Message queue>
When a message queue is used as a connection means, the activation option on the virtual machine side is activated by designating a file descriptor as msgqpath instead of socketpath as follows.
(Reference 10) [Virtual machine startup arguments]
Figure 0005960186
The external process side can be connected by specifying the same file descriptor.
(Reference 11) [External process startup options]
Figure 0005960186
Other options are the same as those in the first embodiment.

<接続手段:INETソケット>
INETソケットを接続手段とする場合、仮想マシン側の起動オプションは下記の通り、socketpathではなくIPアドレスとポート番号を指定して起動する。このとき、レイヤ4プロトコルとしてTCPか、UDPを指定する。
(参12)[仮想マシンの起動時引数]

Figure 0005960186
外部プロセス側も同様のファイル記述子を指定することで接続できるようにする。
(参13)[外部プロセスの起動オプション]
Figure 0005960186
それ以外のオプションについては実施例1と同じである。 <Connection: INET socket>
When the INET socket is used as a connection means, the activation option on the virtual machine side is activated by specifying an IP address and a port number instead of a socket path as follows. At this time, TCP or UDP is designated as the layer 4 protocol.
(Ref 12) [Virtual machine startup arguments]
Figure 0005960186
The external process side can be connected by specifying the same file descriptor.
(Reference 13) [External process startup options]
Figure 0005960186
Other options are the same as those in the first embodiment.

<実施例3>
実施例1では、同一物理ホスト内においてゲストOSの共有バッファキューを仮想マシンから外部プロセスへ拡張する手法について説明した。IPCにおいて、ソケットの代わりに、セキュアな接続方式を組み合わせ、1対1で接続するケースを適用することが可能である。ベーシック認証、パスワード認証、SSL(Secure Sockets Layer)、を利用した接続方式を適用できる。これにより、仮想マシンと外部プロセス間での認証機能を共通鍵、または公開鍵認証にて実現し、交換するメッセージ内容も暗号化することが可能であり、セキュアに共有バッファキューの操作が可能となる。
<Example 3>
In the first embodiment, the method of extending the shared buffer queue of the guest OS from the virtual machine to the external process in the same physical host has been described. In IPC, it is possible to apply a case where one-to-one connection is made by combining secure connection methods instead of sockets. A connection method using basic authentication, password authentication, or SSL (Secure Sockets Layer) can be applied. As a result, the authentication function between the virtual machine and the external process can be realized by common key or public key authentication, and the message content to be exchanged can be encrypted, and the shared buffer queue can be operated securely. Become.

(ベーシック認証を利用したケース)
ベーシック認証を利用するケースでは、実施例1において、仮想マシン起動時のオプションに、外部プロセス接続用の認証情報として、ノードIDの代わりにユーザ/パスワードを指定し起動する。これらのユーザ/パスワードは、図16の[基本設定管理部1]45にて管理される。一方、外部プロセス側も認証許可するためのユーザ/パスワード情報を仮想マシン同様に、図16の[基本設定管理部2]85にて管理する。
(Case using basic authentication)
In the case of using the basic authentication, in the first embodiment, the user / password is specified instead of the node ID as the authentication information for external process connection as an option when starting the virtual machine. These users / passwords are managed by [basic setting management unit 1] 45 in FIG. On the other hand, the user / password information for permitting authentication on the external process side is managed by the [basic setting management unit 2] 85 in FIG.

この場合、これらのオプションは初期化メッセージ前に外部プロセスとやりとりされ、ベーシック認証が正常に終了すると、そのあと、初期化フェーズに移行する。仮想マシンと外部プロセス間の接続確立までの状態遷移については図24に記載のとおりである。図24において、Basic認証フェーズの認証要求応答、ユーザ/パスワード、認証OKの各種メッセージフォーマットは図18に従い、メッセージタイプにbasic認証、メッセージタイプ依存データにそれぞれ、認証要求応答、ユーザ/パスワード、認証OKの情報が記載され、メッセージがやり取りされる。それ以外の全体の状態遷移等は、実施例1にすべて従うため、省略する。   In this case, these options are exchanged with the external process before the initialization message, and when the basic authentication ends normally, the process proceeds to the initialization phase. The state transition until the connection between the virtual machine and the external process is established is as shown in FIG. In FIG. 24, various message formats of authentication request response, user / password, and authentication OK in the basic authentication phase are in accordance with FIG. 18, and authentication request response, user / password, and authentication OK for message type and basic authentication, respectively. Is described and messages are exchanged. Other overall state transitions and the like are the same as in the first embodiment, and are therefore omitted.

(ダイジェスト認証)
ダイジェスト認証を利用するケースでは、ベーシック認証の「ユーザ/パスワード」部分をダイジェストに置き換えた形となる(図25)。各種メッセージフォーマットもベーシック認証と同様に図18に従う。また、それ以外の全体の状態遷移等は、実施例1にすべて従うため、省略する。
(Digest authentication)
In the case of using digest authentication, the “user / password” portion of basic authentication is replaced with a digest (FIG. 25). Various message formats follow FIG. 18 as in the basic authentication. In addition, all other state transitions and the like are the same as in the first embodiment, and are therefore omitted.

(SSL認証)
SSL認証を利用するケースでは、クライアント側がサーバ認証用の証明書を所持し、仮想マシン起動時のオプションとして、サーバ証明書のファイルパスを指定する。これらのサーバ証明書のファイルパス情報は、図16の[基本設定管理部1]45にて管理される。外部プロセス側は、起動時にSSLの認証を実施するかどうかのオプションを指定する。
(SSL authentication)
In the case of using SSL authentication, the client side has a certificate for server authentication, and designates the file path of the server certificate as an option when starting the virtual machine. The file path information of these server certificates is managed by [basic setting management unit 1] 45 in FIG. The external process side specifies an option as to whether or not to perform SSL authentication at startup.

これにより、サーバとクライアント間でSSL認証を実行することにより、接続を実現する(図26)。初期化フェーズに至るSSLによる接続までは、メッセージフォーマットはSSLに従う。また、それ以外の全体の状態遷移等は、実施例1にすべて従うため、省略する。   Thereby, the connection is realized by executing SSL authentication between the server and the client (FIG. 26). Until the connection by SSL leading to the initialization phase, the message format follows SSL. In addition, all other state transitions and the like are the same as in the first embodiment, and are therefore omitted.

<実施例4>
実施例1においては、(3)に記載のとおり、バージョン番号を利用してバッファキュー構成(種別・個数・サイズ)の情報対応を示した。これにより、バージョン番号を利用することで送信用、受信用のバッファキューとして、それぞれマルチバッファキューを仮想マシンと外部プロセスで共有することが可能である。
<Example 4>
In the first embodiment, as described in (3), information correspondence of the buffer queue configuration (type, number, size) is shown using the version number. As a result, the multi-buffer queue can be shared between the virtual machine and the external process as a buffer queue for transmission and reception by using the version number.

この場合、更新メッセージはのメッセージタイプ依存フィールドには、下記のとおり、更新のあったバッファキューのビットを1、更新がないキューを0、とすることにより、接続相手に知らせることが可能である。   In this case, in the message type dependent field of the update message, it is possible to notify the connection partner by setting the bit of the updated buffer queue to 1 and setting the queue without update to 0 as follows. .

例えば、送信用、受信用にそれぞれ4個のバッファキューを利用する場合、メッセージタイプフィールドは送信用4ビット、受信用4ビットの合計8ビットで構成される。例えば送信用の0番目、1番目のキューが更新された場合は、メッセージタイプ依存フィールドは以下のとおりとなる。
11000000 = (送信用4ビット)(受信用4ビット)
これらの更新メッセージをのぞき、実施例1と同じ構成をとるため、実施例4の詳細な手順は省略する。
For example, when four buffer queues are used for transmission and reception, respectively, the message type field is composed of a total of 8 bits, 4 bits for transmission and 4 bits for reception. For example, when the 0th and 1st queues for transmission are updated, the message type dependent fields are as follows.
11000000 = (4 bits for transmission) (4 bits for reception)
Except for these update messages, the configuration is the same as that of the first embodiment, and the detailed procedure of the fourth embodiment is omitted.

<実施例5>
実施例4では、マルチバッファキューにおいて、1つの接続を利用した。送受信用のバッファキューを1つの接続と対応づけ、マルチキューの個数分接続を確立することにより、並列化が望まれパフォーマンス向上が期待できる。具体的には、仮想マシン、外部プロセスともに起動時に個数分のファイル記述子を指定して起動することにより、マルチバッファキュー、且つマルチ接続の機能を持つバッファキューの共有方式を実現することができる。
<Example 5>
In the fourth embodiment, one connection is used in the multi-buffer queue. By associating buffer queues for transmission and reception with one connection and establishing connections for the number of multi-queues, parallelization is desired and performance improvement can be expected. Specifically, a multi-buffer queue and buffer queue sharing method with multi-connection functions can be realized by specifying and starting file descriptors for the number of virtual machines and external processes. .

具体的な実施例については接続が複数と成るだけであり、実施例1と全く同じであるため、詳細は省略する。   The specific embodiment has only a plurality of connections and is exactly the same as that of the first embodiment, so the details are omitted.

<実施例6>
実施例1では、ゲストOSと仮想マシン間のキューとしてvirtioキューの仕様をベースに外部プロセスへ確証する方式について述べた。キュー操作は一般的に、親側と子側で構造(バッファキューの構成とオペレーション方法)で合意できていれば、他のキュー構造においても本発明は適用可能である。実施例1では、仮想マシンと外部プロセス間を接続する際、バージョン番号により、バッファキュー種別、バッファキュー個数、バッファキューサイズの情報を交換する(実施例1の(3))。
<Example 6>
In the first embodiment, the method of confirming to the external process based on the specification of the virtual queue as the queue between the guest OS and the virtual machine has been described. In general, the queue operation can be applied to other queue structures as long as the parent side and the child side agree on the structure (buffer queue configuration and operation method). In the first embodiment, when a virtual machine and an external process are connected, information on the buffer queue type, the number of buffer queues, and the buffer queue size is exchanged according to the version number ((3) of the first embodiment).

よって、キューの更新通知機能と動作モードを交換するだけであり、実施例1の例に加え、設定メッセージにキューの種別情報を追加することにより、任意のキューに拡張可能である。   Therefore, only the queue update notification function and the operation mode are exchanged, and in addition to the example of the first embodiment, the queue type information is added to the setting message, and the queue can be expanded to an arbitrary queue.

状態遷移パターンD2、D6において、Virtioキューを前提することでVirtioキューに起因するドライバ側の再初期化が実装されていないことにより、メモリ解放されないという問題を説明した。本実施例で説明した他のキューでリンクダウンや、リンクアップ時にVirtioキューを再初期化する機能を有する共有バッファキューに適用することで、当該問題も解決できる。   In the state transition patterns D2 and D6, the problem that the memory is not released due to the fact that the re-initialization on the driver side caused by the virtual queue is not implemented by assuming the virtual queue has been described. This problem can also be solved by applying to a shared buffer queue having a function of re-initializing the Virtual queue at the time of link down or link up with another queue described in the present embodiment.

<実施例7>
今までの実施例では、仮想マシンの通信デバイス(virtio−net−ipcでバイス)をクライアント、外部プロセスの通信デバイス(virtqueueデバイス)をサーバとして、実施例を述べていたが、逆の場合も同様に本発明は実現可能である。この場合、サーバ、クライアントの処理が今まで述べてきた実施例と逆のパターンになるがそれ以外の状態遷移については実施例1で述べたものと全く同じになるため、詳細は省略する。
<Example 7>
In the above embodiments, the virtual machine communication device (virtual-net-ipc) is used as the client, and the external process communication device (virtqueue device) is used as the server. In addition, the present invention can be realized. In this case, the processing of the server and the client is the reverse pattern to the embodiment described so far, but the other state transitions are exactly the same as those described in the embodiment 1, and therefore the details are omitted.

<本発明によって生じる効果>
(i)外部プロセス側と仮想マシン側を直接接続することができるため、メモリコピー回数とコンテキストスイッチ切り替え回数を外部通信方式1、2に対し少なくすることができ、高速にデータ転送を実現することができる。
<Effects produced by the present invention>
(I) Since the external process side and the virtual machine side can be directly connected, the number of times of memory copy and context switch switching can be reduced compared to the external communication methods 1 and 2, and high-speed data transfer can be realized. Can do.

(ii)仮想マシン、外部プロセスそれぞれの通信デバイスが、お互い接続相手の状態に関し、状態変化を検知し、自身内部へ通知することにより、ゲストOSや外部プロセス内部の処理ロジックに対し、障害発生やメンテナンスなどの事象に対処する機会を創出する(障害対応等は、ゲストOSや外部プロセス内部の処理に依存)。これにより、仮想マシン(およびゲストOS)と外部プロセスは異常終了の事象も含め、独立してオペレーションすることができる。つまり、仮想マシンの再起動や、外部プロセス側の再起動においても接続相手にはリンクダウンとして見えるため、動作がハングアップするといったことが一切発生しない。 (Ii) Each communication device of the virtual machine and external process detects a change in the state of each other's connection partner, and notifies itself to the inside of the guest OS and the processing logic inside the external process. Create an opportunity to deal with events such as maintenance (failure handling depends on the guest OS and processing inside the external process). As a result, the virtual machine (and guest OS) and the external process can be operated independently including an abnormal termination event. In other words, even if the virtual machine is restarted or the external process is restarted, the connection partner appears to be linked down, so that the operation does not hang up at all.

(iii)仮想マシン、外部プロセスは切断状態に陥ったときに、正しく状態を把握できることにより、それを契機として、接続相手を切り替える動作に移ることができ、さらに再接続機能により、切り離した接続相手と同じ機能を持つ別の接続相手と再接続することによりフェイルオーバー機能を実現することが可能となる。 (Iii) When a virtual machine or an external process falls into a disconnected state, the state can be grasped correctly, so that it is possible to move to the operation of switching the connection partner. The failover function can be realized by reconnecting with another connection partner having the same function as.

(iv)本発明では仮想マシンと外部プロセス間のメッセージの交換内容を提案しており、接続方法を限定しない。これにより、適用するプラットフォームによって実装方法を選択、採用することが可能である。 (Iv) The present invention proposes message exchange contents between the virtual machine and the external process, and does not limit the connection method. Thereby, it is possible to select and adopt the mounting method according to the platform to be applied.

(v)本発明のvirtio−net−ipcデバイスとvirtqueueデバイスを通信インタフェースとして利用することにより、外部プロセスと仮想マシンの接続のあり、なしをゲストOS側にリンクダウンとして状態通知を実施することにより、ゲストOS、外部プロセスはハングアップせずに通常のオペレーションを実施することを可能とする。 (V) By using the virtual-net-ipc device and the virtualqueue device of the present invention as a communication interface, a status notification is made with a link between the external process and the virtual machine connected to the guest OS side, and the status is notified to the guest OS side. The guest OS and external processes can perform normal operations without hanging up.

(vi)外部通信方式1、2では仮想マシンと外部プロセス間の通信はtapデバイスやvhost−netドライバの他に中継のための仮想スイッチが必要と成るが、この方式では直接接続するため、他のコンポーネントを必要としない。 (Vi) In the external communication methods 1 and 2, the communication between the virtual machine and the external process requires a virtual switch for relay in addition to the tap device and the vhost-net driver. Does not require any components.

通常、CPUについてのサイクルタイムは、DRAMのようなメモリへのアクセス時間よりはるかに短い。これは、CPUが次の命令(メモリエリアを参照する)を実行するための待ちが発生することを意味する。そして、メモリエリアへの参照回数が多いほど待ち時間が多く発生することになりスループットの低下が発生する。このため、従来のように仮想マシン間のパケット転送のために複数のメモリエリアにパケットをコピーをすれば、このコピー動作によりネットワークI/Oのパフォーマンスが低下することになる。   Usually, the cycle time for a CPU is much shorter than the access time to a memory such as DRAM. This means that a wait for the CPU to execute the next instruction (referring to the memory area) occurs. As the number of references to the memory area increases, a longer waiting time occurs, resulting in a decrease in throughput. For this reason, if packets are copied to a plurality of memory areas for packet transfer between virtual machines as in the prior art, the performance of network I / O is reduced by this copying operation.

図27は、この問題を解決しようとするモデルである。図27のモデルは、仮想ネットワーク技術のNFVとSDN(OpenFlow)を利用した仮想BRAS(Broadband Remote Access Server)ネットワークノードである。NFVは、ネットワーク機能仮想化(Network Function Virtualization)であり、SDNはソフトウエア制御ネットワーク(Software−Defined Networking)である。   FIG. 27 shows a model for solving this problem. The model of FIG. 27 is a virtual BRAS (Broadband Remote Access Server) network node using NFV and SDN (OpenFlow) of virtual network technology. The NFV is a network function virtualization, and the SDN is a software control network (Software-Defined Networking).

各仮想マシン(VM)は、NFVとして機能し、それぞれインターネット接続サービス、IP電話等のSIPサービス、NSOD(Network Service−Oriented Distributor)として機能する例である。NSODは、DPI(Deep Packet Inspection)やアドレス付与を行い、サービスクライアントとネットワークサービスとの媒介をおこなうものである。仮想ネットワークにおいてパケット転送を行うOpen vswichやソフトウエアベースOpenFlowスイッチ等の仮想スイッチが必要である。図27のモデルは、仮想スイッチと仮想マシンが同じメモリエリアで動作するため、ホストOSをバイパスしてパケットのコピー動作を低減でき、ネットワークI/Oのパフォーマンスを向上することができる。   Each virtual machine (VM) is an example that functions as an NFV and functions as an Internet connection service, a SIP service such as an IP telephone, and an NSOD (Network Service-Oriented Distributor). NSOD performs DPI (Deep Packet Inspection) and address assignment, and mediates between a service client and a network service. A virtual switch such as Open vsswitch or software-based OpenFlow switch that performs packet transfer in a virtual network is required. In the model of FIG. 27, since the virtual switch and the virtual machine operate in the same memory area, the packet copy operation can be reduced by bypassing the host OS, and the performance of the network I / O can be improved.

さらに、このBRASに本発明の仮想通信路構築システムを適用すれこともできる。仮想デバイスとゲストOS間の共有バッファキューを介してそれぞれの仮想マシン間を直接接続し、パケット転送が可能になるため、仮想スイッチが不要となる。このため、パケットコピー回数をさらに低減でき、高速データ転送に寄与できる。   Furthermore, the virtual channel construction system of the present invention can be applied to this BRAS. Since each virtual machine is directly connected via a shared buffer queue between the virtual device and the guest OS and packet transfer is possible, a virtual switch becomes unnecessary. For this reason, the number of packet copies can be further reduced, which can contribute to high-speed data transfer.

[付記]
以下は、本発明の特徴をまとめたものである(図15、図19、図20、図23)。
[Appendix]
The following is a summary of the features of the present invention (FIGS. 15, 19, 20, and 23).

1.本発明は、仮想マシンおよび外部プロセスにおいて、互いの独立性を担保しつつ、バッファキューの操作を共有するために、初期化(接続相手の識別、バッファキューの大きさ、種類の整合性の確立)、設定処理(バッファキュー操作の動作モード、バッファキューの先頭アドレス)、バッファキューの更新通知処理(割り込み有りの場合)、終了処理、の4フェーズに分けて接続状態をモデル化し、以下の通りプロトコルを規定したことを特徴とする。
(a)接続相手間でそれぞれ同じバッファを操作するため、お互いバッファの種別、大きさの整合性が必要になる。初期化メッセージでは、この整合性を実現するために、接続の度に整合性情報をバージョン情報として交換するための情報領域をプロトコルメッセージ内に規定した。
(b)同様に、設定処理フェーズでは、バッファキューのメモリ情報を相手に伝えるための情報領域をプロトコルメッセージ内に規定した。
(c)データの入出力を取り扱う方式として、割り込みモードと割り込みなしモード(ポーリングモード)が存在する。これを接続完了前に事前に折衝するための同様に、設定処理フェーズでは、動作モード規定領域をプロトコルメッセージ内に規定した。
(d)割り込みモードを実現するために、バッファキューの更新のたびに、相手側に更新通知を通知するメッセージ種別をプロトコルに規定した。
1. The present invention initializes (establishes connection partner identification, buffer queue size, and type consistency) in order to share buffer queue operations while ensuring independence between the virtual machine and external processes. ), Setting process (buffer queue operation mode, buffer queue start address), buffer queue update notification process (if there is an interrupt), termination process, and modeled the connection state as follows: It is characterized by specifying a protocol.
(A) Since the same buffer is operated between the connection partners, the types and sizes of the buffers must be consistent with each other. In the initialization message, in order to realize this consistency, an information area for exchanging consistency information as version information for each connection is defined in the protocol message.
(B) Similarly, in the setting processing phase, an information area for transmitting the memory information of the buffer queue to the other party is defined in the protocol message.
(C) There are an interrupt mode and a no interrupt mode (polling mode) as methods for handling data input / output. Similarly, in the setting processing phase, the operation mode defining area is defined in the protocol message in order to negotiate this in advance before the connection is completed.
(D) In order to realize the interrupt mode, the message type for notifying the other party of the update notification every time the buffer queue is updated is defined in the protocol.

2.本発明は、更新通知なしで、通信デバイスがポーリングモードでデータ転送を実現するために、設定フェーズ時に動作モードとして、割り込み無しモード(ポーリングモード)をサポートしたことを特徴とする。 2. The present invention is characterized in that a non-interrupt mode (polling mode) is supported as an operation mode in the setting phase so that the communication device can perform data transfer in a polling mode without an update notification.

3.本発明は、仮想マシン、外部プロセスそれぞれにおいて、切断状態を検知した場合、自身の内部へリンクダウン通知することにより、動作の不定状態を防止可能にすることを特徴とする。 3. The present invention is characterized in that, when a disconnection state is detected in each of a virtual machine and an external process, an indefinite state of operation can be prevented by notifying itself of a link down.

4.本発明は、切断状態になった場合、再接続のフェーズにステート遷移することにより、再接続可能にしたことを特徴とする。 4). The present invention is characterized in that when a disconnected state is established, the state can be reconnected by making a state transition to a reconnection phase.

5.本発明は、仮想マシン・ゲストOSおよび、外部プロセスと、停止・起動の2つのステート状態とを組み合わせ、各状態遷移においても、再接続可能な状態に遷移することを実現する共有バッファキュー拡張用プロトコルのシグナリングを規定したことを特徴とする。 5. The present invention combines a virtual machine / guest OS, an external process, and two state states of stop and start, and for sharing buffer queue expansion that realizes transition to a reconnectable state in each state transition It is characterized by defining protocol signaling.

10:通信デバイスインタフェース
20:送信用・受信用共有バッファキュー管理部1
30:基本設定処理部1
40:通信部(クライアント)
50:インタフェース部
60:共有バッファキュー操作部
70:基本設定処理部2
80:通信部(サーバ)
100:通信デバイス1
200:通信デバイス2
10: Communication device interface 20: Transmission / reception shared buffer queue management unit 1
30: Basic setting processing unit 1
40: Communication unit (client)
50: Interface unit 60: Shared buffer queue operation unit 70: Basic setting processing unit 2
80: Communication unit (server)
100: Communication device 1
200: Communication device 2

Claims (3)

仮想マシン及び前記仮想マシン外に形成された外部プロセスが動作可能なホストOSを有する物理マシンと、
前記仮想マシン内で動作するゲストOSに、前記仮想マシンと前記外部プロセスとを直接接続する仮想通信路を構築させる通信路構築手段と、
を備える仮想通信路構築システムであって、
前記通信路構築手段は、
前記仮想マシンと前記ゲストOSとの間のデータ転送用として形成された共有バッファキューについて、前記仮想マシンが前記ゲストOSから取得した共有バッファキュー情報を前記外部プロセスへ提供することで前記共有バッファキューのデータ転送先を前記外部プロセスへ拡張して前記仮想通信路を構築するとともに、前記ゲストOSと前記外部プロセスとの間の通信に関する手続きを実現させる共有バッファキュー拡張用プロトコル機能と、
前記仮想通信路において、前記仮想マシンと前記外部プロセスとの通信が確立している又は切断しているという接続状態を検知する接続状態検知機能と、
前記接続状態をそれぞれ前記ゲストOSと前記外部プロセス上の処理ロジックに通知する接続状態通知機能と、
前記仮想マシンと前記外部プロセスとの通信が切断しているときに定期的に通信先と再接続する再接続機能と、
することを特徴とする想通信路構築システム。
A physical machine having a virtual machine and a host OS capable of operating an external process formed outside the virtual machine;
A communication path constructing means for constructing a virtual communication path for directly connecting the virtual machine and the external process to the guest OS operating in the virtual machine;
A virtual communication path construction system comprising :
The communication path construction means includes
For the shared buffer queue formed for data transfer between the virtual machine and the guest OS, the shared buffer queue information acquired from the guest OS by the virtual machine is provided to the external process, so that the shared buffer queue A protocol function for extending the shared buffer queue that extends the data transfer destination to the external process and constructs the virtual communication path, and realizes a procedure related to communication between the guest OS and the external process ;
A connection state detection function for detecting a connection state that communication between the virtual machine and the external process is established or disconnected in the virtual communication path;
A connection status notification function for notifying the connection state to each of the guest OS and processing logic on the external process,
A reconnection function for periodically reconnecting to a communication destination when communication between the virtual machine and the external process is disconnected ;
Virtual communication path construction system characterized by have a.
仮想マシン及び前記仮想マシン外に形成される外部プロセスが動作可能なホストOSを有する物理マシン上に、前記仮想マシン及び前記外部プロセスを形成する仮想マシン形成手順と、
前記仮想マシン内で動作するゲストOSに、前記仮想マシンと前記外部プロセスとを直接接続する仮想通信路を構築させる仮想通信路構築手順とを行う仮想通信路構築方法であって、
前記仮想通信路構築手順は、
前記仮想マシンと前記ゲストOSとの間のデータ転送用として形成された共有バッファキューについて、前記仮想マシンが前記ゲストOSから取得した共有バッファキュー情報を前記外部プロセスへ提供することで前記共有バッファキューのデータ転送先を前記外部プロセスへ拡張して前記仮想通信路を構築するとともに、前記ゲストOSと前記外部プロセスとの間の通信に関する手続きを実現させる共有バッファキュー拡張ステップと、
前記仮想通信路において、前記仮想マシンと前記外部プロセスとの通信が確立している又は切断しているという接続状態を検知する接続状態検知ステップと、
前記接続状態をそれぞれ前記ゲストOSと前記外部プロセス上の処理ロジックに通知する接続状態通知ステップと、
前記仮想マシンと前記外部プロセスとの通信が切断しているときに定期的に通信先と再接続する再接続ステップと、
することを特徴とする想通信路構築方法。
A virtual machine forming procedure for forming the virtual machine and the external process on a physical machine having a virtual machine and a host OS capable of operating an external process formed outside the virtual machine;
A virtual communication path construction method for performing a virtual communication path construction procedure for constructing a virtual communication path for directly connecting the virtual machine and the external process to a guest OS operating in the virtual machine ,
The virtual channel construction procedure is:
For the shared buffer queue formed for data transfer between the virtual machine and the guest OS, the shared buffer queue information acquired from the guest OS by the virtual machine is provided to the external process, thereby providing the shared buffer queue. Extending the data transfer destination to the external process to construct the virtual communication path, and realizing a shared buffer queue extending step for realizing a procedure related to communication between the guest OS and the external process ;
A connection state detection step of detecting a connection state in which communication between the virtual machine and the external process is established or disconnected in the virtual communication path;
A connection state notification step of notifying the connection state to each of the guest OS and processing logic on the external process,
A reconnection step of periodically reconnecting to a communication destination when communication between the virtual machine and the external process is disconnected ;
Virtual communication path construction method, characterized by have a.
仮想マシン及び前記仮想マシン外に形成される外部プロセスが動作可能なホストOSを有する物理マシンに、請求項に記載の仮想通信路構築方法を実現させるための仮想通信路構築プログラム。 A virtual communication path construction program for causing a physical machine having a virtual machine and a host OS capable of operating an external process formed outside the virtual machine to realize the virtual communication path construction method according to claim 2 .
JP2014076807A 2014-04-03 2014-04-03 Virtual channel construction system, virtual channel construction method, and virtual channel construction program Active JP5960186B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014076807A JP5960186B2 (en) 2014-04-03 2014-04-03 Virtual channel construction system, virtual channel construction method, and virtual channel construction program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014076807A JP5960186B2 (en) 2014-04-03 2014-04-03 Virtual channel construction system, virtual channel construction method, and virtual channel construction program

Publications (2)

Publication Number Publication Date
JP2015197874A JP2015197874A (en) 2015-11-09
JP5960186B2 true JP5960186B2 (en) 2016-08-02

Family

ID=54547494

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014076807A Active JP5960186B2 (en) 2014-04-03 2014-04-03 Virtual channel construction system, virtual channel construction method, and virtual channel construction program

Country Status (1)

Country Link
JP (1) JP5960186B2 (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6548010B2 (en) * 2015-06-16 2019-07-24 日本電気株式会社 Para-virtualized network device, information processing apparatus, information processing method, and information processing program
CN106844066B (en) * 2017-01-22 2022-09-27 腾讯科技(深圳)有限公司 Application operation method, device and system
JP6737471B2 (en) 2017-03-30 2020-08-12 日本電気株式会社 Control device, control system, control method, and program
JP7083717B2 (en) * 2018-07-23 2022-06-13 ルネサスエレクトロニクス株式会社 Semiconductor equipment
CN109240802B (en) * 2018-09-21 2022-02-18 北京百度网讯科技有限公司 Request processing method and device
JP7251648B2 (en) * 2019-10-08 2023-04-04 日本電信電話株式会社 In-server delay control system, in-server delay control device, in-server delay control method and program
EP4083803A4 (en) 2019-12-23 2023-10-04 Nippon Telegraph And Telephone Corporation Intra-server delay control device, intra-server delay control method, and program
JP7400587B2 (en) 2020-03-30 2023-12-19 横河電機株式会社 Communication processing device, program, and communication processing method
JPWO2022172366A1 (en) * 2021-02-10 2022-08-18
CN116982030A (en) * 2021-03-18 2023-10-31 日本电信电话株式会社 In-server delay control device, in-server delay control method, and program
JP2023003987A (en) 2021-06-25 2023-01-17 富士通株式会社 Information processing apparatus, information processing program, and information processing method
WO2023144878A1 (en) * 2022-01-25 2023-08-03 日本電信電話株式会社 Intra-server delay control device, intra-server delay control method, and program

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5365051B2 (en) * 2008-03-31 2013-12-11 富士通株式会社 Management program, management apparatus and management method
US8739177B2 (en) * 2010-06-21 2014-05-27 Intel Corporation Method for network interface sharing among multiple virtual machines
JP2013242644A (en) * 2012-05-18 2013-12-05 Panasonic Corp Virtual computer system, control method, and program
JP2014032498A (en) * 2012-08-02 2014-02-20 Mitsubishi Electric Corp Fault reproduction system for computer

Also Published As

Publication number Publication date
JP2015197874A (en) 2015-11-09

Similar Documents

Publication Publication Date Title
JP5960186B2 (en) Virtual channel construction system, virtual channel construction method, and virtual channel construction program
US20220030095A1 (en) Methods and apparatus for sharing and arbitration of host stack information with user space communication stacks
JP3805725B2 (en) Gateway, home network system, and message passing method enabling message passing between devices on home network using different middleware
US8625448B2 (en) Method and system for validating network traffic classification in a blade server
US20060059287A1 (en) Methods and apparatus for enabling bus connectivity over a data network
US8107360B2 (en) Dynamic addition of redundant network in distributed system communications
CN112910685B (en) Method and device for realizing unified management of container network
CN102984237B (en) A kind of data transmission system and method connecting based on socket
JP2010183450A (en) Network interface device
WO2017028399A1 (en) Communication data transmission method and system
KR20220157317A (en) Methods and systems for service distribution using data path state replication and intermediate device mapping
US9118621B2 (en) Network controller, method, and medium
CN106452951A (en) Information processing method, device and system
JP5018969B2 (en) COMMUNICATION CONTROL PROGRAM, COMMUNICATION CONTROL DEVICE, COMMUNICATION CONTROL SYSTEM, AND COMMUNICATION CONTROL METHOD
KR100597405B1 (en) System and method for relaying data by use of socket applicaton program
US20160261719A1 (en) Information processing system, control program, and control method
JP4415391B2 (en) Method and apparatus for transmitting data to a network and method and apparatus for receiving data from a network
US8737413B2 (en) Relay server and relay communication system
JP6677052B2 (en) Communication management device, communication management method and program
US9787805B2 (en) Communication control system and communication control method
US11188346B2 (en) Obtaining environment information in a computing environment
US11106359B1 (en) Interconnection of peripheral devices on different electronic devices
JP7456624B2 (en) Network management device, initial setting method and program
US20130179531A1 (en) Network communications apparatus, method, and medium
WO2022254517A1 (en) Communication system and communication control method

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160224

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20160329

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20160526

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20160622

R150 Certificate of patent or registration of utility model

Ref document number: 5960186

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150