CN118041811A - Link detection method and server - Google Patents

Link detection method and server Download PDF

Info

Publication number
CN118041811A
CN118041811A CN202410132826.7A CN202410132826A CN118041811A CN 118041811 A CN118041811 A CN 118041811A CN 202410132826 A CN202410132826 A CN 202410132826A CN 118041811 A CN118041811 A CN 118041811A
Authority
CN
China
Prior art keywords
detection
link
message
forwarding
detection message
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
CN202410132826.7A
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.)
XFusion Digital Technologies Co Ltd
Original Assignee
XFusion 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 XFusion Digital Technologies Co Ltd filed Critical XFusion Digital Technologies Co Ltd
Priority to CN202410132826.7A priority Critical patent/CN118041811A/en
Publication of CN118041811A publication Critical patent/CN118041811A/en
Pending legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the application discloses a link detection method and a server, relates to the technical field of link detection, and is used for providing an automatic link detection scheme so as to improve the efficiency and accuracy of link detection. The method is applied to a server, wherein the server comprises a virtual machine, a forwarding processor and a physical network card, and the virtual machine is connected with the physical network card through the forwarding processor; the method comprises the following steps: receiving a link detection instruction, and responding to the link detection instruction, and sending a first detection message to a forwarding processor by the virtual machine; the forwarding processor returns a second detection message to the virtual machine based on the first detection message; and the virtual machine receives a second detection message returned by the forwarding processor, and the server or the virtual machine performs target link detection based on the record information carried in the second detection message to obtain a first link detection result.

Description

