CN114531351A - Method, device and equipment for transmitting message and computer readable storage medium - Google Patents

Method, device and equipment for transmitting message and computer readable storage medium Download PDF

Info

Publication number
CN114531351A
CN114531351A CN202011196928.3A CN202011196928A CN114531351A CN 114531351 A CN114531351 A CN 114531351A CN 202011196928 A CN202011196928 A CN 202011196928A CN 114531351 A CN114531351 A CN 114531351A
Authority
CN
China
Prior art keywords
vsw
queue
message flow
forwarding
virtio
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011196928.3A
Other languages
Chinese (zh)
Inventor
白涛
王芳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Huawei Digital Technologies Co Ltd
Original Assignee
Beijing Huawei Digital Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Huawei Digital Technologies Co Ltd filed Critical Beijing Huawei Digital Technologies Co Ltd
Priority to CN202011196928.3A priority Critical patent/CN114531351A/en
Publication of CN114531351A publication Critical patent/CN114531351A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions

Abstract

The application discloses a method, a device and equipment for transmitting messages and a computer readable storage medium, and belongs to the technical field of communication. The method comprises the following steps: first, a second VSW corresponding to a first VSW for forwarding a message flow corresponding to a target communication device is obtained. And then controlling the second VSW to issue second overhead information of the second VSW forwarding message flow. And the second overhead information is greater than the first overhead information of the first VSW forwarding message flow. And controlling the second VSW to establish a neighbor relation with the target communication equipment in the process of forwarding the message flow by the first VSW, and exchanging routing information based on the established neighbor relation. And then, replacing the VSW used for forwarding the message flow from the first VSW to the second VSW. The process of establishing the neighbor relation and exchanging the routing information by the second VSW can not cause packet loss, so that the packet loss time in the VSW updating process is shortened, and the packet loss rate in the message transmission process is reduced.

Description

