Method, device, equipment and computer-readable storage medium for transmitting messages
By obtaining and controlling the second VSW to publish overhead information greater than the first VSW, establishing neighbor relationships and exchanging routing information, and using VIRTIO and DPDK lock-free queues to replace the VSW, the packet loss problem during the virtual switch update process is solved and the message transmission efficiency is improved.
Patent Information
- Application Number
- CN202011196928.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-31
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2040-10-31
AI Technical Summary
During the virtual switch (VSW) update process, especially when switching multiple NICs and a large amount of routing information, the existing technology causes a long packet loss time, affecting the message transmission effect.
By acquiring the second VSW and controlling it to publish overhead information greater than the first VSW, a neighbor relationship and exchange routing information are established. At the same time, the VSW is replaced without interrupting message transmission, and the VIRTIO queue and DPDK lock-free queue are used to replace the upstream and downstream message flows.
This shortens the packet loss time during the VSW update process, reduces the packet loss rate during message transmission, and improves transmission efficiency.
Smart Images

Figure CN114531351B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a method, apparatus, device, and computer-readable storage medium for transmitting a message. Background Art
[0002] With the advancement of communication technology, a growing number of methods are being developed for transmitting messages between different communication devices. One such method is to transmit messages through a virtual machine (VM) or point of deployment (POD) installed on a physical communication device. In this method, the VM / POD communicates with the target communication device via a virtual switch (VSW) on the physical communication device, enabling message transmission. In practical applications, VSWs are often updated periodically. Ensuring the transmission quality of messages during these VSW updates is a pressing issue.
[0003] In the related art, the network interface controller (NIC) corresponding to the old version of the VSW is first disconnected, causing the communication connection between the VM / POD and the target communication device to be severed, and packet loss begins. Subsequently, a new version of the VSW is established, and the aforementioned NIC is assigned to it. The new version of the VSW is then able to establish a neighbor relationship with the target communication device and exchange routing information based on this established neighbor relationship, thereby reestablishing the communication connection between the VM / POD and the target communication device, and the packet loss process ends. Therefore, the packet loss time in the related art is the sum of the time required to establish the new version of the VSW, switch the NIC, establish a neighbor relationship between the new version of the VSW and the target communication device, and exchange routing information.
[0004] However, when at least one of the following situations occurs: a large number of NICs needing to be switched or a large amount of routing information is involved, the methods provided by the related art also experience a long packet loss period during the VSW update process. Consequently, this results in a high packet loss rate during message transmission, affecting the message transmission effect. Summary of the Invention
[0005] The embodiments of the present application provide a method, apparatus, device, and computer-readable storage medium for transmitting a message to solve the problems provided by related technologies. The technical solutions are as follows:
[0006] In a first aspect, a method for transmitting a message is provided, the method comprising:
[0007] First, a second VSW is obtained, corresponding to the first VSW used to forward the message flow corresponding to the target communication device. The second VSW is then controlled to publish second overhead information for the message flow forwarded by the second VSW. The second overhead information is greater than the first overhead information used by the first VSW to forward the message flow. While the first VSW is forwarding the message flow, the second VSW is controlled to establish a neighbor relationship with the target communication device and exchange routing information based on this established neighbor relationship. Next, the first VSW is replaced with the second VSW as the VSW used to forward the message flow.
[0008] After obtaining a second VSW to replace the first VSW, the target communication device selects the first VSW as the VSW to forward the message flow from the first and second VSWs by controlling the second VSW to publish second overhead information that is greater than the first overhead information required by the first VSW to forward the message flow. Therefore, the second VSW can establish a neighbor relationship and exchange routing information while the first VSW forwards the message flow without packet loss. After the second VSW establishes a neighbor relationship and exchanges routing information, the first VSW is replaced by the second VSW. Because the process of establishing a neighbor relationship and exchanging routing information by the second VSW in this embodiment does not cause packet loss, the packet loss time during the VSW update process is shortened, reducing the packet loss rate during message transmission.
[0009] In one possible implementation, replacing the VSW used to forward the message flow from the first VSW to the second VSW includes: replacing the VSW used to forward the uplink message flow from the first VSW to the second VSW through the first virtual interface VIRTIO queue, wherein the uplink message flow is a message flow sent to the target communication device, and the first VIRTIO queue includes the uplink message flow.
[0010] In one possible implementation, the VSW used to forward the upstream message flow is replaced by the second VSW from the first VSW through the first virtual interface VIRTIO queue, including: when the virtual interface corresponding to the second VSW is in a closed state, the control agent prohibits the second VSW from reading the first VIRTIO queue; controls the second VSW to open the virtual interface in the closed state; the control agent prohibits the first VSW from reading the first VIRTIO queue, and controls the second VSW to read the first VIRTIO queue, and the second VSW is used to forward the upstream message flow read from the first VIRTIO queue through the virtual interface in the open state.
[0011] In one possible implementation, replacing the VSW used to forward the message flow from the first VSW to the second VSW also includes: replacing the VSW used to forward the downstream message flow from the first VSW to the second VSW through the data table development kit DPDK lock-free queue and the second VIRTIO queue, wherein the downstream message flow is the message flow sent by the target communication device.
[0012] In one possible implementation, the VSW used to forward the downstream message flow is replaced by the second VSW from the first VSW through the data table development kit DPDK lock-free queue and the second VIRTIO queue, including: controlling the first VSW to write the downstream message flow received by the first VSW into the DPDK lock-free queue, and controlling the second VSW to write the downstream message flow received by the second VSW into the DPDK lock-free queue; controlling the agent to read the DPDK lock-free queue and write the read downstream message flow into the second VIRTIO queue; controlling the second VSW to publish third overhead information, the third overhead information is less than the first overhead information, and the third overhead information is used for the target communication device to use the second VSW as the VSW for forwarding the downstream message flow in the first VSW and the second VSW.
[0013] In one possible implementation, after controlling the second VSW to publish the third overhead information, the method further includes: controlling the agent to prohibit the first VSW from writing the downstream message flow received by the first VSW into the DPDK lock-free queue and the second VIRTIO queue; and controlling the second VSW to update the downstream message flow received by the second VSW from writing into the DPDK lock-free queue to writing into the second VIRTIO queue.
[0014] In a possible implementation, after the control agent prohibits the first VSW from writing the downlink message flow received by the first VSW into the DPDK lock-free queue, the method further includes: deleting the first VSW.
[0015] In one possible implementation, the control agent reads the DPDK lock-free queue and writes the read downstream message flow into the second VIRTIO queue, including: determining a message flow volume of the downstream message flow in the DPDK lock-free queue; and based on the message flow volume not exceeding a flow threshold, the control agent writes the read downstream message flow into the second VIRTIO queue through an interrupt.
[0016] In a possible implementation, the method further includes: based on the message flow volume being greater than a flow threshold, the control agent writes the read downstream message flow into the second VIRTIO queue in a polling manner.
[0017] In a possible implementation, the method further includes: controlling the agent to obtain driver information through negotiation; controlling the second VSW to obtain the driver information from the agent, where the driver information is used by the second VSW to forward the message flow.
[0018] In a second aspect, a device for transmitting a message is provided, the device comprising:
[0019] an acquisition module, configured to acquire a second VSW corresponding to the first virtual switch VSW, the first VSW being configured to forward a message flow corresponding to a target communication device, wherein overhead information of the message flow forwarded by the first VSW is first overhead information;
[0020] A control module, configured to control the second VSW to publish second overhead information of the second VSW forwarding message flow, where the second overhead information is greater than the first overhead information;
[0021] The control module is further configured to control the second VSW to establish a neighbor relationship with the target communication device during the process of forwarding the message flow by the first VSW, and to exchange routing information based on the established neighbor relationship;
[0022] The replacement module is used to replace the VSW used to forward the message flow from the first VSW to the second VSW.
[0023] In one possible implementation, the replacement module is used to replace the VSW used to forward an uplink message flow from the first VSW to the second VSW through the first virtual interface VIRTIO queue, wherein the uplink message flow is a message flow sent to a target communication device, and the first VIRTIO queue includes the uplink message flow.
[0024] In one possible implementation, the replacement module is used to control the agent to prohibit the second VSW from reading the first VIRTIO queue when the virtual interface corresponding to the second VSW is in a closed state; control the second VSW to open the virtual interface in the closed state; control the agent to prohibit the first VSW from reading the first VIRTIO queue, and control the second VSW to read the first VIRTIO queue, and the second VSW is used to forward the uplink message flow read from the first VIRTIO queue through the virtual interface in the open state.
[0025] In one possible implementation, the replacement module is further used to replace the VSW used to forward the downlink message flow from the first VSW to the second VSW through the data table development kit DPDK lock-free queue and the second VIRTIO queue, wherein the downlink message flow is the message flow sent by the target communication device.
[0026] In one possible implementation, the replacement module is used to control the first VSW to write the downstream message flow received by the first VSW into the DPDK lock-free queue, and control the second VSW to write the downstream message flow received by the second VSW into the DPDK lock-free queue; control the agent to read the DPDK lock-free queue, and write the read downstream message flow into the second VIRTIO queue; control the second VSW to publish third overhead information, the third overhead information is less than the first overhead information, and the third overhead information is used for the target communication device to use the second VSW as the VSW for forwarding the downstream message flow in the first VSW and the second VSW.
[0027] In one possible implementation, the control module is further configured to control the agent to prohibit the first VSW from writing the downstream message flow received by the first VSW into the DPDK lock-free queue and the second VIRTIO queue; and to control the second VSW to update the downstream message flow received by the second VSW from writing into the DPDK lock-free queue to writing into the second VIRTIO queue.
[0028] In a possible implementation, the apparatus further includes: a deleting module, configured to delete the first VSW.
[0029] In one possible implementation, a replacement module is configured to determine a packet flow rate of a downstream packet flow in a DPDK lock-free queue; based on the packet flow rate not exceeding a flow threshold, the control agent writes the read downstream packet flow to a second VIRTIO queue through an interrupt.
[0030] In a possible implementation, the replacement module is further configured to control the agent to write the read downstream message flow into the second VIRTIO queue in a polling manner based on the message flow volume being greater than the flow threshold.
[0031] In a possible implementation, the control module is further configured to control the agent to negotiate and obtain driver information; and control the second VSW to obtain the driver information from the agent, where the driver information is used by the second VSW to forward the message flow.
[0032] In a third aspect, a device for transmitting a message is provided, comprising: a transceiver, a memory, and a processor. The transceiver, the memory, and the processor communicate with each other via an internal connection path. The memory is configured to store instructions, and the processor is configured to execute the instructions stored in the memory to control the transceiver to receive signals and to control the transceiver to transmit signals. When the processor executes the instructions stored in the memory, the processor performs the method according to the first aspect or any possible implementation of the first aspect.
[0033] Optionally, there are one or more processors and one or more memories.
[0034] Optionally, the memory may be integrated with the processor, or the memory may be provided separately from the processor.
[0035] In the specific implementation process, the memory can be a non-transitory memory, such as a read-only memory (ROM), which can be integrated with the processor on the same chip or can be set on different chips. The embodiments of the present application do not limit the type of memory and the setting method of the memory and the processor.
[0036] In a fourth aspect, a computer program (product) is provided. The computer program (product) includes: computer program code, which, when executed by a computer, enables the computer to execute the methods in the above aspects.
[0037] In a fifth aspect, a computer-readable storage medium is provided, which stores a program or instruction. When the program or instruction runs on a computer, the methods in the above aspects are executed.
[0038] In a sixth aspect, a chip is provided, comprising a processor for calling and executing instructions stored in a memory, so that a communication device equipped with the chip executes the methods in the above aspects.
[0039] In the seventh aspect, another chip is provided, including: an input interface, an output interface, a processor and a memory, the input interface, the output interface, the processor and the memory are connected through an internal connection path, the processor is used to execute the code in the memory, and when the code is executed, the processor is used to execute the methods in the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 A schematic diagram of an implementation environment provided for an embodiment of the present application;
[0041] Figure 2 A schematic diagram of an implementation environment provided for an embodiment of the present application;
[0042] Figure 3 A flowchart of a method for transmitting a message provided in an embodiment of the present application;
[0043] Figure 4 A schematic diagram of a message transmission process provided in an embodiment of the present application;
[0044] Figure 5 A schematic diagram of proxy negotiation provided in an embodiment of the present application;
[0045] Figure 6 A schematic diagram of the structure of a Vring provided in an embodiment of the present application;
[0046] Figure 7 A schematic diagram of a flow chart of an uplink replacement process provided in an embodiment of the present application;
[0047] Figure 8 A schematic diagram of a downlink replacement process provided in an embodiment of the present application;
[0048] Figure 9 A schematic diagram of a DPDK lock-free queue provided in an embodiment of the present application;
[0049] Figure 10 A schematic diagram of the structure of a device for transmitting a message provided in an embodiment of the present application;
[0050] Figure 11 A schematic diagram of the structure of a communication device provided in an embodiment of the present application;
[0051] Figure 12 A schematic diagram of the structure of a communication device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] The terms used in the implementation section of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.
[0053] With the advancement of communication technology, different communication devices can now transmit messages via VMs or PODs. A physical communication device (host) is equipped with a VM / POD and a virtual switch (VSW). The VM / POD and the target communication device are each connected to the VSW. The VSW can be used to forward messages, enabling message transmission between the VM / POD and the target communication device, or, more accurately, between the physical communication device and the target communication device. In actual use, the VSW is periodically updated as needed, and this update process often results in packet loss.
[0054] For example, the VSW update process provided by related art is as follows: First, the NIC corresponding to the old version of the VSW is disconnected, which causes the communication connection between the VM / POD and the target communication device to be severed, and packet loss begins. Then, a new version of the VSW is established, and the NIC corresponding to the old version of the VSW is assigned to the new version of the VSW. The new version of the VSW can then establish a neighbor relationship with the target communication device and exchange routing information based on this established neighbor relationship, thereby reestablishing the communication connection between the VM / POD and the target communication device, and the packet loss process ends. Therefore, the packet loss time in related art is the sum of the time required to establish the new version of the VSW, switch the NIC, establish a neighbor relationship between the new version of the VSW and the target communication device, and exchange routing information.
[0055] When the amount of routing information is large, exchanging routing information also takes a long time. For example, when the amount of routing information is in the millions, exchanging routing information can take tens of seconds. When a large number of NICs need to be switched, switching NICs also takes a long time. Therefore, when at least one of the following situations occurs: a large amount of routing information or a large number of NICs, the packet loss time in the related art will be longer. This increases the packet loss rate during message transmission, affecting the message transmission effect. Therefore, how to shorten the packet loss time and reduce the packet loss rate during the VSW update process is an urgent problem to be solved by those skilled in the art.
[0056] See also Figure 1 , the embodiment of the present application provides a method for transmitting a message, which can be applied to Figure 1 In the implementation environment shown. Figure 1 In the embodiment, a physical communication device 101 and a target communication device 102 are included. The physical communication device 101 includes a VM / POD, a VSW, a NIC, and a client. The VM / POD communicates with the VSW via a virtual input / output (Virtio) interface, and the VSW also communicates with the target communication device 102 via the NIC. The VSW is used to forward messages sent by the VM / POD to the target communication device 102, and forward messages sent by the target communication device 102 to the VM / POD. In addition, the VSW is also connected to the client, so that the client can control the VSW to implement the method for transmitting messages provided in this embodiment.
[0057] For example, in Figure 1 Based on the implementation environment shown, the physical communication device 101 also includes an agent. Figure 2 , the agent communicates with the VSW, VM / POD, and client respectively. The role played by the agent in this embodiment will be described in detail in the method embodiment and will not be repeated here. In addition, the target communication device 102 includes but is not limited to a provider edge (PE) device. In this case, illustratively, the NIC communicates with the target communication device 102 via top of rack (TOR) wiring or a route reflector (RR).
[0058] based on Figure 1 and Figure 2 The embodiment of the present application provides a method for transmitting a message. Taking the method as an example, see Figure 3, the method includes the following process.
[0059] 301. Obtain a second VSW corresponding to a first VSW, where the first VSW is used to forward a message flow corresponding to a target communication device, and overhead information of the message flow forwarded by the first VSW is first overhead information.
[0060] The first VSW is a VSW in a message flow forwarding state, and the message flow includes multiple data packets. Exemplarily, the first VSW being in a message flow forwarding state means that the first VSW is forwarding a data packet in the message flow to the target communication device or VM / POD. Alternatively, the first VSW has finished forwarding a data packet and will start forwarding another data packet after a certain period of time, that is, the first VSW is in the forwarding interval between two data packets. In this embodiment, the first VSW first publishes appropriate first overhead information, so that when the target communication device needs to transmit a message with the physical communication device where the first VSW is located, it selects the first VSW as the VSW for forwarding the message flow based on the first overhead information. After the target communication device completes the selection, the first VSW can enter the message flow forwarding state.
[0061] The message flow forwarded by the first VSW is the message flow corresponding to the target communication device. The first VSW forwards the message flow through the NIC on the physical communication device where the first VSW is located. The message flow corresponding to the target communication device includes at least one of an uplink message flow and a downlink message flow. The uplink message flow refers to the message flow with the VM / POD as the sending end and the target communication device as the receiving end. For example, see Figure 4 In 401, after receiving the uplink message flow sent by the VM / POD, the first VSW forwards the uplink message flow to the target communication device through NIC1 and NIC2. Accordingly, the downlink message flow refers to the message flow with the target communication device as the sending end and the VM / POD as the receiving end. Figure 4 In step 401, the first VSW first receives the downlink message flow sent by the target communication device through NIC1 and NIC2, and then forwards the downlink message flow to the VM / POD. It can be understood that Figure 4 The NIC1 and NIC2 shown in the figure are only examples, and this embodiment does not limit the number of NICs corresponding to the first VSW. Figure 4 In addition to the two NICs shown in FIG, the first VSW can also correspond to three, four or more NICs.
[0062] The second VSW corresponding to the first VSW is used to replace the first VSW. The process of replacing the first VSW with the second VSW is called a VSW update process. In this embodiment, the process of obtaining the second VSW includes: establishing a second VSW instance on the physical communication device where the first VSW resides; obtaining a configuration file; and configuring the second VSW instance based on the configuration information in the configuration file, thereby obtaining the second VSW corresponding to the first VSW.
[0063] Among them, the first VSW occupies the central processing unit (CPU) and memory of the physical communication device where the first VSW is located to ensure the normal operation of the first VSW itself. In this embodiment, the above-mentioned second VSW instance shares the CPU and memory occupied by the first VSW with the first VSW, so that the second VSW can also operate normally. Exemplarily, the memory of the physical communication device adopts a paged memory mechanism, that is, the memory is divided into multiple memory pages for management and use, thereby avoiding waste of memory space. Considering that a large number of memory pages may affect the efficiency of memory use, this embodiment can also further adopt a huge page (hugepage) memory mechanism on the basis of the paged memory mechanism. The difference between the paged memory mechanism and the huge page memory mechanism lies in the size of the memory page. For example, the size of the memory page in the paged memory mechanism is about 4 kilobytes (KB), while the size of the memory page in the huge page memory mechanism is about 4 megabytes (MB).
[0064] In addition, the configuration information included in the configuration file may be different in different business scenarios. For example, the configuration information includes, but is not limited to: the maximum cost information corresponding to the second VSW, the loopback interface information that the second VSW can call, the Internet Protocol (IP) address information corresponding to the loopback interface, and the source address indication information. For ease of understanding, the above-mentioned source address indication information is explained: the second VSW will establish a border gateway protocol (BGP) neighbor relationship with the target communication device in the subsequent process, thereby forming a transmission control protocol (TCP) connection between the second VSW and the target communication device. The source address indication information is used to specify the IP address corresponding to the loopback interface as the source address in the TCP connection. Among them, the process of the second VSW establishing a BGP neighbor relationship with the target communication device can be seen in 303 below.
[0065] In this embodiment, a VIRTIO queue (virtqueue) is required between the second VSW and the VM / POD. The second VSW is used as a backend processing program, the VM / POD is used as a front-end driver, and the VIRTIO queue is used to realize communication between the second VSW and the VM / POD. In the subsequent process, when the second VSW is used to forward the message flow, the second VSW obtains the uplink message flow sent by the VM / POD through the VIRTIO, and forwards the downlink message flow sent by the target communication device to the VM / POD through the VIRTIO queue, thereby realizing the forwarding of the message flow. To establish the VIRTIO queue, the second VSW needs to negotiate with the VM / POD to obtain driver information. The driver information is used to indicate the communication functions that the second VSW and the VM / POD can provide during the communication process, so that the second VSW can realize the forwarding of the message flow. After that, the VIRTIO queue between the second VSW and the VM / POD can be established based on the driver information.
[0066] For example, in this embodiment, the negotiation process is completed by a proxy on behalf of the second VSW, ensuring that the second VSW is not directly aware of the negotiation process. In other words, the method provided in this embodiment further includes controlling the proxy to negotiate and obtain driver information. The second VSW is controlled to obtain the driver information from the proxy, and the driver information is used by the second VSW to forward the packet flow.
[0067] See also Figure 5 In this embodiment, an agent is installed in the physical communication device where the first VSW is located, and the agent and the first VSW share the CPU occupied by the first VSW. After the agent negotiates with the VM / POD, the agent obtains and stores the driver information, then the second VSW does not need to negotiate on its own, but can directly obtain the negotiated driver information from the agent. After the second VSW obtains the driver information, a VIRTIO queue is established between the second VSW and the VM / POD, and the virtual interface corresponding to the second VSW is in a closed state by default. It can be understood that in actual applications, the agent may have been installed before the first VSW is used to forward the message flow. In this case, the agent can also negotiate with the VM / POD on behalf of the first VSW, then the first VSW does not need to perceive the negotiation process, and can establish a VIRTIO queue with the VM / POD, so that the first VSW can be used to forward the message flow.
[0068] exist Figure 5 In the VIRTIO process, the agent only negotiates with the VM / POD on behalf of the first VSW and the second VSW, while the real backend handler in the VIRTIO queue is still the first VSW (or the second VSW). Figure 5 The vUser in is used to indicate that the first VSW (or the second VSW) is the real backend processing program. Figure 5 The poll mode driver (PMD) in the VSW is used to indicate that the first and second VSWs support poll mode, and the userspace input / output (UIO) interface is used to indicate that the first and second VSWs support interrupt mode. The poll mode and interrupt mode will be described later and are not detailed here.
[0069] See also Figure 6 ,VIRTIO queue is implemented through Vring, Figure 6 A schematic diagram of the structure of a Vring is shown. Figure 6 In the Vring, Vring includes: a descriptor array (desc), an available ring buffer (available ring) and a used ring buffer (usedring). Both ring buffers are composed of multiple buffer areas (buffers). Among them, desc is used to store descriptors, and each descriptor is used to indicate whether a buffer area is occupied. Therefore, the first VSW (or the second VSW) and the VM / POD can transmit the message stream according to the instructions of each descriptor. Taking the example of the VM / POD sending a message stream to the second VSW, the VM / POD determines the unoccupied first buffer in the available ring buffer according to the instructions of each descriptor, and writes the message stream to the first buffer. Afterwards, the descriptor corresponding to the first buffer is sent to the second VSW, and the second VSW can read the message stream from the first buffer according to the descriptor. The second VSW also determines the unoccupied second buffer from the usedring buffer according to the instructions of each descriptor, and writes the message stream read from the first buffer into the second buffer, thereby completing the reception of the message stream.
[0070] It should be noted that the VIRTIO queues between the second VSW and the VM / POD include a first VIRTIO queue for transmitting upstream message flows and a second VIRTIO queue for transmitting downstream message flows. The functions of the first and second VIRTIO queues will be described in detail in 304 below and will not be detailed here.
[0071] 302 : Control the second VSW to publish second overhead information of the second VSW forwarding message flow, where the second overhead information is greater than the first overhead information.
[0072] According to the description in 301, the first VSW corresponds to more than two NICs. In this embodiment, some of the NICs corresponding to the first VSW are reallocated to the second VSW. As a result, the second VSW can publish the second overhead information through the allocated NICs, while the first VSW can continue to forward the message flow through the remaining NICs. This embodiment does not limit the number of NICs allocated to the second VSW, as long as it ensures that the first VSW and the second VSW each have at least one NIC after the allocation is completed. For example, this embodiment allocates half of the NICs corresponding to the first VSW to the second VSW. During the NIC switching process, when the connection between the first VSW and some of the NICs is disconnected, the data packets being forwarded through the disconnected NICs will be discarded, resulting in packet loss. Taking the case where the number of NICs is in the thousands as an example, the packet loss time is approximately 100 milliseconds.
[0073] See also Figure 4 In step 401, before reassigning the NICs, the first VSW forwards packets through NIC1 and NIC2. NIC2 is then shut down, disconnecting the first VSW from NIC2. Next, NIC2 is connected to the second VSW. After the connection is successfully established, NIC2 is turned on and unshut. This returns NIC2 to the running state, thus achieving NIC reassignment. Figure 4 402 shows the NIC usage after the NIC is reallocated. As can be seen from 402, the first VSW no longer uses NIC2 and only forwards the message flow through NIC1, while the second VSW publishes the second overhead information through NIC2.
[0074] After the NIC is reallocated, the second VSW is controlled to publish the second overhead information corresponding to the second VSW through the allocated NIC. Since the target communication device selects the VSW with smaller overhead information as the VSW for forwarding the message flow, and the second overhead information published by the second VSW is greater than the first overhead information required by the first VSW to forward the message flow, the target communication device selects the first VSW from the first VSW and the second VSW as the VSW for forwarding the message flow. That is, before and after the target communication device makes the selection, the first VSW is always in the message flow forwarding state, and no packet loss occurs. For example, in this embodiment, the second VSW uses the intermediate system to intermediate system (ISIS) protocol or equal-cost multipath routing (ECMP) to publish the second overhead information, and the second overhead information is the maximum overhead information corresponding to the second VSW.
[0075] Of course, in addition to the methods described above, this embodiment also provides other optional methods for causing the target communication device to select the first VSW as the VSW for forwarding the message flow from the first VSW and the second VSW. In this method, a request is sent to the network management device that manages the target communication device. This request causes the network management device to send an instruction to the target communication device, instructing the target communication device to select the first VSW as the VSW for forwarding the message flow. Therefore, the target communication device no longer needs to make a selection based on the first and second overhead information; it can directly select the first VSW as the VSW for forwarding the message flow based on the received instruction.
[0076] 303 , in the process of forwarding the message flow by the first VSW, control the second VSW to establish a neighbor relationship with the target communication device, and exchange routing information based on the established neighbor relationship.
[0077] Because the target communication device selects the first VSW as the VSW for forwarding the message flow, the first VSW can continue to forward the message flow corresponding to the target communication device. Therefore, the message transmission process between the VM / POD and the target communication device will not be interrupted, that is, no packet loss will occur. While the message transmission process is not interrupted, the second VSW is controlled to establish a BGP neighbor relationship with the target communication device, and routing information is exchanged based on the established BGP neighbor relationship. In other words, the process of the first VSW continuing to forward the message flow and the process of the second VSW establishing a neighbor relationship and exchanging routing information are carried out simultaneously. Therefore, in this embodiment, the process of the second VSW establishing a neighbor relationship and exchanging routing information does not affect the message transmission process between the VM / POD and the target communication device, and thus does not cause packet loss.
[0078] For example, see Figure 4When the second VSW needs to establish a communication connection with the target communication device through the NIC and TOR / RR, the second VSW first establishes a BGP neighbor relationship with the TOR / RR. Based on the established BGP neighbor relationship, the TOR / RR can publish routing information. After the second VSW learns the routing information published by the TOR / RR, it can be used to forward the message flow sent by the VM / POD to the TOR / RR, and the TOR / RR forwards the received message flow to the target communication device, thereby realizing the message transmission from the VM / POD to the target communication device. Based on the established BGP neighbor relationship, the second VSW can also publish routing information. The routing information published by the second VSW includes but is not limited to the VM / POD host route and service route. After the target communication device learns the routing information published by the second VSW, it can be used to send the message flow to the second VSW through the TOR / RR, and the second VSW forwards the received message flow to the VM / POD, thereby realizing the message transmission from the target communication device to the VM / POD.
[0079] It should be noted that, as shown in step 301, after the VIRTIO queue is established between the second VSW and the VM / POD, the virtual interface corresponding to the second VSW is in the shutdown state by default. Therefore, although the second VSW has acquired the ability to forward packets by establishing a BGP neighbor relationship and exchanging routing information, it does not directly forward packets. In this embodiment, the second VSW is used to forward packets only when it replaces the first VSW, as detailed in step 304.
[0080] 304 : Replace the VSW used for forwarding the packet flow from the first VSW to the second VSW.
[0081] According to the description in 301, the message flow includes an uplink message flow and a downlink message flow. In this embodiment, uplink replacement and downlink replacement are performed in different ways respectively. Among them, uplink replacement means: replacing the VSW used to forward the uplink message flow from the first VSW to the second VSW. Downlink replacement means: replacing the VSW used to forward the downlink message flow from the first VSW to the second VSW. In this embodiment, the execution order of the uplink replacement and the downlink replacement is not limited. The uplink replacement and the downlink replacement can be executed in series or in parallel according to actual needs. Next, the processes of uplink replacement and downlink replacement are described respectively.
[0082] Upward substitution: see Figure 7The VSW used to forward the upstream message flow is replaced by the second VSW via the first VIRTIO queue. The upstream message flow is the message flow sent by the VM / POD to the target communication device. The VM / POD writes the upstream message flow into the first VIRTIO queue, which then includes the upstream message flow. The upstream replacement process is then implemented by controlling the read permissions of the first and second VSWs for the first VIRTIO queue.
[0083] Exemplarily, replacing the VSW used to forward the uplink packet flow from the first VSW to the second VSW through the first VIRTIO queue includes the following process.
[0084] 304A1 , when the virtual interface corresponding to the second VSW is in a closed state, the control agent prohibits the second VSW from reading the first VIRTIO queue.
[0085] Since the virtual interface corresponding to the second VSW is in a closed state by default, the second VSW will not forward the message flow. While keeping the virtual interface corresponding to the second VSW in a closed state, the control agent in this embodiment prohibits the second VSW from reading the first VIRTIO queue. In other words, the second VSW does not have the read permission of the first VIRTIO queue, and the second VSW cannot read the upstream message flow from the first VIRTIO queue. Exemplarily, the agent manages an upstream read lock, and the VSW that can call the upstream read lock has the read permission of the first VIRTIO queue. Therefore, the way in which the agent prohibits the second VSW from reading the first VIRTIO queue includes: prohibiting the second VSW from calling the upstream read lock.
[0086] 304A2, controlling the second VSW to open the virtual interface that is in a closed state.
[0087] After the agent has prohibited the second VSW from reading the first VIRTIO queue, the agent controls the second VSW to open the virtual interface in the closed state, thereby obtaining an open virtual interface. However, because the second VSW cannot read the uplink packet flow from the first VIRTIO queue, the second VSW cannot forward the uplink packet flow to the target communication device through the open virtual interface.
[0088] 304A3 , the control agent prohibits the first VSW from reading the first VIRTIO queue, and controls the second VSW to read the first VIRTIO queue. The second VSW is configured to forward the uplink packet flow read from the first VIRTIO queue through the virtual interface in the enabled state.
[0089] In both 304A1 and 304A2, the first VSW has read permission for the first VIRTIO queue, and thus the first VSW can read the upstream message flow from the first VIRTIO queue, thereby being able to forward the upstream message flow. After the control agent prohibits the first VSW from reading the first VIRTIO queue, the first VSW no longer has read permission for the first VIRTIO queue and can no longer be used to forward the upstream message flow. Next, the agent controls the second VSW to read the first VIRTIO, and the second VSW can then read the upstream message flow from the first VIRTIO queue. Therefore, the second VSW can forward the upstream message flow read by the second VSW to the target communication device through the virtual interface in the open state. Thus, the upstream replacement process of replacing the VSW used to forward the upstream message flow from the first VSW to the second VSW is completed. For example, in step 304A3 , the agent prohibits the first VSW from reading the first VIRTIO queue by prohibiting the first VSW from invoking the uplink read lock, and controls the second VSW to read the first VIRTIO queue by controlling the first VSW to invoking the uplink read lock.
[0090] See also Figure 4 , Figure 4 403 in the figure shows that the uplink replacement process has been completed but the downlink replacement process has not yet been completed. According to 403, after the uplink replacement process is completed, the second VSW forwards the uplink message flow read from the first VIRTIO queue to the target communication device, while the first VSW is no longer used to forward the uplink message flow and is only used to forward the downlink message flow sent by the target communication device to the VM / POD.
[0091] During the uplink replacement process, after the proxy prohibits the first VSW from reading the first VIRTIO queue, packets in the uplink message flow that the first VSW has read from the first VIRTIO queue but has not yet forwarded will be discarded. Furthermore, after the proxy controls the second VSW to read the first VIRTIO queue, for a period of time, packets in the uplink message flow forwarded by the second VSW to the target communication device may be out of order. These out-of-order packets will also be discarded. In practice, packet loss during the uplink replacement process lasts approximately 200 milliseconds.
[0092] like Figure 7As shown, before the uplink replacement process, the first VSW reads the uplink message flow from the first VIRTIO queue. The uplink message flow read by the first VSW includes data packets such as F3 P1, F3 P2, and F4 P1. Among them, F is used to indicate the message flow (flow), and P is used to indicate the data packet (packet) in the message flow. Afterwards, the first VSW forwards the uplink message flow read by the first VSW to the PE device through NIC1. After the uplink replacement process is completed, the second VSW forwards the uplink message flow read by the second VSW to the PE device. Figure 7 In the example, the uplink message flow read by the second VSW includes data packets such as F4 P2, F4 P3, and F3 P3.
[0093] Downstream replacement: see Figure 8 The VSW used to forward a downlink message flow, i.e., a message flow sent by a target communication device, is replaced from a first VSW to a second VSW using an unlocked queue and a second VIRTIO queue in the Data Plane Development Kit (DPDK). In this embodiment, the downlink replacement process is implemented by controlling the write permissions of the first and second VSWs to the unlocked queue in the DPDK.
[0094] Exemplarily, replacing the VSW used to forward the downlink packet flow from the first VSW to the second VSW through the DPDK lock-free queue and the second VIRTIO queue includes the following process.
[0095] 304B1 , controlling the first VSW to write the downstream message flow received by the first VSW into the DPDK lock-free queue, and controlling the second VSW to write the downstream message flow received by the second VSW into the DPDK lock-free queue.
[0096] Before controlling the first VSW, the first VSW directly writes the downstream message flow received by the first VSW into the second VIRTIO queue. Accordingly, the VM / POD reads the downstream message flow from the second VIRTIO queue, enabling the first VSW to forward the downstream message flow. After controlling the first VSW to write the downstream message flow received by the first VSW into the DPDK lock-free queue, the first VSW no longer writes the downstream message flow received by the first VSW into the second VIRTIO queue, but instead writes the downstream message flow received by the first VSW into the DPDK lock-free queue.
[0097] In addition, because the second overhead information published by the second VSW is greater than the first overhead information corresponding to the first VSW, the target communication device does not send the downlink message flow to the second VSW, and the second VSW cannot receive the downlink message flow. Therefore, the purpose of controlling the second VSW to write the downlink message flow received by the second VSW into the DPDK lock-free queue is to ensure that after the second VSW receives the downlink message flow in the subsequent process, the downlink message flow received by the second VSW is written into the DPDK lock-free queue instead of the second VIRTIO queue.
[0098] 304B2, the control agent reads the DPDK lock-free queue and writes the read downlink message flow into the second VIRTIO queue.
[0099] After the first VSW is controlled to write the downstream message flow received by the first VSW into the DPDK lock-free queue, the DPDK lock-free queue includes the downstream message flow written by the first VSW. Therefore, the control agent needs to read the downstream message flow from the DPDK lock-free queue and then write the read downstream message flow into the second VIRTIO queue. The VM / POD then obtains the downstream message flow sent by the target communication device by reading the second VIRTIO queue.
[0100] Exemplarily, the control agent reads the DPDK lock-free queue and writes the read downstream message flow to the second VIRTIO queue, including: determining the message flow rate of the downstream message flow in the DPDK lock-free queue; based on the message flow rate not exceeding a flow threshold, the control agent writes the read downstream message flow to the second VIRTIO queue via an interrupt. Accordingly, the method further includes: based on the message flow rate exceeding the flow threshold, the control agent writes the read downstream message flow to the second VIRTIO queue via a polling method. This embodiment does not limit the flow threshold; the value of the flow threshold can be selected based on actual needs.
[0101] Reading via interruption means that after detecting that a downstream message flow has been written to the DPDK lock-free queue, the agent reads from the DPDK lock-free queue. Reading via polling means that the agent proactively queries the DPDK lock-free queue at regular intervals and reads if a downstream message flow is found in the queue. When the agent uses polling to read, each querying thread terminates after finding the downstream message flow. Therefore, if polling is used when the message flow rate is less than the flow threshold, each thread may need to wait for a long time before terminating due to the low message flow rate. This can cause multiple threads to be blocked, consuming a large amount of CPU resources. Therefore, if the message flow rate is not greater than the flow threshold, this embodiment does not use polling, but instead controls the agent to use interruption to read. If the message flow rate is greater than the flow threshold, the thread blocking issue described above does not occur. Therefore, this embodiment controls the agent to use polling to read the downstream message flow.
[0102] Exemplarily, the DPDK lock-free queue in this embodiment is a DPDK runtime environment (RTE) first-in-first-out (FIFO) queue. Among them, the DPDK RTE FIFO queue supports multiple producers (producers) to write synchronously and multiple consumers (consumers) to read synchronously. In this embodiment, the first VSW and the second VSW are equivalent to two producers in the queue, and the first VSW and the second VSW respectively write the downstream message streams they receive into the queue. In addition, the agent is equivalent to a producer in the queue, and the agent reads the downstream message stream from the queue, and then writes the read downstream message stream into the second VIRTIO queue. Through the DPDK RTE FIFO queue, conflicts between the first VSW and the second VSW in the subsequent synchronous writing process are avoided, thereby ensuring the efficiency of writing messages.
[0103] In the DPDK RTE FIFIO queue, the head and tail flags are used to avoid conflicts when multiple producers write simultaneously. Figure 9 , as a producer, the first VSW starts writing at position 1 and moves its head to position 2, where the first VSW expects to end writing. If the second VSW, another producer, also needs to perform synchronous writing, it will start writing at position 2 and move its head to position 3, where it expects to end writing. Therefore, the first VSW writes between positions 1 and 2, and the second VSW writes between positions 2 and 3, avoiding conflicts during the synchronous writing process.
[0104] After the first VSW actually finishes writing, the tail is moved to the position where the first VSW actually finishes writing (for example Figure 9 After the second VSW actually finishes writing and determines that the first VSW has also actually finished writing, the tail is moved to the position where the second VSW actually finishes writing (for example, Figure 9 Position 3 shown).
[0105] Furthermore, when multiple consumers need to read data synchronously, they also use head and tail identifiers to avoid conflicts during the process. However, since this embodiment only includes one consumer, namely the proxy, the method for synchronized reading by multiple consumers will not be described in detail.
[0106] 304B3, control the second VSW to publish third overhead information, the third overhead information is smaller than the first overhead information, and the third overhead information is used by the target communication device in the first VSW and the second VSW to use the second VSW as the VSW for forwarding the downlink message flow.
[0107] Because the target communication device selects the VSW with the smaller overhead information as the VSW for forwarding the message flow, after controlling the second VSW to publish the third overhead information, which is smaller than the first overhead information, the target communication device no longer selects the first VSW as the VSW for forwarding the downstream message flow. Instead, it reselects the second VSW from the first and second VSWs as the VSW for forwarding the downstream message flow. After the target communication device reselects the VSW for forwarding the downstream message flow, the protocol convergence process begins. After protocol convergence, the downstream message flow sent by the target communication device switches from the first VSW to the second VSW. As a result, the first VSW no longer receives the downstream message flow, and the second VSW begins to receive the downstream message flow.
[0108] During the process of the downlink message flow switching from the first VSW to the second VSW, the first VSW will write the downlink message flow that has been received but not yet forwarded into the DPDK lock-free queue. In addition, since 304B1 has controlled the second VSW to write the downlink message flow received by the second VSW into the DPDK lock-free queue, after the downlink message flow is switched to the second VSW, the second VSW will write the downlink message flow received by the second VSW into the DPDK lock-free queue. Therefore, the DPDK lock-free queue includes the downlink message flows written by the first VSW and the second VSW. When the agent reads the downlink message flow from the DPDK lock-free queue, the agent reads it in the order in which the first VSW and the second VSW write it, thereby ensuring that the order of the data packets in the DPDK lock-free queue and the second VIRTIO queue is the same.
[0109] like Figure 8 As shown, Figure 8 The figure shows the situation where the first VSW and the second VSW write downlink message flows into the DPDK lock-free queue. The first VSW writes packets such as F1 P1, F1 P2, and F1 P3 into the DPDK lock-free queue, and the second VSW writes packets such as F2 P1, F2 P2, and F2 P3 into the DPDK lock-free queue. The packets written by the first VSW and the second VSW are arranged in the order of writing, for example Figure 8 The packets in the DPDK lock-free queue are arranged in the order of F1 P1, F1 P2, F2 P1, F2 P2, F1 P3, and F2 P3. In addition, the order of the packets in the second VIRTIO queue is also the same as the order of the packets in the DPDK lock-free queue.
[0110] Exemplarily, after controlling the second VSW to publish the third overhead information, the method further includes: controlling the agent to prohibit the first VSW from writing the downstream message flow received by the first VSW into the DPDK lock-free queue, and controlling the second VSW to update the downstream message flow received by the second VSW from writing the downstream message flow into the DPDK lock-free queue to writing the downstream message flow into the second VIRTIO queue.
[0111] Exemplarily, the agent manages a downstream write lock, and the VSW that can call the downstream write lock has write permission to the DPDK lock-free queue and the second VIRTIO queue. Therefore, by prohibiting the first VSW from calling the downstream write lock, the agent can prohibit the first VSW from writing the downstream message flow received by the first VSW into the DPDK lock-free queue and the second VIRTIO queue. In addition, the second VSW is also controlled to no longer write the downstream message flow received by the second VSW into the DPDK lock-free queue, but directly write the downstream message flow received by the second VSW into the second VIRTIO queue. Therefore, in the subsequent message transmission process, the agent no longer needs to read from the DPDK lock-free queue and rewrite it into the second VIRTIO queue. The downstream message flow read by the VM / POD from the second VIRTIO queue can be the downstream message flow directly written by the second VSW.
[0112] Furthermore, after completing the upstream and downstream replacement processes, the first VSW is no longer used for packet forwarding. Therefore, this embodiment also allocates the NIC corresponding to the first VSW to the second VSW. Exemplarily, this embodiment also deletes the first VSW. Furthermore, the agent releases the managed upstream read lock, downstream read lock, and thread resources used to forward packet flows in the DPDK lock-free queue to the second VIRTIO queue, thereby completing the VSW update process.
[0113] See also Figure 4 , Figure 4 404 in the figure shows that both the upstream and downstream replacement processes have been completed. As can be seen from 404, in the subsequent message transmission process, both the upstream and downstream message flows are forwarded by the second VSW through NIC1 and NIC2, and the first VSW is no longer used to forward any message flows transmitted between the target communication device and the VM / POD.
[0114] During the downlink replacement process, the protocol convergence process after the target communication device selects the second VSW as the VSW for forwarding the downlink message flow can cause packet loss. Furthermore, after the second VSW is controlled to update the downlink message flow received by the second VSW from writing it to the second VIRTIO queue instead of the DPDK lock-free queue, the remaining downlink message flow packets in the DPDK lock-free queue are discarded. In actual applications, the packet loss time during the downlink replacement process is approximately 200 milliseconds.
[0115] As can be seen from the descriptions in 301-304, in this embodiment, the packet loss during NIC switching is approximately 100 milliseconds, the packet loss during upstream replacement is approximately 200 milliseconds, and the packet loss during downstream replacement is approximately 200 milliseconds. Therefore, the total packet loss during the VSW update in this embodiment is approximately 500 milliseconds. This embodiment enables sub-second in-service software upgrades (ISSU) of VSWs, even with thousands of NICs and millions of routing information.
[0116] In summary, after acquiring a second VSW to replace the first VSW, this embodiment controls the second VSW to publish second overhead information, which is greater than the first overhead information required by the first VSW to forward the message flow. This causes the target communication device to select the first VSW as the VSW to forward the message flow from the first and second VSWs. Therefore, the second VSW can establish a neighbor relationship and exchange routing information while the first VSW forwards the message flow without packet loss. After the second VSW establishes a neighbor relationship and exchanges routing information, the first VSW is replaced by the second VSW. Because the process of establishing a neighbor relationship and exchanging routing information by the second VSW in this embodiment does not cause packet loss, the packet loss time during the VSW update process is shortened, reducing the packet loss rate during message transmission.
[0117] like Figure 10 As shown, an embodiment of the present application further provides a device for transmitting a message, the device comprising:
[0118] Acquisition module 1001 is configured to acquire a second virtual switch (VSW) corresponding to a first virtual switch (VSW). The first VSW is configured to forward a message flow corresponding to a target communication device. Overhead information of the message flow forwarded by the first VSW is first overhead information. The process performed by acquisition module 1001 can be found in the description of step 301 above and is not further described here.
[0119] The control module 1002 is configured to control the second VSW to publish second overhead information of the second VSW forwarding message flow, where the second overhead information is greater than the first overhead information.
[0120] Control module 1002 is further configured to control the second VSW to establish a neighbor relationship with the target communication device during the process of forwarding the message flow by the first VSW, and to exchange routing information based on the established neighbor relationship. The process performed by control module 1002 can be found in the description of 302 and 303 above and will not be repeated here.
[0121] The replacement module 1003 is configured to replace the VSW used to forward the packet flow from the first VSW to the second VSW. The process performed by the replacement module 1003 can be found in the description of 304 above and will not be described again here.
[0122] In an exemplary embodiment, the replacement module 1003 is used to replace the VSW used to forward the uplink message flow from the first VSW to the second VSW through the first virtual interface VIRTIO queue, wherein the uplink message flow is a message flow sent to the target communication device, and the first VIRTIO queue includes the uplink message flow.
[0123] In an exemplary embodiment, the replacement module 1003 is used to control the agent to prohibit the second VSW from reading the first VIRTIO queue when the virtual interface corresponding to the second VSW is in a closed state; control the second VSW to open the virtual interface in the closed state; the control agent prohibits the first VSW from reading the first VIRTIO queue, and controls the second VSW to read the first VIRTIO queue, and the second VSW is used to forward the uplink message flow read from the first VIRTIO queue through the virtual interface in the open state.
[0124] In an exemplary embodiment, the replacement module 1003 is further used to replace the VSW used to forward the downlink message flow from the first VSW to the second VSW through the data table development kit DPDK lock-free queue and the second VIRTIO queue, wherein the downlink message flow is the message flow sent by the target communication device.
[0125] In an exemplary embodiment, the replacement module 1003 is used to control the first VSW to write the downstream message flow received by the first VSW into the DPDK lock-free queue, and control the second VSW to write the downstream message flow received by the second VSW into the DPDK lock-free queue; control the agent to read the DPDK lock-free queue, and write the read downstream message flow into the second VIRTIO queue; control the second VSW to publish third overhead information, the third overhead information is less than the first overhead information, and the third overhead information is used for the target communication device to use the second VSW as the VSW for forwarding the downstream message flow in the first VSW and the second VSW.
[0126] In an exemplary embodiment, the control module 1002 is further used to control the agent to prohibit the first VSW from writing the downstream message flow received by the first VSW into the DPDK lock-free queue and the second VIRTIO queue; and control the second VSW to update the downstream message flow received by the second VSW from writing into the DPDK lock-free queue to writing into the second VIRTIO queue.
[0127] In an exemplary embodiment, the apparatus further includes a deletion module configured to delete the first VSW.
[0128] In an exemplary embodiment, the replacement module 1003 is configured to determine a packet flow rate of a downstream packet flow in a DPDK lock-free queue; based on the packet flow rate not being greater than a flow threshold, the control agent writes the read downstream packet flow into the second VIRTIO queue through an interruption.
[0129] In an exemplary embodiment, the replacement module 1003 is further configured to control the agent to write the read downstream message flow into the second VIRTIO queue in a polling manner based on the message flow traffic being greater than the traffic threshold.
[0130] In an exemplary embodiment, the control module 1002 is further configured to control the agent to negotiate and obtain driver information; and control the second VSW to obtain the driver information from the agent, where the driver information is used by the second VSW to forward the message flow.
[0131] It should be understood that the above Figure 10 The provided device is illustrated only by the division of the above-mentioned functional modules when implementing its functions. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiments are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0132] An embodiment of the present application provides a communication device, comprising: a communication interface and a processor, and optionally, a memory. The communication interface, the memory, and the processor communicate with each other via an internal connection path, the memory is configured to store instructions, and the processor is configured to execute the instructions stored in the memory to control the communication interface to receive signals and to control the communication interface to send signals. When the processor executes the instructions stored in the memory, the processor executes any one of the exemplary message transmission methods provided in the embodiments of the present application.
[0133] Corresponding to the method embodiment and virtual device embodiment provided in the present application, the embodiment of the present application further provides a communication device, and the hardware structure of the communication device is introduced below.
[0134] The communication device 1100 or communication device 1200 described below corresponds to the physical communication device in the above-mentioned method embodiment. The various hardware, modules, and other operations and / or functions in the communication device 1100 or communication device 1200 are respectively for implementing the various steps and methods implemented by the communication device 1100 or communication device 1200 in the method embodiment. Regarding how the communication device 1100 or communication device 1200 obtains the detailed process for message transmission, the specific details can be found in the above-mentioned method embodiment. For the sake of brevity, they are not repeated here. Among them, the steps of the above methods 301-304 are completed by the hardware integrated logic circuit or software instructions in the processor of the communication device 1100 or communication device 1200. The steps of the method disclosed in the embodiment of the present application can be directly embodied as being executed by the hardware processor, or by a combination of hardware and software modules in the processor. The software module can be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, a detailed description is not given here.
[0135] The communication device 1100 or the communication device 1200 corresponds to the device for transmitting message streams in the aforementioned virtual device embodiment, and each functional module in the device for transmitting message streams is implemented using software of the communication device 1100 or the communication device 1200. In other words, the functional modules included in the device for transmitting message streams are generated by the processor of the communication device 1100 or the communication device 1200 after reading program code stored in the memory.
[0136] See also Figure 11 , Figure 11 A schematic structural diagram of a communication device 1100 provided by an exemplary embodiment of the present application is shown. Figure 11 The communication device 1100 shown is used to perform the above Figure 3 The communication device 1100 is, for example, a switch, a router, a controller, etc. The communication device 1100 can be implemented by a general bus architecture.
[0137] like Figure 11 As shown, the communication device 1100 includes at least one processor 1101 , a memory 1103 , and at least one communication interface 1104 .
[0138] The processor 1101 is, for example, a general-purpose central processing unit (CPU), a digital signal processor (DSP), a network processor (NP), a graphics processing unit (GPU), a neural network processing unit (NPU), a data processing unit (DPU), a microprocessor, or one or more integrated circuits for implementing the solution of the present application. For example, the processor 1101 includes an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. The PLD is, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. It can implement or execute the various logic blocks, modules, and circuits described in conjunction with the disclosure of the embodiments of the present invention. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
[0139] Optionally, the communication device 1100 further includes a bus. The bus is used to transmit information between the components of the communication device 1100. The bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 11 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0140] The memory 1103 is, for example, a read-only memory (ROM) or other type of static storage device that can store static information and instructions, or a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 1103 is, for example, independent and connected to the processor 1101 via a bus. The memory 1103 can also be integrated with the processor 1101.
[0141] The communication interface 1104 uses any transceiver-like device to communicate with other devices or communication networks. The communication network can be Ethernet, a radio access network (RAN), or a wireless local area network (WLAN). The communication interface 1104 can include a wired communication interface and a wireless communication interface. Specifically, the communication interface 1104 can be an Ethernet interface, a Fast Ethernet (FE) interface, a Gigabit Ethernet (GE) interface, an Asynchronous Transfer Mode (ATM) interface, a wireless local area network (WLAN) interface, a cellular network communication interface, or a combination thereof. The Ethernet interface can be an optical interface, an electrical interface, or a combination thereof. In an embodiment of the present application, the communication interface 1104 can be used for the communication device 1100 to communicate with other devices.
[0142] In a specific implementation, as an embodiment, the processor 1101 may include one or more CPUs, such as Figure 11 0 and CPU1 are shown in FIG. Each of these processors can be a single-CPU processor or a multi-CPU processor. A processor herein can refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0143] In a specific implementation, as an embodiment, the communication device 1100 may include multiple processors, such as Figure 11 1 and 1105. Each of these processors can be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). A processor here can refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).
[0144] In a specific implementation, as an embodiment, the communication device 1100 may further include an output device and an input device. The output device communicates with the processor 1101 and can display information in a variety of ways. For example, the output device can be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. The input device communicates with the processor 1101 and can receive user input in a variety of ways. For example, the input device can be a mouse, a keyboard, a touch screen device, or a sensor device.
[0145] In some embodiments, the memory 1103 is used to store program code 1110 for executing the solution of the present application, and the processor 1101 can execute the program code 1110 stored in the memory 1103. That is, the communication device 1100 can implement the method for transmitting a message provided in the method embodiment through the processor 1101 and the program code 1110 in the memory 1103. The program code 1110 may include one or more software modules. Optionally, the processor 1101 itself may also store program code or instructions for executing the solution of the present application.
[0146] In a specific embodiment, the communication device 1100 of the embodiment of the present application may correspond to the physical communication device in the above method embodiment, and the processor 1101 in the communication device 1100 reads the instruction in the memory 1103 so that Figure 11 The communication device 1100 shown is capable of executing all or part of the operations executed by the physical communication device in the method embodiment.
[0147] The communication device 1100 may also correspond to the above Figure 10 The device shown, Figure 10 Each functional module in the apparatus shown is implemented using software of the communication device 1100. In other words, Figure 10 The functional modules included in the apparatus shown are generated after the processor 1101 of the communication device 1100 reads the program code 1110 stored in the memory 1103 .
[0148] in, Figure 3The method for transmitting a message shown is completed by an integrated logic circuit of hardware or software instructions in the processor of the communication device 1100. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor. The software module can be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in conjunction with its hardware. To avoid repetition, it will not be described in detail here.
[0149] See also Figure 12 , Figure 12 FIG2 shows a schematic diagram of the structure of a communication device 1200 provided by an exemplary embodiment of the present application. The communication device 1200 includes: a main control board 1210 and an interface board 1230 .
[0150] Main control board 1210, also known as the main processing unit (MPU) or route processor card, is responsible for controlling and managing various components in communication device 1200, including routing calculation, device management, device maintenance, and protocol processing. Main control board 1210 includes a central processing unit 1211 and memory 1212.
[0151] Interface board 1230 is also known as a line processing unit (LPU), line card, or service board. It provides various service interfaces and implements data packet forwarding. Service interfaces include, but are not limited to, Ethernet interfaces and POS (Packet over SONET / SDH) interfaces. Ethernet interfaces, for example, are Flexible Ethernet Clients (FlexE Clients). Interface board 1230 includes a central processing unit (CPU) 1231, a network processor (NPU) 1232, a forwarding table memory 1234, and a physical interface card (PIC) 1233.
[0152] The central processing unit 1231 on the interface board 1230 is used to control and manage the interface board 1230 and communicate with the central processing unit 1211 on the main control board 1210 .
[0153] The network processor 1232 is used to implement message forwarding processing. The network processor 1232 can be in the form of a forwarding chip. Specifically, the network processor 1232 is used to forward received messages based on the forwarding table stored in the forwarding table memory 1234. If the destination address of the message is the address of the communication device 1200, the message is sent to the CPU (such as the central processing unit 1211) for processing; if the destination address of the message is not the address of the communication device 1200, the next hop and outgoing interface corresponding to the destination address are searched from the forwarding table based on the destination address, and the message is forwarded to the outgoing interface corresponding to the destination address. The processing of uplink messages includes: processing of the message input interface, forwarding table search; processing of downlink messages: forwarding table search, etc.
[0154] Physical interface card 1233 implements the physical layer interconnection function. Raw traffic enters interface board 1230 through this card, and processed packets are sent out from this physical interface card 1233. Physical interface card 1233, also known as a daughter card, can be installed on interface board 1230. It is responsible for converting optical and electrical signals into packets, performing a validity check on these packets, and forwarding them to network processor 1232 for processing. In some embodiments, a central processing unit can also perform the functions of network processor 1232, such as implementing software forwarding based on a general-purpose CPU, thus eliminating the need for network processor 1232 in physical interface card 1233.
[0155] Optionally, the communication device 1200 includes multiple interface boards. For example, the communication device 1200 further includes an interface board 1240 . The interface board 1240 includes a central processing unit 1241 , a network processor 1242 , a physical interface card 1243 , and a forwarding table entry memory 1244 .
[0156] Optionally, the communication device 1200 further includes a switching fabric board 1220. The switching fabric board 1220 may also be referred to as a switch fabric unit (SFU). If the communication device includes multiple interface boards 1230, the switching fabric board 1220 is used to exchange data between the interface boards. For example, the interface board 1230 and the interface board 1240 can communicate via the switching fabric board 1220.
[0157] The main control board 1210 and the interface board 1230 are coupled. For example, the main control board 1210, the interface board 1230, the interface board 1240, and the switching network board 1220 are connected to the system backplane via a system bus to achieve intercommunication. In one possible implementation, an inter-process communication (IPC) channel is established between the main control board 1210 and the interface board 1230, and communication between the main control board 1210 and the interface board 1230 is performed via the IPC channel.
[0158] Logically, communication device 1200 includes a control plane and a forwarding plane. The control plane includes a main control board 1210 and a central processing unit 1231. The forwarding plane includes various components that perform forwarding, such as a forwarding table entry memory 1234, a physical interface card 1233, and a network processor 1232. The control plane performs routing functions, generates forwarding tables, processes signaling and protocol messages, and configures and maintains device status. The control plane sends the generated forwarding tables to the forwarding plane. On the forwarding plane, the network processor 1232 forwards messages received by the physical interface card 1233 based on the forwarding tables sent by the control plane. The forwarding tables sent by the control plane can be stored in the forwarding table entry memory 1234. In some embodiments, the control plane and forwarding plane can be completely separate and not located on the same device.
[0159] If the communication device 1200 is configured as a physical communication device for transmitting messages, the physical interface card 1233 is used to forward data packets in the message flow.
[0160] The operations on the interface board 1240 in the embodiment of the present application are consistent with those on the interface board 1230 and are not described in detail here for the sake of brevity. The communication device 1200 of this embodiment may correspond to the communication device in each of the above-mentioned method embodiments. The main control board 1210, interface board 1230, and / or 1240 in the communication device 1200 may implement the functions and / or various steps performed by the communication device in each of the above-mentioned method embodiments and are not described in detail here for the sake of brevity.
[0161] It's worth noting that there may be one or more main control boards (SBUs), which can include both active and standby SBUs. There may also be one or more interface boards. The higher the data processing capabilities of a communications device, the more interface boards it provides. Interface boards can also have one or more physical interface cards. There may be no SBUs, one or more SBUs, and multiple SBUs can be used to achieve load balancing and redundant backup. In a centralized forwarding architecture, communications equipment may not require SBUs; the interface boards handle service data processing for the entire system. In a distributed forwarding architecture, communications equipment can have at least one SBU, which enables data exchange between multiple interface boards, providing high-capacity data exchange and processing capabilities. Therefore, communications equipment with a distributed architecture offers greater data access and processing capabilities than equipment with a centralized architecture. Alternatively, a communications device can consist of a single board, without a switching network board (SBU), integrating the functions of the interface board and the main control board. In this case, the central processing unit (CPU) on the interface board and the CPU on the main control board can be combined into a single CPU on this board, performing the combined functions of the two. This type of device has lower data exchange and processing capabilities (for example, low-end switches or routers). The specific architecture used depends on the specific networking deployment scenario and is not specified here.
[0162] In some possible embodiments, the above communication device may also be implemented by a general-purpose processor.
[0163] For example, the general-purpose processor may be in the form of a chip. Specifically, the general-purpose processor for implementing a communication device includes a processing circuit and an input interface and an output interface internally connected to and communicating with the processing circuit. The processing circuit is used to perform the message generation step in each of the above-mentioned method embodiments through the input interface, the processing circuit is used to perform the receiving step in each of the above-mentioned method embodiments through the input interface, and the processing circuit is used to perform the sending step in each of the above-mentioned method embodiments through the output interface. Optionally, the general-purpose processor may further include a storage medium, and the processing circuit is used to perform the storage step in each of the above-mentioned method embodiments through the storage medium. The storage medium may store instructions executed by the processing circuit, and the processing circuit is used to execute the instructions stored in the storage medium to execute each of the above-mentioned method embodiments.
[0164] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor. It is worth noting that the processor may be a processor that supports the Advanced RISC Machine (ARM) architecture.
[0165] Furthermore, in an optional embodiment, the memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. The memory may also include a non-volatile random access memory. For example, the memory may also store device type information.
[0166] The memory may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM), which is used as an external cache memory. By way of example and not limitation, many forms of RAM are available. For example, static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DR RAM).
[0167] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described herein are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive).
[0168] In the context of the embodiments of the present application, computer program code or related data may be carried by any suitable carrier to enable a device, apparatus, or processor to perform the various processes and operations described above. Examples of carriers include signals, computer-readable media, and the like.
[0169] Examples of signals may include electrical, optical, radio, acoustic or other forms of propagated signals, such as carrier waves, infrared signals, etc.
[0170] A machine-readable medium may be any tangible medium that contains or stores a program for or in connection with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination thereof. More detailed examples of machine-readable storage media include an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0171] Those skilled in the art will clearly understand that, for the sake of convenience and brevity of description, the specific working processes of the above-described systems, devices, and modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0172] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, or can be electrical, mechanical or other forms of connection.
[0173] The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of the present application.
[0174] In addition, the functional modules in the various embodiments of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into a single module. The above-mentioned integrated modules may be implemented in the form of hardware or software functional modules.
[0175] If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0176] In this application, the terms "first", "second", etc. are used to distinguish between identical or similar items that have substantially the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is there any limitation on quantity or order of execution. It should also be understood that although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of the various described examples, a first image may be referred to as a second image, and similarly, a second image may be referred to as a first image. Both the first image and the second image may be images, and in some cases, may be separate and different images.
[0177] It should also be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0178] In this application, the term "at least one" means one or more, and the term "plurality" means two or more. For example, "plurality of second messages" means two or more second messages. The terms "system" and "network" are often used interchangeably herein.
[0179] It should be understood that the terminology used in the description of the various examples herein is for the purpose of describing particular examples only and is not intended to be limiting. As used in the description of the various examples and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
[0180] It will also be understood that the term “comprise” (also known as “includes,” “including,” “comprises,” and / or “comprising”) when used in this specification specifies the presence of stated features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0181] It should also be understood that the terms “if” and “if” may be interpreted to mean “when” or “upon” or “in response to determining” or “in response to detecting.” Similarly, the phrases “if it is determined that ” or “if [stated condition or event] is detected” may be interpreted to mean “upon determining ” or “in response to determining ” or “upon detecting [stated condition or event]” or “in response to detecting [stated condition or event],” depending on the context.
[0182] It should be understood that determining B based on A does not mean determining B based solely on A. B can also be determined based on A and / or other information.
[0183] It should also be understood that references throughout this specification to "one embodiment," "an embodiment," or "one possible implementation" mean that specific features, structures, or characteristics associated with that embodiment or implementation are included in at least one embodiment of the present application. Therefore, the appearance of "in one embodiment," "in an embodiment," or "one possible implementation" throughout this specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0184] The above description is merely an embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for transmitting a message, characterized in that: The method comprises: Obtaining a second VSW corresponding to the first virtual switch VSW, where the first VSW is used to forward a message flow corresponding to a target communication device, and overhead information of the message flow forwarded by the first VSW is first overhead information; Control the second VSW to publish second overhead information for the second VSW to forward the packet flow, where the second overhead information is greater than the first overhead information; During the process of forwarding the message flow by the first VSW, controlling the second VSW to establish a neighbor relationship with the target communication device, and exchanging routing information based on the established neighbor relationship; The VSW used to forward the packet flow is replaced by the second VSW from the first VSW.
2. The method according to claim 1, characterized in that The replacing the VSW used for forwarding the packet flow from the first VSW to the second VSW includes: The VSW used to forward the uplink message flow is replaced by the second VSW from the first VSW through the first virtual interface VIRTIO queue, wherein the uplink message flow is a message flow sent to the target communication device, and the first VIRTIO queue includes the uplink message flow.
3. The method according to claim 2, characterized in that The replacing the VSW used for forwarding the uplink packet flow from the first VSW to the second VSW through the first virtual interface VIRTIO queue includes: When the virtual interface corresponding to the second VSW is in a closed state, the control agent prohibits the second VSW from reading the first VIRTIO queue; Controlling the second VSW to open the virtual interface that is in a closed state; The agent is controlled to prohibit the first VSW from reading the first VIRTIO queue, and the second VSW is controlled to read the first VIRTIO queue, wherein the second VSW is configured to forward the uplink message flow read from the first VIRTIO queue through an open virtual interface.
4. The method according to claim 2 or 3, characterized in that The step of replacing the VSW used for forwarding the packet flow from the first VSW to the second VSW further includes: The VSW used to forward the downlink message flow is replaced by the second VSW from the first VSW through the data table development kit DPDK lock-free queue and the second VIRTIO queue, wherein the downlink message flow is the message flow sent by the target communication device.
5. The method according to claim 4, characterized in that The method of replacing the VSW used for forwarding the downlink message flow from the first VSW to the second VSW by using the data table development kit DPDK lock-free queue and the second VIRTIO queue includes: Control the first VSW to write the downlink message flow received by the first VSW into the DPDK lock-free queue, and control the second VSW to write the downlink message flow received by the second VSW into the DPDK lock-free queue; The control agent reads the DPDK lock-free queue and writes the read downlink message flow into the second VIRTIO queue; The second VSW is controlled to publish third overhead information, where the third overhead information is smaller than the first overhead information. The third overhead information is used by the target communication device to use the second VSW as the VSW for forwarding the downlink message flow in the first VSW and the second VSW.
6. The method according to claim 5, characterized in that After controlling the second VSW to publish the third overhead information, the method further includes: Controlling the agent to prohibit the first VSW from writing the downlink message flow received by the first VSW into the DPDK lock-free queue and the second VIRTIO queue; Control the second VSW to update the downlink message flow received by the second VSW from writing into the DPDK lock-free queue to writing into the second VIRTIO queue.
7. The method according to claim 6, characterized in that After controlling the agent to prohibit the first VSW from writing the downlink message flow received by the first VSW into the DPDK lock-free queue, the method further includes: Delete the first VSW.
8. The method according to any one of claims 5 to 7, characterized in that: The control agent reads the DPDK lock-free queue and writes the read downlink message flow into the second VIRTIO queue, including: Determine the message flow rate of the downstream message flow in the DPDK lock-free queue; Based on the fact that the flow rate of the message flow is not greater than the flow threshold, the agent is controlled to write the read downstream message flow into the second VIRTIO queue in an interrupt manner.
9. The method according to claim 8, characterized in that The method further comprises: Based on the message flow being greater than the flow threshold, the agent is controlled to write the read downstream message flow into the second VIRTIO queue in a polling manner.
10. The method according to any one of claims 1 to 9, characterized in that: The method further comprises: The control agent negotiates and obtains the driver information; The second VSW is controlled to obtain the driver information from the agent, where the driver information is used by the second VSW to forward the message flow.
11. A device for transmitting a message, characterized in that: The device comprises: an acquisition module, configured to acquire a second VSW corresponding to a first virtual switch VSW, wherein the first VSW is configured to forward a message flow corresponding to a target communication device, and wherein overhead information of the message flow forwarded by the first VSW is first overhead information; A control module, configured to control the second VSW to publish second overhead information for the second VSW to forward the packet flow, wherein the second overhead information is greater than the first overhead information; The control module is further configured to control the second VSW to establish a neighbor relationship with the target communication device during the process of the first VSW forwarding the message flow, and to exchange routing information based on the established neighbor relationship; A replacement module is used to replace the VSW used to forward the message flow from the first VSW to the second VSW.
12. The device according to claim 11, characterized in that The replacement module is used to replace the VSW used to forward the uplink message flow from the first VSW to the second VSW through the first virtual interface VIRTIO queue, wherein the uplink message flow is a message flow sent to the target communication device, and the first VIRTIO queue includes the uplink message flow.
13. The device according to claim 12, characterized in that The replacement module is configured to control the agent to prohibit the second VSW from reading the first VIRTIO queue when the virtual interface corresponding to the second VSW is in a closed state; control the second VSW to open the closed virtual interface; control the agent to prohibit the first VSW from reading the first VIRTIO queue and control the second VSW to read the first VIRTIO queue, and the second VSW to forward the uplink message flow read from the first VIRTIO queue through the open virtual interface.
14. The device according to claim 12 or 13, characterized in that The replacement module is further used to replace the VSW used to forward the downlink message flow from the first VSW to the second VSW through the data table development kit DPDK lock-free queue and the second VIRTIO queue, wherein the downlink message flow is the message flow sent by the target communication device.
15. The device according to claim 14, characterized in that The replacement module is used to control the first VSW to write the downlink message flow received by the first VSW into the DPDK lock-free queue, and control the second VSW to write the downlink message flow received by the second VSW into the DPDK lock-free queue; control the agent to read the DPDK lock-free queue and write the read downlink message flow into the second VIRTIO queue; control the second VSW to publish third overhead information, where the third overhead information is less than the first overhead information, and the third overhead information is used by the target communication device to use the second VSW as the VSW for forwarding the downlink message flow in the first VSW and the second VSW.
16. The device according to claim 15, characterized in that The control module is further configured to control the agent to prohibit the first VSW from writing the downstream message flow received by the first VSW into the DPDK lock-free queue and the second VIRTIO queue; and control the second VSW to update the downstream message flow received by the second VSW from being written into the DPDK lock-free queue to being written into the second VIRTIO queue.
17. The device according to claim 16, characterized in that The apparatus further includes: a deleting module, configured to delete the first VSW.
18. The device according to any one of claims 15 to 17, characterized in that: The replacement module is configured to determine a message flow rate of a downstream message flow in the DPDK lock-free queue; and based on the message flow rate being no greater than a flow threshold, control the agent to write the read downstream message flow into the second VIRTIO queue through an interruption.
19. The device according to claim 18, characterized in that The replacement module is further configured to control the agent to write the read downstream message flow into the second VIRTIO queue in a polling manner based on the message flow being greater than the flow threshold.
20. The device according to any one of claims 11 to 19, characterized in that: The control module is further configured to control the agent to negotiate and obtain driver information; and control the second VSW to obtain the driver information from the agent, wherein the driver information is used by the second VSW to forward the message flow.
21. A device for transmitting messages, characterized in that: The device includes a memory and a processor; the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the method for transmitting a message according to any one of claims 1 to 10.
22. A computer-readable storage medium, characterized in that The computer-readable storage medium stores at least one instruction, which is loaded and executed by a processor to implement the method for transmitting a message according to any one of claims 1 to 10.
Citation Information
Patent Citations
SDN-based vehicle self-organizing network mobile switching system and method
CN109618283A
Enhanced virtual switch for network function virtualization
WO2017099921A1