Dial testing method and device, electronic equipment and storage medium

By virtualizing dial-test information and simulating dial-test message responses, the problem of gateway dial-test dependence on virtual computing resources is solved, and cost reduction and performance evaluation are achieved.

CN118740665APending Publication Date: 2024-10-01TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202310368827.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-31
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

In the existing technology, gateway dial-up testing requires the deployment of virtual machines at the dial-test source and dial-test destination, resulting in a high reliance on virtual computing resources and increased costs.

Method used

By obtaining the dial test information of the target gateway, virtualize the inner source address and destination address, use the network card of the detection device to send the virtual dial test message, and generate a virtual response message based on the received response message, simulating the gateway dial test process. , avoiding the deployment of virtual machines.

Benefits of technology

It reduces the dependence on virtual computing resources, reduces memory resource usage, reduces the cost of dialing and testing, and effectively evaluates the message parsing performance and forwarding capabilities of the target gateway.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118740665A_ABST
    Figure CN118740665A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of cloud computing, and discloses a dial testing method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining dial testing information of a target gateway, the dial test information comprises an inner-layer virtual source address, an inner-layer virtual destination address, a physical address of the detection equipment, a communication protocol supported by the target gateway and a message forwarding rule corresponding to the target gateway; performing message packaging according to the inner-layer virtual source address, the inner-layer virtual destination address, the physical address of the detection equipment and a communication protocol to obtain a virtual dial test message; based on the message forwarding rule, sending the virtual dial test message through a network card of the detection equipment so as to route the virtual dial test message to a target gateway; and if a virtual dial test message returned by the target gateway route is received, generating a virtual response message corresponding to the virtual dial test message according to the inner-layer virtual destination address and the communication protocol. According to the invention, the problem of dependence on virtual computing resources in gateway dial testing can be solved, and the dial testing cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing technology, and more specifically, to a dialing method, device, electronic device and storage medium. Background Art

[0002] In the related art, in order to test the performance of the dialing gateway, it is necessary to deploy virtual machines at the dialing source and the dialing destination, then log in to the virtual machine at the dialing source, and send a dialing test message to the virtual machine at the dialing destination through the virtual machine at the dialing source, wherein the dialing test message sent by the virtual machine at the dialing source will pass through the gateway to be tested, and then the performance of the gateway can be determined by combining the message receiving situation of the virtual machine at the dialing destination and the message sending situation of the virtual machine at the dialing source. Since the gateway dialing test requires the deployment of virtual machines at both the dialing source and the dialing destination, the dependence on virtual computing resources (i.e., virtual machines) is high, and the cost of the gateway dialing test is high. Summary of the invention

[0003] In view of the above problems, the embodiments of the present application propose a dialing method, device, electronic device and storage medium to solve the problem in the related art that gateway dialing has a high dependence on virtual computing resources.

[0004] According to one aspect of an embodiment of the present application, a dialing test method is provided, the method comprising: obtaining dialing test information of a target gateway, the dialing test information comprising an inner virtual source address, an inner virtual destination address, a physical address of a detection device, a communication protocol supported by the target gateway, and a message forwarding rule corresponding to the target gateway; the inner virtual source address and the inner virtual destination address are obtained by virtualization on the detection device; message encapsulation is performed according to the inner virtual source address, the inner virtual destination address, the physical address of the detection device, and the communication protocol to obtain a virtual dialing test message; based on the message forwarding rule, the virtual dialing test message is sent through a network card of the detection device to route the virtual dialing test message to the target gateway; if the virtual dialing test message returned by the target gateway route is received, a virtual response message corresponding to the virtual dialing test message is generated according to the inner virtual destination address and the communication protocol.

[0005] According to one aspect of an embodiment of the present application, a dialing test device is provided, the device comprising: an acquisition module, used to acquire dialing test information of a target gateway, the dialing test information comprising an inner virtual source address, an inner virtual destination address, a physical address of a detection device, a communication protocol supported by the target gateway and a message forwarding rule corresponding to the target gateway; the inner virtual source address and the inner virtual destination address are obtained by virtualization on the detection device; a message encapsulation module, used to perform message encapsulation according to the inner virtual source address, the inner virtual destination address, the physical address of the detection device and the communication protocol to obtain a virtual dialing test message; a forwarding module, used to send the virtual dialing test message through a network card of the detection device based on the message forwarding rule to route the virtual dialing test message to the target gateway; a response message generation module, used to generate a virtual response message corresponding to the virtual dialing test message according to the inner virtual destination address and the communication protocol if the virtual dialing test message returned by the target gateway is received.

[0006] According to one aspect of an embodiment of the present application, an electronic device is provided, including: a processor; a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the dialing method described above is implemented.

[0007] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor, the dialing method as described above is implemented.

[0008] According to one aspect of an embodiment of the present application, a computer program product is provided, including computer instructions, and when the computer instructions are executed by a processor, the dialing method as described above is implemented.

[0009] In the present application, in order to dial the target gateway, the physical address of the detection device is virtualized to obtain the inner virtual source address and the inner virtual destination address, so that the inner virtual source address is used as the address of the source end, and the inner virtual destination address is used as the address of the destination end. On this basis, the message is automatically encapsulated according to the inner virtual source address, the inner virtual destination address, the physical address of the detection device and the communication protocol to obtain a virtual dialing message; the virtual dialing message is sent through the network card of the detection device, and is routed according to the message forwarding rule corresponding to the target gateway, so that the virtual dialing message is routed to the target gateway and routed back to the detection device, and then, according to the inner virtual destination address, a virtual response message corresponding to the virtual dialing message is generated according to the communication protocol. This realizes the simulation of requests and responses in the gateway dialing process, and thus it can be determined whether the message parsing performance and message forwarding capability of the target gateway meet the requirements according to whether the virtual dialing message is successfully routed back to the detection device after being routed to the target gateway.

[0010] Moreover, in the present application, the detection device serves as both the source and destination of the dial test, and sends virtual dial test messages through the network card of the detection device. In this way, there is no need to deploy a virtual machine on the detection device, which solves the problem of the dial test gateway's dependence on virtual computing resources in related technologies. Moreover, since deploying a virtual machine on the detection device will occupy the memory resources of the detection device, and the solution of the present application does not require the deployment of a virtual machine, the solution of the present application can reduce memory resource usage and reduce the cost of dial testing. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0012] Figure 1 It is a schematic diagram of an application scenario of the present application according to an embodiment of the present application.

[0013] Figure 2 It is a schematic diagram of distribution of dialing tasks according to an embodiment of the present application.

[0014] Figure 3 It is a schematic diagram of an application scenario of the present application according to another embodiment of the present application.

[0015] Figure 4 It is a flow chart of a dialing method according to an embodiment of the present application.

[0016] Figure 5It is a schematic diagram of obtaining a message at the data link layer according to an embodiment of the present application.

[0017] Figure 6 The diagram is a response architecture diagram under the ICMP protocol in a VPC according to an embodiment of the present application.

[0018] Figure 7 It is a response architecture diagram of a TCP message in a VPC according to an embodiment of the present application.

[0019] Figure 8 This is a diagram of the response architecture of ICMP messages in VXLAN according to an embodiment of the present application.

[0020] Fig. 9 It is a schematic diagram of the interaction of ICMP messages according to an embodiment of the present application.

[0021] Fig.10 It is a schematic diagram of message interaction in the case of a short connection according to the TCP protocol according to an embodiment of the present application.

[0022] Fig.11 It is a schematic diagram of message interaction in the case of a long connection according to the TCP protocol according to an embodiment of the present application.

[0023] Fig.12 It is a schematic diagram of message interaction under the GRE protocol according to an embodiment of the present application.

[0024] Fig.13 This is a schematic diagram of the interaction of messages under the VXLAN protocol according to an embodiment of the present application.

[0025] Fig.14 and Fig.15 The schematic diagram of the constructed NTP message is exemplified.

[0026] Fig.16 and Fig.17 The schematic diagram of the constructed DNS message is shown as an example.

[0027] Fig.18 The schematic diagram of the constructed GRE message is exemplified.