Method, device and equipment for transmitting message and computer readable storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method, an apparatus, a device, and a computer-readable storage medium for transmitting a packet.
Background
With the development of communication technology, more and more modes for message transmission between different communication devices are available. One of the methods is to transmit a message through a Virtual Machine (VM) or a point of deployment (POD) installed on a physical communication device. In the method of message transmission through VM/POD, VM/POD performs communication connection with a target communication device through a Virtual Switch (VSW) on a physical communication device, thereby implementing transmission of a message. In practical application, VSW is often updated irregularly, and how to ensure the transmission effect of message transmission in the updating process of VSW is a problem to be solved urgently.
In the related art, first, a Network Interface Controller (NIC) corresponding to an old version of VSW is disconnected, so that the communication connection between the VM/POD and the target communication device is disconnected, and packet loss starts to occur. And then, establishing a new-version VSW, and allocating the NIC to the new-version VSW, so that the new-version VSW can establish a neighbor relation with the target communication equipment, and exchange routing information based on the established neighbor relation, thereby reestablishing the communication connection between the VM/POD and the target communication equipment, and ending the packet loss process. Therefore, the packet loss time in the related art is: and the sum of the time required for establishing the new version of VSW, switching NIC, establishing the neighbor relation between the new version of VSW and the target communication equipment and interacting the routing information.
However, when at least one of a case where the number of NICs requiring handover is large and a case where the amount of routing information is large occurs, the packet loss time in the VSW update process is also long in the method provided in the related art. Therefore, the packet loss rate in the message transmission process is high, and the message transmission effect is affected.
Disclosure of Invention
The embodiment of the application provides a method, a device, equipment and a computer readable storage medium for transmitting messages, which are used for solving the problems provided by the related technology, and the technical scheme is as follows:
in a first aspect, a method for transmitting a packet is provided, where the method includes:
first, a second VSW corresponding to a first VSW for forwarding a message flow corresponding to a target communication device is obtained. And then controlling the second VSW to issue second overhead information of the second VSW forwarding message flow. And the second overhead information is greater than the first overhead information of the first VSW forwarding message flow. And controlling the second VSW to establish a neighbor relation with the target communication equipment in the process of forwarding the message flow by the first VSW, and exchanging routing information based on the established neighbor relation. And then, replacing the VSW used for forwarding the message flow from the first VSW to the second VSW.
After a second VSW for replacing a first VSW is obtained, by controlling second overhead information issued by the second VSW, where the second overhead information is greater than first overhead information required by the first VSW to forward a message flow, a target communication device selects the first VSW from the first VSW and the second VSW as a VSW for forwarding the message flow. Therefore, the second VSW can establish the neighbor relation and exchange the routing information on the premise that the first VSW forwards the message flow and does not generate packet loss. And after the second VSW establishes the neighbor relation and exchanges the routing information, replacing the first VSW with the second VSW. In this embodiment, the process of establishing the neighbor relation and exchanging the routing information by the second VSW does not cause packet loss, so that the packet loss time in the VSW updating process is shortened, and the packet loss rate in the message transmission process is reduced.
In one possible implementation manner, replacing a VSW used for forwarding a packet flow from a first VSW to a second VSW includes: and replacing the VSW used for forwarding 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 equipment, and the first VIRTIO queue comprises the uplink message flow.
In one possible implementation manner, replacing a VSW for forwarding an upstream packet flow from a first VSW to a second VSW through a first virtual interface VIRTIO queue includes: in the process that 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 a second VSW to open a virtual interface in a closed state; and the control agent prohibits the first VSW from reading the first VIRTIO queue, controls the second VSW to read the first VIRTIO queue, and the second VSW is used for forwarding the uplink message flow read from the first VIRTIO queue through the virtual interface in the open state.
In a possible implementation manner, replacing a VSW used for forwarding a packet flow from a first VSW to a second VSW further includes: and replacing the VSW used for forwarding the downlink message flow from the first VSW to the second VSW through the DPDno-lock queue of the data table development kit and the second VIRTIO queue, wherein the downlink message flow is the message flow sent by the target communication equipment.
In a possible implementation manner, replacing a VSW used for forwarding a downlink packet flow from a first VSW to a second VSW through a DPDK lock-free queue of a data table development kit and a second VIRTIO queue includes: controlling the first VSW to write the downlink message flow received by the first VSW into a DPDK lock-free queue, and controlling 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 a second VIRTIO queue; and controlling the second VSW to release third overhead information, wherein the third overhead information is smaller than the first overhead information, and the third overhead information is used for the target communication equipment to take the second VSW as the VSW for forwarding the downlink message flow in the first VSW and the second VSW.
In one possible implementation, after controlling the second VSW to issue the third overhead information, the method further includes: the control agent prohibits 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; and controlling the second VSW to update the downlink message flow received by the second VSW from the DPDK lock-free queue to the second VIRTIO queue.
In a possible implementation manner, after the control agent prohibits the first VSW from writing the downlink packet stream received by the first VSW into the DPDK lock-free queue, the method further includes: the first VSW is deleted.
In a possible implementation manner, the controlling agent reads the DPDK lock-free queue and writes the read downlink packet stream into the second VIRTIO queue, including: determining the message flow of the downlink message flow in the DPDK lock-free queue; and based on the fact that the flow of the message flow is not larger than the flow threshold value, the control agent writes the read downlink message flow into a second VIRTIO queue in an interruption mode.
In one possible implementation, the method further includes: and based on the fact that the flow of the message flow is larger than the flow threshold value, the control agent writes the read downlink message flow into a second VIRTIO queue in a polling mode.
In one possible implementation, the method further includes: the control agent negotiates to obtain driving information; and controlling the second VSW to obtain driving information from the agent, wherein the driving information is used for the second VSW to forward the message flow.
In a second aspect, an apparatus for transmitting a packet is provided, the apparatus including:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a second VSW corresponding to a first virtual switch VSW, the first VSW is used for forwarding a message flow corresponding to target communication equipment, and the overhead information of the message flow forwarded by the first VSW is first overhead information;
the control module is used for controlling the second VSW to issue second overhead information of the second VSW forwarding message flow, wherein the second overhead information is larger than the first overhead information;
the control module is also used for controlling the second VSW to establish a neighbor relation with the target communication equipment in the process of forwarding the message flow by the first VSW, and exchanging routing information based on the established neighbor relation;
and the replacing module is used for replacing the VSW used for forwarding the message flow from the first VSW to the second VSW.
In a possible implementation manner, the replacing module is configured to replace, by a first VSW, a VSW used for forwarding an uplink packet flow from the first VSW to a second VSW through a first virtual interface VIRTIO queue, where the uplink packet flow is a packet flow sent to a target communication device, and the first VIRTIO queue includes the uplink packet flow.
In a possible implementation manner, the replacement module is configured to prohibit, by the control agent, the second VSW from reading the first VIRTIO queue when the virtual interface corresponding to the second VSW is in the closed state; controlling a second VSW to open a virtual interface in a closed state; and the control agent prohibits the first VSW from reading the first VIRTIO queue, controls the second VSW to read the first VIRTIO queue, and the second VSW is used for forwarding the uplink message flow read from the first VIRTIO queue through the virtual interface in the open state.
In a possible implementation manner, the replacement module is further configured to replace, by the first VSW and the second VSW, the VSW for forwarding the downlink packet flow from the first VSW to the second VSW through the DPDK lock-free queue of the data table development kit and the second VIRTIO queue, where the downlink packet flow is a packet flow sent by the target communication device.
In a possible implementation manner, the replacement module is configured to control the first VSW to write the downlink packet stream received by the first VSW into the DPDK lock-free queue, and control the second VSW to write the downlink packet stream 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 a second VIRTIO queue; and controlling the second VSW to release third overhead information, wherein the third overhead information is smaller than the first overhead information, and the third overhead information is used for the target communication equipment to take the second VSW as the VSW for forwarding the downlink message flow in the first VSW and the second VSW.
In a possible implementation manner, the control module is further configured to control the agent to prohibit the first VSW from writing the downlink packet stream received by the first VSW into the DPDK lock-free queue and the second VIRTIO queue; and controlling the second VSW to update the downlink message flow received by the second VSW from the DPDK lock-free queue to the second VIRTIO queue.
In one possible implementation, the apparatus further includes: a deletion module to delete the first VSW.
In a possible implementation manner, the replacement module is configured to determine a packet flow rate of a downlink packet flow in a DPDK lock-free queue; and based on the fact that the flow of the message flow is not larger than the flow threshold, the control agent writes the read downlink message flow into a second VIRTIO queue in an interrupt mode.
In a possible implementation manner, the replacement module is further configured to, based on that the flow of the message stream is greater than the flow threshold, control the agent to write the read downlink message stream into the second VIRTIO queue in a polling manner.
In a possible implementation manner, the control module is further configured to control the agent to negotiate to obtain the driving information; and controlling the second VSW to obtain driving information from the agent, wherein the driving information is used for the second VSW to forward the message flow.
In a third aspect, an apparatus for transmitting a packet is provided, where the apparatus includes: a transceiver, a memory, and a processor. Wherein 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 by the memory to control the transceiver to receive signals and control the transceiver to transmit signals, and when the processor executes the instructions stored by the memory, to cause the processor to perform the method of the first aspect or any of the possible embodiments of the first aspect.
Optionally, there are one or more processors and one or more memories.
Alternatively, the memory may be integrated with the processor, or provided separately from the processor.
In a specific implementation process, the memory may be a non-transient memory, such as a Read Only Memory (ROM), which may be integrated on the same chip as the processor, or may be separately disposed on different chips.
In a fourth aspect, there is provided a computer program (product) comprising: computer program code which, when run by a computer, causes the computer to perform the method of the above-mentioned aspects.
In a fifth aspect, there is provided a computer readable storage medium storing a program or instructions, the method of the above aspects being performed when the program or instructions are run on a computer.
In a sixth aspect, there is provided a chip comprising a processor for retrieving from a memory and executing instructions stored in the memory, so that a communication device in which the chip is installed performs the method in the above aspects.
In a seventh aspect, another chip is provided, including: the system comprises an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected through an internal connection path, the processor is used for executing codes in the memory, and when the codes are executed, the processor is used for executing the method in each aspect.
Drawings
FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application;
FIG. 2 is a schematic diagram of an implementation environment provided by an embodiment of the present application;
fig. 3 is a flowchart of a method for transmitting a message according to an embodiment of the present application;
fig. 4 is a schematic flowchart of a message transmission process according to an embodiment of the present application;
fig. 5 is a schematic diagram of proxy negotiation provided in an embodiment of the present application;
fig. 6 is a schematic structural diagram of Vring provided in an embodiment of the present application;
fig. 7 is a schematic flowchart of an uplink replacement process according to an embodiment of the present application;
fig. 8 is a schematic flowchart of a downlink replacement process according to an embodiment of the present application;
fig. 9 is a schematic diagram of a DPDK lock-free queue according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of an apparatus for transmitting a message according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of a communication device according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of a communication device according to an embodiment of the present application.
Detailed Description
The terminology used in the description of the embodiments section of the present application is for the purpose of describing particular embodiments of the present application only and is not intended to be limiting of the present application.
With the development of communication technology, different communication devices can transmit messages through a VM or a POD. Wherein, based on the installation of VM/POD and VSW on one physical communication device (host), VM/POD and target communication device are respectively connected with VSW in communication. The VSW can be used for forwarding a message, thereby implementing message transmission between the VM/POD and the target communication device, that is, implementing message transmission between the physical communication device and the target communication device. In the actual application process, the VSW may be updated irregularly according to needs, and the VSW updating process often results in packet loss.
For example, the VSW update procedure provided by the related art is as follows: first, the NIC corresponding to the old VSW is disconnected, the communication connection between the VM/POD and the target communication device is disconnected, and the packet loss process starts. And then, establishing a new-version VSW, and allocating the NIC corresponding to the old-version VSW to the new-version VSW, so that the new-version VSW can establish a neighbor relation with the target communication equipment, and exchange routing information based on the established neighbor relation, thereby reestablishing communication connection between the VM/POD and the target communication equipment, and ending the packet loss process. Therefore, the packet loss time in the related art is: and the sum of the time required for establishing the new version of VSW, switching NIC, establishing the neighbor relation between the new version of VSW and the target communication equipment and interacting the routing information.
When the amount of routing information is large, the time taken to exchange routing information is also long. For example, in the case where the amount of routing information is on the order of millions, the time taken to exchange routing information may be as long as tens of seconds. When the number of NICs to be switched is large, it takes a long time to switch the NICs. Therefore, when at least one of the situations of a large amount of routing information and a large number of NICs occurs, the packet loss time in the related art is long. Therefore, the packet loss rate in the message transmission process is increased, and the message transmission effect is influenced. Therefore, how to shorten the packet loss time and reduce the packet loss rate in the VSW updating process is an urgent problem to be solved by those skilled in the art.
Referring to fig. 1, an embodiment of the present application provides a method for transmitting a packet, where the method may be applied in the implementation environment shown in fig. 1. In fig. 1, a physical communication apparatus 101 and a target communication apparatus 102 are included, and the physical communication apparatus 101 includes a VM/POD, a VSW, a NIC, and a client. The VM/POD is communicatively coupled to the VSW via a virtual input/output (virtual) interface, and the VSW is further communicatively coupled to the target communication device 102 via the NIC. The VSW is configured to forward the message sent by the VM/POD to the target communication device 102, and forward the message sent by the target communication device 102 to the VM/POD. In addition, the VSW is also in communication connection with the client, so that the client can control the VSW to implement the method for transmitting the packet provided by this embodiment.
Illustratively, in addition to the implementation environment shown in fig. 1, an agent (agent) is also included in the physical communication device 101. Referring to fig. 2, the agents are communicatively coupled to the VSW, VM/POD and client, respectively. The role of the agent in this embodiment will be described in detail in the method embodiment, and will not be described herein again. Additionally, the target communication device 102 includes, but is not limited to, a Provider Edge (PE) device. In this case, the NIC is communicatively connected to the target communication device 102 through a top of rack (TOR) wiring scheme or a Route Reflector (RR), for example.
Based on the implementation environments shown in fig. 1 and fig. 2, the embodiment of the present application provides a method for transmitting a packet. Taking the method applied to the client in the physical communication device as an example, referring to fig. 3, the method includes the following procedures.
301, obtaining a second VSW corresponding to the 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.
The first VSW is a VSW in a message flow forwarding state, and the message flow includes a plurality of data packets. Exemplarily, the first VSW being in the message flow forwarding state means: the first VSW is forwarding a packet in the message flow to the target communication device or VM/POD. Alternatively, the first VSW may have finished forwarding one packet and may begin forwarding another packet after a certain time, that is, the first VSW is in the forwarding interval of two packets. In this embodiment, the first VSW first issues appropriate first overhead information, so that when the target communication device needs to perform message transmission with the physical communication device where the first VSW is located, the first VSW is selected as the VSW for forwarding the message flow according to the first overhead information. After the target communication device completes the selection, the first VSW may transition into a message flow forwarding state.
The message flow forwarded by the first VSW is the message flow corresponding to the target communication equipment, and the first VSW realizes the forwarding of the message flow through an NIC on the physical communication equipment where the first VSW is located. The message flow corresponding to the target communication device comprises at least one of an uplink message flow and a downlink message flow. The uplink message flow refers to a message flow in which the VM/POD serves as a sending end and the target communication device serves as a receiving end. For example, referring to 401 in fig. 4, after receiving the upstream packet flow sent by the VM/POD, the first VSW forwards the upstream packet flow to the destination communication device through the NIC1 and the NIC 2. Correspondingly, the downlink message flow refers to the message flow of the target communication device as the sending end and the VM/POD as the receiving end. Still referring to 401 in fig. 4, the first VSW first receives the downstream message flow sent by the target communication device through the NIC1 and the NIC2, and then forwards the downstream message flow to the VM/POD. It can be understood that the NICs 1 and 2 shown in fig. 4 are only examples, and the number of NICs corresponding to the first VSW is not limited in this embodiment. In addition to the two NICs shown in fig. 4, the first VSW can correspond to three, four, or more NICs.
And the second VSW corresponding to the first VSW is used for replacing the first VSW, and the process of replacing the first VSW with the second VSW is the updating process of the VSW. In this embodiment, the process of acquiring the second VSW includes: a second VSW instance is established on the physical communication device on which the first VSW resides. And acquiring a configuration file, and configuring the second VSW instance based on the configuration information in the configuration file, so as to acquire the second VSW corresponding to the first VSW.
The first VSW occupies a Central Processing Unit (CPU) and a memory of the physical communication device where the first VSW is located, so as to ensure normal operation of the first VSW. In this embodiment, the second VSW instance and the first VSW share the CPU and the memory occupied by the first VSW, so that the second VSW can also normally operate. Illustratively, the memory of the physical communication device adopts a paging memory mechanism, that is, the memory is divided into a plurality of memory pages for management and use, thereby avoiding waste of memory space. Considering that the use efficiency of the memory may be affected by a large number of memory pages, the embodiment may further adopt a large-page (pagepage) memory mechanism on the basis of the paged memory mechanism, and the paged memory mechanism is different from the large-page memory mechanism in the size of the memory pages. For example, the size of a memory page in a paged memory mechanism is about 4 Kilobytes (KB), while the size of a memory page in a large page memory mechanism is about 4 Megabytes (MB).
In addition, the configuration information included in the configuration file may be different in different service scenarios. Exemplary configuration information includes, but is not limited to: maximum cost (max cost) information corresponding to the second VSW, loopback (loopback) interface information that the second VSW can call, Internet Protocol (IP) address information corresponding to the loopback interface, and source address indication information. For ease of understanding, the above source address indication information is explained: in the subsequent process, the second VSW establishes a Border Gateway Protocol (BGP) neighbor relationship with the target communication device, so that a Transmission Control Protocol (TCP) connection is formed 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. The process for the second VSW to establish a BGP neighbor relationship with the target communication device may be referred to as 303 below.
In this embodiment, a VIRTIO queue (virtuue) is required between the second VSW and the VM/POD. Wherein the second VSW is configured to act as a back-end handler, the VM/POD is configured to act as a front-end driver, and the VIRTIO queue is configured to enable communication between the second VSW and the VM/POD. And when the second VSW is used for forwarding the message flow in the subsequent process, 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 equipment to the VM/POD through the VIRTIO queue, so that the message flow is forwarded. To establish the VIRTIO queue, the second VSW needs to negotiate with the VM/POD to obtain the driving information. The driving information is used for indicating the communication functions that the second VSW and the VM/POD can provide in the communication process, so that the second VSW can realize forwarding of the message flow. A VIRTIO queue between the second VSW and the VM/POD can then be established based on the drive information.
Illustratively, this negotiation process is accomplished in this embodiment by a proxy instead of the second VSW to ensure that the second VSW is not directly aware of the negotiation process. That is, the method provided by the present embodiment further includes: the control agent negotiates to obtain the drive information. And controlling the second VSW to obtain driving information from the agent, wherein the driving information is used for the second VSW to forward the message flow.
Referring to fig. 5, in the present 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 driving information, and the second VSW does not need to negotiate by itself but directly obtains the negotiated driving information from the agent. After the second VSW obtains the driving information, a VIRTIO queue between the second VSW and the VM/POD is established, and a virtual interface corresponding to the second VSW is in a closed state by default. It can be appreciated that in actual practice, the agent may have been installed before the first VSW was used to forward the message flow. In this case, the agent can also negotiate with the VM/POD instead of the first VSW, and the first VSW can establish a VIRTIO queue with the VM/POD without sensing the negotiation process, so that the first VSW can be used to forward the packet flow.
In fig. 5, the agent just negotiates with the VM/POD instead of the first VSW and the second VSW, and the real backend handler in the VIRTIO queue is still the first VSW (or the second VSW). The vUser in fig. 5 is used to indicate that the first VSW (or the second VSW) is the actual back-end handler. In addition, the Polling Mode Driver (PMD) in fig. 5 is used to indicate that the first VSW and the second VSW support the polling mode, and the user space interface (UIO) is used to indicate that the first VSW and the second VSW support the interrupt mode. The polling mode and the interrupt mode will be described later, and will not be described herein.
Referring to fig. 6, the VIRTIO queue is implemented by Vring, and fig. 6 shows a structural diagram of Vring. In fig. 6, Vring includes: a descriptor array (desc), an available ring buffer (available ring) and a used ring buffer (used ring), both of which are formed by a plurality of buffer areas (buffers). Wherein desc is used to store descriptors, each descriptor being used to indicate whether a buffer area is occupied or not. Therefore, the first VSW (or the second VSW) and the VM/POD can transmit the message flow according to the indication of each descriptor. Taking the example that the VM/POD sends the message flow to the second VSW, the VM/POD determines the first buffer which is not occupied in the available ring buffer according to the indication of each descriptor, and writes the message flow into the first buffer. And then, the descriptor corresponding to the first buffer is sent to the second VSW, and the second VSW can read the message flow from the first buffer according to the descriptor. And the second VSW also determines an unoccupied second buffer from the used ring buffer according to the indication of each descriptor, and writes the message flow read from the first buffer into the second buffer, thereby completing the reception of the message flow.
It should be noted that the VIRTIO queue between the second VSW and the VM/POD includes a first VIRTIO queue for performing uplink packet stream transmission and a second VIRTIO queue for performing downlink packet stream transmission. The functions of the first VIRTIO queue and the second VIRTIO queue will be described in detail in the following 304, and will not be described herein again.
And 302, controlling the second VSW to issue second overhead information of the second VSW forwarding message flow, where the second overhead information is greater than the first overhead information.
As can be seen from the description in 301, the first VSW corresponds to more than two NICs. In this embodiment, among all NICs corresponding to the first VSW, a part of NICs are reassigned to the second VSW. Thus, the second VSW can issue the second overhead information through the assigned NIC, while the first VSW can continue to be used for forwarding the message flow through the remaining NICs. In this embodiment, the number of NICs allocated to the second VSW is not limited, as long as it is ensured that at least one NIC corresponds to each of the first VSW and the second VSW after the allocation is completed. Illustratively, the present embodiment allocates half of all NICs corresponding to the first VSW to the second VSW. In the process of switching the NICs, when the connection between the first VSW and the part of NICs is disconnected, the data packet forwarded through the disconnected part of NICs may be discarded, thereby causing a packet loss. Taking the case of thousands of NICs as an example, the packet loss time is about 100 milliseconds.
Referring to 401 in fig. 4, before reallocating the NICs, the first VSW performs forwarding of the message flow through the NIC1 and the NIC 2. Thereafter, the NIC2 is closed, disconnecting the first VSW from the NIC 2. Then, the NIC2 and the second VSW are connected, the NIC2 is turned on after successful connection, and a un-shutdown (unshut) operation is performed on the NIC2, so that the NIC2 enters a running state, thereby implementing NIC reallocation. The NIC usage after reassignment of NICs is shown at 402 in fig. 4. From 402, it can be seen that the first VSW does not use the NIC2 any more, and only forwards the message flow through the NIC1, and the second VSW issues the second overhead information through the NIC 2.
And after the NICs are redistributed, controlling the second VSW to issue second overhead information corresponding to the second VSW through the distributed NICs. The target communication device selects the VSW with the smaller overhead information as the VSW for forwarding the message flow, and the second overhead information issued by the second VSW is larger than the first overhead information required by the first VSW for forwarding the message flow, so that 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 selects, the first VSW is always in the message flow forwarding state, and no packet loss occurs. Exemplarily, in this embodiment, the second VSW issues the second overhead information using an intermediate-system-to-intermediate-system (ISIS) protocol or an equivalent-cost multi-path routing (ECMP), where the second overhead information is the maximum overhead information corresponding to the second VSW.
Of course, in addition to the above-described manners, this embodiment also provides other optional manners, so that the target communication device selects the first VSW as the VSW for forwarding the packet flow from the first VSW and the second VSW. In this approach, a request is sent to a network management device for managing a target communication device, where the request is used for the network management device to send an instruction to the target communication device, where the instruction is used to instruct the target communication device to use a first VSW as a VSW for forwarding a packet flow. Therefore, the target communication device does not need to select according to the first overhead information and the second overhead information, and the first VSW is directly used as the VSW for forwarding the message flow according to the received instruction.
303, in the process of forwarding the message flow by the first VSW, controlling the second VSW to establish a neighbor relation with the target communication device, and exchanging routing information based on the established neighbor relation.
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. Then, the message transmission process between the VM/POD and the target communication device is not interrupted, i.e. no packet loss occurs. And under the condition that the message transmission process is not interrupted, controlling the second VSW to establish a BGP neighbor relation with the target communication equipment, and carrying out routing information interaction based on the established BGP neighbor relation. That is, the process of the first VSW continuing to forward the packet flow is performed synchronously with the process of the second VSW establishing the neighbor relation and exchanging the routing information. Therefore, in this embodiment, the process of establishing the neighbor relationship and exchanging the routing information by the second VSW does not affect the message transmission process between the VM/POD and the target communication device, and thus, packet loss is not caused.
Illustratively, referring to fig. 4, in a case where the second VSW needs to be communicatively connected to the target communication device through the NIC and the 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 is able to publish routing information. After learning the routing information issued by the TOR/RR, the second VSW can be configured to forward the packet flow sent by the VM/POD to the TOR/RR, and the TOR/RR forwards the received packet flow to the target communication device, thereby implementing packet 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 including, but not limited to, VM/POD host routes and traffic routes. After learning the routing information issued by the second VSW, the target communication device 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 implementing message transmission from the target communication device to the VM/POD.
It should be noted that, according to 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 a shutdown (shutdown) state by default. Therefore, although the second VSW obtains the capability of forwarding the message flow through the process of establishing the BGP neighbor relationship and exchanging the routing information, the second VSW does not directly forward the message flow. In this embodiment, the second VSW is used for forwarding the message flow only in the process of replacing the first VSW, which is described in detail in 304.
And 304, replacing the VSW used for forwarding the message flow from the first VSW to the second VSW.
As can be seen from the description in 301, the message stream includes an uplink message stream and a downlink message stream, and in this embodiment, the uplink replacement and the downlink replacement are performed in different manners. Wherein, the uplink replacement means: and replacing the VSW used for forwarding the upstream message flow by a second VSW from the first VSW. The downlink replacement means: and replacing the VSW used for forwarding the downlink message flow by a second VSW from the first VSW. In this embodiment, the execution order of the uplink replacement and the downlink replacement is not limited, and the uplink replacement and the downlink replacement may be executed in series or in parallel according to actual needs. Next, the procedure of the uplink replacement and the downlink replacement will be described.
Uplink replacement: referring to fig. 7, the VSW used to forward the upstream packet flow is replaced by a second VSW from the first VSW through the first VIRTIO queue. And the VM/POD writes the uplink message flow into a first VIRTIO queue, and the first VIRTIO queue comprises the uplink message flow. And then, realizing an uplink replacement process by controlling the reading permission of the first VSW and the second VSW for the first VIRTIO queue.
Illustratively, replacing the VSW for forwarding the upstream packet flow by the first VIRTIO queue from the first VSW to the second VSW includes the following processes.
304a1, the control agent prohibits the second VSW from reading the first VIRTIO queue while the virtual interface corresponding to the second VSW is in the closed state.
Because the virtual interface corresponding to the second VSW is in a closed state by default, the second VSW does not forward the message flow. Under the condition that the virtual interface corresponding to the second VSW is kept in the closed state, the control agent in this embodiment prohibits the second VSW from reading the first VIRTIO queue. That is to say, the second VSW does not have the read permission of the first VIRTIO queue, and the second VSW cannot read the upstream packet flow from the first VIRTIO queue. Illustratively, the agent manages an upstream read lock, and the VSW that can invoke the upstream read lock has read permission of the first VIRTIO queue. Thus, the way the agent prohibits the second VSW from reading the first VIRTIO queue includes: the second VSW is prohibited from invoking the upstream read lock.
304a2, controls the second VSW to open the virtual interface in the off state.
And after the agent prohibits the second VSW from reading the first VIRTIO queue, controlling the second VSW to open the virtual interface in the closed state, so as to obtain the virtual interface in the open state. However, since the second VSW cannot read the upstream packet flow from the first VIRTIO queue, the second VSW cannot forward the upstream packet flow to the target communication device through the virtual interface in the on state.
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, and the second VSW is configured to forward the upstream packet flow read from the first VIRTIO queue through the virtual interface in the open state.
In 304a1 and 304a2, the first VSW has the read permission of the first VIRTIO queue, so that the first VSW can read the upstream packet flow from the first VIRTIO queue, thereby forwarding the upstream packet flow. And after the control agent prohibits the first VSW from reading the first VIRTIO queue, the first VSW does not have the reading permission of the first VIRTIO queue any more and cannot be continuously used for forwarding the uplink message flow. And then, the agent controls the second VSW to read the first VIRTIO, so that the second VSW can read the uplink 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 on state. Thus, the upstream replacement process of replacing the VSW for forwarding the upstream packet flow from the first VSW to the second VSW is completed. Illustratively, in 304a3, the agent disables the first VSW from reading the first VIRTIO queue by disabling the first VSW from invoking the upstream read lock, and controls the second VSW to read the first VIRTIO queue by controlling the first VSW from invoking the upstream read lock.
Referring to fig. 4, 403 in fig. 4 shows a case where the upward replacement process has been completed and the downward replacement process has not been completed. According to 403, after the uplink replacing process is completed, the second VSW forwards the uplink packet flow read from the first VIRTIO queue to the target communication device, and the first VSW is no longer used for forwarding the uplink packet flow, but is only used for forwarding the downlink packet flow sent by the target communication device to the VM/POD.
In the uplink replacing process, after the agent prohibits the first VSW from reading the first VIRTIO queue, the data packet in the uplink message flow, which is read from the first VIRTIO queue by the first VSW but is not forwarded yet, is discarded. In addition, after the agent controls the second VSW to read the first VIRTIO queue, within a certain time, the data packet in the uplink packet flow forwarded by the second VSW to the target communication device may have disorder, and the data packet having the disorder may also be discarded. In practical application, the packet loss time in the uplink replacement process is about 200 milliseconds.
As shown in fig. 7, prior to the upstream replacement process, the upstream message flow is read from the first VIRTIO queue by the first VSW. The upstream packet flow read by the first VSW includes packets such as F3P 1, F3P 2, and F4P 1. Wherein, F is used to indicate message flow (flow), and P is used to indicate data packet (packet) in message flow. Thereafter, the first VSW forwards the upstream message flow read by the first VSW to the PE device through the NIC 1. And after the uplink replacement process is completed, the second VSW forwards the uplink message flow read by the second VSW to the PE device. In fig. 7, the upstream packet flow read by the second VSW includes packets such as F4P 2, F4P 3, and F3P 3.
Downlink replacement: referring to fig. 8, a VSW for forwarding a downlink message stream is replaced from a first VSW to a second VSW through a Data Plane Development Kit (DPDK) lock-free (unlocked) queue and a second VIRTIO queue, where the downlink message stream is a message stream that has been sent by a target communication device. In this embodiment, the downlink replacement process is implemented by controlling the write permission of the first VSW and the second VSW for the DPDK lock-free queue.
Exemplarily, the VSW for forwarding the downlink packet flow is replaced from the first VSW to the second VSW through the DPDK lock-free queue and the second VIRTIO queue, including the following processes.
304B1, controlling the first VSW to write the downlink packet stream received by the first VSW into the DPDK lock-free queue, and controlling the second VSW to write the downlink packet stream received by the second VSW into the DPDK lock-free queue.
Before the first VSW is not controlled, the first VSW directly writes the downlink message flow received by the first VSW into the second VIRTIO queue. Correspondingly, the VM/POD reads the downlink message flow from the second VIRTIO queue, so that the first VSW can realize the forwarding of the downlink message flow. After controlling the first VSW to write the downlink packet stream received by the first VSW into the DPDK lock-free queue, the first VSW does not write the downlink packet stream received by the first VSW into the second VIRTIO queue any longer, but writes the downlink packet stream received by the first VSW into the DPDK lock-free queue.
In addition, because the second overhead information issued 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 packet flow to the second VSW, and the second VSW does not receive the downlink packet flow. Therefore, the purpose of controlling the second VSW to write the downlink packet stream received by the second VSW into the DPDK lock-free queue is to: after the second VSW receives the downlink packet stream in the subsequent process, the downlink packet stream received by the second VSW is written into the DPDK lock-free queue and not written into the second VIRTIO queue.
304B2, the control agent reads the DPDK lock-free queue and writes the read downlink packet stream into the second VIRTIO queue.
After controlling the first VSW to write the downlink packet stream received by the first VSW into the DPDK lock-free queue, the DPDK lock-free queue includes the downlink packet stream written by the first VSW. Therefore, the control agent needs to read the downlink packet flow from the DPDK lock-free queue and write the read downlink packet flow into the second VIRTIO queue, and the VM/POD still obtains the downlink packet flow sent by the target communication device by reading the second VIRTIO queue.
Illustratively, the controlling agent reads the DPDK lock-free queue and writes the read downlink packet stream into the second VIRTIO queue, including: and determining the message flow of the downlink message flow in the DPDK lock-free queue, and based on the fact that the message flow is not larger than a flow threshold value, controlling the agent to write the read downlink message flow into a second VIRTIO queue in an interrupt mode. Correspondingly, the method further comprises: and based on the fact that the flow of the message flow is larger than the flow threshold value, the control agent writes the read downlink message flow into a second VIRTIO queue in a polling mode. In this embodiment, the flow threshold is not limited, and the value of the flow threshold may be selected according to actual needs.
Wherein, reading by the interrupt mode means: and after detecting that the downlink message stream is written into the DPDK lock-free queue, the agent reads from the DPDK lock-free queue. Reading by polling means: and the agent actively inquires the DPDK lock-free queue at regular intervals, and reads the DPDK lock-free queue if the DPDK lock-free queue is inquired to have downlink message flow. Under the condition that the agent reads in a polling mode, each thread for inquiring terminates after inquiring the downlink message flow. Therefore, if the polling method is adopted when the message flow rate is smaller than the flow rate threshold, each thread may need to wait for a long time to terminate due to the small message flow rate. Therefore, multiple threads are blocked, and more CPU resources are occupied. Therefore, based on the fact that the flow rate of the packet flow is not greater than the flow rate threshold, the present embodiment does not adopt the polling method, but the control agent adopts the interrupt method to perform reading. For the case that the flow rate of the message flow is greater than the flow threshold, the above-mentioned problem of thread blocking does not occur, so this embodiment can control the agent to read the downlink message flow in a polling manner.
Illustratively, the DPDK lock-free queue in this embodiment is a DPDK runtime environment (RTE) First In First Out (FIFO) queue. Wherein the DPDK RTE FIFO queue supports multiple producer (producer) synchronous writes and multiple consumer (consumer) synchronous reads. 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 received downlink packet flows into the queue. In addition, the agent is equivalent to a producer in the queue, reads the downlink message stream from the queue, and writes the read downlink message stream into the second VIRTIO queue. Through the DPDK RTE FIFO queue, the first VSW and the second VSW are prevented from generating conflict in the subsequent synchronous writing process, and the efficiency of writing messages is ensured.
In the DPDK RTE FIFIFIO queue, conflict generated in the process of synchronously writing by a plurality of producers is avoided through a head identifier (head) and a tail identifier (tail). Referring to fig. 9, a first VSW, as a producer, starts writing from location 1, moves the head to location 2, where the first VSW expects to end writing. If a second VSW, which is another producer, also needs to write synchronously, the second VSW will start writing from location 2 and move the head to location 3 where the write is expected to end. Therefore, the first VSW writes between location 1 and location 2, and the second VSW writes between location 2 and location 3, avoiding collisions during simultaneous writes.
After the first VSW actually ends writing, the tail is moved to a position (e.g., position 2 shown in fig. 9) where the first VSW actually ends writing. After the second VSW actually ends writing and determines that the first VSW has also actually ended writing, tail is moved to a location where the second VSW actually ends writing (e.g., location 3 shown in fig. 9).
In addition, in the case that a plurality of consumers need to synchronously read, the plurality of consumers also avoid conflict in the process of synchronously reading by the plurality of consumers through a head identification (head) and a tail identification (tail). However, since only one consumer, i.e., the above proxy, is included in this embodiment, the manner of synchronous reading by multiple consumers is not described in detail.
304B3, controlling the second VSW to issue third overhead information, where 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, and takes the second VSW as a VSW for forwarding the downstream packet flow.
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 issue the third overhead information smaller than the first overhead information, the target communication device does not select the first VSW as the VSW for forwarding the downlink message flow any more, but reselects the second VSW from the first VSW and the second VSW as the VSW for forwarding the downlink message flow. After the target communication device reselects the VSW for forwarding the downstream packet flow, a protocol convergence process is started. After the protocol convergence, the downstream message flow sent by the target communication device is switched from the first VSW to the second VSW. Therefore, the first VSW no longer receives the downlink message flow, and the second VSW starts receiving the downlink message flow.
In the process of switching the downlink message flow from the first VSW to the second VSW, the first VSW writes the received downlink message flow which is not yet forwarded into the DPDK lock-free queue. In addition, since the second VSW is controlled in 304B1 to write the downlink packet stream received by the second VSW into the DPDK lock-free queue, after the downlink packet stream is switched to the second VSW, the second VSW writes the downlink packet stream received by the second VSW into the DPDK lock-free queue. Therefore, the DPDK lock-free queue includes the downlink packet 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 according to the writing sequence of the first VSW and the second VSW, so that the sequence of the data packets in the DPDK lock-free queue and the second VIRTIO queue is the same.
As shown in fig. 8, fig. 8 shows a case where the first VSW and the second VSW write the downlink packet flow into the DPDK lock-free queue. The first VSW writes data packets such as F1P 1, F1P 2 and F1P 3 to the DPDK lock-free queue, and the second VSW writes data packets such as F2P 1, F2P 2 and F2P 3 to the DPDK lock-free queue. The data packets written by the first VSW and the second VSW are arranged according to the writing sequence, for example, the data packets in the DPDK lock-free queue in fig. 8 are arranged according to the sequence of F1P 1, F1P 2, F2P 1, F2P 2, F1P 3, and F2P 3. In addition, the sequence of the packets in the second VIRTIO queue is also the same as the sequence of the packets in the DPDK lock-free queue.
Illustratively, after controlling the second VSW to issue the third marketing information, the method further comprises: the control agent prohibits the first VSW from writing the downlink message flow received by the first VSW into the DPDK lock-free queue. And controlling the second VSW to update the downlink message flow received by the second VSW from the DPDK lock-free queue to the second VIRTIO queue.
Illustratively, the agent manages a downlink write lock, and the VSW capable of calling the downlink write lock has write permissions of the DPDK lock-free queue and the second VIRTIO queue. Therefore, the agent can prohibit the first VSW from writing the downlink packet stream received by the first VSW into the DPDK lock-free queue and the second VIRTIO queue by prohibiting the first VSW from invoking the downlink write lock. In addition, the second VSW is further controlled not to write the downlink packet stream received by the second VSW into the DPDK lock-free queue any more, but to directly write the downlink packet stream received by the second VSW into the second VIRTIO queue. Therefore, in the subsequent message transmission process, the agent is not required to read from the DPDK lock-free queue and rewrite the DPDK lock-free queue into the second VIRTIO queue, and the downlink message stream read from the second VIRTIO queue by the VM/POD is only the downlink message stream directly written by the second VSW.
Further, after the uplink replacement process and the downlink replacement process are completed, the first VSW is no longer used for forwarding the message flow, so that the NIC corresponding to the first VSW is also allocated to the second VSW in this embodiment. Illustratively, the present embodiment also deletes the first VSW. In addition, the agent releases the managed uplink read lock and downlink read lock and is used for forwarding the packet flow in the DPDK lock-free queue to the thread resource in the second VIRTIO queue, thereby completing the VSW updating process.
Referring to fig. 4, 404 in fig. 4 shows a case where both the upstream replacement process and the downstream replacement process have been completed. According to 404, in the subsequent message transmission process, the uplink message flow and the downlink message flow are both forwarded by the second VSW through the NIC1 and the NIC2, and the first VSW is no longer used for forwarding any message flow transmitted between the destination communication device and the VM/POD.
In the downlink replacement process, packet loss may be caused in a protocol convergence process after the target communication device selects the second VSW as the VSW for forwarding the downlink packet flow. In addition, after controlling the second VSW to update the downlink packet stream received by the second VSW from being written into the DPDK lock-free queue to being written into the second VIRTIO queue, the data packet of the downlink packet stream remaining in the DPDK lock-free queue may be discarded. In practical application, the packet loss time in the downlink replacement process is about 200 ms.
As can be seen from the description in 301-304, the packet loss time in the NIC switching process of this embodiment is about 100 ms, the packet loss time in the uplink replacement process is about 200 ms, and the packet loss time in the downlink replacement process is about 200 ms. Therefore, the total packet loss time in the VSW updating process of the present embodiment is about 500 milliseconds. In this embodiment, under the condition that the number of NICs is thousands of orders and the information amount of routing information is millions of orders, sub-second-level service online software upgrade (ISSU) of VSW can be implemented.
In summary, in this embodiment, after obtaining the second VSW used to replace the first VSW, the target communication device selects the first VSW from the first VSW and the second VSW as the VSW used to forward the packet flow by controlling the second overhead information issued by the second VSW, where the second overhead information is greater than the first overhead information required by the first VSW to forward the packet flow. Therefore, the second VSW can establish the neighbor relation and exchange the routing information on the premise that the first VSW forwards the message flow and does not generate packet loss. And after the second VSW establishes the neighbor relation and exchanges the routing information, replacing the first VSW with the second VSW. In this embodiment, the process of establishing the neighbor relation and exchanging the routing information by the second VSW does not cause packet loss, so that the packet loss time in the VSW updating process is shortened, and the packet loss rate in the packet transmission process is reduced.
As shown in fig. 10, an embodiment of the present application further provides a device for transmitting a packet, where the device includes:
an obtaining module 1001, configured to obtain a second VSW corresponding to a first virtual switch VSW, where the first VSW is configured 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. The process executed by the obtaining module 1001 may refer to the description in 301 above, and is not described here again.
The control module 1002 is configured to control the second VSW to issue second overhead information of the second VSW forwarding packet flow, where the second overhead information is greater than the first overhead information.
The control module 1002 is further configured to control the second VSW to establish a neighbor relation with the target communication device in the process of forwarding the message flow by the first VSW, and exchange routing information based on the established neighbor relation. The processes executed by the control module 1002 can be referred to the descriptions in 302 and 303 above, and are not described here again.
A replacing module 1003, configured to replace the VSW used for forwarding the packet flow with a second VSW from the first VSW. The process performed by the replacing module 1003 can refer to the description in the above 304, and is not described here again.
In an exemplary embodiment, the replacing module 1003 is configured to replace, by a first VSW, a VSW for forwarding an upstream packet flow with a second VSW through a first virtual interface VIRTIO queue, where the upstream packet flow is a packet flow sent to a target communication device, and the first VIRTIO queue includes the upstream packet flow.
In an exemplary embodiment, the replacing module 1003 is configured to, in a process that a virtual interface corresponding to the second VSW is in a closed state, prohibit the second VSW from reading the first VIRTIO queue; controlling a second VSW to open a virtual interface in a closed state; and the control agent prohibits the first VSW from reading the first VIRTIO queue, controls the second VSW to read the first VIRTIO queue, and the second VSW is used for forwarding the uplink message flow read from the first VIRTIO queue through the virtual interface in the open state.
In an exemplary embodiment, the replacing module 1003 is further configured to replace, by the first VSW and the second vsrtio queue, the VSW for forwarding the downlink packet flow from the first VSW to the second VSW through the DPDK lock-free queue of the data table development kit and the second VIRTIO queue, where the downlink packet flow is a packet flow sent by the target communication device.
In an exemplary embodiment, the replacing module 1003 is configured to control the first VSW to write the downlink packet stream received by the first VSW into the DPDK lock-free queue, and control the second VSW to write the downlink packet stream 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 a second VIRTIO queue; and controlling the second VSW to release third overhead information, wherein the third overhead information is smaller than the first overhead information, and the third overhead information is used for enabling the target communication equipment to use the second VSW as a VSW for forwarding the downlink message flow in the first VSW and the second VSW.
In an exemplary embodiment, the control module 1002 is further configured to control the agent to prohibit the first VSW from writing the downlink packet stream received by the first VSW into the DPDK lock-free queue and the second VIRTIO queue; and controlling the second VSW to update the downlink message flow received by the second VSW from the DPDK lock-free queue to the second VIRTIO queue.
In an exemplary embodiment, the apparatus further comprises: a deletion module to delete the first VSW.
In an exemplary embodiment, the replacing module 1003 is configured to determine a packet flow rate of a downlink packet flow in a DPDK lock-free queue; and based on the fact that the flow of the message flow is not larger than the flow threshold value, the control agent writes the read downlink message flow into a second VIRTIO queue in an interruption mode.
In an exemplary embodiment, the replacing module 1003 is further configured to, based on that the flow rate of the packet stream is greater than the flow threshold, write the read downlink packet stream into the second VIRTIO queue by the control agent in a polling manner.
In an exemplary embodiment, the control module 1002 is further configured to control the agent to negotiate to obtain driving information; and controlling the second VSW to obtain driving information from the agent, wherein the driving information is used for the second VSW to forward the message flow.
It should be understood that, when the apparatus provided in fig. 10 implements its functions, it is only illustrated by the division of the functional modules, and in practical applications, the above functions may be distributed by different functional modules according to needs, that is, the internal structure of the apparatus is divided into different functional modules to implement all or part of the functions described above. In addition, the apparatus and method embodiments provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments for details, which are not described herein again.
An embodiment of the present application provides a communication device, including: a communication interface and a processor, optionally the communication device further comprises a memory. The communication interface, the memory and the processor are in communication with each other through an internal connection path, the memory is used for storing instructions, and the processor is used for executing the instructions stored in the memory to control the communication interface to receive signals and control the communication interface to send signals, and when the processor executes the instructions stored in the memory, the processor is caused to execute any one of the exemplary methods for transmitting messages provided by the embodiments of the present application.
Corresponding to the method embodiment and the virtual device embodiment provided by the present application, an embodiment of the present application further provides a communication device, and a hardware structure of the communication device is described below.
The communication device 1100 or the communication device 1200 described below corresponds to a physical communication device in the foregoing method embodiment, and for the purpose of implementing various steps and methods implemented by the communication device 1100 or the communication device 1200 in the method embodiment, hardware, modules, and other operations and/or functions described above, respectively, for how the communication device 1100 or the communication device 1200 obtains a detailed flow for performing message transmission, specific details may refer to the foregoing method embodiment, and for brevity, are not described again here. Wherein the steps of the above method 301-304 are performed by integrated logic circuits of hardware or instructions in the form of software in the processor of the communication device 1100 or 1200. The steps of a method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware processor, or may be implemented by a combination of hardware and software modules in a processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor. To avoid repetition, it is not described in detail here.
The communication apparatus 1100 or the communication apparatus 1200 corresponds to the device for transmitting a message stream in the virtual device embodiment described above, and each functional module in the device for transmitting a message stream is implemented by software of the communication apparatus 1100 or the communication apparatus 1200. In other words, the apparatus for transmitting a message stream includes functional modules that are generated by a processor of the communication device 1100 or the communication device 1200 reading program code stored in a memory.
Referring to fig. 11, fig. 11 shows a schematic structural diagram of a communication device 1100 according to an exemplary embodiment of the present application. The communication device 1100 shown in fig. 11 is configured to perform the method for transmitting a message shown in fig. 3. The communication device 1100 is, for example, a switch, a router, a controller, etc., and the communication device 1100 may be implemented by a general bus architecture.
As shown in fig. 11, the communication device 1100 includes at least one processor 1101, memory 1103, and at least one communication interface 1104.
The processor 1101 is, for example, a 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 present disclosure. 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. PLDs are, for example, Complex Programmable Logic Devices (CPLDs), field-programmable gate arrays (FPGAs), General Array Logic (GAL), or any combination thereof. Which may implement or perform the various logical blocks, modules, and circuits described in connection with the embodiment disclosure. The processor may also be a combination of computing functions, e.g., comprising one or more microprocessors, DSPs, and microprocessors, among others.
Optionally, the communication device 1100 also includes a bus. The bus is used to transfer information between the various components of the communication device 1100. The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 11, but this is not intended to represent only one bus or type of bus.
The Memory 1103 is, for example, but is not limited to, a read-only Memory (ROM) or other type of static storage device that can store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only Memory (EEPROM), a compact disk read-only Memory (CD-ROM) or other optical disk storage, optical disk storage (including compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, 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 that can be accessed by a computer. The memory 1103 is, for example, independent and connected to the processor 1101 through a bus. The memory 1103 may also be integrated with the processor 1101.
Communication interface 1104 may use any transceiver or the like for communicating with other devices or a communication network, such as an ethernet, a Radio Access Network (RAN), or a Wireless Local Area Network (WLAN). Communication interface 1104 may include a wired communication interface and may also include a wireless communication interface. Specifically, the communication interface 1104 may be an Ethernet (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 may be an optical interface, an electrical interface, or a combination thereof. In an embodiment of the present application, communication interface 1104 may be used for communication between communication device 1100 and other devices.
In particular implementations, processor 1101 may include one or more CPUs, such as CPU0 and CPU1 shown in fig. 11, as one embodiment. Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
In particular implementations, communication device 1100 may include multiple processors, such as processor 1101 and processor 1105 as shown in fig. 11, for one embodiment. Each of these processors may be a single-Core Processor (CPU) or a multi-Core Processor (CPU). A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
In particular implementations, communication device 1100 may also include an output device and an input device, as one embodiment. An output device is in communication with the processor 1101 and may display information in a variety of ways. For example, the output device may be a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display device, a Cathode Ray Tube (CRT) display device, a projector (projector), or the like. The input device is in communication with the processor 1101 and may receive user input in a variety of ways. For example, the input device may be a mouse, a keyboard, a touch screen device, a sensing device, or the like.
In some embodiments, the memory 1103 is used to store program code 1110 for performing aspects of the present application, and the processor 1101 may execute the program code 1110 stored in the memory 1103. That is, the communication device 1100 may implement the method for transmitting a packet according to the method embodiment through the processor 1101 and the program code 1110 in the memory 1103. One or more software modules may be included in program code 1110. Optionally, the processor 1101 may also store program code or instructions for performing aspects of the present application itself.
In a specific embodiment, the communication device 1100 of the embodiment of the present application may correspond to a physical communication device in the above-described method embodiment, and the processor 1101 in the communication device 1100 reads instructions in the memory 1103, so that the communication device 1100 shown in fig. 11 can perform all or part of the operations performed by the physical communication device in the method embodiment.
The communication device 1100 may also correspond to the apparatus shown in fig. 10 described above, and each functional module in the apparatus shown in fig. 10 is implemented by software of the communication device 1100. In other words, the apparatus shown in fig. 10 comprises functional modules that are generated by the processor 1101 of the communication device 1100 reading the program code 1110 stored in the memory 1103.
The method of transmitting messages shown in fig. 3 is performed by an integrated logic circuit of hardware or an instruction in the form of software in a processor of the communication device 1100. The steps of a method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware processor, or may be implemented by a combination of hardware and software modules in a processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and performs the steps of the above method in combination with hardware thereof, which are not described in detail herein to avoid repetition.
Referring to fig. 12, fig. 12 is a schematic structural diagram of a communication device 1200 according to an exemplary embodiment of the present application. The communication apparatus 1200 includes: a main control board 1210 and an interface board 1230.
The main control board 1210 is also called a Main Processing Unit (MPU) or a route processor card (route processor card), and the main control board 1210 is used for controlling and managing each component in the communication device 1200, including routing computation, device management, device maintenance, and protocol processing functions. The main control board 1210 includes: a central processor 1211 and a memory 1212.
The interface board 1230 is also called a Line Processing Unit (LPU), a line card (line card), or a service board. The interface board 1230 is used to provide various service interfaces and implement forwarding of data packets. The service interfaces include, but are not limited to, Ethernet interfaces, such as Flexible Ethernet services interfaces (FlexE Ethernet Clients), POS (Packet over SONET/SDH) interfaces, and the like. The interface board 1230 includes: a central processor 1231, a network processor 1232, a forwarding table entry store 1234, and a Physical Interface Card (PIC) 1233.
The central processor 1231 of the interface board 1230 is used for controlling and managing the interface board 1230 and communicating with the central processor 1211 of the main control board 1210.
The network processor 1232 is configured to implement forwarding processing of the packet. The network processor 1232 may take the form of a forwarding chip. Specifically, the network processor 1232 is configured to forward the received message based on the forwarding table stored in the forwarding table entry storage 1234, and if the destination address of the message is the address of the communication device 1200, send the message to a CPU (e.g., 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 the outgoing interface corresponding to the destination address are found from the forwarding table according to the destination address, and the message is forwarded to the outgoing interface corresponding to the destination address. The processing of the uplink message comprises the following steps: processing a message input interface and searching a forwarding table; and (3) downlink message processing: forwarding table lookups, and the like.
The physical interface card 1233 is used to implement the interfacing function of the physical layer, from which the original traffic enters the interface board 1230, and the processed messages are sent out from the physical interface card 1233. The physical interface card 1233, also called a daughter card, may be installed on the interface board 1230, and is responsible for converting the optical signal into a message, performing validity check on the message, and forwarding the message to the network processor 1232 for processing. In some embodiments, the central processor may also perform the functions of the network processor 1232, such as implementing software forwarding based on a general purpose CPU, so that the network processor 1232 is not required in the physical interface cards 1233.
Optionally, the communication device 1200 includes a plurality of interface boards, for example, the communication device 1200 further includes an interface board 1240, and the interface board 1240 includes: a central processor 1241, a network processor 1242, a physical interface card 1243 and a forwarding table entry memory 1244.
Optionally, the communication device 1200 further comprises a switch board 1220. The switch board 1220 may also be called a Switch Fabric Unit (SFU). In the case of a communication device having multiple interface boards 1230, the switch board 1220 is used to complete the data exchange between the interface boards. For example, interface board 1230 and interface board 1240 may communicate with each other via switch board 1220.
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 switch board 1220 are connected to the system backplane through a system bus to realize intercommunication. In a possible implementation manner, an inter-process communication protocol (IPC) channel is established between the main control board 1210 and the interface board 1230, and the main control board 1210 and the interface board 1230 communicate with each other through the IPC channel.
Logically, the communication device 1200 includes a control plane including the main control board 1210 and the central processor 1231, and a forwarding plane including various components performing forwarding, such as a forwarding entry memory 1234, a physical interface card 1233, and a network processor 1232. The control plane performs functions of a router, generating a forwarding table, processing signaling and protocol messages, configuring and maintaining the state of the device, and the like, issues the generated forwarding table to the forwarding plane, and in the forwarding plane, the network processor 1232 looks up the table of the messages received by the physical interface card 1233 and forwards the messages based on the forwarding table issued by the control plane. The forwarding table issued by the control plane may be stored in forwarding table entry store 1234. In some embodiments, the control plane and the forwarding plane may be completely separate and not on the same device.
If the communication device 1200 is configured as a physical communication device for transmitting messages, the physical interface card 1233 is used for forwarding packets in the message stream.
The operation of the interface board 1240 in the embodiment of the present application is the same as the operation of the interface board 1230, and for brevity, will not be described again. The communication device 1200 of this embodiment may correspond to the communication device in each of the above method embodiments, and the main control board 1210, the interface board 1230 and/or 1240 in the communication device 1200 may implement the functions and/or various steps implemented by the communication device in each of the above method embodiments, and for brevity, no further description is provided here.
It should be noted that there may be one or more main control boards, and when there are more main control boards, the main control boards may include a main control board and a standby main control board. The interface board may have one or more blocks, and the stronger the data processing capability of the communication device, the more interface boards are provided. There may also be one or more physical interface cards on an interface board. The exchange network board may not have one or more blocks, and when there are more blocks, the load sharing redundancy backup can be realized together. Under the centralized forwarding architecture, the communication device does not need a switching network board, and the interface board undertakes the processing function of the service data of the whole system. Under the distributed forwarding architecture, the communication device can have at least one switching network board, and the data exchange among a plurality of interface boards is realized through the switching network board, so that the high-capacity data exchange and processing capacity is provided. Therefore, the data access and processing capabilities of the communication devices of the distributed architecture are greater than those of the devices of the centralized architecture. Optionally, the communication device may also be in the form of only one board card, that is, there is no switching network board, and the functions of the interface board and the main control board are integrated on the one board card, at this time, the central processing unit on the interface board and the central processing unit on the main control board may be combined into one central processing unit on the one board card to perform the function after the two are superimposed, and the data switching and processing capability of the device in this form is low (for example, communication devices such as a low-end switch or a router, etc.). Which architecture is specifically adopted depends on the specific networking deployment scenario, and is not limited herein.
In some possible embodiments, the communication device described above may also be implemented by a general-purpose processor.
For example, the general purpose processor may be in the form of a chip. Specifically, the general-purpose processor implementing the communication device includes a processing circuit, and an input interface and an output interface connected to and communicating with the processing circuit, where the processing circuit is configured to execute the message generating step in each of the above-mentioned method embodiments through the input interface, the processing circuit is configured to execute the receiving step in each of the above-mentioned method embodiments through the input interface, and the processing circuit is configured to execute 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 configured to execute the storage steps in the above-described method embodiments through the storage medium. The storage medium may store instructions for execution by a processing circuit that executes the instructions stored by the storage medium to perform the various method embodiments described above.
It should be understood that the processor may be a Central Processing Unit (CPU), other general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or any conventional processor or the like. It is noted that the processor may be an advanced reduced instruction set machine (ARM) architecture supported processor.
Further, in an alternative embodiment, the memory may include both read-only memory and random access memory, and provide instructions and data to the processor. The memory may also include non-volatile random access memory. For example, the memory may also store device type information.
The memory may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The non-volatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an electrically Erasable EPROM (EEPROM), or a flash memory. Volatile memory can be Random Access Memory (RAM), which acts as 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 SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM), and direct memory bus RAM (DR RAM).
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part 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, the procedures or functions described in accordance with the present application are generated, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, 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 by wire (e.g., coaxial cable, fiber optic, digital subscriber line) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk), among others.
In the context of embodiments of the present application, computer program code or relevant 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 a carrier include a signal, computer readable medium, and the like.
Examples of signals may include electrical, optical, radio, acoustic, or other forms of propagated signals, such as carrier waves, infrared signals, and the like.
A machine-readable medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The 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 a machine-readable storage medium include an electrical connection having one or more wires, a portable computer diskette, 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.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system, the device and the module described above may refer to corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the module is only one logical functional division, and other divisions may be realized in practice, for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted, or not executed. Further, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may also be an electrical, mechanical or other form of connection.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of the embodiments of the present application.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The terms "first," "second," and the like in this application are used for distinguishing between similar items and items that have substantially the same function or similar functionality, and it should be understood that "first," "second," and "nth" do not have any logical or temporal dependency or limitation on the number or order of execution. It will be further understood that, although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first image may be referred to as a second image, and similarly, a second image may be referred to as a first image, without departing from the scope of the various described examples. Both the first image and the second image may be images, and in some cases, may be separate and distinct images.
It should also be understood that, in the embodiments of the present application, the sequence numbers of the respective processes do not mean the execution sequence, and the execution sequence of the respective processes should be determined by the functions and the inherent logic thereof, and should not constitute any limitation to the implementation process of the embodiments of the present application.
The term "at least one" in this application means one or more, and the term "plurality" in this application means two or more, for example, the plurality of second messages means two or more second messages. The terms "system" and "network" are often used interchangeably herein.
It is to be understood that the terminology used in the description of the various described 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 described 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.
It will be further understood that the terms "comprises," "comprising," "includes," and/or "including," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terms "if" and "if" may be interpreted to mean "when" ("where" or "upon") or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined," or "if [ a stated condition or event ] is detected," may be interpreted to mean "upon determining," or "in response to determining," or "upon detecting [ a stated condition or event ], or" in response to detecting [ a stated condition or event ] ", depending on the context.
It should be understood that determining B from a does not mean determining B from a alone, but may also be determined from a and/or other information.
It should also be appreciated that reference throughout this specification to "one embodiment," "an embodiment," "one possible implementation" means that a particular feature, structure, or characteristic described in connection with the embodiment or implementation is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" or "one possible implementation" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (22)

1. A method for transmitting a message, the method comprising:
acquiring a second VSW corresponding to a first virtual switch VSW, wherein the first VSW is used for forwarding a message flow corresponding to target communication equipment, and the cost information of the message flow forwarded by the first VSW is first cost information;
controlling the second VSW to issue second overhead information of the message flow forwarded by the second VSW, wherein the second overhead information is larger than the first overhead information;
controlling the second VSW to establish a neighbor relation with the target communication equipment in the process of forwarding the message flow by the first VSW, and exchanging routing information based on the established neighbor relation;
and replacing the VSW used for forwarding the message flow by the first VSW with the second VSW.
2. The method of claim 1, wherein replacing the VSW used for forwarding the packet flow from the first VSW to the second VSW comprises:
replacing the VSW used for forwarding the uplink message flow from the first VSW to the second VSW through a first virtual interface VIRTIO queue, wherein the uplink message flow is a message flow sent to the target communication equipment, and the first VIRTIO queue comprises the uplink message flow.
3. The method of claim 2, wherein replacing the VSW for forwarding the upstream packet flow from the first VSW to the second VSW via the first virtual interface VIRTIO queue comprises:
in the process that 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 in the closed state;
and controlling the agent to forbid the first VSW from reading the first VIRTIO queue, and controlling the second VSW to read the first VIRTIO queue, wherein the second VSW is used for forwarding the uplink message flow read from the first VIRTIO queue through a virtual interface in an open state.
4. The method of claim 2 or 3, wherein the replacing the VSW used for forwarding the packet flow from the first VSW to the second VSW, further comprises:
replacing the VSW used for forwarding the downlink message flow from the first VSW to the second VSW through a DPDK lock-free queue of a data table development kit and a second VIRTIO queue, wherein the downlink message flow is a message flow sent by the target communication device.
5. The method of claim 4, wherein the replacing, by the first VSW, the VSW for forwarding the downstream packet flow with the second VSW through the DPDK lock-free queue of the data table development kit and the second VIRTIO queue comprises:
controlling the first VSW to write the downlink message flow received by the first VSW into the DPDK lock-free queue, and controlling 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;
and controlling the second VSW to issue third overhead information, wherein the third overhead information is smaller than the first overhead information, and the third overhead information is used for the target communication device to use the second VSW as a VSW for forwarding the downlink message flow in the first VSW and the second VSW.
6. The method of claim 5, wherein after the controlling the second VSW to publish third marketing information, the method further comprises:
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;
and controlling the second VSW to update the downlink message flow received by the second VSW from the DPDk lock-free queue to the second VIRTIO queue.
7. The method of claim 6, wherein after the controlling the agent to prohibit the first VSW from writing the downlink packet flow received by the first VSW into the DPDK lock-free queue, the method further comprises:
deleting the first VSW.
8. The method according to any one of claims 5 to 7, wherein the reading of the DPDK lock-free queue by the control agent and the writing of the read downlink packet stream into the second VIRTIO queue comprises:
determining the message flow of the downlink message flow in the DPDK lock-free queue;
and controlling the agent to write the read downlink message flow into the second VIRTIO queue in an interrupt mode based on the message flow not larger than the flow threshold.
9. The method of claim 8, further comprising:
and controlling the agent to write the read downlink message flow into the second VIRTIO queue in a polling mode based on the message flow rate being larger than the flow threshold value.
10. The method according to any one of claims 1-9, further comprising:
the control agent negotiates to obtain driving information;
and controlling the second VSW to obtain the driving information from the agent, wherein the driving information is used for the second VSW to forward the message flow.
11. An apparatus for transmitting a message, the apparatus comprising:
an obtaining module, configured to obtain a second VSW corresponding to a first virtual switch VSW, where the first VSW is configured 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;
a control module, configured to control the second VSW to issue second overhead information for the second VSW to forward the packet flow, where 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 relation with the target communication device in a process of forwarding the message flow by the first VSW, and exchange routing information based on the established neighbor relation;
and the replacing module is used for replacing the VSW used for forwarding the message flow from the first VSW to the second VSW.
12. The apparatus of claim 11, wherein the replacing module is configured to replace, by the first VSW, the VSW for forwarding the upstream packet flow with the second VSW through a first virtual interface VIRTIO queue, where the upstream packet flow is a packet flow sent to the target communication device, and the upstream packet flow is included in the first VIRTIO queue.
13. The apparatus of claim 12, wherein the replacement module is configured to prohibit the second VSW from reading the first VIRTIO queue when a virtual interface corresponding to the second VSW is in a closed state; controlling the second VSW to open the virtual interface in the closed state; and controlling the agent to forbid the first VSW from reading the first VIRTIO queue, and controlling the second VSW to read the first VIRTIO queue, wherein the second VSW is used for forwarding the uplink message flow read from the first VIRTIO queue through a virtual interface in an open state.
14. The apparatus according to claim 12 or 13, wherein the replacing module is further configured to replace, by the first VSW, the VSW for forwarding the downlink packet flow with the second VSW through a DPDK lock-free queue of a data table development kit and a second VIRTIO queue, where the downlink packet flow is a packet flow sent by the target communication device.
15. The apparatus according to claim 14, wherein the replacing module is configured to control the first VSW to write the downlink packet flow received by the first VSW into the DPDK lock-free queue, and control the second VSW to write the downlink packet 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; and controlling the second VSW to issue third overhead information, wherein the third overhead information is smaller than the first overhead information, and the third overhead information is used for the target communication device to use the second VSW as a VSW for forwarding the downlink message flow in the first VSW and the second VSW.
16. The apparatus of claim 15, wherein the control module is further configured to control the agent to prohibit the first VSW from writing the downlink packet stream received by the first VSW into the DPDK lock-free queue and the second VIRTIO queue; and controlling the second VSW to update the downlink message flow received by the second VSW from the DPDk lock-free queue to the second VIRTIO queue.
17. The apparatus of claim 16, further comprising: a deletion module to delete the first VSW.
18. The apparatus according to any one of claims 15 to 17, wherein the replacing module is configured to determine a packet flow rate of a downlink packet flow in the DPDK lock-free queue; and controlling the agent to write the read downlink message flow into the second VIRTIO queue in an interrupt mode based on the message flow not larger than the flow threshold.
19. The apparatus according to claim 18, wherein the replacement module is further configured to control the agent to write the read downlink packet stream into the second VIRTIO queue in a polling manner based on that the packet stream traffic is greater than the traffic threshold.
20. The apparatus according to any of claims 11-19, wherein the control module is further configured to control the agent to negotiate to obtain the driving information; and controlling the second VSW to obtain the driving information from the agent, wherein the driving information is used for the second VSW to forward the message flow.
21. An apparatus for transmitting a message, the apparatus comprising a memory and a processor; the memory has stored therein at least one instruction that is loaded and executed by the processor to implement the method of transmitting a message of any of claims 1-10.
22. A computer-readable storage medium having stored therein at least one instruction, which is loaded and executed by a processor, to implement the method of transmitting a message according to any one of claims 1-10.
CN202011196928.3A 2020-10-31 2020-10-31 Method, device and equipment for transmitting message and computer readable storage medium Pending CN114531351A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011196928.3A CN114531351A (en) 2020-10-31 2020-10-31 Method, device and equipment for transmitting message and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011196928.3A CN114531351A (en) 2020-10-31 2020-10-31 Method, device and equipment for transmitting message and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN114531351A true CN114531351A (en) 2022-05-24

Family

ID=81619127

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011196928.3A Pending CN114531351A (en) 2020-10-31 2020-10-31 Method, device and equipment for transmitting message and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN114531351A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115150464A (en) * 2022-06-22 2022-10-04 北京天融信网络安全技术有限公司 Application proxy method, device, equipment and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115150464A (en) * 2022-06-22 2022-10-04 北京天融信网络安全技术有限公司 Application proxy method, device, equipment and medium
CN115150464B (en) * 2022-06-22 2024-03-15 北京天融信网络安全技术有限公司 Application proxy method, device, equipment and medium

Similar Documents

Publication Publication Date Title
US8312197B2 (en) Method of routing an interrupt signal directly to a virtual processing unit in a system with one or more physical processing units
WO2017133623A1 (en) Data stream processing method, apparatus, and system
KR101784900B1 (en) Computer, control device and data processing method
KR102204670B1 (en) Technologies for proxy-based multi-threaded message passing communication
CN108984327B (en) Message forwarding method, multi-core CPU and network equipment
WO2019100266A1 (en) Mobile edge host-machine service notification method and apparatus
CN111431757A (en) Virtual network flow acquisition method and device
EP4357901A1 (en) Data writing method and apparatus, data reading method and apparatus, and device, system and medium
US11231964B2 (en) Computing device shared resource lock allocation
CN114531351A (en) Method, device and equipment for transmitting message and computer readable storage medium
CN114172753B (en) Address reservation method, network equipment and system
US20190044871A1 (en) Technologies for managing single-producer and single consumer rings
CN104572315A (en) Inter-subsystem communication method, communication entities and distributed communication system
CN103036815B (en) A kind of information technology and communication technology ICT emerging system
CN109698845B (en) Data transmission method, server, unloading card and storage medium
JP6036445B2 (en) COMMUNICATION SYSTEM, RELAY DEVICE, COMMUNICATION METHOD, AND PROGRAM
US9594651B2 (en) Parallel computer system and control method for parallel computer system
CN116700595A (en) Data processing method, system and equipment based on cache
CN110677845B (en) Method, network element and system for determining application function request state
KR100871729B1 (en) Multi-mode terminal and data packet transferring method
CN110543351B (en) Data processing method and computer device
CN114826898A (en) Cross-host communication method, device, equipment, system and readable storage medium
CN105072047A (en) Message transmitting and processing method
CN113452729A (en) Serial number determination method, equipment and storage medium
CN114615273B (en) Data transmission method, device and equipment based on load balancing system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination