Data transmission method and system, electronic equipment and computer readable storage medium
By intercepting data packets at the application layer of the virtual machine and encapsulating them in a virtual switch, the problem of low data transmission efficiency in virtual machines is solved, achieving low-latency and high-bandwidth network transmission.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2026-03-31
AI Technical Summary
In traditional cloud networks, virtual machines have low data transmission efficiency, making it difficult to meet the network communication requirements of low latency and high bandwidth.
By intercepting data packets to be transmitted at the application layer of the virtual machine, the data is bypassed from the virtual machine's transport layer and transmitted directly to the virtual switch, where it is encapsulated, thus avoiding processing by the virtual machine's transport layer.
It greatly reduces the performance overhead of virtual machines, improves data transmission efficiency, and meets the requirements of low latency and high bandwidth for network transmission.
Smart Images

Figure CN121771305A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and more specifically, to a data transmission method, system, electronic device, and computer-readable storage medium. Background Technology
[0002] With the development of artificial intelligence (AI) network technology, the requirements for low latency and high bandwidth in network communication are becoming increasingly stringent.
[0003] Currently, in traditional cloud networks, when virtual machines transmit data, the data to be transmitted from the application layer of the virtual machine is typically encapsulated by the transport layer within the virtual machine. Then, the encapsulated data packet is transmitted to the physical host or a virtual switch in the smart network interface card via a virtual device interface (e.g., Virtio interface). However, when the amount of data to be transmitted is large, the data processing pressure on the virtual machine's transport layer is significant, impacting network transmission performance and resulting in low data transmission efficiency. This makes it difficult to meet the demands for low latency and high bandwidth in network communication.
[0004] There is currently no effective solution to the above problems. Summary of the Invention
[0005] This application provides a data transmission method, system, electronic device, and computer-readable storage medium to at least solve the technical problem of low data transmission efficiency in virtual machines.
[0006] According to one aspect of the embodiments of this application, a data transmission method is provided, applied at a sending end, the sending end being used to transmit data to a receiving end, and including a virtual machine and a virtual switch, the virtual machine including at least an application layer running on the virtual machine. The method includes: detecting a data packet to be transmitted from the application layer; calling a socket port connected to the application layer to intercept the data packet to be transmitted; transmitting the intercepted data packet to be transmitted to the virtual switch in the sending end; controlling the virtual switch in the sending end to encapsulate the intercepted data packet to be transmitted; determining the address information of the receiving end from the encapsulated data packet to be transmitted, and transmitting the encapsulated data packet to be transmitted to the receiving end according to the address information.
[0007] According to another aspect of the embodiments of this application, a data transmission method is also provided, applied to a virtual machine in a sending end, the sending end being used to transmit data to a receiving end, the virtual machine including at least an application layer running on the virtual machine, the method including: detecting a data packet to be transmitted in the application layer; calling a socket port connected to the application layer to intercept the data packet to be transmitted; transmitting the intercepted data packet to be transmitted to a virtual switch in the sending end, wherein the intercepted data packet to be transmitted is encapsulated by the virtual switch, the encapsulated data packet to be transmitted including the address information of the receiving end, the address information being used to transmit the encapsulated data packet to the receiving end.
[0008] According to another aspect of the embodiments of this application, a data transmission method is also provided, applied to a virtual switch in a sending end, the sending end being used to transmit data to a receiving end, the method comprising: receiving a data packet to be transmitted from a virtual machine in the sending end, wherein the data packet to be transmitted is a data packet to be transmitted from the application layer intercepted by the virtual machine calling a socket port connected to the application layer in the virtual machine; encapsulating the data packet to be transmitted by calling a network transmission protocol matched with the receiving end, obtaining an encapsulation result; encapsulating the encapsulation result according to the network communication information of the receiving end, obtaining an encapsulated data packet to be transmitted; determining the address information of the receiving end from the encapsulated data packet to be transmitted, and transmitting the encapsulated data packet to be transmitted to the receiving end according to the address information.
[0009] According to another aspect of the embodiments of this application, a data transmission method is also provided, applied to a receiving end, the receiving end including a virtual machine and a virtual switch, the virtual machine including at least an application layer running on the virtual machine, the method including: receiving an encapsulated data packet to be transmitted from a sending end, wherein the encapsulated data packet to be transmitted is obtained by encapsulating an intercepted data packet to be transmitted through the virtual switch in the sending end, the intercepted data packet to be transmitted is obtained by the sending end calling a socket port connected to the application layer of the sending end to intercept the data packet to be transmitted of the application layer of the sending end, and the intercepted data packet to be transmitted is transmitted from the socket port to the virtual switch in the sending end; controlling the virtual switch in the receiving end to decapsulate the encapsulated data packet to be transmitted; calling the socket port connected to the application layer of the virtual machine in the receiving end to send the decapsulated data packet to be transmitted to the application layer of the virtual machine in the receiving end.
[0010] According to another aspect of the embodiments of this application, a data transmission apparatus is also provided, the apparatus comprising: a first detection unit for detecting a data packet to be transmitted at the application layer; a first invocation unit for invoking a socket port connected to the application layer to intercept the data packet to be transmitted; a first interception unit for transmitting the intercepted data packet to be transmitted to a virtual switch in the sending end; a first control unit for controlling the virtual switch in the sending end to encapsulate the intercepted data packet to be transmitted; and a first transmission unit for determining the address information of the receiving end from the encapsulated data packet to be transmitted, and transmitting the encapsulated data packet to be transmitted to the receiving end according to the address information.
[0011] According to another aspect of the embodiments of this application, a data transmission apparatus is also provided, the apparatus comprising: a second detection unit for detecting a data packet to be transmitted at the application layer; a second invocation unit for invoking a socket port connected to the application layer to intercept the data packet to be transmitted; and a second interception unit for transmitting the intercepted data packet to be transmitted to a virtual switch in the sending end, wherein the intercepted data packet to be transmitted is encapsulated by the virtual switch, and the encapsulated data packet to be transmitted includes address information of the receiving end, the address information being used to transmit the encapsulated data packet to the receiving end.
[0012] According to another aspect of the embodiments of this application, a data transmission apparatus is also provided, comprising: a first receiving unit, configured to receive a data packet to be transmitted from a virtual machine in a sending end, wherein the data packet to be transmitted is a data packet to be transmitted from the application layer intercepted by the virtual machine calling a socket port connected to the application layer in the virtual machine; a third calling unit, configured to call a network transmission protocol matching the receiving end to encapsulate the data packet to be transmitted, and obtain an encapsulation result; an encapsulation unit, configured to encapsulate the encapsulation result according to the network communication information of the receiving end, and obtain an encapsulated data packet to be transmitted; and a second transmitting unit, configured to determine the address information of the receiving end from the encapsulated data packet to be transmitted, and transmit the encapsulated data packet to the receiving end according to the address information.
[0013] According to another aspect of the embodiments of this application, a data transmission apparatus is also provided, the apparatus comprising: a second receiving unit, configured to receive an encapsulated data packet to be transmitted from a sending end, wherein the encapsulated data packet to be transmitted is obtained by encapsulating an intercepted data packet to be transmitted through a virtual switch in the sending end, the intercepted data packet to be transmitted is obtained by the sending end calling a socket port connected to the application layer of the sending end to intercept the data packet to be transmitted of the application layer of the sending end, and the intercepted data packet to be transmitted is transmitted from the socket port to the virtual switch in the sending end; a second control unit, configured to control the virtual switch in the receiving end to decapsulate the encapsulated data packet to be transmitted; and a third calling unit, configured to call a socket port connected to the application layer of a virtual machine in the receiving end to send the decapsulated data packet to be transmitted to the application layer of the virtual machine in the receiving end.
[0014] According to another aspect of the embodiments of this application, a computer terminal is also provided, including: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods in various embodiments of this application when it runs.
[0015] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored executable program, wherein, when the executable program is running, it controls the device where the computer-readable storage medium is located to perform the methods of various embodiments of this application.
[0016] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the methods of various embodiments of this application.
[0017] According to another aspect of the embodiments of this application, a computer program product is also provided, including a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods in various embodiments of this application.
[0018] According to another aspect of the embodiments of this application, a computer program is also provided, which, when executed by a processor, implements the methods of the various embodiments of this application.
[0019] This application provides a data transmission method applied to a sending end. The sending end transmits data to a receiving end and includes a virtual machine and a virtual switch. The virtual machine includes at least an application layer. When a data packet to be transmitted is detected in the application layer, the sending end calls a socket port connected to the application layer to intercept the data packet. The intercepted data packet is then transmitted to the virtual switch in the sending end. The virtual switch in the sending end is controlled to encapsulate the intercepted data packet. The address information of the receiving end is determined from the encapsulated data packet, and the encapsulated data packet is transmitted to the receiving end according to the address information. In other words, when the virtual machine in this application performs data transmission, it can intercept the data packet to be transmitted by calling a socket port connected to the application layer in the virtual machine. This allows the data packet to bypass the transport layer in the virtual machine, that is, it is transmitted directly to the virtual switch without being encapsulated by the transport layer in the virtual machine. The virtual switch then encapsulates the data packet and transmits the encapsulated data packet to the receiving end. Therefore, the data to be transmitted in this embodiment of the application does not need to be encapsulated by the transport layer in the virtual machine, which greatly reduces the performance overhead of the virtual machine, meets the requirements of low latency and high bandwidth in the entire network transmission process, improves the data transmission efficiency of the virtual machine, and thus solves the technical problem of low data transmission efficiency of the virtual machine.
[0020] It is worth noting that the general description above and the detailed description that follow are merely for illustrative purposes and do not constitute a limitation on this application. Attached Figure Description
[0021] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0022] Figure 1 This is a hardware structure block diagram corresponding to a data transmission method according to an embodiment of this application;
[0023] Figure 2 This is a structural block diagram of a computing environment according to an embodiment of this application;
[0024] Figure 3 This is a structural block diagram of a service mesh according to an embodiment of this application;
[0025] Figure 4 This is a flowchart of a data transmission method according to an embodiment of this application;
[0026] Figure 5 This is a flowchart of another data transmission method according to an embodiment of this application;
[0027] Figure 6 This is a flowchart of another data transmission method according to an embodiment of this application;
[0028] Figure 7 This is a flowchart of another data transmission method according to an embodiment of this application;
[0029] Figure 8 This is a schematic diagram of a data transmission system according to an embodiment of this application;
[0030] Figure 9 This is a schematic diagram of data transmission in a virtual machine according to an embodiment of this application;
[0031] Figure 10 This is a schematic diagram of data transmission in a virtual machine according to an embodiment of this application;
[0032] Figure 11 This is a flowchart of a method for sending a data packet to be transmitted according to an embodiment of this application;
[0033] Figure 12 This is a flowchart of a method for receiving a data packet to be transmitted according to an embodiment of this application;
[0034] Figure 13 This is a schematic diagram of a network layer in a virtual machine according to an embodiment of this application;
[0035] Figure 14 This is a schematic diagram of a cache or ACK mechanism according to an embodiment of this application;
[0036] Figure 15 This is a schematic diagram illustrating the development of a network congestion control strategy according to an embodiment of this application;
[0037] Figure 16 This is a schematic diagram of a data transmission device according to an embodiment of this application;
[0038] Figure 17 This is a schematic diagram of another data transmission apparatus according to an embodiment of this application;
[0039] Figure 18 This is a schematic diagram of another data transmission apparatus according to an embodiment of this application;
[0040] Figure 19 This is a schematic diagram of another data transmission apparatus according to an embodiment of this application;
[0041] Figure 20 This is a structural block diagram of an electronic device according to an embodiment of this application. Detailed Implementation
[0042] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0043] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0044] First, some nouns or terms that appear in the description of the embodiments of this application shall be interpreted as follows:
[0045] Transmission Control Protocol (TCP) is a connection-oriented, reliable, byte-stream-based transport layer protocol. TCP ensures reliable data transmission by using sequence numbers and acknowledgment mechanisms to guarantee data correctness and integrity. TCP is suitable for applications that require reliable data transmission, such as file transfer and email.
[0046] User Datagram Protocol (UDP) is a connectionless and unreliable transport layer protocol. UDP does not provide reliable data transmission and error recovery mechanisms. Data packets may be lost or out of order. UDP is suitable for real-time applications, such as audio and video transmission, and scenarios with high transmission speed requirements.
[0047] The Internet Protocol (IP) is a network layer protocol used to transmit data packets in a network. The IP protocol uses IP addresses to identify devices in the network and transmits data packets from the sender to the receiver through routers. The IP protocol is the basic protocol of the Internet and together with the TCP and UDP protocols, it forms the Internet Protocol Suite.
[0048] Software-defined networking (SDN) is a network architecture based on software control that separates the network control plane from the data plane. It uses a centralized controller to manage and configure network devices, providing a more flexible and programmable network management approach.
[0049] Virtual Extensible LAN (VXLAN) is a virtualized extended local area network technology that provides larger-scale network connectivity and more flexible network deployment by creating virtual networks on existing network infrastructure. VXLAN networks can achieve interconnection across data centers and physical networks, providing higher network scalability and flexibility.
[0050] A virtual machine (VM) is a computer system based on virtualization technology that allows multiple independent virtual machine operating systems to run simultaneously on a single physical host. Each virtual machine has its own independent operating system, applications, and resources, and can run like an independent physical computer.
[0051] A Virtual Private Cloud (VPC) is a virtual network environment based on cloud computing technology. It creates a virtual, isolated network space on a public cloud infrastructure, allowing users to deploy their own applications and services within it. VPCs provide a secure, flexible, and scalable network environment, and users can customize network topology, IP address ranges, subnets, and routing rules according to their needs.
[0052] Elastic Network Interface (ENI) is a network resource in cloud computing used to connect virtual machine instances and cloud services. ENI can be associated with virtual machine instances through Virtual Private Cloud (VPC) or subnet to provide network connectivity for the instances, and supports multiple IP addresses and multiple network interfaces.
[0053] Upper Layer Protocol (ULP) refers to protocols that operate above the transport layer and are used to provide specific functions or services. ULP protocols are typically used at the application layer. For example, protocols such as HTTP, FTP, and SMTP belong to ULP protocols. ULP protocols are responsible for encapsulating or decapsulating data so that applications can communicate and exchange data.
[0054] According to an embodiment of this application, a data transmission method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0055] The method embodiment provided in Embodiment 1 of this application can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing a data transmission method is shown. Figure 1 As shown, the computer terminal 10 (or mobile device) may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor (MCU) or a programmable gate array (FPGA), etc.), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may include: a display, an input / output interface (I / O interface), a Universal Serial Bus (USB) port (which may be included as one of the ports of the USB bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0056] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0057] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the method in the embodiments of this application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the method in the above embodiments. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0058] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0059] The display can be, for example, a touchscreen liquid crystal display (LCD), which allows the user to interact with the user interface of the computer terminal 10 (or mobile device).
[0060] Figure 1 The hardware structure block diagram shown can serve not only as an exemplary block diagram of the aforementioned computer terminal 10 (or mobile device), but also as an exemplary block diagram of the aforementioned server. In one optional embodiment, Figure 2 The use of the above is illustrated in a block diagram. Figure 1 The computer terminal 10 (or mobile device) shown is an embodiment of a computing node in computing environment 201. Figure 2 A block diagram of a computing environment is shown, such as Figure 2As shown, computing environment 201 includes multiple computing nodes (such as servers) running on a distributed network (shown as 210-1, 210-2, ... in the diagram). Each computing node contains local processing and memory resources, and end user 202 can remotely run applications or store data within computing environment 201. Applications can be provided as multiple services 220-1, 220-2, 220-3, and 220-4 within computing environment 201, representing services "A", "D", "E", and "H", respectively.
[0061] End user 202 can provide and access services through a web browser or other software application on a client. In some embodiments, the provisioning and / or requests of end user 202 can be provided to ingress gateway 230. Ingress gateway 230 may include a corresponding agent to handle the provisioning and / or requests for services (one or more services provided in computing environment 201).
[0062] Services are provided or deployed based on various virtualization technologies supported by the Computing Environment 201. In some embodiments, services may be provided based on Virtual Machine (VM)-based virtualization, container-based virtualization, and / or similar methods. Virtual Machine-based virtualization can simulate a real computer by initializing a virtual machine, executing programs and applications without directly accessing any actual hardware resources. While the virtual machine virtualizes the machine, container-based virtualization can launch containers to virtualize an entire operating system (OS), allowing multiple workloads to run on a single OS instance.
[0063] In one embodiment based on container virtualization, several containers of a service can be assembled into a Pod (e.g., a Kubernetes Pod). For example, such as Figure 2 As shown, service 220-2 can be equipped with one or more Pods 240-1, 240-2, ..., 240-N (collectively referred to as Pods). A Pod can include a proxy 245 and one or more containers 242-1, 242-2, ..., 242-M (collectively referred to as containers). One or more containers within a Pod handle requests related to one or more corresponding functions of the service. Proxy 245 typically controls service-related network functions such as routing and load balancing. Other services can also be equipped with similar Pods.
[0064] During operation, executing a user request from end user 202 may require invoking one or more services in computing environment 201, and executing one or more functions of one service may require invoking one or more functions of another service. For example... Figure 2As shown, service "A" 220-1 receives user requests from terminal user 202 from ingress gateway 230. Service "A" 220-1 can call service "D" 220-2, and service "D" 220-2 can request service "E" 220-3 to perform one or more functions.
[0065] The aforementioned computing environment can be a cloud computing environment, where resource allocation is managed by cloud services, allowing functionality development without needing to consider implementation, adjustment, or server scaling. This computing environment allows developers to execute event-responsive code without building or maintaining complex infrastructure. Services can be partitioned into a set of functions that can automatically and independently scale, rather than scaling a single hardware device to handle potential loads.
[0066] In another alternative embodiment, Figure 3 The use of the above is illustrated in a block diagram. Figure 1 The computer terminal 10 (or mobile device) shown is an embodiment of a service mesh. Figure 3 A block diagram of a service mesh structure is shown, such as Figure 3 As shown, the service mesh 300 is mainly used to facilitate secure and reliable communication between multiple microservices. Microservices refer to the decomposition of an application into multiple smaller services or instances, which are distributed across different clusters / machines.
[0067] like Figure 3 As shown, a microservice may include application service instance A and application service instance B, which together form the functional application layer of service mesh 300. In one implementation, application service instance A runs as a container / process 308 on machine / workload container group 314 (Pod), and application service instance B runs as a container / process 310 on machine / workload container group 316 (Pod).
[0068] In one implementation, application service instance A can be a data encapsulation service, and application service instance B can be a data transmission service.
[0069] like Figure 3As shown, application service instance A and grid proxy (sidecar) 303 coexist in machine workload container group 314, and application service instance B and grid proxy 305 coexist in machine workload container 316. Grid proxy 303 and grid proxy 305 form the data plane layer of service mesh 300. Grid proxy 303 and grid proxy 305 run as containers / processes 304 and 306 respectively, and can receive requests 312 for product query services. Grid proxy 303 and application service instance A can communicate bidirectionally, and grid proxy 305 and application service instance B can also communicate bidirectionally. Furthermore, grid proxy 303 and grid proxy 305 can also communicate bidirectionally with each other.
[0070] In one implementation, traffic from application service instance A is routed to the appropriate destination via mesh proxy 303, and network traffic from application service instance B is routed to the appropriate destination via mesh proxy 305. It should be noted that the network traffic mentioned here includes, but is not limited to, Hypertext Transfer Protocol (HTTP), Representational State Transfer (REST), high-performance, general-purpose open-source frameworks (Google Remote Procedure Call, gRPC), and open-source in-memory data structure storage systems (Redis).
[0071] In one implementation, the functionality of the extended data plane layer can be achieved by writing custom filters for the proxy (Envoy) in service mesh 300. The service mesh proxy configuration can enable the service mesh to correctly proxy service traffic, achieving service interoperability and service governance. Mesh proxy 303 and mesh proxy 305 can be configured to perform at least one of the following functions: service discovery, health checking, routing, load balancing, authentication and authorization, and observability.
[0072] like Figure 3 As shown, the service mesh 300 also includes a control plane layer. This control plane layer can consist of a set of services running in a dedicated namespace, hosted by a managed control plane component 301 within machine / workload container groups (machine / Pods) 302. Figure 3 As shown, the managed control plane component 301 communicates bidirectionally with grid agents 303 and 305. The managed control plane component 301 is configured to perform various control and management functions. For example, it receives telemetry data from grid agents 303 and 305 and can further aggregate this telemetry data. In addition to these services, the managed control plane component 301 can also provide a user-facing Application Programming Interface (API) to facilitate manipulation of network behavior and the provision of configuration data to grid agents 303 and 305.
[0073] Under the aforementioned operating environment, this application provides the following: Figure 4 The data transmission method shown is applied to the sending end, which transmits data to the receiving end and includes a virtual machine and a virtual switch. The virtual machine includes at least the application layer. Figure 4 This is a flowchart of a data transmission method according to an embodiment of this application. Figure 4 As shown, the method includes the following steps:
[0074] Step S401: The application layer data packet to be transmitted is detected.
[0075] In the technical solution provided in step S401 of this application, the application layer is the application layer in the virtual machine of the sending end. The application layer may include an application in the virtual machine. The data packet to be transmitted may be a data packet sent by the application. The data packet to be transmitted may carry the address information of the receiving end.
[0076] In this embodiment, the application layer in the virtual machine can send data to be transmitted, and the sending end can detect the data to be transmitted sent by the application layer in the virtual machine. After detecting the data to be transmitted from the application layer, the following step S402 is executed.
[0077] Step S402: Call the socket port connected to the application layer to intercept the data packet to be transmitted.
[0078] In the technical solution provided in step S402 of this application, the socket port (e.g., a Socket interface) is a data transmission interface on the socket layer (e.g., the Socket layer) in the virtual machine. One side of the socket layer connects to the application layer in the virtual machine, and the other side connects to the transport layer in the virtual machine. The transport layer can be understood as the network transport protocol stack in the virtual machine, such as the TCP / IP protocol stack. The virtual switch is a virtual switch running on the host machine or a smart network interface card.
[0079] In this embodiment, after detecting the data packet to be transmitted from the application layer in the virtual machine, the socket port connected to the application layer can be called to intercept the data packet to be transmitted from the application layer. That is, the data packet to be transmitted from the application layer is intercepted at the socket layer on the virtual machine, so that the intercepted data packet can bypass the transport layer in the virtual machine and be directly transmitted to the virtual switch at the sending end.
[0080] Optionally, the socket port can be invoked to intercept the data packets to be transmitted on the socket port using the Extended Berkeley Packet Filter (eBPF).
[0081] In the above steps, by calling the socket port connected to the application layer in the virtual machine, the data packets to be transmitted in the application layer can be intercepted. This allows the data packets to bypass the transport layer (TCP / IP protocol stack) in the virtual machine and be directly transmitted to the virtual switch. Since the data packets do not need to be processed by the transport layer in the virtual machine, the overhead of the virtual machine is greatly reduced and the data transmission efficiency of the virtual machine is improved.
[0082] Step S403: The intercepted data packet to be transmitted is transmitted to the virtual switch in the sending end.
[0083] In the technical solution provided by step S403 of this application, after intercepting the data packet to be transmitted, the intercepted data packet to be transmitted can be transmitted to the virtual switch in the sending end through the network card interface.
[0084] In this embodiment, the data redirection function (e.g., bpf_redirect) in the eBPF program can be used to forward the intercepted data packets to be transmitted directly to the virtual switch through the specified network card interface, thereby bypassing the TCP / IP protocol stack in the virtual machine.
[0085] In the above steps, after intercepting the data packet to be transmitted, the intercepted data packet can be directly transmitted to the virtual switch in the sending end through the specified network card interface, thereby bypassing the transport layer in the virtual machine. There is no need to perform protocol stack processing on the data packet to be transmitted in the virtual machine, saving virtual machine resource usage.
[0086] Step S404: Control the virtual switch in the sending end to encapsulate the intercepted data packets to be transmitted.
[0087] In the technical solution provided by step S404 of this application, the virtual switch runs on a host machine or a smart network interface card. Encapsulation of intercepted data packets to be transmitted is used to instruct the intercepted data packets to be transmitted to undergo transport layer encapsulation, and virtual scalable local area network (e.g., Overlay VXLAN) encapsulation technology is used to further encapsulate the data packets to be transmitted after transport layer encapsulation.
[0088] In this embodiment, after the virtual switch at the sending end receives the intercepted data packet to be transmitted, it can control the virtual switch to encapsulate the intercepted data packet to be transmitted twice. The first encapsulation is a transport layer encapsulation, that is, the intercepted data packet to be transmitted is encapsulated using the TCP / IP protocol; the second encapsulation is a re-encapsulation of the data packet after the transport layer encapsulation using Overlay VXLAN encapsulation technology, resulting in the encapsulated data packet to be transmitted.
[0089] In this step, the intercepted data packets to be transmitted are encapsulated twice in the virtual switch. Since the virtual switch runs on hardware, hardware acceleration technology can be used to complete the transport layer encapsulation and Overlay VXLAN encapsulation of the intercepted data packets to be transmitted on the virtual switch. Through the combination of hardware and software, the efficiency of data encapsulation and processing is greatly improved.
[0090] Step S405: Determine the address information of the receiving end from the encapsulated data packet to be transmitted, and transmit the encapsulated data packet to the receiving end according to the address information.
[0091] In the technical solution provided by step S405 of this application, the address information of the receiving end may include the IP information and port information of the receiving end.
[0092] In this embodiment, as described above, the data packet to be transmitted carries the address information of the receiving end. Based on this, the intercepted data packet to be transmitted is encapsulated in step S404, and the encapsulated data packet to be transmitted also carries the address information of the receiving end. Based on this, after the data packet is encapsulated, the address information of the receiving end can be determined from the encapsulated data packet to be transmitted, and then the encapsulated data packet to be transmitted is transmitted to the receiving end according to the obtained address information of the receiving end.
[0093] It should be noted that step S405 above, which involves determining the address information of the receiving end from the encapsulated data packet to be transmitted and transmitting the encapsulated data packet to the receiving end according to the address information, can be performed by the sending end or by a virtual switch in the sending end; no specific restriction is made here.
[0094] In steps S401 to S405 above, when the virtual machine is transmitting data, it can intercept the data packets to be transmitted by calling the socket port connected to the application layer in the virtual machine. This allows the data packets to bypass the transport layer in the virtual machine and be directly transmitted to the virtual switch. In other words, the data packets do not need to be encapsulated by the transport layer in the virtual machine; they are directly transmitted to the virtual switch, where they are encapsulated and then transmitted to the receiving end. Since the data does not need to be encapsulated by the transport layer in the virtual machine, the performance overhead of the virtual machine is greatly reduced, meeting the requirements of low latency and high bandwidth in the entire network transmission process, improving the data transmission efficiency of the virtual machine, and thus solving the technical problem of low data transmission efficiency in virtual machines.
[0095] The data transmission method described above will be further introduced below through specific implementation methods.
[0096] As an optional implementation, step S402, which involves calling a socket port connected to the application layer to intercept data packets to be transmitted, includes: calling the socket port to trigger the data interception component of the sending end to run; and using the running data interception component to intercept data packets to be transmitted.
[0097] In this implementation, the socket port can be a data transmission port on the socket layer of the virtual machine, which connects to the application layer within the virtual machine. The data interception component instructs the eBPF program components to intercept data packets to be transmitted through the socket port.
[0098] Optionally, after detecting the application layer data packet to be transmitted in the virtual machine, the socket port in the virtual machine connected to the application layer can be invoked, and the data interception component (eBPF program) can be triggered to intercept the data packet to be transmitted on the socket port.
[0099] Alternatively, after intercepting the data packet to be transmitted, the intercepted data packet can be forwarded directly to the virtual switch through the specified network interface card via the data redirection function in the eBPF program (e.g., bpf_redirect), thereby bypassing the TCP / IP protocol stack in the virtual machine.
[0100] In this step, by calling the socket port connected to the application layer in the virtual machine, the data interception component is triggered to intercept the data packets to be transmitted from the application layer. This allows the data packets to bypass the transport layer (TCP / IP protocol stack) in the virtual machine and be transmitted directly to the virtual switch. Since the data packets do not need to be processed by the transport layer in the virtual machine, the overhead of the virtual machine is greatly reduced and the data transmission efficiency of the virtual machine is improved.
[0101] As an optional implementation, the data packet to be transmitted is intercepted using a running data interception component, including: using the running data interception component to detect the data output status of the socket port, wherein the data output status is used to indicate whether the socket port has successfully output data; and in response to the data output status indicating that the socket port has successfully output the data packet to be transmitted, the data packet to be transmitted is intercepted.
[0102] In this embodiment, the output status of the socket port is used at least to indicate whether the socket port has successfully output data. After the data interception component is triggered, the running data interception component can be used to detect the data output status of the socket port, and then intercept the data packet to be transmitted after the socket port has successfully output the application layer data packet.
[0103] For example, the data interception component can be a component corresponding to an eBPF program. After the data interception component is triggered, the running eBPF program can detect the data output status of the socket port. When it detects that the socket port has successfully output data, it uses the identification information of the data packet to be transmitted to determine whether the data output by the socket port is the data packet to be transmitted. If the data packet output by the socket port is the data packet to be transmitted, then the data to be transmitted is intercepted.
[0104] As an optional implementation, the virtual machine in the sending end further includes a transport layer, and the data transmission method further includes: determining the initial transmission state of the data packet to be transmitted, wherein the initial transmission state is used to indicate that the data packet to be transmitted is allowed to be transmitted to the virtual switch in the sending end through the transport layer of the virtual machine in the sending end; transmitting the intercepted data packet to be transmitted to the virtual switch in the sending end, including: switching the initial transmission state of the intercepted data packet to be transmitted to a target transmission state, and transmitting the intercepted data packet to be transmitted to the virtual switch in the sending end in the target transmission state, wherein the target transmission state is used to indicate that the data packet to be transmitted is prohibited from being transmitted to the virtual switch in the sending end through the transport layer of the virtual machine in the sending end.
[0105] In this embodiment, when the data packet to be transmitted is in the initial transmission state, it means that the data packet sent by the application layer of the virtual machine is to be transmitted to the virtual switch at the sending end through the transport layer in the virtual machine. When the data packet to be transmitted is in the target transmission state, it means that the data packet sent by the application layer of the virtual machine is to bypass the transport layer in the virtual machine and be transmitted directly to the virtual switch at the sending end.
[0106] Optionally, after intercepting a data packet to be transmitted, the transmission status of the intercepted data packet can be switched from the initial transmission status to the target transmission status. That is, the data packets to be transmitted sent from the application layer of the virtual machine can bypass the transport layer in the virtual machine and be directly transmitted to the virtual switch at the sending end. In other words, the data packets to be transmitted sent from the application layer of the virtual machine do not pass through the TCP / IP protocol stack in the virtual machine.
[0107] In this step, the data packets to be transmitted sent by the application layer of the sending virtual machine are intercepted in the target transmission state. That is, the intercepted data packets to be transmitted do not go through the transmission layer in the sending virtual machine, which greatly saves the virtual machine's overhead and improves the data transmission efficiency of the virtual machine.
[0108] As an optional implementation, step S404, controlling the virtual switch in the sending end to encapsulate the intercepted data packet to be transmitted, includes: controlling the virtual switch in the sending end to call the network transmission protocol matched with the receiving end to encapsulate the intercepted data packet to be transmitted, and obtaining the encapsulation result; controlling the virtual switch in the sending end to encapsulate the encapsulation result according to the network communication information of the receiving end, and obtaining the encapsulated data packet to be transmitted.
[0109] In this embodiment, the network transport protocol matched with the receiving end may include TCP and IP protocols, or UDP and IP protocols. Network communication information is used to indicate Virtual Scalable Local Area Network (VLAN) information. The encapsulation result indicates the result of encapsulating the intercepted data packets to be transmitted using the network transport protocol.
[0110] In this embodiment, after the virtual switch at the sending end obtains the intercepted data packet to be transmitted, it can call the network transmission protocol that matches the receiving end to encapsulate the intercepted data packet to be transmitted, so as to ensure that the intercepted data packet to be transmitted can be correctly sent to the receiving end.
[0111] Optionally, after encapsulating the intercepted data packets using a network transmission protocol matching the receiving end, and obtaining the encapsulation result, the encapsulation result can be re-encapsulated using the network communication information of the receiving end to obtain the encapsulated data packets to be transmitted. Specifically, the re-encapsulation of the encapsulation result using the network communication information of the receiving end is used for indication, and the re-encapsulation of the encapsulation result using Overlay VXLAN encapsulation technology yields the encapsulated data packets to be transmitted, thereby achieving finer-grained network isolation and access control, and improving the network security of the data packets to be transmitted in the virtualization environment.
[0112] In the above steps, encapsulating the intercepted data packets to be transmitted using a network transmission protocol that matches the receiving end ensures that the intercepted data packets to be transmitted can be correctly transmitted to the receiving end. Encapsulating the data packets to be transmitted again using a network transmission protocol that matches the receiving end can improve the network security of the data packets to be transmitted in the virtualization environment.
[0113] As an optional implementation, the intercepted data packet to be transmitted includes the address information of the receiving end, which is contained in the encapsulation result. The virtual switch in the sending end is controlled to invoke a network transmission protocol matching the receiving end to encapsulate the intercepted data packet to be transmitted, obtaining the encapsulation result. This includes: controlling the virtual switch in the sending end to invoke the transport layer control protocol in the network transmission protocol to encapsulate the intercepted data packet to be transmitted according to the encapsulation format corresponding to the transport layer control protocol, obtaining the encapsulation result; or, controlling the virtual switch in the sending end to invoke the user datagram protocol in the network transmission protocol to encapsulate the intercepted data packet to be transmitted according to the encapsulation format corresponding to the user datagram protocol, obtaining the encapsulation result.
[0114] In this embodiment, the Transport Layer Control Protocol (TCP) indicates a connection-oriented, reliable, byte-stream-based transport layer protocol that ensures reliable data transmission. The User Datagram Protocol (UDP) indicates a connectionless, unreliable transport layer protocol. UDP does not provide reliable data transmission or error recovery mechanisms, but it has a higher transmission speed. When encapsulating intercepted data packets, either protocol can be selected.
[0115] Optionally, the virtual switch at the sending end can be controlled to invoke the TCP protocol and encapsulate the intercepted data packets to be transmitted according to the corresponding TCP data encapsulation format to obtain the encapsulation result. Alternatively, the virtual switch at the sending end can be controlled to invoke the UDP protocol and encapsulate the intercepted data packets to be transmitted according to the corresponding UDP data encapsulation format to obtain the encapsulation result. No specific restrictions are imposed here.
[0116] Optionally, after obtaining the encapsulation result, the encapsulation result can be encapsulated again using the IP protocol.
[0117] In this step, network transmission protocols can be used to encapsulate the intercepted data packets to be transmitted, so that the intercepted data packets can be correctly transmitted to the receiving end.
[0118] As an optional implementation, controlling the virtual switch in the sending end to encapsulate the encapsulation result according to the network communication information of the receiving end to obtain the encapsulated data packet to be transmitted includes: controlling the virtual switch in the sending end to determine the network identifier of the receiving end from the encapsulation result, wherein the network identifier is used to identify the network where the receiving end is located; encapsulating the encapsulation result according to the network communication information corresponding to the network identifier to obtain the encapsulated data packet to be transmitted.
[0119] In this embodiment, the network identifier is used to identify the Virtual Scalable Local Area Network (VXLAN) where the receiving end is located, and the network communication information is used to indicate the VXLAN information.
[0120] Optionally, as described above, the data packet to be transmitted carries the address information of the receiving end. Based on this, after encapsulating the intercepted data packet using a network transmission protocol to obtain the encapsulation result, this encapsulation result also carries the address information of the receiving end. Based on this, the network identifier of the Virtual Scalable Local Area Network (VLAN) where the receiving end is located can be further confirmed according to the address information of the receiving end. Then, according to the VLAN corresponding to the network identifier, the encapsulation result is encapsulated again using VLAN encapsulation technology to obtain the encapsulated data packet to be transmitted.
[0121] For example, Overlay VXLAN encapsulation technology is used to re-encapsulate data packets that have already been encapsulated by network transmission protocols.
[0122] In this step, after determining the virtual Scalable Local Area Network (VXLAN) where the receiving end is located, VXLAN encapsulation technology (such as Overlay VXLAN encapsulation technology) can be used to re-encapsulate the data packet to be transmitted after it has been encapsulated by the network transmission protocol, so that the encapsulated data packet to be transmitted can be transmitted securely in the virtualized network environment.
[0123] As an optional implementation, transmitting the encapsulated data packet to the receiving end according to the address information includes: determining a target network congestion control policy from at least one network congestion control policy based on the network state between the sending end and the receiving end, wherein the network congestion control policy is used to represent the rule for transmitting the encapsulated data packet to the receiving end; and transmitting the encapsulated data packet to the receiving end corresponding to the address information according to the target network congestion control policy.
[0124] In this embodiment, network congestion control is a technique used in computer networks to avoid network congestion by adjusting data transmission rates and controlling flow. During network transmission, congestion occurs when network traffic exceeds network capacity, leading to problems such as packet loss and increased latency. Congestion control technology avoids network congestion by monitoring network traffic and adjusting data transmission rates, ensuring normal network operation and reliable data transmission.
[0125] Optionally, at least one network congestion control strategy may include: Priority-Based Flow Control (PFC), Credit-based Flow Control (CBC) which controls data flow by allocating credits during data transmission, Quantized Congestion Notification (QN), Data Center Quantized Congestion Notification (DCQCN) which controls traffic in data center networks, Smart Multi-Stream Rate-Based Protocol (SMSRP), Scalable Wireless Internet Fairness Transport (SWIFT), High Performance Congestion Control (HPCC), and Adaptive Congestion Control (ACC). These are merely examples and do not limit the specific type of network congestion control strategy.
[0126] Optionally, based on the network status between the sender and receiver, one of the above network congestion control strategies can be selected as the target network control strategy to control the transmission process of the encapsulated data packets to be transmitted.
[0127] In this step, the transmission process of the encapsulated data packets is controlled by a network congestion control strategy, which can prevent congestion during the transmission of the encapsulated data packets and ensure reliable transmission of the encapsulated data packets.
[0128] As an optional implementation, the data transmission method further includes: acquiring an initial data packet to be transmitted from the sending end to the receiving end; dividing the initial data packet into multiple sub-data packets; and determining the multiple sub-data packets as data packets to be transmitted.
[0129] In this embodiment, when the data packet to be transmitted from the transmitting end to the receiving end is large, in order to meet the requirements of low latency and bandwidth, the data packet to be transmitted can be split into packets, and each of the split sub-data packets can be processed in accordance with the above-mentioned processing method for the data packet to be transmitted, and the processed multiple sub-data packets can be transmitted to the receiving end.
[0130] In this step, when the data packet to be transmitted at the transmitting end is large, it can be split into smaller packets for processing and transmission, in order to ensure that the data packet meets the requirements of low latency and high bandwidth during transmission.
[0131] As an optional implementation, the data transmission method further includes: in response to not receiving an acknowledgment message from the receiving end for the encapsulated data packet to be transmitted within a preset time period, transmitting the encapsulated data packet to the receiving end again according to the address information.
[0132] In this embodiment, a cache acknowledgment mechanism (e.g., a cache / Ack mechanism) can be used to determine whether the receiving end has received the encapsulated data packet sent by the sending end. That is, after the sending end sends the data packet, it can start a timer and check whether it will receive an acknowledgment message (e.g., an Ack message) from the receiving end regarding the encapsulated data packet within a preset time period. If an acknowledgment message is received, it means that the receiving end has successfully received the encapsulated data packet. If no acknowledgment message is received, it means that the receiving end has not received the encapsulated data packet. In this case, the encapsulated data packet can be resent to the receiving end.
[0133] In this step, after the sending end sends the encapsulated data packet to the receiving end, the Cache / Ack mechanism can be used to quickly retransmit lost packets, so as to ensure the reliability of transmission and reduce packet loss latency.
[0134] Under the aforementioned operating environment, this application provides the following: Figure 5 The data transmission method shown is applied to a virtual machine in the sending end, which is used to transmit data to the receiving end. The virtual machine includes at least an application layer running on the virtual machine. Figure 5 This is a flowchart of another data transmission method according to an embodiment of this application. For example... Figure 5 As shown, the method includes the following steps:
[0135] Step S501: The application layer data packet to be transmitted is detected.
[0136] In the technical solution provided in step S501 of this application, the application layer is the application layer in the virtual machine of the sending end. The application layer may include the application in the virtual machine, and the data packet to be transmitted may be the data packet sent by the application. The data packet to be transmitted may carry the address information of the receiving end.
[0137] In this embodiment, the application layer in the virtual machine can send data to be transmitted, and the sending end can detect the data to be transmitted sent by the application layer in the virtual machine. After detecting the data to be transmitted from the application layer, the following step S502 is executed.
[0138] Step S502: Call the socket port connected to the application layer to intercept the data packet to be transmitted.
[0139] In the technical solution provided in step S502 of this application, the intercepted data packet to be transmitted is encapsulated by a virtual switch. The encapsulated data packet to be transmitted includes the address information of the receiving end, which is used to transmit the encapsulated data packet to the receiving end. A socket port (e.g., a Socket interface) is a data transmission interface on the socket layer (e.g., the Socket layer) in a virtual machine. One side of the socket layer connects to the application layer in the virtual machine, and the other side connects to the transport layer in the virtual machine. The transport layer can be understood as the network transport protocol stack in the virtual machine, such as the TCP / IP protocol stack. The virtual switch is a virtual switch running on a host machine or a smart network card.
[0140] In this embodiment, after detecting the application layer's data packet to be transmitted in the virtual machine, the socket port connected to the application layer can be invoked to intercept the application layer's data packet to be transmitted. That is, the application layer's data packet to be transmitted is intercepted at the socket layer on the virtual machine. The specific interception method can be referred to the description of step S402 above, and will not be repeated here.
[0141] Step S503: The intercepted data packet to be transmitted is transmitted to the virtual switch in the sending end.
[0142] In the technical solution provided by step S503 of this application, after intercepting the data packet to be transmitted, the intercepted data packet to be transmitted can be transmitted to the virtual switch in the sending end through the network card interface.
[0143] In this embodiment, the data redirection function (e.g., bpf_redirect) in the eBPF program can be used to directly forward the intercepted data packets to be transmitted to the virtual switch through the specified network card interface, thereby bypassing the TCP / IP protocol stack in the virtual machine. There is no need to perform protocol stack processing on the data packets to be transmitted in the virtual machine, saving virtual machine resource consumption.
[0144] In steps S501 to S503 above, after detecting the application layer data packet to be transmitted from the virtual machine at the sending end, the application layer data packet to be transmitted is intercepted by calling the socket port connected to the application layer in the virtual machine. This allows the data packet to bypass the transport layer (TCP / IP protocol stack) in the virtual machine and be directly transmitted to the virtual switch. Since the data packet to be transmitted does not need to be processed by the transport layer in the virtual machine, the overhead of the virtual machine is greatly reduced and the data transmission efficiency of the virtual machine is improved.
[0145] Under the aforementioned operating environment, this application provides the following: Figure 6 The data transmission method shown is applied to a virtual switch in the sending end, which is used to transmit data to the receiving end. Figure 6 This is a flowchart of another data transmission method according to an embodiment of this application. For example... Figure 6 As shown, the method includes the following steps:
[0146] Step S601: Receive the data packet to be transmitted from the virtual machine in the sending end.
[0147] In the technical solution of step S601 of this application, the virtual machine in the sending end is connected to the virtual switch. After the virtual machine in the sending end transmits the data packet to be transmitted to the virtual switch, the virtual switch can receive the data packet to be transmitted from the virtual machine in the sending end.
[0148] Step S602: Call the network transmission protocol that matches the receiving end to encapsulate the data packet to be transmitted and obtain the encapsulation result.
[0149] In the technical solution provided in step S602 of this application, the virtual switch runs on a host machine or a smart network interface card. The network transmission protocol matched with the receiving end can be TCP or IP; this is merely an example and does not impose any specific limitations on the network transmission protocol.
[0150] In this embodiment, encapsulating the intercepted data packets to be transmitted instructs the virtual switch to perform transport layer encapsulation on the intercepted data packets. Specifically, after the virtual switch at the sending end receives the intercepted data packets, it first calls the network transport protocol matching the receiving end to encapsulate the data packets, obtaining the encapsulation result. In this step, by migrating the transport layer encapsulation processing of the data packets to be transmitted from the virtual machine to the virtual switch—that is, encapsulating the intercepted data packets using the TCP / IP protocol within the virtual switch—the efficiency of data packet encapsulation processing is improved, and the overhead of the virtual machine is saved.
[0151] Step S603: Encapsulate the encapsulation result according to the network communication information of the receiving end to obtain the encapsulated data packet to be transmitted.
[0152] In the technical solution provided in step S603 of this application, the network communication information of the receiving end is used to at least indicate the virtual scalable local area network encapsulation technology (e.g., Overlay VXLAN encapsulation technology) that matches the virtual scalable local area network used by the receiving end.
[0153] In this embodiment, after performing network transmission protocol encapsulation on the intercepted data packet to be transmitted through the above step S602 to obtain the encapsulation result, the encapsulation result can be further encapsulated using Virtual Scalable Local Area Network (VLAN) encapsulation technology to obtain the encapsulated data packet to be transmitted.
[0154] In this step, the data packets that have been encapsulated at the transport layer are encapsulated again using Overlay VXLAN encapsulation technology, which can provide logical isolation between different virtual networks, allowing them to coexist on the physical network without interfering with each other.
[0155] Step S604: Determine the address information of the receiving end from the encapsulated data packet to be transmitted, and transmit the encapsulated data packet to the receiving end according to the address information.
[0156] In the technical solution provided by step S604 of this application, the address information of the receiving end may include the IP information and port information of the receiving end.
[0157] In this embodiment, as described above, the data packet to be transmitted carries the address information of the receiving end. Based on this, the intercepted data packet to be transmitted is encapsulated through steps S602 and S603, and the encapsulated data packet to be transmitted also carries the address information of the receiving end. Based on this, after the data packet is encapsulated, the address information of the receiving end can be determined from the encapsulated data packet to be transmitted, and then the encapsulated data packet to be transmitted is transmitted to the receiving end according to the obtained address information of the receiving end.
[0158] In steps S601 to S604 above, after receiving the data packet to be transmitted from the virtual machine, the virtual switch at the sending end can encapsulate the intercepted data packet twice within the virtual switch. Since the virtual switch runs on hardware, hardware acceleration technology can be used to perform transport layer encapsulation and Overlay VXLAN encapsulation on the virtual switch. This combination of hardware and software greatly improves the efficiency of data encapsulation processing. Moreover, the data to be transmitted does not need to go through the transport layer in the virtual machine for encapsulation processing, which greatly reduces the overhead of the virtual machine, meets the requirements of low latency and high bandwidth in the entire network transmission process, improves data transmission efficiency, and thus solves the technical problem of low data transmission efficiency of the virtual machine.
[0159] Under the aforementioned operating environment, this application provides the following: Figure 7 The data transmission method shown is applied to the receiving end, which includes a virtual machine and a virtual switch. The virtual machine includes at least an application layer running on the virtual machine. Figure 7 This is a flowchart of another data transmission method according to an embodiment of this application. For example... Figure 7 As shown, the method includes the following steps:
[0160] Step S701: Receive the encapsulated data packet to be transmitted from the sending end.
[0161] In the technical solution provided by step S701 of this application, after the sending end transmits the encapsulated data packet to be transmitted to the receiving end through a highly reliable transmission connection, the receiving end can receive the encapsulated data packet to be transmitted from the sending end.
[0162] Step S702: Control the virtual switch in the receiving end to decapsulate the encapsulated data packet to be transmitted.
[0163] In the technical solution provided by step S702 of this application, decapsulation includes decapsulating the Overlay VXLAN encapsulation in the data packet to be transmitted after decapsulation, and decapsulating the transport layer encapsulation of the data packet to be transmitted after decapsulating the Overlay VXLAN encapsulation.
[0164] In this embodiment, after receiving the encapsulated data packet to be transmitted, the receiving end can control the virtual switch in the receiving end to decapsulate the encapsulated data packet to obtain the data packet to be transmitted sent by the sending end.
[0165] Step S703: Call the socket port connected to the application layer of the virtual machine in the receiving end, and send the decapsulated data packet to be transmitted to the application layer of the virtual machine in the receiving end.
[0166] In the technical solution provided by step S703 of this application, after decapsulating the encapsulated data packet to be transmitted, the socket port connected to the application layer of the virtual machine in the receiving end can be called, and then the decapsulated data packet to be transmitted can be sent to the application layer of the virtual machine in the receiving end through the socket port. That is, the decapsulated data packet to be transmitted does not pass through the transport layer in the virtual machine of the receiving end.
[0167] In steps S701 to S703 above, after receiving the encapsulated data packet to be transmitted sent by the sending end, the receiving end can decapsulate the encapsulated data packet to obtain the original data packet to be transmitted from the sending end. Then, it can directly call the socket port to transmit the data packet to be transmitted to the application layer in the virtual machine of the receiving end, bypassing the transport layer in the virtual machine of the receiving end. There is no need to perform transmission processing in the transport layer, which reduces the overhead of the virtual machine of the receiving end, improves the data transmission rate of the virtual machine, and thus solves the technical problem of low transmission rate of the virtual machine.
[0168] The data transmission method described above will be further introduced below through specific implementation methods.
[0169] As an optional implementation, step S702, controlling the virtual switch in the receiving end to decapsulate the encapsulated data packet to be transmitted, includes: controlling the virtual switch in the receiving end to decapsulate the encapsulated data packet to be transmitted according to the network communication information of the receiving end, and obtaining the decapsulation result; controlling the virtual switch in the receiving end to decapsulate the decapsulation result according to the network transmission protocol matched by the receiving end, and obtaining the data packet to be transmitted.
[0170] In this embodiment, since the virtual switch at the sending end performs two encapsulation operations (e.g., transport layer encapsulation and overlay VXLAN encapsulation) on the intercepted data packets to be transmitted, the receiving end can perform two decapsulation operations on the encapsulated data packets to be transmitted after receiving them.
[0171] Optionally, the virtual switch in the receiving end is controlled to first decapsulate the encapsulated data packet to be transmitted according to the network communication information of the receiving end. That is, the virtual switch in the receiving end is controlled to decapsulate the encapsulated data packet to be transmitted under the Overlay VXLAN encapsulation to obtain the decapsulation result.
[0172] Optionally, after obtaining the decapsulation result, a decapsulation operation is performed on the decapsulation result, that is, the decapsulation result is decapsulated again according to the network transmission protocol matched by the receiving end to obtain the data packet to be transmitted.
[0173] In this step, the received encapsulated data packets are decapsulated twice in the virtual switch at the receiving end. Since the virtual switch at the receiving end runs on hardware devices such as the host machine or smart network card, hardware acceleration technology can be used in the decapsulation process to improve the decapsulation efficiency of the encapsulated data packets to be transmitted.
[0174] As an optional implementation, the virtual switch in the receiving end is controlled to decapsulate the encapsulated data packet to be transmitted according to the network communication information of the receiving end, and the decapsulation result is obtained. This includes: controlling the virtual switch in the receiving end to identify the network communication information in the encapsulated data packet to be transmitted; controlling the virtual switch in the receiving end to delete the network communication information in the encapsulated data packet to be transmitted, and obtaining the decapsulation result.
[0175] In this embodiment, when controlling the virtual switch to decapsulate the encapsulated data packet to be transmitted using Overlay VXLAN, the virtual switch in the receiving end can be controlled to identify the network communication information in the encapsulated data packet to be transmitted. The network communication information may include VXLAN header information, such as VXLAN VNI information and IP information.
[0176] Optionally, after identifying the network communication information in the encapsulated data packet to be transmitted, the network communication information in the encapsulated data packet to be transmitted can be deleted, that is, the VXLAN header information in the encapsulated data packet to be transmitted can be deleted, thereby obtaining the data packet to be transmitted after decapsulating the Overlay VXLAN.
[0177] For example, the VXLAN decapsulation operation for the encapsulated data packet to be transmitted involves extracting the VNI and IP of the packet, performing a route lookup to find the destination virtual machine (VM), and then deleting the VXLAN header.
[0178] As an optional implementation, controlling the virtual switch in the receiving end to decapsulate the decapsulation result according to the network transmission protocol matched by the receiving end to obtain the data packet to be transmitted includes: controlling the virtual switch to parse the decapsulation result according to the network transmission protocol matched by the receiving end to obtain the network transmission protocol header information in the decapsulation result; deleting the network transmission protocol header information in the decapsulation result to obtain the data packet to be transmitted.
[0179] In this embodiment, after decapsulating the encapsulated data packet into Overlay VXLAN, the transport layer encapsulation of the decapsulated data packet into Overlay VXLAN can be further decapsulated.
[0180] For example, the network transport protocol can be TCP or UDP. Based on this, a virtual switch can be controlled to parse the decapsulated overlay VXLAN data packet according to the TCP or UDP protocol matched to the receiving end. This yields the network transport protocol header information in the decapsulated data packet, which is then removed to obtain the data packet to be transmitted. The network protocol header information is used to indicate the RT header. In other words, decapsulating the transport layer RT of a packet involves extracting the packet ID from the RT, sending an ACK packet reply, and then deleting the RT header. If it is an ACK packet, the corresponding packet buffer is located and reclaimed.
[0181] In this step, the original data packet to be transmitted can be sent by the sending end by decapsulating the transport layer after the overlay VXLAN encapsulation is decapsulated.
[0182] As an optional implementation, the virtual machine in the receiving end further includes a transport layer, and the method further includes: determining the initial transmission state of the decapsulated data packet to be transmitted, wherein the initial transmission state is used to indicate that the decapsulated data packet to be transmitted is allowed to be transmitted through the transport layer of the virtual machine in the receiving end to the application layer in the virtual machine in the receiving end; sending the decapsulated data packet to be transmitted to the application layer, including: switching the initial transmission state of the decapsulated data packet to be transmitted to a target transmission state, and transmitting the decapsulated data packet to be transmitted to the application layer in the target transmission state, wherein the target transmission state is used to indicate that the decapsulated data packet to be transmitted is prohibited from being transmitted through the transport layer of the virtual machine in the receiving end to the application layer in the virtual machine in the receiving end.
[0183] In this embodiment, when the decapsulated data packet to be transmitted is in the initial transmission state, it indicates that the decapsulated data packet to be transmitted is to the application layer in the virtual machine through the virtual machine's transport layer. When the data packet to be transmitted is in the target transmission state, it indicates that the decapsulated data packet to be transmitted can be directly transmitted to the application layer in the virtual machine through the socket port in the virtual machine of the receiving end, without going through the virtual machine's transport layer.
[0184] Optionally, after the receiving virtual switch decapsulates the encapsulated data packet, it can switch the transmission state of the decapsulated data packet from the initial transmission state to the target transmission state. That is, it controls the decapsulated data packet to bypass the transport layer in the receiving virtual machine and directly transmit to the application layer in the receiving virtual machine. In other words, the decapsulated data packet does not pass through the TCP / IP protocol stack in the receiving virtual machine.
[0185] In this step, by switching the transmission state of the decapsulated data packet to the target transmission state, the decapsulated data packet can bypass the transport layer in the receiving virtual machine and be transmitted to the application layer. That is, the decapsulated data packet does not go through the transport layer in the receiving virtual machine, which greatly saves the overhead of the receiving virtual machine and improves the data transmission efficiency of the virtual machine.
[0186] As an optional implementation, after the virtual switch in the control receiving end decapsulates the encapsulated data packet to be transmitted, the data transmission method further includes: sending an acknowledgment message to the sending end, wherein the acknowledgment message is used to indicate that the receiving end has successfully received the data packet to be transmitted.
[0187] In this embodiment, after the virtual switch on the receiving end decapsulates the encapsulated data packet to be transmitted, it can send an acknowledgment message to the sending end to notify the sending end that the receiving end has successfully received the data packet to be transmitted.
[0188] In this step, after the virtual switch on the receiving end decapsulates the encapsulated data packet to be transmitted, it can immediately send an acknowledgment message to the sending end to avoid the sending end waiting. If the receiving end fails to obtain the data packet to be transmitted, it can choose not to send an acknowledgment message to the sending end, so that the sending end can automatically and fully encapsulate the data packet to be transmitted after waiting for a preset time, in order to ensure the reliability of transmission and reduce packet loss latency.
[0189] Under the aforementioned operating environment, this application provides the following: Figure 8 The data transmission system shown. (As shown in the image) Figure 8 As shown, the data transmission system 800 includes a transmitter 801 and a receiver 802.
[0190] The sender 801 is used to detect the application layer data packets to be transmitted in the virtual machine in the sender, call the socket port connected to the application layer, intercept the data packets to be transmitted, and transmit the intercepted data packets to the virtual switch in the sender; control the virtual switch in the sender to encapsulate the intercepted data packets to be transmitted; determine the address information of the receiver from the encapsulated data packets to be transmitted, and transmit the encapsulated data packets to the receiver according to the address information.
[0191] In this embodiment, when the virtual machine transmits data, it can intercept the data packets to be transmitted by calling the socket port connected to the application layer in the virtual machine. This allows the data packets to bypass the transport layer in the virtual machine and be directly transmitted to the virtual switch. The virtual switch then encapsulates the data packets and transmits them to the receiving end. The data to be transmitted does not need to go through the transport layer in the virtual machine for encapsulation, which greatly reduces the overhead of the virtual machine, meets the requirements of low latency and high bandwidth in the entire network transmission process, improves data transmission efficiency, and thus solves the technical problem of low data transmission efficiency of the virtual machine.
[0192] The receiver 802 is used to receive the encapsulated data packets to be transmitted sent by the sender, control the virtual switch in the receiver to decapsulate the encapsulated data packets to be transmitted, and call the socket port connected to the application layer of the virtual machine in the receiver to send the decapsulated data packets to be transmitted to the application layer of the virtual machine in the receiver.
[0193] In this embodiment, after receiving the encapsulated data packet to be transmitted from the sender, the receiver can decapsulate the encapsulated data packet to obtain the original data packet to be transmitted from the sender. Then, it can directly call the socket port to transmit the data packet to the application layer in the virtual machine of the receiver, bypassing the transport layer in the virtual machine of the receiver. This eliminates the need for transmission processing in the transport layer, reduces the overhead of the virtual machine of the receiver, improves the data transmission rate of the virtual machine, and thus solves the technical problem of low transmission rate of the virtual machine.
[0194] The technical solutions of the embodiments of the present invention will be illustrated below with reference to preferred embodiments.
[0195] Currently, in traditional cloud networks, when virtual machines transmit data, the application layer within the virtual machine calls the Socket interface after sending the data to be transmitted. This data is then encapsulated by the TCP / IP protocol stack within the virtual machine kernel, and subsequently transmitted via the Virtio interface to the physical host or a virtual switch in the smart network interface card. The virtual switch performs overlay encapsulation processing before forwarding the data to the receiving end. However, with the development of AI network technology, the requirements for low latency and high bandwidth are increasing. The TCP / IP protocol stack within the virtual machine kernel has become a bottleneck at the network layer. When the application layer has a large amount of data to transmit, the data processing pressure on the TCP / IP protocol stack is significant, affecting network transmission performance and resulting in low data transmission efficiency.
[0196] Figure 9 This is a schematic diagram illustrating data transmission in a virtual machine according to an embodiment of this application. Figure 9As shown, the sending end includes an application layer, a socket layer, a TCP / IP protocol stack, and an ENI interface. The data packets to be transmitted sent by the application layer are transmitted to the TCP / IP protocol stack through the socket layer. After being encapsulated by the TCP / IP protocol stack, they are transmitted to the Virtual Private Cloud (VPC) through the ENI elastic network interface. The virtual switch running in the VPC performs VXLAN encapsulation and transmits the encapsulated data packets to the receiving end through the lower network Underlay.
[0197] After receiving the encapsulated data packet, the virtual switch in the VPC performs a VXLAN decapsulation operation. Then, the decapsulated data packet is transmitted to the receiving virtual machine via the ENI interface. The TCP / IP protocol stack in the receiving virtual machine decapsulates the packet to obtain the original data packet to be transmitted, which is then transmitted to the Socket layer, and finally to the application layer in the receiving virtual machine. Figure 9 As shown, the packet encapsulation format for the data to be transmitted is: Payload+TCP / UDP+IP+VXLAN+tunnel UDP+tunnelIPv4.
[0198] During the aforementioned data transmission process, the data packets to be transmitted need to be encapsulated and decapsulated in the TCP / IP protocol stack within the virtual machine, resulting in significant overhead for the virtual machine and low data transmission efficiency, making it difficult to meet the AI network's requirements for low latency and high bandwidth.
[0199] However, this application proposes a data transmission method whereby, after the application layer in the virtual machine sends a data packet to be transmitted, it calls the Socket interface to directly intercept the data packet at the Socket layer, bypassing the TCP / IP protocol stack in the virtual machine kernel. The intercepted data packet is then transmitted to the virtual switch of the physical host or smart network card, where transport layer encapsulation and overlay encapsulation are completed. In other words, the Socket interface is compatible with the current software ecosystem. Data packets sent from the application layer are intercepted by calling the Socket interface, thus bypassing the TCP / IP protocol stack in the virtual machine for encapsulation processing and directly transmitting the data to the virtual switch, reducing latency. Since the virtual machine runs on hardware, hardware acceleration technology is used in the virtual switch to complete the TCP / IP protocol encapsulation and overlay encapsulation processing, reducing the virtual machine's overhead and meeting the requirements of low latency and high bandwidth in the entire network transmission process. This improves data transmission efficiency and solves the technical problem of low data transmission efficiency caused by the need for encapsulation processing of data packets sent from the application layer of the virtual machine at the virtual machine's transport layer in related technologies.
[0200] Figure 10 This is a schematic diagram of data transmission in a virtual machine according to an embodiment of this application. Figure 10 As shown, the application layer of the virtual machine in the sending end sends out the data packet to be transmitted. It can call the Socket interface to intercept the data packet to be transmitted to the Socket layer, and transmit the intercepted data packet directly to the virtual switch running in the Virtual Private Cloud (VPC) through ENI-Express. The virtual switch in the VPC performs transport layer (Reliable Transport, or RT) encapsulation and VXLAN encapsulation, thereby bypassing the TCP / IP protocol stack in the virtual machine. The virtual switch in the VPC runs on the host machine or smart network card.
[0201] Optionally, when the data packet to be transmitted is sent to the Socket layer, the user can also transmit the IP and port information of the receiving virtual machine to the Socket layer. At the Socket layer, the eBPF module stores the IP and port information of the receiving virtual machine in the ULP header. This ULP header is parsed in the ENI-Express ULP, and then the SDN controller table of the virtual switch is queried. That is, the IP and interface information of the receiving end (VM) are used to look up tenant information to obtain the IP address of the receiving host machine, and then the IP addresses of the two host machines are used to establish a highly reliable connection.
[0202] Optionally, such as Figure 10 As shown, after the virtual switch at the sending end encapsulates the data packet to be transmitted, it can transmit the encapsulated data packet to the receiving end through the VXLAN high-reliability connection established between the sending end and the receiving end.
[0203] The virtual switch running in the VPC at the receiving end can decapsulate the encapsulated data packets sent by the sending end. For example, it can first decapsulate the VXLAN encapsulation in the data packet, and then perform a transport layer decapsulation operation on the decapsulated data packet to obtain the original data packet. Then, the original data packet is transmitted to the Socket layer in the receiving end's virtual machine via ENI-Express. The Socket layer then transmits the data packet to the application layer in the receiving end's virtual machine, thus bypassing the TCP / IP protocol stack in the receiving end's virtual machine. Figure 10 As shown, in this transmission mode, the packet encapsulation format of the data to be transmitted is: Payload+Reliable Transport+VXLAN+UDP+tunnel IPv4.
[0204] Next, we will introduce the process of sending the data packet at the sending end.
[0205] Figure 11 This is a flowchart illustrating a method for sending a data packet to be transmitted according to an embodiment of this application. The flowchart demonstrates the process of sending the data packet to be transmitted. Figure 11 As shown, the method includes the following steps:
[0206] Step S1101: The application layer in the virtual machine sends the data packet to be transmitted.
[0207] In this step, the application layer in the virtual machine can send the data packets to be transmitted.
[0208] In step S1102, the application layer calls the Socket interface to intercept the data packet to be transmitted at the Socket layer.
[0209] In this step, after the application layer in the virtual machine at the sending end sends the data packet to be transmitted, the application layer will call the Socket interface to intercept the data packet to be transmitted at the Socket layer, thereby bypassing the TCP / IP protocol stack in the virtual machine kernel. The application layer in the virtual machine is connected to the Socket layer.
[0210] Step S1103: The intercepted data packets to be transmitted are transmitted to the virtual switch.
[0211] In this step, after intercepting the data packet to be transmitted, the intercepted data packet can be transmitted to a virtual switch through the Elastic Network Interface (ENI). The virtual switch can run on a physical host or a smart network interface card (NIC).
[0212] Step S1104: Control the virtual switch to perform transport layer encapsulation processing on the intercepted data packets to be transmitted.
[0213] In this step, after the intercepted data packet to be transmitted is sent to the virtual switch, the virtual switch can be controlled to perform transport layer encapsulation processing on the data packet. Transport layer encapsulation processing instructs the transport layer control protocol to encapsulate the data packet to be transmitted, thereby establishing a reliable communication channel between the sender and receiver, ensuring that the data to be transmitted can be correctly transmitted from the sender to the receiver. The transport layer control protocol can include TCP and IP protocols; this is merely an example and is not intended to limit the specific transport layer control protocol used.
[0214] Step S1105: Control the virtual switch to perform virtual extended LAN encapsulation on the data packets to be transmitted after the transport layer encapsulation process.
[0215] In this step, after performing transport layer encapsulation on the data packets to be transmitted, the virtual switch can also perform virtual extended LAN encapsulation (Overlay encapsulation) on the data packets to be transmitted after transport layer encapsulation, so as to achieve finer-grained network isolation and access control and improve the network security of the data packets to be transmitted in the virtualized environment.
[0216] Step S1106: Transmit the encapsulated data packet to be transmitted to the receiving end.
[0217] In this step, after the data packet to be transmitted is encapsulated, it can be transmitted to the receiving end through a highly reliable connection established between the sending and receiving ends.
[0218] In steps S1101 to S1106 above, after the application layer of the virtual machine at the sending end sends the data packet to be transmitted, it is intercepted at the Socket layer, thereby bypassing the TCP / IP protocol stack in the virtual machine and directly transmitting the data packet to be transmitted to the virtual switch running on the physical host or smart network card. The virtual switch performs transport layer encapsulation and VXLAN encapsulation on the intercepted data packet, and then transmits it to the receiving end. Since there is no need to perform transport layer encapsulation operations in the virtual machine, the overhead of the virtual machine is greatly saved, thereby improving the performance of the virtual machine, helping to reduce network communication latency, improve the scalability and throughput of the entire network communication, and achieve the technical effect of improving the data transmission efficiency of the virtual machine.
[0219] Figure 12 This is a flowchart illustrating a method for receiving a data packet to be transmitted according to an embodiment of this application. The process demonstrates the receiving end's reception of the data packet to be transmitted. Figure 12 As shown, the method includes the following steps;
[0220] Step S1201: Receive the encapsulated data packet to be transmitted sent by the sending end.
[0221] In this step, after the encapsulated data packet sent by the sending end reaches the receiving end, the receiving end can receive the encapsulated data packet, which is a data packet encapsulated by the transport layer and VXLAN.
[0222] Step S1202: Control the virtual switch at the receiving end to decapsulate the encapsulated data packet to be transmitted.
[0223] In this step, after the receiving end receives the data packet to be transmitted sent by the sending end, it can first control the virtual switch of the receiving end to encapsulate the decapsulated data packet into VXLAN.
[0224] For example, a virtual switch can identify the Virtual Network Identifier (VNI) in the encapsulated data packet to be transmitted and the IP information of the receiving virtual machine carried in the data packet. Then, based on the identified IP information of the receiving virtual machine, it can determine the virtual machine to which the encapsulated data packet is to be sent, and remove the VXLAN header from the encapsulated data packet to be transmitted, thus obtaining the data packet to be transmitted after decapsulation.
[0225] Step S1203: For the data packet to be transmitted that has been de-encapsulated from VXLAN, decapsulate the transport layer.
[0226] In this step, since the encapsulated data packet to be transmitted has undergone two encapsulations—first the transport layer encapsulation and then the VXLAN encapsulation—after decapsulating the encapsulated data packet to be transmitted through step S1202, it is necessary to perform a decapsulation operation on the decapsulated data packet to be transmitted through the transport layer to obtain the original data packet to be transmitted.
[0227] Step S1204: Pass the decapsulated data packet to be transmitted to the Socket layer in the virtual machine.
[0228] In this embodiment, after decapsulating the encapsulated data packet to be transmitted through the above steps S1202 and S1203, the decapsulated data packet to be transmitted can be passed to the Socket layer in the virtual machine, thereby bypassing the transport layer (TCP / IP protocol stack) of the virtual machine.
[0229] Step S1205: Pass the data to be transmitted in the Socket layer of the virtual machine to the application layer of the virtual machine.
[0230] In this embodiment, since the Socket layer in the virtual machine is connected to the application layer, when the data to be transmitted enters the Socket layer, it can be transmitted from the Socket layer to the application layer.
[0231] In steps S1201 to S1205 above, after receiving the encapsulated data packet to be transmitted from the sending end, the receiving end can perform VXLAN decapsulation and transport layer decapsulation operations on the encapsulated data packet through the receiving end's virtual switch, thereby obtaining the original data packet to be transmitted. The original data packet is then transmitted to the Socket layer of the receiving end's virtual machine, and the Socket layer transmits the data packet to the application layer in the receiving end's virtual machine, realizing network communication between the application layers of the sending end's virtual machine and the receiving end's virtual machine. Because the decapsulation operation on the encapsulated data packet is performed through the receiving end's virtual switch, the decapsulated data packet does not need to pass through the transport layer in the virtual machine, but is directly transmitted to the application layer of the virtual machine through the Socket layer. This reduces the virtual machine's overhead, helps reduce network communication latency, improves the scalability and throughput of the entire network communication, and achieves the technical effect of improving the data transmission efficiency of the virtual machine.
[0232] The network layer in the virtual machine will be introduced in more detail next.
[0233] Figure 13 This is a schematic diagram of the network layer in a virtual machine according to an embodiment of this application, such as... Figure 13 As shown, the network layer in a virtual machine includes: the application layer, the ULP layer, the transport layer, the VPC layer, and the hardware layer.
[0234] The application layer is used to generate data packets to be transmitted.
[0235] The ULP layer receives data packets to be transmitted from the application layer and passes them to the transport layer. Additionally, the ULP layer queries the VM-NC to obtain the host NC's IP address, creates a host identifier (Client ID, or CID), and manages the CID's attributes.
[0236] The transport layer encapsulates data packets to ensure highly reliable transmission and uses a cache / acknowledgment (Ack) mechanism to quickly retransmit lost packets, guaranteeing transmission reliability and reducing latency due to packet loss. The cache / acknowledgment (Ack) mechanism is used in network communication to determine whether a data packet has been successfully received. When the sender sends a data packet, the receiver sends an acknowledgment (Ack) signal to indicate that the data packet has been received. If the sender does not receive an acknowledgment signal within a certain time, it will retransmit the data packet. This mechanism ensures reliable data packet transmission, improving communication stability and efficiency.
[0237] Optionally, the message encapsulation format of the high-reliability transport layer is shown in Table 1 below, wherein the transport header is encapsulated after VPCVXLAN in GPE format to make full use of network transmission efficiency.
[0238] Table 1. Message Encapsulation Format
[0239]
[0240] Among them, `act type` indicates the message type, such as request, response, notification, etc.; `act value` indicates the specific operation type, such as the specific operation type of a request, the specific result of a response, etc.; `reservel` indicates a reserved field for possible future expansion or other uses; `ret` indicates the return value, representing the return result or status of the operation; `ece` indicates the error code, representing the error code or exception information in the message; `dir` indicates the direction, representing the transmission direction of the message, such as the request direction or response direction; `ack` indicates the acknowledgment flag, indicating whether the message needs to be acknowledged; `se` indicates the sequence number, used to identify the order or uniqueness of the message; `OpCode` indicates the operation code, representing the operation or function code specified in the message; `Packet Sequence Number` indicates the sequence number of the data packet, used to identify the order of the data packets during transmission; `Local CID` indicates the local CID (Connection Identifier, or CID for short), used to uniquely identify the connection between the local endpoint and the remote endpoint; `Peer CID` indicates the peer CID (Connection Identifier, or CID for short). The Identifier is used to uniquely identify the connection between the remote endpoint and the local endpoint; the Timestamp value is used to indicate the timestamp value, which is used to record the time when the data packet is sent or received; the Timestamp ecr is used to indicate the timestamp echo (Echo Request), which is used to transmit timestamp information in the data packet and request the other party to return the same timestamp information.
[0241] The VPC layer refers to the network layer within a Virtual Private Cloud (VPC) environment, and relates to the network virtualization technologies used by cloud service providers. Within a VPC, users can create isolated network environments within the cloud.
[0242] The hardware layer is the lowest layer of the model and is responsible for the physical transmission media and devices, such as network interface cards, routers, and switches, to ensure that data can flow in the physical network.
[0243] Figure 14 This is a schematic diagram of a cache or ACK mechanism according to an embodiment of this application, such as... Figure 14As shown, when transmitting data packets, a timer is first triggered to start timing, and the data packets to be sent are placed in the cache and sent in order. When the cached data packets enter the sender, they can be transmitted to the receiver.
[0244] After receiving a data packet from the sender, the receiver can send an acknowledgment message (AckPacket) to the sender. After receiving the acknowledgment message from the receiver, the sender can send a free cache message to the buffer. After receiving the free cache message, the buffer can clear the buffer and send a clear timer message to the timer.
[0245] Optionally, such as Figure 14 As shown, if the sending end does not receive an acknowledgment message from the receiving end within a preset time period, it can resend the data packet to be transmitted to the receiving end.
[0246] Optionally, when transmitting data, the sending end can select a target network congestion control algorithm from among the network congestion control algorithms based on the network status between the sending and receiving ends to control network traffic and avoid network congestion. The network congestion control strategies may include: PFC congestion control strategy, Credit-based FlowControl congestion control strategy, DCQCN congestion control strategy, Speculative Reservation Protocol congestion control strategy, HPCC congestion control strategy, ACC congestion control strategy, etc.
[0247] Figure 15 This is a schematic diagram illustrating the development of a network congestion control strategy according to an embodiment of this application, such as... Figure 15 As shown, this illustrates the development of congestion control strategies driven by the transmitter, the switch, and the receiver.
[0248] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.
[0249] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0250] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, they can also be implemented by hardware. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0251] According to an embodiment of this application, a data transmission apparatus for implementing the above-described data transmission method is also provided. Figure 16 This is a schematic diagram of a data transmission device according to an embodiment of this application, such as... Figure 16 As shown, the data transmission device 1600 includes: a first detection unit 1601, a first recall unit 1602, a first control unit 1603, and a first transmission unit 1604.
[0252] The first detection unit 1601 is used to detect the data packet to be transmitted at the application layer.
[0253] The first calling unit 1602 is used to call the socket port connected to the application layer to intercept the data packet to be transmitted;
[0254] The first interception unit 1603 is used to transmit the intercepted data packet to be transmitted to the virtual switch in the sending end;
[0255] The first control unit 1604 is used to control the virtual switch in the sending end to encapsulate the intercepted data packets to be transmitted;
[0256] The first transmission unit 1605 is used to determine the address information of the receiving end from the encapsulated data packet to be transmitted, and to transmit the encapsulated data packet to the receiving end according to the address information.
[0257] It should be noted that the first detection unit 1601, the first calling unit 1602, the first interception unit 1603, the first control unit 1603, and the first transmission unit 1604 correspond to steps S401 to S405. The five units and the corresponding steps implement the same examples and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules or units can be hardware or software components stored in memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above modules can also be part of the device and run in the computer terminal 10 provided in Embodiment 1.
[0258] According to an embodiment of this application, a data transmission apparatus for implementing the above-described data transmission method is also provided. Figure 17 This is a schematic diagram of another data transmission apparatus according to an embodiment of this application, such as... Figure 17 As shown, the data transmission device 1700 includes: a second detection unit 1701 and a second calling unit 1702.
[0259] The second detection unit 1701 is used to detect the data packets to be transmitted at the application layer.
[0260] The second calling unit 1702 is used to call the socket port connected to the application layer to intercept data packets to be transmitted.
[0261] The second interception unit 1703 is used to transmit the intercepted data packet to the virtual switch in the sending end. The virtual switch is used to encapsulate the intercepted data packet, determine the address information of the receiving end from the encapsulated data packet, and transmit the encapsulated data packet to the receiving end according to the address information.
[0262] It should be noted that the second detection unit 1701, the second calling unit 1702, and the second interception unit 1703 mentioned above correspond to steps S501 to S503. The three units and the corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules or units can be hardware or software components stored in memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above modules can also be part of a device and run in the computer terminal 10 provided in Embodiment 1.
[0263] According to an embodiment of this application, a data transmission apparatus for implementing the above-described data transmission method is also provided. Figure 18 This is a schematic diagram of another data transmission apparatus according to an embodiment of this application, such as... Figure 18 As shown, the data transmission device 1800 includes: a first receiving unit 1801, a third calling unit 1802, an encapsulation unit 1803, and a second transmission unit 1804.
[0264] The first receiving unit 1801 is used to receive the data packet to be transmitted from the virtual machine in the sending end, wherein the data packet to be transmitted is the application layer data packet to be transmitted intercepted by the virtual machine calling the socket port connected to the application layer in the virtual machine.
[0265] The third calling unit 1802 is used to call the network transmission protocol matched with the receiving end to encapsulate the data packet to be transmitted and obtain the encapsulation result.
[0266] The encapsulation unit 1803 is used to encapsulate the encapsulation result according to the network communication information of the receiving end, so as to obtain the encapsulated data packet to be transmitted.
[0267] The second transmission unit 1804 is used to determine the address information of the receiving end from the encapsulated data packet to be transmitted, and to transmit the encapsulated data packet to the receiving end according to the address information.
[0268] It should be noted that the first receiving unit 1801, the third calling unit 1802, the second encapsulation unit 1803, and the second transmission unit 1804 correspond to steps S601 to S604. The four units and the corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules or units can be hardware or software components stored in memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above modules can also be part of a device and run in the computer terminal 10 provided in Embodiment 1.
[0269] According to an embodiment of this application, a data transmission apparatus for implementing the above-described data transmission method is also provided. Figure 19 This is a schematic diagram of another data transmission apparatus according to an embodiment of this application, such as... Figure 19 As shown, the data transmission device 1900 includes: a second receiving unit 1901, a decapsulation unit 1902, and a fourth calling unit 1903.
[0270] The second receiving unit 1901 is used to receive the encapsulated data packet to be transmitted from the sending end. The encapsulated data packet to be transmitted is obtained by encapsulating the intercepted data packet to be transmitted through the virtual switch in the sending end. The intercepted data packet to be transmitted is obtained by the sending end calling the socket port connected to the application layer of the sending end to intercept the data packet to be transmitted of the application layer of the sending end. The intercepted data packet to be transmitted is transmitted from the socket port to the virtual switch in the sending end.
[0271] The decapsulation unit 1902 is used to control the virtual switch in the receiving end to decapsulate the encapsulated data packets to be transmitted.
[0272] The fourth calling unit 1903 is used to call the socket port connected to the application layer of the virtual machine in the receiving end, and send the decapsulated data packet to be transmitted to the application layer of the virtual machine in the receiving end.
[0273] It should be noted that the second receiving unit 1901, the decapsulation unit 1902, and the fourth calling unit 1903 correspond to steps S701 to S703. The three units and the corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules or units can be hardware or software components stored in memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above modules can also be part of the device and run in the computer terminal 10 provided in Embodiment 1.
[0274] It should be noted that the preferred implementation schemes involved in the above embodiments of this application are the same as the schemes, application scenarios and implementation processes provided in Embodiment 1, but are not limited to the schemes provided in Embodiment 1.
[0275] Embodiments of this application may provide an electronic device, which may be any one of a group of electronic devices. Optionally, in this embodiment, the aforementioned electronic device may also be replaced by a terminal device such as a mobile terminal.
[0276] Optionally, in this embodiment, the aforementioned electronic device may be located in at least one of a plurality of network devices in a computer network.
[0277] In this embodiment, the computer terminal described above can execute the program code in the method.
[0278] Optionally, Figure 20This is a structural block diagram of an electronic device according to an embodiment of this application. As shown in the figure, the electronic device A may include: one or more (only one is shown in the figure) processors 2002, memory 2004, memory controller, and peripheral interfaces, wherein the peripheral interfaces are connected to a radio frequency module, an audio module, and a display.
[0279] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the methods and apparatus in the embodiments of this application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby implementing the methods in the above embodiments. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to electronic device A via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0280] The processor can access information and applications stored in memory via the transmission device to perform the following steps: detect the data packet to be transmitted at the application layer; call the socket port connected to the application layer to intercept the data packet to be transmitted; transmit the intercepted data packet to the virtual switch at the sending end; control the virtual switch at the sending end to encapsulate the intercepted data packet to be transmitted; determine the address information of the receiving end from the encapsulated data packet to be transmitted, and transmit the encapsulated data packet to the receiving end according to the address information.
[0281] Optionally, the processor may also execute program code that performs the following steps: calls the socket port to trigger the data interception component of the sending end to run; and uses the running data interception component to intercept the data packets to be transmitted.
[0282] Optionally, the processor may also execute program code that performs the following steps: using a running data interception component to detect the data output status of the socket port, wherein the data output status is used to indicate whether the socket port has successfully output data; and in response to the data output status indicating that the socket port has successfully output the data packet to be transmitted, intercepting the data packet to be transmitted.
[0283] Optionally, the processor may also execute program code for the following steps: determining the initial transmission state of the data packet to be transmitted, wherein the initial transmission state indicates that the data packet to be transmitted is allowed to be transmitted through the transport layer of the virtual machine in the sending end to the virtual switch in the sending end; transmitting the intercepted data packet to be transmitted to the virtual switch in the sending end, including: switching the initial transmission state of the intercepted data packet to be transmitted to the target transmission state, and transmitting the intercepted data packet to be transmitted to the virtual switch in the sending end in the target transmission state, wherein the target transmission state indicates that the data packet to be transmitted is prohibited from being transmitted through the transport layer of the virtual machine in the sending end to the virtual switch in the sending end.
[0284] Optionally, the processor may also execute program code that performs the following steps: controls the virtual switch in the sending end to call the network transmission protocol matched with the receiving end to encapsulate the intercepted data packet to be transmitted, and obtain the encapsulation result; controls the virtual switch in the sending end to encapsulate the encapsulation result according to the network communication information of the receiving end, and obtain the encapsulated data packet to be transmitted.
[0285] Optionally, the processor may also execute program code that performs the following steps: controls the virtual switch in the sending end to call the transport layer control protocol in the network transmission protocol to encapsulate the intercepted data packets to be transmitted according to the encapsulation format corresponding to the transport layer control protocol, and obtains the encapsulation result; or, controls the virtual switch in the sending end to call the user datagram protocol in the network transmission protocol to encapsulate the intercepted data packets to be transmitted according to the encapsulation format corresponding to the user datagram protocol, and obtains the encapsulation result.
[0286] Optionally, the processor may also execute program code that performs the following steps: controls the virtual switch in the sending end to determine the network identifier of the receiving end from the encapsulation result, wherein the network identifier is used to identify the network in which the receiving end is located; encapsulates the encapsulation result according to the network communication information corresponding to the network identifier to obtain the encapsulated data packet to be transmitted.
[0287] Optionally, the processor may also execute program code that performs the following steps: acquiring the initial data packet to be transmitted from the sending end to the receiving end; dividing the initial data packet into multiple sub-data packets; and determining the multiple sub-data packets as data packets to be transmitted.
[0288] Optionally, the processor may also execute program code that performs the following steps: in response to not receiving an acknowledgment message from the receiving end for the encapsulated data packet to be transmitted within a preset time period, the processor retransmits the encapsulated data packet to be transmitted to the receiving end according to the address information.
[0289] This application provides a data transmission method. When a virtual machine transmits data, it can intercept data packets to be transmitted by calling a socket port connected to the application layer within the virtual machine. This allows the data packets to bypass the transport layer within the virtual machine and be directly transmitted to a virtual switch. The virtual switch then encapsulates the data packets and transmits the encapsulated packets to the receiving end. Since the data does not need to undergo encapsulation processing by the transport layer within the virtual machine, this significantly reduces the virtual machine's overhead, meets the requirements for low latency and high bandwidth in the entire network transmission process, improves data transmission efficiency, and thus solves the technical problem of low data transmission efficiency in virtual machines.
[0290] It will be understood by those skilled in the art that the structure shown in the figure is merely illustrative, and the electronic device may also be a smartphone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile internet device (MID), a personal access display (PAD), or other terminal devices. This figure does not limit the structure of the aforementioned electronic device. For example, electronic device A may include more or fewer components (such as a network interface, a display device, etc.) than shown in the figure, or may have a different configuration than shown in the figure.
[0291] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0292] Embodiments of this application also provide a computer-readable storage medium. Optionally, in this embodiment, the computer-readable storage medium can be used to store program code executed by the method provided in the above embodiments.
[0293] Optionally, in this embodiment, the storage medium may be located in any one of the electronic devices in the group of electronic devices in the computer network, or in any one of the mobile terminals in the group of mobile terminals.
[0294] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: detecting the data packet to be transmitted at the application layer; calling the socket port connected to the application layer to intercept the data packet to be transmitted; transmitting the intercepted data packet to be transmitted to the virtual switch in the sending end; controlling the virtual switch in the sending end to encapsulate the intercepted data packet to be transmitted; determining the address information of the receiving end from the encapsulated data packet to be transmitted, and transmitting the encapsulated data packet to be transmitted to the receiving end according to the address information.
[0295] Optionally, the computer-readable storage medium is also configured to store program code for performing the following steps: invoking the socket port to trigger the execution of the data interception component at the sending end; and using the running data interception component to intercept the data packet to be transmitted.
[0296] Optionally, the computer-readable storage medium is further configured to store program code for performing the following steps: using a running data interception component, detecting the data output status of the socket port, wherein the data output status is used to indicate whether the socket port has successfully output data; and intercepting the data packet to be transmitted in response to the data output status indicating that the socket port has successfully output the data packet to be transmitted.
[0297] Optionally, the computer-readable storage medium is further configured to store program code for performing the following steps: determining an initial transmission state of a data packet to be transmitted, wherein the initial transmission state indicates that the data packet to be transmitted is allowed to be transmitted through the transport layer of the virtual machine in the sending end to the virtual switch in the sending end; transmitting the intercepted data packet to be transmitted to the virtual switch in the sending end, including: switching the initial transmission state of the intercepted data packet to be transmitted to a target transmission state, and transmitting the intercepted data packet to be transmitted to the virtual switch in the sending end in the target transmission state, wherein the target transmission state indicates that the data packet to be transmitted is prohibited from being transmitted through the transport layer of the virtual machine in the sending end to the virtual switch in the sending end.
[0298] Optionally, the computer-readable storage medium is further configured to store program code for performing the following steps: controlling a virtual switch in the sending end to encapsulate the intercepted data packet to be transmitted by calling a network transmission protocol matched with that in the receiving end, and obtaining an encapsulation result; controlling a virtual switch in the sending end to encapsulate the encapsulation result according to the network communication information in the receiving end, and obtaining an encapsulated data packet to be transmitted.
[0299] Optionally, the computer-readable storage medium is further configured to store program code for performing the following steps: controlling the virtual switch in the sending end to call the transport layer control protocol in the network transmission protocol to encapsulate the intercepted data packets to be transmitted according to the encapsulation format corresponding to the transport layer control protocol, and obtain the encapsulation result; or controlling the virtual switch in the sending end to call the user datagram protocol in the network transmission protocol to encapsulate the intercepted data packets to be transmitted according to the encapsulation format corresponding to the user datagram protocol, and obtain the encapsulation result.
[0300] Optionally, the computer-readable storage medium is further configured to store program code for performing the following steps: controlling a virtual switch in the sending end to determine the network identifier of the receiving end from the encapsulation result, wherein the network identifier is used to identify the network in which the receiving end is located; encapsulating the encapsulation result according to the network communication information corresponding to the network identifier to obtain the encapsulated data packet to be transmitted.
[0301] Optionally, the computer-readable storage medium is further configured to store program code for performing the following steps: acquiring an initial data packet to be transmitted from the sending end to the receiving end; dividing the initial data packet into multiple sub-data packets; and identifying the multiple sub-data packets as data packets to be transmitted.
[0302] Optionally, the computer-readable storage medium is further configured to store program code for performing the following steps: in response to not receiving an acknowledgment message from the receiving end for the encapsulated data packet to be transmitted within a preset time period, retransmitting the encapsulated data packet to the receiving end according to the address information.
[0303] Embodiments of this application also provide a computer program product. Optionally, in this embodiment, the computer program product may include a computer program that, when executed by a processor, implements the methods provided in the embodiments described above.
[0304] Embodiments of this application also provide a computer program product. Optionally, the computer program product may include a non-volatile computer-readable storage medium, which can be used to store a computer program that, when executed by a processor, implements the method provided in the above embodiments.
[0305] Embodiments of this application also provide a computer program. Optionally, in this embodiment, when the computer program is executed by a processor, it implements the method provided in the above embodiments.
[0306] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0307] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0308] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0309] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0310] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0311] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, ROM, RAM, portable hard drives, magnetic disks, or optical disks.
[0312] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A data transmission method, characterized by, The application is applied to a sending end for transmitting data to a receiving end, and comprises a virtual machine and a virtual switch, wherein the virtual machine at least comprises an application layer running on the virtual machine, and the method comprises: detecting a data packet to be transmitted of the application layer; calling a socket port connected with the application layer to intercept the data packet to be transmitted; transmitting the intercepted data packet to be transmitted to the virtual switch in the sending end; controlling the virtual switch in the sending end to encapsulate the intercepted data packet to be transmitted; determining address information of the receiving end from the encapsulated data packet to be transmitted, and transmitting the encapsulated data packet to be transmitted to the receiving end according to the address information.
2. The method of claim 1, wherein, The calling of the socket port connected with the application layer to intercept the data packet to be transmitted comprises: calling the socket port to trigger a data interception component of the sending end to run; intercepting the data packet to be transmitted by using the running data interception component.
3. The method of claim 2, wherein, The intercepting of the data packet to be transmitted by using the running data interception component comprises: detecting a data output state of the socket port by using the running data interception component, wherein the data output state is used to indicate whether the socket port successfully outputs data; intercepting the data packet to be transmitted in response to the data output state being that the socket port successfully outputs the data packet to be transmitted.
4. The method of claim 1, wherein, The virtual machine in the sending end further comprises a transmission layer, and the method further comprises: determining an initial transmission state of the data packet to be transmitted, wherein the initial transmission state is used to indicate that the data packet to be transmitted is allowed to be transmitted to the virtual switch in the sending end through the transmission layer of the virtual machine in the sending end; The transmitting of the intercepted data packet to be transmitted to the virtual switch in the sending end comprises: switching the initial transmission state of the intercepted data packet to be transmitted to a target transmission state, and transmitting the intercepted data packet to be transmitted to the virtual switch in the sending end in the target transmission state, wherein the target transmission state is used to indicate that the data packet to be transmitted is prohibited to be transmitted to the virtual switch in the sending end through the transmission layer of the virtual machine in the sending end.
5. The method of claim 1, wherein, The controlling of the virtual switch in the sending end to encapsulate the intercepted data packet to be transmitted comprises: controlling the virtual switch in the sending end to encapsulate the intercepted data packet to be transmitted by using a network transmission protocol matched with the receiving end to obtain an encapsulation result; controlling the virtual switch in the sending end to encapsulate the encapsulation result according to network communication information of the receiving end to obtain the encapsulated data packet to be transmitted.
6. The method of claim 5, wherein, The intercepted data packet to be transmitted comprises address information of the receiving end, the address information is contained in the encapsulation result, and the controlling of the virtual switch in the sending end to encapsulate the intercepted data packet to be transmitted by using the network transmission protocol matched with the receiving end to obtain the encapsulation result comprises: controlling the virtual switch in the sending end to call a transport layer control protocol in the network transmission protocol, and to encapsulate the intercepted to-be-transmitted data packet according to an encapsulation format corresponding to the transport layer control protocol, so as to obtain the encapsulation result; or controlling the virtual switch in the sending end to call a user datagram protocol in the network transmission protocol, and to encapsulate the intercepted to-be-transmitted data packet according to an encapsulation format corresponding to the user datagram protocol, so as to obtain the encapsulation result.
7. The method of claim 5, wherein, controlling the virtual switch in the sending end to encapsulate the encapsulation result according to network communication information of the receiving end, so as to obtain the encapsulated to-be-transmitted data packet, including: controlling the virtual switch in the sending end to determine network identification of the receiving end from the encapsulation result, wherein the network identification is used to identify a network in which the receiving end is located; encapsulating the encapsulation result according to the network communication information corresponding to the network identification, so as to obtain the encapsulated to-be-transmitted data packet.
8. The method according to any one of claims 1 to 7, characterized in that, The method further includes: obtaining initial data packets to be transmitted from the sending end to the receiving end; dividing the initial data packets to obtain a plurality of sub-data packets; determining the plurality of sub-data packets as the to-be-transmitted data packets respectively.
9. The method according to any one of claims 1 to 8, characterized in that, The method further includes: in response to not receiving an acknowledgement message of the receiving end to the encapsulated to-be-transmitted data packet within a preset time length, transmitting the encapsulated to-be-transmitted data packet to the receiving end again according to the address information.
10. A data transmission method, characterized by, A virtual machine applied to a sending end, the sending end being used to transmit data to a receiving end, and the virtual machine at least including an application layer running on the virtual machine, the method including: detecting to-be-transmitted data packets of the application layer; calling a socket port connected with the application layer to intercept the to-be-transmitted data packets; transmitting the intercepted to-be-transmitted data packets to a virtual switch in the sending end, wherein the intercepted to-be-transmitted data packets are encapsulated by the virtual switch, and the encapsulated to-be-transmitted data packets include address information of the receiving end, and the address information is used to transmit the encapsulated to-be-transmitted data packets to the receiving end.
11. A data transmission method, characterized by, A virtual switch applied to a sending end, the sending end being used to transmit data to a receiving end, the method including: receiving to-be-transmitted data packets of a virtual machine in the sending end, wherein the to-be-transmitted data packets are to-be-transmitted data packets of an application layer in the virtual machine, which are intercepted by calling a socket port connected with the application layer in the virtual machine; calling a network transmission protocol matched with the receiving end to encapsulate the to-be-transmitted data packets, so as to obtain an encapsulation result; encapsulating the encapsulation result according to network communication information of the receiving end, so as to obtain the encapsulated to-be-transmitted data packets; determining address information of the receiving end from the encapsulated to-be-transmitted data packets, and transmitting the encapsulated to-be-transmitted data packets to the receiving end according to the address information.
12. A data transmission method, characterized by, The method is applied to a receiving end, the receiving end comprises a virtual machine and a virtual switch, the virtual machine at least comprises an application layer running on the virtual machine, and the method comprises the following steps: receiving the encapsulated to-be-transmitted data packet from the sending end, wherein the encapsulated to-be-transmitted data packet is obtained by encapsulating the intercepted to-be-transmitted data packet by the virtual switch in the sending end, the intercepted to-be-transmitted data packet is obtained by intercepting the to-be-transmitted data packet of the application layer of the sending end by a socket port connected with the application layer of the sending end in the sending end, and the intercepted to-be-transmitted data packet is transmitted to the virtual switch in the sending end by the socket port; controlling the virtual switch in the receiving end to decapsulate the encapsulated to-be-transmitted data packet; calling a socket port connected with the application layer of the virtual machine in the receiving end to send the decapsulated to-be-transmitted data packet to the application layer of the virtual machine in the receiving end.
13. The method of claim 12, wherein, controlling the virtual switch in the receiving end to decapsulate the encapsulated to-be-transmitted data packet, comprising: controlling the virtual switch in the receiving end to decapsulate the encapsulated to-be-transmitted data packet according to the network communication information of the receiving end to obtain a decapsulated result; controlling the virtual switch in the receiving end to decapsulate the decapsulated result according to the network transmission protocol matched by the receiving end to obtain the to-be-transmitted data packet.
14. The method of claim 13, wherein, controlling the virtual switch in the receiving end to decapsulate the encapsulated to-be-transmitted data packet according to the network communication information of the receiving end to obtain a decapsulated result, comprising: controlling the virtual switch in the receiving end to identify the network communication information in the encapsulated to-be-transmitted data packet; controlling the virtual switch in the receiving end to delete the network communication information in the encapsulated to-be-transmitted data packet to obtain the decapsulated result.
15. The method of claim 13, wherein, controlling the virtual switch in the receiving end to decapsulate the decapsulated result according to the network transmission protocol matched by the receiving end to obtain the to-be-transmitted data packet, comprising: controlling the virtual switch to parse the decapsulated result according to the network transmission protocol matched by the receiving end to obtain the network transmission protocol header information in the decapsulated result; deleting the network transmission protocol header information in the decapsulated result to obtain the to-be-transmitted data packet.
16. The method of claim 12, wherein, The virtual machine in the receiving end further comprises a transmission layer, and the method further comprises the following steps: determining an initial transmission state of the decapsulated to-be-transmitted data packet, wherein the initial transmission state is used to indicate that the decapsulated to-be-transmitted data packet is allowed to be transmitted to the application layer in the virtual machine in the receiving end through the transmission layer of the virtual machine in the receiving end; Sending the decapsulated data packet to the application layer includes: switching the initial transmission state of the decapsulated data packet to the target transmission state, and transmitting the decapsulated data packet to the application layer in the target transmission state, wherein the target transmission state indicates that the decapsulated data packet is prohibited from being transmitted through the transport layer of the virtual machine in the receiving end to the application layer of the virtual machine in the receiving end.
17. The method of claim 12, wherein, After controlling the virtual switch in the receiving end to decapsulate the encapsulated data packet to be transmitted, the method further includes: A confirmation message is sent to the sending end, wherein the confirmation message is used to indicate that the receiving end has successfully received the data packet to be transmitted.
18. A signal transmission system, characterized by include: The sending end is used to detect the data packets to be transmitted in the application layer of the virtual machine in the sending end, call the socket port connected to the application layer, and intercept the data packets to be transmitted. The intercepted data packet to be transmitted is transmitted to the virtual switch in the sending end; the virtual switch in the sending end is controlled to encapsulate the intercepted data packet to be transmitted. The address information of the receiving end is determined from the encapsulated data packet to be transmitted, and the encapsulated data packet to be transmitted is transmitted to the receiving end according to the address information; The receiving end is used to receive the encapsulated data packet to be transmitted sent by the sending end, control the virtual switch in the receiving end to decapsulate the encapsulated data packet to be transmitted, and call the socket port connected to the application layer of the virtual machine in the receiving end to send the decapsulated data packet to be transmitted to the application layer of the virtual machine in the receiving end.
19. An electronic device, comprising: include: Memory, which stores executable programs; A processor for running the program, wherein the program, when running, performs the method according to claims 1 to 17.
20. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored executable program, wherein, when the executable program is executed, it controls the device on which the storage medium is located to perform the method of claims 1 to 17.
21. A computer program product, characterised in that, Includes a computer program that, when executed by a processor, implements the method according to claims 1 to 17.