[0028] Fig.19 It is a block diagram of a dialing device according to an embodiment of the present application.

[0029] Fig. 20 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION

[0030] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.

[0031] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0032] It should be noted that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0033] Cloud computing refers to the delivery and use model of IT infrastructure, which means obtaining required resources through the network in an on-demand and easily scalable manner; in a broad sense, cloud computing refers to the delivery and use model of services, which means obtaining required services through the network in an on-demand and easily scalable manner. This service can be IT and software, Internet-related, or other services. Cloud computing is the product of the development and integration of traditional computer and network technologies such as grid computing, distributed computing, parallel computing, utility computing, network storage technologies, virtualization, and load balancing.

[0034] As users demand more stability in services, in order to ensure the stability of the services provided, dialing tests are usually performed on services and networks to determine the stability of services and whether there are any anomalies. With the development of the Internet, real-time data streams, and the diversification of connected devices, as well as the demand for search services, social networks, mobile commerce, and open collaboration, cloud computing technology has developed rapidly. Based on the development of cloud computing technology, cloud dialing tests have emerged.

[0035] Cloud Automated Testing (CAT) relies on a proprietary service quality monitoring network and uses service quality monitoring points distributed around the world to periodically monitor websites, domain names, backend interfaces, etc. This allows users to view availability and latency changes over time to help analyze site quality. Cloud Automated Testing provides a custom threshold alarm function for availability indicators, and then configures alarms to achieve real-time notification of anomalies.

[0036] In the related art, in order to test the performance of a dialing gateway, it is necessary to deploy virtual machines at the dialing source and the dialing destination. After that, the virtual machine at the dialing source is logged in, and a dialing test message is sent to the virtual machine at the dialing destination through the virtual machine at the dialing source. The dialing test message sent by the virtual machine at the dialing source will pass through the gateway to be tested. Furthermore, the performance of the gateway can be determined by combining the message reception status of the virtual machine at the dialing destination with the message sending status of the virtual machine at the dialing source.

[0037] Because the gateway dial test in the prior art requires the deployment of virtual machines on both the dial test source side and the dial test destination side, it relies heavily on virtual computing resources (ie, virtual machines) and the cost of the dial test gateway is high. Based on this, the solution of the present application is proposed.

[0038] Figure 1 is a schematic diagram of an application scenario of the present application according to an embodiment of the present application, such as Figure 1 As shown, the application scenario includes a dialing control platform 110, a message constructor 120, a detection device 130 and a gateway 140. The message constructor 120 can be deployed in an electronic device (such as a server) to automatically construct a virtual dialing message and generate a response message for the virtual dialing message; the detection device 130 is used to send a virtual dialing message and receive a virtual dialing message routed back from the gateway 140 to be dialed. The detection device can be a server.

[0039] The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, as well as big data and artificial intelligence platforms.

[0040] In other embodiments, the message builder 120 and the detection device 130 may also be deployed on the same electronic device, that is, the electronic device is not only used to build the virtual dial test message, but also used to send and receive the virtual dial test message. The dial test control platform 110 is used to manage the dial test task to send the gateway's dial test task to the message builder 120 and the detection device 130 for execution.

[0041] After receiving the virtual dial test message returned by the gateway 140, the detection device 130 may send the virtual dial test message to the dial test control platform, and the dial test control platform 110 analyzes the performance of the gateway 140 based on the virtual dial test message received by the detection device 130. The dial test control platform 110 may also send the virtual dial test message received by the detection device 130 to the message constructor 120, so that the message constructor 120 constructs a response message of the virtual dial test message.

[0042] In the present application, the dialing test control platform 110 can also store the dialing test information of the object to be tested (the object to be tested is such as a gateway, an application server, etc.). In this way, the message constructor 120 can obtain the dialing test information of the object to be tested from the dialing test control platform 110 to generate a corresponding virtual dialing test message.

[0043] The message constructor 120 generates a virtual dialing message in accordance with the communication protocol supported by the object to be dialed. Figure 1 As shown, if the destination of the dial test is in a private network (Virtual Private Cloud, VPC), the message constructor 120 can generate a VPC message (i.e., a VPC virtual dial test message) of a corresponding communication protocol according to the dial test information, such as an ICMP message based on the Internet Control Message Protocol (ICMP), a DNS message based on the Domain Name System (DNS), an NTP message based on the Network Time Protocol (NTP), a TCP message based on the Transmission Control Protocol (TCP), a UDP message based on the User Datagram Protocol (UDP), etc. If the destination of the dial test is located in a public network, the message constructor 120 can generate common messages under various communication protocols, such as ICMP messages, DNS messages, NTP messages, TCP messages, and UDP messages.

[0044] In some embodiments, the dialing test control platform 110 may instantiate the dialing test task to facilitate orderly management of the dialing test task, so as to perform resource management and task control on the dialing test task. Figure 2 FIG. 1 is a schematic diagram of distributing a dialing task according to an embodiment of the present application. Figure 2 As shown, the dial test task can be instantiated according to the dial test task and the dial test information of the dial test object corresponding to the dial test task. The dial test instance corresponding to the dial test task includes the gateway node passed by the dial test, the dial test source (i.e., the source end of the dial test), forwarding rules, dial test frequency, etc. Figure 2 In the example, three dial test instances are shown, namely, dial test instance 1, dial test instance 2 and dial test instance 3. In the present application, during the execution of each dial test instance, a virtualized message response needs to be performed for the dial test destination. On this basis, for each dial test instance, multiple projects corresponding to the dial test instance can be established. Figure 2 In the example, three projects of the dial test instance 1 are shown, namely project 1#, project 2# and project 3#. In this way, the message acquisition resident process can be started through the parameters passed in by the dial test instance to automatically execute each project of the dial test instance. For each project, information related to project execution can be associated, such as the message forwarding rules required by the gateway, and task rules such as response scenario configuration information and packet sending configuration information. After that, the corresponding project is executed according to the execution related information corresponding to each project to realize the dial test of the dial test object (dial test object such as gateway).

[0045] Each project of the dial test instance is a subtask of the dial test instance. After the project is completed, the dial test data (such as the constructed dial test message and the constructed response message, etc.) is stored in the database in chronological order through a fixed instance identifier (instance tag), which can ensure the traceability of historical dial test data. Figure 2 Two databases are shown in the figure, namely database I and database II. In this way, the life cycle management of the dialing task can be realized, and when the task is completed, the interface can be directly called to perform a rollback operation.

[0046] Figure 3 is a schematic diagram of an application scenario of the present application according to another embodiment of the present application, such as Figure 3 As shown, the application scenario includes a dial test console, a scheduling platform and a data management platform, wherein the dial test console can be used to configure the dial test information of each object to be dialed, and the calling platform can instantiate the dial test task of the object to be dialed, model the scenario, and automatically issue message forwarding rules according to the dial test information of the object to be dialed; in the process of executing the dial test instance, the source end and the destination end of the dial test interact with each other, the source end can pull up the message construction process to automatically construct the dial test message during the interaction process, and pull up the result reporting process at the source end to report the dial test data generated during the dial test process to the data management platform, and the data management platform can store the dial test data in a time series. At the destination end of the dial test, if multiple dial test tasks are issued to the same node, the destination end provides the ability to isolate different dial test tasks, and the destination end provides a standard interface for packet issuance.

[0047] In this application, when the object to be tested is a gateway, the source and the destination can be deployed on the same electronic device. Furthermore, the physical carriers of the source and the destination, that is, the test device, can also receive tests from other external test sources, that is, the test device has atomic capabilities.

[0048] Furthermore, the dial test console can also obtain historical dial test data from the data management platform for result analysis. In some embodiments, the user can configure intelligent alarms, operation and maintenance monitoring and operation analysis in the interactive interface of the dial test control platform to analyze and intelligently alarm based on the dial test data obtained by the dial test.

[0049] In the above embodiment, the two processes of dial test task management and message forwarding are separated, which can expand the scope of dial test sources and realize decentralized dial test task management. Moreover, in this application, the network card of the detection device is used for message injection and acquisition, and each network node can be used as a probe landing point (i.e., detection device), which expands the dial test boundary and operable range. It can make up for the defect that the source end of the dial test is strongly dependent on the virtual machine and reduce the pressure on the dial test center.

