A method, device, cluster, product and storage medium for generating forwarding table entries
By generating forwarding table entries in virtual switches in cloud networks and binding a buffer queue with the smallest load, the problem of vCPU load uneven caused by hash conflict is solved, and better load balancing and packet processing efficiency is achieved.
Patent Information
- Application Number
- CN202510034633.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2045-01-09
AI Technical Summary
In cloud networks, hashing algorithms are used to forward multicast and unicast messages with hash conflicts, resulting in uneven load on vCPUs in the virtual machine and may even lead to packet loss.
By generating forwarding table entries in the virtual switch, binding buffer queues, outgoing ports and play table entries with the lowest load, ensuring that packets are processed through buffer queues with the lowest load, thereby achieving load balancing of vCPU.
It effectively solves the problem of uneven load of vCPUs caused by hash conflict, improves the load balancing of multiple vCPUs in the virtual machine, and reduces the risk of packet loss.
Smart Images

Figure CN119449724B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to a method, device, cluster, product and storage medium for generating a forwarding table entry. Background Art
[0002] As is known to all, when forwarding multicast messages and / or unicast messages in a cloud network scenario, it is necessary to forward the received multicast messages and / or unicast messages to the virtual machine (VM) on the cloud server based on the virtual switch (VS) on the cloud server, and process them by the virtual central processing unit (vCPU) in the VM. There are multiple network cards in the above VM. In order to improve the message throughput of the VM, the multi-buffer queue function of the network card is usually enabled so that multiple vCPUs in the VM can process messages in each buffer queue in parallel. Then, when there are multiple vCPUs in the VM and the multiple vCPUs are used to process messages in different buffer queues, how to load balance the multiple vCPUs has become one of the key concerns in this field.
[0003] A common cloud network message forwarding method includes: VS calculates the hash value of the five-tuple of the received multicast message and / or unicast message based on the hash algorithm, and sends the messages corresponding to different hash values to different buffer queues in the VM, so that different vCPUs in the VM process the messages in different buffer queues.
[0004] However, the above hash algorithm has a hash conflict scenario, that is, the hash values of different five-tuples may be the same, so that multiple messages of different five-tuples are assigned to the same buffer queue, resulting in uneven vCPU load in the VM, and in severe cases, may cause message loss. Summary of the invention
[0005] The embodiments of the present application provide a method, device, cluster, product and storage medium for generating a forwarding table entry, which can improve the load balancing of multiple vCPUs in a virtual machine.
[0006] In order to achieve the above purpose, the embodiment of the present application adopts the following technical solution:
[0007] In a first aspect, an embodiment of the present application provides a method for generating a forwarding table entry, the method being applied to a virtual switch in a cloud server, the cloud server also comprising: at least one virtual machine, the virtual switch being used to forward messages to the at least one virtual machine; each of the at least one virtual machine comprising a plurality of buffer queues and a plurality of virtual processors vCPU corresponding to the plurality of buffer queues; wherein the vCPU corresponding to a buffer queue is used to process messages in the buffer queue; the method comprising: receiving a creation message, the creation message being used to request the creation of a forwarding table entry corresponding to a first play list entry; the first play list entry being used to indicate a message sent from a source end to a destination end; A message forwarding path; determining a first buffer queue based on load information of multiple buffer queues corresponding to a first output port of a first virtual machine; the first buffer queue is a buffer queue with the smallest load among the multiple buffer queues; the first virtual machine is a virtual machine among the at least one virtual machine to receive a first message sent to the destination; the first output port is a port in the first virtual machine for receiving the first message; binding the first buffer queue, the first output port and the first broadcast table entry, and generating a forwarding table entry corresponding to the first broadcast table entry in a first forwarding table; the forwarding table entry is used to indicate that the received first message is sent to the first buffer queue through the first output port.
[0008] The method for generating a forwarding table item provided in an embodiment of the present application is applied to a virtual switch in a cloud server. The method determines a first buffer queue with the smallest load from multiple buffer queues corresponding to a first egress port of a first virtual machine in response to a received creation message for requesting to create a forwarding table item corresponding to a first play list item; wherein the first play list item is used to indicate a forwarding path of a message sent from a source end to a destination end, and the first virtual machine is a virtual machine in at least one virtual machine in the above-mentioned cloud server that is to receive a first message sent to a destination end indicated by the first play list item; then, the first buffer queue, the first egress port and the above-mentioned first play list item are bound, and a forwarding table item corresponding to the first play list item is generated in a first forwarding table; so that after receiving the above-mentioned first message, the virtual switch can send the first message to the above-mentioned first buffer queue through the above-mentioned first egress port based on the forwarding table item corresponding to the first play list item. Since the first virtual machine includes multiple buffer queues and multiple vCPUs for processing messages in different buffer queues, and since the first playlist item is bound to the buffer queue with the smallest current load in the first virtual machine, the problem of uneven vCPU load in the virtual machine caused by hash conflicts is solved, thereby improving the load balancing of multiple vCPUs in the virtual machine.
[0009] In a possible implementation, when the first playlist entry is a multicast list entry, the receiving a creation message includes: receiving a creation message from a first egress port of the first virtual machine.
[0010] In a possible implementation, when the first playlist item is a unicast list item, the receiving of the creation message includes: receiving a control signaling from a cloud server, the control signaling carrying the creation message, the creation message also including: an identifier of the first output port.
[0011] In one possible implementation, the load information of the above-mentioned buffer queue includes: the load value of the buffer queue, or the message frequency of the buffer queue; wherein the load value of the buffer queue is used to indicate the sum of the bandwidths of the messages indicated by the forwarding table entries corresponding to the buffer queue; the message frequency of the buffer queue is used to indicate the number of messages sent to the buffer queue within a time period.
[0012] In one possible implementation, when the load information of the buffer queue includes: the load value of the buffer queue, the load information of multiple buffer queues corresponding to the first output port in the first virtual machine is used to determine the first buffer queue, including: obtaining the load value corresponding to each buffer queue in the multiple buffer queues; and determining the buffer queue with the smallest load value among the multiple buffer queues as the above-mentioned first buffer queue.
[0013] In a possible implementation, when the load information of the above-mentioned buffer queue includes: the message frequency of the buffer queue, the load information of the multiple buffer queues corresponding to the first output port in the first virtual machine is used to determine the first buffer queue, including: obtaining the message frequency of each buffer queue in the previous time period of the above-mentioned multiple buffer queues; and determining the buffer queue with the smallest message frequency in the previous time period among the multiple buffer queues as the first buffer queue.
[0014] In a possible implementation, when the load information of the above-mentioned buffer queue includes: the load value of the buffer queue, after binding the first buffer queue, the first output port and the first play table item, and generating a forwarding table item corresponding to the first play table item in the first forwarding table, the method also includes: obtaining a first load value corresponding to the first play table item; the first load value is used to indicate the actual bandwidth of the first message; and increasing the load value of the first buffer queue by the first load value.
[0015] In the embodiment of the present application, when the load information of the above-mentioned buffer queue includes the load value of the buffer queue, after binding the first buffer queue, the first output port and the first broadcast table item, and generating a forwarding table item corresponding to the first broadcast table item in the first forwarding table, the load value of the first buffer queue is increased by the first load value corresponding to the first broadcast table item, thereby ensuring the accuracy of the load values of multiple buffer queues corresponding to the first output port, and then improving the accuracy of the buffer queue with the smallest load determined from the multiple buffer queues, thereby improving the load balancing of multiple vCPUs in the virtual machine.
[0016] In a possible implementation, when the first load value is not obtained, the first load value is a preset default load value.
[0017] In a possible implementation, when the load information of the above-mentioned buffer queue includes: the message frequency of the buffer queue, after binding the first buffer queue, the first output port and the first broadcast table item, and generating the forwarding table item corresponding to the first broadcast table item in the first forwarding table, the method also includes: periodically obtaining the message frequency of each buffer queue in a time period in the multiple buffer queues in the first virtual machine.
[0018] In a possible implementation, after binding the first buffer queue, the first output port and the first play list item as described above, and generating a forwarding table item corresponding to the first play list item in the first forwarding table, the method further includes: receiving a deletion message; the deletion message is used to indicate deletion of the binding relationship between the first output port and the first play list item; and in response to the deletion message, deleting the binding relationship from the first forwarding table.
[0019] In the embodiment of the present application, when the load information of the above-mentioned buffer queue includes the load value of the buffer queue, after binding the first buffer queue, the first output port and the first broadcast table item, and generating a forwarding table item corresponding to the first broadcast table item in the first forwarding table, in response to a received deletion message indicating deletion of the binding relationship between the above-mentioned first output port and the first broadcast table item, the binding relationship between the first broadcast table item, the first output port and the first buffer queue is deleted from the first forwarding table; thereby, the accuracy of the multicast table item and / or the unicast table item bound to the buffer queue is guaranteed to a certain extent, thereby improving the accuracy of the load of the buffer queue.
[0020] In one possible implementation, when the load information of the above-mentioned buffer queue includes: the load value of the buffer queue, the method also includes: obtaining a first load value corresponding to the first play list item; the first load value is used to indicate the actual bandwidth of the above-mentioned first message; and subtracting the first load value from the load value of the first buffer queue.
[0021] In the embodiment of the present application, when the load information of the above-mentioned buffer queue includes the load value of the buffer queue, after deleting the binding relationship between the first broadcast table item, the first output port and the first buffer queue from the first forwarding table, the load value of the first buffer queue is subtracted from the first load value corresponding to the first broadcast table item, thereby ensuring the accuracy of the load values of multiple buffer queues corresponding to the first output port, thereby improving the accuracy of the buffer queue with the smallest load determined from the multiple buffer queues, and therefore improving the load balancing of multiple vCPUs in the virtual machine.
[0022] In a possible implementation, after binding the first buffer queue, the first output port and the first play list item as described above, and generating a forwarding table item corresponding to the first play list item in the first forwarding table, the method further includes: obtaining the first play list item from the received first message; determining the first output port and the first buffer queue corresponding to the first play list item from the first forwarding table; and sending the first message to the first buffer queue through the first output port.
[0023] The virtual switch in the embodiment of the present application obtains the first broadcast table item from the received first message, and determines the first output port and the first buffer queue corresponding to the first broadcast table item from the first forwarding table; then, the first message is sent to the first buffer queue through the first output port. Since the first virtual machine includes multiple buffer queues and multiple vCPUs for processing messages in different buffer queues, and since the first buffer queue is the buffer queue with the smallest load among the multiple buffer queues corresponding to the first output port when the first broadcast table item is bound to the first output port; therefore, the first message is sent to the first buffer queue through the first output port, which solves the problem of uneven load of vCPUs in the virtual machine caused by hash conflicts, thereby improving the load balancing of multiple vCPUs in the virtual machine.
[0024] In a possible implementation, before sending the first message to the first buffer queue through the first output port, the method also includes: obtaining load information of the first buffer queue; sending the first message to the first buffer queue through the first output port includes: when the load of the first buffer queue is less than a preset load, sending the first message to the first buffer queue through the first output port.
[0025] In one possible implementation, when the load of the above-mentioned first buffer queue is greater than the preset load, the method also includes: determining a second buffer queue based on the load information of multiple buffer queues corresponding to the first output port; the second buffer queue is the buffer queue with the smallest load among the current multiple buffer queues; updating the first buffer queue corresponding to the second play list item to the second buffer queue; the load of the updated first buffer queue is less than the preset load.
[0026] The embodiment of the present application obtains the first play list item from the received first message, and after determining the first output port and the second buffer queue corresponding to the first play list item from the first forwarding table item, obtains the load information of the first buffer queue; when the load of the first buffer queue is greater than the preset load, the buffer queue with the smallest current load among the multiple buffer queues corresponding to the first output port is determined as the second buffer queue; and the first buffer queue corresponding to the second play list item bound to the first buffer queue is updated to the above-mentioned second buffer queue, so that the load of the updated first buffer queue is less than the preset load, thereby avoiding the problem of load overload of the buffer queue, thereby improving the load balancing of multiple vCPUs in the virtual machine.
[0027] In one possible implementation, when the load information of the above-mentioned buffer queue includes: the load value of the buffer queue, the method also includes: obtaining a second load value corresponding to the above-mentioned second play list item; the second load value is used to indicate the actual bandwidth of the second message indicated by the second play list item; subtracting the second load value from the load value of the first buffer queue; and increasing the load value of the second buffer queue by the second load value.
[0028] In a possible implementation, the second play list entry is an entry indicating a message with the lowest message frequency among multiple entries bound to the first buffer queue.
[0029] The second broadcast table entry is the table entry with the lowest message frequency of the message indicated in the multiple table entries (such as unicast table entries and multicast table entries) bound to the first buffer queue; thereby, to a certain extent, avoiding the problem of disorder of the second messages caused by the first buffer queue receiving a part of the second messages and the second buffer queue receiving another part of the second messages in the process of updating the first buffer queue corresponding to the second broadcast table entry to the second buffer queue.
[0030] In a second aspect, an embodiment of the present application provides a device for generating a forwarding table entry, which is applied to a virtual switch in a cloud server, and the cloud server also includes: at least one virtual machine, the virtual switch is used to forward messages to the at least one virtual machine; each of the at least one virtual machine includes multiple buffer queues and multiple virtual processors vCPU corresponding to the multiple buffer queues; wherein the vCPU corresponding to a buffer queue is used to process messages in the one buffer queue; the generating device includes: a transceiver module, a processing module and a storage module; the transceiver module is used to receive a creation message, the creation message is used to request the creation of a forwarding table entry corresponding to a first play list item; the first play list item is used to Indicates a forwarding path for a message sent from a source end to a destination end; the processing module is used to determine a first buffer queue based on load information of multiple buffer queues corresponding to a first output port in a first virtual machine; the first buffer queue is a buffer queue with the smallest load among the multiple buffer queues; the first virtual machine is a virtual machine among the at least one virtual machine to receive a first message sent to a destination end; the first output port is a port in the first virtual machine for receiving the first message; a storage module is used to bind the first buffer queue, the first output port and the first broadcast table item, and generate a forwarding table item corresponding to the first broadcast table item in a first forwarding table; the forwarding table item is used to indicate that the received first message is sent to the first buffer queue through the first output port.
[0031] In a possible implementation, the transceiver module is configured to receive a create message from a first output port of the first virtual machine.
[0032] In a possible implementation, the transceiver module is used to receive control signaling from the cloud server, the control signaling carries a creation message, and the creation message also includes: an identifier of the first output port.
[0033] In one possible implementation, the load information of the buffer queue includes: the load value of the buffer queue, or the message frequency of the buffer queue; wherein the load value of the buffer queue is used to indicate the sum of the bandwidths of the messages indicated by the forwarding table entries corresponding to the buffer queue; and the message frequency of the buffer queue is used to indicate the number of messages sent to the buffer queue within a time period.
[0034] In a possible implementation, the transceiver module is used to obtain the load value corresponding to each buffer queue in the multiple buffer queues; the processing module is used to determine the buffer queue with the smallest load value in the multiple buffer queues as the first buffer queue.
[0035] In one possible implementation, the transceiver module is used to obtain the message frequency of each buffer queue in the last time period of multiple buffer queues; the processing module is used to determine the buffer queue with the smallest message frequency in the last time period among the multiple buffer queues as the first buffer queue.
[0036] In a possible implementation, the transceiver module is used to obtain a first load value corresponding to the first playlist item; the first load value is used to indicate an actual bandwidth of the first message; and the processing module is used to increase the load value of the first buffer queue by the first load value.
[0037] In a possible implementation, when the first load value is not obtained, the first load value is a preset default load value.
[0038] In a possible implementation, the transceiver module is used to periodically obtain a message frequency of each buffer queue in a time period in a plurality of buffer queues in the first virtual machine.
[0039] In a possible implementation, the transceiver module is used to receive a deletion message; the deletion message is used to indicate deletion of the binding relationship between the first output port and the first playlist item; the storage module is used to delete the binding relationship from the first forwarding table in response to the deletion message.
[0040] In a possible implementation, the transceiver module is used to obtain a first load value corresponding to the first playlist item; the first load value is used to indicate an actual bandwidth of the first message; and the processing module is used to subtract the first load value from the load value of the first buffer queue.
[0041] In one possible implementation, the transceiver module is used to obtain a first play list item from a received first message; the processing module is used to determine a first output port and a first buffer queue corresponding to the first play list item from a first forwarding table; and the transceiver module is used to send the first message to the first buffer queue through the first output port.
[0042] In a possible implementation, the transceiver module is used to obtain load information of the first buffer queue; the transceiver module is used to send the first message to the first buffer queue through the first egress port when the load of the first buffer queue is less than a preset load.
[0043] In one possible implementation, a processing module is used to determine a second buffer queue based on load information of multiple buffer queues corresponding to a first output port; the second buffer queue is the buffer queue with the smallest load among the current multiple buffer queues; a storage module is used to update the first buffer queue corresponding to the second play list item to the second buffer queue; the load of the updated first buffer queue is less than a preset load.
[0044] In one possible implementation, the transceiver module is used to obtain a second load value corresponding to the second play list item; the second load value is used to indicate the actual bandwidth of the second message indicated by the second play list item; the processing module is used to subtract the second load value from the load value of the first buffer queue; the processing module is used to increase the load value of the second buffer queue by the second load value.
[0045] In a possible implementation, the second play list entry is an entry indicating a message with the lowest message frequency among the multiple entries bound to the first buffer queue.
[0046] In a third aspect, the present application provides a computing device cluster, comprising at least one computing device, each computing device comprising a processor and a memory; the processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method described in the first aspect and any one of its possible implementations.
[0047] In a fourth aspect, the present application provides a computer-readable storage medium having computer instructions stored thereon. When the computer instructions are executed on a computing device, the computing device executes the method described in the first aspect above and any one of its possible implementations.
[0048] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the method described in the first aspect and any one of its possible implementations.
[0049] It should be understood that the beneficial effects achieved by the technical solutions of the second to fifth aspects of the present application and the corresponding possible implementation methods can be referred to the technical effects of the first aspect and its corresponding possible implementation methods mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 A schematic diagram of the structure of a cloud server provided in an embodiment of the present application;
[0051] Figure 2 A schematic diagram of the hardware structure of a computing device provided in an embodiment of the present application;
[0052] Figure 3 One of the flow charts of a method for generating a forwarding table entry provided in an embodiment of the present application;
[0053] Figure 4 A second flow chart of a method for generating a forwarding table entry provided in an embodiment of the present application;
[0054] Figure 5 A third flow chart of a method for generating a forwarding table entry provided in an embodiment of the present application;
[0055] Figure 6 A fourth flowchart of a method for generating a forwarding table entry provided in an embodiment of the present application;
[0056] Figure 7 A fifth flow chart of a method for generating a forwarding table entry provided in an embodiment of the present application;
[0057] Figure 8 A sixth flow chart of a method for generating a forwarding table entry provided in an embodiment of the present application;
[0058] Fig. 9 A seventh flowchart of a method for generating a forwarding table entry provided in an embodiment of the present application;
[0059] Fig.10 FIG8 is a flow chart of a method for generating a forwarding table entry provided in an embodiment of the present application;
[0060] Fig.11 A ninth flowchart of a method for generating a forwarding table entry provided in an embodiment of the present application;
[0061] Fig.12 A tenth flowchart of a method for generating a forwarding table entry provided in an embodiment of the present application;
[0062] Fig.13 A schematic diagram of the structure of a device for generating a forwarding table entry provided in an embodiment of the present application;
[0063] Fig.14 A schematic diagram of a computing device cluster provided in an embodiment of the present application;
[0064] Fig.15 A network connection diagram provided for an embodiment of the present application. DETAILED DESCRIPTION
[0065] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0066] The terms "first buffer queue" and "second buffer queue" in the description and claims of the embodiments of the present application are used to distinguish different buffer queues, rather than to describe a specific order of the buffer queues. For example, a first message and a second message are used to distinguish different messages, rather than to describe a specific order of the messages.
[0067] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0068] In the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" refers to two or more than two. For example, multiple buffer queues refer to two or more than two buffer queues.
[0069] A common cloud network message forwarding method includes: a VS receives a multicast message and / or a unicast message (referred to as: a target message); then, a hash value of a five-tuple of the target message is calculated based on a hash algorithm; thereafter, a first buffer queue is determined from multiple buffer queues in a VM according to the hash value, wherein there are multiple vCPUs in the VM, and the multiple vCPUs are used to process messages in different buffer queues; finally, the target message is sent to the first buffer queue of the VM.
[0070] However, the above hash algorithm has the possibility of hash conflict, that is, the hash values of different quintuples may be the same, so the buffer queues determined by multiple different quintuple messages may be the same, so that the messages of different quintuples are sent to the same buffer queue, resulting in uneven vCPU load in the VM, and in severe cases may cause message loss.
[0071] Based on this, an embodiment of the present application provides a method for generating a forwarding table entry, which is applied to a virtual switch in a cloud server. In the process of creating a forwarding table entry for multicast or unicast (referred to as: first broadcast), the method binds the first broadcast table entry, the first output port of the first virtual machine, and the first buffer queue with the smallest load among multiple buffer queues corresponding to the first output port, and generates a forwarding table entry corresponding to the first broadcast, so that the subsequent virtual switch sends the first message indicated by the received first broadcast to the first buffer queue through the first output port based on the forwarding table entry. Among them, the first virtual machine is a virtual machine to receive the first message; the first output port is a port in the first virtual machine for receiving the first message. Since the first virtual machine includes multiple buffer queues and multiple vCPUs for processing messages in different buffer queues, and since the first broadcast table entry is bound to the buffer queue with the smallest current load in the first virtual machine, the problem of uneven load of vCPUs in the virtual machine caused by hash conflicts is solved, thereby improving the load balancing of multiple vCPUs in the virtual machine.
[0072] A method for generating a forwarding table entry provided in an embodiment of the present application is applied to Figure 1 In the cloud server shown in FIG. 1 , the cloud server includes: a physical network card unit, a virtual switch, and at least one virtual machine. Figure 1 As shown, the at least one virtual machine includes: virtual machine A and virtual machine B. It should be understood that the at least one virtual machine may include one virtual machine or multiple virtual machines. The embodiment of the present application is described by taking the at least one virtual machine including virtual machine A and virtual machine B as an example, which will not be repeated later.
[0073] The virtual switch may be an open virtual switch (OVS) or an enhanced virtual switch (EVS) or other software modules having switch functions.
[0074] The physical network card unit is used to receive a multicast message sent by the virtual switch, wherein the multicast message includes information of a multicast table entry of the multicast; then, the multicast message is sent to a router outside the cloud server to create routing information corresponding to the multicast table entry in a routing table of the router. The physical network card unit is a software module in the physical network card in the cloud server.
[0075] The virtual machine can be used to send a report message for creating a target multicast forwarding table entry to the virtual switch through the port of the network card in the virtual machine; wherein a virtual machine includes at least one port, each port corresponds to at least one buffer queue, wherein each buffer queue corresponds to a vCPU among multiple vCPUs contained in the virtual machine, and the vCPU is used to process the messages cached in the corresponding buffer queue.
[0076] The following takes virtual machine A as an example:
[0077] When creating a forwarding table entry corresponding to multicast, the specific functions of the above-mentioned physical network card unit, virtual switch and virtual machine are as follows:
[0078] Virtual machine A sends a report message (i.e., a creation message or a multicast message) to the virtual switch through port A in virtual machine A to join a certain multicast; wherein the report message includes information for creating a multicast table entry (also known as a multicast identifier). In response to the above report message, the virtual switch determines the buffer queue with the smallest load (e.g., buffer queue 0) from the multiple buffer queues in virtual machine A; and binds the multicast table entry, port A of virtual machine A, and buffer queue 0, and generates a forwarding table entry corresponding to the multicast table entry indicated by the information of the multicast table entry in the report message in the multicast forwarding table; the forwarding table entry is used to indicate that the multicast message indicated by the multicast table entry is sent to buffer queue 0 through port A.
[0079] It should be noted that the above-mentioned report message includes information for creating a multicast table entry (also called: a multicast identifier), wherein the information of the multicast table entry includes: a multicast group, such as (*, Gn), or a multicast source group, such as (Sn, Gn); it can be seen that the information of the multicast table entry is used to indicate the multicast table entry; for the sake of ease of description, the embodiment of the present application simply refers to the information of the multicast table entry as a multicast table entry, which will not be repeated later.
[0080] In the present application, the types of multicast entries include: (*, Gn) or (Sn, Gn). The "*" in (*, Gn) indicates that the source address of the multicast message is an arbitrary address, and "Gn" indicates the destination address of the multicast message. For example, the multicast entry (*, G1) indicates that the multicast message from an arbitrary source address is a message sent to G1 (such as: 225.0.0.1). The "Sn" in (Sn, Gn) indicates the source address of the multicast message, and "Gn" indicates the destination address of the multicast message. For example, the "S2" in the multicast entry (S2, G2) indicates the source address of the multicast message of the (S2, G2) multicast, and "G2" indicates the destination address of the multicast message of the (S2, G2) multicast.
[0081] In the present application, port A is the port of the virtual network card in virtual machine A; wherein, the virtual machine A may include multiple virtual network cards or one virtual network card. Specifically, the embodiment of the present application does not limit the number of virtual network cards included in virtual machine A.
[0082] It should be understood that, in the case where there is one virtual network card in the virtual machine A, and the virtual network card has only one port (such as port A), the identifier of port A is used to indicate the virtual machine A; that is, the identifier of port A can be the identifier of the virtual machine A; for example, the identifier of port A is the index number or port number of the port of virtual machine A. In the case where there are multiple ports in the virtual machine A, the identifier of port A is used to indicate virtual machine A and port A in virtual machine A, such as the identifier of port A includes the identifier of virtual machine A and the port number of port A.
[0083] Similarly, the implementation method of virtual machine B sending a report message to join a multicast to the virtual switch through port B in virtual machine B is consistent with the implementation method of virtual machine A sending a report message to join a multicast to the virtual switch through port A, which will not be repeated here.
[0084] In the process of receiving multicast messages, the specific functions of the above-mentioned physical network card unit, virtual switch and virtual machine are as follows:
[0085] The physical network card unit receives a multicast message matching the (*, G1) multicast from an external device of the cloud server and sends the multicast message to the virtual switch. The virtual switch determines the multicast entry (*, G1) corresponding to the multicast message from the multicast message; then, from the multicast forwarding table, it determines the port A and buffer queue 0 corresponding to the multicast entry (*, G1); finally, the virtual switch sends the multicast message to buffer queue 0 through port A. The vCPU corresponding to buffer queue 0 in virtual machine A performs message processing on the message cached in buffer queue 0.
[0086] It should be noted that, for the convenience of description, the embodiment of the present application refers to the multicast message that matches the multicast entry as the multicast message of the multicast entry, which will not be described in detail later.
[0087] When creating a forwarding table entry corresponding to unicast, the specific functions of the above-mentioned physical network card unit, virtual switch and virtual machine are as follows:
[0088] The virtual switch receives control signaling sent by the control plane (e.g., cloud service controller) of the cloud server to instruct the creation of a forwarding table entry corresponding to a unicast for virtual machine A; wherein the control signaling message includes a unicast table entry (also called a unicast identifier) and an identifier of port A in virtual machine A that receives the unicast message. In response to the control signaling, the virtual switch determines the buffer queue with the smallest load (e.g., buffer queue 0) from among multiple buffer queues in virtual machine A; binds the unicast table entry, port A of virtual machine A, and buffer queue 0, and generates a forwarding table entry corresponding to the unicast table entry in the unicast forwarding table; the forwarding table entry is used to instruct the unicast message of the unicast table entry to be sent to buffer queue 0 through port A.
[0089] In the process of receiving unicast messages, the specific functions of the above-mentioned physical network card unit, virtual switch and virtual machine are similar to those of the above-mentioned physical network card unit, virtual switch and virtual machine in the process of receiving multicast, and will not be repeated here.
[0090] In the present application, a cloud server may be an independent computing device or a device cluster composed of multiple computing devices; taking the computing device as an example, the server may be a high-density server, a rack server or a whole cabinet server in terms of form; in terms of performance, it may be a general-purpose server, a GPU (graphics processing unit) server, or an artificial intelligence (AI) server; the specific embodiments of the present application do not limit the product form of the computing device.
[0091] For example, Figure 2 Can be Figure 1 The hardware structure diagram of a computing device of a cloud server in FIG. 2 is shown; the computing device may include: a processor 201, a memory 202, a communication interface 203, and a physical network card 204. The processor 201, the memory 202, the communication interface 203, and the physical network card 204 may be connected to each other via a bus 205, or in other ways.
[0092] The processor 201 includes one or more CPUs. The CPU may be a single-core CPU (single-CPU) or a multi-core CPU (multi-CPU). Optionally, the processor 201 may also include a graphics processing unit (GPU), a field-programmable gate array (FPGA), an application-specific integrated circuit (ASIC), etc.
[0093] The memory 202 includes, but is not limited to, a random access memory (RAM), a read only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, or an optical memory, a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store a desired program code in the form of an instruction, an operating system or a data structure and can be accessed by a computer. In the embodiment of the present application, the memory 202 can store information such as a multicast forwarding table and a unicast forwarding table.
[0094] In a possible implementation, the memory 202 may exist independently of the processor 201. The memory 202 may be connected to the processor 201 via a bus 205 for storing data, instructions, or program codes. When the processor 201 calls and executes the instructions or program codes stored in the memory 202, the relevant steps in the method for generating the forwarding table items provided in the embodiment of the present application can be implemented.
[0095] In another possible implementation, the memory 202 may also be integrated with the processor 201 .
[0096] The communication interface 203 may be a transceiver module, used to communicate with other devices or communication networks, such as Ethernet, RAN, wireless local area networks (WLAN), etc. The communication interface 203 may receive instructions, messages or data, etc.
[0097] Optionally, the communication interface 203 may also be a transceiver circuit located in the processor 201, for implementing signal input and signal output of the processor 201. The communication interface 203 may be a wired interface (port), such as a fiber distributed data interface (FDDI) or a gigabit Ethernet (GE) interface, or the communication interface 203 may also be a wireless interface.
[0098] The physical network card 204 includes, but is not limited to, a peripheral component interconnect (PCI) network card, a peripheral component interconnect express (PCIe) network card, and a universal serial bus (USB) network card. In the present application, the physical network card is used to receive unicast messages and / or multicast messages from an external device and send the message to a virtual switch in the cloud server; wherein the above-mentioned physical network card 204 includes Figure 1 The physical network card unit in.
[0099] The bus 205 may be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus may also be divided into a serial bus and a parallel bus. For ease of representation, Figure 2 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0100] It should be understood that Figure 2 The computing device in the example is only one example of a computing device, which may have Figure 2 More or fewer components shown in the figure may be combined with two or more components, or may have different component configurations. For example, the computing device may also include a smart network card, such as a data processing unit (DPU).
[0101] It should be noted that the system architecture and application scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field can know that with the evolution of the system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0102] The present application provides a method for generating a forwarding table entry, which is applied to Figure 1 The virtual switch in the cloud server shown in FIG. Figure 3 As shown, the method includes: S110-S130.
[0103] S110: Receive a creation message.
[0104] In the present application, the create message is used to request the creation of a forwarding table entry corresponding to the first playlist entry.
[0105] Among them, the first broadcast table item is used to indicate the forwarding path of the message sent from the source end to the destination end. In the present application, the first broadcast table item includes: a multicast table item or a unicast table item. Among them, the multicast table items of different multicasts are different; similarly, the unicast table items of different unicasts are different; that is, the multicast table item is a multicast identifier (or a multicast routing identifier) used to route a multicast message. The unicast table item is a unicast identifier (or a unicast routing identifier) used to route a unicast message. Among them, the multicast message may refer to a message sent from the source end to a multicast group, and the multicast group includes multiple receiving ends. The unicast message may refer to a message sent to a receiving end.
[0106] In the case that the first playlist entry is a multicast list entry, the type of the multicast list entry includes: (*, Gn) or (Sn, Gn).
[0107] For example, in the case where the first playlist entry is a multicast list entry, assuming that the multicast list entry is used to indicate that a message is sent to the address indicated by "225.0.0.1" (i.e., the multicast address); then, the first playlist entry is (*, 225.0.0.1). Furthermore, assuming that the multicast list entry is used to indicate that a message sent from the address indicated by "225.0.0.2" is sent to the address indicated by "225.0.0.1"; then, the first playlist entry is (225.0.0.2, 225.0.0.1).
[0108] In the case where the first playlist entry is a unicast list entry, the unicast list entry includes an Internet Protocol (IP) address or a Media Access Control (MAC) address; the IP address or the MAC address is used to indicate a destination address of the unicast message.
[0109] For example, if the first playlist entry is a unicast list entry, assuming that the unicast list entry is used to indicate that the message is sent to an address with an IP address of 192.168.1.3, then the first playlist entry is 192.168.1.3. Also assuming that the unicast list entry is used to indicate that the message is sent to an address with a MAC address of 00-16-EA-AE-3C-40, then the first playlist entry is 00-16-EA-AE-3C-40.
[0110] In the case that the first play list item is a multicast list item, the implementation method of the S110 includes: receiving the creation message from the first egress port of the first virtual machine.
[0111] In this application, the first virtual machine is Figure 1 The at least one virtual machine included in the cloud server shown is a virtual machine to receive a message (referred to as: first message) sent to the destination end indicated by the first playlist item; that is, the above-mentioned first virtual machine is a virtual machine to receive the first message indicated by the first playlist item among the above-mentioned at least one virtual machine.
[0112] In the present application, the first egress port is a port in the first virtual machine for receiving the first message; the first egress port may specifically be a port of a virtual network card in the first virtual machine.
[0113] In the case where the first play list item is a multicast list item, the creation message is a report message based on the Internet Group Management Protocol (IGMP), and the report message is used to instruct the first virtual machine to join the multicast indicated by the first play list item, or to create a forwarding table item corresponding to the first play list item; wherein the report message includes information used to indicate the first play list item, that is, the report message includes: the first play list item.
[0114] For the convenience of description, in the embodiment of the present application, since the information of the first groupcast table item is used to indicate the first play table item, for the convenience of description, the embodiment of the present application includes the information used to indicate the above-mentioned first play table item in the message, which is referred to as the first play table item included in the message, and will not be repeated later.
[0115] For the triggering condition for triggering the first virtual machine to send a report message to the virtual switch, refer to the related art and will not be described in detail here.
[0116] In the case that the first play list item is a unicast list item, the implementation method of the S110 includes: receiving a control signaling from a cloud server, the control signaling carrying the creation message; wherein the creation message also includes: an identifier of the first output port.
[0117] The control signaling is a signaling sent by the control plane (eg, cloud service controller) in the cloud server to the virtual switch.
[0118] The specific implementation method of the above S110 includes: receiving a control signaling sent by a control plane of the cloud server, and parsing the control signaling to obtain the above creation message.
[0119] S120: Determine a first buffer queue based on load information of multiple buffer queues corresponding to a first egress port in the first virtual machine.
[0120] Optionally, the first buffer queue is a buffer queue with the smallest load among multiple buffer queues corresponding to the first egress port.
[0121] It should be understood that in the embodiment of the present application, the buffer queue with the smallest load is a possible implementation method. It can also be a buffer queue with the second smallest load, or a buffer queue that meets preset conditions, or other buffer queues that can meet load balancing, etc., without limitation.
[0122] The buffer queues corresponding to different egress ports in the first virtual machine may be the same or different. Specifically, the embodiment of the present application does not specifically limit the buffer queues corresponding to different ports in the virtual machine.
[0123] In the present application, the load information of the buffer queue is used to indicate the load size of the buffer queue. Specifically, the load information of the buffer queue includes: the load value of the buffer queue, or the message frequency of the buffer queue.
[0124] In the present application, the load value of the buffer queue is used to indicate the sum of the bandwidths of the messages indicated by the forwarding table entries corresponding to the buffer queue; that is, the load value of the above-mentioned buffer queue is used to indicate the sum of the bandwidths of the multicast messages indicated by the multicast table entries bound to the buffer queue and the bandwidths of the unicast messages indicated by the unicast table entries bound to the buffer queue.
[0125] Exemplarily, assume that the multicast table entries bound to buffer queue 0 include: (*, G1) and (S2, G2); the unicast table entries bound to buffer queue 0 include: IP1 and MAC1. Among them, the bandwidth of the multicast message of the (*, G1) multicast is 100Mbps, the bandwidth of the multicast message of the (S2, G2) multicast is 200Mbps, the bandwidth of the unicast message of the IP1 unicast is 150Mbps, and the bandwidth of the unicast message of the MAC1 unicast is 50Mbps; then, the load value of buffer queue 0 is used to indicate a bandwidth of 500Mbps (i.e.: 100Mbps+200Mbps+150Mbps+50Mbps); specifically, the load value of the buffer queue 0 can be 5.
[0126] In the present application, the message frequency of a buffer queue is used to indicate the number of messages sent to the buffer queue within a time period. Specifically, the message frequency of the buffer queue can be the maximum value of the number of messages sent to the buffer queue within multiple sub-time intervals included in a time period; or it can be the average value of the number of messages sent to the buffer queue within a time period.
[0127] Exemplarily, assuming that the above time period is 20 seconds (s), wherein the buffer queue 0 receives 18 messages in the sub-time interval from 0s to 10s, and receives 22 messages in the sub-time interval from 10s to 20s; then, when the message frequency of the buffer queue 0 is the maximum value of the number of messages sent to the buffer queue 0 in the multiple sub-time intervals included in the time period, the message frequency of the buffer queue 0 is 22 messages / 10 seconds. When the message frequency of the buffer queue 0 is the average value of the number of messages sent to the buffer queue 0 in the time period, the message frequency of the buffer queue 0 is 2 messages / second.
[0128] In the case where the load information of the buffer queue includes: the load value of the buffer queue, the implementation of S120 is as follows: Figure 4 Shown are: S120A-S120B.
[0129] S120A: Obtain a load value corresponding to each buffer queue in a plurality of buffer queues corresponding to the first egress port.
[0130] After a buffer queue (such as buffer queue 0) among the multiple buffer queues corresponding to the first egress port is bound to a unicast / multicast entry, the virtual switch adds the load value corresponding to the unicast / multicast entry to the current load value of the buffer queue 0. The load value corresponding to the unicast / multicast entry is used to indicate the bandwidth of the message indicated by the unicast / multicast entry; that is, the load value of the buffer queue 0 is the sum of the load values corresponding to all entries bound to the buffer queue 0 (that is, all entries include unicast entries and multicast entries).
[0131] The implementation method of S120A may be to obtain the load value corresponding to each of the above buffer queues from the above virtual switch, or to obtain the load value of each buffer queue from other devices (such as: cloud server controller). The specific embodiment of the present application does not limit the implementation method of the above S120A.
[0132] S120B: Determine a buffer queue with the smallest load value among the multiple buffer queues as the first buffer queue.
[0133] Exemplarily, assume that the load value corresponding to each of the above-mentioned multiple buffer queues is as shown in Table 1 below: including 4 buffer queue numbers and the load values of the 4 buffer queues; among them, the load value corresponding to the buffer queue with buffer queue number 0 (abbreviated as: buffer queue 0) is 5, the load value corresponding to buffer queue 1 is 3, the load value corresponding to buffer queue 2 is 6, and the load value corresponding to buffer queue 3 is 10; then, since the load value corresponding to buffer queue 1 is the smallest, buffer queue 1 is determined as the above-mentioned first buffer queue.
[0134] Table 1
[0135]
[0136] In the case where the load information of the buffer queue includes: the message frequency of the buffer queue, the implementation of S120 is as follows: Figure 5 Shown include: S120a-S120b.
[0137] S120a. Obtain a message frequency in a previous time period of each of a plurality of buffer queues in the first virtual machine.
[0138] When the load information of the buffer queue includes: the message frequency of the buffer queue, the virtual switch periodically obtains the message frequency of each buffer queue in a time period in the multiple buffer queues in the first virtual machine, and caches the obtained message frequencies of different buffer queues.
[0139] In the present application, the previous time period is the time period closest to the current time; that is, the message frequency in the above-mentioned previous time period is the message frequency in the time period closest to the current time.
[0140] S120b: Determine the buffer queue with the smallest message frequency in the previous time period among the multiple buffer queues as the first buffer queue.
[0141] Exemplarily, assume that the message frequency of each buffer queue in the above-mentioned multiple buffer queues is as shown in Table 2 below; including 4 buffer queue numbers and the message frequencies of the 4 buffer queues; among them, the message frequency of the buffer queue with buffer queue number 0 (abbreviated as: buffer queue 0) is 3 messages per second, the message frequency of buffer queue 1 is 5 messages per second, the message frequency of buffer queue 2 is 10 messages per second, and the message frequency of buffer queue 3 is 8 messages per second; then, since the message frequency of buffer queue 0 is the smallest, buffer queue 0 is determined as the above-mentioned first buffer queue.
[0142] Table 2
[0143]
[0144] S130: Bind the first buffer queue, the first egress port, and the first playlist entry, and generate a forwarding entry corresponding to the first playlist entry in the first forwarding table.
[0145] The forwarding table entry corresponding to the first play table entry is used to indicate that the received first message is sent to the first buffer queue of the first virtual machine through the first egress port of the first virtual machine.
[0146] In the present application, the first forwarding table includes: a multicast forwarding table or a unicast forwarding table; wherein, when the above-mentioned first broadcast table item is a multicast table item, the above-mentioned first forwarding table is a multicast forwarding table; when the above-mentioned first broadcast table item is a unicast table item, the above-mentioned first forwarding table is a unicast forwarding table.
[0147] The implementation method of S130 is to add the binding relationship between the first buffer queue, the first output port and the first play list item in the first forwarding table. Specifically, when the first play list item is a multicast list item, the implementation method of S130 is referred to as S130A below; when the first play list item is a unicast list item, the implementation method of S130 is referred to as S130a below; it will not be repeated here.
[0148] The method for generating a forwarding table item provided in an embodiment of the present application is applied to a virtual switch in a cloud server. The method determines a first buffer queue with the smallest load from multiple buffer queues corresponding to a first egress port in a first virtual machine in response to a received creation message for requesting to create a forwarding table item corresponding to a first play list item; wherein the first play list item is used to indicate a forwarding path of a message sent from a source end to a destination end, and the first virtual machine is a virtual machine in at least one virtual machine in the above-mentioned cloud server that is to receive a first message sent to a destination end indicated by the first play list item; then, the first buffer queue, the first egress port and the above-mentioned first play list item are bound, and a forwarding table item corresponding to the first play list item is generated in a first forwarding table; so that after receiving the above-mentioned first message, the virtual switch can send the first message to the above-mentioned first buffer queue through the above-mentioned first egress port based on the forwarding table item corresponding to the first play list item. Since the first virtual machine includes multiple buffer queues and multiple vCPUs for processing messages in different buffer queues, and since the first playlist item is bound to the buffer queue with the smallest current load in the first virtual machine, the problem of uneven vCPU load in the virtual machine caused by hash conflicts is solved, thereby improving the load balancing of multiple vCPUs in the virtual machine.
[0149] In the case where the first playlist item is a multicast list item, based on Figures 3 to 5 ,like Figure 6 As shown, an embodiment of the present application provides an implementation method of S130, which includes: S130A.
[0150] S130A: Add the binding relationship among the first buffer queue, the first egress port and the first playlist entry in the multicast forwarding table.
[0151] In the present application, the binding relationship among the first buffer queue, the first egress port and the first playlist entry is used to represent the forwarding table entry corresponding to the first playlist entry.
[0152] In the case where the above-mentioned first broadcast table item exists in the above-mentioned multicast forwarding table, the implementation method of the above-mentioned S130A includes: adding a first binding relationship in the output port set corresponding to the first broadcast table item in the multicast forwarding table, and the first binding relationship is the binding relationship between the above-mentioned first buffer queue and the first output port; wherein, the output port set corresponding to a multicast table item includes the correspondence between all ports bound to the multicast table item and the buffer queues.
[0153] Exemplarily, assume that the multicast forwarding table includes: 2 multicast table entries and 2 egress port sets as shown in Table 3 below; the 2 multicast table entries include: (*, 225.0.0.1) and (225.0.0.2, 225.0.0.3); the 2 egress port sets include {port A + buffer queue 0} and {port A + buffer queue 1, port B + buffer queue 0}, and the "{}" symbol represents a set. Among them, the egress port set corresponding to (*, 225.0.0.1) is {port A + buffer queue 0}, and "port A + buffer queue 0" means sending to buffer queue 0 through port A. The egress port set corresponding to (225.0.0.2, 225.0.0.3) is {port A + buffer queue 1, port B + buffer queue 0}.
[0154] Assume that the first broadcast table entry is (*, 225.0.0.1), the first output port is port B, and the first buffer queue is buffer queue 1; then, since there is a multicast table entry (*, 225.0.0.1) in the multicast forwarding table, the binding relationship between port B and buffer queue 1 (i.e., port B+buffer queue 1) is added to the output port set corresponding to (*, 225.0.0.1), so that the output port set corresponding to (*, 225.0.0.1) after addition is as shown in Table 4 below: {port A+buffer queue 0, port B+buffer queue 1}.
[0155] Table 3
[0156]
[0157] Table 4
[0158]
[0159] In the case that the first play list entry does not exist in the multicast forwarding table, the implementation method of S130A includes: adding a correspondence between the first play list entry and the first binding relationship in the multicast forwarding table.
[0160] Exemplarily, based on the above example, the multicast forwarding table is shown in Table 3 above; assuming that the above first broadcast table item is (*, 225.0.0.4), the first output port is port A, and the first buffer queue is buffer queue 2; then, the correspondence between (*, 225.0.0.4) and port A and buffer queue 2 is added to the multicast table, and the multicast forwarding table shown in Table 5 below is obtained, which includes the binding relationship between (*, 225.0.0.4), port A and buffer queue 2.
[0161] Table 5
[0162]
[0163] In the embodiment of the present application, when the first play list item is a multicast list item, in response to a received creation message for requesting to create a forwarding table item corresponding to the first play list item, a first buffer queue with the smallest load is determined from multiple buffer queues corresponding to a first egress port in a first virtual machine; wherein the first play list item is used to indicate a forwarding path of a message sent from a source end to a destination end, and the first virtual machine is a virtual machine in at least one virtual machine in the above-mentioned cloud server that is to receive a first message (i.e., a multicast message) sent to the destination end indicated by the first play list item; then, the first buffer queue, the first egress port and the above-mentioned first play list item are bound, and a forwarding table item corresponding to the first play list item is generated in a multicast forwarding table; so that after receiving the above-mentioned first message, the virtual switch can send the first message to the above-mentioned first buffer queue through the above-mentioned first egress port based on the forwarding table item corresponding to the first play list item. Since the first virtual machine includes multiple buffer queues and multiple vCPUs for processing messages in different buffer queues, and since the first playlist item is bound to the buffer queue with the smallest current load in the first virtual machine, the problem of uneven vCPU load in the virtual machine caused by hash conflicts is solved, thereby improving the load balancing of multiple vCPUs in the virtual machine.
[0164] In the case where the first playlist item is a unicast item, based on Figures 3 to 5 ,like Figure 7 As shown, an embodiment of the present application provides a method for implementing S130, which includes: S130a.
[0165] S130a: Add the binding relationship among the first buffer queue, the first egress port and the first playlist entry in the unicast forwarding table.
[0166] It should be understood that unicast refers to a one-to-one transmission mode, that is, a point-to-point transmission mode, so a unicast entry in the unicast forwarding table corresponds to only a binding relationship between a port and a buffer queue.
[0167] Exemplarily, assuming that the unicast forwarding table is as shown in Table 6 below, the unicast forwarding table includes: 2 unicast table entries and 2 port binding relationships, the port binding relationship is the binding relationship between the port and the buffer queue; the 2 unicast table entries include: 192.168.1.3 and 192.168.1.4; the 2 port binding relationships include: port A + buffer queue 0 and port B + buffer queue 1. Among them, the unicast table entry 192.168.1.3 corresponds to port A + buffer queue 0 (that is, binding); the unicast table entry 192.168.1.4 corresponds to port B + buffer queue 1.
[0168] Assume that the first broadcast table item is 192.168.1.5, the first output port is port C, and the first buffer queue is buffer queue 2; then, the binding relationship between the first broadcast table item 192.168.1.5, port C, and buffer queue 2 is added to the unicast forwarding table to obtain the unicast forwarding table shown in Table 7, which includes the binding relationship between the first broadcast table item 192.168.1.5 and port C+buffer queue 2.
[0169] Table 6
[0170]
[0171] Table 7
[0172]
[0173] In the embodiment of the present application, when the first play list item is a unicast list item, in response to a received creation message for requesting to create a forwarding table item corresponding to the first play list item, a first buffer queue with the smallest load is determined from multiple buffer queues corresponding to a first egress port in a first virtual machine; wherein the first play list item is used to indicate a forwarding path of a message sent from a source end to a destination end, and the first virtual machine is a virtual machine in at least one virtual machine in the above-mentioned cloud server that is to receive a first message (i.e., a unicast message) sent to the destination end indicated by the first play list item; then, the first buffer queue, the first egress port and the above-mentioned first play list item are bound, and a forwarding table item corresponding to the first play list item is generated in a unicast forwarding table; so that after receiving the above-mentioned first message, the virtual switch can send the first message to the above-mentioned first buffer queue through the above-mentioned first egress port based on the forwarding table item corresponding to the first play list item. Since the first virtual machine includes multiple buffer queues and multiple vCPUs for processing messages in different buffer queues, and since the first playlist item is bound to the buffer queue with the smallest current load in the first virtual machine, the problem of uneven vCPU load in the virtual machine caused by hash conflicts is solved, thereby improving the load balancing of multiple vCPUs in the virtual machine.
[0174] It should be understood that, in the case where the load information of the above-mentioned buffer queue is the message frequency of the buffer queue, after the above-mentioned S130, the first message indicated by the first broadcast table item will be sent to the first buffer queue based on the forwarding table item, and then the message frequency of the first buffer queue will increase accordingly. However, in the case where the load information of the above-mentioned buffer queue is the load value of the buffer queue, since the load value of the buffer queue is the sum of the bandwidths of the messages indicated by the table items (unicast and / or multicast) bound to the buffer queue; and although the above-mentioned S130 generates a forwarding table item corresponding to the first broadcast table item in the first forwarding table, it does not perform an update operation on the load value of the first buffer queue, so although the first buffer queue adds the first broadcast table item bound to it, the load value of the first buffer queue does not change, resulting in a low accuracy of the load value of the first buffer queue.
[0175] Based on this, in the case where the load information of the buffer queue includes the load value of the buffer queue, based on Figure 3 , Figure 4 , Figure 6 or Figure 7 ,like Figure 8 As shown, after S130, the method for generating a forwarding table entry provided in the embodiment of the present application further includes: S210-S220.
[0176] S210: Obtain a first load value corresponding to a first playlist item.
[0177] The first load value corresponding to the first playlist item is used to indicate the actual bandwidth of the first message; the first load value may be the actual bandwidth of the first message, or it may be a value after the actual bandwidth of the first message is processed based on a preset algorithm (such as: reduced by N times according to a preset ratio). The specific embodiment of the present application does not specifically limit the first load value.
[0178] For ease of description, the embodiment of the present application is described by taking the first play list item as a multicast list item as an example, which will not be described in detail later.
[0179] S210 is implemented by: determining a first load value corresponding to the first multicast list item from a preset relationship between the multicast list item and the load value.
[0180] Exemplarily, it is assumed that the preset relationship is as shown in Table 8 below, including: 3 multicast entries and 3 load values; the 3 multicast entries include: (*, 225.0.0.1), (225.0.0.2, 225.0.0.3) and (*, 225.0.0.4); the 3 load values include: 2, 1, 3. Among them, the load value corresponding to the multicast entry (*, 225.0.0.1) is 2, the load value corresponding to the multicast entry (225.0.0.2, 225.0.0.3) is 1, and the load value corresponding to the multicast entry (*, 225.0.0.4) is 3.
[0181] Then, when the first playlist item is (*, 225.0.0.1), the first load value is 2; when the first playlist item is (225.0.0.2, 225.0.0.3), the first load value is 1; when the first playlist item is (*, 225.0.0.4), the first load value is 3.
[0182] Table 8
[0183]
[0184] Optionally, when the first load value is not obtained (that is, when the first play list entry does not exist in the multicast forwarding table), a preset default load value is used as the first load value.
[0185] S220: Increase the load value of the first buffer queue by a first load value.
[0186] Exemplarily, assume that the load value of the first buffer queue is 3; and further assume that the first load value is 2; then, the load value 3 of the first buffer queue is increased by the first load value 2, and the updated load value of the first buffer queue is 5.
[0187] In the embodiment of the present application, when the load information of the above-mentioned buffer queue includes the load value of the buffer queue, after binding the first buffer queue, the first output port and the first broadcast table item, and generating a forwarding table item corresponding to the first broadcast table item in the first forwarding table, the load value of the first buffer queue is increased by the first load value corresponding to the first broadcast table item, thereby ensuring the accuracy of the load values of multiple buffer queues corresponding to the first output port, and then improving the accuracy of the buffer queue with the smallest load determined from the multiple buffer queues, thereby improving the load balancing of multiple vCPUs in the virtual machine.
[0188] Above Figures 3 to 8A scheme for binding a first playlist entry to a first buffer queue to generate a forwarding entry corresponding to the first playlist entry in a first forwarding table is introduced. Subsequently, there is also a scenario of deleting the entry (i.e., multicast entry and / or unicast entry) bound to the first buffer queue. In this scenario, the above method is as follows: Fig. 9 As shown, after the above S130, it also includes: S310-S320.
[0189] S310: Receive a deletion message.
[0190] In the present application, the deletion message is used to indicate deletion of the binding relationship between the first output port and the first playlist entry.
[0191] In the case where the above-mentioned first play list item is a multicast list item, the above-mentioned deletion message is a leave message based on the Internet Group Management Protocol (IGMP) sent by the first virtual machine to the above-mentioned virtual switch through the first output port, and the leave message is used to indicate the deletion of the binding relationship between the above-mentioned first output port and the first play list item; wherein, the leave message includes the above-mentioned first play list item.
[0192] For the triggering condition for triggering the first virtual machine to send a leave message to the virtual switch, refer to the related art and will not be described in detail here.
[0193] Optionally, the leave message further includes an identifier of the first buffer queue and / or an identifier of the first egress port.
[0194] The implementation method of S310 includes: receiving a leave message sent by the first virtual machine through the first egress port.
[0195] In the case that the first playlist item is a unicast item, the implementation method of S310 includes: receiving a control signaling from a cloud server, the control signaling carrying the deletion message; wherein the deletion message also includes: the first playlist item.
[0196] In this application, control signaling is the signaling sent by the control plane in the above-mentioned cloud server (such as: cloud service controller) to the virtual switch.
[0197] In the present application, the specific implementation method of S310 includes: receiving the control signaling sent by the control plane of the cloud server, and parsing the control signaling to obtain the above-mentioned deletion message.
[0198] S320: In response to the deletion message, delete the binding relationship among the first playlist entry, the first egress port, and the first buffer queue from the first forwarding table.
[0199] The implementation of S320 includes: when the first play list item is a multicast list item, deleting the binding relationship from the multicast forwarding table; when the first play list item is a unicast list item, deleting the binding relationship from the unicast forwarding table.
[0200] In the embodiment of the present application, when the load information of the above-mentioned buffer queue includes the load value of the buffer queue, after binding the first buffer queue, the first output port and the first broadcast table item, and generating a forwarding table item corresponding to the first broadcast table item in the first forwarding table, in response to a received deletion message indicating deletion of the binding relationship between the above-mentioned first output port and the first broadcast table item, the binding relationship between the first broadcast table item, the first output port and the first buffer queue is deleted from the first forwarding table; thereby, the accuracy of the multicast table item and / or the unicast table item bound to the buffer queue is guaranteed to a certain extent, thereby improving the accuracy of the load of the buffer queue.
[0201] It should be understood that in the scenario of deleting the table entries bound to the first buffer queue (i.e., multicast table entries and / or unicast table entries), although the above S310-S320 deletes the forwarding table entries corresponding to the first broadcast table entries in the first forwarding table, it does not perform an update operation on the load value of the first buffer queue. Therefore, although the first buffer queue reduces the first broadcast table entry bound to it, the load value of the first buffer queue does not change, resulting in a lower accuracy of the load value of the first buffer queue; subsequently, in order to reduce the load value of the first buffer queue, it is also necessary to subtract the load value corresponding to the first broadcast table entry from the load value of the first buffer queue.
[0202] Based on this, in one implementation, when the load information of the buffer queue is the load value, as shown in FIG. Fig.10 As shown, after the above S320, the following steps are also included: S330-S340.
[0203] S330: Obtain a first load value corresponding to the first playlist item.
[0204] The implementation method of S330 is consistent with that of S210. For the specific description of S330, reference may be made to the above-mentioned description of S210, which will not be repeated here.
[0205] S340. Subtract the first load value from the load value of the first buffer queue.
[0206] Exemplarily, assume that the load value of the first buffer queue is 5; and further assume that the first load value is 2; then, the load value of the first buffer queue is subtracted from the first load value 2 to obtain an updated load value of 3 for the first buffer queue.
[0207] In the embodiment of the present application, when the load information of the above-mentioned buffer queue includes the load value of the buffer queue, after deleting the binding relationship between the first broadcast table item, the first output port and the first buffer queue from the first forwarding table, the load value of the first buffer queue is subtracted from the first load value corresponding to the first broadcast table item, thereby ensuring the accuracy of the load values of multiple buffer queues corresponding to the first output port, thereby improving the accuracy of the buffer queue with the smallest load determined from the multiple buffer queues, and therefore improving the load balancing of multiple vCPUs in the virtual machine.
[0208] It should be understood that the above embodiment introduces a scheme for creating a forwarding table entry corresponding to the first play list item and a scheme for deleting the forwarding table entry corresponding to the first play list item; subsequently, there is also a scheme for sending the message indicated by the first table item to the first buffer queue bound to the first play list item during the message transmission process, and the specific scheme is as follows:
[0209] based on Figures 3 to 10 ,like Fig.11 As shown, after the above S130, the method for generating a forwarding table entry provided in the embodiment of the present application further includes: S410-S430.
[0210] S410: Obtain a first playlist item from a received first message.
[0211] The implementation of S410 includes: obtaining a destination address of the first message (hereinafter referred to as the first destination address), and then determining an entry in the first forwarding table whose destination address is the first destination address as the first play table entry.
[0212] Exemplarily, assume that the destination address of the first message is 225.0.0.1; and assume that the first forwarding table is as shown in Table 5 above; then, since the destination address of the multicast table entry (*, 225.0.0.1) included in the multicast table entry in Table 5 is 225.0.0.1, the multicast table entry (*, 225.0.0.1) is determined as the above-mentioned first multicast table entry.
[0213] S420: Determine a first egress port and a first buffer queue corresponding to a first playlist entry from the first forwarding table.
[0214] Exemplarily, based on the example in S410 above, the first broadcast table entry is the (*, 225.0.0.1) multicast table entry; port A corresponding to the (*, 225.0.0.1) multicast table entry in the first forwarding table is determined as the above-mentioned first egress port, and the buffer queue 0 corresponding to the (*, 225.0.0.1) multicast table entry is determined as the above-mentioned first buffer queue.
[0215] S430: Send the first message to the first buffer queue through the first egress port.
[0216] The virtual switch in the embodiment of the present application obtains the first broadcast table item from the received first message, and determines the first output port and the first buffer queue corresponding to the first broadcast table item from the first forwarding table; then, the first message is sent to the first buffer queue through the first output port. Since the first virtual machine includes multiple buffer queues and multiple vCPUs for processing messages in different buffer queues, and since the first buffer queue is the buffer queue with the smallest load among the multiple buffer queues corresponding to the first output port when the first broadcast table item is bound to the first output port; therefore, the first message is sent to the first buffer queue through the first output port, which solves the problem of uneven load of vCPUs in the virtual machine caused by hash conflicts, thereby improving the load balancing of multiple vCPUs in the virtual machine.
[0217] It should be understood that during the message transmission process, the actual bandwidth or message frequency of some service flows (i.e., some multicast messages of multicast and / or some unicast messages of unicast) is variable, which may cause the buffer queue bound to the service flow to be overloaded, and in severe cases, the buffer queue may lose some traffic. Based on this, during the message transmission process, the load of the overloaded buffer queue needs to be re-scheduled, as follows:
[0218] based on Fig.11 , the present application embodiment provides a specific implementation method, such as Fig.12 The method shown includes: S510-S570.
[0219] S510: Obtain a first playlist item from a received first message.
[0220] S520: Determine a first egress port and a first buffer queue corresponding to a first playlist entry from the first forwarding table.
[0221] The implementation method of the above S510-S520 is consistent with the implementation method of the above S410-S420. For the specific description of S510-S520, please refer to the above related description of S410-S420, which will not be repeated here.
[0222] S530: Obtain load information of the first buffer queue.
[0223] In the present application, the load information of the first buffer queue includes: the load value of the first buffer queue, or the message frequency of the first buffer queue.
[0224] In the present application, the load value and message frequency of the buffer queue in S530 are the same as the load value and message frequency of the buffer queue in the above-mentioned S120. For details, please refer to the relevant description in S120, which will not be repeated here.
[0225] The implementation method of S530 includes: determining the load information corresponding to the first buffer queue from the corresponding relationship between the buffer queue and the load information.
[0226] Exemplarily, assuming that the correspondence between the buffer queue and the load information is as shown in Table 2 above, when the load information of the above-mentioned first buffer queue includes: the message frequency of the first buffer queue, assuming that the first buffer queue is a buffer queue with a buffer queue number of 2 (abbreviated as: buffer queue 2), then the message frequency of the first buffer queue is 10.
[0227] S540: Determine whether the load of the first buffer queue is less than a preset load.
[0228] In the present application, the preset load is the critical value of the load overload of the first buffer queue. That is to say, when the load of the first buffer queue is greater than the preset load, the first buffer queue may lose messages; when the load of the first buffer queue is less than the preset load, the first buffer queue can cache messages normally.
[0229] When the load of the first buffer queue is less than the preset load, the following S570 is executed.
[0230] When the load of the first buffer queue is greater than the preset load, the following S550 - S570 are executed.
[0231] When the load of the first buffer queue is equal to the preset load, the virtual switch executes any step of S550 or S570 below. Specifically, the embodiment of the present application does not limit the actions executed by the virtual switch when the load of the first buffer queue is equal to the preset load.
[0232] S550: Determine a second buffer queue based on load information of multiple buffer queues corresponding to the first egress port.
[0233] The second buffer queue is a buffer queue with the smallest load among the multiple buffer queues corresponding to the current first egress port.
[0234] The implementation method of S550 is consistent with that of S120. For the specific description of S550, reference may be made to the above-mentioned description of S120, which will not be repeated here.
[0235] S560: Update the first buffer queue corresponding to the second playlist item to the second buffer queue; the load of the updated first buffer queue is less than the preset load.
[0236] In the present application, the multicast table entry or the unicast table entry bound to the first buffer queue includes the second play table entry.
[0237] The implementation of S560 includes: releasing the binding relationship between the second playlist item and the first buffer queue, and binding the second playlist item to the second buffer queue.
[0238] Exemplarily, based on the example in S530, the above-mentioned first buffer queue is buffer queue 2, and the message frequency of the first buffer queue is 10; since the message frequency 3 of buffer queue 0 (that is, the buffer queue with buffer queue number 0) is less than the message frequencies of buffer queues 1 to 3, buffer queue 0 is determined as the second buffer queue.
[0239] Assume that the second broadcast table entry is the (*, 225.0.0.4) multicast table entry, and the port corresponding to the (*, 225.0.0.4) multicast table entry is port A; then, release the binding relationship between the (*, 225.0.0.4) multicast table entry and port A and buffer queue 2; bind port A and buffer queue 0 to the (*, 225.0.0.4) multicast table entry; so that the virtual switch sends the second message indicated by the received second broadcast table entry to buffer queue 0 through port A.
[0240] Optionally, the second broadcast table entry is the table entry with the lowest message frequency of the message indicated among the multiple tables (such as unicast tables and multicast tables) bound to the first buffer queue; thereby, to a certain extent, avoiding the problem of disorder of the second messages caused by the first buffer queue receiving a part of the second messages and the second buffer queue receiving another part of the second messages in the process of updating the first buffer queue corresponding to the second broadcast table entry to the second buffer queue.
[0241] When the load information of the buffer queue includes the message frequency of the buffer queue, after the first buffer queue corresponding to the second playlist item is updated to the second buffer queue, the second message indicated by the second playlist item will no longer be sent to the first buffer queue, thereby reducing the load of the first buffer queue.
[0242] In the case where the load information of the buffer queue includes the load value of the buffer queue, after the above S560, it also includes: obtaining a second load value corresponding to the second playlist item; the second load value is used to indicate the actual bandwidth of the second message indicated by the second playlist item; then, the load value of the first buffer queue is subtracted from the second load value, and the load value of the second buffer queue is increased by the second load value. The specific implementation method thereof is referred to the following S210-S220 and S330, which will not be repeated here.
[0243] S570: Send the first message to the first buffer queue through the first egress port.
[0244] The implementation method of S570 is consistent with that of S430. For the specific description of S570, please refer to the above description of S430, which will not be repeated here.
[0245] The embodiment of the present application obtains the first play list item from the received first message, and after determining the first output port and the second buffer queue corresponding to the first play list item from the first forwarding table item, obtains the load information of the first buffer queue; when the load of the first buffer queue is greater than the preset load, the buffer queue with the smallest current load among the multiple buffer queues corresponding to the first output port is determined as the second buffer queue; and the first buffer queue corresponding to the second play list item bound to the first buffer queue is updated to the above-mentioned second buffer queue, so that the load of the updated first buffer queue is less than the preset load, thereby avoiding the problem of load overload of the buffer queue, thereby improving the load balancing of multiple vCPUs in the virtual machine.
[0246] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to achieve the above functions, the generation device of the forwarding table item includes a hardware structure and / or software module corresponding to the execution of each function. Those skilled in the art should be easily aware that, in conjunction with the units and algorithm steps of each example described in the embodiment disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0247] The embodiment of the present application can be based on the above method, and the generation device of the forwarding table item can be divided into functional modules exemplarily. For example, the generation device of the forwarding table item can include each functional module corresponding to each functional division, and two or more functions can also be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional module. It should be noted that the division of modules in the embodiment of the present application is schematic, which is only a logical function division, and there can be other division methods when actually implemented.
[0248] In the case of dividing each functional module into corresponding functional modules, Fig.13 A possible structural diagram of a device for generating a forwarding table entry involved in the above embodiment is shown; the device for generating a forwarding table entry is deployed at Figure 1 The virtual switch in the cloud server is shown in Figure 1. Fig.13 As shown, the device for generating the forwarding table entry includes: a transceiver module 1301 , a processing module 1302 and a storage module 1303 .
[0249] The transceiver module 1301 is used to receive a creation message; for example, to execute step S110 in the above method embodiment.
[0250] The processing module 1302 is used to determine the first buffer queue based on the load information of the multiple buffer queues corresponding to the first egress port in the first virtual machine; for example, execute step S120 in the above method embodiment.
[0251] The storage module 1303 is used to bind the first buffer queue, the first egress port and the first playlist entry, and generate a forwarding entry corresponding to the first playlist entry in the first forwarding table; for example, executing step S130 in the above method embodiment.
[0252] Optionally, the transceiver module 1301 is configured to receive a create message from a first output port of the first virtual machine.
[0253] Optionally, the transceiver module 1301 is used to receive control signaling from a cloud server, where the control signaling carries a creation message.
[0254] Optionally, the load information of the buffer queue includes: the load value of the buffer queue, or the message frequency of the buffer queue; wherein the load value of the buffer queue is used to indicate the sum of the bandwidths of the messages indicated by the forwarding table entries corresponding to the buffer queue; the message frequency of the buffer queue is used to indicate the number of messages sent to the buffer queue within a time period.
[0255] Optionally, the transceiver module 1301 is used to obtain a load value corresponding to each buffer queue in a plurality of buffer queues corresponding to the first egress port; for example, executing step S120A in the above method embodiment.
[0256] The processing module 1302 is used to determine the buffer queue with the smallest load value among the multiple buffer queues as the first buffer queue; for example, execute step S120B in the above method embodiment.
[0257] Optionally, the transceiver module 1301 is used to obtain the message frequency of each buffer queue in the multiple buffer queues in the first virtual machine in the previous time period; for example, executing step S120a in the above method embodiment.
[0258] The processing module 1302 is used to determine the buffer queue with the smallest message frequency in the previous time period among the multiple buffer queues as the first buffer queue; for example, execute step S120b in the above method embodiment.
[0259] Optionally, the transceiver module 1301 is configured to obtain a first load value corresponding to a first playlist item; for example, executing step S210 in the above method embodiment.
[0260] The processing module 1302 is used to increase the load value of the first buffer queue by a first load value; for example, executing step S220 in the above method embodiment.
[0261] Optionally, when the first load value is not obtained, the first load value is a preset default load value.
[0262] Optionally, the message frequency of each buffer queue in a time period in a plurality of buffer queues in the first virtual machine is periodically obtained.
[0263] Optionally, the transceiver module 1301 is used to receive a deletion message; for example, executing step S310 in the above method embodiment.
[0264] The storage module 1303 is used to delete the binding relationship between the first playlist entry, the first egress port and the first buffer queue from the first forwarding table in response to the deletion message; for example, executing step S320 in the above method embodiment.
[0265] Optionally, the transceiver module 1301 is configured to obtain a first load value corresponding to a first playlist item; for example, executing step S330 in the above method embodiment.
[0266] The processing module 1302 is used to subtract the first load value from the load value of the first buffer queue; for example, executing step S340 in the above method embodiment.
[0267] Optionally, the transceiver module 1301 is configured to obtain a first playlist item from a received first message; for example, executing step S410 in the above method embodiment.
[0268] The processing module 1302 is used to determine the first egress port and the first buffer queue corresponding to the first play list entry from the first forwarding table; for example, executing step S420 in the above method embodiment.
[0269] The transceiver module 1301 is used to send the first message to the first buffer queue through the first output port; for example, execute step S430 in the above method embodiment.
[0270] Optionally, the transceiver module 1301 is used to obtain the load information of the first buffer queue; for example, executing step S530 in the above method embodiment.
[0271] The transceiver module 1301 is used to send the first message to the first buffer queue through the first egress port when the load of the first buffer queue is less than a preset load; for example, execute steps S540 and S570 in the above method embodiment.
[0272] Optionally, the processing module 1302 is used to determine the second buffer queue based on the load information of the multiple buffer queues corresponding to the first egress port; for example, executing step S550 in the above method embodiment.
[0273] The storage module 1303 is used to update the first buffer queue corresponding to the second playlist item to the second buffer queue; the load of the updated first buffer queue is less than the preset load; for example, step S560 in the above method embodiment is executed.
[0274] Optionally, the transceiver module 1301 is configured to obtain a second load value corresponding to the second playlist item.
[0275] The processing module 1302 is configured to subtract a second load value from the load value of the first buffer queue; and increase the load value of the second buffer queue by the second load value.
[0276] Optionally, the second play list entry is an entry indicating a message with the lowest message frequency among multiple entries bound to the first buffer queue.
[0277] Among them, the transceiver module 1301, the processing module 1302 and the storage module 1303 can all be implemented by software, or can be implemented by hardware. Exemplarily, the implementation of the processing module 1302 is introduced below by taking the processing module 1302 as an example. Similarly, the implementation of the transceiver module 1301 and the storage module 1303 can refer to the implementation of the processing module 1302.
[0278] As an example of a software functional unit, the processing module 1302 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the computing instance may be one or more. For example, the processing module 1302 may include code running on multiple hosts / virtual machines / containers.
[0279] It should be noted that the multiple hosts / virtual machines / containers used to run the code can be distributed in the same region or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code can be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple data centers with close geographical locations. Generally, a region can include multiple AZs.
[0280] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.
[0281] As an example of a hardware functional unit, the processing module 1302 may include at least one computing device, such as a server, etc. Alternatively, the processing module 1302 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0282] The multiple computing devices included in the processing module 1302 can be distributed in the same region or in different regions. The multiple computing devices included in the processing module 1302 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the processing module 1302 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0283] It should be noted that, in other embodiments, the processing module 1302 can be used to execute any step in the method for generating the above-mentioned forwarding table items, the transceiver module 1301 can be used to execute any step in the method for generating the above-mentioned forwarding table items, and the storage module 1303 can be used to execute any step in the method for generating the above-mentioned forwarding table items. The steps that the processing module 1302, the transceiver module 1301, and the storage module 1303 are responsible for implementing can be specified as needed, and the processing module 1302, the transceiver module 1301, and the storage module 1303 respectively implement different steps in the method for generating the above-mentioned forwarding table items to realize all the functions of the management device.
[0284] The embodiment of the present application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.
[0285] like Fig.14 As shown, the computing device cluster includes at least one computing device 100. The memory 106 in one or more computing devices 100 in the computing device cluster may store the same instructions for executing the above-mentioned method for generating forwarding table entries.
[0286] In some possible implementations, the memory 106 of one or more computing devices 100 in the computing device cluster may also store partial instructions for executing the method for generating the forwarding table entries. In other words, the combination of one or more computing devices 100 may jointly execute instructions for executing the method for generating the forwarding table entries.
[0287] It should be understood that the processor and bus in the computing device 100 are similar to Figure 2 The processor 201 and bus 205 in the computing device 100 are consistent. For a detailed description of the processor and bus in the computing device 100, see Figure 2 The relevant description will not be repeated here.
[0288] It should be noted that the memory 106 in different computing devices 100 in the computing device cluster can store different instructions, which are respectively used to execute part of the functions of the management device. That is, the instructions stored in the memory 106 in different computing devices 100 can implement the functions of one or more modules in the processing module 1302, the transceiver module 1301 and the storage module 1303.
[0289] In some possible implementations, one or more computing devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network. Fig.15 A possible implementation is shown. Fig.15 As shown, two computing devices 100A and 100B are connected via a network. Specifically, the network is connected via a communication interface in each computing device. In this type of possible implementation, the memory 106 in the computing device 100A stores instructions for executing the functions of the processing module 1302. At the same time, the memory 106 in the computing device 100B stores instructions for executing the functions of the transceiver module 1301 and the storage module 1303.
[0290] Fig.15The connection method between the computing device clusters shown may be that considering that the method for generating the forwarding table items provided in the present application requires frequent acquisition and transmission of data, it is considered that the functions implemented by the storage module 1303 and the transceiver module 1301 are handed over to the computing device 100B for execution.
[0291] It should be understood that Fig.15 The functions of the computing device 100A shown in FIG. 1 may also be completed by multiple computing devices 100. Similarly, the functions of the computing device 100B may also be completed by multiple computing devices 100.
[0292] The present application embodiment also provides another computing device cluster. The connection relationship between the computing devices in the computing device cluster can be similar to that of Fig.14 and Fig.15 The connection mode of the computing device cluster is different in that the memory 106 in one or more computing devices 100 in the computing device cluster may store the same instructions for executing the method for generating forwarding table entries.
[0293] In some possible implementations, the memory 106 of one or more computing devices 100 in the computing device cluster may also store partial instructions for executing the method for generating forwarding table entries. In other words, the combination of one or more computing devices 100 may jointly execute instructions for executing the method for generating forwarding table entries.
[0294] The embodiment of the present application also provides a computer program product comprising instructions. The computer program product may be software or a program product comprising instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device is caused to execute a method for generating a forwarding table entry.
[0295] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by the computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute a method for generating a forwarding table entry.
[0296] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for generating a forwarding table entry, characterized in that: The method is applied to a virtual switch in a cloud server, wherein the cloud server further includes: at least one virtual machine, the virtual switch is used to forward messages to the at least one virtual machine; each of the at least one virtual machine includes a plurality of buffer queues and a plurality of virtual processors vCPUs corresponding to the plurality of buffer queues; wherein the vCPU corresponding to a buffer queue is used to process messages in the buffer queue; the method includes: receiving a creation message, wherein the creation message is used to request the creation of a forwarding table entry corresponding to a first playlist entry; the first playlist entry is used to indicate a forwarding path of a message sent from a source end to a destination end; Determine a first buffer queue based on load information of multiple buffer queues corresponding to a first egress port in a first virtual machine; the first buffer queue is a buffer queue with the smallest load among the multiple buffer queues; the first virtual machine is a virtual machine to be used to receive a first message sent to the destination end among the at least one virtual machine; the first egress port is a port in the first virtual machine for receiving the first message; The first buffer queue, the first egress port and the first play table entry are bound, and a forwarding entry corresponding to the first play table entry is generated in a first forwarding table; the forwarding entry is used to indicate that the received first message is sent to the first buffer queue through the first egress port.
2. The method according to claim 1, characterized in that In the case that the first play list item is a multicast list item, the receiving a creation message includes: The create message is received from the first egress port of the first virtual machine.
3. The method according to claim 1, characterized in that In the case that the first play list item is a unicast list item, the receiving a creation message includes: A control signaling is received from the cloud server, where the control signaling carries the creation message, and the creation message further includes: an identifier of the first output port.
4. The method according to claim 1, characterized in that: The load information of the buffer queue includes: the load value of the buffer queue, or the message frequency of the buffer queue; The load value of the buffer queue is used to indicate the sum of the bandwidths of the messages indicated by the forwarding table entries corresponding to the buffer queue; The message frequency of the buffer queue is used to indicate the number of messages sent to the buffer queue within a time period.
5. The method according to claim 4, characterized in that In a case where the load information of the buffer queue includes: a load value of the buffer queue, determining the first buffer queue based on the load information of the plurality of buffer queues corresponding to the first egress port in the first virtual machine includes: Obtaining a load value corresponding to each buffer queue in the multiple buffer queues; A buffer queue with the smallest load value among the multiple buffer queues is determined as the first buffer queue.
6. The method according to claim 4, characterized in that In a case where the load information of the buffer queue includes: a message frequency of the buffer queue, determining the first buffer queue based on the load information of the plurality of buffer queues corresponding to the first egress port in the first virtual machine includes: Obtaining the message frequency of each buffer queue in the last time period of the multiple buffer queues; A buffer queue having the smallest message frequency in the last time period among the multiple buffer queues is determined as the first buffer queue.
7. The method according to any one of claims 4 to 6, characterized in that: In a case where the load information of the buffer queue includes: a load value of the buffer queue, after binding the first buffer queue, the first egress port, and the first play list item, and generating the forwarding table item corresponding to the first play list item in the first forwarding table, the method further includes: Acquire a first load value corresponding to the first playlist item; the first load value is used to indicate an actual bandwidth of the first message; The load value of the first buffer queue is increased by the first load value.
8. The method according to claim 7, characterized in that When the first load value is not obtained, the first load value is a preset default load value.
9. The method according to any one of claims 4 to 6, characterized in that: In a case where the load information of the buffer queue includes: the message frequency of the buffer queue, after binding the first buffer queue, the first egress port, and the first play list item, and generating the forwarding table item corresponding to the first play list item in the first forwarding table, the method further includes: Periodically obtain the message frequency of each buffer queue in a time period in the multiple buffer queues in the first virtual machine.
10. The method according to any one of claims 4 to 6, characterized in that: After binding the first buffer queue, the first egress port, and the first play list item, and generating the forwarding table item corresponding to the first play list item in the first forwarding table, the method further includes: receiving a deletion message; the deletion message is used to indicate deletion of the binding relationship between the first output port and the first playlist item; In response to the deletion message, the binding relationship is deleted from the first forwarding table.
11. The method according to claim 10, characterized in that In the case where the load information of the buffer queue includes: a load value of the buffer queue, the method further includes: Acquire a first load value corresponding to the first playlist item; the first load value is used to indicate an actual bandwidth of the first message; The first load value is subtracted from the load value of the first buffer queue.
12. The method according to any one of claims 4 to 6, characterized in that: After binding the first buffer queue, the first egress port, and the first play list item, and generating the forwarding table item corresponding to the first play list item in the first forwarding table, the method further includes: Acquire the first playlist item from the received first message; Determine the first output port and the first buffer queue corresponding to the first play list item from the first forwarding table; Send the first message to the first buffer queue through the first egress port.
13. The method according to claim 12, characterized in that Before sending the first message to the first buffer queue through the first egress port, the method further includes: Obtaining load information of the first buffer queue; The sending the first message to the first buffer queue through the first egress port includes: When the load of the first buffer queue is less than a preset load, the first message is sent to the first buffer queue through the first egress port.
14. The method according to claim 13, characterized in that When the load of the first buffer queue is greater than the preset load, the method further includes: Determine a second buffer queue based on load information of multiple buffer queues corresponding to the first egress port; the second buffer queue is a buffer queue with the smallest load among the multiple buffer queues; The first buffer queue corresponding to the second playlist item is updated to the second buffer queue; the load of the updated first buffer queue is less than the preset load.
15. The method according to claim 14, characterized in that In the case where the load information of the buffer queue includes: a load value of the buffer queue, the method further includes: Acquire a second load value corresponding to the second play list item; the second load value is used to indicate an actual bandwidth of the second message indicated by the second play list item; Subtract the second load value from the load value of the first buffer queue; The load value of the second buffer queue is increased by the second load value.
16. The method according to claim 14 or 15, characterized in that The second broadcast table entry is a table entry indicating a message with the lowest message frequency among the multiple table entries bound to the first buffer queue.
17. A device for generating a forwarding table entry, characterized in that: The generating device is applied to a virtual switch in a cloud server, and the cloud server further includes: at least one virtual machine, the virtual switch is used to forward messages to the at least one virtual machine; each of the at least one virtual machine includes a plurality of buffer queues and a plurality of virtual processors vCPU corresponding to the plurality of buffer queues; wherein the vCPU corresponding to a buffer queue is used to process messages in the buffer queue; the generating device includes: a transceiver module, a processing module and a storage module; The transceiver module is used to receive a creation message, wherein the creation message is used to request the creation of a forwarding table entry corresponding to a first playlist entry; the first playlist entry is used to indicate a forwarding path of a message sent from a source end to a destination end; The processing module is used to determine the first buffer queue based on the load information of multiple buffer queues corresponding to the first egress port in the first virtual machine; the first buffer queue is the buffer queue with the smallest load among the multiple buffer queues; the first virtual machine is a virtual machine to receive the first message sent to the destination end among the at least one virtual machine; the first egress port is a port in the first virtual machine for receiving the first message; The storage module is used to bind the first buffer queue, the first output port and the first play table item, and generate a forwarding table item corresponding to the first play table item in the first forwarding table; the forwarding table item is used to indicate that the received first message is sent to the first buffer queue through the first output port.
18. A computing device cluster, characterized in that: comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 16.
19. A computer-readable storage medium, characterized in that: Computer instructions are stored, and when the computer instructions are executed on a computing device, the computing device is caused to execute the method according to any one of claims 1 to 16.
20. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device cluster, the computing device cluster executes the method according to any one of claims 1 to 16.
Citation Information
Patent Citations
Multicast message forwarding method and device
CN105429881A
Message processing method and network equipment
CN110677358A
Method and device for sending message
CN114666276A