Data transmission method, apparatus, system, device, medium and product
By calculating the weight coefficients and hashing of the endpoints of the virtual extended LAN tunnel, the traffic data transmission path is dynamically adjusted, which solves the problem of unreasonable traffic data allocation in ECMP and improves data transmission efficiency and resource utilization.
Patent Information
- Application Number
- CN202511247807.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-03
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2045-09-03
AI Technical Summary
In cloud computing, when using ECMP for load balancing, unreasonable distribution of traffic data can lead to virtual network elements with different processing capabilities receiving the same traffic data, resulting in low data processing efficiency.
By calculating the number of virtual network cards bound to each virtual extended LAN tunnel endpoint, a weighting coefficient is determined. Based on the weighting coefficient, a target tunnel endpoint is selected from multiple tunnel endpoints to transmit traffic data. Combined with hash processing and random number generation, the transmission path of traffic data is dynamically adjusted.
This enabled the rational allocation of traffic data, improved data transmission efficiency and resource utilization, and ensured the high efficiency and accuracy of data processing.
Smart Images

Figure CN120729780B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of cloud computing, and in particular, to a data transmission method, device, system, equipment, medium and product. BACKGROUND
[0002] In the current field of cloud computing, the Equal-cost multi-path routing (ECMP) is commonly used to achieve load balancing. In the case of processing a large amount of data by a virtual network element, the virtual network element can be ensured to run efficiently and stably.
[0003] In the related art, in the process of using ECMP, the traffic data is evenly distributed to each virtual network element. In this case, the virtual network elements with different processing capabilities receive the same traffic data, which leads to unreasonable allocation of traffic data. SUMMARY
[0004] The present disclosure is proposed in view of the above problems. The present disclosure provides a data transmission method, device, system, equipment, medium and product.
[0005] According to one aspect of the present disclosure, a data transmission method is provided, applied to a client, wherein the client comprises a first virtual extended local area network tunnel endpoint, and the method comprises:
[0006] obtaining a first number of virtual network cards bound to each second virtual extended local area network tunnel endpoint in a server;
[0007] calculating a weight coefficient from the first virtual extended local area network tunnel endpoint to each second virtual extended local area network tunnel endpoint based on the first number; wherein the weight coefficient is used to indicate a probability of selecting the second virtual extended local area network tunnel endpoint to transmit first traffic data;
[0008] determining a target tunnel endpoint in a plurality of second virtual extended local area network tunnel endpoints based on the weight coefficient, and sending the first traffic data to the target tunnel endpoint, so that the server transmits the first traffic data to a corresponding virtual network element through a virtual network card bound to the target tunnel endpoint, to process the first traffic data through the virtual network element.
[0009] In addition, the method for determining a target tunnel endpoint in a plurality of second virtual extended local area network tunnel endpoints based on the weight coefficient according to one aspect of the present disclosure comprises:
[0010] determining a value interval corresponding to a corresponding second virtual extended local area network tunnel endpoint based on the weight coefficient;
[0011] hash the first flow data, and determine a first random number according to a first hash processing result;
[0012] determine a second virtual extended local area network tunnel endpoint corresponding to a value interval in which the first random number is located in the multiple value intervals, to obtain the target tunnel endpoint.
[0013] In addition, the method for determining the value interval corresponding to the corresponding second virtual extended local area network tunnel endpoint according to the weight coefficient comprises:
[0014] determining that the weight coefficient of the second virtual extended local area network tunnel endpoint to be currently calculated is a first weight coefficient;
[0015] determining an accumulated value of the weight coefficients smaller than the first weight coefficient in the weight coefficients corresponding to all the second virtual extended local area network tunnel endpoints, to obtain a first accumulated value;
[0016] determining a second accumulated value of the weight coefficients corresponding to all the second virtual extended local area network tunnel endpoints;
[0017] performing operation on the first weight coefficient, the first accumulated value and the second accumulated value, to obtain the value interval of the second virtual extended local area network tunnel endpoint to be currently calculated.
[0018] In addition, the method for performing operation on the first weight coefficient, the first accumulated value and the second accumulated value to obtain the value interval of the second virtual extended local area network tunnel endpoint to be currently calculated according to one aspect of the present disclosure comprises:
[0019] performing summation processing on the first weight coefficient and the first accumulated value, to obtain a second weight coefficient;
[0020] determining a ratio of the first accumulated value and the second accumulated value as a first boundary point;
[0021] determining a ratio of the second weight coefficient and the second accumulated value as a second boundary point; wherein the second boundary point is greater than the first boundary point;
[0022] determining the value interval of the second virtual extended local area network tunnel endpoint to be currently calculated based on the first boundary point and the second boundary point.
[0023] In addition, the method for hashing the first flow data and determining a first random number according to a first hash processing result according to one aspect of the present disclosure comprises:
[0024] determine a flow field of the first flow data; wherein the flow field comprises at least one of the following: a source address, a target address, a source port, a target port, a protocol type;
[0025] hash the flow field to obtain the first hash processing result;
[0026] map the first hash processing result in a specified interval to obtain the first random number; wherein the specified interval is a value range greater than or equal to a first value and less than a second value, and the first value is less than the second value.
[0027] In addition, according to an aspect of the present disclosure, the method further comprises:
[0028] determine a second number of virtual network cards bound by all the second virtual extended local area network tunnel endpoints;
[0029] calculate a ratio of the first number and the second number;
[0030] calculate a product of the ratio and a matching coefficient corresponding to each of the second virtual extended local area network tunnel endpoints to obtain a weight coefficient of each of the second virtual extended local area network tunnel endpoints.
[0031] In addition, according to an aspect of the present disclosure, after determining a target tunnel endpoint among the plurality of second virtual extended local area network tunnel endpoints based on the weight coefficient, the method further comprises:
[0032] generate a first routing table based on an identifier of each of the second virtual extended local area network tunnel endpoints, the weight coefficient of each of the second virtual extended local area network tunnel endpoints, a virtual network card bound by each of the second virtual extended local area network tunnel endpoints, and the target tunnel endpoint;
[0033] establish an association relationship between the flow field of the first flow data and the first routing table; wherein the flow field comprises at least one of the following: a source address, a target address, a source port, a target port, a protocol type;
[0034] determine a target tunnel endpoint for transmitting second flow data based on the first routing table and the association relationship; wherein the second flow data is flow data after the first flow data.
[0035] In addition, according to an aspect of the present disclosure, the method further comprises:
[0036] determining a flow field of the second flow data;
[0037] hashing the flow field of the first flow data to obtain a first hash processing result;
[0038] hashing the flow field of the second flow data to obtain a second hash processing result;
[0039] in a case where the first hash processing result and the second hash processing result are the same, determining that a target tunnel endpoint in the first routing table is a target tunnel endpoint for transmitting the second flow data.
[0040] In addition, according to an aspect of the present disclosure, after hashing the flow field of the second flow data to obtain a second hash processing result, the method further comprises:
[0041] in a case where the first hash processing result and the second hash processing result are different, determining a value interval corresponding to a second virtual extended local area network tunnel endpoint based on the weight coefficient;
[0042] determining a second random number according to the second hash processing result;
[0043] determining a second virtual extended local area network tunnel endpoint corresponding to a value interval in which the second random number is located in the plurality of value intervals, to obtain a target tunnel endpoint for transmitting the second flow data.
[0044] In addition, according to an aspect of the present disclosure, after determining the target tunnel endpoint for transmitting the second flow data based on the first routing table and the association relationship, the method further comprises:
[0045] in a case where a virtual network card bound to the second virtual extended local area network tunnel endpoint changes, calculating a changed weight coefficient of the second virtual extended local area network tunnel endpoint based on a number of changed bound virtual network cards;
[0046] updating the first routing table based on the matching item to obtain a second routing table; wherein the matching item comprises at least one of the following: the changed weight coefficient and the changed bound virtual network card;
[0047] determining a changed target tunnel endpoint based on the flow field of the first flow data and the second routing table; wherein the changed target tunnel endpoint is a second virtual extended local area network tunnel endpoint for transmitting the first flow data determined based on the changed weight coefficient;
[0048] After receiving the second traffic data, a target tunnel endpoint for transmitting the second traffic data is determined based on a traffic field of the first traffic data, the second routing table and the changed target tunnel endpoint.
[0049] According to an aspect of the present disclosure, a data transmission method is provided, which is applied to a server, the server comprising a plurality of second virtual extended local area network tunnel endpoints and a plurality of virtual network elements, each of the second virtual extended local area network tunnel endpoints and each of the virtual network elements being connected through a virtual network card, and the method comprising:
[0050] receiving first traffic data sent by a client to a target tunnel endpoint, wherein the target tunnel endpoint is determined by the client based on weight coefficients of the second virtual extended local area network tunnel endpoints, the weight coefficients being probabilities for transmitting the first traffic data from a first virtual extended local area network tunnel endpoint to each of the second virtual extended local area network tunnel endpoints, and the weight coefficients being determined based on a first number of virtual network cards bound to each of the second virtual extended local area network tunnel endpoints;
[0051] transmitting the first traffic data to a corresponding virtual network element based on a virtual network card bound to the target tunnel endpoint, so as to process the first traffic data through the virtual network element.
[0052] In addition, the transmitting the first traffic data to the corresponding virtual network element based on the virtual network card bound to the target tunnel endpoint according to an aspect of the present disclosure comprises:
[0053] when the target tunnel endpoint is bound to one virtual network card, transmitting the first traffic data to a first virtual network element, wherein a virtual network card bound to the first virtual network element is of the same type as a virtual network card bound to the target tunnel endpoint.
[0054] In addition, the transmitting the first traffic data to the corresponding virtual network element based on the virtual network card bound to the target tunnel endpoint according to an aspect of the present disclosure comprises:
[0055] when the target tunnel endpoint is bound to a plurality of virtual network cards, determining a target virtual network card from the plurality of virtual network cards bound to the target tunnel endpoint;
[0056] transmitting the first traffic data to a second virtual network element based on the target virtual network card, wherein a virtual network card bound to the second virtual network element is of the same type as the target virtual network card.
[0057] In addition, the determining the target virtual network card from the plurality of virtual network cards bound to the target tunnel endpoint according to an aspect of the present disclosure comprises:
[0058] determine a flow field of the first flow data; wherein the flow field comprises at least one of a source address, a target address, a source port, a target port, and a protocol type;
[0059] hash the flow field to obtain a third hash processing result;
[0060] perform a modulo operation on the third hash processing result and a number of virtual network cards bound to the target tunnel endpoint to obtain an operation result;
[0061] map the operation result to obtain the target virtual network card.
[0062] According to another aspect of the present disclosure, a data transmission system is provided, comprising: a client and a server; the client comprises a first virtual extended local area network tunnel endpoint, and the server comprises a plurality of second virtual extended local area network tunnel endpoints and a plurality of virtual network elements, each of the second virtual extended local area network tunnel endpoints and each of the virtual network elements being connected through a virtual network card;
[0063] The client is configured to obtain a first number of virtual network cards bound to each of the second virtual extended local area network tunnel endpoints in the server, and calculate a weight coefficient from the first virtual extended local area network tunnel endpoint to each of the second virtual extended local area network tunnel endpoints based on the first number; wherein the weight coefficient is used to indicate a probability of selecting the second virtual extended local area network tunnel endpoint to transmit first flow data; and determine a target tunnel endpoint in the plurality of second virtual extended local area network tunnel endpoints based on the weight coefficient, and send the first flow data to the target tunnel endpoint.
[0064] The server is configured to transmit the first flow data to a corresponding virtual network element based on a virtual network card bound to the target tunnel endpoint, and process the first flow data through the virtual network element.
[0065] According to another aspect of the present disclosure, a client is provided, comprising a first virtual extended local area network tunnel endpoint, comprising:
[0066] A network card obtaining unit is configured to obtain a first number of virtual network cards bound to each of second virtual extended local area network tunnel endpoints in a server;
[0067] A weight processing unit is configured to calculate a weight coefficient from the first virtual extended local area network tunnel endpoint to each of the second virtual extended local area network tunnel endpoints based on the first number; wherein the weight coefficient is used to indicate a probability of selecting the second virtual extended local area network tunnel endpoint to transmit first flow data.
[0068] The first data transmission unit is configured to determine a target tunnel endpoint from the second virtual extended local area network tunnel endpoints based on the weight coefficients, and send the first traffic data to the target tunnel endpoint, so that the server transmits the first traffic data to a corresponding virtual network element through a virtual network card bound to the target tunnel endpoint, and processes the first traffic data through the virtual network element.
[0069] According to another aspect of the present disclosure, a server is provided, which comprises a plurality of second virtual extended local area network tunnel endpoints and a plurality of virtual network elements, each of the second virtual extended local area network tunnel endpoints and each of the virtual network elements being connected through a virtual network card, and comprises:
[0070] The data receiving unit is configured to receive first traffic data sent by a client to a target tunnel endpoint, wherein the target tunnel endpoint is determined by the client based on weight coefficients of the second virtual extended local area network tunnel endpoints, the weight coefficients being probabilities of transmitting the first traffic data from a first virtual extended local area network tunnel endpoint to each of the second virtual extended local area network tunnel endpoints, and the weight coefficients being determined based on a first number of virtual network cards bound to each of the second virtual extended local area network tunnel endpoints.
[0071] The second data transmission unit is configured to transmit the first traffic data to a corresponding virtual network element based on a virtual network card bound to the target tunnel endpoint, so that the first traffic data is processed through the virtual network element.
[0072] According to still another aspect of the present disclosure, an electronic device is provided, which comprises a processor, a memory and a bus, the memory storing machine readable instructions executable by the processor, the processor and the memory being in communication through the bus when the electronic device is running, and the machine readable instructions being executed by the processor to perform the steps of the above data transmission method.
[0073] According to still another aspect of the present disclosure, a computer readable storage medium is provided, which stores a computer program, the computer program being executed by a processor to perform the steps of the above data transmission method.
[0074] According to still another aspect of the present disclosure, a computer program product is provided, which is stored in a storage medium, and the program product is executed by at least one processor to perform the steps of the above data transmission method.
[0075] As will be described in detail below, according to the data transmission method, device, system, equipment, medium and product of the embodiments of the present disclosure, the client obtains a first quantity of virtual network cards bound to each second virtual extended local area network tunnel endpoint in the server, and calculates a weight coefficient from the first virtual extended local area network tunnel endpoint to each second virtual extended local area network tunnel endpoint based on the first quantity; wherein the weight coefficient is used to indicate the probability of selecting the second virtual extended local area network tunnel endpoint to transmit the first traffic data; and based on the weight coefficient, a target tunnel endpoint is determined in the plurality of second virtual extended local area network tunnel endpoints, the first traffic data is sent to the target tunnel endpoint, the server transmits the first traffic data to the corresponding virtual network element based on the virtual network card bound to the target tunnel endpoint, and the first traffic data is processed through the virtual network element. Through the above processing mode, the weight coefficient is calculated based on the first quantity of virtual network cards bound to the second virtual extended local area network tunnel endpoint, so that the probability of transmitting traffic data can be dynamically adjusted according to the change of the virtual network card, the reasonable allocation of traffic data from the first virtual extended local area network tunnel endpoint to the second virtual extended local area network tunnel endpoint is realized, and through the processing mode of the server, the reasonable allocation of traffic data from the virtual extended local area network tunnel endpoint to the virtual network element is realized, and thus on the basis of reasonable data allocation, the data transmission efficiency is effectively improved.
[0076] It is to be understood that both the foregoing general description and the following detailed description are exemplary and intended to provide further explanation of the subject technology. BRIEF DESCRIPTION OF DRAWINGS
[0077] The foregoing and other objects, features and advantages of the present disclosure will become more apparent from the following detailed description, which proceeds with reference to the accompanying drawings. The drawings are provided to illustrate embodiments of the present disclosure and, together with the detailed description, serve to explain the present disclosure and do not constitute a limitation thereof. In the drawings, like reference numerals refer to like elements or steps throughout.
[0078] Figure 1 FIG. 1 is a flowchart illustrating a data transmission method according to an embodiment of the present disclosure.
[0079] Figure 2 FIG. 2 is a schematic diagram illustrating the transmission of traffic data from a client to a virtual network element according to an embodiment of the present disclosure.
[0080] Figure 3 FIG. 6 is a flowchart illustrating a second data transmission method according to an embodiment of the present disclosure.
[0081] Figure 4 FIG. 7 is an interaction diagram illustrating a data transmission process according to an embodiment of the present disclosure.
[0082] Figure 5is a flow chart illustrating a process of a routing table according to an embodiment of the present disclosure.
[0083] Figure 6 is a block diagram illustrating a client according to an embodiment of the present disclosure.
[0084] Figure 7 is a block diagram illustrating a server according to an embodiment of the present disclosure.
[0085] Figure 8 is a hardware block diagram of an electronic device according to an embodiment of the present disclosure.
[0086] Figure 9 is a schematic diagram of a computer program product according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0087] In order to make the objectives, technical solutions and advantages of the present disclosure more apparent, the following will describe the example embodiments according to the present disclosure in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, and are not all the embodiments of the present disclosure, and it should be understood that the present disclosure is not limited to the example embodiments described herein.
[0088] For the convenience of understanding the present embodiments, first, a data transmission method disclosed by the present embodiments will be described in detail, and the execution subject of the data transmission method provided by the present embodiments is generally an electronic device with certain computing capability, which for example includes a terminal device or a server or other processing device. In some possible implementation manners, the data transmission method can be realized by the processor calling the computer readable instructions stored in the memory.
[0089] Referring to Figure 1 is a flow chart of a data transmission method provided by the present embodiments, and the data transmission method can be applied to a client, and the client includes a first virtual extended local area network tunnel endpoint. Wherein, the method includes steps S101-S103, wherein:
[0090] Step S101: obtaining a first number of virtual network cards bound by each second virtual extended local area network tunnel endpoint in a server.
[0091] Referring to Figure 2 is a schematic diagram of traffic data from a client to a virtual network element, Figure 2The Group ENI (Group Elastic Network Interface) is used for ECMP (Equal-cost multi-path routing) in a cloud network. The Group ENI includes multiple subports. Each subport can be load balanced. A client can communicate with the Group ENI by accessing a network address of the Group ENI, so as to send traffic data to a virtual extended local area network tunnel endpoint corresponding to a subport of the Group ENI, complete an ECMP process of the traffic data to the virtual extended local area network tunnel endpoint, and ensure high efficiency and accuracy of a data transmission process.
[0092] Figure 2 The client includes a first virtual extended local area network tunnel endpoint, and the server includes multiple second virtual extended local area network tunnel endpoints and multiple virtual network elements. Each second virtual extended local area network tunnel endpoint and each virtual network element are connected through a subport. Each second virtual extended local area network tunnel endpoint corresponds to one or more subports. Each virtual network element corresponds to one or more subports. For example, the virtual network element 4 corresponds to two subports. The virtual network element 5 corresponds to one subport. The virtual network element 4 and the virtual network element 5 correspond to one second virtual extended local area network tunnel endpoint.
[0093] The first virtual extended local area network tunnel endpoint and the second virtual extended local area network tunnel endpoint are VXLAN tunnel endpoints VTEP (VXLAN Tunnel End Point), and the virtual extended local area network is VXLAN (Virtual eXtensible Local Area Network). The virtual network element can be a network function virtualization NFV (Network Functions Virtualization), a virtual load balancer vLB (virtual Load Balancer), a virtual NAT gateway vNAT (virtual NAT Gateway), or another network element. No more examples are given here.
[0094] Because the subport is bound to a virtual network element according to performance and capacity of a physical node where the virtual network element is located, a high-performance and large-capacity physical node is usually bound to more subports, and vice versa. Therefore, in the process of calculating the weight coefficient, the number of subports bound to the second virtual extended local area network tunnel endpoint, that is, the first number, needs to be considered.
[0095] Step S102: calculating a weight coefficient from the first virtual extended local area network tunnel endpoint to each of the second virtual extended local area network tunnel endpoints based on the first quantity; wherein the weight coefficient is used to indicate a probability of selecting the second virtual extended local area network tunnel endpoint to transmit the first traffic data.
[0096] The process of the weight coefficient will be exemplarily described later, and no more examples are given here.
[0097] In the embodiments of the present disclosure, the first traffic data to be transmitted can be acquired, and the weight coefficient can be calculated based on the first quantity of the virtual network cards bound by each of the second virtual extended local area network tunnel endpoints, so as to dynamically adjust the transmission path of the first traffic data according to the change of the virtual network cards, thereby improving the flexibility of the data transmission process.
[0098] Step S103: determining a target tunnel endpoint in the plurality of second virtual extended local area network tunnel endpoints based on the weight coefficient, and sending the first traffic data to the target tunnel endpoint, so that the server transmits the first traffic data to the corresponding virtual network element through the virtual network card bound by the target tunnel endpoint, and processes the first traffic data through the virtual network element.
[0099] In the embodiments of the present disclosure, the client determines a target tunnel endpoint in the plurality of second virtual extended local area network tunnel endpoints based on the weight coefficient, and then sends the first traffic data to the target tunnel endpoint, and the server transmits the first traffic data to the corresponding virtual network element based on the virtual network card bound by the target tunnel endpoint, and processes the first traffic data through the virtual network element.
[0100] In the above embodiments, the client can calculate the weight coefficient based on the first quantity of the virtual network cards bound by the second virtual extended local area network tunnel endpoints, so as to dynamically adjust the probability of transmitting the traffic data according to the change of the virtual network cards, to realize the reasonable allocation of the traffic data from the first virtual extended local area network tunnel endpoint to the second virtual extended local area network tunnel endpoint, and through the processing mode of the server, to realize the reasonable allocation of the traffic data from the virtual extended local area network tunnel endpoint to the virtual network element, thereby effectively improving the data transmission efficiency on the basis of reasonable data allocation.
[0101] In an optional embodiment, the above step of determining a target tunnel endpoint in the plurality of second virtual extended local area network tunnel endpoints based on the weight coefficient specifically includes the following steps:
[0102] determining a value interval corresponding to the corresponding second virtual extended local area network tunnel endpoint based on the weight coefficient;
[0103] performing a hash processing on the first traffic data, and determining a first random number according to a first hash processing result;
[0104] determining a second virtual extended local area network tunnel endpoint corresponding to a value interval in which the first random number is located in the plurality of value intervals, to obtain the target tunnel endpoint.
[0105] Here, each second virtual extended local area network tunnel endpoint corresponds to a value interval, and the greater the weight coefficient of each second virtual extended local area network tunnel endpoint, the larger the value interval range of the second virtual extended local area network tunnel endpoint. The larger the value interval range, the higher the probability of selecting the second virtual extended local area network tunnel endpoint to transmit the first flow data, that is, the higher the probability of the random number falling into the value interval.
[0106] Based on this, the value interval range of each second virtual extended local area network tunnel endpoint can be determined according to the weight coefficient of each second virtual extended local area network tunnel endpoint. The value interval range of each second virtual extended local area network tunnel endpoint is determined by dividing the interval.
[0107] In the embodiments of the present disclosure, the client can divide the corresponding value interval for each second virtual extended local area network tunnel endpoint according to the weight coefficient of each second virtual extended local area network tunnel endpoint, and set a uniformly distributed random number by means of hash processing of the first flow data, record the value interval in which the random number is located, and determine the second virtual extended local area network tunnel endpoint corresponding to the value interval as the target tunnel endpoint.
[0108] In the above embodiment, the value interval is determined based on the weight coefficient. The larger the value interval, the higher the probability of the random number falling into the value interval, which realizes that the second virtual extended local area network tunnel endpoint with more bound virtual network cards is more likely to transmit the first flow data, so that the high-performance virtual extended local area network tunnel endpoint transmits more flow data, thereby improving the resource utilization rate.
[0109] In an optional embodiment, the above step of determining the value interval corresponding to the second virtual extended local area network tunnel endpoint based on the weight coefficient includes the following steps:
[0110] determining that the weight coefficient of the second virtual extended local area network tunnel endpoint to be calculated at present is a first weight coefficient;
[0111] determining an accumulated value of the weight coefficients smaller than the first weight coefficient in the weight coefficients corresponding to all the second virtual extended local area network tunnel endpoints, to obtain a first accumulated value;
[0112] determining a second accumulated value of the weight coefficients corresponding to all the second virtual extended local area network tunnel endpoints;
[0113] The first weight coefficient, the first accumulated value and the second accumulated value are operated to obtain the value interval of the current second virtual extended local area network tunnel endpoint to be calculated.
[0114] The disclosure exemplarily describes the determination manner of the value interval.
[0115] Specifically, the weight coefficients of each second virtual extended local area network tunnel endpoint can be sorted to obtain a sorting result. If the weight coefficient of the current second virtual extended local area network tunnel endpoint to be calculated is a first weight coefficient, the sum of the weight coefficients smaller than the first weight coefficient, i.e., a first accumulated value, is determined based on the sorting result. Then, the sum of all weight coefficients, i.e., a second accumulated value, is determined. Finally, the value interval of the current second virtual extended local area network tunnel endpoint to be calculated is determined based on the first weight coefficient, the first accumulated value and the second accumulated value.
[0116] In the above embodiment, the length of the value interval is ensured to be in a proportional relationship with the weight coefficient, and all value intervals are spliced into a complete interval, avoiding the problem that random numbers repeatedly cover different value intervals. Moreover, when the weight coefficient changes, the changed value interval can be quickly generated without interrupting the transmission of data, so that dynamic adjustment of the value interval can be realized.
[0117] In an optional embodiment, the step of operating the first weight coefficient, the first accumulated value and the second accumulated value to obtain the value interval of the current second virtual extended local area network tunnel endpoint to be calculated specifically includes the following steps:
[0118] The first weight coefficient and the first accumulated value are summed to obtain a second weight coefficient;
[0119] The ratio of the first accumulated value to the second accumulated value is determined as a first boundary point;
[0120] The ratio of the second weight coefficient to the second accumulated value is determined as a second boundary point; wherein the second boundary point is greater than the first boundary point;
[0121] The value interval of the current second virtual extended local area network tunnel endpoint to be calculated is determined based on the first boundary point and the second boundary point.
[0122] For example, if the first weight coefficient is 1 and the second weight coefficient is 2, the first accumulated value is 0, the second accumulated value is 3, the first boundary point is 0 and the second boundary point is 3, the value interval of the current second virtual extended local area network tunnel endpoint to be calculated is [0, 3]. , the second boundary point is .
[0123] If the first weight coefficient is , and , the value range of the current second virtual extended local area network tunnel endpoint to be calculated is , the first accumulated value is , the second accumulated value is , the first boundary point is , the second weight coefficient is , and the second boundary point is . There are no more examples here.
[0124] It is worth noting that the first boundary point corresponding to each second virtual extended local area network tunnel endpoint is a closed interval, and the second boundary point is an open interval.
[0125] In the embodiments of the present disclosure, for each second virtual extended local area network tunnel endpoint, the interval left end point, i.e. the first boundary point, can be determined according to the accumulated value of the weight coefficient less than the weight coefficient corresponding to the second virtual extended local area network tunnel endpoint, and the accumulated value of all weight coefficients, and the interval right end point, i.e. the second boundary point, can be determined according to the second weight coefficient and the accumulated value of all weight coefficients, and the value range greater than or equal to the first boundary point and less than the second boundary point is determined as the value range of the second virtual extended local area network tunnel endpoint.
[0126] In the above embodiments, the weight coefficient of each second virtual extended local area network tunnel endpoint is mapped in the interval , and the value range of each second virtual extended local area network tunnel endpoint is determined based on the weight coefficient, so that when the weight coefficient changes, the size of the random number does not need to be adjusted, thereby simplifying the process of determining the target tunnel endpoint.
[0127] In an optional embodiment, the above step hashes the first traffic data, and determines the first random number according to the first hash processing result, specifically including the following steps:
[0128] Determine the traffic field of the first traffic data; wherein the traffic field includes at least one of the following: source address, target address, source port, target port, protocol type;
[0129] Hash processing the traffic field to obtain the first hash processing result;
[0130] Map the first hash processing result in a specified interval to obtain the first random number; wherein the specified interval is a value range greater than or equal to a first value and less than a second value, and the first value is less than the second value.
[0131] The disclosure does not require the traffic field extracted from the first traffic data to be adaptable.
[0132] In order to make the size of the first random number correspond to the range of the value interval, the first value can be 0 and the second value can be 1, so that the first random number does not fall into the range outside the value interval, and the effectiveness of the data transmission process can be effectively ensured.
[0133] The first value, the second value and The interval can be adjusted as needed, but the first value and the left end point of the interval must be the same, and the second value and the right end point of the interval must be the same.
[0134] In the embodiment of the disclosure, the traffic field of the first traffic data can be determined first, and the traffic field is subjected to hash processing, so as to ensure that each piece of traffic data corresponds to a first hash processing result, and the first hash processing result is mapped to a specified interval to determine a random number, so as to ensure that each first hash processing result also corresponds to a random number, thereby ensuring that each piece of traffic data corresponds to a random number, and ensuring the consistency of the data transmission process corresponding to the same piece of traffic data.
[0135] In an optional implementation, the above step calculates the weight coefficient of each of the second virtual extended local area network tunnel endpoints from the first virtual extended local area network tunnel endpoint based on the first quantity, and specifically includes the following steps:
[0136] Determine a second quantity of virtual network cards bound by all the second virtual extended local area network tunnel endpoints;
[0137] Calculate the ratio of the first quantity and the second quantity;
[0138] Calculate the product of the ratio and the matching coefficient corresponding to each of the second virtual extended local area network tunnel endpoints to obtain the weight coefficient of each of the second virtual extended local area network tunnel endpoints.
[0139] The disclosure exemplarily describes the processing process of the weight coefficient.
[0140] Specifically, wherein, the second quantity, the first quantity, the matching coefficient, wherein the matching coefficient can be configured according to the second quantity, and in general cases, the matching coefficient is greater than or equal to 1.
[0141] For the second virtual extended local area network tunnel endpoint, each second virtual extended local area network tunnel endpoint can correspond to a matching coefficient, or all second virtual extended local area network tunnel endpoints can correspond to a matching coefficient, and the disclosure does not require this.
[0142] For example, if the second number is 4, the first number of the virtual network cards bound to the second virtual extended local area network tunnel endpoint A is 1, the first number of the virtual network cards bound to the second virtual extended local area network tunnel endpoint B is 3, and the matching coefficient is 128, then the weight coefficient of the second virtual extended local area network tunnel endpoint A is 32, and the weight coefficient of the second virtual extended local area network tunnel endpoint B is 96.
[0143] The probability of the second virtual extended local area network tunnel endpoint A transmitting the first traffic data is one fourth, and the probability of the second virtual extended local area network tunnel endpoint B transmitting the first traffic data is three fourths, so the second virtual extended local area network tunnel endpoint B is more likely to be selected as the target tunnel endpoint than the second virtual extended local area network tunnel endpoint A.
[0144] In the above embodiment, the number of the virtual network cards bound to each second virtual extended local area network tunnel endpoint is introduced into the calculation process of the weight coefficient, so that the processing capacity of each second virtual extended local area network tunnel endpoint is used to reasonably distribute the traffic data.
[0145] In an optional embodiment, after the target tunnel endpoint is determined among the second virtual extended local area network tunnel endpoints based on the weight coefficients, the above steps specifically include the following steps:
[0146] A first routing table is generated based on the identifier of each second virtual extended local area network tunnel endpoint, the weight coefficient of each second virtual extended local area network tunnel endpoint, the virtual network card bound to each second virtual extended local area network tunnel endpoint, and the target tunnel endpoint.
[0147] An association relationship between a traffic field of the first traffic data and the first routing table is established, wherein the traffic field includes at least one of the following: source address, target address, source port, target port, and protocol type.
[0148] A target tunnel endpoint for transmitting second traffic data is determined based on the first routing table and the association relationship, wherein the second traffic data is traffic data after the first traffic data.
[0149] In the embodiments of the present disclosure, after the target tunnel endpoint is determined, the client establishes a first routing table based on the second virtual extended local area network tunnel endpoint, the weight coefficient, the virtual network card, and the target tunnel endpoint, and establishes an association relationship between the traffic field and the first routing table, so that the first routing table and the association relationship can be used to assist in determining the target tunnel endpoint corresponding to subsequent traffic data, and a part of the calculation amount can be effectively reduced, thereby improving the efficiency of the data transmission process.
[0150] In an optional implementation, the step of determining the target tunnel endpoint for transmitting the second traffic data based on the first routing table and the association relationship comprises the following steps:
[0151] determining a traffic field of the second traffic data;
[0152] performing hash processing on the traffic field of the first traffic data to obtain a first hash processing result;
[0153] performing hash processing on the traffic field of the second traffic data to obtain a second hash processing result;
[0154] in a case where the first hash processing result and the second hash processing result are the same, determining that the target tunnel endpoint in the first routing table is the target tunnel endpoint for transmitting the second traffic data.
[0155] In the embodiments of the present disclosure, the first hash processing result of the first traffic data and the second hash processing result of the second traffic data are determined first, and by comparing the first hash processing result and the second hash processing result, it is ensured that the first hash processing result and the second hash processing result are the same, and the target tunnel endpoint of the first traffic data is reused as the target tunnel endpoint of the second traffic data, so that the process of random number is not required, a large amount of concurrent transmission of traffic data can be supported, and the flexibility of the data transmission process is improved.
[0156] In an optional implementation, after the step of performing hash processing on the traffic field of the second traffic data to obtain a second hash processing result, the step comprises the following steps:
[0157] in a case where the first hash processing result and the second hash processing result are different, determining a value interval corresponding to the second virtual extended local area network tunnel endpoint based on the weight coefficient;
[0158] determining a second random number according to the second hash processing result;
[0159] determining the second virtual extended local area network tunnel endpoint corresponding to the value interval in which the second random number is located in the plurality of value intervals, to obtain the target tunnel endpoint for transmitting the second traffic data.
[0160] If the first hash processing result and the second hash processing result are different, it indicates that the random number of the first traffic data and the random number of the second traffic data are different, and further, the target tunnel endpoint of the first traffic data and the target tunnel endpoint of the second traffic data can also be different, and in this case, the weight coefficient and the corresponding value interval are unchanged, and for this, the random number of the second traffic data, i.e., the second random number, needs to be recalculated.
[0161] In the embodiments of the present disclosure, in the case that the first hash processing result and the second hash processing result are different, the second random number of the second traffic data is determined, and the target tunnel endpoint for transmitting the second traffic data is determined based on the second random number, thereby providing a complete processing flow of the target tunnel endpoint for the second traffic data.
[0162] After the target tunnel endpoint for transmitting the second traffic data is determined, the target tunnel endpoint for the second traffic data can be added to the first routing table to obtain an added first routing table, and an association relationship between the traffic field of the second traffic data and the added first routing table is established, so that the client can determine the target tunnel endpoint corresponding to subsequent traffic data based on the added first routing table and the association relationship, to ensure the integrity of the data transmission process.
[0163] In an optional embodiment, the above-mentioned steps, after determining the target tunnel endpoint for transmitting the second traffic data based on the first routing table and the association relationship, specifically include the following steps:
[0164] In the case that the virtual network card bound to the second virtual extended local area network tunnel endpoint changes, the changed weight coefficient of the second virtual extended local area network tunnel endpoint is calculated based on the number of the changed bound virtual network cards;
[0165] The first routing table is updated based on the matching item to obtain a second routing table; wherein the matching item includes at least one of the following: the changed weight coefficient and the changed bound virtual network card;
[0166] The changed target tunnel endpoint is determined based on the traffic field of the first traffic data and the second routing table; wherein the changed target tunnel endpoint is the second virtual extended local area network tunnel endpoint for transmitting the first traffic data determined based on the changed weight coefficient;
[0167] After receiving the second traffic data, the target tunnel endpoint for transmitting the second traffic data is determined based on the traffic field of the first traffic data, the second routing table and the changed target tunnel endpoint.
[0168] In the process of data transmission, if the virtual network card bound to the second virtual extended local area network tunnel endpoint changes, for example, the virtual network card is bound to other second virtual extended local area network tunnel endpoint, or the bound virtual network card is added or deleted, the weight coefficient can be recalculated based on the number of the changed bound virtual network cards to obtain the changed weight coefficient.
[0169] Based on this, it is determined whether the changed weight coefficient and the changed bound virtual network card respectively match the first routing table, if both match, the first routing table is not updated, if any one does not match, the changed weight coefficient and the changed bound virtual network card are added to the first routing table, the update of the first routing table is realized, and a second routing table is obtained.
[0170] In the embodiment of the present disclosure, the changed target tunnel endpoint of the first traffic data can be determined according to the traffic field of the first traffic data and the second routing table, and the target tunnel endpoint for transmitting the second traffic data can be determined based on the changed target tunnel endpoint, the traffic field of the first traffic data and the second routing table, so that the transmission strategy of the traffic data can be adjusted in time based on the dynamic change of the virtual network card, thereby improving the flexibility of the data transmission process.
[0171] After the changed target tunnel endpoint is determined, the changed target tunnel endpoint can also be added to the second routing table, so that the target tunnel endpoint for transmitting the second traffic data can be determined based on the traffic field of the first traffic data and the second routing table.
[0172] Referring to Figure 3 As shown in FIG. 3, a flowchart of a second data transmission method provided by the embodiment of the present disclosure is shown, and the data transmission method can be applied to a server, the server includes a plurality of second virtual extended local area network tunnel endpoints and a plurality of virtual network elements, each second virtual extended local area network tunnel endpoint and each virtual network element are connected by a virtual network card. Wherein, the method includes steps S301-S302, wherein:
[0173] Step S301: receiving first traffic data sent by a client to a target tunnel endpoint; wherein, the target tunnel endpoint is determined by the client based on weight coefficients of the second virtual extended local area network tunnel endpoints, the weight coefficients are probabilities for transmitting the first traffic data from a first virtual extended local area network tunnel endpoint to each second virtual extended local area network tunnel endpoint, and the weight coefficients are determined based on a first number of virtual network cards bound by each second virtual extended local area network tunnel endpoint.
[0174] In the embodiment of the present disclosure, the client obtains the first number of virtual network cards bound by each second virtual extended local area network tunnel endpoint in the server, and obtains the first traffic data to be transmitted, then calculates the weight coefficients from the first virtual extended local area network tunnel endpoint to each second virtual extended local area network tunnel endpoint based on the first number, and determines the target tunnel endpoint in the plurality of second virtual extended local area network tunnel endpoints based on the weight coefficients, and sends the first traffic data to the target tunnel endpoint.
[0175] In the above embodiment, the virtual extended local area network tunnel endpoint transmitting the first traffic data is dynamically adjusted according to the change of the virtual network card, thereby improving the flexibility of the data transmission process.
[0176] Step S302: transmitting the first traffic data to the corresponding virtual network element based on the virtual network card bound by the target tunnel endpoint, so that the first traffic data is processed by the virtual network element.
[0177] In the embodiment of the present disclosure, the server transmits the first traffic data to the corresponding virtual network element based on the virtual network card bound by the target tunnel endpoint, and processes the first traffic data through the virtual network element to obtain a processing result, so as to determine whether the first traffic data is abnormal according to the processing result.
[0178] In the above embodiment, the client can calculate the weight coefficient based on the first quantity of the virtual network cards bound by the second virtual extended local area network tunnel endpoint, so as to dynamically adjust the probability of transmitting the traffic data according to the change of the virtual network card, realize the reasonable allocation of the traffic data from the first virtual extended local area network tunnel endpoint to the second virtual extended local area network tunnel endpoint, and realize the reasonable allocation of the traffic data from the virtual extended local area network tunnel endpoint to the virtual network element through the processing mode of the server, thereby effectively improving the data transmission efficiency on the basis of reasonable data allocation.
[0179] In an optional embodiment, the step of transmitting the first traffic data to the corresponding virtual network element based on the virtual network card bound by the target tunnel endpoint comprises the following steps:
[0180] When the target tunnel endpoint is bound with one virtual network card, the first traffic data is transmitted to the first virtual network element, wherein the virtual network card bound by the first virtual network element is of the same type as the virtual network card bound by the target tunnel endpoint.
[0181] In the embodiment of the present disclosure, if the target tunnel endpoint is bound with one virtual network card, the first virtual network element is bound with one or more virtual network cards, and one of the virtual network cards bound by the first virtual network element is of the same type as the virtual network card bound by the target tunnel endpoint, the first traffic data is directly transmitted to the first virtual network element.
[0182] In an optional embodiment, the step of transmitting the first traffic data to the corresponding virtual network element based on the virtual network card bound by the target tunnel endpoint comprises the following steps:
[0183] When the target tunnel endpoint is bound with multiple virtual network cards, a target virtual network card is determined from the multiple virtual network cards bound by the target tunnel endpoint.
[0184] transmit the first traffic data to the second virtual network element based on the target virtual network card; wherein the virtual network card bound to the second virtual network element is of the same type as the target virtual network card.
[0185] In the embodiments of the present disclosure, if the target tunnel endpoint is bound to multiple virtual network cards and the second virtual network element is bound to one or more virtual network cards, the target virtual network card needs to be determined from the multiple virtual network cards bound to the target tunnel endpoint, the ECMP process of the first traffic data to the virtual network card is implemented, and the first traffic data is transmitted to the second virtual network element based on the target virtual network card, and one of the virtual network cards bound to the second virtual network element is of the same type as the target virtual network card.
[0186] In the above embodiments, the server implements secondary ECMP of the first traffic data, that is, the target virtual network card is determined from the multiple virtual network cards bound to the target tunnel endpoint, so as to improve the rationality of the data transmission process on the basis of load balancing of the traffic data.
[0187] In an optional embodiment, the above step of determining the target virtual network card from the multiple virtual network cards bound to the target tunnel endpoint specifically includes the following steps:
[0188] determining a traffic field of the first traffic data; wherein the traffic field includes at least one of the following: source address, target address, source port, target port, protocol type;
[0189] performing hash processing on the traffic field to obtain a third hash processing result;
[0190] performing modulo operation on the third hash processing result and the number of virtual network cards bound to the target tunnel endpoint to obtain an operation result;
[0191] mapping the operation result to obtain the target virtual network card.
[0192] The virtual network cards bound to the target tunnel endpoint can be sorted in advance to obtain the identifiers of the virtual network cards. After the operation result is obtained, the operation result can be mapped to the identifier of the virtual network card, and the virtual network card corresponding to the mapped identifier is determined as the target virtual network card.
[0193] In the above embodiments, through the processing procedures of hash processing, modulo operation and mapping, the first traffic data is uniformly dispersed to each virtual network card bound to the target tunnel endpoint, avoiding transmission of too much traffic data by a single virtual network card, and ensuring stability and efficiency of the data transmission process.
[0194] The above data transmission process will be described below. Figure 4 The above data transmission process will be described below. Figure 4As shown, the specific process is described as follows:
[0195] S401: The client acquires a first quantity of virtual network cards bound to each second virtual extended local area network tunnel endpoint in the server.
[0196] Among them, the client includes a first virtual extended local area network tunnel endpoint, the server includes a plurality of second virtual extended local area network tunnel endpoints and a plurality of virtual network elements, each second virtual extended local area network tunnel endpoint and each virtual network element are connected through a virtual network card.
[0197] S402: The client calculates the weight coefficient from the first virtual extended local area network tunnel endpoint to each second virtual extended local area network tunnel endpoint based on the first quantity.
[0198] Among them, the weight coefficient is used to indicate the probability of selecting the second virtual extended local area network tunnel endpoint to transmit the first flow data.
[0199] S403: The client determines a target tunnel endpoint in the plurality of second virtual extended local area network tunnel endpoints based on the weight coefficient.
[0200] S404: The client sends the first flow data to the target tunnel endpoint.
[0201] S405: The server transmits the first flow data to the corresponding virtual network element based on the virtual network card bound to the target tunnel endpoint.
[0202] S406: The server processes the first flow data through the virtual network element.
[0203] The following will be described in combination with Figure 5 The processing process of the routing table is described. As shown, Figure 5 The specific process is described as follows:
[0204] S501: Based on the identifier of each second virtual extended local area network tunnel endpoint, the weight coefficient of each second virtual extended local area network tunnel endpoint, the virtual network card bound to each second virtual extended local area network tunnel endpoint and the target tunnel endpoint for transmitting the first flow data, a first routing table is generated.
[0205] S502: An association relationship between the flow field of the first flow data and the first routing table is established.
[0206] Among them, the flow field includes at least one of the following: source address, target address, source port, target port, protocol type.
[0207] S503: Determine the target tunnel endpoint for transmitting the second flow data based on the first routing table and the association relationship.
[0208] The second flow data is flow data after the first flow data.
[0209] S504: In a case where the virtual network card bound to the second virtual extended local area network tunnel endpoint changes, calculating a changed weight coefficient of the second virtual extended local area network tunnel endpoint based on a quantity of the changed bound virtual network card.
[0210] S505: Updating the first routing table based on the matching item to obtain a second routing table.
[0211] The matching item includes at least one of the changed weight coefficient and the changed bound virtual network card.
[0212] S506: Determining a changed target tunnel endpoint based on the flow field of the first flow data and the second routing table.
[0213] The changed target tunnel endpoint is a second virtual extended local area network tunnel endpoint for transmitting the first flow data based on the changed weight coefficient.
[0214] S507: After receiving the second flow data, determining a target tunnel endpoint for transmitting the second flow data based on the flow field of the first flow data, the second routing table, and the changed target tunnel endpoint.
[0215] The disclosure also provides a data transmission system, including a client and a server; the client includes a first virtual extended local area network tunnel endpoint, and the server includes a plurality of second virtual extended local area network tunnel endpoints and a plurality of virtual network elements; each of the second virtual extended local area network tunnel endpoints and each of the virtual network elements are connected through a virtual network card.
[0216] The client is configured to acquire a first quantity of virtual network cards bound to each of the second virtual extended local area network tunnel endpoints in the server, calculate a weight coefficient from the first virtual extended local area network tunnel endpoint to each of the second virtual extended local area network tunnel endpoints based on the first quantity, and determine a target tunnel endpoint in the plurality of second virtual extended local area network tunnel endpoints based on the weight coefficient, and send first flow data to the target tunnel endpoint.
[0217] Here, the specific implementation of the client is as described above, and will not be described in detail here.
[0218] The server is configured to transmit the first flow data to a corresponding virtual network element based on a virtual network card bound to the target tunnel endpoint, and process the first flow data through the virtual network element.
[0219] Here, the specific implementation of the server is as described above in the embodiments, and thus is not described in detail here.
[0220] Based on the same inventive concept, the data transmission method is also provided in the embodiments of the present disclosure. Since the principle of solving problems of the device in the embodiments of the present disclosure is similar to the above-mentioned data transmission method, the implementation of the device can be referred to the implementation of the method, and the repeated parts are not described again.
[0221] Referring to Figure 6 FIG. 1 shows a schematic diagram of a client provided by the embodiments of the present disclosure, and the device includes a network card acquisition unit 60, a weight processing unit 61, and a first data transmission unit 62; wherein:
[0222] The network card acquisition unit is configured to acquire a first number of virtual network cards bound to each second virtual extended local area network tunnel endpoint in the server;
[0223] The weight processing unit is configured to calculate a weight coefficient from the first virtual extended local area network tunnel endpoint to each second virtual extended local area network tunnel endpoint based on the first number; wherein the weight coefficient is used to indicate a probability of selecting the second virtual extended local area network tunnel endpoint to transmit the first flow data;
[0224] The first data transmission unit is configured to determine a target tunnel endpoint in the plurality of second virtual extended local area network tunnel endpoints based on the weight coefficient, and send the first flow data to the target tunnel endpoint, so that the server transmits the first flow data to a corresponding virtual network element through a virtual network card bound to the target tunnel endpoint, so as to process the first flow data through the virtual network element.
[0225] In a possible implementation, the client is further configured to:
[0226] Determine a value interval corresponding to the corresponding second virtual extended local area network tunnel endpoint based on the weight coefficient;
[0227] Hash process the first flow data, and determine a first random number according to a first hash processing result;
[0228] Determine a second virtual extended local area network tunnel endpoint corresponding to a value interval in which the first random number is located in the plurality of value intervals, to obtain the target tunnel endpoint.
[0229] In a possible implementation, the client is further configured to:
[0230] Determine that the weight coefficient of the second virtual extended local area network tunnel endpoint to be calculated at present is a first weight coefficient;
[0231] determining an accumulated value of the weight coefficients corresponding to all the second virtual extended local area network tunnel endpoints and less than the first weight coefficient, to obtain a first accumulated value;
[0232] determining a second accumulated value of the weight coefficients corresponding to all the second virtual extended local area network tunnel endpoints;
[0233] performing operation on the first weight coefficient, the first accumulated value and the second accumulated value, to obtain the value interval of the current second virtual extended local area network tunnel endpoint to be calculated.
[0234] In a possible implementation, the client further includes:
[0235] performing summation processing on the first weight coefficient and the first accumulated value, to obtain a second weight coefficient;
[0236] determining a ratio of the first accumulated value and the second accumulated value as a first boundary point;
[0237] determining a ratio of the second weight coefficient and the second accumulated value as a second boundary point; wherein the second boundary point is greater than the first boundary point;
[0238] determining the value interval of the current second virtual extended local area network tunnel endpoint to be calculated based on the first boundary point and the second boundary point.
[0239] In a possible implementation, the client further includes:
[0240] determining a flow field of the first flow data; wherein the flow field includes at least one of the following: source address, target address, source port, target port, protocol type;
[0241] performing hash processing on the flow field, to obtain the first hash processing result;
[0242] mapping the first hash processing result in a specified interval, to obtain the first random number; wherein the specified interval is a value range greater than or equal to a first numerical value and less than a second numerical value, and the first numerical value is less than the second numerical value.
[0243] In a possible implementation, the client further includes:
[0244] determining a second number of virtual network cards bound by all the second virtual extended local area network tunnel endpoints;
[0245] calculating a ratio of the first number and the second number;
[0246] The product of the ratio and the matching coefficient corresponding to each second virtual extended local area network tunnel endpoint is calculated to obtain a weight coefficient of each second virtual extended local area network tunnel endpoint.
[0247] In a possible implementation, the client further comprises:
[0248] A first routing table is generated based on the identity of each second virtual extended local area network tunnel endpoint, the weight coefficient of each second virtual extended local area network tunnel endpoint, the virtual network card bound to each second virtual extended local area network tunnel endpoint, and the target tunnel endpoint.
[0249] An association relationship between a traffic field of the first traffic data and the first routing table is established, wherein the traffic field comprises at least one of a source address, a target address, a source port, a target port, and a protocol type.
[0250] A target tunnel endpoint for transmitting second traffic data is determined based on the first routing table and the association relationship, wherein the second traffic data is traffic data after the first traffic data.
[0251] In a possible implementation, the client further comprises:
[0252] A traffic field of the second traffic data is determined.
[0253] The traffic field of the first traffic data is subjected to hash processing to obtain a first hash processing result.
[0254] The traffic field of the second traffic data is subjected to hash processing to obtain a second hash processing result.
[0255] In a case where the first hash processing result and the second hash processing result are the same, a target tunnel endpoint in the first routing table is determined as the target tunnel endpoint for transmitting the second traffic data.
[0256] In a possible implementation, the client further comprises:
[0257] In a case where the first hash processing result and the second hash processing result are different, a value interval corresponding to a second virtual extended local area network tunnel endpoint is determined based on the weight coefficient.
[0258] A second random number is determined according to the second hash processing result.
[0259] A second virtual extended local area network tunnel endpoint corresponding to the value interval in which the second random number is located in the plurality of value intervals is determined to obtain the target tunnel endpoint for transmitting the second traffic data.
[0260] In a possible implementation, the client is further configured to:
[0261] In a case where the virtual network cards bound to the second virtual extended local area network tunnel endpoint change, a changed weight coefficient of the second virtual extended local area network tunnel endpoint is calculated based on a number of the changed bound virtual network cards;
[0262] The first routing table is updated based on the matching item to obtain a second routing table; the matching item includes at least one of the changed weight coefficient and the changed bound virtual network card;
[0263] A changed target tunnel endpoint is determined based on a flow field of the first flow data and the second routing table; the changed target tunnel endpoint is a second virtual extended local area network tunnel endpoint for transmitting the first flow data, which is determined based on the changed weight coefficient;
[0264] After the second flow data is received, a target tunnel endpoint for transmitting the second flow data is determined based on the flow field of the first flow data, the second routing table, and the changed target tunnel endpoint.
[0265] Referring to Figure 7 FIG. 1 shows a schematic diagram of a server provided by an embodiment of the present disclosure, which includes a data receiving unit 70 and a second data transmitting unit 71; wherein:
[0266] The data receiving unit is configured to receive first flow data sent by a client to a target tunnel endpoint; the target tunnel endpoint is determined by the client based on a weight coefficient of a second virtual extended local area network tunnel endpoint; the weight coefficient is a probability of transmitting the first flow data from a first virtual extended local area network tunnel endpoint to each second virtual extended local area network tunnel endpoint; the weight coefficient is determined based on a first number of virtual network cards bound to each second virtual extended local area network tunnel endpoint;
[0267] The second data transmitting unit is configured to transmit the first flow data to a corresponding virtual network element based on a virtual network card bound to the target tunnel endpoint, so that the first flow data is processed by the virtual network element.
[0268] In a possible implementation, the server is further configured to:
[0269] When the target tunnel endpoint is bound to one virtual network card, the first flow data is transmitted to a first virtual network element; the virtual network card bound to the first virtual network element is of the same type as the virtual network card bound to the target tunnel endpoint.
[0270] In a possible implementation, the server is further configured to:
[0271] When the target tunnel endpoint is bound to multiple virtual network cards, determining a target virtual network card from the multiple virtual network cards bound to the target tunnel endpoint;
[0272] transmitting the first traffic data to a second virtual network element based on the target virtual network card, wherein a virtual network card bound to the second virtual network element is of the same type as the target virtual network card.
[0273] In a possible implementation, the server is further configured to:
[0274] determining a traffic field of the first traffic data, wherein the traffic field includes at least one of a source address, a target address, a source port, a target port, and a protocol type;
[0275] performing hash processing on the traffic field to obtain a third hash processing result;
[0276] performing modulo operation on the third hash processing result and a number of virtual network cards bound to the target tunnel endpoint to obtain an operation result;
[0277] mapping the operation result to obtain the target virtual network card.
[0278] The processing procedure of each module and the interaction procedure between modules can refer to the related description in the method embodiments, and will not be repeated here.
[0279] Corresponding to the data transmission method in Figure 1 and Figure 3 , the present disclosure further provides an electronic device 80, as shown in Figure 8 , a structural schematic diagram of the electronic device 80 provided by the present disclosure, which includes:
[0280] a processor 81, a memory 82, and a bus 83; the memory 82 is configured to store execution instructions, including an internal memory 821 and an external memory 822; the internal memory 821 is also referred to as an internal storage, and is configured to temporarily store operation data in the processor 81 and exchange data with the external memory 822 such as a hard disk; the processor 81 exchanges data with the external memory 822 through the internal memory 821; when the electronic device 80 is running, the processor 81 and the memory 82 communicate through the bus 83, so that the processor 81 executes the following instructions:
[0281] obtaining a first number of virtual network cards bound to each second virtual extended local area network tunnel endpoint in the server;
[0282] Based on the first quantity, a weighting coefficient is calculated from the first virtual extended LAN tunnel endpoint to each second virtual extended LAN tunnel endpoint; wherein the weighting coefficient is used to indicate the probability of selecting the second virtual extended LAN tunnel endpoint to transmit the first traffic data;
[0283] Based on the weighting coefficient, a target tunnel endpoint is determined among multiple second virtual extended LAN tunnel endpoints, and the first traffic data is sent to the target tunnel endpoint so that the server transmits the first traffic data to the corresponding virtual network element through the virtual network card bound to the target tunnel endpoint, so as to process the first traffic data through the virtual network element.
[0284] Alternatively, execute the following command:
[0285] Receive first traffic data sent by the client to the target tunnel endpoint; wherein the target tunnel endpoint is determined by the client based on the weight coefficient of the second virtual extended LAN tunnel endpoint, the weight coefficient being the probability of transmitting the first traffic data from the first virtual extended LAN tunnel endpoint to each second virtual extended LAN tunnel endpoint, and the weight coefficient being determined based on the first number of virtual network cards bound to each second virtual extended LAN tunnel endpoint;
[0286] The first traffic data is transmitted to the corresponding virtual network element based on the virtual network card bound to the target tunnel endpoint, so as to process the first traffic data through the virtual network element.
[0287] This disclosure also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the data transmission method described in the above-described method embodiments. The storage medium may be a volatile or non-volatile computer-readable storage medium.
[0288] This disclosure also provides a computer program product 90, such as... Figure 9 The diagram shown is a schematic diagram of the structure of a computer program product 90 provided in an embodiment of this disclosure. The computer program product 90 carries a computer program 91. The program included in the computer program 91 can be used to execute the steps of the data transmission method described in the above method embodiments. For details, please refer to the above method embodiments, which will not be repeated here.
[0289] The above describes the data transmission method, device, system, equipment, medium and product according to the embodiments of the present disclosure with reference to the drawings. First, the client obtains the first number of virtual network cards bound to each second virtual extended local area network tunnel endpoint in the server. Then, the weight coefficient from the first virtual extended local area network tunnel endpoint to each second virtual extended local area network tunnel endpoint is calculated based on the first number. The weight coefficient is used to indicate the probability of selecting the second virtual extended local area network tunnel endpoint to transmit the first traffic data. Finally, the target tunnel endpoint is determined in the plurality of second virtual extended local area network tunnel endpoints based on the weight coefficient, and the first traffic data is sent to the target tunnel endpoint, so that the server transmits the first traffic data to the corresponding virtual network element through the virtual network card bound to the target tunnel endpoint, so as to process the first traffic data through the virtual network element. Through the above processing mode, the weight coefficient is calculated based on the first number of virtual network cards bound to the second virtual extended local area network tunnel endpoint, so that the probability of transmitting traffic data can be dynamically adjusted according to the change of the virtual network card, the reasonable allocation of traffic data from the first virtual extended local area network tunnel endpoint to the second virtual extended local area network tunnel endpoint is realized, and through the processing mode of the server, the reasonable allocation of traffic data from the virtual extended local area network tunnel endpoint to the virtual network element is realized, and then on the basis of reasonable data distribution, the data transmission efficiency is effectively improved.
[0290] The basic principles of the present disclosure are described above in combination with specific embodiments, but it should be pointed out that the advantages, advantages, effects and the like mentioned in the present disclosure are only examples and are not limiting, and these advantages, advantages, effects and the like cannot be considered as the must-have of each embodiment of the present disclosure. In addition, the specific details of the above disclosure are only for the purpose of example and for the purpose of understanding, and are not limited to the above specific details, and the present disclosure is not limited to the above specific details.
[0291] The block diagrams of the devices, apparatuses, equipment, systems involved in the present disclosure are only illustrative examples and are not intended to require or imply the connection, arrangement, configuration shown in the block diagram. As those skilled in the art will recognize, these devices, apparatuses, equipment, systems can be connected, arranged, configured in any manner. Words such as "include", "contain", "have" and the like are open-ended words, which mean "including but not limited to", and can be used interchangeably. The words "or" and "and" used herein mean the word "and / or", and can be used interchangeably unless the context clearly indicates otherwise. The word "such as" used herein means the phrase "such as but not limited to", and can be used interchangeably.
[0292] Also, as used in the description herein and throughout the claims that follow, the meaning of "or" includes "and / or" unless the context clearly dictates otherwise. For example, when used in the examination of "at least one of A or / and B" the phrase "at least one of A or B" means A or B or both. As used in the examination of "between one and three of A, B, and C," the phrase means A or B or C, or any combination thereof.
[0293] It is also important to note that the systems and methods of the disclosure can be embodied in a variety of forms depending on the particular requirements of the applications. Some embodiments can be implemented in software, while other embodiments can be implemented in hardware or a combination of software and hardware. As used herein the term "software" includes but is not limited to one or more computer program(s) or other computer readable instructions that can be stored or carried on a computer readable medium, such as a floppy disk, a flexible disk, a hard disk, a magnetic tape, a magnetic disk, an optical disk, a CD-ROM, RAM, ROM, PROM, EPROM, a flash memory, a solid state drive, or other memory chip or cartridge, or the like.
[0294] Various changes, modifications and alterations to the techniques described herein can be made without departing from the teachings of the attached claims. Moreover, the scope of the claims should not be limited to the particular aspects described in the above description and drawings. Rather, the scope of the claims should be understood to include all aspects and equivalents thereof that are within the scope of the claims. The disclosure is not intended to be limited to the aspects specifically identified hereinabove. Rather, the scope of the disclosure includes all aspects and equivalents thereof that are within the scope of the claims.
[0295] The above description of disclosed aspects is intended to be illustrative, and not restrictive. Many other aspects can be apparent to those of skill in the art upon reviewing the above description. The scope of the disclosure should therefore be determined with reference to the appended claims, along with the full scope of equivalents to which such claims are entitled. The claims should not be limited to the features described hereinabove, but should be given their full scope since numerous modifications and alterations mentioned above are within the scope of the present disclosure. Accordingly, the disclosure is not limited to particular aspects described herein as such, but can vary considerably.
[0296] The above description has been presented for the purpose of illustration and description. Further, the description is not intended to limit the embodiments of the disclosure to the form disclosed herein. Although various example aspects and embodiments have been discussed above, those of skill in the art will recognize certain modifications, permutations, additions, and sub-combinations thereof.
Claims
1. A data transmission method applied to a client, wherein the client comprises a first virtual extended local area network tunnel end point, characterized in that, The method comprises: acquiring a first quantity of virtual network cards bound to each second virtual extended local area network tunnel endpoint in a service end; calculating a weight coefficient from the first virtual extended local area network tunnel endpoint to each second virtual extended local area network tunnel endpoint based on the first quantity; wherein the weight coefficient is used to indicate a probability of selecting the second virtual extended local area network tunnel endpoint to transmit first traffic data; determining a target tunnel endpoint in the plurality of second virtual extended local area network tunnel endpoints based on the weight coefficient, and sending the first traffic data to the target tunnel endpoint, so that the service end transmits the first traffic data to a corresponding virtual network element through a virtual network card bound to the target tunnel endpoint, to process the first traffic data through the virtual network element.
2. The method of claim 1, wherein, The method further comprises: determining a value interval corresponding to the corresponding second virtual extended local area network tunnel endpoint based on the weight coefficient; performing hash processing on the first traffic data, and determining a first random number according to a first hash processing result; determining a second virtual extended local area network tunnel endpoint corresponding to a value interval in which the first random number is located in the plurality of value intervals, to obtain the target tunnel endpoint.
3. The method of claim 2, wherein, The method further comprises: determining that the weight coefficient of the current second virtual extended local area network tunnel endpoint to be calculated is a first weight coefficient; determining a first accumulated value of weight coefficients smaller than the first weight coefficient in all weight coefficients corresponding to the second virtual extended local area network tunnel endpoints; determining a second accumulated value of all weight coefficients corresponding to the second virtual extended local area network tunnel endpoints; performing operation on the first weight coefficient, the first accumulated value and the second accumulated value to obtain the value interval of the current second virtual extended local area network tunnel endpoint to be calculated.
4. The method of claim 3, wherein, The method further comprises: performing summation processing on the first weight coefficient and the first accumulated value to obtain a second weight coefficient; determining that a ratio of the first accumulated value to the second accumulated value is a first boundary point; determining that a ratio of the second weight coefficient to the second accumulated value is a second boundary point; wherein the second boundary point is greater than the first boundary point; determining the value interval of the current second virtual extended local area network tunnel endpoint to be calculated based on the first boundary point and the second boundary point.
5. The method of claim 2, wherein, The method further comprises: determining a traffic field of the first traffic data; wherein the traffic field comprises at least one of the following: source address, target address, source port, target port, protocol type; performing hash processing on the traffic field to obtain the first hash processing result; and determining the first random number according to the first hash processing result. Map the first hash processing result in a specified interval to obtain the first random number; wherein the specified interval is a value range greater than or equal to a first value and less than a second value, and the first value is less than the second value.
6. The method of claim 1, wherein, The calculating the weight coefficient from the first virtual extended local area network tunnel endpoint to each second virtual extended local area network tunnel endpoint based on the first quantity comprises: Determining a second quantity of virtual network cards bound by all the second virtual extended local area network tunnel endpoints; Calculating a ratio of the first quantity and the second quantity; Calculating a product of the ratio and a matching coefficient corresponding to each second virtual extended local area network tunnel endpoint to obtain the weight coefficient of each second virtual extended local area network tunnel endpoint.
7. The method of claim 1, wherein, After determining the target tunnel endpoint in the plurality of second virtual extended local area network tunnel endpoints based on the weight coefficient, the method further comprises: Generating a first routing table based on the identifier of each second virtual extended local area network tunnel endpoint, the weight coefficient of each second virtual extended local area network tunnel endpoint, the virtual network card bound by each second virtual extended local area network tunnel endpoint, and the target tunnel endpoint; Establishing an association relationship between a traffic field of the first traffic data and the first routing table; wherein the traffic field comprises at least one of the following: source address, target address, source port, target port, protocol type; Determining a target tunnel endpoint for transmitting second traffic data based on the first routing table and the association relationship; wherein the second traffic data is traffic data after the first traffic data.
8. The method of claim 7, wherein, The determining the target tunnel endpoint for transmitting the second traffic data based on the first routing table and the association relationship comprises: Determining a traffic field of the second traffic data; Hash processing the traffic field of the first traffic data to obtain a first hash processing result; Hash processing the traffic field of the second traffic data to obtain a second hash processing result; In the case that the first hash processing result and the second hash processing result are the same, determining that the target tunnel endpoint in the first routing table is the target tunnel endpoint for transmitting the second traffic data.
9. The method of claim 8, wherein, After the hash processing of the traffic field of the second traffic data to obtain the second hash processing result, the method further comprises: In the case that the first hash processing result and the second hash processing result are not the same, determining a value interval corresponding to the corresponding second virtual extended local area network tunnel endpoint based on the weight coefficient; Determining a second random number according to the second hash processing result; Determining the second virtual extended local area network tunnel endpoint corresponding to the value interval in which the second random number is located in the plurality of value intervals to obtain the target tunnel endpoint for transmitting the second traffic data.
10. The method of claim 7, wherein, After determining the target tunnel endpoint for transmitting the second traffic data based on the first routing table and the association relationship, the method further comprises: In the case that the virtual network card bound to the second virtual extended local area network tunnel endpoint changes, the changed weight coefficient of the second virtual extended local area network tunnel endpoint is calculated based on the number of the changed bound virtual network cards; The first routing table is updated based on the matching item to obtain a second routing table; wherein the matching item includes at least one of the following: the changed weight coefficient and the changed bound virtual network card; The changed target tunnel endpoint is determined based on the flow field of the first flow data and the second routing table; wherein the changed target tunnel endpoint is a second virtual extended local area network tunnel endpoint for transmitting the first flow data, which is determined based on the changed weight coefficient. After receiving the second flow data, the target tunnel endpoint for transmitting the second flow data is determined based on the flow field of the first flow data, the second routing table and the changed target tunnel endpoint.
11. A data transmission method applied to a server, wherein the server comprises a plurality of second virtual extended local area network tunnel end points and a plurality of virtual network elements, each of the second virtual extended local area network tunnel end points and each of the virtual network elements are connected through a virtual network card, and the method comprises: receiving a data packet from a first virtual extended local area network tunnel end point; determining a second virtual extended local area network tunnel end point corresponding to the first virtual extended local area network tunnel end point; determining a virtual network element corresponding to the second virtual extended local area network tunnel end point; and sending the data packet to the virtual network element. Comprising: Receiving the first flow data sent by a client to a target tunnel endpoint; wherein the target tunnel endpoint is determined by the client based on the weight coefficient of the second virtual extended local area network tunnel endpoint, and the weight coefficient is the probability of transmitting the first flow data from the first virtual extended local area network tunnel endpoint to each second virtual extended local area network tunnel endpoint, which is determined based on the first number of virtual network cards bound to each second virtual extended local area network tunnel endpoint; Transmitting the first flow data to a corresponding virtual network element based on the virtual network card bound to the target tunnel endpoint, so that the first flow data is processed by the virtual network element.
12. The method of claim 11, wherein, The transmitting of the first flow data to a corresponding virtual network element based on the virtual network card bound to the target tunnel endpoint comprises: When the target tunnel endpoint is bound to one virtual network card, the first flow data is transmitted to a first virtual network element; wherein the virtual network card bound to the first virtual network element is of the same type as the virtual network card bound to the target tunnel endpoint.
13. The method of claim 11, wherein, The transmitting of the first flow data to a corresponding virtual network element based on the virtual network card bound to the target tunnel endpoint comprises: When the target tunnel endpoint is bound to multiple virtual network cards, a target virtual network card is determined in the multiple virtual network cards bound to the target tunnel endpoint; The first flow data is transmitted to a second virtual network element based on the target virtual network card; wherein the virtual network card bound to the second virtual network element is of the same type as the target virtual network card.
14. The method of claim 13, wherein, The determining of the target virtual network card in the multiple virtual network cards bound to the target tunnel endpoint comprises: Determining the flow field of the first flow data; wherein the flow field includes at least one of the following: source address, target address, source port, target port, protocol type; Hash processing the flow field to obtain a third hash processing result; Performing a modulo operation on the third hash processing result and the number of virtual network cards bound to the target tunnel endpoint to obtain an operation result; Mapping the operation result to obtain the target virtual network card.
15. A data transmission system, characterized by Comprising: The client and the server; the client includes a first virtual extended local area network tunnel endpoint, and the server includes a plurality of second virtual extended local area network tunnel endpoints and a plurality of virtual network elements, each of the second virtual extended local area network tunnel endpoints and each of the virtual network elements are connected through a virtual network card; The client is used for obtaining a first quantity of virtual network cards bound by each of the second virtual extended local area network tunnel endpoints in the server, and calculating a weight coefficient from the first virtual extended local area network tunnel endpoint to each of the second virtual extended local area network tunnel endpoints based on the first quantity; wherein the weight coefficient is used for indicating a probability of selecting the second virtual extended local area network tunnel endpoint to transmit first flow data; and determining a target tunnel endpoint in the plurality of second virtual extended local area network tunnel endpoints based on the weight coefficient, and sending the first flow data to the target tunnel endpoint; The server is used for transmitting the first flow data to a corresponding virtual network element based on a virtual network card bound by the target tunnel endpoint, and processing the first flow data through the virtual network element.
16. A client comprising a first virtual extensible local area network tunnel endpoint therein, characterized in that, Comprise: A network card obtaining unit is used for obtaining a first quantity of virtual network cards bound by each of the second virtual extended local area network tunnel endpoints in the server; A weight processing unit is used for calculating a weight coefficient from the first virtual extended local area network tunnel endpoint to each of the second virtual extended local area network tunnel endpoints based on the first quantity; wherein the weight coefficient is used for indicating a probability of selecting the second virtual extended local area network tunnel endpoint to transmit first flow data; A first data transmission unit is used for determining a target tunnel endpoint in the plurality of second virtual extended local area network tunnel endpoints based on the weight coefficient, and sending the first flow data to the target tunnel endpoint, so that the server transmits the first flow data to a corresponding virtual network element through a virtual network card bound by the target tunnel endpoint, and processes the first flow data through the virtual network element.
17. A server comprising a plurality of second virtual extensible local area network tunnel end points and a plurality of virtual network elements, each of the second virtual extensible local area network tunnel end points and each of the virtual network elements being communicatively coupled by a virtual network card, wherein, Comprise: A data receiving unit is used for receiving first flow data sent by a client to a target tunnel endpoint; wherein the target tunnel endpoint is determined by the client based on a weight coefficient of the second virtual extended local area network tunnel endpoint, the weight coefficient is a probability of transmitting the first flow data from a first virtual extended local area network tunnel endpoint to each of the second virtual extended local area network tunnel endpoints, and the weight coefficient is determined based on a first quantity of virtual network cards bound by each of the second virtual extended local area network tunnel endpoints; A second data transmission unit is used for transmitting the first flow data to a corresponding virtual network element based on a virtual network card bound by the target tunnel endpoint, so as to process the first flow data through the virtual network element.
18. An electronic device, comprising: Comprise: A processor, a memory and a bus, the memory stores machine readable instructions executable by the processor, when the electronic device is running, the processor and the memory are communicated through the bus, the machine readable instructions are executed by the processor to execute the steps of the data transmission method in any one of claims 1 to 14.
19. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is run by the processor to execute the steps of the data transmission method according to any one of claims 1 to 14.
20. A computer program product, characterised in that, The computer program product is stored in a storage medium, and the program product is executed by at least one processor to implement the data transmission method according to any one of claims 1 to 14.
Citation Information
Patent Citations
Data transmission method between servers and strongswan server
CN111786868A
Cloud computing virtual network system, application method and device thereof, equipment and medium
CN117499318A