[0050] Moreover, in this solution, when different dialing test tasks are sent to the same network element node, the corresponding tasks are isolated from each other and will not cause interference. In addition, the dialing test results are stored in the time series database in real time to realize the query and management of historical dialing test data.

[0051] In addition, this solution manages the processing logic of the source and destination of network interaction through a remote dial-up control platform. In the application scenario of TCP session, this method can simulate the processing logic of the network protocol layer of the operating system, control the fields of the network message to simulate the corresponding request and response, and report the results, realizing flexible network dial-up without destroying the gateway forwarding logic in the link.

[0052] Figure 4 is a flow chart of a dialing method according to an embodiment of the present application, which method can be executed by an electronic device with processing capabilities, such as a server. Figure 4 As shown, the method at least includes steps 410 to 440, which are described in detail as follows:

[0053] Step 410, obtain the dialing information of the target gateway, the dialing information includes the inner virtual source address, the inner virtual destination address, the physical address of the detection device, the communication protocol supported by the target gateway and the message forwarding rules corresponding to the target gateway; the inner virtual source address and the inner virtual destination address are obtained by virtualization on the detection device.

[0054] The target gateway refers to the gateway that needs to be dialed. The gateway is an electronic device that connects two network segments using different protocols. The function of the gateway is to parse the messages transmitted by the transmission protocol in the two network segments and forward the transmitted messages. Figure 4Steps 410 to 440 in the process can implement dialing test on the target gateway to test the message parsing capability and message forwarding capability of the target gateway. In other words, it can test whether the target gateway can accurately parse the message and whether it can accurately forward the message.

[0055] In the present application, the detection device is used as the source end of the target gateway for detection, and also as the destination end of the target gateway for detection. That is, during the dialing process, the transmission path of the message is: the message sent from the source end to the destination end reaches the destination end after being routed by the target gateway. In the present application, since the detection device is used as both the source end and the destination end of the target gateway for detection, the physical address of the detection device is virtualized to obtain two different inner virtual addresses, one of which is used as the source end, and the other is used as the destination end, so as to distinguish the source end and the destination end in the detection process. In the present application, the inner virtual address used as the source end is referred to as the inner virtual source address, and the inner virtual address used as the destination end is referred to as the inner virtual destination address. It can be understood that the inner virtual source address and the inner virtual destination address are two different inner virtual addresses, and the inner virtual source address and the inner virtual destination address point to the same physical address, that is, both point to the physical address of the detection device.

[0056] The message forwarding rules corresponding to the target gateway include parent-child machine rules and routing forwarding rules, where the parent-child machine rules indicate the mapping relationship between the inner virtual address and the outer physical address, that is, the parent-child machine rules indicate the outer physical address pointed to by each inner virtual address. The routing forwarding rules are used to indicate the routing path from the detection device to the target gateway.

[0057] The communication protocol supported by the target gateway may be Generic Routing Encapsulation (GRE), TCP, UDP, NTP, DNS, ICMP, etc., which are not specifically limited here.

[0058] Step 420, encapsulate the message according to the inner virtual source address, the inner virtual destination address, the physical address of the detection device and the communication protocol to obtain a virtual dialing message.

[0059] Specifically, in step 420, the inner virtual source address and the inner virtual destination address are encapsulated as the inner IP header of the virtual dialing message according to the communication protocol, and the physical address of the detection device is encapsulated as the outer IP header of the virtual dialing message according to the communication protocol, and then the outer IP header, the inner IP header, and the data segment are combined to obtain the virtual dialing message. It can be understood that the virtual dialing message is a request message initiated to the destination end.

[0060] The virtual dial test message is different from the real request message used for the request. Therefore, in order to facilitate the distinction between the virtual dial test message used for the dial test and the real request message, the virtual dial test message may include a control field for indicating that the message is a virtual dial test message used for the dial test rather than a real request message, that is, the virtual dial test message and the real request message are identified by the value of the control field.

[0061] Step 430: Based on the message forwarding rule, the virtual dial-up message is sent through the network card of the detection device to route the virtual dial-up message to the target gateway.

[0062] As described above, since the message forwarding rule corresponding to the target gateway indicates the routing path from the detection device to the target gateway, after the virtual dialing message is sent through the network card of the detection device, the virtual dialing message can be routed to the target gateway according to the message forwarding rule.

[0063] Specifically, in step 430, the data link layer of the detection device can obtain the gateway address of the next hop address according to the destination IP, and then use the ARP (Address Resolution Protocol, which is a TCP / IP protocol that obtains the physical address according to the IP address) protocol to obtain the corresponding destination MAC address; then, the physical layer of the detection device can obtain the name of the network exit network card according to the specified destination IP through the route command (the route command is used to display and operate the IP routing table), that is, obtain the name of the network card of the detection device. Then, the constructed virtual dial-up message is sent through the network card of the detection device.

[0064] In this application, after the virtual dial test message is constructed, the virtual dial test message is sent directly through the network card of the detection device. In this way, the user does not need to log in to the virtual machine and send the virtual dial test message through the virtual machine. This can solve the dependence of gateway dial test on virtual computing resources (i.e., virtual machines).

[0065] Step 440: If a virtual dialing message returned by the target gateway router is received, a virtual response message corresponding to the virtual dialing message is generated according to the inner virtual destination address and the communication protocol.

[0066] After the virtual dial test message is routed to the target gateway, the target gateway parses the virtual dial test message. Parsing the outer IP header of the virtual dial test message can determine that the destination address of the virtual dial test message is the physical address of the detection device, and then the virtual dial test message continues to be routed with the physical address of the detection device as the destination. It can be understood that if the virtual dial test message returned by the target gateway route is received from the network card of the detection device, it is determined that the target gateway has accurately parsed and forwarded the virtual dial test message, that is, it is determined that the message parsing and forwarding capabilities of the target gateway are normal and meet the requirements; on the contrary, if the virtual dial test message returned by the target gateway route is not received indoors for a long time after the virtual dial test message is sent, the possible reason is that the target gateway parsed it incorrectly, resulting in the target gateway not forwarding it accurately.

[0067] In some embodiments, the virtual dial test message is sent through the network card of the detection device. Then, under normal circumstances, the target gateway routes the virtual dial test message back and it is also received by the network card of the detection device. On this basis, message monitoring can be performed at the data link layer of the detection device. The data link layer is the upper layer of the hardware layer of the detection device (the layer where the network card hardware is located). Afterwards, the monitored messages are filtered at the data link layer of the detection device to identify the virtual dial test message, so as to facilitate the subsequent construction of a response message based on the virtual dial test message.

[0068] It is understandable that after receiving the virtual dial test message returned by the target gateway router, if the destination end does not respond to the virtual dial test message, the session process established between the source end and the destination end will continue to wait for the response to the virtual dial test message, causing the session process to occupy the memory all the time. Therefore, in the present application, after receiving the virtual dial test message returned by the target gateway router, a response message of the virtual dial test message is constructed to simulate the normal session process between the source end and the destination end.

[0069] Among them, the receiver corresponding to the virtual response message corresponding to the virtual dial-up message is the inner virtual source address, and the sender address corresponding to the virtual response message is the inner virtual destination address. Therefore, after the virtual response message is encapsulated, the virtual response message is routed to the inner virtual source address according to the inner virtual source address, thereby completing a message interaction between the source end (inner virtual source address) and the destination end (inner virtual destination address).

