Data transmission method, device, server and readable storage medium
By creating multiple virtual switches in the server, the target virtual switch receives the data packets to be transmitted and determines the transmission path, the problem of poor transmission performance of existing medium-sized or large networks is solved, and more efficient data transmission and simple migration process is achieved.
Patent Information
- Application Number
- CN202211606136.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-12
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2042-12-12
AI Technical Summary
There are gaps in transmission performance in existing medium or large networks, resulting in inefficiency.
By creating multiple virtual switches in the server, the target virtual switch receives the packets to be transmitted and determines the transmission path based on whether there is a transmission path in the server's database. If it does not exist in the database, the target virtual switch will determine the transmission path based on the routing information of other virtual switches and perform packet transmission.
This method does not require setting up multiple sets of physical devices, which reduces costs, avoids interference from physical cable transmission, improves transmission performance, and simplifies the network migration process.
Smart Images

Figure CN116112450B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a data transmission method, device, server and readable storage medium. Background Art
[0002] With the development of Internet technology, in order to meet the communication needs of medium or large networks, the OSPF (Open Shortest Path First) protocol is usually used in medium or large networks.
[0003] In conventional technology, in a medium or large network, multiple groups of servers, switches, routers and other physical devices are set up to implement OSPF and establish communication in the medium or large network.
[0004] However, existing medium-sized or large-scale networks suffer from poor transmission performance. Summary of the invention
[0005] Based on this, it is necessary to provide a data transmission method, device, server and readable storage medium that can improve the transmission performance of the network in response to the above technical problems.
[0006] In a first aspect, the present application provides a data transmission method, which is applied to a server, wherein a plurality of virtual switches are created in the server, and the method comprises:
[0007] The target virtual switch among the multiple virtual switches receives the data packet to be transmitted, and determines whether the database of the server contains the transmission path corresponding to the data packet to be transmitted;
[0008] When the server database does not contain the transmission path corresponding to the data packet to be transmitted, the transmission path is determined according to the data packet to be transmitted and the routing information of other virtual switches in the multiple virtual switches, and the data packet to be transmitted is transmitted based on the transmission path.
[0009] In the above embodiment, when transmitting data packets, multiple virtual switches created in a server are used to replace multiple groups of physical devices in the prior art. After the target switch in the multiple virtual switches receives the data packet to be transmitted, and the server's database does not include the transmission data of the data packet to be transmitted, the target virtual switch will determine the transmission path corresponding to the data packet to be transmitted based on the data packet to be transmitted and the routing information of other virtual switches in the multiple virtual switches, so as to complete the transmission of the data packet to be transmitted based on the transmission path. In this way, the transmission of the data packet to be transmitted is realized through multiple virtual switches in the server. Compared with the use of physical devices in the prior art, there is no need to set up multiple groups of servers or switches, which can reduce costs; there will be no compatibility issues between multiple virtual switches; and the connection between multiple virtual switches does not need to be through physical cables, which can avoid interference caused by physical cable transmission, thereby improving transmission performance.
[0010] In addition, multiple virtual switches are created on one server. When migrating, the data in the server is directly copied to complete the migration. There is no need to relocate a large number of physical devices, which makes migration very convenient.
[0011] In one embodiment, determining a transmission path according to a data packet to be transmitted and routing information of other virtual switches in a plurality of virtual switches includes:
[0012] Determine link information according to routing information of other virtual switches in the multiple virtual switches;
[0013] Determine the transmission path based on the link information and the data packets to be transmitted.
[0014] In the above embodiment, when the server database does not contain the transmission path corresponding to the data packet to be transmitted, the target virtual switch determines the link information based on the routing information obtained from the virtual switch adjacent to it, and determines the transmission path corresponding to the data packet to be transmitted based on the link information. This method of determining the transmission path is simple and easy to implement.
[0015] In one embodiment, determining a transmission path according to link information and a data packet to be transmitted includes:
[0016] Extracting source address and destination address from the data packet to be transmitted;
[0017] Based on the Dijkstra algorithm, the transmission path from the source address to the destination address is determined according to the link information.
[0018] In the above embodiment, the method of determining the transmission path of the data packet to be transmitted from the source address to the destination address based on the Dijkstra algorithm and link information can quickly and accurately select the optimal path corresponding to the data packet to be transmitted from the link information, thereby improving the transmission performance.
[0019] In one embodiment, determining whether a database of the server contains a transmission path corresponding to the data packet to be transmitted includes:
[0020] Based on the source address and the destination address corresponding to the data packet to be transmitted, a search is performed in the database of the server to determine whether the database of the server contains a transmission path from the source address to the destination address.
[0021] In the above embodiment, the target virtual switch directly searches for the transmission path in the database of the server according to the source address and the target address corresponding to the data packet to be transmitted, which can improve the efficiency of searching for the transmission path and thus improve the transmission performance.
[0022] In one embodiment, the method further comprises:
[0023] In the case that the database of the server contains the transmission path corresponding to the data packet to be transmitted, the data packet to be transmitted is transmitted based on the transmission path.
[0024] In the above embodiment, when the transmission path corresponding to the data packet to be transmitted is stored in the database of the server, the data packet to be transmitted is directly transmitted according to the transmission path, which can improve the efficiency of transmitting the data packet to be transmitted, thereby improving the transmission performance.
[0025] In one of the embodiments, a data plane development kit is also built in the server, and before the virtual switch receives the data packet to be transmitted, the method further includes:
[0026] The data plane development kit receives a data packet to be transmitted, and determines whether a transmission path corresponding to the data packet to be transmitted is included in a data plane development kit library;
[0027] If not, the data packet to be transmitted is transmitted to the target virtual switch;
[0028] If included, the data packet to be transmitted is transmitted based on the transmission path.
[0029] In the above embodiment, before the data packet to be transmitted is transmitted to the target virtual switch, the created DPDK is first used to receive the data packet to be transmitted, and after determining that the DPDK library contains the transmission path corresponding to the data packet to be transmitted, the data packet to be transmitted is directly transmitted according to the transmission path, and there is no need to transmit the data packet to be transmitted to the target virtual switch, which can improve the transmission efficiency and thus improve the transmission performance.
[0030] In one embodiment, the method further comprises:
[0031] The target virtual switch transmits the determined transmission path to the data plane development kit, and the data plane development kit stores the transmission path in the data plane development kit library.
[0032] In the above embodiment, after the target virtual switch determines the transmission path, the target virtual switch transmits the transmission path to DPDK, and DPDK stores the received transmission path and the corresponding source address and destination address in the DPDK library. In this way, the next time DPDK receives a data packet with the same source address and destination address, it directly searches the DPDK library for the corresponding transmission path for transmission, which can improve transmission efficiency.
[0033] In a second aspect, an embodiment of the present application provides a data transmission device, which is applied to a server, and multiple virtual switches are created in the server. The device includes:
[0034] A receiving module, used for receiving a data packet to be transmitted, and determining whether a transmission path corresponding to the data packet to be transmitted is contained in a database of the server;
[0035] The transmission module is used to determine the transmission path according to the data packet to be transmitted and the routing information of other virtual switches in multiple virtual switches when the server database does not contain the transmission path corresponding to the data packet to be transmitted, and transmit the data packet to be transmitted based on the transmission path.
[0036] In a third aspect, an embodiment of the present application provides a server, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method provided in the first aspect are implemented.
[0037] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the method provided in the first aspect when the computer program is executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A schematic diagram of an application environment of a data transmission method in an embodiment;
[0039] Figure 2 A schematic diagram of a step flow chart of a data transmission method in an embodiment;
[0040] Figure 3 A schematic diagram of a step flow chart of a data transmission method in another embodiment;
[0041] Figure 4 A schematic diagram of a step flow chart of a data transmission method in another embodiment;
[0042] Figure 5 A schematic diagram of a step flow chart of a data transmission method in another embodiment;
[0043] Figure 6 A schematic diagram of a step flow chart of a data transmission method in another embodiment;
[0044] Figure 7 A schematic diagram of a structure in which multiple virtual switches are connected in a server in one embodiment;
[0045] Figure 8 FIG. 4 is a schematic diagram of the structure of a data transmission device in one embodiment. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0047] First of all, before specifically introducing the technical solution of the present application, the technical background or technical evolution context on which the present application is based is introduced. With the development of Internet technology, in order to meet the communication needs of medium or large networks, the OSPF (Open Shortest Path First) protocol is usually used in the network. After OSPF is configured, most paths will be calculated by the protocol itself, without the need for manual configuration. Even if the network topology changes, the protocol can calculate it by itself.
[0048] In conventional technology, in a medium or large network, multiple groups of servers, switches, routers and other physical devices are set up to implement the OSPF protocol and establish communication in the medium or large network. However, the existing medium or large network uses multiple physical devices, which may result in poor transmission performance. In view of this, the present application provides a data transmission method capable of improving transmission performance.
[0049] The following is an introduction to the technical solutions involved in this application in combination with the scenarios to which this application is applied.
[0050] The data transmission method provided by the present application can be applied to a server in which a plurality of virtual switches are pre-compiled and installed. The internal structure of the server can be as follows: Figure 1 As shown, the server includes a processor, a memory, and a communication interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the server is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a data transmission method is implemented.
[0051] In one embodiment, Figure 2 As shown, a data transmission method is provided. This embodiment uses the method applied to a server as an example for illustration. The method includes the following steps:
[0052] Step 200: A target virtual switch among multiple virtual switches receives a data packet to be transmitted, and determines whether a database of a server contains a transmission path corresponding to the data packet to be transmitted.
[0053] The target virtual switch is any one of the multiple virtual switches. The transmission path corresponding to the data packet to be transmitted refers to each node through which the data packet to be transmitted passes during transmission.
[0054] The data packet to be transmitted includes the source address (the source of the data) and the target address (the destination to which the data needs to be sent) corresponding to the data. If multiple target virtual switches in the server have transmitted data with the same source address and target address as the data packet to be transmitted, the transmission path corresponding to the data packet will be stored in the database in the server. After receiving the data packet to be transmitted from the network card, the target virtual switch searches the server's database to determine whether the transmission path corresponding to the data packet to be transmitted is stored in the server's database.
[0055] Step 210: When the server database does not contain the transmission path corresponding to the data packet to be transmitted, determine the transmission path according to the data packet to be transmitted and the routing information of other virtual switches in the multiple virtual switches, and transmit the data packet to be transmitted based on the transmission path.
[0056] If the target virtual switch determines that the server's database does not contain the transmission path corresponding to the data packet to be transmitted by searching in the server's database, that is, the server receives the data packet to be transmitted for the first time. At this time, the target virtual switch determines the transmission path corresponding to the data packet to be transmitted based on the data packet to be transmitted and the routing information of other virtual switches in the multiple virtual switches. The routing information includes: the regional address, routing address, interface address, neighbor address and port number synchronization status of each virtual switch. This embodiment does not limit the specific content of the routing information, as long as its function can be achieved.
[0057] After determining the transmission path corresponding to the data packet to be transmitted, the target virtual switch transmits the data packet to be transmitted according to the transmission path. In other words, the target virtual switch transmits the data packet to be transmitted to the next node of the target virtual switch according to the address of the next node of the target virtual switch through which the data packet to be transmitted passes in the transmission path.
[0058] In an optional embodiment, the target virtual switch calculates the transmission path corresponding to the data packet to be transmitted based on the preset OSPF protocol and according to the routing information of other virtual switches in the multiple virtual switches.
[0059] In an optional embodiment, when the target virtual switch transmits the data packet to be transmitted to the next node, it forwards it through a forwarding plane (Open Flow).
[0060] The data transmission method provided in the embodiment of the present application is applied to a server, in which multiple virtual switches are created. The method includes a target virtual switch in the multiple virtual switches receiving a data packet to be transmitted, and determining whether the server's database contains a transmission path corresponding to the data packet to be transmitted; in the case where the server's database does not contain the transmission path corresponding to the data packet to be transmitted, the transmission path is determined according to the data packet to be transmitted and the routing information of other virtual switches in the multiple virtual switches, and the data packet to be transmitted is transmitted based on the transmission path. In this embodiment, when transmitting a data packet, multiple groups of physical devices in the prior art are replaced by multiple virtual switches created in a server. After the target switch in the multiple virtual switches receives the data packet to be transmitted, and the server's database does not include the transmission data of the data packet to be transmitted, the target virtual switch determines the transmission path corresponding to the data packet to be transmitted according to the routing information of the data packet to be transmitted and other virtual switches in the multiple virtual switches, so as to complete the transmission of the data packet to be transmitted based on the transmission path. In this way, the transmission of the data packet to be transmitted is realized by multiple virtual switches in the server. Compared with the use of physical devices in the prior art, there is no need to set up multiple groups of servers or switches, which can reduce costs; there will be no compatibility issues between multiple virtual switches; and the connection between multiple virtual switches does not need to pass through physical cables, which can avoid interference caused by physical cable transmission, thereby improving transmission performance.
[0061] In addition, multiple virtual switches are created on one server. When migrating, the data in the server is directly copied to complete the migration. There is no need to relocate a large number of physical devices, which makes migration very convenient.
[0062] See also Figure 3 In one embodiment, a method for determining a transmission path according to a data packet to be transmitted and routing information of other virtual switches in a plurality of virtual switches is provided, and the steps of the method include:
[0063] Step 300: Determine link information according to routing information of other virtual switches in the plurality of virtual switches.
[0064] Multiple virtual switches in the server can communicate with each other. The target virtual switch can obtain the routing information stored in other virtual switches adjacent to it; other virtual switches adjacent to the target virtual switch can obtain the routing information of the virtual switches adjacent to it, so that the target virtual switch can obtain the routing information of all virtual switches in the server. Each virtual switch can obtain the routing information of other virtual switches in multiple virtual switches in real time or according to a preset period.
[0065] When the server's database does not contain the transmission path corresponding to the data packet to be transmitted, the target virtual switch will obtain the link information based on the routing information of all other virtual switches in the multiple virtual switches. The link information is used to characterize the routing status in each virtual switch, for example, which two or more virtual switches are connected in sequence, which virtual switch is connected to the corresponding host, etc. The link information includes the process address, area address, interface address, data type, link state address, announcement routing address, length, sequence number and metric value, etc. This embodiment does not limit the specific content of the link information, as long as its function can be achieved.
[0066] Step 310: Determine a transmission path according to the link information and the data packet to be transmitted.
[0067] After obtaining the link information, the target virtual switch can determine the transmission path corresponding to the data packet to be transmitted according to the link information and the data packet to be transmitted. The data packet to be transmitted includes the source address and the destination address corresponding to the data packet to be transmitted. The target virtual switch can select a path from the source address to the destination address in the link information to determine the transmission path corresponding to the data packet to be transmitted.
[0068] In this embodiment, when the server database does not contain the transmission path corresponding to the data packet to be transmitted, the target virtual switch determines the link information based on the routing information obtained from the virtual switch adjacent to it, and determines the transmission path corresponding to the data packet to be transmitted based on the link information. This method of determining the transmission path is simple and easy to implement.
[0069] See also Figure 4 In one embodiment, a method for determining a transmission path according to link information and a data packet to be transmitted is provided, and the steps of the method include:
[0070] Step 400: extract the source address and the destination address from the data packet to be transmitted.
[0071] The data packet to be transmitted includes a source address and a destination address corresponding to the data packet to be transmitted. After obtaining the data packet to be transmitted, the target virtual switch can extract the source address and the destination address from the data packet to be transmitted.
[0072] In an optional embodiment, the target virtual switch parses the data packet to be transmitted according to the protocol corresponding to the working layer (for example, the transport layer and the network layer) where the data packet to be transmitted is located to obtain the source address and the destination address corresponding to the data packet to be transmitted.
[0073] Step 410: Based on the Dijkstra algorithm and the link information, determine the transmission path from the source address to the target address.
[0074] The Dijkstra algorithm is an algorithm for determining paths in the OSPF protocol. After obtaining link information and the source and destination addresses corresponding to the data packet to be transmitted, the target virtual switch calculates the result of reaching each node (virtual switch or external communication device) during the transmission of the data packet to be transmitted based on the Dijkstra algorithm, and determines the transmission path of the data packet to be transmitted from the source address to the destination address based on the calculation result.
[0075] In this embodiment, the method of determining the transmission path of the data packet to be transmitted from the source address to the destination address based on the Dijkstra algorithm and link information can quickly and accurately select the optimal path corresponding to the data packet to be transmitted from the link information, thereby improving the transmission performance.
[0076] In one embodiment, an implementation method of determining whether a database of a server contains a transmission path corresponding to a data packet to be transmitted includes the following steps:
[0077] Based on the source address and the destination address corresponding to the data packet to be transmitted, a search is performed in the database of the server to determine whether the database of the server contains a transmission path from the source address to the destination address.
[0078] The database of the server stores multiple transmission paths when using the server to transmit data packets, that is, the database of the server stores the correspondence between different source addresses and target addresses and transmission paths. When the target virtual switch searches for the transmission path corresponding to the data packet to be transmitted in the database of the server, it first extracts the source address and target address corresponding to the data packet to be transmitted from the data packet to be transmitted, and searches the database of the server according to the extracted source address and target address to determine whether the database of the server contains the transmission path corresponding to the data packet to be transmitted.
[0079] In an optional embodiment, the target virtual switch first searches for the source address and the target address in the database of the server, and then determines the transmission path corresponding to the source address and the target address according to the corresponding relationship, that is, the transmission path corresponding to the data packet to be transmitted.
[0080] In this embodiment, the target virtual switch directly searches for the transmission path in the database of the server according to the source address and the target address corresponding to the data packet to be transmitted, which can improve the efficiency of searching for the transmission path and thus improve the transmission performance.
[0081] In one embodiment, the steps of the data transmission method further include:
[0082] If the database of the server contains a transmission path corresponding to the data packet to be transmitted, the data packet to be transmitted is transmitted based on the transmission path.
[0083] If the target virtual switch searches the server database and determines that the server database contains the transmission path corresponding to the data packet to be transmitted, the target virtual switch directly transmits the data packet to be transmitted according to the transmission path found. In other words, the target virtual switch transmits the data packet to be transmitted to the next node of the target virtual switch according to the address of the next node of the target virtual switch in the transmission path found.
[0084] In this embodiment, when the transmission path corresponding to the data packet to be transmitted is stored in the database of the server, the data packet to be transmitted is directly transmitted according to the transmission path, which can improve the efficiency of transmitting the data packet to be transmitted, thereby improving the transmission performance.
[0085] In one embodiment, a data plane development kit (DPDK) is also built in the server. In other words, after the system (usually a Linux system) is installed on the server, a network card that supports DPDK is used, and the installed system is compiled and installed through meson&ninja to build the DPDK environment, load the UIO driver required for the DPDK environment, bind the network card to the UIO driver, and configure large page memory to build DPDK in the server. DPDK is a collection of function libraries and drivers for quickly processing data packets. DPDK creates function libraries for different working environments by creating EAL (EnvironmentAbstraction Layer). The function library created by DPDK hides the details of the underlying environment and can be applied to any processor.
[0086] See also Figure 5 When the server includes DPDK, before the virtual switch receives the data packet to be transmitted, the method further includes:
[0087] Step 500: The data plane development kit receives a data packet to be transmitted, and determines whether a data plane development kit library contains a transmission path corresponding to the data packet to be transmitted.
[0088] The data packet to be transmitted through the network card will first be transmitted to DPDK, which includes the DPDK library. After DPDK receives the data packet to be transmitted, it will first search in the DPDK library to determine whether the data DPDK library contains the transmission path corresponding to the data packet to be transmitted.
[0089] In an optional embodiment, the DPDK library stores the correspondence between different source addresses and target addresses and transmission paths. After receiving the data packet to be transmitted, the DPDK extracts the source address and target address contained in the data packet to be transmitted; and searches the DPDK library according to the extracted source address and target address to determine whether the DPDK library contains the transmission path corresponding to the data packet to be transmitted.
[0090] Step 510: If not included, transmit the data packet to be transmitted to the target virtual switch.
[0091] If DPDK determines, by searching in the DPDK library, that the DPDK library does not contain the transmission path corresponding to the data packet to be transmitted, DPDK transmits the transmission data packet to the target virtual switch, so that the target virtual switch determines the transmission path corresponding to the data packet to be transmitted, and transmits the data packet to be transmitted according to the determined transmission path.
[0092] Step 520: If yes, transmit the data packet to be transmitted based on the transmission path.
[0093] If the DPDK determines that the DPDK library contains the transmission path corresponding to the data packet to be transmitted by searching in the DPDK library, the DPDK directly transmits the data packet to be transmitted according to the found transmission path.
[0094] In this embodiment, before the data packet to be transmitted is transmitted to the target virtual switch, the created DPDK is first used to receive the data packet to be transmitted, and after determining that the DPDK library contains the transmission path corresponding to the data packet to be transmitted, the data packet to be transmitted is directly transmitted according to the transmission path. There is no need to transmit the data packet to be transmitted to the target virtual switch, which can improve the transmission efficiency and thus improve the transmission performance.
[0095] In one embodiment, the steps of the data transmission method further include:
[0096] The target virtual switch transmits the determined transmission path to the data plane development kit, and the data plane development kit stores the received transmission path in the data plane development kit library.
[0097] When a DPDK is created in a server and the DPDK library does not contain a transmission path corresponding to a data packet to be transmitted, but a database of the server contains a transmission path corresponding to the data packet to be transmitted or a target virtual switch determines a transmission path based on the data packet to be transmitted and routing information of other virtual switches in multiple virtual switches, the target virtual switch transmits the transmission path to the DPDK. After receiving the transmission path, the DPDK stores the transmission path and the corresponding source address and destination address in the DPDK library.
[0098] In this embodiment, after the target virtual switch determines the transmission path, the target virtual switch will transmit the transmission path to DPDK. DPDK will store the received transmission path and the corresponding source address and destination address in the DPDK library. In this way, the next time DPDK receives a data packet with the same source address and destination address, it will directly search the DPDK library for the corresponding transmission path for transmission, which can improve transmission efficiency.
[0099] See also Figure 6 An embodiment of the present application provides a data transmission method, the method comprising the steps of:
[0100] Step 600: Install the system on the server, use a network card that supports DPDK, and compile and install the installed system through meson&ninja to build a DPDK environment;
[0101] Step 610: Load the UIO driver required by the DPDK environment, bind the network card to the UIO driver, configure large page memory, and compile and install multiple virtual switches on the installed system;
[0102] Step 620: The DPDK receives the data packet to be transmitted, and determines whether the DPDK library contains a transmission path corresponding to the data packet to be transmitted;
[0103] Step 630: If the DPDK library contains a transmission path corresponding to the data packet to be transmitted, the data packet to be transmitted is transmitted based on the transmission path;
[0104] Step 640: If the DPDK library does not contain a transmission path corresponding to the data packet to be transmitted, the data packet to be transmitted is transmitted to the target virtual switch;
[0105] Step 650: The target virtual switch receives the data packet to be transmitted, and searches the database of the server based on the source address and the destination address corresponding to the data packet to be transmitted to determine whether the database of the server contains the transmission path corresponding to the data packet to be transmitted;
[0106] Step 660: If the transmission path corresponding to the data packet to be transmitted is included in the database of the server, the data packet to be transmitted is transmitted based on the transmission path;
[0107] Step 670: If the database of the server does not contain the transmission path corresponding to the data packet to be transmitted, determine the link information according to the routing information of other virtual switches in the multiple virtual switches;
[0108] Step 680: extract the source address and the destination address from the data packet to be transmitted;
[0109] Step 690: Based on the Dijkstra algorithm and the link information, determine the transmission path from the source address to the target address.
[0110] Step 691: transmit the transmission path to DPDK, and DPDK stores the received transmission path in the DPDK library.
[0111] In one embodiment, Figure 7 As shown in the figure, it is assumed that four virtual switches are created in the server, namely R1, R2, R3 and R4, and the external hosts connected to the server include host 1 connected to R1, host 2 connected to R3, and host 3 connected to R4. R4 can receive the routing information of R1, R1 can receive the routing information of R2, R4 and R3, R3 can receive the routing information of R1; R2 can receive the routing information of R1.
[0112] If R4 is the target virtual switch, R4 receives the data packet to be transmitted from host 3, the source address of the data packet to be transmitted is the address of host 3, and the destination address is the address of host 2. After receiving the data packet to be transmitted, R4 determines whether the server's database contains the transmission path corresponding to the data packet to be transmitted; if it does, the transmission path is from host 3 to R4, from R4 to R1, from R1 to R3, and from R3 to host 2, then R4 transmits the data packet to be transmitted to R1; if it does not, R4 will obtain the routing information of R1, determine the link information based on the routing information, and determine the transmission path based on the link information.
[0113] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed 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 part of the steps or stages in other steps.
[0114] Based on the same inventive concept, the embodiment of the present application also provides a data transmission device for implementing the data transmission method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more data transmission device embodiments provided below can refer to the limitations on the data transmission method above, and will not be repeated here.
[0115] In one embodiment, Figure 8 As shown, a data transmission device 10 is provided, comprising: a receiving module 11 and a transmission module 12, wherein:
[0116] The receiving module 11 is used to receive a data packet to be transmitted, and determine whether the database of the server contains a transmission path corresponding to the data packet to be transmitted.
[0117] The transmission module 12 is used to determine the transmission path according to the data packet to be transmitted and the routing information of other virtual switches in the multiple virtual switches when the server database does not contain the transmission path corresponding to the data packet to be transmitted, and transmit the data packet to be transmitted based on the transmission path.
[0118] In one embodiment, the transmission module 12 includes a first determining unit and a second determining unit. The first determining unit is used to determine link information according to routing information of other virtual switches in the plurality of virtual switches; and the second determining unit is used to determine a transmission path according to the link information and the data packet to be transmitted.
[0119] In one embodiment, the second determining unit is specifically configured to extract a source address and a destination address from the data packet to be transmitted; and determine a transmission path from the source address to the destination address based on the Dijkstra algorithm and the link information.
[0120] In one embodiment, the receiving module 11 is specifically used to search in the database of the server based on the source address and the destination address corresponding to the data packet to be transmitted, so as to determine whether the database of the server contains a transmission path from the source address to the destination address.
[0121] In one embodiment, the transmission module 12 is further configured to transmit the transmission data packet based on the transmission path when the transmission path corresponding to the data packet to be transmitted is included in the database of the server.
[0122] In one embodiment, the data transmission device 10 also includes a determination module, which is used to receive a data packet to be transmitted and determine whether the data plane development kit library contains a transmission path corresponding to the data packet to be transmitted; if not, the data packet to be transmitted is transmitted to the target virtual switch; if contained, the data packet to be transmitted is transmitted based on the transmission path.
[0123] In one embodiment, the transmission module 12 is further used to transmit the determined transmission path to the data plane development kit, and the data plane development kit stores the transmission path in the data plane development kit library.
[0124] Each module in the above data transmission device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0125] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 1 shown.
[0126] 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 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 those shown in the figure, or combine certain components, or have a different arrangement of components.
[0127] In one embodiment, 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:
[0128] A target virtual switch among the multiple virtual switches receives a data packet to be transmitted, and determines whether a database of the server contains a transmission path corresponding to the data packet to be transmitted;
[0129] When the server database does not contain the transmission path corresponding to the data packet to be transmitted, the transmission path is determined according to the data packet to be transmitted and the routing information of other virtual switches in the multiple virtual switches, and the data packet to be transmitted is transmitted based on the transmission path.
[0130] In one embodiment, when the processor executes the computer program, the following steps are also implemented: determining link information according to routing information of other virtual switches in the multiple virtual switches; and determining a transmission path according to the link information and the data packet to be transmitted.
[0131] In one embodiment, when the processor executes the computer program, the following steps are further implemented: extracting the source address and the destination address from the data packet to be transmitted; and determining the transmission path from the source address to the destination address based on the Dijkstra algorithm and the link information.
[0132] In one embodiment, when the processor executes the computer program, the following steps are also implemented: based on the source address and the destination address corresponding to the data packet to be transmitted, searching in the database of the server to determine whether the database of the server contains a transmission path from the source address to the destination address.
[0133] In one embodiment, when the processor executes the computer program, the following steps are further implemented: when the database of the server contains the transmission path corresponding to the data packet to be transmitted, the data packet to be transmitted is transmitted based on the transmission path.
[0134] In one embodiment, when the processor executes the computer program, the following steps are also implemented: the data plane development kit receives a data packet to be transmitted, and determines whether the data plane development kit library contains a transmission path corresponding to the data packet to be transmitted; if not, the data packet to be transmitted is transmitted to the target virtual switch; if contained, the data packet to be transmitted is transmitted based on the transmission path.
[0135] In one embodiment, when the processor executes the computer program, the following steps are further implemented: the target virtual switch transmits the determined transmission path to the data plane development kit, and the data plane development kit stores the transmission path in the data plane development kit library.
[0136] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0137] A target virtual switch among the multiple virtual switches receives a data packet to be transmitted, and determines whether a database of the server contains a transmission path corresponding to the data packet to be transmitted;
[0138] When the server database does not contain the transmission path corresponding to the data packet to be transmitted, the transmission path is determined according to the data packet to be transmitted and the routing information of other virtual switches in the multiple virtual switches, and the data packet to be transmitted is transmitted based on the transmission path.
[0139] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining link information based on routing information of other virtual switches in the multiple virtual switches; and determining a transmission path based on the link information and the data packet to be transmitted.
[0140] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: extracting the source address and the destination address from the data packet to be transmitted; and determining the transmission path from the source address to the destination address based on the Dijkstra algorithm and the link information.
[0141] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on the source address and the destination address corresponding to the data packet to be transmitted, searching in the database of the server to determine whether the database of the server contains a transmission path from the source address to the destination address.
[0142] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: when the database of the server contains the transmission path corresponding to the data packet to be transmitted, the data packet to be transmitted is transmitted based on the transmission path.
[0143] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the data plane development kit receives a data packet to be transmitted, and determines whether the data plane development kit library contains a transmission path corresponding to the data packet to be transmitted; if not, the data packet to be transmitted is transmitted to the target virtual switch; if contained, the data packet to be transmitted is transmitted based on the transmission path.
[0144] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: the target virtual switch transmits the determined transmission path to the data plane development kit, and the data plane development kit stores the transmission path in the data plane development kit library.
[0145] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0146] A target virtual switch among the multiple virtual switches receives a data packet to be transmitted, and determines whether a database of the server contains a transmission path corresponding to the data packet to be transmitted;
[0147] When the server database does not contain the transmission path corresponding to the data packet to be transmitted, the transmission path is determined according to the data packet to be transmitted and the routing information of other virtual switches in the multiple virtual switches, and the data packet to be transmitted is transmitted based on the transmission path.
[0148] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining link information based on routing information of other virtual switches in the multiple virtual switches; and determining a transmission path based on the link information and the data packet to be transmitted.
[0149] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: extracting the source address and the destination address from the data packet to be transmitted; and determining the transmission path from the source address to the destination address based on the Dijkstra algorithm and the link information.
[0150] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on the source address and the destination address corresponding to the data packet to be transmitted, searching in the database of the server to determine whether the database of the server contains a transmission path from the source address to the destination address.
[0151] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: when the database of the server contains the transmission path corresponding to the data packet to be transmitted, the data packet to be transmitted is transmitted based on the transmission path.
[0152] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the data plane development kit receives a data packet to be transmitted, and determines whether the data plane development kit library contains a transmission path corresponding to the data packet to be transmitted; if not, the data packet to be transmitted is transmitted to the target virtual switch; if contained, the data packet to be transmitted is transmitted based on the transmission path.
[0153] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: the target virtual switch transmits the determined transmission path to the data plane development kit, and the data plane development kit stores the transmission path in the data plane development kit library.
[0154] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and 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 embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present 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), magnetoresistive 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0155] The technical features of the above embodiments may be combined arbitrarily. 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.
[0156] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A data transmission method, characterized in that: Applied to a server, wherein a plurality of virtual switches are created in the server, and a data plane development kit is also constructed in the server, the method comprising: The data plane development kit receives a data packet to be transmitted, and determines whether a data plane development kit library contains a transmission path corresponding to the data packet to be transmitted; If included, transmitting the data packet to be transmitted based on the transmission path; If not, transmitting the data packet to be transmitted to a target virtual switch among the multiple virtual switches; The target virtual switch receives the data packet to be transmitted, and determines whether the database of the server contains a transmission path corresponding to the data packet to be transmitted; In the case that the database of the server does not contain the transmission path corresponding to the data packet to be transmitted, the target virtual switch determines the transmission path according to the data packet to be transmitted and the routing information of other virtual switches among the multiple virtual switches, and transmits the data packet to be transmitted based on the transmission path; The target virtual switch transmits the determined transmission path to the data plane development kit, and the data plane development kit stores the transmission path in the data plane development kit library.
2. The method according to claim 1, characterized in that The determining the transmission path according to the data packet to be transmitted and the routing information of other virtual switches in the multiple virtual switches includes: Determining link information according to routing information of other virtual switches in the multiple virtual switches; The transmission path is determined according to the link information and the data packet to be transmitted.
3. The method according to claim 2, characterized in that The determining the transmission path according to the link information and the data packet to be transmitted includes: Extracting a source address and a destination address from the data packet to be transmitted; Based on the Dijkstra algorithm and according to the link information, the transmission path from the source address to the target address is determined.
4. The method according to any one of claims 1 to 3, characterized in that: The determining whether the database of the server contains the transmission path corresponding to the data packet to be transmitted includes: Based on the source address and the destination address corresponding to the data packet to be transmitted, a search is performed in the database of the server to determine whether the database of the server contains a transmission path from the source address to the destination address.
5. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: In a case where the database of the server contains the transmission path corresponding to the data packet to be transmitted, the data packet to be transmitted is transmitted based on the transmission path.
6. A data transmission device, characterized in that: Applied to a server, wherein a plurality of virtual switches are created in the server, and a data plane development kit is also constructed in the server, the device comprising: A determination module, configured to receive a data packet to be transmitted, and determine whether a data plane development kit library contains a transmission path corresponding to the data packet to be transmitted; if so, transmit the data packet to be transmitted based on the transmission path; if not, transmit the data packet to be transmitted to a target virtual switch among the multiple virtual switches; A receiving module, used for receiving the data packet to be transmitted, and determining whether the database of the server contains a transmission path corresponding to the data packet to be transmitted; a transmission module, configured to determine the transmission path according to the data packet to be transmitted and routing information of other virtual switches among the multiple virtual switches, and transmit the data packet to be transmitted based on the transmission path when the transmission path corresponding to the data packet to be transmitted is not included in the database of the server; The transmission module is further used to transmit the determined transmission path to the data plane development kit, and the data plane development kit stores the transmission path in the data plane development kit library.
7. A server, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: 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.
Citation Information
Patent Citations
Forwarding method of virtual machine data, SDN controller and SDN system
CN106470155A
Method and equipment for forwarding a data packet by using a virtual switch
CN109803016A
Message forwarding method, computer equipment and storage medium
CN115225708A