Link detection method and server
Technical Field
The embodiment of the application relates to the technical field of link detection, in particular to a link detection method and a server.
Background
Through virtualization technology, one or more Virtual Machines (VMs) can be emulated on a server (e.g., a physical server, which may be simply referred to as a host). To achieve network interworking between virtual machines and servers, physical network cards (network interface controller, NIC, also known as network adapters) connecting the virtual machines and servers may be connected through forwarding processors such as packet filtering firewalls (iptables), virtual switches (vswitch), and the like. Thus, when the virtual machine needs to transmit the message with the server, the message can be sent to the physical network card of the server through the forwarding processor. For the link from the virtual machine to the physical network card via the forwarding processor, the link detection is required to determine whether an abnormal event such as packet loss occurs in the link.
Currently, the link detection method is generally: the technical staff inquires the message information of the physical network card or the message information of the forwarding processor, and judges whether the link has abnormal events or not by manually analyzing the message information of the physical network card or the message information of the forwarding processor.
However, the above-mentioned technical solutions rely on manual inquiry and manual analysis, so that the efficiency and accuracy of link detection are low.
Disclosure of Invention
The embodiment of the application provides a link detection method and a server, which are used for providing an automatic link detection scheme so as to improve the efficiency and accuracy of link detection.
In order to achieve the above purpose, the embodiment of the application adopts the following technical scheme:
On the one hand, a link detection method is provided, which is applied to a server, wherein the server comprises a virtual machine, a forwarding processor and a physical network card, and the virtual machine is connected with the physical network card through the forwarding processor; the method comprises the following steps:
And receiving a link detection instruction. The link detection instruction is used for indicating target link detection. The target link is a link between the virtual machine to the physical network card via the forwarding processor.
And responding to the link detection instruction, and sending a first detection message to the forwarding processor by the virtual machine so as to trigger the forwarding processor to forward the first detection message to the physical network card. And the forwarding processor returns a second detection message to the virtual machine based on the first detection message, wherein the second detection message carries record information of the operation of the forwarding processor on the first detection message. And the virtual machine receives a second detection message returned by the forwarding processor, and the server or the virtual machine performs target link detection based on the record information carried in the second detection message to obtain a first link detection result, wherein the first link detection result is used for indicating whether an abnormal event occurs in the target link.
In the above technical solution, the virtual machine is triggered to send the first detection message to the forwarding processor through the link detection instruction, the forwarding processor records the operation performed on the first detection message, and returns the second detection message carrying the recorded information to the virtual machine. Furthermore, the second detection message carries the operation of the forwarding processor on the first detection message, so that the virtual machine or the server detects the target link based on the record information carried in the second detection message, and whether the target link has an abnormal event can be determined. Therefore, the scheme for triggering the automatic link detection based on the link detection instruction is provided, and the efficiency and the accuracy of the link detection can be improved.
The virtual machine refers to one of the plurality of virtual machines connected with the physical network card, so that under the condition that the physical network card is connected with the plurality of virtual machines, targeted link detection can be executed for one of the virtual machines, whether an abnormal event occurs to a target link corresponding to each virtual machine can be accurately positioned, and the accuracy of link detection is further improved.
In some possible implementations, performing target link detection based on the record information carried in the second detection packet to obtain a first link detection result includes:
And determining forwarding result information of the forwarding processor on the first detection message based on the record information carried in the second detection message. The forwarding result information is used for indicating whether the forwarding processor forwards the first detection message to the physical network card.
And if the forwarding result information indicates that the forwarding processor forwards the first detection message to the physical network card, the determined first link detection result indicates that the abnormal event does not occur in the target link. That is, if the forwarding processor forwards the first detection message normally, it indicates that no abnormal event occurs in the target link. If the forwarding result information indicates that the forwarding processor does not forward the first detection message to the physical network card, the determined first link detection result indicates that the abnormal event occurs in the target link. That is, if the forwarding processor does not forward the first detection message normally, it indicates that an abnormal event occurs in the target link.
In the implementation manner, the record information carried in the second detection message is skillfully utilized to determine the forwarding result information of the forwarding processor on the first detection message, and whether the abnormal event occurs in the target link is determined by judging whether the forwarding processor forwards the first detection message to the physical network card or not, so that the first link detection result can be rapidly and efficiently determined, the efficiency of determining the first link detection result is improved, and the efficiency of link detection is improved.
In some possible implementations, the method further includes:
And determining a second link detection result based on the record information carried in the second detection message under the condition that the first link detection result indicates that the abnormal event occurs in the target link, wherein the second link detection result is used for indicating the reason of the abnormal event occurring in the target link.
In the implementation manner, the reason that the abnormal event occurs in the target link can be further determined, and the information amount obtained by link detection is increased.
In some possible implementations, the operation performed by the forwarding processor on the first detection packet includes determining whether the first detection packet meets a forwarding condition of the forwarding processor. Correspondingly, the record information is used for indicating whether the first detection message accords with the forwarding condition of the forwarding processor.
Based on the record information carried in the second detection message, determining a second link detection result includes:
If the record information indicates that the first detection message does not accord with the forwarding condition, the forwarding condition which is not met by the first detection message is used as the second link detection result.
In the above implementation, a way of determining the second link detection result is provided. The method comprises the steps of recording whether the first detection message accords with the forwarding condition of the forwarding processor in the recording information, and skillfully utilizing the recording information carried in the second detection message to determine the forwarding condition which is not met by the first detection message, so that the reason that the forwarding processor does not forward the first detection message to the physical network card can be determined, the second link detection result can be rapidly and efficiently determined, the efficiency of determining the second link detection result is improved, and the link detection efficiency is improved.
In some possible implementations, in response to the link detection instruction, the virtual machine sends a first detection message to the forwarding processor, including:
and responding to the link detection instruction, and sending a message detection instruction to the virtual machine. Further, the virtual machine responds to the message detection instruction and sends the first detection message to the forwarding processor.
In the above implementation manner, a manner of triggering the virtual machine to send the first detection message to the forwarding processor based on the message detection instruction is provided, so that the subsequent target link detection is performed smoothly.
In some possible implementations, the forwarding processor returns a second detection packet to the virtual machine based on the first detection packet, including:
The forwarding processor receives a first detection message from the virtual machine, acquires record information of operation of the forwarding processor on the first detection message, and generates a second detection message based on the record information. Further, the forwarding processor returns a second detection message to the virtual machine.
In the implementation manner, the operation performed on the first detection message is recorded by the forwarding processor, and the obtained record information is carried in the second detection message and returned to the virtual machine. Further, the virtual machine is enabled to perform target link detection based on the record information of the forwarding processor to determine whether an abnormal event occurs in the target link.
In some possible implementations, obtaining record information of an operation performed by the forwarding processor on the first detection packet includes:
Judging whether the first detection message accords with the forwarding condition of the forwarding processor, and recording the judging process of whether the first detection message accords with the forwarding condition of the forwarding processor to obtain the record information.
In the above implementation manner, the record information may be obtained by recording a determination process of whether the first detection packet meets the forwarding condition of the forwarding processor, so that the subsequent virtual machine can perform the target link detection based on the record information of the forwarding processor, thereby ensuring smooth performance of the link detection.
In some possible implementations, determining whether the first detection packet meets the forwarding condition of the forwarding processor includes at least one of the following four possible implementations:
In one possible implementation manner, based on the MAC address and the IP address in the first detection packet, it is determined whether a mapping relationship exists between the MAC address and the IP address. If the mapping relation exists, the first detection message is judged to be in accordance with the forwarding condition of the forwarding processor, and if the mapping relation does not exist, the first detection message is judged to be not in accordance with the forwarding condition of the forwarding processor.
It should be understood that if the mapping relationship exists between the MAC address and the IP address in the first detection packet, this indicates that the address is correct, so that the subsequent forwarding can be successfully performed. If the mapping relation between the MAC address and the IP address does not exist, the fact that the address is incorrect is indicated, and subsequent forwarding cannot be successfully executed.
In another possible implementation manner, based on the VLAN type of the virtual local area network in the first detection packet, it is determined whether the VLAN type is the same as the VLAN type where the forwarding processor is located. If the first detection messages are the same, the first detection messages are judged to be in accordance with the forwarding conditions of the forwarding processor, and if the first detection messages are not the same, the first detection messages are judged to be not in accordance with the forwarding conditions of the forwarding processor.
It should be understood that if the VLAN type in the first detection packet is the same as the VLAN type where the forwarding processor is located, it means that the forwarding processor can reach the lan corresponding to the VLAN type, and can successfully execute subsequent forwarding. If the VLAN type in the first detection message is different from the VLAN type where the forwarding processor is located, the forwarding processor cannot reach the local area network corresponding to the VLAN type, and subsequent forwarding cannot be successfully executed.
In another possible implementation manner, it is determined whether the first detection message is in error in the transmission process. If the first detection message does not have errors, the first detection message is judged to be in accordance with the forwarding condition of the forwarding processor, and if the first detection message does not have errors, the first detection message is judged to be not in accordance with the forwarding condition of the forwarding processor.
It should be understood that if the first detection message is not in error in the transmission process, it indicates that the transmission is not in error, and the subsequent forwarding can be successfully performed. If the first detection message is wrong in the transmission process, the transmission is wrong, and the subsequent forwarding cannot be smoothly executed.
In another possible implementation manner, it is determined whether the first detection message meets a firewall filtering rule. If the firewall filtering rule is met, the first detection message is judged to be met with the forwarding condition of the forwarding processor, and if the firewall filtering rule is not met, the first detection message is judged to be not met with the forwarding condition of the forwarding processor.
It should be understood that if the first detection message meets the firewall filtering rule, it indicates that the first detection message meets the specification, and the subsequent forwarding can be successfully performed. If the first detection message does not accord with the firewall filtering rule, the first detection message does not accord with the specification, and the subsequent forwarding cannot be successfully executed.
In the implementation manner, four ways of judging whether the first detection message accords with the forwarding condition of the forwarding processor are provided, so that the options of the forwarding processor for executing the judging process are enriched.
In some possible implementations, the method further includes:
If the first detection message accords with the forwarding condition of the forwarding processor, forwarding the first detection message to the physical network card. Or if the first detection message does not accord with the forwarding condition of the forwarding processor, the first detection message is not forwarded to the physical network card.
In the above implementation manner, under the condition that the first detection message meets the forwarding condition of the forwarding processor, forwarding the first detection message to the physical network card to ensure the reliability of message transmission.
In some possible implementations, receiving the link detection instruction includes:
and receiving a link detection instruction from the management terminal.
And further, performing target link detection based on the record information carried in the second detection message, and returning the first link detection result to the management terminal after obtaining the first link detection result.
In the implementation manner, the management terminal sends the link detection instruction to the server to trigger the server to execute the process of target link detection. Further, the management terminal can receive the first link detection result returned from the server. A way of triggering the execution of link detection based on the interaction between the management terminal and the server is provided. Therefore, an automatic link detection scheme is provided, and the efficiency and accuracy of link detection can be improved.
In some possible implementations, the forwarding processor includes a virtual switch through which the virtual machine is connected to the physical network card; or the forwarding processor comprises a packet filtering firewall and a virtual switch, and the virtual machine is connected with the physical network card by connecting the packet filtering firewall and the virtual switch in sequence.
In the above implementation, two types of forwarding processors are provided, enriching the alternatives of configuring the forwarding processors.
In some possible implementations, the first and second detection messages each include a transmission type field for indicating a transmission type of the detection message.
The transmission type field of the first detection message is a first transmission type, and the first transmission type is used for indicating that the first detection message is a detection message sent by the virtual machine to the physical network card. The transmission type field of the second detection message is a second transmission type, and the second transmission type is used for indicating that the second detection message is a detection message returned by the forwarding processor based on the first detection message.
In the implementation manner, the transmission type field is set in the first detection message and the second detection message, so that the information quantity contained in the detection messages is increased, and the detection messages with different transmission types can be distinguished conveniently.
In some possible implementations, the first detection message and the second detection message each include a priority field, where the priority field is used to indicate a transmission priority of the message.
The priority fields of the first detection message and the second detection message are the highest priority, and the highest priority refers to the highest priority of other messages transmitted relative to the same time period.
In the above implementation manner, the priority fields of the first detection message and the second detection message are set to the highest priority. Therefore, the transmission priority of the first detection message and the second detection message can be guaranteed to be highest, namely, the first detection message and the second detection message are transmitted preferentially relative to other messages transmitted in the same time period, and abnormal events caused by message loss due to priority scheduling are avoided.
In some possible implementations, in the case where the anomaly detection is packet loss detection, the anomaly event is a packet loss event.
On the other hand, the link detection device is applied to a server, the server comprises a virtual machine, a forwarding processor and a physical network card, and the virtual machine is connected with the physical network card through the forwarding processor; the device comprises:
the receiving module is used for receiving a link detection instruction, wherein the link detection instruction is used for indicating target link detection, and the target link is a link from the virtual machine to the physical network card through the forwarding processor;
the virtual machine is used for sending a first detection message to the forwarding processor in response to the link detection instruction, and the forwarding processor is used for forwarding the first detection message to the physical network card;
the return module is used for returning a second detection message to the virtual machine based on the first detection message, wherein the second detection message carries record information of the operation of the forwarding processor on the first detection message;
the detection module is used for receiving a second detection message returned by the forwarding processor, detecting a target link based on the record information carried in the second detection message, and obtaining a first link detection result, wherein the first link detection result is used for indicating whether an abnormal event occurs to the target link.
In another aspect, a server is provided that includes a processor and a memory, the processor and the memory being coupled. The memory is used for storing computer program instructions, and the processor is used for calling the computer program instructions in the memory to execute the link detection method shown in the embodiment.
In another aspect, a computer-readable storage medium is provided, which stores computer program instructions for causing a server to perform a link detection method as in the above embodiments.
In another aspect, a computer program product is provided comprising computer program instructions which, when run on a server, cause the server to perform a link detection method as described in the above embodiments.
Drawings
Fig. 1 is a schematic diagram of a link detection system according to an embodiment of the present application;
Fig. 2 is a schematic hardware structure of a server according to an embodiment of the present application;
Fig. 3 is a schematic flow chart of a link detection method according to an embodiment of the present application;
fig. 4 is an interaction schematic diagram of a link detection method according to an embodiment of the present application;
fig. 5 is a schematic diagram of a message header of a detection message according to an embodiment of the present application;
fig. 6 is a schematic diagram of a format of an IP datagram according to an embodiment of the present application;
fig. 7 is a schematic flow chart of a link detection according to an embodiment of the present application;
fig. 8 is a schematic flow chart of a link detection according to an embodiment of the present application;
Fig. 9 is a schematic structural diagram of a link detection device according to an embodiment of the present application.
Detailed Description
In the description of the embodiments of the present application, unless otherwise indicated, "/" means "or" and, for example, A/B may mean A or B. "and/or" herein is merely an association relationship describing an association object, and means that three relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist together, and B exists alone. Furthermore, "at least one" means one or more, and "a plurality" means two or more. The terms "first," "second," and the like do not limit the number and order of execution, and the terms "first," "second," and the like do not necessarily differ.
It should be noted that, in the embodiments of the present application, words such as "exemplary" or "such as" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "e.g." in an embodiment of the present application is not to be taken as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
The link detection method provided by the embodiment of the application can be applied to the message transmission scenes among different virtual machines of the same server, and can also be applied to the message transmission scenes among the virtual machines of different servers. Specifically, the link detection method provided by the embodiment of the application can be applied to a detection scene of a link from a virtual machine to a physical network card through a forwarding processor.
Currently, for the link from the virtual machine to the physical network card via the forwarding processor, the method for detecting the link is generally: the technical staff inquires the message information of the physical network card or the message information of the forwarding processor, and judges whether the link has abnormal events or not by manually analyzing the message information of the physical network card or the message information of the forwarding processor. For example, a technician may query the server for messaging information of the physical network card by remotely logging into the server. As another example, a technician may query a forwarding processor for messaging information by remotely logging into the forwarding processor.
However, the above-mentioned technical solutions rely on manual inquiry and manual analysis, so that the efficiency and accuracy of link detection are low. In addition, for a virtual type forwarding processor such as a packet filtering firewall or a virtual switch, it is difficult to query the relevant transceiving message information, so that the link detection is difficult to perform.
In view of this, an embodiment of the present application provides a link detection method, which triggers, by a link detection instruction, a virtual machine to send a first detection packet to a forwarding processor, records an operation performed on the first detection packet by the forwarding processor, and returns a second detection packet carrying recorded information to the virtual machine. Furthermore, the second detection message carries the operation of the forwarding processor on the first detection message, so that the virtual machine or the server detects the target link based on the record information carried in the second detection message, and whether the target link has an abnormal event can be determined. Therefore, the scheme for triggering the automatic link detection based on the link detection instruction is provided, and the efficiency and the accuracy of the link detection can be improved.
Fig. 1 is a schematic diagram of an architecture of a link detection system according to an embodiment of the present application. Referring to fig. 1, the link detection system includes a management terminal 101 and a server 102. The server 102 includes a virtual machine 1021, a forwarding processor 1022, and a physical network card 1023. In the embodiment of the present application, the virtual machine 1021 may be connected to the physical network card 1023 through the forwarding processor 1022, so as to implement network interworking between the virtual machine 1021 and the physical network card 1023.
Wherein the management terminal 101 is configured to provide a background management service to the server 102. For example, the management terminal 101 may be used to provide a background management service to the virtual machine 1021 in the server 102.
In some possible implementations, the management terminal 101 may be at least one of a smart phone, a smart watch, a desktop computer, a laptop computer, a virtual reality terminal, an augmented reality terminal, a wireless terminal, and a laptop portable computer.
In the embodiment of the present application, the management terminal 101 is configured to send a link detection instruction to the server 102 to instruct the server 102 to perform target link detection, where the target link is a link between the virtual machine 1021 and the physical network card 1023 via the forwarding processor 1022.
The server 102 may be a separate physical server, such as a general purpose server, a graphics processing (graphics processing unit, GPU) server, a data processing (data processing unit, DPU) server, an artificial intelligence (ARTIFICIAL INTELLIGENCE, AI) server, or the like, or a server cluster or a distributed file system formed by a plurality of physical servers, which is not limited in this embodiment of the present application.
Virtual machine 1021 refers to a virtual computer system that has complete hardware system functionality and operates in a completely isolated environment through software emulation. In some possible implementations, the number of virtual machines 1021 is one or more. It should be appreciated that by virtualization technology, one or more virtual machines, such as virtual machine 1, virtual machine 2, virtual machine 3, etc. as shown in fig. 1, can be emulated on a server. By way of example, virtual machine 1021 may be understood as a virtual representation of a server.
In the embodiment of the present application, the virtual machine 1021 is configured to send a first detection message to the forwarding processor 1022, receive a second detection message returned by the forwarding processor 1022, and perform target link detection by the server or the virtual machine based on the record information carried in the second detection message, so as to obtain a first link detection result.
The forwarding processor 1022 is configured to connect the virtual machine 1021 and the physical network card 1023, and specifically is configured to forward the first detection message from the virtual machine 1021 to the physical network card 1023.
In some embodiments, forwarding processor 1022 may include a virtual switch, and accordingly virtual machine 1021 may connect physical network card 1023 through the virtual switch. For example, one end of the virtual switch may be a virtual port connected to the virtual machine 1021, and the other end may be an uplink port connected to the physical network card 1023.
In some possible implementations, the virtual switch may be a distributed virtual switch (which may be simply referred to as a distributed switch), such as a hyper-converged infrastructure (HCI) distributed switch. The distributed switch can be used as a single virtual switch among all associated hosts, so that the virtual machines can ensure that network configuration of the virtual machines is kept consistent when the virtual machines are migrated across the hosts, high-efficiency data transmission and data management of the virtual machines can be realized, and service integration and function integration of different virtual machines are realized.
Referring to fig. 1, taking virtual machine 1 as an example, virtual machine 1 may be connected to a physical network card 1023 through a virtual switch. For example, virtual machine 1 may be provided with a virtual machine 1 port (vm_port1), a virtual switch may be provided with a virtual port1, and virtual machine 1 and the virtual switch may be connected through the virtual machine 1 port and the virtual port 1. Further, the virtual switch may be connected to the physical network card 1023 through an uplink port.
In other embodiments, forwarding processor 1022 may include a packet filtering firewall and a virtual switch, and accordingly virtual machine 1021 may connect physical network card 1023 by connecting the packet filtering firewall, virtual switch in turn.
The packet filtering firewall is configured to perform rule matching on the first detection packet according to a firewall filtering rule defined in advance, for example, determine whether the first detection packet meets the firewall filtering rule, and execute a corresponding forwarding action according to a result of rule matching, for example, allow forwarding or not allow forwarding. In some possible implementations, the packet filtering firewall may be provided with multiple security groups, such as security group 1 (security_group_br1), security group 2 (security_group_br2) shown in fig. 1. Wherein the security group is a virtual firewall, and the packet filtering firewall can perform the rule matching process based on the security group.
Referring to fig. 1, taking virtual machine 2 as an example, virtual machine 2 may be connected to physical network card 1023 by sequentially connecting a packet filtering firewall, a virtual switch. In some possible implementations, virtual machine 2 may connect with physical network card 1023 by connecting security group 1, the virtual switch in turn. For example, virtual machine 2 may be provided with a virtual machine 2 port (vm_port2), security group 1 may be provided with a security group 1 port (sg_port1), and virtual machine 2 and security group 1 may be connected through virtual machine 2 ports and security group 1 ports. The virtual switch may be provided with a virtual port2, through which virtual port2 the virtual switch may connect to the security group 1.
Or taking the virtual machine 3 as an example, the virtual machine 3 may be connected to the physical network card 1023 by sequentially connecting a packet filtering firewall and a virtual switch. In some possible implementations, virtual machine 3 may connect with physical network card 1023 by connecting security group 2, the virtual switch in turn. For example, virtual machine 3 may be provided with a virtual machine 3 port (vm_port3), security group 2 may be provided with a security group 2 port (sg_port2), and virtual machine 3 and security group 2 may be connected through virtual machine 3 ports and security group 2 ports. The virtual switch may be provided with a virtual port3, through which virtual port3 the virtual switch may connect the security group 2.
In the embodiment of the present application, the forwarding processor 1022 is configured to receive a first detection message from the virtual machine 1021, obtain record information of an operation performed by the forwarding processor 1022 on the first detection message, and generate a second detection message based on the record information. Further, the second detection message is returned to the virtual machine 1021 for the virtual machine 1021 to perform target link detection, thereby obtaining the first link detection result.
Physical network card 1023 is a piece of hardware device deployed on server 102 for communication. In the embodiment of the present application, the physical network card 1023 is configured to receive the first detection packet from the forwarding processor 1022 when no abnormal event occurs in the target link.
In the above-described link detection system shown in fig. 1, the flow of performing link detection may include: the management terminal 101 transmits a link detection instruction to the server 102. The server 102 receives the link detection instruction, and in response to the link detection instruction, the virtual machine 1021 sends a first detection message to the forwarding processor 1022. The forwarding processor 1022 receives the first detection message from the virtual machine 1021, acquires record information of an operation performed by the forwarding processor 1022 on the first detection message, generates a second detection message based on the record information, and returns the second detection message to the virtual machine 1021. The virtual machine 1021 receives the second detection message returned by the forwarding processor 1022, and the server or the virtual machine performs target link detection based on the record information carried in the second detection message, so as to obtain a first link detection result.
In this way, the virtual machine is triggered to send the first detection message to the forwarding processor through the link detection instruction, the forwarding processor records the operation on the first detection message, and the second detection message carrying the recorded information is returned to the virtual machine. Furthermore, the second detection message carries the operation of the forwarding processor on the first detection message, so that the virtual machine or the server detects the target link based on the record information carried in the second detection message, and whether the target link has an abnormal event can be determined. Therefore, the scheme for triggering the automatic link detection based on the link detection instruction is provided, and the efficiency and the accuracy of the link detection can be improved.
Fig. 2 is a schematic hardware structure of a server according to an embodiment of the present application. Referring to fig. 2, the server 200 shown in fig. 2 may include: processor 201, memory 202, communication interface 203, and bus 204. The processor 201, the memory 202 and the communication interface 203 may be connected via a bus 204.
The processor 201 is a control center of the server 200, and may be a general-purpose central processing unit such as (central processing unit, CPU), or may be other general-purpose processors. Wherein the general purpose processor may be a microprocessor or any conventional processor or the like. In the embodiment of the present application, the link detection method may be performed by the processor 201 in the server 200. For example, in some possible implementations, the processor 201 in the server 200 may be installed with a link detection tool that is run by the processor 201 to perform the link detection method.
As an example, processor 201 may include one or more CPUs, such as CPU 0 and CPU 1 shown in fig. 2.
Memory 202 may be, but is not limited to, a read-only memory (ROM) or other type of static storage device that can store static information and instructions, or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), magnetic disk storage 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. In the embodiment of the present application, the first detection message may be stored in the memory 202 of the server 200.
In one possible implementation, the memory 202 may exist independent of the processor 201. The memory 202 may be coupled to the processor 201 via the bus 204 for storing data, instructions or program code. The processor 201, when calling and executing instructions or program codes stored in the memory 202, can implement the link detection method provided by the embodiment of the present application.
In another possible implementation, the memory 202 may also be integrated with the processor 201.
A communication interface 203 for the server 200 to connect with other devices through a communication network, which may be an ethernet, a radio access network (radio access network, RAN), a wireless local area network (wireless local area networks, WLAN), etc. The communication interface 203 may include a receiving unit for receiving data, and a transmitting unit for transmitting data.
Bus 204 may be an industry standard architecture (industry standard architecture, ISA) bus, an external device interconnect (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in fig. 2, but not only one bus or one type of bus.
It should be noted that the structure shown in fig. 2 is not limiting of the server 200, and the server 200 may include more or less components than those shown in fig. 2, or may combine some components, or may have a different arrangement of components.
Fig. 3 is a flow chart of a link detection method according to an embodiment of the present application. In some possible implementations, the method may be applied to the server shown in fig. 1 and described above, where the server includes a virtual machine, a forwarding processor, and a physical network card. The virtual machine is connected with the physical network card through the forwarding processor. In some possible implementations, the method may be performed by a processor of a server. Referring to fig. 3, the method includes the following S301-S304:
s301, receiving a link detection instruction.
The link detection instruction is used for indicating target link detection. In some possible implementations, the link detection instruction may be an instruction from the management terminal. For example, in some possible implementations, the management terminal may send a link detection instruction to the server to trigger the server to perform target link detection.
In the embodiment of the application, the target link is a link from the virtual machine to the physical network card through the forwarding processor. Illustratively, taking the example that the forwarding processor includes a virtual switch, the target link may be a link from the virtual machine to the physical network card via the virtual switch. Also illustratively, taking the example that the forwarding processor includes a packet filtering firewall, virtual switch, the target link may be a link from the virtual machine to the physical network card via the packet filtering firewall, virtual switch.
S302, responding to the link detection instruction, and sending a first detection message to a forwarding processor by the virtual machine.
In the embodiment of the application, the forwarding processor is used for forwarding the first detection message to the physical network card. The first detection message is used for target link detection, and is a detection message to be transmitted from the virtual machine to the physical network card through the forwarding processor in the embodiment of the application. In step S302, the server may control the virtual machine to send a first detection message to the forwarding processor in response to the link detection instruction. Or in step S301, the virtual machine of the server receives the link detection instruction, and the virtual machine sends the first detection message to the forwarding processor in response to the link detection instruction.
S303, the forwarding processor returns a second detection message to the virtual machine based on the first detection message.
The second detection message carries record information of the operation of the forwarding processor on the first detection message. In some possible implementations, the operation performed by the forwarding processor on the first detection packet may be: and judging whether the first detection message accords with the forwarding condition of the forwarding processor. Correspondingly, the record information is used for indicating whether the first detection message accords with the forwarding condition of the forwarding processor.
In some possible implementations, after the forwarding processor receives the first detection message from the virtual machine, record information of an operation performed by the forwarding processor on the first detection message is obtained, a second detection message is generated based on the record information, and the second detection message is returned to the virtual machine.
S304, the virtual machine receives a second detection message returned by the forwarding processor, and the server or the virtual machine performs target link detection based on the record information carried in the second detection message to obtain a first link detection result.
The first link detection result is used for indicating whether an abnormal event occurs to the target link. In some possible implementations, in the case where the anomaly detection is packet loss detection, the anomaly event is a packet loss event.
According to the technical scheme provided by the embodiment of the application, the virtual machine is triggered to send the first detection message to the forwarding processor through the link detection instruction, the forwarding processor records the operation on the first detection message, and the second detection message carrying the recorded information is returned to the virtual machine. Furthermore, the second detection message carries the operation of the forwarding processor on the first detection message, so that the virtual machine or the server detects the target link based on the record information carried in the second detection message, and whether the target link has an abnormal event can be determined. Therefore, the scheme for triggering the automatic link detection based on the link detection instruction is provided, and the efficiency and the accuracy of the link detection can be improved.
Fig. 4 is an interaction schematic diagram of a link detection method according to an embodiment of the present application, and a description is given of an interaction flow between a management terminal, a server, and a virtual machine and a forwarding processor included in the server in the link detection system shown in fig. 1. Referring to fig. 4, the method includes the following S401 to S419:
S401, the management terminal responds to the installation operation of the link detection tool and sends a tool installation instruction to the server.
The tool installation instruction is used for indicating that the link detection tool is installed in the virtual machine. The link detection tool is provided with a function of target link detection, such as a function of abnormality detection of a target link. In some possible implementations, the anomaly detection may be packet loss detection. The embodiment of the application will be described with reference to the following description of the packet loss detection as an example. It is noted that the anomaly detection may also be other types of detection, such as packet error detection, interception detection, etc. The embodiment of the application does not limit the specific type of abnormality detection.
In the embodiment of the application, the target link is a link from the virtual machine to the physical network card through the forwarding processor. Illustratively, taking the example that the forwarding processor includes a virtual switch, the target link may be a link from the virtual machine to the physical network card via the virtual switch. Also illustratively, taking the example that the forwarding processor includes a packet filtering firewall, virtual switch, the target link may be a link from the virtual machine to the physical network card via the packet filtering firewall, virtual switch.
In some possible implementations, the link detection tool may be a piece of program code newly implanted in the virtual machine. For example, the link detection tool may be configured as a piece of program code that is general-purpose, such as a piece of program code that is suitable for windows systems and linux systems. Alternatively, as another example, the link detection tool may be configured as two pieces of program code, such as one piece of program code for a windows system and one piece of program code for a linux system. In this way, the method can be applied to different operating systems operated by the virtual machine so as to facilitate the installation of the link detection tool on the virtual machine.
The management terminal may be provided with a display interface of the link detection tool in which a technician may perform the relevant operation. For example, the display interface of the link detection tool may include an installation control of the link detection tool, and the installation operation of the link detection tool may be a trigger operation of the installation control of the link detection tool by a technician. Accordingly, in some possible implementations, S401 may be replaced by: and the management terminal responds to the triggering operation of the installation control of the link detection tool and sends a tool installation instruction to the server. By way of example, the triggering operation may be a click operation, a double click operation, a long press operation, or other operations. The embodiment of the application does not limit the specific type of the triggering operation.
In the embodiment of the application, the link detection tool can be pre-installed in the server. In some possible implementations, in a case where the virtual machine has mounted the link detection tool, the management terminal transmits a tool mounting instruction to the server in response to a mounting operation of the link detection tool to instruct that the link detection tool is mounted in the virtual machine. The virtual machine mounted link detection tool refers to a link detection tool mounted in an associated server of the virtual machine.
In other possible implementations, in a case that the link detection tool is not mounted on the virtual machine, the management terminal sends a tool mounting instruction to the server in response to a mounting operation of the link detection tool, so as to instruct that the link detection tool is mounted on the virtual machine. Further, the server receives a tool mounting instruction from the management terminal, mounts the link detection tool in the virtual machine based on the tool mounting instruction, and returns mounting completion information to the management terminal. And the management terminal receives mounting completion information returned by the server based on the tool mounting instruction.
For example, the display interface of the link detection tool may include a mount control of the link detection tool, and the mount operation of the link detection tool may be a trigger operation of the mount control of the link detection tool by a technician. Accordingly, the process that the management terminal sends the tool mounting instruction to the server in response to the mounting operation of the link detection tool may be replaced by: and the management terminal responds to the triggering operation of the mounting control of the link detection tool and sends a tool mounting instruction to the server.
Further, in some possible implementations, the management terminal may also display the mounting completion information, such as displaying the mounting completion information in a display interface of the link detection tool, to prompt a technician that the virtual machine has mounted the link detection tool. Therefore, the information quantity displayed in the terminal interface is increased, so that a technician can know that the virtual machine is mounted with the link detection tool in time. For example, the management terminal may display the mounting completion information in a highlighted form. Or, the management terminal may display the mounting completion information in a jittered form. The embodiment of the application does not limit the display form of the mounting completion information.
In the implementation manner, the link detection tool is mounted on the virtual machine in advance, so that the subsequent process of mounting the link detection tool is ensured to be carried out smoothly, and the link detection is ensured to be carried out smoothly.
S402, the server receives a tool installation instruction from the management terminal, and installs a link detection tool in the virtual machine based on the tool installation instruction.
In some possible implementations, the tool installation instructions may carry an installation file, such as an installation package, of the link detection tool. Accordingly, after receiving the tool installation instruction from the management terminal, the server can acquire an installation file carried by the tool installation instruction, download the installation file and install the link detection tool in the virtual machine.
In some possible implementations, S402 may be implemented by the server and the virtual machine in cooperation, for example, after the server receives a tool installation instruction from the management terminal, the tool installation instruction may be sent to the virtual machine, and the virtual machine installs the link detection tool in the virtual machine in response to the tool installation instruction.
S403, the server returns installation completion information to the management terminal.
After the link detection tool is successfully installed in the virtual machine, the server may return installation completion information to the management terminal to indicate that the virtual machine has installed the link detection tool.
In some possible implementations, S403 may be implemented by the server and the virtual machine in cooperation, for example, after the link detection tool is successfully installed in the virtual machine, the virtual machine returns the installation completion information to the server, and the server returns the installation completion information to the management terminal in response to the installation completion information.
S404, the management terminal receives installation completion information returned by the server.
In some possible implementations, after the management terminal receives the installation completion information returned by the server based on the tool installation instruction, the installation completion information may also be displayed to prompt a technician that the virtual machine has installed the link detection tool. For example, the management terminal may display the installation completion information in a highlighted form. Or, the management terminal may display the installation completion information in a jittered form. The embodiment of the application does not limit the display form of the installation completion information.
It should be noted that, in some embodiments, before implementing the present solution, the link detection tool may be installed in all virtual machines of the server in advance through S401 to S404 described above. That is, the link detection tool may be the default tool for the virtual machine, similar to the arping tool installed by default in the virtual machine, and so on. Therefore, the link detection tool does not need to be installed when the link detection is executed, and the link detection can be triggered and executed quickly and conveniently. It should be appreciated that in this embodiment, the link detection tool need only be installed once in a lump in each virtual machine of the server.
Or in other embodiments, when the target link detection is performed on a certain virtual machine, a link detection tool may be installed in the certain virtual machine through S401 to S404, so that the link detection tool is used to complete the link detection on the certain virtual machine later. Therefore, only the link detection tool is required to be installed for the virtual machine to be subjected to target link detection, and the link detection tool is not required to be installed for all the virtual machines, so that resources occupied by installing the link detection tool in all the virtual machines can be saved.
S405, the management terminal responds to the starting operation of the link detection tool to start the link detection tool.
For example, the display interface of the link detection tool may include a start control of the link detection tool, and the start operation of the link detection tool may be a trigger operation of the start control of the link detection tool by a technician. Accordingly, S405 may be replaced by: the management terminal starts the link detection tool in response to a trigger operation of a start control of the link detection tool.
It should be noted that S405 is one possible implementation manner of starting the link detection tool. In another possible implementation, the management terminal may further set the link detection tool to the detection mode in response to a mode setting operation on the link detection tool.
The detection mode may also be referred to as a positioning mode or a diagnostic mode, which indicates that the link detection tool is in an operational state. It will be appreciated that the link detection tool being in a detection mode means that the link detection tool is now providing the functionality of target link detection. In this way, by setting the link detection tool to the detection mode, the link detection tool is used for target link detection later.
S406, the management terminal responds to the link detection operation for the virtual machine and sends a link detection instruction to the server.
In the embodiment of the application, the link detection instruction is used for indicating target link detection. In some possible implementations, the link detection instruction may carry a first detection message in order to perform a subsequent process of target link detection. The first detection message is used for target link detection, and is a detection message to be transmitted from the virtual machine to the physical network card through the forwarding processor in the embodiment of the application.
In some possible implementations, the management terminal responds to the link detection operation for the virtual machine, acquires a first detection message input by a user, and sends a link detection instruction carrying the first detection message to the server.
The user may be a technician such as a manager, an operation and maintenance person, or the like. For example, the display interface of the link detection tool may include a command input box for inputting the first detection message. The display interface of the link detection tool may further include a link detection control, and the link detection operation may be a trigger operation of the link detection control by a technician. Accordingly, the process of the management terminal obtaining the first detection message input by the user and sending the link detection instruction to the server in response to the link detection operation for the virtual machine may be replaced by: after the technician inputs the first detection message in the command input box, the technician can implement triggering operation on the link detection control, and the management terminal responds to the triggering operation on the link detection control to acquire the first detection message input by the user and send a link detection instruction carrying the first detection message to the server.
In the implementation mode, the first detection message is manually input, so that the first detection message to be transmitted can be quickly and efficiently obtained, the technical personnel can be conveniently and flexibly set the message content of the first detection message, and the man-machine interaction efficiency is improved.
Or in other possible implementations, the management terminal responds to the link detection operation for the virtual machine, acquires the locally stored first detection message, and sends a link detection instruction carrying the first detection message to the server.
The local memory of the management terminal stores a default first detection message. Taking the example that the display interface of the link detection tool may include a link detection control, a technician may implement a triggering operation on the link detection control, and then the management terminal responds to the triggering operation on the link detection control to obtain a locally stored first detection message, and sends a link detection instruction carrying the first detection message to the server.
In the implementation mode, the first detection message is stored locally, so that the first detection message does not need to be input manually, and the man-machine interaction efficiency can be further improved. Thus, two modes of acquiring the first detection message by the management terminal are provided, and the selectable modes of acquiring the first detection message by the management terminal are enriched. The method for acquiring the first detection message by the management terminal is not limited in the embodiment of the application.
S407, the server receives the link detection instruction, and responds to the link detection instruction to send a message detection instruction to the virtual machine.
The message detection instruction is used for indicating the virtual machine to send the first detection message to the forwarding processor.
In some possible implementations, the first detection message may be a detection message carried by the link detection instruction, and accordingly, the server may obtain, from the link detection instruction, the first detection message carried by the link detection instruction, and generate a message detection instruction based on the first detection message, so as to send the message detection instruction to the virtual machine.
Or, in other possible implementations, the first detection message may be a detection message generated by the server based on the link detection instruction, and accordingly, the server may generate the first detection message based on the message content indicated by the link detection instruction, and generate a message detection instruction based on the new first detection message, so as to send the message detection instruction to the virtual machine.
Thus, two modes of acquiring the first detection message by the server are provided, and the optional modes of acquiring the first detection message by the server are enriched. The method for obtaining the first detection message by the server is not limited in the embodiment of the application.
It should be noted that, in other possible implementations, the first detection message may also be a detection message generated by the virtual machine based on the message detection instruction, and accordingly, the virtual machine may newly generate the first detection message based on the message content indicated by the message detection instruction, so as to send the first detection message to the forwarding processor.
S408, the virtual machine responds to the message detection instruction and sends a first detection message to the forwarding processor.
In the embodiment of the application, the forwarding processor is used for forwarding the first detection message to the physical network card.
S409, the forwarding processor receives a first detection message from the virtual machine.
S410, the forwarding processor acquires record information of the operation of the forwarding processor on the first detection message.
The record information is used for indicating whether the first detection message accords with the forwarding condition of the forwarding processor.
In some possible implementations, after the forwarding processor receives the first detection packet from the virtual machine, it may determine whether the first detection packet meets a forwarding condition of the forwarding processor, and record a determination process of whether the first detection packet meets the forwarding condition of the forwarding processor, to obtain the record information.
In this way, the record information can be obtained by recording the judging process of whether the first detection message accords with the forwarding condition of the forwarding processor, so that the subsequent virtual machine can perform target link detection based on the record information of the forwarding processor, and smooth performance of link detection is ensured.
For example, in some possible implementations, the forwarding processor may determine whether the first detection packet meets a forwarding condition of the forwarding processor based on a packet header of the first detection packet. Illustratively, the message header of the first detection message may include a media access control (MEDIA ACCESS control, MAC) header, a virtual local area network (virtual local area network, VLAN) header, and an internet protocol address (internet protocol address, IP) header. Fig. 5 is a schematic diagram of a message header of a detection message according to an embodiment of the present application. Referring to fig. 5, a message header 500 of a detection message may include a MAC header 501, a VLAN header 502, and an IP header 503. In some possible implementations, the message header of the detection message may be 40 bytes. The following describes a process of determining whether the first detection message meets the forwarding condition of the forwarding processor based on the message header shown in fig. 5.
In some possible implementations, the process of the forwarding processor determining whether the first detection packet meets the forwarding condition of the forwarding processor may include at least one of the following four manners.
In the first mode, the forwarding processor judges whether a mapping relationship exists between the MAC address and the IP address based on the MAC address and the IP address in the first detection message. If the mapping relation exists, the first detection message is judged to be in accordance with the forwarding condition of the forwarding processor, and if the mapping relation does not exist, the first detection message is judged to be not in accordance with the forwarding condition of the forwarding processor.
In the first aspect, the set forwarding condition may be a condition of: the MAC address has a mapping relationship with the IP address.
Wherein the MAC address is used to indicate a source MAC address and a destination MAC address. For example, referring to fig. 5, the MAC address may be the MAC address 5011 in the MAC header 501 shown in fig. 5. The IP address is used to indicate a source IP address and a destination IP address. The IP address may be the IP address 5031 in the IP header 503 shown in fig. 5.
It should be understood that if the mapping relationship exists between the MAC address and the IP address in the first detection packet, this indicates that the address is correct, so that the subsequent forwarding can be successfully performed. If the mapping relation between the MAC address and the IP address does not exist, the fact that the address is incorrect is indicated, and subsequent forwarding cannot be successfully executed.
In some possible implementations, the process of determining, by the forwarding processor, whether the MAC address and the IP address have a mapping relationship may be: the forwarding processor queries whether a mapping relationship between the MAC address and the IP address exists in an address resolution protocol (address resolution protocol) ARP, and if the mapping relationship between the MAC address and the IP address can be queried in the address resolution protocol, determines that the mapping relationship exists between the MAC address and the IP address. If the mapping relation between the MAC address and the IP address cannot be queried in the address resolution protocol, determining that the mapping relation does not exist between the MAC address and the IP address.
And the forwarding processor judges whether the VLAN type is the same as the VLAN type of the forwarding processor based on the VLAN type of the virtual local area network in the first detection message. If the first detection messages are the same, the first detection messages are judged to be in accordance with the forwarding conditions of the forwarding processor, and if the first detection messages are not the same, the first detection messages are judged to be not in accordance with the forwarding conditions of the forwarding processor.
In the second aspect, the set forwarding condition may be a condition of second: the VLAN type is the same as the VLAN type where the forwarding processor is located.
Wherein, VLAN type refers to local area network type. For example, referring to fig. 5, the VLAN type in the first detection packet may be VLAN type 5021 in VLAN header 502 shown in fig. 5. It should be understood that if the VLAN type in the first detection packet is the same as the VLAN type where the forwarding processor is located, it means that the forwarding processor can reach the lan corresponding to the VLAN type, and can successfully execute subsequent forwarding. If the VLAN type in the first detection message is different from the VLAN type where the forwarding processor is located, the forwarding processor cannot reach the local area network corresponding to the VLAN type, and subsequent forwarding cannot be successfully executed.
In some possible implementations, the forwarding processor may acquire the VLAN type of the forwarding processor, and further determine whether the VLAN type in the first detection packet is the same as the VLAN type in which the forwarding processor is located.
And thirdly, the forwarding processor judges whether the first detection message is in error in the transmission process. If the first detection message does not have errors, the first detection message is judged to be in accordance with the forwarding condition of the forwarding processor, and if the first detection message does not have errors, the first detection message is judged to be not in accordance with the forwarding condition of the forwarding processor.
In the third aspect, the set forwarding condition may be a third condition: the first detection message is not in error in the transmission process.
It should be understood that if the first detection message is not in error in the transmission process, it indicates that the transmission is not in error, and the subsequent forwarding can be successfully performed. If the first detection message is wrong in the transmission process, the transmission is wrong, and the subsequent forwarding cannot be smoothly executed.
In some possible implementations, the process that the forwarding processor determines whether the first detection packet is in error in the transmission process may be: the forwarding processor checks whether the first detection message is erroneous during transmission based on a cyclic redundancy check (cyclic redundancy check, CRC).
And fourthly, the forwarding processor judges whether the first detection message accords with the firewall filtering rule. If the firewall filtering rule is met, the first detection message is judged to be met with the forwarding condition of the forwarding processor, and if the firewall filtering rule is not met, the first detection message is judged to be not met with the forwarding condition of the forwarding processor.
In the fourth aspect, the set forwarding condition may be a condition four: the first detection message accords with the firewall filtering rule.
The firewall filtering rules are preset packet filtering rules. It should be understood that if the first detection message meets the firewall filtering rule, it indicates that the first detection message meets the specification, and the subsequent forwarding can be successfully performed. If the first detection message does not accord with the firewall filtering rule, the first detection message does not accord with the specification, and the subsequent forwarding cannot be successfully executed.
In some possible implementations, the process of the forwarding processor determining whether the first detection packet meets the firewall filtering rule may be: the forwarding processor judges whether the MAC address and the IP address in the first detection message accord with the firewall filtering rule.
In the implementation manner, four ways of judging whether the first detection message accords with the forwarding condition of the forwarding processor are provided, so that the options of the forwarding processor for executing the judging process are enriched. It should be noted that, the forwarding processor may determine whether the first detection packet meets the forwarding condition of the forwarding processor based on one, two or more of the above four manners.
For example, taking the example that the forwarding processor includes a virtual switch, it may be determined whether the first detection packet meets the forwarding condition of the virtual switch based on the first condition, the second condition, and the third condition. The corresponding procedure may be: in the address resolution protocol, the virtual switch inquires whether the mapping relation between the MAC address and the IP address in the first detection message exists in the address resolution protocol. If the mapping relation between the MAC address and the IP address can be queried in the address resolution protocol, judging whether the VLAN type in the first detection message is the same as the VLAN type of the forwarding processor. If the VLAN type in the first detection message is the same as the VLAN type of the forwarding processor, checking whether the first detection message is in error in the transmission process based on cyclic redundancy check. If the first detection message is not in error in the transmission process, the first detection message is judged to accord with the forwarding condition of the virtual switch. It should be appreciated that if the first detection message does not meet any of the conditions, it is determined that the first detection message does not meet the forwarding condition of the virtual switch.
The above example describes a process of determining whether the first detection packet meets the forwarding condition of the virtual switch, taking the determination process of sequentially executing the first condition, the second condition, and the third condition as an example. In other embodiments, the judging process of the third condition, the second condition and the first condition may be sequentially performed, or the judging process of the first condition, the third condition and the second condition may be sequentially performed, or the judging process of the second condition, the third condition and the first condition may be sequentially performed. The embodiment of the application does not limit the judgment sequence of the forwarding condition.
Also illustratively, taking the example that the forwarding processor includes a packet filtering firewall and a virtual switch, the packet filtering firewall may determine whether the first detection packet meets the forwarding condition of the packet filtering firewall based on the first condition, the second condition, the third condition, and the fourth condition. The corresponding procedure may be: the packet filtering firewall queries whether the mapping relation between the MAC address and the IP address in the first detection message exists in the address resolution protocol. If the mapping relation between the MAC address and the IP address can be queried in the address resolution protocol, judging whether the VLAN type in the first detection message is the same as the VLAN type of the forwarding processor. If the VLAN type in the first detection message is the same as the VLAN type of the forwarding processor, checking whether the first detection message is in error in the transmission process based on cyclic redundancy check. If the first detection message is not in error in the transmission process, judging whether the MAC address and the IP address in the first detection message accord with the firewall filtering rule. If the MAC address and the IP address in the first detection message accord with the firewall filtering rule, the first detection message is judged to accord with the forwarding condition of the packet filtering firewall. It should be appreciated that if the first detection message does not meet any of the conditions, it is determined that the first detection message does not meet the forwarding condition of the packet filtering firewall.
It should be noted that, the above example describes a process of determining whether the first detection packet meets the forwarding condition of the packet filtering firewall by taking the determination process of sequentially executing the condition one, the condition two, the condition three and the condition four as an example. In other embodiments, the judging process of the fourth condition, the third condition, the second condition and the first condition may be sequentially performed, or the judging process of the first condition, the fourth condition, the third condition and the second condition may be sequentially performed, or the judging process of the second condition, the fourth condition, the third condition and the first condition may be sequentially performed. The embodiment of the application does not limit the judgment sequence of the forwarding condition.
In some possible implementations, if the first detection message meets the forwarding condition of the forwarding processor, forwarding the first detection message to the physical network card. Or if the first detection message does not accord with the forwarding condition of the forwarding processor, the first detection message is not forwarded to the physical network card. Thus, under the condition that the first detection message accords with the forwarding condition of the forwarding processor, the first detection message is forwarded to the physical network card, so that the reliability of message transmission is ensured.
It should be understood that if the forwarding processor forwards the first detection packet normally, it indicates that the forwarding processor does not generate an abnormal event, such as a packet loss event, and if the forwarding processor does not forward the first detection packet normally, it indicates that the forwarding processor generates an abnormal event, such as a packet loss event.
S411, the forwarding processor generates a second detection message based on the record information.
After obtaining the record information of the operation of the forwarding processor on the first detection message, the record information can be newly added on the basis of the first detection message to generate a second detection message. When the second detection message is generated, the message header (such as the MAC header, the VLAN header, the IP header, etc.) in the first detection message needs to be updated, so that the second detection message is returned to the virtual machine later.
The second detection message includes a data field that may be used to carry record information of the operation performed by the forwarding processor on the first detection message. Referring to fig. 5, the data field may be an IP data field 504 shown in fig. 5, and the record information of the operation performed on the first detection packet by the forwarding processor may be the transponder information 5041 in the IP data field 504 shown in fig. 5.
For example, after acquiring the record information of the operation performed by the forwarding processor on the first detection message, the forwarding processor may newly add the record information in the data field of the first detection message to generate the second detection message.
It should be noted that, the IP header 503 and the IP data field 504 shown in fig. 5 may form an IP datagram. Fig. 6 is a schematic diagram illustrating a format of an IP datagram according to an embodiment of the present application. Referring to fig. 6, components of record information (e.g., transponder information 5041 of fig. 5) are shown, wherein the record information may include a transponder name 601, a processing result 602, a non-compliance condition 603, and a reserved byte 604.
The transponder name 601 refers to the name, such as a number or an identification, of the transponder. The transponder name 601 may be 8 bits and the values may include 01, 02, … …, 255. For example, 01 may be used to represent the forwarding processor 1. The forwarding processor 2 may be denoted 02.
The processing result 602 refers to whether the forwarding processor forwards the first detection message to the physical network card. The processing result 602 may be 8 bits, and the values may include 01, 02, … …, 255. For example, a 01 may be used to indicate normal forwarding, meaning that no abnormal event has occurred. A 02 may be taken to mean that no forwarding is possible, meaning that an exception event has occurred.
The non-compliance condition 603 refers to a forwarding condition that the first detection packet does not correspond to. The non-conforming condition 603 may be 8 bits and the values may be 01, 02, … …, 255. For example, 01 may be used to indicate that there is no address mapping, i.e., there is no mapping between MAC addresses and IP addresses, and ARP may be understood as unreachable. A VLAN type may be indicated by 02 as being different from the VLAN type in which the forwarding processor is located, and may be understood as not reachable by the network. 03 may be used to indicate that the first detection message is in error during transmission. It may be indicated that 04 indicates that the first detection message does not conform to the firewall filtering rule, and it may be understood that iptables may not be forwarded.
Reserved bytes 604 may be used for later addition of new descriptive information.
In addition, FIG. 6 illustrates the format of an IP header that may include a version number, a header, a service type, a total length, an identifier, a flag, an offset, a time-to-live, a protocol, a header checksum, a source IP address, and a destination IP address. In some possible implementations, the version number may be 4 bits. In some possible implementations, the header may be 4 bits. In some possible implementations, the service type may be 8 bits. In some possible implementations, the total length may be 16 bits. In some possible implementations, the identifier may be 16 bits. In some possible implementations, the flag may be 3 bits. In some possible implementations, the offset may be 13 bits. In some possible implementations, the lifetime may be 8 bits. In some possible implementations, the protocol may be 8 bits. In some possible implementations, the header checksum may be 16 bits. In some possible implementations, the source IP address may be 32 bits. In some possible implementations, the destination IP address may be 32 bits.
S412, the forwarding processor returns a second detection message to the virtual machine.
Note that, the content shown in S409 to S412 corresponds to the process of the relay processor in fig. 3 for returning the second detection message to the virtual machine based on the first detection message.
Fig. 7 is a schematic flow chart of link detection according to an embodiment of the present application. Referring to fig. 7, the link detection tool may default to a non-detection mode (which may also be referred to as a normal mode) that indicates that the link detection tool is in a non-operational state. The link detection tool is controlled by the management terminal to enter a detection mode, and a subsequent link detection process is performed when the link detection tool is in the detection mode, and no processing is performed when the link detection tool is in the non-detection mode.
Taking an example that the forwarding processor includes a packet filtering firewall and a virtual switch, the link detection process may be: after the packet filtering firewall receives the first detection message, judging whether the first detection message accords with the forwarding condition of the packet filtering firewall, if so, judging whether the packet filtering firewall allows forwarding of the first detection message. If the first detection message meets the forwarding condition of the packet filtering firewall, forwarding the packet by the packet filtering firewall, for example, forwarding the first detection message to the virtual switch. If the first detection message does not meet the forwarding condition of the packet filtering firewall, the packet filtering firewall intercepts the first detection message and can also be understood as discarding the first detection message (which can be simply referred to as packet loss). And the packet filtering firewall also acquires the record information of the operation of the packet filtering firewall on the first detection message and returns a second detection message carrying the record information to the virtual machine.
After the virtual switch receives the first detection message, judging whether the first detection message accords with the forwarding condition of the virtual switch, if so, judging whether the virtual switch allows forwarding of the first detection message. If the first detection message meets the forwarding condition of the virtual switch, the virtual switch forwards the message, such as forwarding the first detection message to the physical network card. If the first detection message does not meet the forwarding condition of the virtual switch, the virtual switch intercepts the first detection message and can also be understood as discarding the first detection message. And the virtual switch also acquires the record information of the operation of the virtual switch on the first detection message and returns a second detection message carrying the record information to the virtual machine.
Therefore, by developing and implanting a section of program code for target link detection in the virtual machine, the forwarding processor can be triggered to record the operation of the forwarding processor on the first detection message and return a second detection message carrying record information to the virtual machine so as to realize subsequent target link detection.
Fig. 8 is a schematic flow chart of link detection according to an embodiment of the present application. Referring to fig. 8, the flow of link detection may include: first, a link detection tool is mounted on a virtual machine. And installing a link detection tool on the virtual machine. And starting a detection mode of the link detection tool, and triggering the virtual machine to send a first detection message to the forwarding processor. Taking the example that the forwarding processor includes the forwarding processor 1 and the forwarding processor 2, when the first detection message passes through the forwarding processor 1, the forwarding processor 1 records the operation of the forwarding processor 1 on the first detection message, and returns a second detection message carrying record information to the virtual machine. Similarly, when the first detection message passes through the forwarding processor 2, the forwarding processor 2 records the operation of the forwarding processor 2 on the first detection message, and returns a second detection message carrying the recorded information to the virtual machine.
S413, the virtual machine receives a second detection message returned by the forwarding processor.
For the first detection message and the second detection message related to the embodiment of the present application, in some possible implementations, the first detection message and the second detection message may be in the form of packet messages. Wherein, the packet message refers to a binary format message transmitted in a network layer. It is understood that when the first detection message or the second detection message is transmitted on the ethernet link, the first detection message and the second detection message may be in the form of ethernet frames.
In some possible implementations, the first and second detection messages each include a transmission type field for indicating a transmission type of the detection message.
For example, referring to fig. 5, the transmission type field may be a protocol type (type) field 5032 of the IP header shown in fig. 5. The transmission type field of the first detection message is a first transmission type, and the first transmission type is used for indicating that the first detection message is a detection message sent by the virtual machine to the physical network card. For example, the value of the first transmission type may be 252, which indicates that the first detection message is a detection message sent by the virtual machine to the physical network card.
Taking the first detection message as an example of a message manually input by a technician in the management terminal, in some possible implementations, the value of the first transmission type may be manually configured by the technician as 252. As another example, taking the first detection message as a message locally stored in the management terminal as an example, in some possible implementations, the value of the first transmission type may be configured as 252 by default. As another example, taking the first detection message as a newly generated message of the server as an example, in some possible implementations, the value of the first transmission type may be automatically configured as 252 by the server. As another example, taking the first detection message as a newly generated message of the virtual machine as an example, in some possible implementations, the value of the first transmission type may be automatically configured as 252 by the virtual machine.
The transmission type field of the second detection message is a second transmission type, and the second transmission type is used for indicating that the first detection message is a detection message returned by the forwarding processor based on the first detection message. For example, the second transmission type may have a value of 253, which indicates that the first detection message is a detection message returned by the forwarding processor based on the first detection message.
For example, the value of the second transmission type may be automatically configured by the forwarding processor to 253 before returning the second detection message to the virtual machine.
In the above embodiment, by setting the transmission type field in the first detection packet and the second detection packet, the amount of information included in the detection packet is increased, so as to distinguish detection packets of different transmission types.
In some possible implementations, the first detection message and the second detection message each include a priority field, where the priority field is used to indicate a transmission priority of the message.
For example, referring to fig. 5, the priority field may include a priority field in the MAC header 501, such as MAC priority 5012 shown in fig. 5. Also exemplary, referring to fig. 5, the priority field may also include a priority field in the IP header 503, such as IP priority 5033 shown in fig. 5.
The priority fields of the first detection message and the second detection message are the highest priority, and the highest priority refers to the highest priority of other messages transmitted relative to the same time period.
For example, taking the first detection message as a message manually input by a technician in the management terminal as an example, in some possible implementations, the value of the priority field of the first detection message may be manually configured as the highest priority by the technician. For another example, taking the first detection message as a message locally stored in the management terminal as an example, in some possible implementation manners, the value of the priority field of the first detection message may be configured as the highest priority by default. As another example, taking the first detection message as a newly generated message of the server as an example, in some possible implementations, the value of the first transmission type may be automatically configured as the highest priority by the server. As another example, taking the first detection message as a newly generated message of the virtual machine as an example, in some possible implementations, the value of the first transmission type may be automatically configured as the highest priority by the virtual machine.
For example, the value of the priority field of the second detection message may be automatically configured to be the highest priority by the forwarding processor before returning the second detection message to the virtual machine.
In the above embodiment, the priority fields of the first detection message and the second detection message are set to the highest priority. Therefore, the transmission priority of the first detection message and the second detection message can be guaranteed to be highest, namely, the first detection message and the second detection message are transmitted preferentially relative to other messages transmitted in the same time period, and abnormal events caused by message loss due to priority scheduling are avoided.
And S414, the virtual machine or the server detects the target link based on the record information carried in the second detection message to obtain a first link detection result.
The first link detection result is used for indicating whether an abnormal event occurs to the target link.
In some possible implementations, the virtual machine or the server may determine forwarding result information of the forwarding processor on the first detection packet based on the record information carried in the second detection packet. If the forwarding result information indicates that the forwarding processor forwards the first detection message to the physical network card, the determined first link detection result indicates that the abnormal event does not occur in the target link. If the forwarding result information indicates that the forwarding processor does not forward the first detection message to the physical network card, the determined first link detection result indicates that the abnormal event occurs in the target link.
Therefore, the record information carried in the second detection message is skillfully utilized to determine the forwarding result information of the forwarding processor on the first detection message, and whether the abnormal event occurs in the target link is determined by judging whether the forwarding processor forwards the first detection message to the physical network card or not, so that the first link detection result can be rapidly and efficiently determined, the efficiency of determining the first link detection result is improved, and the efficiency of link detection is improved.
And under the condition that the first link detection result indicates that the abnormal event occurs in the target link, the second detection message is further used for determining a second link detection result, and the second link detection result is used for indicating the reason why the abnormal event occurs in the target link. Therefore, the reason for the abnormal event of the target link can be further determined, and the information amount obtained by link detection is increased.
For example, in some possible implementations, in a case where the first link detection result indicates that the abnormal event occurs in the target link, the virtual machine or the server may determine the second link detection result based on the record information carried in the second detection message. Taking an example that the operation performed by the forwarding processor on the first detection packet includes determining whether the first detection packet meets the forwarding condition of the forwarding processor, the process of determining the second link detection result may be: if the record information indicates that the first detection message does not accord with the forwarding condition, the forwarding condition which is not met by the first detection message is used as the second link detection result.
In the above implementation, a way of determining the second link detection result is provided. The method comprises the steps of recording whether the first detection message accords with the forwarding condition of the forwarding processor in the recording information, and skillfully utilizing the recording information carried in the second detection message to determine the forwarding condition which is not met by the first detection message, so that the reason that the forwarding processor does not forward the first detection message to the physical network card can be determined, the second link detection result can be rapidly and efficiently determined, the efficiency of determining the second link detection result is improved, and the link detection efficiency is improved.
In the related art, it is difficult to accurately locate whether an abnormal event such as a packet loss occurs, and it is more difficult to locate the cause of the occurrence of the abnormal event, so that the link detection and location are more difficult. Compared with the related art, the embodiment of the application provides a link detection scheme aiming at the virtual type forwarding processors such as the distributed switch, which not only can determine whether an abnormal event occurs, but also can determine the reason of the occurrence of the abnormal event, increases the information quantity obtained by link detection, improves the accuracy of the link detection, and solves the difficulty of the link detection of the virtual type forwarding processors such as the distributed switch in the related art.
S415, the virtual machine returns a first link detection result to the server.
S416, the server returns a first link detection result to the management terminal.
S417, the management terminal receives the first link detection result returned by the server.
In some possible implementations, the management terminal further receives a second link detection result returned by the virtual machine, where the first link detection result indicates that the abnormal event occurs on the target link.
S418, the management terminal displays the first link detection result.
In some possible implementations, the management terminal displays the first link detection result in the display interface of the link detection tool to prompt a technician about the result of the link detection. Therefore, the information quantity displayed in the terminal interface is increased, so that a technician can timely acquire the result of the link detection.
For example, the management terminal may display the first link detection result in a highlighted form. Or, the management terminal may display the first link detection result in a jittered form. The embodiment of the application does not limit the display form of the first link detection result.
Therefore, the information quantity displayed by the management terminal is increased by displaying the first link detection result on the management terminal, so that a technician can know the result of the link detection in time. Note that S418 is an optional step. In other possible implementations, after the management terminal receives the first link detection result returned by the virtual machine, the step of displaying the first link detection result as shown in S418 need not be performed.
Further, in some possible implementations, after the management terminal receives the second link detection result returned by the virtual machine, the management terminal further displays the second link detection result, for example, the second link detection result is displayed in a display interface of the link detection tool, so as to prompt a technician of a cause of the abnormal event in the current link detection. Therefore, the information quantity displayed in the terminal interface is increased, so that a technician can timely know the reason of the abnormal event of the current link detection.
For example, the management terminal may display the second link detection result in a highlighted form. Or, the management terminal may display the second link detection result in a jittered form. The embodiment of the application does not limit the display form of the second link detection result.
Therefore, by displaying the second link detection result on the management terminal, the information quantity displayed by the management terminal is increased, so that a technician can know the reason of the abnormal event of the link detection in time.
S419, the management terminal closes the link detection tool.
Note that S419 is an optional step. In other possible implementations, the management terminal may switch the link detection tool from the detection mode to the non-detection mode. For example, the display interface of the link detection tool may include a mode switching control, such as a switch control, of the link detection tool, so that the link detection tool can be easily controlled to flexibly switch between a detection mode and a non-detection mode through the mode switching control, thereby improving the man-machine interaction efficiency.
According to the technical scheme provided by the embodiment of the application, the virtual machine is triggered to send the first detection message to the forwarding processor through the link detection instruction, the forwarding processor records the operation on the first detection message, and the second detection message carrying the recorded information is returned to the virtual machine. Furthermore, the second detection message carries the operation of the forwarding processor on the first detection message, so that the virtual machine or the server detects the target link based on the record information carried in the second detection message, and whether the target link has an abnormal event can be determined. Therefore, the scheme for triggering the automatic link detection based on the link detection instruction is provided, and the efficiency and the accuracy of the link detection can be improved.
It should be noted that, in the related art, the physical network card of one server may aggregate the received and transmitted message information of multiple virtual machines, and the physical network card is used as the uplink of the forwarding processor, so that the forwarding processor may aggregate the received and transmitted message information of multiple virtual machines. Therefore, when large-scale message receiving and sending information is faced, it is difficult to determine which virtual machine corresponds to the link which has abnormal event, so that the problem that the analysis is difficult to be performed manually is solved, and the accuracy of link detection is reduced. In the embodiment of the application, under the condition that the physical network card is connected with a plurality of virtual machines, the targeted link detection can be executed aiming at one of the virtual machines, so that whether the abnormal event occurs to the target link corresponding to each virtual machine can be accurately positioned, and the accuracy of the link detection is further improved.
The foregoing description of the embodiments of the present application has been presented primarily in terms of methods. It will be appreciated that, in order to implement the above-mentioned functions, the server in the embodiment of the present application includes corresponding hardware structures and/or software modules for performing the respective functions. Those of skill in the art will readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the embodiments of the present application.
Fig. 9 is a schematic structural diagram of a link detection device according to an embodiment of the present application. Referring to fig. 9, the link detection apparatus includes a receiving module 901, a transmitting module 902, a returning module 903, and a detecting module 904. Wherein,
The receiving module 901 is configured to receive a link detection instruction, where the link detection instruction is used to instruct detection of a target link, and the target link is a link between the virtual machine and the physical network card via the forwarding processor;
The sending module 902 is configured to respond to the link detection instruction, where the virtual machine sends a first detection packet to a forwarding processor, and the forwarding processor is configured to forward the first detection packet to the physical network card;
The returning module 903 is configured to return, to the virtual machine, a second detection message based on the first detection message, where the second detection message carries record information of an operation performed by the forwarding processor on the first detection message;
The detection module 904 is configured to receive a second detection message returned by the forwarding processor, and perform target link detection based on the record information carried in the second detection message, to obtain a first link detection result, where the first link detection result is used to indicate whether an abnormal event occurs in the target link.
According to the technical scheme provided by the embodiment of the application, the virtual machine is triggered to send the first detection message to the forwarding processor through the link detection instruction, the forwarding processor records the operation on the first detection message, and the second detection message carrying the recorded information is returned to the virtual machine. Furthermore, the second detection message carries the operation of the forwarding processor on the first detection message, so that the virtual machine or the server detects the target link based on the record information carried in the second detection message, and whether the target link has an abnormal event can be determined. Therefore, the scheme for triggering the automatic link detection based on the link detection instruction is provided, and the efficiency and the accuracy of the link detection can be improved.
In some possible implementations, the detection module 904 is specifically configured to:
Determining forwarding result information of the forwarding processor on the first detection message based on the record information carried in the second detection message;
If the forwarding result information indicates that the forwarding processor forwards a first detection message to the physical network card, the determined first link detection result indicates that the abnormal event does not occur in the target link;
If the forwarding result information indicates that the forwarding processor does not forward the first detection message to the physical network card, the determined first link detection result indicates that the abnormal event occurs in the target link.
In some possible implementations, the apparatus further includes a determining module configured to:
And determining a second link detection result based on the record information carried in the second detection message under the condition that the first link detection result indicates that the abnormal event occurs in the target link, wherein the second link detection result is used for indicating the reason of the abnormal event occurring in the target link.
In some possible implementations, the operation performed by the forwarding processor on the first detection packet includes determining whether the first detection packet meets a forwarding condition of the forwarding processor; the record information is used for indicating whether the first detection message accords with the forwarding condition of the forwarding processor;
The determining module is specifically configured to:
If the record information indicates that the first detection message does not accord with the forwarding condition, the forwarding condition which is not met by the first detection message is used as the second link detection result.
In some possible implementations, the sending module 902 is specifically configured to:
and responding to the link detection instruction, and sending a message detection instruction to the virtual machine. And the virtual machine responds to the message detection instruction and sends the first detection message to the forwarding processor.
In some possible implementations, the return module 903 is specifically configured to:
The forwarding processor receives a first detection message from the virtual machine, acquires record information of operation of the forwarding processor on the first detection message, and generates a second detection message based on the record information. Further, the forwarding processor returns a second detection message to the virtual machine.
In some possible implementations, the return module 903 is specifically configured to:
Judging whether the first detection message accords with the forwarding condition of the forwarding processor, and recording the judging process of whether the first detection message accords with the forwarding condition of the forwarding processor to obtain the record information.
In some possible implementations, the return module 903 is specifically configured to at least one of:
based on the Media Access Control (MAC) address and the Internet Protocol (IP) address in the first detection message, judging whether a mapping relation exists between the MAC address and the IP address; if the mapping relation exists, judging that the first detection message accords with the forwarding condition of the forwarding processor, and if the mapping relation does not exist, judging that the first detection message does not accord with the forwarding condition of the forwarding processor;
Judging whether the VLAN type is the same as the VLAN type of the forwarding processor or not based on the VLAN type of the virtual local area network in the first detection message; if the first detection messages are the same, judging that the first detection messages accord with the forwarding conditions of the forwarding processor, and if the first detection messages are not the same, judging that the first detection messages do not accord with the forwarding conditions of the forwarding processor;
Judging whether the first detection message is in error in the transmission process; if the first detection message does not have errors, judging that the first detection message accords with the forwarding condition of the forwarding processor, and if the first detection message does not have errors, judging that the first detection message does not accord with the forwarding condition of the forwarding processor;
Judging whether the first detection message accords with a firewall filtering rule; if the firewall filtering rule is met, the first detection message is judged to be met with the forwarding condition of the forwarding processor, and if the firewall filtering rule is not met, the first detection message is judged to be not met with the forwarding condition of the forwarding processor.
In some possible implementations, the apparatus further includes a forwarding module configured to:
if the first detection message accords with the forwarding condition of the forwarding processor, forwarding the first detection message to the physical network card; or alternatively, the first and second heat exchangers may be,
If the first detection message does not accord with the forwarding condition of the forwarding processor, the first detection message is not forwarded to the physical network card.
In some possible implementations, the receiving module 901 is specifically configured to receive a link detection instruction from the management terminal;
the return module is further configured to return the first link detection result to the management terminal.
In some possible implementations, the forwarding processor includes a virtual switch through which the virtual machine is connected to the physical network card; or the forwarding processor comprises a packet filtering firewall and a virtual switch, and the virtual machine is connected with the physical network card by connecting the packet filtering firewall and the virtual switch in sequence.
In some possible implementations, the first detection message and the second detection message each include a transmission type field, where the transmission type field is used to indicate a transmission type of the detection message;
The transmission type field of the first detection message is a first transmission type, and the first transmission type is used for indicating that the first detection message is a detection message sent by the virtual machine to the physical network card; the transmission type field of the second detection message is a second transmission type, and the second transmission type is used for indicating that the second detection message is a detection message returned by the forwarding processor based on the first detection message.
In some possible implementations, the first detection message and the second detection message each include a priority field, where the priority field is used to indicate a transmission priority of the message;
The priority fields of the first detection message and the second detection message are the highest priority, and the highest priority refers to the highest priority of other messages transmitted relative to the same time period.
In some possible implementations, in the case where the anomaly detection is packet loss detection, the anomaly event is a packet loss event.
The embodiment of the application also provides a server, which comprises a processor and a memory, wherein the processor and the memory are coupled. The memory is used for storing computer program instructions, and the processor is used for calling the computer program instructions in the memory to execute the link detection method shown in the embodiment.
The embodiment of the present application also provides a computer-readable storage medium storing computer program instructions for causing a server to execute the link detection method as in the above embodiment.
The embodiments of the present application also provide a computer program product comprising computer program instructions which, when run on a server, cause the server to perform the link detection method as described in the above embodiments.
Wherein the server, the computer-readable storage medium or the computer program product provided by the embodiments of the present application are each configured to perform the corresponding method provided above. Therefore, the advantages achieved by the method can be referred to as the advantages in the corresponding method provided above, and will not be described herein.
It will be apparent to those skilled in the art from this disclosure that, for convenience and brevity of description, only the above-described division of functional modules is illustrated, and in practical applications, the above-described functional allocation may be performed by different functional modules, that is, the internal structure of the device (e.g., server) is divided into different functional modules, so as to perform all or part of the above-described functions. The specific working processes of the above-described system, device (such as a server) and unit may refer to the corresponding processes in the foregoing method embodiments, which are not described herein again.
In the several embodiments provided herein, it should be understood that the disclosed systems, apparatuses (e.g., servers) and methods may be implemented in other ways. For example, the above-described embodiments of an apparatus (e.g., a server) are merely illustrative, and the division of the modules or units is merely a logical function division, and may be implemented in other ways, such as multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units described above, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the method of the various embodiments of the present application. And the aforementioned storage medium includes: flash memory, removable hard disk, read-only memory, random access memory, magnetic or optical disk, and the like.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. The link detection method is characterized by being applied to a server, wherein the server comprises a virtual machine, a forwarding processor and a physical network card, and the virtual machine is connected with the physical network card through the forwarding processor; the method comprises the following steps:
receiving a link detection instruction, wherein the link detection instruction is used for indicating target link detection, and the target link is a link between the virtual machine and the physical network card through the forwarding processor;
Responding to the link detection instruction, the virtual machine sends a first detection message to the forwarding processor, and the forwarding processor is used for forwarding the first detection message to the physical network card; the forwarding processor returns a second detection message to the virtual machine based on the first detection message, wherein the second detection message carries record information of the operation of the forwarding processor on the first detection message;
And detecting a target link based on the record information carried in the second detection message to obtain a first link detection result, wherein the first link detection result is used for indicating whether an abnormal event occurs in the target link.
2. The method of claim 1, wherein the performing target link detection based on the record information carried in the second detection packet to obtain a first link detection result includes:
determining forwarding result information of the forwarding processor on the first detection message based on the record information carried in the second detection message;
If the forwarding result information indicates that the forwarding processor forwards the first detection message to the physical network card, the determined first link detection result indicates that the abnormal event does not occur in the target link;
And if the forwarding result information indicates that the forwarding processor does not forward the first detection message to the physical network card, the determined first link detection result indicates that the abnormal event occurs in the target link.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
And under the condition that the first link detection result indicates that the abnormal event occurs in the target link, determining a second link detection result based on the record information carried in the second detection message, wherein the second link detection result is used for indicating the reason of the abnormal event occurring in the target link.
4. The method of claim 3, wherein the operation of the forwarding processor on the first detection message comprises determining whether the first detection message meets a forwarding condition of the forwarding processor; the record information is used for indicating whether the first detection message accords with the forwarding condition of the forwarding processor;
The determining a second link detection result based on the record information carried in the second detection message includes:
And if the record information indicates that the first detection message does not accord with the forwarding condition, using the forwarding condition which is not met by the first detection message as the second link detection result.
5. The method of any of claims 1-4, wherein the virtual machine sending a first detection message to the forwarding processor in response to the link detection instruction comprises:
responding to the link detection instruction, and sending a message detection instruction to the virtual machine, wherein the message detection instruction is used for indicating to send the first detection message to the forwarding processor;
and the virtual machine responds to the message detection instruction and sends the first detection message to the forwarding processor.
6. The method of any of claims 1-5, wherein the forwarding processor comprises a virtual switch through which the virtual machine is connected to the physical network card; or the forwarding processor comprises a packet filtering firewall and the virtual switch, and the virtual machine is connected with the physical network card by sequentially connecting the packet filtering firewall and the virtual switch.
7. The method according to any one of claims 1-6, wherein the first and second detection messages each include a transmission type field for indicating a transmission type of the detection message;
The transmission type field of the first detection message is a first transmission type, and the first transmission type is used for indicating that the first detection message is a detection message sent by the virtual machine to the physical network card; the transmission type field of the second detection message is a second transmission type, and the second transmission type is used for indicating that the second detection message is a detection message returned by the forwarding processor based on the first detection message.
8. The method according to any one of claims 1-7, wherein the first and second detection messages each include a priority field for indicating a transmission priority of a message;
the priority fields of the first detection message and the second detection message are the highest priority, and the highest priority refers to the highest priority of other messages transmitted relative to the same time period.
9. The method according to any one of claims 1-8, wherein in case the anomaly detection is a packet loss detection, the anomaly event is a packet loss event.
10. A server, wherein the server comprises a processor and a memory; the processor and the memory are coupled;
The memory is used for storing computer program instructions;
the processor for invoking computer program instructions in the memory to perform the method of any of claims 1-9.
CN202410132826.7A 2024-01-30 2024-01-30 Link detection method and server Pending CN118041811A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410132826.7A CN118041811A (en) 2024-01-30 2024-01-30 Link detection method and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410132826.7A CN118041811A (en) 2024-01-30 2024-01-30 Link detection method and server

Publications (1)

Publication Number Publication Date
CN118041811A true CN118041811A (en) 2024-05-14

Family

ID=90999675

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410132826.7A Pending CN118041811A (en) 2024-01-30 2024-01-30 Link detection method and server

Country Status (1)

Country Link
CN (1) CN118041811A (en)

Similar Documents

Publication Publication Date Title
CN109074330B (en) Network interface card, computing device, and data packet processing method
KR101480583B1 (en) A method for supporting ip network interconnectivity between partitions in a virtualized environment
EP1482712B1 (en) Virtual network addresses
US10812597B2 (en) Content delivery network (CDN) management system, method, and apparatus
CN109479028B (en) Network interface card, computing device, and data packet processing method
EP1892929B1 (en) A method, an apparatus and a system for message transmission
US7116675B2 (en) Methods and systems for transferring packets and preventing illicit access
US20110292807A1 (en) Method and system for sideband communication architecture for supporting manageability over wireless lan (wlan)
EP3367612A1 (en) Dial testing method, dial testing system, and compute node
US20130346487A1 (en) Relay server and relay communication system
US10630542B2 (en) Method for automatically initializing network device, remote server and network system using the same
CN113595905B (en) Distributed routing method, device, equipment and storage medium
CN114815782A (en) Remote diagnosis method, apparatus, device and medium
CN110691139A (en) Data transmission method, device, equipment and storage medium
CN113163024B (en) Message processing method, server and storage medium
KR20230017886A (en) Packet processing method, device and system
CN111200519B (en) Data processing method and device, BBU, access network equipment and storage medium
CN118041811A (en) Link detection method and server
US7505418B1 (en) Network loopback using a virtual address
CN108234359B (en) System and method for transmitting message
CN115277450A (en) OPNET-based virtual-real combined heterogeneous communication network fusion system and application
CN108683689B (en) Improved test system and method for realizing NIDS and NIPS intrusion detection function
CN112825043A (en) Information processing apparatus, address duplication management method, and computer-readable non-transitory recording medium
US9535874B2 (en) Host embedded controller interface bridge
CN112462647B (en) Radio station network control system and method

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