[0070] Figure 5 FIG. 1 is a schematic diagram of obtaining a message at the data link layer according to an embodiment of the present application. Figure 5As shown, the message sent from the outside to the detection device will enter the data link layer (the data link layer includes the network card driver) after passing through the physical layer. After that, the received message will enter the network tap from the data link layer, and the filter will identify whether the message is a virtual dial test message. After that, the virtual dial test message determined by the filter will be temporarily stored in the buffer area, and there will be a subsequent response message for constructing the virtual dial test message. Specifically, the Open Live microsecond capture of the data link layer message can be based on the libpacp (Packet Capture Library, i.e., data packet capture function library). As Figure 5 As shown, the network splitter captures messages from the data link layer, and then the filter can use the BSD Packet Filter (Berkeley Packet Capture Filter) algorithm to filter the messages of the data link layer. After the filter identifies and determines the network virtual message, the upper layer application can construct a response message of the network virtual message accordingly. Specifically, the filter can identify whether the message is a virtual dialing message based on the value of the control field specified in the message. In this case, the value of the specified field in the message is a value used to indicate that the message is a virtual dialing message, or a value indicating that the message is a normal request message.

[0071] After receiving the virtual dial test message returned by the target gateway routing, the detection device parses the virtual dial test message, can determine the inner virtual destination address corresponding to the destination end, and route the virtual dial test message to the inner virtual destination address accordingly. In this way, after the virtual dial test message is routed to the inner virtual destination address, a virtual response message corresponding to the virtual dial test message can be constructed according to the communication protocol and the inner virtual destination address, and the virtual response message can be routed to the inner virtual source address, so as to simulate the session between the source end and the destination end of the dial test. Since the virtual dial test message is responded to by constructing a virtual response message corresponding to the virtual dial test message, the source end of the dial test does not need to always pull up the session process with the destination end of the dial test, that is, after the virtual response message corresponding to the virtual dial test message is routed to the inner virtual source address, the session process between the source end and the destination end of the dial test can be correspondingly closed after the session ends.

[0072] In some embodiments, the method further includes: after sending the virtual dial test message, based on the task timer, the detection task corresponding to the target gateway is timed to respond; if it is determined that the time waiting for the response to the virtual dial test message exceeds the time threshold, the detection task corresponding to the target gateway is closed. Before sending the virtual dial test message, a corresponding session process between the source end and the destination end of the dial test will be established in the detection device. On this basis, a task timer can be deployed for the session process. The timing time of the task timer is the time waiting for the response to the virtual dial test message. If it is determined that the time waiting for the response to the virtual dial test message exceeds the time threshold, the detection task corresponding to the target gateway is closed, and the corresponding session process between the source end and the destination end of the dial test is established. In this way, the memory of the detection device can be released in time, the waste of the memory of the detection device can be avoided, and the memory occupation of the detection device can be reduced.

[0073] In the present application, in order to dial the target gateway, the physical address of the detection device is virtualized to obtain an inner virtual source address and an inner virtual destination address, so that the inner virtual source address is used as the address of the source end, and the inner virtual destination address is used as the address of the destination end. On this basis, the message is automatically encapsulated according to the inner virtual source address, the inner virtual destination address, the physical address of the detection device and the communication protocol to obtain a virtual dialing message; the virtual dialing message is sent through the network card of the detection device, and is routed according to the message forwarding rules corresponding to the target gateway, so that the virtual dialing message is routed to the target gateway and routed back to the detection device, and then, according to the inner virtual destination address, a virtual response message corresponding to the virtual dialing message is generated according to the communication protocol. This realizes the simulation of requests and responses in the gateway dialing process, and thus it can be determined whether the message parsing performance and message forwarding capability of the target gateway meet the requirements according to whether the virtual dialing message is successfully routed back to the detection device after being routed to the target gateway.

[0074] Moreover, in the present application, the detection device serves as both the source and destination of the dial test, and sends virtual dial test messages through the network card of the detection device. In this way, there is no need to deploy a virtual machine on the detection device, which solves the problem of the dial test's dependence on virtual computing resources. Moreover, since deploying a virtual machine on the detection device will occupy the memory resources of the detection device, and the solution of the present application does not require the deployment of a virtual machine, the solution of the present application can reduce memory resource usage and reduce the cost of dial testing.

[0075] It is worth mentioning that during the dialing test, the destination end and the source end of the dialing test may perform multiple message exchanges in one session. For example, under the TCP protocol, the source end and the destination end perform a three-way handshake to establish a connection and then continue to exchange messages. In each message interaction process, for the source end, a virtual dialing test message (request message) can be automatically constructed according to the same process as step 420, and for the destination end, a response message can be automatically generated according to the same process as step 440.

[0076] In some embodiments, the dialing information also includes response scenario configuration information; wherein, the response scenario configuration information can be customized according to actual needs. wherein, for different communication protocols, the covered response scenarios may be different, therefore, for different communication protocols, the response scenario configuration information corresponding to each response scenario under each communication protocol may be configured separately. the response scenario configuration information is used to indicate the rules for generating a response message corresponding to the response scenario, for example, the response scenario configuration information can be used to indicate the value of the control field in the response message for distinguishing the response scenario, so that the value of the control field in the subsequent response message is used to guide the generation of subsequent messages in the session. in this embodiment, step 440 includes the following steps a1 and a2, which are described in detail as follows:

[0077] Step A1: if a virtual dial test message returned by a target gateway router is received, a target response scenario corresponding to the virtual dial test message is determined.

[0078] In the present application, the virtual dial test message may include a scenario control field for identifying a scenario, thereby, the target response scenario corresponding to the virtual dial test message may be identified according to the value of the scenario control field in the virtual dial test message. It is worth mentioning that the scenario control fields in the virtual dial test messages of different communication protocols may be the same or different.

[0079] Figure 6 This is a response architecture diagram of the ICMP protocol in a private network (Virtual Private Cloud, VPC) according to an embodiment of the present application. To simulate the ICMP automatic response of the VPC detection server, it is necessary to cover the response scenarios of the current cloud server (Cloud Virtual Machine, CVM) sub-machines. Figure 6 As shown in the figure, the response scenarios under the ICMP protocol in the private network include ICMP detection messages of VPC detection devices after the parent-child relationship is established, ICMP detection messages of non-VPC detection devices, NAT gateway detection messages of VPC detection devices after the NAT (Network Address Translation) gateway is bound to the LAN IP, and NAT gateway detection messages of non-VPC detection devices. Figure 6As shown, for the two response scenarios of the VPC detection device ICMP detection message after the parent-child relationship is created, and the ICMP detection message of the non-VPC detection device, the value of the gre.SeqPresent field in the detection message is false. For the two response scenarios of the VPC detection device NAT gateway detection message after the NAT gateway is bound to the LAN IP, and the NAT gateway detection message of the non-VPC detection device, the value of the gre.SeqPresent field in the detection message is true. Therefore, under the ICMP protocol, the gre.SeqPresent field in the detection message can be regarded as a scenario control field. Figure 6 In the response structure shown, the inner virtual destination addresses corresponding to the detection messages of different scenarios are different.

[0080] Figure 7 is a diagram of a response architecture of a TCP message in a VPC according to an embodiment of the present application, such as Figure 7 As shown, to simulate the TCP automatic response of the VPC detection server, it is necessary to cover all the response scenarios of the current CVM sub-machine, including VPC detection TCP service, normal TCP three-way handshake of the sub-machine and ack response of TCP long connection. In a specific embodiment, the session detection of the gateway long connection can be realized through periodic detection of fixed five-tuple (wherein the fixed five-tuple refers to the source port, source address, destination port, destination address and communication protocol). Figure 7 As shown in the figure, when the detection device detects the slave machine, the value of the gre.ip.ttl field in the detection message is 255, and in the case of a normal TCP connection request, the value of the gre.ip.ttl field in the detection message is 255. In addition, in the case of a TCP short connection, the value of the gre.tcp.rst field in the detection message is true, and in the case of a TCP long connection, the value of the gre.tcp.syn field in the detection message is false, and the value of the gre.tcp.syn field is true. Therefore, in Figure 7 In the response scenario of the TCP protocol shown in FIG. 1 , fields such as gre.ip.ttl, gre.tcp.rst, gre.tcp.syn, and gre.tcp.syn can be used as scenario control fields for identifying the response scenario. Figure 7 In the example, the client can be regarded as the source of the detection, and the server can be regarded as the destination of the detection.

