US10127067B2ActiveUtilityA1

Method and computing device for selecting protocol stack for virtual machines

62
Assignee: HUAWEI TECH CO LTDPriority: Oct 29, 2013Filed: Apr 27, 2016Granted: Nov 13, 2018
Est. expiryOct 29, 2033(~7.3 yrs left)· nominal 20-yr term from priority
H04L 69/321H04L 69/12G06F 2009/45562H04L 49/70G06F 9/45558G06F 9/544H04L 69/162
62
PatentIndex Score
1
Cited by
23
References
15
Claims

Abstract

A method and computing device for selecting a protocol stack for performing protocol processing on data is presented. The computing device is configured with a hypervisor for managing a first virtual machine. According to the method, when a socket creation instruction sent by the first virtual machine is received, a protocol stack instance is selected from the protocol stack instances provided by the computing device. Then, a socket is created in the selected protocol stack instance according to the socket creation instruction; and a creation result is transmitted to the first virtual machine. Therefore, in a virtualized environment, multiple virtual machines disposed in a same computing device can share a network protocol processing capability, and protocol stacks of the virtual machines achieve load balance.

Claims

exact text as granted — not AI-modified
What is claimed is: 
     
       1. A method, performed by a computing device hosting a first virtual machine, the computing device configured with a hypervisor for managing the first virtual machine, the method comprising:
 receiving, by the hypervisor from the first virtual machine, a socket creation instruction to create a first socket; 
 selecting a first protocol stack instance from a plurality of protocol stack instances in the hypervisor of the computing device according to a prestored correspondence between a virtual machine identifier and a protocol stack instance identifier; 
 creating the first socket in the first protocol stack instance according to the socket creation instruction; 
 sending a correspondence between the first socket and an identifier of the first protocol stack instance in the hypervisor to the first virtual machine; and 
 performing, according to the correspondence, data processing for the first virtual machine based on the first socket in the first protocol stack instance in the hypervisor. 
 
     
     
       2. The method according to  claim 1 , wherein the computing device further hosts a second virtual machine, and the method further comprising performing a protocol processing function for data of the second virtual machine using the first protocol stack instance such that the first protocol stack instance is used to perform one or more data encapsulation functions for both the first virtual machine and the second virtual machine. 
     
     
       3. The method according to  claim 2 , further comprising:
 receiving a first data transmission instruction for transmitting data to the second virtual machine based on the first socket; and 
 transmitting, using the first protocol stack instance, the data to be transmitted to the second virtual machine based on the first socket to a protocol stack offload apparatus in the second virtual machine, the protocol stack offload apparatus in the second virtual machine being configured to perform data transmission between the first protocol stack instance and the second virtual machine and further configured to transmit the data to an application process in the second virtual machine. 
 
     
     
       4. The method according to  claim 1 , wherein selecting the first protocol stack instance from the plurality of protocol stack instances provided by the computing device comprises selecting the first protocol stack instance from the plurality of protocol stack instances according to a load balance principle. 
     
     
       5. The method according to  claim 1 , wherein selecting the first protocol stack instance from the plurality of protocol stack instances in the hypervisor comprises:
 determining an application process corresponding to the first socket according to the socket creation instruction; 
 determining a service feature of the application process according to historical information about socket creation of the application process; and 
 selecting the first protocol stack instance from the plurality of protocol stack instances according to the service feature of the application process. 
 
     
     
       6. The method according to  claim 1 , wherein selecting the first protocol stack instance from the plurality of protocol stack instances in the hypervisor comprises selecting the first protocol stack instance from the plurality of protocol stack instances according to attribute information of the first socket according to the socket creation instruction. 
     
     
       7. The method according to  claim 1 , wherein after sending the correspondence between the first socket and the identifier of the first protocol stack instance to the first virtual machine, the method further comprises:
 receiving, by the hypervisor from the first virtual machine, a control instruction for performing a control operation on the first socket; 
 determining, according to the correspondence between the first socket and the identifier of the first protocol stack instance, the first protocol stack instance corresponding to the first socket; 
 performing the control operation on the first socket in the first protocol stack instance in the hypervisor according to the control instruction; and 
 transmitting, from the hypervisor to the first virtual machine, an operation result of the control operation performed on the first socket according to the control instruction from the first virtual machine. 
 
     
     
       8. A computing device for hosting a first virtual machine and a second virtual machine, the computing device comprising:
 a non-transitory computer readable storage medium having stored thereon computer-executable instructions for the first virtual machine and a hypervisor for managing the first virtual machine; and 
 a processor coupled to the non-transitory computer readable storage medium, the instructions causing the processor to be configured to:
 send, from the first virtual machine to the hypervisor, a socket creation instruction so as to create a first socket; 
 receive the socket creation instruction from the first virtual machine; 
 determine an application process corresponding to the socket creation instruction; 
 determine a service feature of the application process according to historical information about socket creation of the application process; 
 select, according to the service feature of the application process, a first protocol stack instance from a plurality of protocol stack instances provided by the computing device; 
 create the first socket in the first protocol stack instance according to the socket creation instruction; 
 send a correspondence between the first socket and an identifier of the first protocol stack instance to the first virtual machine; and 
 perform, according to the correspondence, data processing based on the first socket in the first protocol stack instance for the first virtual machine. 
 
 
     
     
       9. The computing device according to  claim 8 , wherein the computing device further hosts the second virtual machine, and the first protocol stack instance being provided a protocol processing function so as to process data of the second virtual machine. 
     
     
       10. The computing device according to  claim 9 , wherein the instructions further cause the processor to be configured to:
 receive a first data transmission instruction for transmitting data to the second virtual machine based on the first socket; and 
 transmit, using the first protocol stack instance, the data to be transmitted to the second virtual machine based on the first socket to a protocol stack offload apparatus in the second virtual machine, the protocol stack offload apparatus in the second virtual machine being configured to:
 perform data transmission between the first protocol stack instance and the second virtual machine; and 
 transmit the data to an application process in the second virtual machine. 
 
 
     
     
       11. The computing device according to  claim 8 , wherein the instructions further cause the processor to be configured to determine that a virtual device used for data transmission is not a virtual network interface card (NIC) of the first virtual machine. 
     
     
       12. The computing device according to  claim 8 , wherein the instructions further cause the processor to be configured to determine, according to the service feature of the application process, that a virtual device used for data transmission is not a virtual network interface card (NIC) of the first virtual machine. 
     
     
       13. The computing device according to  claim 8 , wherein the instructions further cause the processor to be configured to determine, according to attribute information of the first socket according to the socket creation instruction, that a virtual device used for data transmission is not a virtual network interface card (NIC) of the first virtual machine. 
     
     
       14. The computing device according to  claim 8 , wherein the instructions further cause the processor to be configured to:
 receive, from the first virtual machine, a control instruction for performing a control operation on the first socket; 
 determine, according to the correspondence between the first socket and the identifier of the first protocol stack instance, the first protocol stack instance corresponding to the first socket in the control instruction; 
 perform the control operation on the first socket in the first protocol stack instance according to the control instruction; and 
 transmit, from the hypervisor to the first virtual machine, an operation result of the control operation performed on the first socket according to the control instruction from the first virtual machine. 
 
     
     
       15. A method, performed by a computing device hosting a first virtual machine, the computing device being configured with a hypervisor so as to manage the first virtual machine, the method comprising:
 receiving a socket creation instruction from the first virtual machine; 
 selecting, according to a prestored correspondence between a first identifier of the first virtual machine and a second identifier of a first protocol stack instance, the first protocol stack instance from a plurality of protocol stack instances provided by the computing device; 
 creating a first socket in the first protocol stack instance according to the socket creation instruction; 
 sending, to the first virtual machine, a correspondence relating the first socket and the identifier of the first protocol stack instance; and 
 performing, according to the correspondence, data processing based on the first socket in the first protocol stack instance for the first virtual machine.

Cited by (0)

No later patents cite this yet.

References (0)

No backward citations on record.