Transparent detection method and device of network connectivity, electronic equipment and storage medium
By creating a virtual network interface in the cloud product and using UUID identification codes to mark data packets, network connectivity detection can be performed without entering the device's internal workings. This solves the problems of detection failure and slow speed caused by virtual machine shutdown, improves the detection rate, and ensures the privacy of user data.
Patent Information
- Application Number
- CN202310411921.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-18
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2043-04-18
AI Technical Summary
Existing network connectivity testing methods in cloud products suffer from several issues: failures can occur when virtual machines are shut down, failures can occur due to incorrect network configuration of customer virtual machines, slow speeds, and issues affecting the privacy of user virtual machines.
By creating virtual network interfaces at the source and destination nodes, constructing and forwarding data packets, and simulating the sending and receiving process of data packets without entering the device, and using UUID identification codes to mark data packets for easy filtering, transparent detection is achieved.
It improves the detection rate, ensures the privacy of user data, and avoids the impact of device network configuration and shutdown status on the detection results.
Smart Images

Figure CN116389312B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of communication technology, specifically relating to a method and apparatus for transparent network connectivity detection, an electronic device, and a storage medium. Background Technology
[0002] In current public cloud, private cloud and other cloud products, due to the increasingly complex network conditions of customers, a virtual machine-to-virtual machine network connectivity detection function is usually provided.
[0003] Existing network connectivity testing methods have the following problems during use: 1. Incorrect network configuration in the client virtual machine can lead to test failure and affect the test results; 2. Shutting down the virtual machine will prevent the test from being performed; 3. It requires accessing the virtual machine through a QGA proxy tool, which is very slow; 4. It requires entering the virtual machine, which affects the privacy of the user's virtual machine. Summary of the Invention
[0004] The purpose of this application is to provide a network connectivity transparency detection method, apparatus, electronic device, and storage medium to solve the problems in existing network connectivity testing methods, such as the inability to detect when the virtual machine is turned off, detection failure due to incorrect network configuration of the client virtual machine, slow speed, and impact on the privacy of the user's virtual machine.
[0005] To achieve the above objectives, one technical solution adopted in this application is:
[0006] A transparent detection method for network connectivity is provided, applied to a source node detection proxy unit, the transparent detection method comprising:
[0007] Create a source virtual network port;
[0008] The system receives a message sending instruction, which is sent by the detection service unit in response to the user's detection instruction. The detection instruction includes the address of the source node, the address of the destination node, the network protocol, the transmission protocol, the port of the source device, the port of the destination device, and the data packet length.
[0009] Based on the message sending instruction, a data packet is constructed;
[0010] The data packet is forwarded to the network port of the source device through the source virtual network port, so that the data packet is sent to the network port of the destination device through the network port of the source device.
[0011] In one or more embodiments, the step of forwarding the data packet to the network port of the source device via the source virtual network port further includes:
[0012] Generate an identifier and insert the identifier into the data packet.
[0013] In one or more embodiments, the identifier is a randomly generated UUID identification code.
[0014] To achieve the above objectives, another technical solution adopted in this application is:
[0015] A transparent network connectivity detection device is provided, comprising:
[0016] The source test port management module is used to create source virtual network ports;
[0017] The first instruction receiving module receives a message sending instruction. The message sending instruction is sent by the detection service unit in response to the user's detection instruction. The detection instruction includes the address of the source node, the address of the destination node, the network protocol, the transmission protocol, the port of the source device, the port of the destination device, and the data packet length.
[0018] The data packet construction module constructs data packets based on the message sending instruction;
[0019] The data packet sending module is used to forward the data packet to the network port of the source device through the source virtual network port, so that the data packet is sent to the network port of the destination device through the network port of the source device.
[0020] To achieve the above objectives, another technical solution adopted in this application is:
[0021] A transparent detection method for network connectivity is provided, applied to a destination node detection proxy unit, the transparent detection method comprising:
[0022] Create a destination virtual network interface;
[0023] Receive message receiving instruction, which is sent by the detection service unit in response to the user's detection instruction;
[0024] In response to the message receiving instruction, the network port of the destination device is monitored so that the destination virtual network port can receive data packets created and forwarded by the source node detection proxy unit.
[0025] The result of receiving the data packet is reported back.
[0026] In one or more embodiments, the data packet further includes an identification code generated by the source node detection agent unit and inserted into the data packet.
[0027] In one or more embodiments, the identifier is a randomly generated UUID.
[0028] In one or more embodiments, the step of monitoring the network port of the target device to enable the target virtual network port to receive data packets created and forwarded by the source node detection proxy unit is specifically as follows:
[0029] Monitor the network port of the destination device, and intercept the data packet from the network port of the destination device based on the identification code.
[0030] To achieve the above objectives, another technical solution adopted in this application is:
[0031] A transparent network connectivity detection device is provided, comprising:
[0032] The destination test port management module is used to create destination virtual network ports;
[0033] The second instruction receiving module is used to receive message receiving instructions, which are sent by the detection service unit in response to the user's detection instructions.
[0034] The monitoring module is used to monitor the network port of the destination device in response to the message receiving instruction, so that the destination virtual network port can receive data packets created and forwarded by the source node detection proxy unit.
[0035] The receiving result feedback module is used to provide feedback on the receiving result of the data packet.
[0036] To achieve the above objectives, another technical solution adopted in this application is:
[0037] A transparent detection method for network connectivity is provided, applied to a detection service unit, the transparent detection method comprising:
[0038] Receive detection instructions sent by the user, the detection instructions including the address of the source node, the address of the destination node, the network protocol, the transmission protocol, the port of the source device, the port of the destination device, and the data packet length;
[0039] In response to the detection command, a message sending command is sent to the source node detection agent unit, so that the source node detection agent unit constructs a data packet based on the message sending command, and forwards the data packet to the network port of the source device through the created source virtual network port, so that the data packet is sent to the network port of the destination device through the network port of the source device;
[0040] In response to the detection command, a message receiving command is sent to the destination node detection proxy unit, so that the destination node detection proxy unit listens to the network port of the destination device, receives the data packet through the created destination virtual network port and feeds back the receiving result;
[0041] Based on the received data packets, connectivity information is fed back.
[0042] In one or more embodiments, the data packet further includes an identification code generated by the source node detection agent unit and inserted into the data packet.
[0043] In one or more embodiments, the identifier is a randomly generated UUID.
[0044] In one or more embodiments, the destination node detection proxy unit intercepts the data packet from the network port of the destination device based on the identification code.
[0045] In one or more embodiments, the step of sending the message sending instruction to the source node detection proxy unit further includes:
[0046] The detection command is parsed and the parameter validity is verified.
[0047] To achieve the above objectives, another technical solution adopted in this application is:
[0048] A transparent network connectivity detection device is provided, comprising:
[0049] The third instruction receiving module is used to receive detection instructions sent by the user. The detection instructions include the address of the source node, the address of the destination node, the network protocol, the transmission protocol, the port of the source device, the port of the destination device, and the data packet length.
[0050] The first instruction sending module is used to respond to the detection instruction by sending a message sending instruction to the source node detection agent unit, so that the source node detection agent unit constructs a data packet based on the message sending instruction and forwards the data packet to the network port of the source device through the created source virtual network port, so that the data packet is sent to the network port of the destination device through the network port of the source device;
[0051] The second instruction sending module is used to respond to the detection instruction by sending a message receiving instruction to the destination node detection proxy unit, so that the destination node detection proxy unit can listen to the network port of the destination device and receive the data packet through the created destination virtual network port and return the receiving result.
[0052] The detection result feedback module is used to provide connectivity information based on the reception result of the data packet.
[0053] To achieve the above objectives, another technical solution adopted in this application is:
[0054] An electronic device is provided, comprising:
[0055] At least one processor; and
[0056] A memory that stores instructions, which, when executed by the at least one processor, cause the at least one processor to perform the transparent network connectivity detection method as described in any of the above embodiments.
[0057] To achieve the above objectives, another technical solution adopted in this application is:
[0058] A machine-readable storage medium is provided that stores executable instructions, which, when executed, cause the machine to perform a transparent network connectivity detection method as described in any of the above embodiments.
[0059] The advantages of this application, which differ from existing technologies, are:
[0060] The source node detection proxy unit of this application forwards data packets to the source device's network port through the source virtual network port. The data packets are then sent from the source device's network port to the destination device's network port. This simulates the process of the source device actually sending data packets without accessing the source device. The destination node detection proxy unit listens to the destination device receiving data packets through the created destination virtual network port and reports the reception results, simulating the process of the destination device actually receiving data packets. The sending and receiving of data packets does not require access to the device's internal workings, and the device's own operating status does not affect the data packet sending process. This avoids the impact of network configuration, power-off status, etc., on connectivity information, improves the detection rate, and ensures the privacy of user data. Attached Figure Description
[0061] Figure 1 This is a schematic diagram of a scenario illustrating the network connectivity transparency detection method and apparatus shown in various embodiments of this application;
[0062] Figure 2 This is a flowchart illustrating one implementation of the transparent network connectivity detection method of this application;
[0063] Figure 3 This is a schematic diagram of the structure of one embodiment of the data package of this application;
[0064] Figure 4 This is a schematic diagram of one embodiment of the transparent network connectivity detection device of this application;
[0065] Figure 5 This is a flowchart illustrating another embodiment of the transparent network connectivity detection method of this application;
[0066] Figure 6 This is a schematic diagram of one embodiment of the transparent network connectivity detection device of this application;
[0067] Figure 7This is a flowchart illustrating another implementation of the transparent network connectivity detection method of this application;
[0068] Figure 8 This is a schematic diagram of one embodiment of the transparent network connectivity detection device of this application;
[0069] Figure 9 This is a schematic diagram of one embodiment of the electronic device of this application. Detailed Implementation
[0070] The present application will now be described in detail with reference to the embodiments shown in the accompanying drawings. However, these embodiments do not limit the present application, and any structural, methodological, or functional modifications made by those skilled in the art based on these embodiments are included within the protection scope of the present application.
[0071] As customers' network conditions become increasingly complex, it is often necessary to provide customers with network connectivity detection functionality between virtual machines.
[0072] The network connectivity detection function can determine the connectivity between virtual machines by specifying necessary packet parameters, such as source IP, destination IP, source port, destination port, and protocol number, and then using an automated proxy to access the client's source virtual machine. In the source virtual machine, a packet containing the above parameters is constructed and sent. Then, the destination virtual machine checks whether the constructed packet is received, thereby determining the connectivity between virtual machines.
[0073] However, this detection method requires the participation of a virtual machine. Shutting down the virtual machine or incorrect network configuration of the virtual machine will cause the detection to fail and affect the detection results.
[0074] In addition, the detection speed is very slow because the QGA proxy tool is required to enter the virtual machine to perform the operation, and entering the virtual machine will affect the privacy of the user's virtual machine.
[0075] To address the aforementioned issues, the applicant has developed a method for transparent network connectivity testing, which allows connectivity testing to be performed without entering a virtual machine, container, or other independent space.
[0076] This application is primarily used in cloud products; for details, please refer to [link / reference]. Figure 1 , Figure 1 This is a schematic diagram of a scenario illustrating the network connectivity transparency detection method and apparatus shown in various embodiments of this application. For example... Figure 1 As shown, the network connectivity transparency detection method can detect the connectivity of independent spaces within each node of a cloud product. These independent spaces can be virtual machines or containers. Users can issue detection commands through a client, and each node can perform network connectivity detection based on the received commands and feed the connectivity information back to the client.
[0077] The method described in this application is detailed below. Please refer to [link / reference]. Figure 2 , Figure 2 This is a flowchart illustrating one implementation of the transparent network connectivity detection method of this application.
[0078] This transparent detection method is applied to the source node detection proxy unit. Specifically, the transparent detection method includes:
[0079] S100a, Create source virtual network port.
[0080] First, the detection proxy unit inside the source node can create a source virtual network interface for testing, and set parameters such as the network card attributes, maximum packet length, MAC address, and IP address of the source virtual network interface.
[0081] In one embodiment, the test virtual network interface can be a tap interface. In other embodiments, other types of virtual network cards, such as tun interfaces, can also be used, all of which can achieve the effect of this embodiment.
[0082] In cloud platform applications involving multiple nodes, since the source and destination nodes cannot be determined before testing, it is understandable that a detection proxy unit can be set up in each node, and each detection proxy unit in each node can create a virtual network interface, thereby ensuring that the source node detection proxy unit creates an active virtual network interface before testing.
[0083] S200a, Receive message sending command.
[0084] Understandably, in order to test network connectivity between different nodes, users will send detection commands that include specific test information, such as the address of the source node, the address of the destination node, the network protocol, the transport protocol, the port of the source device, the port of the destination device, and the packet length.
[0085] For example, the user's test command could be as follows: Test the connectivity from virtual machine A to virtual machine B, IPv4, TCP, destination port 22, source port 23, packet length 1400.
[0086] The source device is not limited to a virtual machine; in other application scenarios, the source device can also be a container or other independent space.
[0087] The user's detection command can be sent to the detection service unit, which can be located in any node or in each node; this is not limited here. When the detection service unit receives the user's detection command, it can determine the source node based on the content of the command and send a message transmission command to the source node's detection agent unit.
[0088] It should be understood that the message sending command also includes the specific detection information in the detection command, such as the address of the source node, the address of the destination node, the network protocol, the transport protocol, the port of the source device, the port of the destination device, and the data packet length.
[0089] S300a: Constructs data packets based on message sending instructions.
[0090] After receiving the message sending instruction, the source node detection agent unit can construct the user-specified data packet based on the network protocol, transmission protocol, and data packet length in the specific detection information.
[0091] In one application scenario, when the detection instruction includes a data packet length of 1400, the source node detection agent unit can construct a data packet with a length of 1400 and set a header structure before the data packet.
[0092] In one application scenario, to facilitate the destination node in filtering data packets, the source node detection agent unit can also insert an identifier into the data packet, using an identifier of a specific number of bits to mark the data packet.
[0093] In one implementation, the identifier can be a randomly generated UUID identifier; see [link to relevant documentation]. Figure 3 , Figure 3 This is a schematic diagram of one embodiment of the data packet of this application. As shown in the figure, the UUID identification code can be inserted at the end of the data packet to mark the data packet.
[0094] It is understood that in other embodiments, the identifier can also be other types of identification codes, and the identifier can also be inserted in other positions of the data packet, as long as the data packet can be filtered out at the destination node, all of which can achieve the effect of this embodiment.
[0095] S400a: Forwards data packets to the source device's network port via the source virtual network port.
[0096] After the data packet is constructed, the source node detection agent unit can forward the data packet to the network port of the source device. At this time, the data packet can be sent to the network port of the destination device through the network port of the source device, thus realizing the process of simulating the actual sending of data packets by the source device without entering the source device.
[0097] Understandably, the data packet transmission process does not require access to the source device's internal system. Therefore, the source device's operating status does not affect the data packet transmission process, avoiding the influence of the source device's network configuration, shutdown status, etc. on the detection results. This also improves the detection rate and ensures the privacy of user data.
[0098] During the data packet transmission process, the destination node detection agent unit can keep monitoring the network port status of the destination device, thereby enabling the destination node detection agent unit to receive data packets and provide feedback on the reception results through the created destination virtual network port.
[0099] Specifically, when the detection service unit receives the user's detection instruction, it can determine the destination node based on the content of the detection instruction and send a message receiving instruction to the destination node detection agent unit.
[0100] Once the destination node detection agent unit receives the message reception instruction, it can listen to the network port of the destination device and maintain the listening state.
[0101] Accordingly, the destination node detection agent unit can create a destination virtual network interface before detection, so that data packets can be received at the destination device's network interface through the destination virtual network interface.
[0102] Since the data packets are obtained by the destination node detection agent unit through the destination virtual network port at the destination device's network port, the process of the destination device actually receiving data packets can be simulated.
[0103] Understandably, receiving data packets does not require entering the internal workings of the destination device. Therefore, the working status of the destination device itself does not affect the data packet transmission process, avoiding the influence of the destination device's network configuration, power-off status, etc. on the detection results. This also improves the detection rate and ensures the privacy of user data.
[0104] This application also provides a transparent network connectivity detection device; please refer to [link to relevant documentation]. Figure 4 , Figure 4 This is a schematic diagram of one embodiment of the transparent network connectivity detection device of this application.
[0105] As shown in the figure, the transparent detection device includes a source test port management module 21, a first instruction receiving module 22, a data packet construction module 23, and a data packet sending module 24.
[0106] Among them, the source test port management module 21 is used to create source virtual network ports;
[0107] The first instruction receiving module 22 receives the message sending instruction. The message sending instruction is sent by the detection service unit in response to the user's detection instruction. The detection instruction includes the address of the source node, the address of the destination node, the network protocol, the transmission protocol, the port of the source device, the port of the destination device, and the data packet length.
[0108] The data packet construction module 23 constructs data packets based on message sending instructions;
[0109] The data packet sending module 24 is used to forward data packets to the network port of the source device through the source virtual network port, so that the data packets are sent to the network port of the destination device through the network port of the source device, so that the destination node detection agent unit that listens to the network port of the destination device can receive data packets through the created destination virtual network port and report the reception result.
[0110] In one embodiment, a packet tagging module 25 is also included, which generates an identifier and inserts the identifier into the packet.
[0111] As per the above reference Figures 1 to 3 This specification describes a transparent network connectivity detection method according to embodiments thereof. The details mentioned in the above description of the method embodiments also apply to the transparent network connectivity detection apparatus of embodiments thereof. The above-described transparent network connectivity detection apparatus can be implemented in hardware, software, or a combination of hardware and software.
[0112] This application also provides a transparent detection method for network connectivity, which is applied to a destination node detection proxy unit.
[0113] Please see Figure 5 , Figure 5 This is a flowchart illustrating another implementation of the transparent network connectivity detection method of this application.
[0114] The transparency detection method includes:
[0115] S100b, Create a destination virtual network port.
[0116] First, the detection proxy unit inside the destination node can create a destination virtual network interface for testing, and set parameters such as the network card attributes, maximum packet length, MAC address, and IP address of the destination virtual network interface.
[0117] In one embodiment, the test virtual network interface can be a tap interface. In other embodiments, other types of virtual network cards, such as tun interfaces, can also be used, all of which can achieve the effect of this embodiment.
[0118] In cloud platform applications involving multiple nodes, since the source and destination nodes cannot be determined before testing, it is understandable that a detection proxy unit can be set up in each node, and each detection proxy unit in each node can create a virtual network interface, thereby ensuring that the destination node's detection proxy unit creates a target virtual network interface before testing.
[0119] S200b, Message Reception Command.
[0120] Understandably, in order to test network connectivity between different nodes, users will send detection commands that include specific test information, such as the address of the source node, the address of the destination node, the network protocol, the transport protocol, the port of the source device, the port of the destination device, and the packet length.
[0121] For example, the user's test command could be as follows: Test the connectivity from virtual machine A to virtual machine B, IPv4, TCP, destination port 22, source port 23, packet length 1400.
[0122] The destination device is not limited to a virtual machine; in other application scenarios, the destination device can also be a container or other independent space.
[0123] The user's detection command can be sent to the detection service unit, which can be located in any node or in each node; this is not limited here. Upon receiving the user's detection command, the detection service unit can determine the destination node based on the command's content and send a message reception command to the destination node's detection agent unit.
[0124] It should be understood that the message receiving instruction also includes the specific detection information in the detection instruction, such as the address of the source node, the address of the destination node, the network protocol, the transport protocol, the port of the source device, the port of the destination device, and the data packet length.
[0125] S300b responds to message receive commands and listens to the network port of the destination device.
[0126] Once the destination node detection agent unit receives the message reception instruction, it can start listening to the network port of the destination device and maintain the listening state.
[0127] Simultaneously, after receiving the user's detection instruction, the detection service unit can also determine the source node through the specific detection information in the detection instruction and send a message sending instruction to the source node detection agent unit.
[0128] After receiving the message sending instruction, the source node detection agent unit can construct the user-specified data packet based on the network protocol, transmission protocol, and data packet length in the specific detection information. It then forwards the data packet to the source device's network port through the source virtual network port created by the source node detection agent unit. The data packet can then be sent from the source device's network port to the destination device's network port, thus simulating the process of the source device actually sending data packets without actually entering the source device. The specific process is as described in steps S300a and S400a above, and will not be repeated here.
[0129] During the continuous monitoring of the target device's network port, the destination node detection agent unit can intercept data packets sent by the source node detection agent unit at the target device's network port. Therefore, receiving data packets does not require entering the target device's internal system, and the target device's own operating status does not affect the data packet sending process. This avoids the target device's network configuration, shutdown status, etc., affecting the detection results, improves the detection rate, and ensures the privacy of user data.
[0130] Understandably, the destination node detection agent unit can filter and intercept data packets based on the specific detection information included in the received message receiving instructions.
[0131] In one application scenario, to further facilitate the destination node detection agent unit in filtering data packets, the source node detection agent unit can also insert an identifier into the data packet. The data packet is marked by an identifier of a specific number of bits, and the destination node detection agent unit can intercept the data packet from the network port of the destination device based on the identifier.
[0132] In one implementation, the identifier can be a randomly generated UUID identification code and inserted at the end of the data packet; in other implementations, the identifier can also be other types of identification codes or inserted at any other arbitrary position, as long as it can achieve data packet filtering, all of which can achieve the effect of this implementation.
[0133] S400b, feedback data packet reception results.
[0134] The destination node detection agent unit can report the reception result to the detection service unit based on the data packet reception result, i.e. whether it has received the data packet sent by the source node detection agent unit.
[0135] Based on the received results, the detection service unit can provide connectivity information to the user. In one application scenario, when the destination node detection proxy unit receives a data packet, it can send a reception success instruction; upon receiving the reception success instruction, the detection service unit can inform the user that the connectivity detection was successful, meaning the source and destination devices are connected. In another application scenario, when the destination node detection proxy unit does not receive a data packet, it can send a reception failure instruction; upon receiving the reception failure instruction, the detection service unit can inform the user that the connectivity detection failed, meaning the source and destination devices are disconnected.
[0136] This application also provides a transparent network connectivity detection device; please refer to [link to relevant documentation]. Figure 6 , Figure 6 This is a schematic diagram of one embodiment of the transparent network connectivity detection device of this application.
[0137] The transparent testing device includes a target test port management module 31, a second instruction receiving module 32, a listening module 33, and a receiving result feedback module 34.
[0138] Among them, the destination test port management module 31 is used to create the destination virtual network port;
[0139] The second instruction receiving module 32 is used to receive message receiving instructions, which are sent by the detection service unit in response to the user's detection instructions.
[0140] The listening module 33 is used to listen to the network port of the destination device in response to the message receiving instruction, so that the destination virtual network port can receive the data packets created and forwarded by the source node detection agent unit.
[0141] The receiving result feedback module 34 is used to provide feedback on the receiving result;
[0142] The data packet is constructed by the source node detection agent unit in response to the message sending instruction sent by the detection service unit. The data packet is forwarded to the network port of the source device by the source virtual network port created by the source node detection agent unit, and then sent to the network port of the destination device through the network port of the source device. The message sending instruction is sent by the detection service unit in response to the user's detection instruction. The detection instruction includes the address of the source node, the address of the destination node, the network protocol, the transport protocol, the port of the source device, the port of the destination device, and the data packet length.
[0143] As per the above reference Figure 5 This specification describes a transparent network connectivity detection method according to embodiments thereof. The details mentioned in the above description of the method embodiments also apply to the transparent network connectivity detection apparatus of embodiments thereof. The above-described transparent network connectivity detection apparatus can be implemented in hardware, software, or a combination of hardware and software.
[0144] This application also provides a transparent detection method for network connectivity, which is applied to a detection service unit.
[0145] Please see Figure 7 , Figure 7 This is a flowchart illustrating another implementation of the transparent network connectivity detection method of this application.
[0146] The transparency detection method includes:
[0147] S100c: Receives detection commands sent by the user.
[0148] To test network connectivity between different nodes, users send a test command that includes specific test information, such as the address of the source node, the address of the destination node, the network protocol, the transport protocol, the port of the source device, the port of the destination device, and the packet length.
[0149] For example, the user's test command could be as follows: Test the connectivity from virtual machine A to virtual machine B, IPv4, TCP, destination port 22, source port 23, packet length 1400.
[0150] The source and destination devices are not limited to virtual machines. In other application scenarios, the source and destination devices can also be containers or other independent spaces.
[0151] The user's detection command can be sent to the detection service unit. The detection service unit can be set in any node or in each node, which is not limited here.
[0152] In one implementation, when the detection service unit receives a user's detection command, it can parse the detection command and verify the validity of the parameters of the detection command.
[0153] For example, the detection service unit can have built-in parameters such as the maximum length of data packets and the directory of ports, so as to detect the validity of the parameters of the detection command and to send error information to the user when the parameters are invalid.
[0154] S200c, in response to the detection command, sends a message to the source node detection agent unit.
[0155] Understandably, when the detection service unit receives the user's detection instruction, it can determine the source node based on the content of the detection instruction and send a message sending instruction to the source node detection agent unit.
[0156] It should be understood that the message sending command also includes the specific detection information in the detection command, such as the address of the source node, the address of the destination node, the network protocol, the transport protocol, the port of the source device, the port of the destination device, and the data packet length.
[0157] After receiving the message sending instruction, the source node detection agent unit can construct the user-specified data packet based on the network protocol, transmission protocol, and data packet length in the specific detection information.
[0158] In one application scenario, when the detection instruction includes a data packet length of 1400, the source node detection agent unit can construct a data packet with a length of 1400 and set a header structure before the data packet.
[0159] In one application scenario, to facilitate the destination node in filtering data packets, the source node detection agent unit can also insert an identifier into the data packet, using an identifier of a specific number of bits to mark the data packet.
[0160] In one implementation, the identifier can be a randomly generated UUID identifier, which can be inserted at the end of the data packet to mark it. In other implementations, the identifier can be other types of identifiers, and the identifier can be inserted at other positions in the data packet. The goal is to filter out data packets at the destination node, achieving the desired effect of this implementation.
[0161] After the data packet is constructed, the source node detection agent unit can forward the data packet to the network port of the source device. At this time, the data packet can be sent to the network port of the destination device through the network port of the source device, thus realizing the process of simulating the actual sending of data packets by the source device without entering the source device.
[0162] S300c, in response to the detection command, sends a message receiving command to the destination node detection agent unit.
[0163] When the detection service unit receives the user's detection instruction, it can determine the destination node based on the content of the detection instruction and send a message reception instruction to the destination node detection agent unit. It should be understood that the message reception instruction also includes the specific detection information in the detection instruction, such as the source node address, the destination node address, the network protocol, the transport protocol, the source device port, the destination device port, and the data packet length.
[0164] Once the destination node detection agent unit receives the message reception instruction, it can start listening to the network port of the destination device and maintain the listening state.
[0165] During the continuous monitoring of the target device's network port, the destination node detection agent unit can intercept data packets sent by the source node detection agent unit at the target device's network port. Therefore, receiving data packets does not require entering the target device's internal system, and the target device's own operating status does not affect the data packet sending process. This avoids the target device's network configuration, shutdown status, etc., affecting the detection results, improves the detection rate, and ensures the privacy of user data.
[0166] The destination node detection agent unit can report the reception result to the detection service unit based on the data packet reception result, i.e. whether it has received the data packet sent by the source node detection agent unit.
[0167] S400c: Based on the received results, it feeds back connectivity information.
[0168] Based on the received results, the detection service unit can provide connectivity information to the user. In one application scenario, when the destination node detection proxy unit receives a data packet, it can send a reception success instruction; upon receiving the reception success instruction, the detection service unit can inform the user that the connectivity detection was successful, meaning the source and destination devices are connected. In another application scenario, when the destination node detection proxy unit does not receive a data packet, it can send a reception failure instruction; upon receiving the reception failure instruction, the detection service unit can inform the user that the connectivity detection failed, meaning the source and destination devices are disconnected.
[0169] This application also provides a transparent network connectivity detection device; please refer to [link to relevant documentation]. Figure 8 , Figure 8 This is a schematic diagram of one embodiment of the transparent network connectivity detection device of this application.
[0170] The transparent detection device includes a third instruction receiving module 41, a first instruction sending module 42, a second instruction sending module 43, and a detection result feedback module 44.
[0171] The third instruction receiving module 41 is used to receive detection instructions sent by the user. The detection instructions include the address of the source node, the address of the destination node, the network protocol, the transmission protocol, the port of the source device, the port of the destination device, and the data packet length.
[0172] The first instruction sending module 42 is used to respond to the detection instruction and send a message sending instruction to the source node detection agent unit, so that the source node detection agent unit can construct a data packet based on the message sending instruction and forward the data packet to the network port of the source device through the created source virtual network port, so that the data packet is sent to the network port of the destination device through the network port of the source device.
[0173] The second instruction sending module 43 is used to respond to the detection instruction and send a message receiving instruction to the destination node detection agent unit, so that the destination node detection agent unit can listen to the network port of the destination device and receive data packets through the created destination virtual network port and return the receiving result.
[0174] The detection result feedback module 44 is used to provide connectivity information based on the received data packets.
[0175] As per the above reference Figure 7 This specification describes a transparent network connectivity detection method according to embodiments thereof. The details mentioned in the above description of the method embodiments also apply to the transparent network connectivity detection apparatus of embodiments thereof. The above-described transparent network connectivity detection apparatus can be implemented in hardware, software, or a combination of hardware and software.
[0176] Figure 9 This is a schematic diagram of one embodiment of the electronic device of this application. For example... Figure 9 As shown, the electronic device 50 may include at least one processor 51, a memory 52 (e.g., non-volatile memory), a RAM 53, and a communication interface 54, and the at least one processor 51, memory 52, RAM 53, and communication interface 54 are connected together via a bus 55. The at least one processor 51 executes at least one computer-readable instruction stored or encoded in the memory 52.
[0177] It should be understood that the computer-executable instructions stored in memory 52, when executed, cause at least one processor 51 to perform the above-described combinations in the various embodiments of this specification. Figures 1-7 The description includes various operations and functions.
[0178] In the embodiments of this specification, electronic device 30 may include, but is not limited to: personal computer, server computer, workstation, desktop computer, laptop computer, notebook computer, mobile electronic device, smartphone, tablet computer, cellular phone, personal digital assistant (PDA), handheld device, messaging device, wearable electronic device, consumer electronic device, etc.
[0179] According to one embodiment, a program product, such as a machine-readable medium, is provided. The machine-readable medium may have instructions (i.e., the elements implemented in software as described above), which, when executed by a machine, cause the machine to perform the above-described combinations of the various embodiments of this specification. Figures 1-7 The various operations and functions described. Specifically, a system or apparatus equipped with a readable storage medium storing software program code that implements the functions of any of the embodiments described above, and enabling the computer or processor of the system or apparatus to read and execute the instructions stored in the readable storage medium.
[0180] In this case, the program code read from the readable medium itself can perform the functions of any of the above embodiments, and therefore the machine-readable code and the readable storage medium storing the machine-readable code constitute a part of this specification.
[0181] Examples of readable storage media include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD-RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, program code can be downloaded from a server computer or the cloud via a communication network.
[0182] Those skilled in the art will understand that the various embodiments disclosed above can be modified and varied without departing from the spirit of the invention. Therefore, the scope of protection of this specification should be defined by the appended claims.
[0183] It should be noted that not all steps and units in the above process and system structure diagrams are mandatory; some steps or units can be omitted according to actual needs. The execution order of each step is not fixed and can be determined as needed. The device structure described in the above embodiments can be a physical structure or a logical structure. That is, some units may be implemented by the same physical client, or some units may be implemented by multiple physical clients, or they may be jointly implemented by certain components in multiple independent devices.
[0184] In the above embodiments, the hardware units or modules can be implemented mechanically or electrically. For example, a hardware unit, module, or processor may include permanent dedicated circuitry or logic (such as a dedicated processor, FPGA, or ASIC) to perform the corresponding operation. The hardware unit or processor may also include programmable logic or circuitry (such as a general-purpose processor or other programmable processor), which can be temporarily configured by software to perform the corresponding operation. The specific implementation method (mechanical, dedicated permanent circuitry, or temporarily configured circuitry) can be determined based on cost and time considerations.
[0185] The specific embodiments described above with reference to the accompanying drawings are exemplary embodiments, but do not represent all embodiments that can be implemented or fall within the scope of the claims. The term "exemplary" as used throughout this specification means "serving as an example, instance, or illustration" and does not imply that it is "preferred" or "advantageous" compared to other embodiments. Specific details are included to provide an understanding of the described techniques. However, these techniques can be practiced without these specific details. In some instances, well-known structures and apparatuses are shown in block diagram form to avoid obscuring the concepts of the described embodiments.
[0186] The foregoing description of this disclosure is provided to enable any person skilled in the art to implement or use this disclosure. Various modifications to this disclosure will be apparent to those skilled in the art, and the general principles applicable herein can be applied to other variations without departing from the scope of this disclosure. Therefore, this disclosure is not limited to the examples and designs described herein, but is consistent with the widest scope of the principles and novel features disclosed herein.
Claims
1. A transparent detection method for network connectivity, characterized in that, The transparent detection method, applied to the destination node detection proxy unit, includes: Create a destination virtual network interface; Receive message receiving instruction, which is sent by the detection service unit in response to the user's detection instruction; In response to the message receiving instruction, the network port of the destination device is monitored so that the destination virtual network port can receive data packets created and forwarded by the source node detection proxy unit. The data packets are constructed by the source node detection proxy unit based on the message sending instruction and forwarded to the network port of the source device through the created source virtual network port. The data packets are then sent to the network port of the destination device through the network port of the source device. The message sending instruction is sent by the detection service unit in response to the detection instruction. Feedback on the reception result of the data packet; The data packet also includes an identification code, which is generated by the source node detection agent unit and inserted into the data packet. The specific steps of monitoring the network port of the destination device are: monitoring the network port of the destination device, and intercepting the data packet by the network port of the destination device based on the identification code.
2. The transparency detection method according to claim 1, characterized in that, The identifier is a randomly generated UUID.
3. A transparent detection device for network connectivity, characterized in that, include: The destination test port management module is used to create destination virtual network ports; The second instruction receiving module is used to receive message receiving instructions, which are sent by the detection service unit in response to the user's detection instructions. The monitoring module is used to monitor the network port of the destination device in response to the message receiving instruction, so that the destination virtual network port can receive the data packets created and forwarded by the source node detection proxy unit. The data packets are constructed by the source node detection proxy unit based on the message sending instruction, and forwarded to the network port of the source device through the created source virtual network port, so that the data packets are sent to the network port of the destination device through the network port of the source device. The message sending instruction is sent by the detection service unit in response to the detection instruction. A reception result feedback module is used to provide feedback on the reception result of the data packet; The data packet also includes an identification code, which is generated by the source node detection agent unit and inserted into the data packet. The specific steps of monitoring the network port of the destination device are: monitoring the network port of the destination device, and intercepting the data packet by the network port of the destination device based on the identification code.
4. A transparent detection method for network connectivity, characterized in that, The transparent detection method, applied to the detection service unit, includes: Receive detection instructions sent by the user, the detection instructions including the address of the source node, the address of the destination node, the network protocol, the transmission protocol, the port of the source device, the port of the destination device, and the data packet length; In response to the detection command, a message sending command is sent to the source node detection agent unit, so that the source node detection agent unit constructs a data packet based on the message sending command, and forwards the data packet to the network port of the source device through the created source virtual network port, so that the data packet is sent to the network port of the destination device through the network port of the source device. The data packet also includes an identification code, which is generated by the source node detection agent unit and inserted into the data packet. In response to the detection command, a message receiving command is sent to the destination node detection proxy unit, so that the destination node detection proxy unit listens to the network port of the destination device, receives the data packet through the created destination virtual network port and feeds back the receiving result, wherein the destination node detection proxy unit intercepts the data packet from the network port of the destination device based on the identification code; Based on the received data packets, connectivity information is fed back.
5. The transparency detection method according to claim 4, characterized in that, The identifier is a randomly generated UUID.
6. The transparency detection method according to claim 4, characterized in that, Before the step of sending the message sending instruction to the source node detection agent unit, the following is also included: The detection command is parsed and the parameter validity is verified.
7. A transparent detection device for network connectivity, characterized in that, include: The third instruction receiving module is used to receive detection instructions sent by the user. The detection instructions include the address of the source node, the address of the destination node, the network protocol, the transmission protocol, the port of the source device, the port of the destination device, and the data packet length. The first instruction sending module is used to respond to the detection instruction by sending a message sending instruction to the source node detection agent unit, so that the source node detection agent unit constructs a data packet based on the message sending instruction and forwards the data packet to the network port of the source device through the created source virtual network port, so that the data packet is sent to the network port of the destination device through the network port of the source device. The data packet also includes an identification code, which is generated by the source node detection agent unit and inserted into the data packet. The second instruction sending module is used to send a message receiving instruction to the destination node detection proxy unit in response to the detection instruction, so that the destination node detection proxy unit can listen to the network port of the destination device and receive the data packet through the created destination virtual network port and return the receiving result. The destination node detection proxy unit intercepts the data packet from the network port of the destination device based on the identification code. The detection result feedback module is used to provide connectivity information based on the reception result of the data packet.
8. An electronic device, comprising: At least one processor; as well as A memory storing instructions that, when executed by the at least one processor, cause the at least one processor to perform the transparent detection method for network connectivity as described in any one of claims 1 to 2, 4 to 6.
9. A machine-readable storage medium storing executable instructions that, when executed, cause the machine to perform the transparent detection method for network connectivity as described in any one of claims 1 to 2, 4 to 6.
Citation Information
Patent Citations
Detection method and apparatus for virtual machine business network port
CN107544835A