[0081] Figure 8 1 is a diagram showing the response architecture of ICMP messages in a vxlan (Virtual eXtensible Local Area Network) according to an embodiment of the present application. Figure 8 As shown, the ICMP response of the simulated BMS (bare metal server) / DC (Domain Controller) detection server server, including the DCGW detection message, IDC detection message and Xgw (VxlanGateway) / sxgw (Stateful Vxlan Gateway) detection message of IDC (Internet Data Center) through DCGW.

[0082] Step A2: Generate a virtual response message corresponding to the virtual dial test message according to the communication protocol based on the inner virtual destination address and the response scenario configuration information corresponding to the target response scenario.

[0083] As described above, the response scenario configuration information corresponding to the target response scenario indicates the generation rules of the response message in the target response scenario under the corresponding communication protocol. Therefore, based on the response scenario configuration information corresponding to the target response scenario, the inner virtual destination address is used and a virtual response message of the virtual dialing message is generated according to the communication protocol.

[0084] There are differences in the message generation rules under different response scenarios, especially the control fields in the messages and the values ​​of the control fields. For example, there are differences in the generation rules of each handshake during the three-way handshake of a TCP connection. Therefore, in the present application, different response scenarios can be configured to obtain the response scenario configuration information of the corresponding response scenario. After that, when a response is required, the current corresponding response scenario is first determined based on the virtual dialing message, and then a virtual response message is generated in a targeted manner according to the scenario configuration information of the current corresponding response scenario. In this way, the solution of the present application can be flexibly applied to a variety of response scenarios.

[0085] In some embodiments, the response scenario configuration information includes a configuration strategy for the first control field in the response message of the communication protocol; in other words, according to the configuration strategy for the first control field in the response message under the communication protocol in the response scenario configuration information, the value of the first control field in the corresponding response message can be determined accordingly. In the present application, the value of the first control field is used to encapsulate a virtual response message to simulate a response. In this embodiment, step A2 includes the following steps B1 and B2, which are described in detail as follows:

[0086] Step B1, determining a value of a first control field in a response message for a communication protocol according to a configuration strategy for a first control field in a response message for a communication protocol in response scenario configuration information corresponding to a target response scenario.

[0087] Among them, for different communication protocols, the first control field in the response scenario configuration information corresponding to each response scenario under the communication protocol can be one or more, which is not specifically limited here. The configuration strategy of the first control field in the response message of the communication protocol in the response scenario configuration information is used to indicate the value of the first control field in the response message under the corresponding response scenario, or to indicate the calculation method of the value of the first control field in the response message under the corresponding response scenario.

[0088] Step B2, constructing a response message according to the communication protocol based on the inner virtual destination address and the value of the first control field in the response message for the communication protocol, and obtaining a virtual response message corresponding to the virtual dial test message.

[0089] In step B2, the inner virtual address and the determined value of the first control field are encapsulated according to the communication protocol to obtain a virtual response message corresponding to the virtual dial test message. It can be understood that in the virtual response message corresponding to the virtual dial test message, the value of the first control field is the value determined in step B1 according to the configuration policy of the first control field.

[0090] Furthermore, the value of the first control field in the virtual response message corresponding to the virtual dial test message can also be used to identify the response message as a constructed virtual response message. The first control field in the virtual response message corresponding to the virtual dial test message can be one or more.

[0091] In some embodiments, the dial test information also includes packet configuration information, which indicates the configuration strategy of the second control field in the dial test message for the communication protocol; the value of the second control field is used to encapsulate the virtual dial test message to simulate the request in the dial test process. In this embodiment, step 420 includes the following steps C1 and C2, which are described in detail as follows:

[0092] Step C1, determining the value of the second control field in the dial test message for the communication protocol according to the configuration strategy of the second control field in the dial test message for the communication protocol indicated by the packet configuration information; wherein the value of the first control field and the value of the second control field in the same session under the communication protocol are corresponding.

[0093] The configuration strategy of the second control field in the packet configuration information can be used to indicate the value of the second control field in the virtual dial test message of the corresponding communication protocol, or to indicate the calculation rule of the value of the second control field in the virtual dial test message of the corresponding communication protocol. It can be understood that for each communication protocol, the second control field in the corresponding dial test message can be one or more, depending on the specific situation.

[0094] Under the communication protocol, the value of the first control field and the value of the second control field in the same session are corresponding, that is, the value of the first control field in the virtual dialing message and the value of the second control field in the virtual response message can be used to determine whether the virtual dialing message and the virtual response message belong to the same session.

[0095] Step C2, based on the inner virtual source address, the inner virtual destination address, the physical address of the detection device and the value of the second control field, encapsulate the request message according to the communication protocol to obtain a virtual dialing message.

[0096] In step C2, according to the communication protocol, the inner virtual source address, the inner virtual destination address, the physical address of the detection device and the value of the second control field are message encapsulated to obtain a virtual dialing message.

[0097] In some embodiments, for a communication protocol, the first control field in a response message under the communication protocol and the second control field in a dial test message (request message) under the communication protocol may be the same field, or may have partially the same fields.

[0098] Fig. 9 is a schematic diagram of the interaction of ICMP messages according to an embodiment of the present application, such as Fig. 9 As shown, the second control field in the dial-test message under the ICMP protocol includes a TypeCode field, a Sequence Number field, an Identifier field, and a Date field, that is, Fig. 9 The fields shown on the left. Among them, the value of the TypeCode field in the dial test message under the ICMP protocol is 0x0800 (which is used to indicate the ping request type), the value of the Sequence Number field is 87 (this value is a fixed value for ICMP request dial test, which is used to indicate that the dial test message is a constructed virtual dial test message, not a real request message); the value of the Identifier field is determined by converting the system microsecond timestamp, such as formatting the random system time value at the microsecond level; the value of the Date field is determined by converting jarvis+system microsecond time.

[0099] Please continue reading Fig. 9 , the first control field in the response message under the ICMP protocol includes the TypeCode field, the Sequence Number field, the Identifier field and the Date field. Although the first control field is the same as the second control field, the value of the first control field is not exactly the same as the value of the second control field. Fig. 9On the right side, the value of the TypeCode field in the response message under the ICMP protocol is 0x0000 (which is used to indicate a ping echo reply), and the value of the SequenceNumber field is the same as the value of the Sequence Number field in the dial test message, that is, the value of the Sequence Number field in the response message under the ICMP protocol is the value of the Sequence Number field in the corresponding dial test message (that is, the value carried by the ICMP request); the value of the Identifier field in the response message under the ICMP protocol is also the same as the value of the Identifier field in the corresponding dial test message. The value of the Date field in the response message under the ICMP protocol is determined by jarvis+system microsecond time conversion.

[0100] exist Fig. 9 In the corresponding embodiment, although the dialing message can be identified by the fixed value (i.e., the value of the Sequence Number field), conflicts may exist in practice, for example, the content is actually different. Therefore, a specific value (i.e., jarvis) is added to the Date field as a reserved value to distinguish the time, so that the two messages will not conflict or be confused.

[0101] In some embodiments, the communication protocol includes a transmission control protocol or a user datagram protocol; the first control field includes a sequence number; the second control field includes a sequence number; in this embodiment, step B1 includes: according to the configuration strategy of the sequence number in the response message of the communication protocol in the response scenario configuration information corresponding to the target response scenario, the value of the sequence number in the response message is determined according to the system timestamp in the first unit. In this embodiment, step C1 includes: according to the configuration strategy of the sequence number in the dial test message of the communication protocol indicated by the packet sending configuration information, the value of the sequence number in the dial test message is determined according to the system timestamp in the second unit; wherein the first unit and the second unit are different time units.

[0102] Under the transmission control protocol, the communication connection established between the source and destination ends participating in the dial test can be a TCP short connection or a TCP long connection. Regardless of whether it is a TCP short connection or a TCP long connection, the values ​​of the sequence number in the dial test message and the sequence number in the response message can be determined according to the above embodiment.

[0103] In the above embodiment, for the continuous dial test message and response message in one session, since the value of the sequence number in the dial test message and the value of the sequence number in the response message are both determined by the system timestamp, when the time interval between the dial test message and the response message is short, if the value of the sequence number in the dial test message and the value of the sequence number in the response message are determined by the timestamp in the same time unit, the value of the sequence number in the dial test message and the value of the sequence number in the response message may be the same. In this embodiment, to avoid this problem, the value of the sequence number in the dial test message and the value of the sequence number in the response message are determined by the system timestamp in two different time units.

