Data transmission method, device, equipment, storage medium and program product
By configuring the association between a virtual bare metal gateway and a physical switch in a cloud computing environment, the high cost of network interconnection between bare metal servers and virtual machines is solved, achieving low-cost and efficient data transmission and interconnection.
Patent Information
- Application Number
- CN202510961384.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-11
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-07-11
AI Technical Summary
In a cloud computing environment, network connectivity between bare metal servers and virtual machines is costly. Existing physical gateway data transmission methods need to be compatible with different types of physical switches, increasing transmission costs.
By deploying physical switches under the network and configuring virtual bare metal gateways associated with them, the virtual bare metal gateways are used to determine the forwarding path of data packets, enabling direct data interaction with various types of physical switches, reducing dependence on hardware devices.
It reduces data transmission costs, improves network reliability and stability, realizes interconnection and interoperability of different data packet formats, and reduces the demand for hardware equipment.
Smart Images

Figure CN120499095B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a data transmission method, apparatus, device, storage medium, and program product. Background Art
[0002] With the rapid development of cloud computing technology, bare metal servers (BMS) are widely used in various fields, including big data processing, high-performance computing, and financial security, due to their high performance, high security, and physical isolation. However, in cloud computing environments, network connectivity between bare metal servers and virtual machines (VMs) has become a major challenge.
[0003] Currently, smart network cards or physical switches are usually used to deploy and implement physical gateways. However, the data transmission method based on the existing physical gateway has the problem of high cost. Summary of the Invention
[0004] Based on this, it is necessary to provide a data transmission method, device, equipment, storage medium and program product that can reduce transmission costs in response to the above technical problems.
[0005] In a first aspect, the present application provides a data transmission method, the method comprising:
[0006] Deploy the physical switch under the first network, and configure a virtual bare metal gateway associated with the physical switch according to the first network to obtain a configured virtual bare metal gateway;
[0007] When a first data packet is received from an external device through a physical switch, a forwarding path for the first data packet is determined according to the configured virtual bare metal gateway, and the first data packet is forwarded to a target bare metal server under the physical switch based on the forwarding path.
[0008] The data transmission method provided by the embodiment of the present application is to obtain a configured virtual bare metal gateway by deploying a physical switch under a first network and configuring a virtual bare metal gateway associated with the physical switch according to the first network. Then, when receiving a first data packet sent by an external device through the physical switch, the forwarding path of the first data packet is determined according to the configured virtual bare metal gateway, and the first data packet is forwarded to the target bare metal server under the physical switch based on the forwarding path. In the traditional data transmission process, when using a bare metal gateway to transmit data, the bare metal gateway needs to be adapted to the physical switch, and different types of physical switches are adapted to different bare metal gateways, and additional hardware equipment is also required, which undoubtedly increases the transmission cost. The above method uses the deployed virtual bare metal gateway for data transmission, which can directly interact with various types of physical switches for data, effectively reducing the data transmission cost.
[0009] In some embodiments, the virtual bare metal gateway includes an information query table, a first virtual forwarder, and multiple second virtual forwarders. Determining a forwarding path for the first data packet based on the configured virtual bare metal gateway includes:
[0010] Query the forwarding source of the first data packet in the information query table;
[0011] If the forwarding source is the first virtual forwarder, determining a first forwarding path for the first data packet according to the routing table in the first virtual forwarder; the first forwarding path includes forwarding the first data packet by the first virtual forwarder through the physical switch to the target bare metal server;
[0012] If the forwarding source is a second virtual forwarder, a target virtual forwarder is determined from multiple second virtual forwarders, and a first forwarding path of the first data packet is determined according to the routing table in the target virtual forwarder; the first forwarding path includes forwarding the first data packet by the target virtual forwarder through the physical switch to the target bare metal server.
[0013] In some embodiments, the virtual bare metal gateway further includes a virtual proxy module and a virtual network card table, and determining a target virtual forwarder from a plurality of second virtual forwarders includes:
[0014] Sending relevant information of the third virtual forwarder to the virtual proxy module for forwarding function verification to obtain a verification result; the third virtual forwarder is the second virtual forwarder determined by the forwarding source of the first data packet;
[0015] If the verification result indicates that the third virtual forwarder has the forwarding function, determining the third virtual forwarder as the target virtual forwarder;
[0016] If the verification result indicates that the third virtual forwarder does not have the forwarding function, a second virtual forwarder with the forwarding function among the plurality of second virtual forwarders is determined according to the virtual network card table, and the second virtual forwarder with the forwarding function is determined as the target virtual forwarder.
[0017] The method described in the embodiments of the present application verifies the forwarding function of the third virtual forwarder through the virtual proxy module, thereby promptly determining whether the virtual forwarder has normal forwarding functionality, avoiding packet forwarding failures due to virtual forwarder failures, and improving network reliability. Furthermore, if the third virtual forwarder does not have forwarding functionality, a device with forwarding functionality can be found from among the multiple second virtual forwarders based on the virtual network card table as the target virtual forwarder. This backup mechanism allows for rapid failover in the event of a virtual forwarder failure, ensuring the continuity and stability of data transmission.
[0018] In some embodiments, the method further comprises:
[0019] When a second data packet is received from the physical switch, the second data packet is sent to the configured virtual bare metal gateway for encapsulation processing, and the encapsulated second data packet is forwarded to the external device through the physical switch; the second data packet is the data packet after the target bare metal server processes the first data packet.
[0020] The method described in the embodiments of the present application, since different external devices may use different data packet formats for communication, and the virtual bare metal gateway can encapsulate and process data packets of various formats, allows the physical switch to communicate with multiple types of external devices, breaking the communication barriers caused by incompatible data packet formats, realizing the interconnection of the entire network, and thus improving data transmission efficiency.
[0021] In some embodiments, configuring a virtual bare metal gateway associated with a physical switch according to a first network to obtain a configured virtual bare metal gateway includes:
[0022] Creating a corresponding virtual network card according to the first network, and constructing a virtual network card table of the virtual network card;
[0023] Obtain information about the virtual network card based on the transmission path relationship between the physical switch and the virtual bare metal gateway associated with the physical switch;
[0024] The routing information in the routing table is updated based on the relevant information of the virtual network card to obtain the configured virtual bare metal gateway.
[0025] The methods described in the embodiments of this application can reduce reliance on traditional hardware devices by implementing network functions through the construction of a virtual bare metal gateway. In traditional network architectures, implementing different network functions often requires the deployment of a large number of hardware devices. However, the use of virtual bare metal gateways and virtual network cards can replace these hardware devices to a certain extent, reducing hardware and maintenance costs.
[0026] In some embodiments, the method further comprises:
[0027] The physical switch is deployed in the second network, and a virtual bare metal gateway associated with the physical switch is configured according to the second network to obtain a configured virtual bare metal gateway.
[0028] The method described in the embodiments of the present application, by configuring a virtual bare metal gateway under the second network, can realize the reuse of a network card for the initial deployment of the first network and the second network when providing services, which can save hardware costs, and then use the deployed virtual bare metal gateway for data transmission, which can effectively reduce data transmission costs.
[0029] In a second aspect, the present application further provides a data transmission device, the device comprising:
[0030] A configuration module, configured to deploy the physical switch under the first network, and configure a virtual bare metal gateway associated with the physical switch according to the first network to obtain a configured virtual bare metal gateway;
[0031] The transmission module is used to determine the forwarding path of the first data packet according to the configured virtual bare metal gateway when receiving the first data packet sent by the external device through the physical switch, and forward the first data packet to the target bare metal server under the physical switch based on the forwarding path.
[0032] In a third aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0033] Deploy the physical switch under the first network, and configure a virtual bare metal gateway associated with the physical switch according to the first network to obtain a configured virtual bare metal gateway;
[0034] When a first data packet is received from an external device through a physical switch, a forwarding path for the first data packet is determined according to the configured virtual bare metal gateway, and the first data packet is forwarded to a target bare metal server under the physical switch based on the forwarding path.
[0035] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0036] Deploy the physical switch under the first network, and configure a virtual bare metal gateway associated with the physical switch according to the first network to obtain a configured virtual bare metal gateway;
[0037] When a first data packet is received from an external device through a physical switch, a forwarding path for the first data packet is determined according to the configured virtual bare metal gateway, and the first data packet is forwarded to a target bare metal server under the physical switch based on the forwarding path.
[0038] In a fifth aspect, the present application further provides a computer program product, the computer program product comprising a computer program, which, when executed by a processor, implements the following steps:
[0039] Deploy the physical switch under the first network, and configure a virtual bare metal gateway associated with the physical switch according to the first network to obtain a configured virtual bare metal gateway;
[0040] When a first data packet is received from an external device through a physical switch, a forwarding path for the first data packet is determined according to the configured virtual bare metal gateway, and the first data packet is forwarded to a target bare metal server under the physical switch based on the forwarding path.
[0041] The above-mentioned data transmission method, apparatus, device, storage medium and program product, the method obtains a configured virtual bare metal gateway by deploying a physical switch under a first network, and configuring a virtual bare metal gateway associated with the physical switch according to the first network. Then, when receiving a first data packet sent by an external device through the physical switch, the forwarding path of the first data packet is determined according to the configured virtual bare metal gateway, and the first data packet is forwarded to the target bare metal server under the physical switch based on the forwarding path. In the traditional data transmission process, when using a bare metal gateway to transmit data, the bare metal gateway needs to be adapted to the physical switch, and different types of physical switches are adapted to different bare metal gateways, and additional hardware equipment is also required, which undoubtedly increases the transmission cost. The above-mentioned method uses the deployed virtual bare metal gateway for data transmission, which can directly interact with various types of physical switches for data, effectively reducing the data transmission cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 is a schematic diagram of the architecture of a data transmission system in some embodiments;
[0043] Figure 2 This is a flowchart of a data transmission method in some embodiments;
[0044] Figure 3 This is a second flowchart of a data transmission method in some embodiments;
[0045] Figure 4 This is a third flowchart of a data transmission method in some embodiments;
[0046] Figure 5 This is a fourth flowchart of a data transmission method in some embodiments;
[0047] Figure 6 This is a fifth flowchart of a data transmission method in some embodiments;
[0048] Figure 7 is a structural block diagram of a data transmission device in some embodiments;
[0049] Figure 8 1 is a diagram of the internal structure of a computer device in some embodiments. DETAILED DESCRIPTION
[0050] In the embodiments of this application, the term "and / or" describes the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0051] In the embodiments of the present application, the term "plurality" refers to two or more than two, and other quantifiers are similar.
[0052] In the embodiments of the present application, the term "at least one" means one or more. For example, at least one of A, B and C can mean the following six situations: A exists alone, B exists alone, C exists alone, A and B exist at the same time, A and C exist at the same time, B and C exist at the same time, and A, B and C exist at the same time.
[0053] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0054] With the rapid development of cloud computing technology, bare metal servers (BMS) are widely used in various fields, including big data processing, high-performance computing, and financial security, due to their high performance, high security, and physical isolation. However, network connectivity between bare metal servers and virtual machines in cloud computing environments presents a major challenge. Currently, physical gateways are typically deployed and implemented using Smart NICs or physical switches. However, data transmission methods based on existing physical gateways are costly.
[0055] In view of this, the embodiments of the present application propose a data transmission method, apparatus, device, storage medium and program product, which transmit data through a deployed virtual bare metal gateway and can directly interact with various types of physical switches, effectively reducing data transmission costs.
[0056] It should be noted that the beneficial effects or technical problems solved by the embodiments of the present application are not limited to this one, but may also include other implicit or related problems. For details, please refer to the description of the following embodiments.
[0057] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0058] In some embodiments, the data transmission method provided in the embodiments of the present application can be applied to various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices, or applied to an independent server or a server cluster composed of multiple servers. The embodiments of the present application are described by taking the application of the method to a computer device as an example, and the computer device may include a data transmission system 10. The architecture of the data transmission system 10 can be as follows: Figure 1 As shown, the data transmission system 10 may include a virtual bare metal gateway 101, at least one physical switch 102 and at least one bare metal server 103, wherein the virtual bare metal gateway 101 and the physical switch 102 are set one-to-one or one-to-many, multiple physical switches 102 are communicated with each other, and multiple bare metal servers 103 can be deployed under the physical switch 102. During the data transmission process, the data transmission system 10 can filter out the target bare metal server from the multiple bare metal servers 103, and then realize data transmission with the external device 20 through the bare metal gateway 101, the physical switch 102 and the target bare metal server.
[0059] Those skilled in the art will understand that Figure 1 The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of the present application, and does not constitute a limitation on the data transmission system to which the scheme of the present application is applied. The specific data transmission system may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0060] In some embodiments, as Figure 2 As shown, a data transmission method is provided, which is applied to Figure 1 The computer device in the example is used to illustrate the process, including the following steps:
[0061] S201: Deploy a physical switch in a first network, and configure a virtual bare metal gateway associated with the physical switch according to the first network to obtain a configured virtual bare metal gateway.
[0062] The first network is the initial network used to deploy the bare metal server before installing the operating system. There is a corresponding relationship between the physical switch and the virtual bare metal gateway.
[0063] In an embodiment of the present application, a computer device configures a bare metal server according to a bare metal server creation request sent by a user. The specific configuration process may be: after the computer device receives the bare metal server creation request, it may parse the creation request to obtain information of the first network, and then create configuration information of the virtual network card corresponding to the first network, and finally call the physical switch to the first network according to the configuration information of the virtual network card, and according to the correspondence between the physical switch and the virtual bare metal gateway, deploy the virtual bare metal gateway associated with the physical switch to the first network, and mount the bare metal server to the virtual bare metal gateway according to the address information of the bare metal server in the configuration information of the virtual network card, and obtain the configured virtual bare metal gateway and bare metal server. It should be noted that the correspondence between the physical switch and the virtual bare metal gateway can be created in advance according to usage requirements. The configuration information of the virtual network card includes the network information corresponding to the virtual network card and the address information of the bare metal server, etc. When calling the physical switch, any physical switch in the current data transmission system can be called, or the physical switch with the best performance can be called.
[0064] S202: Upon receiving a first data packet sent by an external device through a physical switch, determine a forwarding path for the first data packet according to the configured virtual bare metal gateway, and forward the first data packet to a target bare metal server under the physical switch based on the forwarding path.
[0065] The external device can be an external communication device independently provided by the virtual bare metal gateway or a computer. The first data packet is a data packet sent by the external device, and the first data packet includes at least one of data to be processed, address information, and network information. The forwarding path is the transmission path of the first data packet, that is, the location from which the first data packet is forwarded to.
[0066] In an embodiment of the present application, after the computer device configures the virtual bare metal gateway based on the above steps, it can communicate with the external device based on the virtual bare metal gateway. The specific process is as follows: the external device can send the first data packet to the physical switch, and the computer device can receive the first data packet through the physical switch. After receiving the first data packet, the computer device can use the configured virtual bare metal gateway to analyze the transmission source device, transmission intermediate device and transmission destination device of the data packet according to the routing information in the virtual bare metal gateway, further determine the forwarding path of the first data packet, and then forward the first data packet to the target bare metal server under the physical switch according to the forwarding path. The target bare metal server processes the data and returns the processing result. Among them, the routing information includes the address information and next-hop device information of each transmission device. Optionally, when the format of the data packet sent by the external device is inconsistent with the format of the data packet processed by the virtual bare metal gateway and the bare metal server, then in this case, after receiving the first data packet, the computer device can first convert the format of the first data packet, and then use the virtual bare metal gateway and the target bare metal server to process the first data packet after the format conversion. For example, when a computer device receives a first data packet in vxlan format, the decapsulation module in the virtual bare metal gateway can decapsulate the vxlan format of the first data packet, and after determining the forwarding path, convert the decapsulated data packet into vlan format, and finally forward the vlan format data packet to the target bare metal server, which processes the first vlan format data packet. Optionally, the virtual bare metal gateway and the physical switch can transmit data through their respective physical network card interfaces, for example, the physical network card interface of the virtual bare metal gateway is a NIC interface, and the physical network card interface of the physical switch is a Port interface; the external device and the physical switch can transmit data through their respective physical network card interfaces, for example, the physical network card interface of the external device is a NIC interface; and the physical switch and the bare metal server can transmit data through the Port interface.
[0067] The data transmission method provided by the embodiment of the present application is to obtain a configured virtual bare metal gateway by deploying a physical switch under a first network and configuring a virtual bare metal gateway associated with the physical switch according to the first network. Then, when receiving a first data packet sent by an external device through the physical switch, the forwarding path of the first data packet is determined according to the configured virtual bare metal gateway, and the first data packet is forwarded to the target bare metal server under the physical switch based on the forwarding path. In the traditional data transmission process, when using a bare metal gateway to transmit data, the bare metal gateway needs to be adapted to the physical switch, and different types of physical switches are adapted to different bare metal gateways, and additional hardware equipment is also required, which undoubtedly increases the transmission cost. The above method uses the deployed virtual bare metal gateway for data transmission, which can directly interact with various types of physical switches for data, effectively reducing the data transmission cost.
[0068] In some embodiments, the virtual bare metal gateway includes an information query table, a first virtual forwarder, and multiple second virtual forwarders. On this basis, a specific implementation method for determining the forwarding path of the first data packet is also provided, such as Figure 3 As shown, the “determining a forwarding path for the first data packet according to the configured virtual bare metal gateway” in S202 above includes:
[0069] S301: Query the forwarding source of the first data packet in an information query table.
[0070] The virtual bare metal gateway includes an information query table, a first virtual forwarder, and multiple second virtual forwarders. The information query table contains the correspondence between virtual network identifiers and virtual routing information. The virtual routing information includes virtual forwarders and their corresponding routing forwarding tables or routing tables. The first virtual forwarder is the outermost virtual forwarder in the virtual bare metal gateway, and the second virtual forwarder is the innermost virtual forwarder. The outer virtual forwarders have a higher data transmission speed than the inner virtual forwarders.
[0071] In an embodiment of the present application, after receiving the first data packet, the computer device can parse the first data packet, determine the virtual network identifier of the first data packet, and then query the virtual routing information corresponding to the virtual network identifier of the first data packet in the information query table, and then determine the corresponding virtual forwarder based on the virtual routing information, and use the virtual forwarder as the forwarding source of the first data packet.
[0072] S302: If the forwarding source is the first virtual forwarder, determine a first forwarding path for the first data packet according to the routing table in the first virtual forwarder.
[0073] Among them, when the forwarding source is the first virtual forwarder, the first forwarding path includes forwarding the first data packet from the first virtual forwarder to the target bare metal server through the physical switch.
[0074] In an embodiment of the present application, when the computer device determines that the forwarding source is the first virtual forwarder based on the above steps, this situation indicates that data forwarding can be directly performed using the virtual forwarder in the outer layer of the virtual bare metal gateway. Then, the routing forwarding table in the first virtual forwarder can be obtained from the information query table, and then the next-hop transmission device is determined according to the routing forwarding table in the first virtual forwarder, and then the next-hop transmission device of the next-hop transmission device is determined, until the target transmission device is the target bare metal server, and the first forwarding path of the first data packet can be obtained, that is, the first forwarding path includes the first virtual forwarder forwarding the first data packet to the target bare metal server through the physical switch.
[0075] S303: If the forwarding source is a second virtual forwarder, determine a target virtual forwarder from a plurality of second virtual forwarders, and determine a first forwarding path for the first data packet according to a routing table in the target virtual forwarder.
[0076] The first forwarding path when the forwarding source is the second virtual forwarder includes forwarding the first data packet from the target virtual forwarder to the target bare metal server through the physical switch.
[0077] In an embodiment of the present application, when the computer device determines, based on the above steps, that the forwarding source is a second virtual forwarder, this indicates that the outer virtual forwarder in the virtual bare metal gateway cannot be used directly for data forwarding, and that the inner virtual forwarder must be used for data forwarding. The computer device can then further determine whether the second virtual forwarder is currently occupied. If the second virtual forwarder is not occupied, the second virtual forwarder is used as the target virtual forwarder, and a first forwarding path for the first data packet is determined based on the routing table in the second virtual forwarder. If the second virtual forwarder is occupied, a target virtual forwarder is determined from multiple second virtual forwarders, and the first forwarding path for the first data packet is determined based on the routing table in the target virtual forwarder. The first data packet is then forwarded to the target virtual forwarder, and the first data packet is forwarded to the target bare metal server based on the first forwarding path. Optionally, when the computer device determines that the forwarding source is the second virtual forwarder, a flow table (i.e., a flow table) can be applied for and created in the virtual bare metal gateway to record relevant information about the first data packet. The relevant information about the first data packet may specifically record information such as the format of the first data packet, the source of the first data packet, and the content or purpose of the first data packet. After the flow table is created, a first forwarding path of the first data packet may be determined, and then the first forwarding path may also be recorded in the flow table.
[0078] Optionally, the virtual bare metal gateway further includes a virtual proxy module and a virtual network card table. On this basis, a specific implementation method for determining the target virtual forwarder is also provided, such as Figure 4 As shown, the “determining a target virtual forwarder from a plurality of second virtual forwarders” in S303 above includes:
[0079] S401, sending relevant information of the third virtual forwarder to the virtual proxy module to perform forwarding function verification and obtain a verification result.
[0080] Among them, the third virtual forwarder is a second virtual forwarder determined by the forwarding source of the first data packet. The relevant information of the third virtual forwarder includes the identifier and address information of the third virtual forwarder. The virtual bare metal gateway also includes a virtual proxy module and a virtual network card table. The virtual proxy module stores the correspondence between the virtual forwarder and the forwarding rule, and the forwarding rule is used to characterize whether the virtual forwarder has the forwarding function. Optionally, the virtual proxy module may also include a virtual forwarder list. The virtual network card table includes relevant information of the virtual forwarder with the forwarding function. The verification result includes verification passed or verification failed. Furthermore, when the verification result is verification passed, the verification result may also include that the third virtual forwarder has the forwarding function or the third virtual forwarder does not have the forwarding function.
[0081] In an embodiment of the present application, after the computer device determines the second virtual forwarder based on the forwarding source of the first data packet, it can use the second virtual forwarder as the third virtual forwarder, and then send the relevant information of the third virtual forwarder to the virtual agent module. After the virtual agent module receives the relevant information of the third virtual forwarder, it can determine whether the third virtual forwarder has the forwarding function based on the correspondence between the virtual forwarder and the forwarding rule, and obtain a verification result. In this case, the verification result includes whether the third virtual forwarder has the forwarding function or the third virtual forwarder does not have the forwarding function. Optionally, after the virtual agent module receives the relevant information of the third virtual forwarder, it can also verify whether the third virtual forwarder exists in the virtual forwarder list. If so, it indicates that the verification is successful. Then, it can further determine whether the third virtual forwarder has the forwarding function based on the correspondence between the virtual forwarder and the forwarding rule, and obtain a verification result including whether the third virtual forwarder has the forwarding function or the third virtual forwarder does not have the forwarding function. If it does not exist, it indicates that the verification is unsuccessful.
[0082] S402: If the verification result indicates that the third virtual forwarder has the forwarding function, determine the third virtual forwarder as the target virtual forwarder.
[0083] In the embodiment of the present application, when the computer device determines based on the above steps that the verification result indicates that the third virtual forwarder has the forwarding function, the third virtual forwarder is determined as the target virtual forwarder.
[0084] S403: If the verification result indicates that the third virtual forwarder does not have the forwarding function, determine a second virtual forwarder with the forwarding function among the plurality of second virtual forwarders according to the virtual network card table, and determine the second virtual forwarder with the forwarding function as the target virtual forwarder.
[0085] In an embodiment of the present application, when the computer device determines based on the above steps that the verification result indicates that the third virtual forwarder does not have forwarding functionality, a second virtual forwarder with forwarding functionality is selected from multiple second virtual forwarders in the virtual network card table, and then the second virtual forwarder with forwarding functionality is used as the target virtual forwarder. Optionally, when multiple second virtual forwarders with forwarding functionality exist, any one of them can be selected as the target virtual forwarder. Optionally, the second virtual forwarder with forwarding functionality whose address information is closest to the third virtual forwarder can be selected as the target virtual forwarder. Optionally, the second virtual forwarder with forwarding functionality that currently has the best performance can also be selected as the target virtual forwarder.
[0086] The method described in the embodiments of the present application verifies the forwarding function of the third virtual forwarder through the virtual proxy module, thereby promptly determining whether the virtual forwarder has normal forwarding functionality, avoiding packet forwarding failures due to virtual forwarder failures, and improving network reliability. Furthermore, if the third virtual forwarder does not have forwarding functionality, a device with forwarding functionality can be found from among the multiple second virtual forwarders based on the virtual network card table as the target virtual forwarder. This backup mechanism allows for rapid failover in the event of a virtual forwarder failure, ensuring the continuity and stability of data transmission.
[0087] In some embodiments, based on the above embodiments, the data transmission method further includes:
[0088] When a second data packet sent by the physical switch is received, the second data packet is sent to the configured virtual bare metal gateway for encapsulation processing, and the encapsulated second data packet is forwarded to the external device through the physical switch.
[0089] The second data packet is a data packet obtained by processing the first data packet by the target bare metal server.
[0090] In an embodiment of the present application, after the target bare metal server processes the first data packet, it obtains a second data packet, and then the second data packet can be sent to the physical switch through the physical network port. After the physical switch receives the second data packet, it can forward the second data packet to the virtual bare metal gateway in the computer device through the network port, so that the computer device can receive the second data packet. After receiving the second data packet, if the format of the second data packet is inconsistent with the format of the first data packet, the computer device needs to use the encapsulation module in the virtual bare metal gateway to encapsulate the second data packet. For example, the vlan format of the second data packet is encapsulated into the vxlan format to obtain the encapsulated second data packet, and then the encapsulated second data packet is forwarded to the external device through the physical switch, and the external device can receive the processing result of the computer device on the first data packet.
[0091] The method described in the embodiments of the present application, since different external devices may use different data packet formats for communication, and the virtual bare metal gateway can encapsulate and process data packets of various formats, allows the physical switch to communicate with multiple types of external devices, breaking the communication barriers caused by incompatible data packet formats, realizing the interconnection of the entire network, and thus improving data transmission efficiency.
[0092] In some embodiments, a specific implementation method for configuring a virtual bare metal gateway is also provided, such as Figure 5 As shown, the above-mentioned "configuring a virtual bare metal gateway associated with the physical switch according to the first network to obtain a configured virtual bare metal gateway" in S201 includes:
[0093] S501: Create a corresponding virtual network card according to the first network, and build a virtual network card table of the virtual network card.
[0094] The virtual network card table includes at least one of a virtual network ID, a MAC address, and an IP address.
[0095] In an embodiment of the present application, after receiving a bare metal server creation request, the computer device can parse the relevant information of the first network from the bare metal server creation request, then create the corresponding virtual network card configuration information based on the relevant information of the first network, then call the physical switch to the virtual network corresponding to the virtual network card, and associate the virtual bare metal gateway, and build a virtual network card table for the virtual network card in the virtual bare metal gateway. Exemplarily, the computer device can be composed of a software-defined network controller (SDN controller) and a device management service. After receiving a bare metal server creation request, the SDN controller can create the configuration information of the virtual network card, then put the configuration information of the virtual network card into a message queue. The device management service regularly obtains the configuration information of the virtual network card from the message queue, and then calls the physical switch, creates a virtual bare metal gateway, and deploys the bare metal server to the first network based on the configuration information of the virtual network card, and builds a virtual network card table for the virtual network card in the virtual bare metal gateway. Optionally, in actual applications, the SDN controller can directly send the configuration information of the virtual network card to the device management service without going through the message queue. For example, the SDN controller receives a request to create a bare metal server. It then creates virtual network card configuration information corresponding to the first network and associates it with the bare metal server. It then saves this virtual network card configuration information to the SDN controller's in-memory database and sends it to the MQ message queue. The device management service retrieves the virtual network card configuration information from the message queue, configures the physical switch to the virtual network VLAN, and calls the virtual bare metal gateway to create a virtual network card table (i.e., virtual machine interface) and specify the corresponding virtual network VLAN.
[0096] S502: Obtain relevant information of the virtual network card according to a transmission path relationship between the physical switch and the virtual bare metal gateway associated with the physical switch.
[0097] The transmission path relationship includes the address information of the physical switch and the address information of the virtual bare metal gateway. The relevant information of the virtual network card includes the routing information of the virtual network card and the virtual routing forwarding information.
[0098] In an embodiment of the present application, after the computer device creates a virtual bare metal gateway based on the above steps, it can send the transmission path relationship between the physical switch and the virtual bare metal gateway to a preset storage device, and obtain all the information of the virtual network card from the storage device. Among them, the preset storage device can be an SDN controller. For example, after the virtual bare metal gateway creates the virtual machine interface, the agent program running on the virtual bare metal gateway initiates a subscription to the SDN controller through the XMPP protocol. The SDN controller sends the virtual bare metal gateway information such as the virtual routing forwarding information VRF, IP address, MAC address, and routing table of the virtual network card, and the computer device can obtain the relevant information of the virtual network card.
[0099] S503: Update the routing information in the routing forwarding table according to the relevant information of the virtual network card to obtain the configured virtual bare metal gateway.
[0100] In an embodiment of the present application, after the computer device obtains the relevant information of the virtual network card based on the above steps, it can update the routing information in the routing table according to the relevant information of the virtual network card to obtain the configured virtual bare metal gateway. For example, after the agent program receives the relevant information of the virtual network card sent by the SDN controller, it can convert the format of the virtual bare metal gateway information, and then store the format-converted information as its own memory data structure, and send the VRF table, routing table, vxlan, vlan and other information to the forwarding plane (the forwarding plane supports DPDK high-speed forwarding) for forwarding. In the subsequent deployment of the operating system, deployment can be achieved through the virtual bare metal gateway.
[0101] The methods described in the embodiments of this application can reduce reliance on traditional hardware devices by implementing network functions through the construction of a virtual bare metal gateway. In traditional network architectures, implementing different network functions often requires the deployment of a large number of hardware devices. However, the use of virtual bare metal gateways and virtual network cards can replace these hardware devices to a certain extent, reducing hardware and maintenance costs.
[0102] In some embodiments, a method for configuring a virtual bare metal gateway according to a user's business needs is further provided, and the data transmission method further includes:
[0103] The physical switch is deployed in the second network, and a virtual bare metal gateway associated with the physical switch is configured according to the second network to obtain a configured virtual bare metal gateway.
[0104] The second network is a network that users set up based on their business needs after deploying a bare metal server and installing the operating system to provide personalized services. The first and second networks have different network segments.
[0105] In an embodiment of the present application, when a computer device deploys a virtual bare metal gateway under a second network, it can clear the relevant information of the virtual bare metal gateway deployed under the first network in advance, and then use the same steps to configure the virtual bare metal gateway under the second network. Specifically, after the computer device receives the service network card creation request corresponding to the second network, it can parse the creation request to obtain information about the second network, and then create the configuration information of the virtual network card corresponding to the second network. Finally, according to the configuration information of the virtual network card, the physical switch is called to the second network, and according to the correspondence between the physical switch and the virtual bare metal gateway, the virtual bare metal gateway associated with the physical switch is deployed to the second network, and the bare metal server is mounted on the virtual bare metal gateway according to the address information of the bare metal server in the configuration information of the virtual network card, to obtain the configured virtual bare metal gateway and bare metal server. It should be noted that the correspondence between the physical switch and the virtual bare metal gateway can be created in advance according to the usage requirements. The configuration information of the virtual network card includes the network information corresponding to the virtual network card and the address information of the bare metal server, etc. When calling the physical switch above, any physical switch in the current data transmission system can be called, or the physical switch with the best performance can be called. After the bare metal server system is started, it can provide functions such as DHCP, security groups, gateways, EIPs, DNS, ACLs, and peer-to-peer connections. It should be noted that the data transmission methods described in the preceding embodiments can be used not only in virtual bare metal gateways deployed on the first network, but also in virtual bare metal gateways deployed on the second network. Data packets are transmitted in the same manner in the virtual bare metal gateways deployed on the second network as in the first network.
[0106] The method described in the embodiments of the present application, by configuring a virtual bare metal gateway under the second network, can realize the reuse of a network card for the initial deployment of the first network and the second network when providing services, which can save hardware costs, and then use the deployed virtual bare metal gateway for data transmission, which can effectively reduce data transmission costs.
[0107] In summary of all the above embodiments, a data transmission method is also provided, such as Figure 6 As shown, the method includes:
[0108] S601: deploy a physical switch under a first network, create a corresponding virtual network card according to the first network, and construct a virtual network card table for the virtual network card.
[0109] S602: Obtain relevant information of the virtual network card according to a transmission path relationship between the physical switch and the virtual bare metal gateway associated with the physical switch.
[0110] S603: Update the routing information in the routing forwarding table according to the relevant information of the virtual network card to obtain the configured virtual bare metal gateway.
[0111] S604: Deploy the physical switch in the second network, and configure a virtual bare metal gateway associated with the physical switch according to the second network to obtain a configured virtual bare metal gateway.
[0112] S605 : When a first data packet is received from an external device through a physical switch, the forwarding source of the first data packet is searched in an information query table.
[0113] S606: If the forwarding source is the first virtual forwarder, determine a first forwarding path for the first data packet based on the routing table in the first virtual forwarder, wherein the first forwarding path includes forwarding the first data packet from the first virtual forwarder to the target bare metal server via the physical switch.
[0114] S607: If the forwarding source is the second virtual forwarder, send the relevant information of the third virtual forwarder to the virtual proxy module for forwarding function verification to obtain a verification result.
[0115] S608: If the verification result indicates that the third virtual forwarder has the forwarding function, determine the third virtual forwarder as the target virtual forwarder.
[0116] S609: If the verification result indicates that the third virtual forwarder does not have the forwarding function, a second virtual forwarder with the forwarding function is determined from the virtual network card table among the plurality of second virtual forwarders, and the second virtual forwarder with the forwarding function is determined as the target virtual forwarder. The first forwarding path includes the target virtual forwarder forwarding the first data packet to the target bare metal server via the physical switch.
[0117] S610: Determine a first forwarding path for a first data packet according to a routing table in a target virtual forwarder, and forward the first data packet to a target bare metal server under a physical switch based on the forwarding path.
[0118] S611: Upon receiving a second data packet sent by the physical switch, the second data packet is sent to the configured virtual bare metal gateway for encapsulation, and the encapsulated second data packet is forwarded to an external device via the physical switch. The second data packet is the result of the target bare metal server processing the first data packet.
[0119] The method described in the embodiment of the present application realizes a method for generating, storing, and issuing a virtual bare metal gateway configuration, realizes a large-scale unified Layer 2 networking of virtual machines and containers, and achieves high availability of the bare metal gateway.
[0120] The methods described in the above steps are all described in the above embodiments. Please refer to the above description for details and will not be repeated here.
[0121] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0122] Based on the same inventive concept, embodiments of the present application further provide a data transmission device for implementing the aforementioned data transmission method. The implementation solution provided by this device is similar to the implementation solution described in the aforementioned method. Therefore, the specific limitations of one or more data transmission device embodiments provided below can be found in the above-mentioned limitations of the data transmission method and will not be further elaborated here.
[0123] In some embodiments, as Figure 7 As shown, a data transmission device is provided, comprising:
[0124] The configuration module 70 is used to deploy the physical switch under the first network, and configure the virtual bare metal gateway associated with the physical switch according to the first network to obtain the configured virtual bare metal gateway.
[0125] The transmission module 71 is used to determine the forwarding path of the first data packet according to the configured virtual bare metal gateway when receiving the first data packet sent by the external device through the physical switch, and forward the first data packet to the target bare metal server under the physical switch based on the forwarding path.
[0126] In some embodiments, the transmission module includes:
[0127] The query unit is used to query the forwarding source of the first data packet in the information query table.
[0128] The first determination unit is used to determine a first forwarding path for the first data packet according to the routing table in the first virtual forwarder if the forwarding source is the first virtual forwarder; the first forwarding path includes forwarding the first data packet by the first virtual forwarder through the physical switch to the target bare metal server.
[0129] The second determination unit is used to determine the target virtual forwarder from multiple second virtual forwarders if the forwarding source is the second virtual forwarder, and then determine the first forwarding path of the first data packet according to the routing table in the target virtual forwarder; the first forwarding path includes forwarding the first data packet by the target virtual forwarder to the target bare metal server through the physical switch.
[0130] In some embodiments, the second determining unit includes:
[0131] The first verification subunit is used to send relevant information of the third virtual forwarder to the virtual proxy module for forwarding function verification to obtain a verification result; the third virtual forwarder is the second virtual forwarder determined by the forwarding source of the first data packet.
[0132] The first determining subunit is configured to determine the third virtual forwarder as the target virtual forwarder if the verification result indicates that the third virtual forwarder has the forwarding function.
[0133] The second determining subunit is used to determine a second virtual forwarder with forwarding function among multiple second virtual forwarders according to the virtual network card table if the verification result indicates that the third virtual forwarder does not have forwarding function, and determine the second virtual forwarder with forwarding function as the target virtual forwarder.
[0134] In some embodiments, the above-mentioned data transmission device is also used to send the second data packet to the configured virtual bare metal gateway for encapsulation processing when receiving the second data packet sent by the physical switch, and forward the encapsulated second data packet to the external device through the physical switch; the second data packet is the data packet after the target bare metal server processes the first data packet.
[0135] In some embodiments, the configuration module includes:
[0136] The construction unit is configured to create a corresponding virtual network card according to the first network, and to construct a virtual network card table of the virtual network card.
[0137] The acquisition unit is used to acquire relevant information of the virtual network card according to the transmission path relationship between the physical switch and the virtual bare metal gateway associated with the physical switch.
[0138] The configuration unit is used to update the routing information in the routing forwarding table according to the relevant information of the virtual network card to obtain the configured virtual bare metal gateway.
[0139] In some embodiments, the above-mentioned data transmission device is also used to deploy a physical switch under a second network, and configure a virtual bare metal gateway associated with the physical switch according to the second network to obtain a configured virtual bare metal gateway.
[0140] Each module in the above-mentioned data transmission device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0141] In some embodiments, a computer device is provided. The computer device can be a terminal or a server. The internal structure diagram thereof can be as follows: Figure 8 As shown, the computer device includes a processor, memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, memory, and input / output interface are connected via a system bus, while the communication interface, display unit, and input device are connected to the system bus via the input / output interface. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operating system and computer programs stored in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals via wired or wireless means, with wireless communication being achieved via Wi-Fi, mobile cellular networks, NFC (near-field communication), or other technologies. When executed by the processor, the computer program implements a data transmission method. The display unit of the computer device is used to produce a visually visible image and may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse.
[0142] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0143] In some embodiments, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0144] Deploy the physical switch under the first network, and configure a virtual bare metal gateway associated with the physical switch according to the first network to obtain a configured virtual bare metal gateway;
[0145] When a first data packet is received from an external device through a physical switch, a forwarding path for the first data packet is determined according to the configured virtual bare metal gateway, and the first data packet is forwarded to a target bare metal server under the physical switch based on the forwarding path.
[0146] In some embodiments, when the processor executes the computer program, it further implements the following steps:
[0147] Query the forwarding source of the first data packet in the information query table;
[0148] If the forwarding source is the first virtual forwarder, determining a first forwarding path for the first data packet according to the routing table in the first virtual forwarder; the first forwarding path includes forwarding the first data packet by the first virtual forwarder through the physical switch to the target bare metal server;
[0149] If the forwarding source is a second virtual forwarder, a target virtual forwarder is determined from multiple second virtual forwarders, and a first forwarding path of the first data packet is determined according to the routing table in the target virtual forwarder; the first forwarding path includes forwarding the first data packet by the target virtual forwarder through the physical switch to the target bare metal server.
[0150] In some embodiments, when the processor executes the computer program, it further implements the following steps:
[0151] Sending relevant information of the third virtual forwarder to the virtual proxy module for forwarding function verification to obtain a verification result; the third virtual forwarder is the second virtual forwarder determined by the forwarding source of the first data packet;
[0152] If the verification result indicates that the third virtual forwarder has the forwarding function, determining the third virtual forwarder as the target virtual forwarder;
[0153] If the verification result indicates that the third virtual forwarder does not have the forwarding function, a second virtual forwarder with the forwarding function among the plurality of second virtual forwarders is determined according to the virtual network card table, and the second virtual forwarder with the forwarding function is determined as the target virtual forwarder.
[0154] In some embodiments, when the processor executes the computer program, it further implements the following steps:
[0155] When a second data packet is received from the physical switch, the second data packet is sent to the configured virtual bare metal gateway for encapsulation processing, and the encapsulated second data packet is forwarded to the external device through the physical switch; the second data packet is the data packet after the target bare metal server processes the first data packet.
[0156] In some embodiments, when the processor executes the computer program, it further implements the following steps:
[0157] Creating a corresponding virtual network card according to the first network, and constructing a virtual network card table of the virtual network card;
[0158] Obtain information about the virtual network card based on the transmission path relationship between the physical switch and the virtual bare metal gateway associated with the physical switch;
[0159] The routing information in the routing table is updated based on the relevant information of the virtual network card to obtain the configured virtual bare metal gateway.
[0160] In some embodiments, when the processor executes the computer program, it further implements the following steps:
[0161] The physical switch is deployed in the second network, and a virtual bare metal gateway associated with the physical switch is configured according to the second network to obtain a configured virtual bare metal gateway.
[0162] The computer device provided in the above embodiment has an implementation principle and technical effects similar to those of the above method embodiment, and will not be described in detail here.
[0163] In some embodiments, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0164] Deploy the physical switch under the first network, and configure a virtual bare metal gateway associated with the physical switch according to the first network to obtain a configured virtual bare metal gateway;
[0165] When a first data packet is received from an external device through a physical switch, a forwarding path for the first data packet is determined according to the configured virtual bare metal gateway, and the first data packet is forwarded to a target bare metal server under the physical switch based on the forwarding path.
[0166] In some embodiments, when the computer program is executed by a processor, the following steps are further implemented:
[0167] Query the forwarding source of the first data packet in the information query table;
[0168] If the forwarding source is the first virtual forwarder, determining a first forwarding path for the first data packet according to the routing table in the first virtual forwarder; the first forwarding path includes forwarding the first data packet by the first virtual forwarder through the physical switch to the target bare metal server;
[0169] If the forwarding source is a second virtual forwarder, a target virtual forwarder is determined from multiple second virtual forwarders, and a first forwarding path of the first data packet is determined based on the routing table in the target virtual forwarder; the first forwarding path includes forwarding the first data packet by the target virtual forwarder through the physical switch to the target bare metal server.
[0170] In some embodiments, when the computer program is executed by a processor, the following steps are further implemented:
[0171] Sending relevant information of the third virtual forwarder to the virtual proxy module for forwarding function verification to obtain a verification result; the third virtual forwarder is the second virtual forwarder determined by the forwarding source of the first data packet;
[0172] If the verification result indicates that the third virtual forwarder has the forwarding function, determining the third virtual forwarder as the target virtual forwarder;
[0173] If the verification result indicates that the third virtual forwarder does not have the forwarding function, a second virtual forwarder with the forwarding function among the plurality of second virtual forwarders is determined according to the virtual network card table, and the second virtual forwarder with the forwarding function is determined as the target virtual forwarder.
[0174] In some embodiments, when the computer program is executed by a processor, the following steps are further implemented:
[0175] When a second data packet is received from the physical switch, the second data packet is sent to the configured virtual bare metal gateway for encapsulation processing, and the encapsulated second data packet is forwarded to the external device through the physical switch; the second data packet is the data packet after the target bare metal server processes the first data packet.
[0176] In some embodiments, when the computer program is executed by a processor, the following steps are further implemented:
[0177] Creating a corresponding virtual network card according to the first network, and constructing a virtual network card table of the virtual network card;
[0178] Obtain information about the virtual network card based on the transmission path relationship between the physical switch and the virtual bare metal gateway associated with the physical switch;
[0179] The routing information in the routing table is updated based on the relevant information of the virtual network card to obtain the configured virtual bare metal gateway.
[0180] In some embodiments, when the computer program is executed by a processor, the following steps are further implemented:
[0181] The physical switch is deployed in the second network, and a virtual bare metal gateway associated with the physical switch is configured according to the second network to obtain a configured virtual bare metal gateway.
[0182] In some embodiments, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0183] Deploy the physical switch under the first network, and configure a virtual bare metal gateway associated with the physical switch according to the first network to obtain a configured virtual bare metal gateway;
[0184] When a first data packet is received from an external device through a physical switch, a forwarding path for the first data packet is determined according to the configured virtual bare metal gateway, and the first data packet is forwarded to a target bare metal server under the physical switch based on the forwarding path.
[0185] In some embodiments, when the computer program is executed by a processor, the following steps are further implemented:
[0186] Query the forwarding source of the first data packet in the information query table;
[0187] If the forwarding source is the first virtual forwarder, determining a first forwarding path for the first data packet according to the routing table in the first virtual forwarder; the first forwarding path includes forwarding the first data packet by the first virtual forwarder through the physical switch to the target bare metal server;
[0188] If the forwarding source is a second virtual forwarder, a target virtual forwarder is determined from multiple second virtual forwarders, and a first forwarding path of the first data packet is determined based on the routing table in the target virtual forwarder; the first forwarding path includes forwarding the first data packet by the target virtual forwarder through the physical switch to the target bare metal server.
[0189] In some embodiments, when the computer program is executed by a processor, the following steps are further implemented:
[0190] Sending relevant information of the third virtual forwarder to the virtual proxy module for forwarding function verification to obtain a verification result; the third virtual forwarder is the second virtual forwarder determined by the forwarding source of the first data packet;
[0191] If the verification result indicates that the third virtual forwarder has the forwarding function, determining the third virtual forwarder as the target virtual forwarder;
[0192] If the verification result indicates that the third virtual forwarder does not have the forwarding function, a second virtual forwarder with the forwarding function among the plurality of second virtual forwarders is determined according to the virtual network card table, and the second virtual forwarder with the forwarding function is determined as the target virtual forwarder.
[0193] In some embodiments, when the computer program is executed by a processor, the following steps are further implemented:
[0194] When a second data packet is received from the physical switch, the second data packet is sent to the configured virtual bare metal gateway for encapsulation processing, and the encapsulated second data packet is forwarded to the external device through the physical switch; the second data packet is the data packet after the target bare metal server processes the first data packet.
[0195] In some embodiments, when the computer program is executed by a processor, the following steps are further implemented:
[0196] Creating a corresponding virtual network card according to the first network, and constructing a virtual network card table of the virtual network card;
[0197] Obtain information about the virtual network card based on the transmission path relationship between the physical switch and the virtual bare metal gateway associated with the physical switch;
[0198] The routing information in the routing table is updated based on the relevant information of the virtual network card to obtain the configured virtual bare metal gateway.
[0199] In some embodiments, when the computer program is executed by a processor, the following steps are further implemented:
[0200] The physical switch is deployed in the second network, and a virtual bare metal gateway associated with the physical switch is configured according to the second network to obtain a configured virtual bare metal gateway.
[0201] The above embodiment provides a computer program product, whose implementation principle and technical effects are similar to those of the above method embodiment, and will not be repeated here.
[0202] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), data processing logic devices based on quantum computing, and the like.
[0203] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0204] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A data transmission method, characterized in that: The method comprises: Deploy at least one physical switch of the data transmission system under a first network, create a corresponding virtual network card according to the first network, and construct a virtual network card table of the virtual network card; Obtaining relevant information of the virtual network card according to a transmission path relationship between the physical switch and the virtual bare metal gateway associated with the physical switch; Update the routing information in the routing forwarding table according to the relevant information of the virtual network card to obtain the configured virtual bare metal gateway; When a first data packet is received from an external device through the physical switch, a forwarding path for the first data packet is determined according to the configured virtual bare metal gateway, and the first data packet is forwarded to a target bare metal server under any physical switch in the data transmission system based on the forwarding path.
2. The method according to claim 1, characterized in that The virtual bare metal gateway includes an information query table, a first virtual forwarder, and multiple second virtual forwarders. Determining a forwarding path for the first data packet based on the configured virtual bare metal gateway includes: Query the forwarding source of the first data packet in the information query table; If the forwarding source is the first virtual forwarder, determining a first forwarding path for the first data packet according to a routing table in the first virtual forwarder; the first forwarding path includes forwarding the first data packet by the first virtual forwarder through the physical switch to the target bare metal server; If the forwarding source is the second virtual forwarder, a target virtual forwarder is determined from the multiple second virtual forwarders, and a first forwarding path of the first data packet is determined according to the routing table in the target virtual forwarder; the first forwarding path includes forwarding the first data packet by the target virtual forwarder through the physical switch to the target bare metal server.
3. The method according to claim 2, characterized in that The virtual bare metal gateway further includes a virtual proxy module and a virtual network card table, and determining the target virtual forwarder from the multiple second virtual forwarders includes: Sending relevant information of the third virtual forwarder to the virtual proxy module for forwarding function verification to obtain a verification result; the third virtual forwarder is the second virtual forwarder determined by the forwarding source of the first data packet; If the verification result indicates that the third virtual forwarder has the forwarding function, determining the third virtual forwarder as the target virtual forwarder; If the verification result indicates that the third virtual forwarder does not have the forwarding function, a second virtual forwarder having the forwarding function among the multiple second virtual forwarders is determined according to the virtual network card table, and the second virtual forwarder having the forwarding function is determined as the target virtual forwarder.
4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: Upon receiving a second data packet sent by the physical switch, the second data packet is sent to the configured virtual bare metal gateway for encapsulation processing, and the encapsulated second data packet is forwarded to the external device through the physical switch; the second data packet is the data packet obtained by the target bare metal server processing the first data packet.
5. The method according to claim 1, wherein The method further comprises: The physical switch is deployed in a second network, and a virtual bare metal gateway associated with the physical switch is configured according to the second network to obtain a configured virtual bare metal gateway.
6. A data transmission device, characterized in that: The device comprises: A configuration module is configured to deploy at least one physical switch of a data transmission system under a first network, create a corresponding virtual network card according to the first network, and construct a virtual network card table for the virtual network card; obtain relevant information of the virtual network card according to a transmission path relationship between the physical switch and a virtual bare metal gateway associated with the physical switch; update routing information in a routing forwarding table according to the relevant information of the virtual network card to obtain a configured virtual bare metal gateway; A transmission module is used to determine a forwarding path for a first data packet sent by an external device through the physical switch according to the configured virtual bare metal gateway, and forward the first data packet to a target bare metal server under any physical switch in the data transmission system based on the forwarding path.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
9. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Bare metal server network system and implementation method thereof
CN111585917A
Bare metal service delivery method and device, computer equipment and storage medium
CN112286537A