[0104] In some embodiments, one of the first unit and the second unit may be microseconds, and the other may be nanoseconds. Of course, in other embodiments, the first unit and the second unit may also be other two different time units.

[0105] It is understandable that, under the transmission control protocol, the first control field in the response message may include other control fields in addition to the sequence number. Similarly, the second control field in the dial test message may include other control fields in addition to the sequence number.

[0106] Fig.10 This is a schematic diagram of message interaction in the case of a short connection according to the TCP protocol according to an embodiment of the present application. TCP short connection interaction follows the TCP three-way handshake rule. Since the dial test only needs to obtain the network message transmission time, the four handshakes are ignored. Fig.10 As shown, in the first handshake, the second control field in the dial test message includes a Tcpflags field, a Tcpflags.ACK field, a Sequence Number field (i.e., a sequence number), and an Acknowledgment Number field, wherein the value of the Tcpflags field in the dial test message of the first handshake is true, the value of the Tcpflags.ACK field is false, the value of the Sequence Number field (i.e., the sequence number) is determined by converting the system microsecond (second unit) time, that is, it is determined by converting using a microsecond timestamp; the value of the Acknowledgment Number field is 0.

[0107] exist Fig.10In the second handshake shown, the first control field in the response message includes the Tcpflags field, the Tcpflags.ACK field, the Sequence Number field (i.e., the sequence number), and the Acknowledgment Number field. Among them, the value of the Tcpflags field is true, the value of the Tcpflags.ACK field is true, the value of the Sequence Number field (i.e., the sequence number) is determined by the system nanosecond (first unit) time conversion, that is, it is determined by using the nanosecond timestamp for conversion; the value of the Acknowledgment Number field is SYN.seq+1.

[0108] exist Fig.10 In the third handshake shown, the second control field in the dial test message includes the Tcpflags.SYN field, the Tcpflags.ACK field, the Tcpflags.RST field, the Sequence Number field and the Acknowledgment Number field. Among them, the value of the Tcpflags.SYN field is false, the value of the Tcpflags.ACK field is false, and the value of the Tcpflags.RST field is true; the value of the Sequence Number field is (SYN+ACK).ack; and the value of the Acknowledgment Number field is not 0.

[0109] exist Fig.10 In the process, the SYN+ACK response reflects that the forwarding is normal, and the transmission time is calculated. The last ACK confirmation is replaced by the RST (reset) message, and the corresponding session in the link is cleared at the same time to prevent the new session from being blocked and affecting the dial-up forwarding.

[0110] Fig.11 1 is a schematic diagram of message interaction in the case of a long connection according to the TCP protocol according to an embodiment of the present application. Fig.10 and Fig.11 It can be seen that in the first two handshakes in the process of establishing a TCP long connection, the second control field in the dial test message, the values ​​of each second control field, and the first control field in the response message and the value of the first control field are the same as those in the first two handshakes in the process of establishing a TCP short connection.

[0111] like Fig.11As shown, in the third handshake during the TCP long connection establishment process, the second control field in the dial test message includes the Tcpflags.SYN field (whose value is true), the Tcpflags.ACK field (whose value is false), the SequenceNumber field (whose value is (SYN+ACK).ack) and the Acknowledgment Number field (whose value is (SYN+ACK).seq+1).

[0112] like Fig.11 As shown in the figure, TCP long connection interaction follows the TCP three-way handshake rule. After the session is established, the message is sent through PUSH+ACK, and the correctness of the message interaction needs to be ensured by controlling the value of the Sequence Number field, the value of the TCP.payload field (payload is used to indicate the percentage of the effective load in the message, which is the length of the message minus the protocol length / total message length) and the time interval between two message sending. Fig.11 As shown in the figure, after the session is established, the second dial test message is sent 30 seconds after the first one. The reason for the 30-second interval is that the system time is used as the value of the Sequence Number field. After 30 seconds, the value of the Sequence Number field will increase by 30, which is exactly equal to the sum of the value of the Sequence Number field of the previous PUSH+ACK message and the value of the TCP.payload field (30 bytes). In addition, the payload (60 bytes) of the ACK message on the server side is guaranteed to be equal to the difference after the conversion of 2 times the 30s time.

[0113] When the TCP long connection request cannot be returned (for example, the waiting time for the response exceeds the time threshold), a fixed long connection session is established again through the dial test task management. In a specific embodiment, a fixed source port number 52121 can be used to ensure that a fixed long connection session is established each time. In this way, the PUSH+ACK message after a 30s interval can stably reuse the long connection for detection.

[0114] For TCP long and short connections, whether the last message is an ACK message or a RST message in the TCP three-way handshake can be judged by the fixed source port 52121. If the destination port of the SYN+ACK message is 52121, it is determined to be a long connection requirement, and an ACK message is sent; if the destination port is not 52121, it is determined to be a short connection requirement, and a RST message is sent.

[0115] In some embodiments, the communication protocol includes at least one of a general routing encapsulation protocol and a virtual extensible local area network protocol; the first control field in a dial test message for the general routing encapsulation protocol and the second control field in a response message for the general routing encapsulation protocol are the same, and the value of the first control field is the same as the value of the second control field; the first control field in a dial test message for the virtual extensible local area network protocol and the second control field in a response message for the virtual extensible local area network protocol are the same, and the value of the first control field is the same as the value of the second control field.

[0116] Fig.12 FIG. 1 is a schematic diagram of message interaction under the Generic Routing Encapsulation Protocol (GRE protocol) according to an embodiment of the present application. Fig.12 As shown, the second control field in the dial test message is the same as the first control field in the response message, both including the KeyPresent field, the Version field, the Protocol field and the Key field, and the values ​​of the same first control field and the second control field are also the same. GRE transmission can be controlled by the Version field: 0x01 (v1 version), Key: vpcid (vpcid value), and the value of the Key field in the GRE response message is consistent with the value of the Key field in the dial test message to ensure that the message interaction is not cross-streamed.

[0117] Fig.13 FIG. 1 is a schematic diagram of message interaction under the Virtual Extensible Local Area Network Protocol (VXLAN Protocol) according to an embodiment of the present application. Fig.13 As shown, the second control field in the dial-up test message is the same as the first control field in the response message, both of which include the ValidIDFlag field and the VNI field (this field represents the VXLAN Network Identifier, i.e., the network identifier of the virtual extensible local area network), and the value of the corresponding first field is the same as the value of the second field. Therefore, the VXLAN dial-up test message can control vxlanflags: 0x0800 (VXLAN Network Identifier is set), VXLAN NetworkIdentifier: vpcid (vpcid value), and the VXLAN response message is consistent with the value of the VNI field in the dial-up test message to ensure that the message interaction is not cross-flow.

[0118] In the present application, the message is controlled by copying the data link layer message. In addition, since the sending and responding are completed at the same data link layer, the message interaction process needs to be predefined, that is, through user-defined configuration, the configuration strategy of the first control field in the response message of the communication protocol and the configuration strategy of the second control field in the dial test message (request message) of the communication protocol are configured, so as to facilitate the subsequent determination of the value of the first control field in the response message based on the defined configuration strategy of the first control field, and the determination of the value of the second control field in the dial test message based on the defined configuration strategy of the second control field, thereby encapsulating the dial test message and automatically generating the response message.

[0119] Fig.14 and Fig.15 The schematic diagram of the constructed NTP message is shown as an example. Under the NTP protocol, the dial-up message and the response message can be controlled by controlling the Key Bit field ( Fig.14 The value is Yes in the Mode field ( Fig.15 The value is 3, indicating client, that is, client mode), and specifies the UDP port 123 and NTP server address of the NTP service.

[0120] Fig.16 and Fig.17 The schematic diagram of the constructed DNS message is shown as an example. Under the DNS protocol, the DNS data message QR (Response): the flag information value of the query request is 0 and the query question area (Queries) is controlled. The Queries part is used to control the question of the DNS query request. Usually there is only one question. This part contains the query information in progress, including the query name (the host name being queried), the query type, the query class (for example Fig.16 and Fig.17 The query name is bj.govcloud.tencent.com; the query type is type A, and the query class is classIN), and the DNS service UDP port 53 and DNS server address (i.e. Fig.16 and Fig.17 The part selected by the dotted box at the top is used to specify the DNS service UDP port 53 and the DNS server address).

[0121] Fig.18 The schematic diagram of the constructed GRE message is shown as an example. Fig.18 As shown, the key setting part of the GRE data message can be controlled (i.e. Fig.18 The first dotted box selects the part) and the encapsulated Protocol part ( Fig.18The private network uses the GRE protocol for network virtualization, and key is used to represent different vpcIds (private network IDs).

[0122] In some embodiments, the method further includes the following steps D1 to D4, which are described in detail as follows:

[0123] Step D1, obtaining first detection information of a target object, where the target object is a detection object other than a gateway; the first detection information includes a destination address of the target object, a communication protocol supported by the target object, and a source address.

[0124] The target object may be an application service, a port, a network element node, a load balancer, etc., which are not specifically limited here. The first detection information of the target object may be configured by a user. The first detection information may also include a configured port, such as a source port and a destination port.

[0125] Step D2, encapsulating the message according to the destination address, communication protocol and source address in the first detection information to obtain a first virtual dialing message.

[0126] The encapsulation process of the first virtual dial test message is basically similar to the encapsulation process of the virtual dial test message in the above text. It can be understood that if the configuration policy of the control field is configured for the communication protocol in the first detection information, in step D2, the value of the control field in the dial test message is determined according to the configuration policy of the control field, and the determined value of the control field is encapsulated into the first virtual dial test message.

[0127] Step D3: Send a first virtual dialing message to the target object through the network card of the detection device.

[0128] Step D4, receiving a first response message returned by the target object in response to the first virtual dialing message.

[0129] Step D5, determining the dialing test result of the target object according to the first response message.

[0130] In this embodiment, the first response message is obtained by the target object responding to the first virtual dial test message. Therefore, the dial test result of the target object can be determined by analyzing the first response message. For example, if the target object is a website, the page access performance of the website can be analyzed and determined based on the first response message. In this embodiment, the application service, network element node, port, etc. can be dialed by customizing the construction of a virtual dial test message, and then sending the virtual dial test message through the network card of the detection device, without the need to deploy a virtual machine. The virtual resources relied on by the dial test are small, and since there is no need to deploy a virtual machine, the user is not required to log in to the virtual machine during the dial test process, which can improve the operability of network operation and maintenance and reduce the cost of dial test resources. The solution of this embodiment can be applied to troubleshooting in network operation and maintenance scenarios, and the dial test message can be quickly customized and constructed, and the dial test message can be flexibly sent through a specified network card, instead of sending the dial test message only when logging in to the virtual machine.

[0131] In some embodiments, the method further includes: storing the virtual dial test message and the virtual response message corresponding to the virtual dial test message in the dial test process in time sequence, so as to ensure the traceability of historical dial test data.

[0132] The following describes an apparatus embodiment of the present application, which can be used to execute the method in the above-mentioned embodiment of the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the above-mentioned method embodiment of the present application.

[0133] Fig.19 is a block diagram of a dialing test device according to an embodiment of the present application, and the dialing test device can be configured in an electronic device to implement the dialing test method provided by the present application. Fig.19 As shown, the dialing test device includes: an acquisition module 1910, which is used to obtain the dialing test information of the target gateway, the dialing test information includes an inner virtual source address, an inner virtual destination address, a physical address of the detection device, a communication protocol supported by the target gateway and a message forwarding rule corresponding to the target gateway; the inner virtual source address and the inner virtual destination address are obtained by virtualization on the detection device; a message encapsulation module 1920, which is used to encapsulate the message according to the inner virtual source address, the inner virtual destination address, the physical address of the detection device and the communication protocol to obtain a virtual dialing test message; a forwarding module 1930, which is used to send the virtual dialing test message through the network card of the detection device based on the message forwarding rule to route the virtual dialing test message to the target gateway; a response message generation module 1940, which is used to generate a virtual response message corresponding to the virtual dialing test message according to the inner virtual destination address and the communication protocol if the virtual dialing test message returned by the target gateway route is received.

[0134] In some embodiments, the dial test information also includes response scenario configuration information; the response message generation module 1940 includes: a target response scenario determination unit, which is used to determine the target response scenario corresponding to the virtual dial test message if a virtual dial test message returned by the target gateway routing is received; a virtual response message determination unit, which is used to generate a virtual response message corresponding to the virtual dial test message according to the communication protocol based on the inner virtual destination address and the response scenario configuration information corresponding to the target response scenario.

[0135] In some embodiments, the response scenario configuration information includes a configuration strategy for a first control field in a response message for a communication protocol; a virtual response message determination unit includes: a first determination unit, used to determine a value of the first control field in the response message for the communication protocol according to the configuration strategy for the first control field in the response message for the communication protocol in the response scenario configuration information corresponding to the target response scenario; a first generation unit, used to construct a response message according to the communication protocol based on an inner virtual destination address and the value of the first control field in the response message for the communication protocol, to obtain a virtual response message corresponding to the virtual dialing message.

[0136] In some embodiments, the dialing information also includes packet configuration information, which indicates the configuration strategy of the second control field in the dialing message for the communication protocol; the message encapsulation module 1920 includes: a second determination unit, which is used to determine the value of the second control field in the dialing message for the communication protocol according to the configuration strategy of the second control field in the dialing message for the communication protocol indicated by the packet configuration information; wherein the value of the first control field and the value of the second control field in the same session under the communication protocol are corresponding; an encapsulation unit, which is used to encapsulate the request message according to the communication protocol based on the inner virtual source address, the inner virtual destination address, the physical address of the detection device, and the value of the second control field to obtain a virtual dialing message.

[0137] In some embodiments, the communication protocol includes a transmission control protocol; the first control field includes a sequence number; the second control field includes a sequence number; the first determination unit is further configured to: determine the value of the sequence number in the response message according to the system timestamp under the first unit in accordance with the configuration strategy of the sequence number in the response message of the communication protocol in the response scenario configuration information corresponding to the target response scenario; the second determination unit is further configured to: determine the value of the sequence number in the dial test message according to the system timestamp under the second unit in accordance with the configuration strategy of the sequence number in the dial test message of the communication protocol indicated by the packet configuration information; wherein the first unit and the second unit are different time units.

[0138] In some embodiments, the communication protocol includes at least one of a general routing encapsulation protocol and a virtual extensible local area network protocol; the first control field in a dial test message for the general routing encapsulation protocol and the second control field in a response message for the general routing encapsulation protocol are the same, and the value of the first control field is the same as the value of the second control field; the first control field in a dial test message for the virtual extensible local area network protocol and the second control field in a response message for the virtual extensible local area network protocol are the same, and the value of the first control field is the same as the value of the second control field.

[0139] In some embodiments, the dialing test device also includes: a response timing module, which is used to respond to the detection task corresponding to the target gateway based on the task timer after sending the virtual dialing test message; and a task closing module, which is used to close the detection task corresponding to the target gateway if it is determined that the waiting time for responding to the virtual dialing test message exceeds a time threshold.

[0140] In some embodiments, the dialing test device also includes: a first detection information acquisition module, which is used to obtain the first detection information of the target object, and the target object is other detection objects except the gateway; the first detection information includes the destination address of the target object, the communication protocol supported by the target object, and the source address; a first virtual dialing test message encapsulation module, which is used to encapsulate the message according to the destination address, communication protocol and source address in the first detection information to obtain a first virtual dialing test message; a sending module, which is used to send the first virtual dialing test message to the target object through the network card of the detection device; a receiving module, which is used to receive a first response message returned by the target object in response to the first virtual dialing test message; and a dialing test result determination module, which is used to determine the dialing test result of the target object according to the first response message.

[0141] In some embodiments, the dial test device further includes: a storage module, configured to store the virtual dial test message and the virtual response message corresponding to the virtual dial test message in the dial test process in a time sequence.

[0142] Fig. 20 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Fig. 20 The computer system 2000 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application. The electronic device may be a server or other device with certain processing capabilities, which is used to execute the dialing method provided by the present application.

[0143] like Fig. 20As shown, computer system 2000 includes a central processing unit (CPU) 2001, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 2002 or the program loaded from the storage part 2008 to the random access memory (RAM) 2003, such as executing the method in the above embodiment. In RAM 2003, various programs and data required for system operation are also stored. CPU 2001, ROM 2002 and RAM 2003 are connected to each other through bus 2004. Input / output (I / O) interface 2005 is also connected to bus 2004.

[0144] The following components are connected to the I / O interface 2005: an input section 2006 including a keyboard, a mouse, etc.; an output section 2007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 2008 including a hard disk, etc.; and a communication section 2009 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 2009 performs communication processing via a network such as the Internet. A drive 2010 is also connected to the I / O interface 2005 as needed. A removable medium 2011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 2010 as needed so that a computer program read therefrom is installed into the storage section 2008 as needed.

[0145] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 2009, and / or installed from the removable medium 2011. When the computer program is executed by the central processing unit (CPU) 2001, various functions defined in the system of the present application are executed.

[0146] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0147] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0148] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0149] As another aspect, the present application further provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments; or may exist independently without being assembled into the electronic device. The above computer-readable storage medium carries computer-readable instructions, and when the computer-readable storage instructions are executed by a processor, the method in any of the above embodiments is implemented.

[0150] According to one aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method in any of the above embodiments.

[0151] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0152] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.

[0153] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.

[0154] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A dialing method, characterized in that: The method comprises: Acquire the dialing information of the target gateway, the dialing information including the inner virtual source address, the inner virtual destination address, the physical address of the detection device, the communication protocol supported by the target gateway and the message forwarding rule corresponding to the target gateway; the inner virtual source address and the inner virtual destination address are obtained by virtualization on the detection device; Encapsulate the message according to the inner virtual source address, the inner virtual destination address, the physical address of the detection device and the communication protocol to obtain a virtual dialing message; Based on the message forwarding rule, sending the virtual dial-up message through the network card of the detection device to route the virtual dial-up message to the target gateway; If the virtual dialing message returned by the target gateway routing is received, a virtual response message corresponding to the virtual dialing message is generated according to the inner virtual destination address and the communication protocol.

2. The method according to claim 1, characterized in that The dial test information also includes response scenario configuration information; If the virtual dial test message returned by the target gateway routing is received, generating a virtual response message corresponding to the virtual dial test message according to the communication protocol includes: If the virtual dial test message returned by the target gateway routing is received, determining a target response scenario corresponding to the virtual dial test message; A virtual response message corresponding to the virtual dial test message is generated according to the inner virtual destination address and the response scenario configuration information corresponding to the target response scenario and in accordance with the communication protocol.

3. The method according to claim 2, characterized in that The response scenario configuration information includes a configuration strategy for a first control field in a response message of the communication protocol; The step of generating a virtual response message corresponding to the virtual dial test message according to the communication protocol based on the inner virtual destination address and the response scenario configuration information corresponding to the target response scenario includes: Determine a value of the first control field in the response message for the communication protocol according to a configuration strategy for the first control field in the response message for the communication protocol in the response scenario configuration information corresponding to the target response scenario; According to the inner virtual destination address and the value of the first control field in the response message for the communication protocol, a response message is constructed according to the communication protocol to obtain a virtual response message corresponding to the virtual dial test message.

4. The method according to claim 3, characterized in that The dial test information also includes packet sending configuration information, and the packet sending configuration information indicates a configuration strategy for the second control field in the dial test message of the communication protocol; The step of encapsulating the message according to the inner virtual source address, the inner virtual destination address, the physical address of the detection device and the communication protocol to obtain the virtual dialing message includes: Determine the value of the second control field in the dial test message for the communication protocol according to the configuration strategy of the second control field in the dial test message for the communication protocol indicated by the packet sending configuration information; wherein the value of the first control field and the value of the second control field in the same session under the communication protocol are corresponding; Based on the inner virtual source address, the inner virtual destination address, the physical address of the detection device and the value of the second control field, the request message is encapsulated according to the communication protocol to obtain the virtual dialing message.

5. The method according to claim 4, characterized in that The communication protocol includes a transmission control protocol; the first control field includes a sequence number; the second control field includes a sequence number; The determining, according to the configuration strategy for the first control field in the response message of the communication protocol in the response scenario configuration information corresponding to the target response scenario, a value of the first control field in the response message of the communication protocol, comprises: Determine, according to the configuration strategy for the sequence number in the response message of the communication protocol in the response scenario configuration information corresponding to the target response scenario, the value of the sequence number in the response message according to the system timestamp under the first unit; The step of determining the value of the second control field in the dial test message for the communication protocol according to the configuration strategy of the second control field in the dial test message for the communication protocol indicated by the packet sending configuration information comprises: According to the configuration strategy of the sequence number in the dial test message for the communication protocol indicated by the packet configuration information, the value of the sequence number in the dial test message is determined according to the system timestamp under the second unit; wherein the first unit and the second unit are different time units.

6. The method according to claim 4, characterized in that The communication protocol includes at least one of the general routing encapsulation protocol and the virtual extensible local area network protocol; The first control field in the dial test message for the generic routing encapsulation protocol is the same as the second control field in the response message for the generic routing encapsulation protocol, and the value of the first control field is the same as the value of the second control field; The first control field in the dial-up message for the virtual extensible local area network protocol and the second control field in the response message for the virtual extensible local area network protocol are the same, and the value of the first control field is the same as the value of the second control field.

7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: After sending the virtual dialing message, responding to the detection task corresponding to the target gateway based on the task timer; If it is determined that the time length for waiting for a response to the virtual dial test message exceeds a time length threshold, the detection task corresponding to the target gateway is closed.

8. The method according to claim 1, characterized in that The method further comprises: Acquire first detection information of a target object, where the target object is a detection object other than a gateway; the first detection information includes a destination address of the target object, a communication protocol supported by the target object, and a source address; Encapsulate the message according to the destination address, communication protocol and source address in the first detection information to obtain a first virtual dial-up message; Sending the first virtual dialing message to the target object through the network card of the detection device; Receiving a first response message returned by the target object in response to the first virtual dialing message; Determine a dialing result of the target object according to the first response message.

9. The method according to any one of claims 1 to 6 or claim 8, characterized in that The method further comprises: The virtual dial test message in the dial test process and the virtual response message corresponding to the virtual dial test message are stored in time sequence.

10. A dialing device, characterized in that: The device comprises: An acquisition module is used to acquire the dialing information of the target gateway, wherein the dialing information includes an inner virtual source address, an inner virtual destination address, a physical address of a detection device, a communication protocol supported by the target gateway, and a message forwarding rule corresponding to the target gateway; the inner virtual source address and the inner virtual destination address are obtained by virtualizing on the detection device; A message encapsulation module, used to encapsulate the message according to the inner virtual source address, the inner virtual destination address, the physical address of the detection device and the communication protocol to obtain a virtual dialing message; A forwarding module, configured to send the virtual dial-up test message through the network card of the detection device based on the message forwarding rule, so as to route the virtual dial-up test message to the target gateway; The response message generation module is used to generate a virtual response message corresponding to the virtual dialing message according to the inner virtual destination address and the communication protocol if the virtual dialing message returned by the target gateway routing is received.

11. An electronic device, characterized in that: include: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 9 is implemented.

12. A computer-readable storage medium having computer-readable instructions stored thereon, characterized in that: When the computer-readable instructions are executed by a processor, the method according to any one of claims 1 to 9 is implemented.

13. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the method according to any one of claims 1 to 9 is implemented.

Citation Information

Cited By

  • Automatic testing method, device and equipment for service quality binding based on gateway and storage medium

    CN119420680A

  • Automated testing method, device, equipment and storage medium based on gateway-based quality of service binding

    CN119420680B