Network diagnosis method and device, computer device and storage medium
Patent Information
- Application Number
- CN202211373620.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-03
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2042-11-03
AI Technical Summary
[0003]然而,网络地址转换后的第一业务提供方与第二业务提供方的通信路径可能会存在网络故障,导致在网络地址转换后,第一业务提供方与第二业务提供方的之间无法通信
[0073] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps described in the first aspect.
Smart Images

Figure CN115695368B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent operation and maintenance technology, and in particular to a network diagnostic method, device, computer equipment, storage medium and computer program product. Background Technology
[0002] The first service provider needs to communicate with the second service provider. For security and management requirements of both parties, both the original addresses of the first and second service providers need to undergo Network Address Translation (NAT). Before NAT, the communication path between the two service providers is from the first service provider's original address to the second service provider's original address. After NAT, the communication path is from the first service provider's original address to the second service provider's translated address, and then from the first service provider's translated address back to the second service provider's original address.
[0003] However, network failures may occur in the communication path between the first and second service providers after Network Address Translation (NAT), preventing them from communicating. Therefore, a network diagnostic method for NAT architecture is urgently needed. Summary of the Invention
[0004] Therefore, it is necessary to provide a network diagnostic method, apparatus, computer equipment, computer-readable storage medium, and computer program product capable of performing network diagnostics on address translation architectures, addressing the aforementioned technical problems.
[0005] Firstly, this application provides a network diagnostic method. The method includes:
[0006] Obtain the communication path information after address translation; the communication path information includes information on the first sub-path from the first original address of the first service provider to the first translated address of the second service provider, and information on the second sub-path from the second translated address of the first service provider to the second original address of the second service provider;
[0007] Based on the address translation requirements of the second service provider, determine the address translation diagnostic result corresponding to the communication path information;
[0008] If the address translation diagnosis result indicates that the address translation is correct, for each sub-path, the communication configuration information of the network devices along the sub-path is obtained, and based on the communication configuration information of the network devices along the sub-path, it is determined whether the sub-path meets the communication conditions, and the communication diagnosis result of the sub-path is obtained.
[0009] A network diagnostic result is generated based on the communication path information, the address translation diagnostic result, and the communication diagnostic result of each sub-path.
[0010] In one embodiment, the along-path network device includes an along-path access control device; the step of determining whether the sub-path meets the communication conditions based on the communication configuration information of the along-path network device, and obtaining the communication diagnostic result of the sub-path, includes:
[0011] Based on the communication configuration information of the network devices along the route, determine whether the sub-path meets the preset routing communication conditions, and obtain the routing diagnosis result of the sub-path;
[0012] Based on the communication configuration information of the access control devices along the route, determine whether the sub-path meets the preset access control conditions, and obtain the access control diagnostic result of the sub-path;
[0013] Based on the routing diagnostic results and access control diagnostic results of the sub-path, a communication diagnostic result for the sub-path is generated.
[0014] In one embodiment, the communication configuration information includes routing configuration information; the step of determining whether the sub-path meets preset routing communication conditions based on the communication configuration information of the network devices along the route, and obtaining the routing diagnosis result of the sub-path, includes:
[0015] Based on the sub-path information of the sub-path, in the preset routing information of the first service provider, query the order in which the data in the sub-path passes through the network devices along the route of the first service provider and the order in which the data in the sub-path passes through the network devices along the route of the first service provider.
[0016] For each network device along the route, based on the routing configuration information of the network device along the route, the routing configuration information of the two adjacent network devices along the route, and the preset routing communication conditions, it is determined whether the network device along the route is routable to the adjacent network devices, and the routing diagnosis result of the network device along the route is obtained.
[0017] The routing diagnosis results of the sub-paths are determined based on the routing diagnosis results of each of the network devices along the route.
[0018] In one embodiment, the communication configuration information includes access control configuration information; the step of determining whether the sub-path meets preset access control conditions based on the communication configuration information of the access control devices along the route, and obtaining the access control diagnostic result of the sub-path, includes:
[0019] Based on the sub-path information of the sub-path, in the preset routing rules of the access control devices of the first service provider, query the access control devices along the route of the data in the sub-path that pass through the first service provider.
[0020] For each access control device along the route, the source address and destination address of the sub-path are checked for consistency with the source address and destination address contained in the access control rules of the access control device along the route, and the consistency check result of the access control device along the route is obtained.
[0021] Based on the consistency verification results of each access control device along the route, the access control diagnostic results of the sub-path are determined.
[0022] In one embodiment, when the sub-path is the first sub-path, determining the routing diagnosis result of the sub-path based on the routing diagnosis results of each of the network devices along the route includes:
[0023] Based on the routing diagnostic results of each of the network devices along the route, a routing diagnostic result for the sub-path containing a routing diagnostic identifier is generated.
[0024] In one embodiment, when the sub-path is the second sub-path, determining the routing diagnosis result of the sub-path based on the routing diagnosis results of each of the network devices along the route includes:
[0025] Based on the first original address, query the connection requirements corresponding to the first original address from among the connection requirements of the second service provider; the connection requirements include access type requirements, access device requirements, and access port requirements;
[0026] The data in the second sub-path is subjected to a consistency check between the connection information of the second service provider and the connection requirements corresponding to the first original address, and the connection information of the last along-path network device in the first service provider and the second service provider, to obtain the consistency check result.
[0027] The routing diagnosis result of the sub-path is determined based on the routing diagnosis results of each network device along the route and the consistency detection results.
[0028] In one embodiment, obtaining the address-translated communication path information includes:
[0029] Obtain the first original address of the first service provider and the second original address of the second service provider before address translation;
[0030] In the mapping relationship between the original address and the converted address of the second service provider, query the first converted address of the second service provider;
[0031] The sub-access relationship from the first original address to the first converted address is matched with multiple access relationships included in the preset address conversion rules, and the successfully matched access relationship is taken as the target access relationship;
[0032] In the mapping relationship between the access relationship and the converted address of the first service provider, query the second converted address of the first service provider corresponding to the target access relationship;
[0033] The first original address, the first converted address, the second converted address, and the second original address constitute the communication path information after address conversion.
[0034] In one embodiment, determining the address translation diagnostic result corresponding to the communication path information based on the address translation requirements of the second service provider includes:
[0035] In the address conversion requirements of the second service provider, query the address conversion requirements corresponding to the first original address; the address conversion requirements include the range of addresses after conversion;
[0036] If the second converted address is within the range of the converted address, then the address conversion diagnosis result corresponding to the communication path information is determined to be a correct address conversion;
[0037] If the second converted address is not within the range of the converted addresses, then the address conversion diagnosis result corresponding to the communication path information is determined to be an address conversion error.
[0038] Secondly, this application also provides a network diagnostic device. The device includes:
[0039] The acquisition module is used to acquire communication path information after address translation; the communication path information includes information on the first sub-path from the first original address of the first service provider to the first translated address of the second service provider, and information on the second sub-path from the second translated address of the first service provider to the second original address of the second service provider;
[0040] The address translation diagnostic module is used to determine the address translation diagnostic result corresponding to the communication path information based on the address translation requirements of the second service provider.
[0041] The communication diagnostic module is used to, when the address translation diagnostic result indicates that the address translation is correct, acquire the communication configuration information of the network devices along the sub-path for each sub-path segment, and determine whether the sub-path meets the communication conditions based on the communication configuration information of the network devices along the sub-path, and obtain the communication diagnostic result of the sub-path.
[0042] The network diagnostic module is used to generate network diagnostic results based on the communication path information, the address translation diagnostic results, and the communication diagnostic results of each sub-path.
[0043] In one embodiment, the along-path network device includes an along-path access control device; the communication diagnostic module is specifically used for:
[0044] Based on the communication configuration information of the network devices along the route, determine whether the sub-path meets the preset routing communication conditions, and obtain the routing diagnosis result of the sub-path;
[0045] Based on the communication configuration information of the access control devices along the route, determine whether the sub-path meets the preset access control conditions, and obtain the access control diagnostic result of the sub-path;
[0046] Based on the routing diagnostic results and access control diagnostic results of the sub-path, a communication diagnostic result for the sub-path is generated.
[0047] In one embodiment, the communication configuration information includes routing configuration information; the communication diagnostic module is specifically used for:
[0048] Based on the sub-path information of the sub-path, in the preset routing information of the first service provider, query the order in which the data in the sub-path passes through the network devices along the route of the first service provider and the order in which the data in the sub-path passes through the network devices along the route of the first service provider.
[0049] For each network device along the route, based on the routing configuration information of the network device along the route, the routing configuration information of the two adjacent network devices along the route, and the preset routing communication conditions, it is determined whether the network device along the route is routable to the adjacent network devices, and the routing diagnosis result of the network device along the route is obtained.
[0050] The routing diagnosis results of the sub-paths are determined based on the routing diagnosis results of each of the network devices along the route.
[0051] In one embodiment, the communication configuration information includes access control configuration information; the communication diagnostic module is specifically used for:
[0052] Based on the sub-path information of the sub-path, in the preset routing rules of the access control devices of the first service provider, query the access control devices along the route of the data in the sub-path that pass through the first service provider.
[0053] For each access control device along the route, the source address and destination address of the sub-path are checked for consistency with the source address and destination address contained in the access control rules of the access control device along the route, and the consistency check result of the access control device along the route is obtained.
[0054] Based on the consistency verification results of each access control device along the route, the access control diagnostic results of the sub-path are determined.
[0055] In one embodiment, when the sub-path is the first sub-path, the communication diagnostic module is specifically used for:
[0056] Based on the routing diagnostic results of each of the network devices along the route, a routing diagnostic result for the sub-path containing a routing diagnostic identifier is generated.
[0057] In one embodiment, when the sub-path is the second sub-path, the communication diagnostic module is specifically used for:
[0058] Based on the first original address, query the connection requirements corresponding to the first original address from among the connection requirements of the second service provider; the connection requirements include access type requirements, access device requirements, and access port requirements;
[0059] The data in the second sub-path is subjected to a consistency check between the connection information of the second service provider and the connection requirements corresponding to the first original address, and the connection information of the last along-path network device in the first service provider and the second service provider, to obtain the consistency check result.
[0060] The routing diagnosis result of the sub-path is determined based on the routing diagnosis results of each network device along the route and the consistency detection results.
[0061] In one embodiment, the acquisition module is specifically used for:
[0062] Obtain the first original address of the first service provider and the second original address of the second service provider before address translation;
[0063] In the mapping relationship between the original address and the converted address of the second service provider, query the first converted address of the second service provider;
[0064] The sub-access relationship from the first original address to the first converted address is matched with multiple access relationships included in the preset address conversion rules, and the successfully matched access relationship is taken as the target access relationship;
[0065] In the mapping relationship between the access relationship and the converted address of the first service provider, query the second converted address of the first service provider corresponding to the target access relationship;
[0066] The first original address, the first converted address, the second converted address, and the second original address constitute the communication path information after address conversion.
[0067] In one embodiment, the address translation diagnostic module is specifically used for:
[0068] In the address conversion requirements of the second service provider, query the address conversion requirements corresponding to the first original address; the address conversion requirements include the range of addresses after conversion;
[0069] If the second converted address is within the range of the converted address, then the address conversion diagnosis result corresponding to the communication path information is determined to be a correct address conversion;
[0070] If the second converted address is not within the range of the converted addresses, then the address conversion diagnosis result corresponding to the communication path information is determined to be an address conversion error.
[0071] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps described in the first aspect.
[0072] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the steps described in the first aspect.
[0073] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps described in the first aspect.
[0074] The aforementioned network diagnostic methods, devices, computer equipment, storage media, and computer program products, based on the acquired address-translated communication path information, first diagnose whether the address translation is correct based on the address translation requirements of the second service provider. Then, for each sub-path after address translation, based on the communication configuration information of the network devices along the sub-path, they determine whether the sub-path is reachable. Communication diagnostics are performed on the segmented access relationships after address translation, realizing full-link communication diagnostics. In this way, network diagnostics of the address-translated communication path can be performed, realizing network diagnostics of the address translation architecture. Attached Figure Description
[0075] Figure 1 This is a flowchart illustrating a network diagnostic method in one embodiment;
[0076] Figure 2 This is a flowchart illustrating the steps for determining the communication diagnostic results of a sub-path in one embodiment.
[0077] Figure 3 This is a flowchart illustrating the steps for determining the routing diagnosis results of a sub-path in one embodiment.
[0078] Figure 4 This is a flowchart illustrating the steps for determining the access control diagnostic results of a sub-path in one embodiment.
[0079] Figure 5 This is a flowchart illustrating the steps for determining the routing diagnostic results of a sub-path in another embodiment;
[0080] Figure 6 This is a flowchart illustrating the steps for obtaining the communication path information after address translation in one embodiment;
[0081] Figure 7 This is a flowchart illustrating the steps for determining the address translation diagnostic result in one embodiment;
[0082] Figure 8 This is a structural block diagram of a network diagnostic device in one embodiment;
[0083] Figure 9 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0084] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0085] In one embodiment, such as Figure 1 As shown, a network diagnostic method is provided. This embodiment illustrates the method applied to a terminal, but it is understood that the method can also be applied to a server, and to a system including both a terminal and a server, and is implemented through interaction between the terminal and the server. The terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart vehicle devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. In this embodiment, the method includes the following steps:
[0086] Step 101: Obtain the communication path information after address translation.
[0087] The communication path information includes information on the first sub-path from the first original address of the first service provider to the first converted address of the second service provider, and information on the second sub-path from the first converted address of the first service provider to the second original address of the second service provider.
[0088] In this embodiment, the first service provider is a service provider that includes an address translation system and performs address translation. The address translation system is a system that translates the first original address of the first service provider and the second original address of the second service provider. The second service provider is a service provider that does not perform address translation. The first service provider communicates with the second service provider. The first service provider may be a service provider that provides intermediary services. The second service provider may be a cooperating service provider of the first service provider that provides intermediary services. For example, the first service provider may be a bank, and the second service provider may be a partner of the bank. Before network address translation, the communication path between the first service provider and the second service provider is from the first original address of the first service provider to the second original address of the second service provider. After network address translation, the communication path between the first service provider and the second service provider is from the first original address of the first service provider to the first translated address of the second service provider, and then from the second translated address of the first service provider to the second original address of the second service provider.
[0089] The terminal obtains the first original address of the first service provider and the second original address of the second service provider. Then, based on the first original address of the first service provider, the second original address of the second service provider, and a preset address translation rule, the terminal determines the second translated address of the first service provider and the first translated address of the second service provider. Finally, the terminal combines the first original address, the second original address, the second translated address, and the first translated address to construct the address-translated communication path information.
[0090] In one example, the address translation rules include: the mapping relationship between the original address and the translated address of the first service provider, and the mapping relationship between the original address and the translated address of the second service provider. The terminal, based on the first service provider's first original address, queries the second translated address of the first service provider from the mapping relationship between the original address and the translated address. Simultaneously, the terminal, based on the second service provider's second original address, queries the first translated address of the second service provider from the mapping relationship between the original address and the translated address. In this way, the address translation rules adopt a static routing approach, with both the original and translated addresses of the first and second service providers having static mapping relationships. This provides high confidentiality and security, and also improves the efficiency of obtaining the communication path information after address translation.
[0091] Step 102: Based on the address translation requirements of the second service provider, determine the address translation diagnostic results corresponding to the communication path information.
[0092] In this embodiment, the terminal obtains the address translation requirements of the second service provider. Then, the terminal determines whether the communication path information meets the address translation requirements of the second service provider, and generates an address translation diagnostic result corresponding to the communication path information, including an address translation diagnostic identifier, based on the determination result. Specifically, if the communication path information meets the address translation requirements of the second service provider, the terminal determines the address translation diagnostic identifier as an identifier indicating correct address translation. If the communication path information does not meet the address translation requirements of the second service provider, the terminal determines the address translation diagnostic identifier as an identifier indicating an address translation error. Then, the terminal generates the address translation diagnostic result corresponding to the communication path information based on the address translation identifier. The address translation diagnostic identifier indicates whether the address translation is correct. The address translation result may include a determination of whether the address translation is correct, and may also include the reason for the address translation error.
[0093] In one example, the terminal uses the address translation identifier as the result of the address translation.
[0094] In one example, if the address translation identifier indicates that the address translation is correct, the terminal uses the address translation identifier as the address translation result. If the address translation identifier indicates that the address translation is incorrect, the terminal uses the address translation identifier and the address translation error reason information to form the address translation result. The address translation error reason information can be "Does not meet the address translation requirements of the second service provider".
[0095] In one example, the terminal can preset the requirements for a second service provider. Then, based on the name of the second service provider, the terminal queries the address translation requirements of that second service provider within the second service provider requirements list. Here, "second service provider requirements" refers to the requirements of a single second service provider. These requirements include address translation requirements for multiple second service providers. The second service provider requirements can include the mapping between the names of second service providers and their address translation requirements. The second service provider requirements can be modified by the terminal. For example, the terminal can add, delete, and modify second service providers and their requirements within the second service provider requirements list.
[0096] Step 103: If the address translation diagnosis result indicates that the address translation is correct, for each sub-path, obtain the communication configuration information of the network devices along the sub-path, and determine whether the sub-path meets the communication conditions based on the communication configuration information of the network devices along the sub-path, and obtain the communication diagnosis result of the sub-path.
[0097] In this embodiment, if the address translation diagnostic result indicates that the address translation is correct, for each sub-path, the terminal determines the network devices along the path through which the data passes. Then, the terminal obtains the communication configuration information of the network devices along the path. Here, the network devices along the path are the network devices through which the data passes within the path. The communication configuration information is configuration information related to communication. The communication configuration information may include routing configuration information and access control configuration information.
[0098] The terminal presets communication conditions. Then, based on the communication configuration information of the network devices along the route, the terminal determines whether the sub-path meets the communication conditions. If the sub-path meets the communication conditions, the communication diagnostic result for the sub-path is "communication reachable." If the sub-path does not meet the communication conditions, the communication diagnostic result for the sub-path is "communication unreachable." Here, the communication conditions are used to measure whether the path is reachable. The communication diagnostic result is used to indicate whether the sub-path is reachable.
[0099] Step 104: Generate network diagnostic results based on communication path information, address translation diagnostic results, and communication diagnostic results of each sub-path.
[0100] In this embodiment, the terminal determines a comprehensive communication diagnostic result based on the communication diagnostic results of each sub-path. Then, the terminal determines a network diagnostic result based on the communication path information, address translation diagnostic results, and the comprehensive communication diagnostic result. The comprehensive communication diagnostic result indicates whether communication is reachable after address translation. Specifically, the terminal determines a comprehensive communication diagnostic identifier based on the communication diagnostic results of each sub-path. This comprehensive communication diagnostic identifier indicates whether communication is reachable after address translation. Then, the terminal generates a comprehensive communication diagnostic result based on the comprehensive communication diagnostic identifier.
[0101] In one example, if the communication diagnostic results for each sub-path indicate that the sub-path is reachable, then the comprehensive communication diagnostic identifier is used to represent the reachability of the path after address translation. The terminal then uses this comprehensive communication diagnostic identifier as the comprehensive communication diagnostic result. If the communication diagnostic results for a sub-path indicate that the sub-path is unreachable, then the comprehensive communication diagnostic identifier is used to represent the unreachability of the path after address translation. The terminal then uses the sub-path corresponding to the communication diagnostic result indicating that the sub-path is unreachable as the communication error path. Finally, the terminal combines the comprehensive communication diagnostic identifier and the communication error path to form the comprehensive communication diagnostic result.
[0102] In one example, the terminal combines communication path information, address translation diagnostic results, and comprehensive communication diagnostic results to form the network diagnostic results.
[0103] In one example, the terminal presets a prompt message. Then, the terminal combines the prompt message, communication path information, address translation diagnostic results, and comprehensive communication diagnostic results to form a network diagnostic result. The prompt message is used to inform the user. The prompt message may be: "The first service provider needs to access the first translated address of the second service provider" or "The IP address exposed by the first service provider to the second service provider is the translated IP address of the first service provider's server, i.e., the second translated address."
[0104] In one example, the terminal determines diagnostic suggestions based on the address translation diagnostic results and the overall communication diagnostic results. Then, the terminal combines the communication path information, address translation diagnostic results, overall communication diagnostic results, and diagnostic suggestions to form the network diagnostic result.
[0105] In the aforementioned network diagnostic method, based on the acquired address-translated communication path information, the correctness of the address translation is first diagnosed according to the address translation requirements of the second service provider. Then, for each sub-path after address translation, the reachability of the sub-path is determined based on the communication configuration information of the network devices along that sub-path. Communication diagnostics are performed on the segmented access relationships after address translation, achieving end-to-end communication diagnostics. This enables network diagnostics of the address-translated communication path and the address translation architecture. Furthermore, this network diagnostic method can automatically and quickly perform network diagnostics, replacing manual analysis and diagnosis, reducing repetitive workload, lowering network operation and maintenance pressure, and improving operational efficiency.
[0106] In one embodiment, the network equipment along the route includes access control equipment along the route. For example... Figure 2 As shown, the specific process of determining whether a sub-path meets the communication conditions and obtaining the communication diagnostic result of the sub-path based on the communication configuration information of network devices along the route includes the following steps:
[0107] Step 201: Based on the communication configuration information of the network devices along the route, determine whether the sub-path meets the preset routing communication conditions, and obtain the routing diagnosis result of the sub-path.
[0108] In this embodiment, the communication configuration information includes routing configuration information. Routing communication conditions are used to measure whether a path is reachable. Routing diagnostic results are used to indicate whether a path is reachable.
[0109] The terminal presets routing communication conditions. Then, based on the routing configuration information of network devices along the route, the terminal determines whether the sub-path meets the routing communication conditions. Then, based on the determination result, the terminal generates a routing diagnostic result for the sub-path.
[0110] In one example, if the sub-path meets the routing communication conditions, the routing diagnosis result for the sub-path is "routing correct". If the sub-path does not meet the routing communication conditions, the routing diagnosis result for the sub-path is "routing incorrect".
[0111] Step 202: Based on the communication configuration information of the access control devices along the route, determine whether the sub-path meets the preset access control conditions and obtain the access control diagnosis result of the sub-path.
[0112] In this embodiment, the access control device along the path refers to the access control device through which the data passes. The access control device along the path may include: a firewall along the path and an ACL (Access Control List) device along the path. Communication configuration information includes access control configuration information. Access control conditions are used to measure whether the access control of the path is reachable. It is understood that any conditions capable of measuring the access control reachability of a path can be used in this embodiment, and this application is not limited thereto. Access control diagnostic results are used to indicate whether the access control of the path is reachable.
[0113] The terminal presets access control conditions. Then, based on the access control configuration information of the network devices along the path, the terminal determines whether the sub-path meets the access control conditions. Then, based on the determination result, the terminal generates an access control diagnostic result for the sub-path.
[0114] In one example, if the subpath meets the access control conditions, the access control diagnostic result for the subpath is that access control has been opened. If the subpath does not meet the access control conditions, the access control diagnostic result for the subpath is that access control has not been opened.
[0115] Step 203: Generate the communication diagnostic result of the sub-path based on the routing diagnostic result and the access control diagnostic result of the sub-path.
[0116] In this embodiment of the application, the terminal generates the communication diagnostic result of the sub-path based on the routing diagnostic result and the access control diagnostic result of the sub-path.
[0117] In one example, if the routing diagnostic result of the sub-path indicates that the sub-path is correctly routed, and the access control diagnostic result of the sub-path indicates that the access control of the sub-path is open, then the communication diagnostic identifier of the sub-path is an identifier indicating that communication is reachable. The terminal then uses this communication diagnostic identifier as the communication diagnostic result for the sub-path. If the routing diagnostic result of the sub-path indicates that the sub-path is incorrectly routed, or the access control diagnostic result of the sub-path indicates that the access control of the sub-path is not open, then the communication diagnostic identifier of the sub-path is an identifier indicating that communication is unreachable. The terminal then uses the communication diagnostic identifier, the routing diagnostic result of the sub-path, and the access control diagnostic result of the sub-path to construct the communication diagnostic result for the sub-path.
[0118] In one example, the terminal combines the routing diagnostic results of the sub-path with the access control diagnostic results of the sub-path to form the communication diagnostic results of the sub-path.
[0119] In the aforementioned network diagnostic method, based on the communication configuration information of network devices along the route, it is determined whether the sub-path meets preset routing communication conditions, thus obtaining the routing diagnostic result for the sub-path. Then, based on the communication configuration information of access control devices along the route, it is determined whether the sub-path meets preset access control conditions, thus obtaining the access control diagnostic result for the sub-path. Finally, based on the routing diagnostic result and the access control diagnostic result of the sub-path, the communication diagnostic result for the sub-path is determined. In this way, for each sub-path segment after address translation, its routable reachability and access control are determined separately, enabling comprehensive communication diagnostics of the segmented access relationships after address translation, thus improving the comprehensiveness and accuracy of network diagnostics for address translation architectures.
[0120] In one embodiment, the communication configuration information includes routing configuration information. For example... Figure 3 As shown, the specific process of determining whether a sub-path meets the routing communication conditions and obtaining the routing diagnosis result of the sub-path based on the communication configuration information of network devices along the route includes the following steps:
[0121] Step 301: Based on the sub-path information of the sub-path, query the routing information of the first service provider in the preset routing information of the first service provider to find the order in which the data in the sub-path passes through the network devices along the route of the first service provider.
[0122] In this embodiment, the terminal obtains routing information from a preset first service provider. Then, based on the sub-path information of the sub-path, the terminal queries the routing information of the preset first service provider to determine the order in which data within the sub-path passes through network devices along the route of the first service provider and the order in which the data within the sub-path passes through these network devices. The sub-path information includes the source address and destination address of the sub-path. The sub-path information of the first sub-path includes a first source address and a first translated address. The sub-path information of the second sub-path includes a second translated address and a second source address.
[0123] Step 302: For each network device along the route, based on the routing configuration information of the network device along the route, the routing configuration information of the two adjacent network devices along the route, and the preset routing communication conditions, determine whether the network device along the route is routable with the adjacent network devices, and obtain the routing diagnosis result of the network device along the route.
[0124] In this embodiment, the terminal determines the previous adjacent network device and the next adjacent network device of each adjacent network device based on the order in which the network devices and data pass through the network devices within the first service provider. Then, for each network device, the terminal queries the routing information of that network device to find the next-hop addresses corresponding to the two addresses contained in the sub-path information. The terminal then determines whether the next-hop address corresponding to the address of the first service provider contained in the sub-path information is the address of the interface connecting the network device to the previous network device. Simultaneously, the terminal determines whether the next-hop address corresponding to the address of the second service provider contained in the sub-path information is the address of the interface connecting the network device to the next network device. If the next-hop address corresponding to the address of the first service provider included in the sub-path information is the address of the interface connecting the current network device to the previous network device, and the next-hop address corresponding to the address of the second service provider included in the sub-path information is the address of the interface connecting the current network device to the next network device, then the routing diagnosis result for the current network device is that the route between the current network device and its adjacent network devices is reachable. If the next-hop address corresponding to the address of the first service provider included in the sub-path information is not the address of the interface connecting the current network device to the previous network device, and the next-hop address corresponding to the address of the second service provider included in the sub-path information is not the address of the interface connecting the current network device to the next network device, then the routing diagnosis result for the current network device is that the route between the current network device and its adjacent network devices is unreachable.
[0125] Step 303: Determine the routing diagnosis result of the sub-path based on the routing diagnosis results of each network device along the route.
[0126] In this embodiment of the application, the terminal determines the routing diagnosis result of the sub-path based on the routing diagnosis results of each network device along the route.
[0127] In one example, the terminal uses the routing diagnostic results of each network device along the route to form the routing diagnostic result of that sub-path.
[0128] In one example, the terminal determines the route diagnostic identifier of the sub-path based on the route diagnostic results of each network device along the route. Then, the terminal generates the route diagnostic result for the sub-path based on the route diagnostic identifier of the sub-path.
[0129] In the aforementioned network diagnostic method, for each network device along the route, it is determined whether the route between the network device and its two adjacent network devices is reachable, thus determining the routing diagnostic result of the network device along the route. Then, based on the routing diagnostic results of each network device along the route, the routing diagnostic result of the sub-path is determined, thereby realizing the routing diagnostic for the sub-path. The routing diagnostic for the address-translated communication path is broken down into the routing diagnostic for each sub-path, and then the routing diagnostic for the sub-path is broken down into the routing diagnostic for each network device along the route. When performing routing diagnostics on the address translation architecture, this method not only avoids omissions and improves the accuracy of routing diagnostics on the address translation architecture, but also greatly improves the efficiency of routing diagnostics on the address translation architecture by using distributed computing.
[0130] In one embodiment, the communication configuration information includes access control configuration information. For example... Figure 4 As shown, the specific process of determining whether a sub-path meets preset access control conditions and obtaining the access control diagnostic result of the sub-path based on the communication configuration information of the access control devices along the route includes the following steps:
[0131] Step 401: Based on the sub-path information of the sub-path, query the access control devices along the route of the data in the first service provider in the preset access control device routing rules of the first service provider.
[0132] In this embodiment, the terminal obtains preset routing rules for the access control devices of the first service provider. Then, based on the sub-path information of the sub-path, the terminal queries the preset routing rules for the access control devices of the first service provider to determine which access control devices the data within that sub-path passes through. These access control devices include: along-path firewalls and along-path ACL (Access Control List) devices. Along-path ACL devices include: along-path routers and along-path switches.
[0133] Step 402: For each access control device along the route, perform a consistency check between the source address and destination address of the sub-path and the source address and destination address contained in the access control rules of the access control device along the route, and obtain the consistency check result of the access control device along the route.
[0134] In this embodiment, the access control rule includes a 5-tuple. The 5-tuple includes: source address and destination address. The access control rule includes: firewall policies and ACL rules of ACL devices. The ACL rules include: router ACL rules and switch ACL rules. The consistency check result indicates whether the source address and destination address of the sub-path are consistent with the source address and destination address contained in the access control rules of the access control devices along the path. The check result may also include inconsistent addresses.
[0135] For each access control device along the route, the terminal performs a consistency check between the source address and destination address of the sub-path and the source address and destination address contained in the access control rules of the access control device along the route, and obtains the consistency check result of the access control device along the route.
[0136] Step 403: Determine the access control diagnostic result of the sub-path based on the consistency verification results of each access control device along the route.
[0137] In this embodiment of the application, the terminal determines the access control diagnostic result of the sub-path based on the consistency verification results of each access control device along the path.
[0138] In one example, the terminal uses the consistency verification results of each access control device along the path to form the access control diagnostic result for that sub-path.
[0139] In one example, the terminal determines the access control diagnostic identifier for a sub-path based on the consistency verification results of each access control device along the path. Then, the terminal generates the access control diagnostic result for the sub-path based on this identifier. Specifically, if the consistency verification results of each access control device along the path indicate that the source and destination addresses of the sub-path are consistent with the source and destination addresses contained in the access control rules of the access control devices along the path, then the access control diagnostic identifier for the sub-path is an identifier indicating that access control has been opened. The terminal then uses this access control identifier as the access control result for the sub-path. If the consistency verification results of some access control devices along the path indicate that the source and destination addresses of the sub-path are inconsistent with the source and destination addresses contained in the access control rules of the access control devices along the path, then the access control diagnostic identifier for the sub-path is an identifier indicating that access control has not been opened. The terminal then designates the access control device along the path corresponding to the sub-access control diagnostic result indicating that the source and destination addresses of the sub-path are inconsistent with the source and destination addresses contained in the access control rules of the access control devices along the path as an access control fault device. Then, the terminal uses the access control diagnostic identifier and access control fault device of the sub-path to form the access control diagnostic result of the sub-path.
[0140] In one example, for each access control device along the path, the destination service protocol and destination port of the sub-path are compared with the destination service protocol and destination port contained in the access control rules of that access control device along the path to obtain the consistency comparison result of that access control device. Then, the terminal determines the access control diagnostic result of the sub-path based on the consistency verification results and consistency comparison results of each access control device along the path.
[0141] In the aforementioned network diagnostic method, for each access control device along the path, it is determined whether the access control device along the path has opened access control to the sub-path, and the access control diagnostic result of the access control device along the path is determined. Then, based on the access control diagnostic results of each access control device along the path, the access control diagnostic result of the sub-path is determined, thus realizing the access control diagnostic for the sub-path. The access control diagnostic for the address-translated communication path is broken down into the access control diagnostic for each sub-path, and then the access control diagnostic for the sub-path is broken down into the access control diagnostic for each network device along the path. When performing access control diagnostics on the address translation architecture, this method not only avoids omissions and improves the accuracy of access control diagnostics on the address translation architecture, but also greatly improves the efficiency of access control diagnostics on the address translation architecture by using distributed computing.
[0142] In one embodiment, when the sub-path is the first sub-path, the specific process of determining the routing diagnosis result of the sub-path based on the routing diagnosis results of each network device along the path in step 303 can be as follows: Step 303A, based on the routing diagnosis results of each network device along the path, generate the routing diagnosis result of the sub-path containing the routing diagnosis identifier.
[0143] In this embodiment, the terminal determines the routing diagnosis identifier of the sub-path based on the routing diagnosis results of each along-path network device. Then, the terminal generates a routing diagnosis result for the sub-path, including the routing diagnosis identifier, based on the sub-path's routing diagnosis identifier. Specifically, if the routing diagnosis results of each along-path network device indicate that the route between the along-path network device and its adjacent along-path network devices is reachable, then the routing diagnosis identifier of the sub-path is an identifier indicating that the sub-path's routing is correct. The terminal then uses this sub-path's routing diagnosis identifier as the sub-path's routing diagnosis result. If the sub-routing diagnosis results of some along-path network devices indicate that the route between the along-path network device and its adjacent along-path network devices is unreachable, then the sub-path's routing diagnosis identifier is an identifier indicating that the sub-path's routing is incorrect. The terminal then designates the along-path network device corresponding to the routing diagnosis result indicating that the route between the along-path network device and its adjacent along-path network devices is unreachable as a routing fault device. Finally, the terminal uses the sub-path's routing diagnosis identifier and the routing fault device to constitute the sub-path's routing diagnosis result.
[0144] In the above network diagnostic method, when the sub-path is the first sub-path, the routing diagnostic results of the sub-path containing the routing diagnostic identifier are generated based on the routing diagnostic results of each network device along the path. This makes the generated routing diagnostic results include not only the diagnosis of whether the routing of the sub-path is correct, but also the diagnosis of routing faulty devices, so as to facilitate users to correct the problematic address translation architecture and improve the practicality of routing diagnostics for address translation architecture.
[0145] In one embodiment, such as Figure 5 As shown, when the sub-path is the second sub-path, step 303, which determines the routing diagnosis result of the sub-path based on the routing diagnosis results of each network device along the route, includes the following steps:
[0146] Step 501: Based on the first source address, query the connection requirements corresponding to the first source address from among the connection requirements of the second service provider.
[0147] The connectivity requirements include access type requirements, access device requirements, and access port requirements.
[0148] In this embodiment of the application, each connection requirement of the second service provider is a connection requirement of the second service provider to multiple first service providers.
[0149] Based on the first source address, the terminal queries the connection requirements corresponding to the first source address from among the connection requirements of the second service provider.
[0150] Step 502: Perform a consistency check on the connection information and connection requirements between the data in the second sub-path and the last network device along the first service provider and the second service provider to obtain the consistency check result.
[0151] In this embodiment, the terminal determines, based on the preset routing information of the first service provider and the sub-path information of the second sub-path, that the data within the second sub-path passes through the last along-path network device within the first service provider. Then, the terminal performs a consistency check on the connection information between this last along-path network device and the second service provider, and the connection requirement, to obtain a consistency check result. The connection information includes: access type, access device, and access port. The consistency check result indicates whether the connection information between the last along-path network device and the second service provider, and the connection requirement, are consistent.
[0152] Step 503: Determine the routing diagnosis result of the sub-path based on the routing diagnosis results and consistency test results of each network device along the route.
[0153] In this embodiment, the terminal determines a first routing diagnosis sub-result for the sub-path based on the routing diagnosis results of each along-path network device. Simultaneously, the terminal determines a second routing diagnosis sub-result for the sub-path based on the consistency check results. Then, the terminal uses the first and second routing diagnosis sub-results to determine the routing diagnosis result for the sub-path. Specifically, the process of determining the first routing diagnosis sub-result based on the routing diagnosis results of each along-path network device is similar to step 303A. If the consistency check result indicates that the connection information between the last along-path network device and the second service provider is consistent with the connection requirements, the terminal determines the second routing diagnosis sub-result as a correct route. If the consistency check result indicates that the connection information between the last along-path network device and the second service provider is inconsistent with the connection requirements, the terminal determines the second routing diagnosis sub-result as a routing error. If both the first and second routing diagnosis sub-results are correct, the routing diagnosis identifier for the sub-path is an identifier indicating a correct route. If either the first or second routing diagnosis sub-result is a routing error, the routing diagnosis identifier for the sub-path is an identifier indicating a routing error. Then, the terminal identifies the routing diagnosis of the sub-path and generates the routing diagnosis result for that sub-path.
[0154] In the above network diagnostic method, when the sub-path is the second sub-path, the connection requirements corresponding to the first original address are first determined. Then, it is determined whether the connection information between the data in the second sub-path and the last along-path network device in the first service provider meets the connection requirements of the second service provider. Then, based on the routing diagnostic results and consistency detection results of each along-path network device, the routing diagnostic result of the sub-path is determined. This ensures that the routing diagnostic result of the sub-path includes not only whether the routing within the first service provider is correct, but also whether the routing between the first service provider and the second service provider is correct, further avoiding omissions in network diagnostics and further improving the accuracy of routing diagnostics for address translation architectures.
[0155] In one embodiment, such as Figure 6 As shown, the specific process of obtaining the communication path information after address translation includes the following steps:
[0156] Step 601: Obtain the first original address of the first service provider and the second original address of the second service provider before address translation.
[0157] In this embodiment, the terminal obtains the first original address of the first service provider and the second original address of the second service provider before address translation. Specifically, the terminal can obtain network diagnostic request information input by the user. Then, the terminal determines the first original address of the first service provider and the second original address of the second service provider before address translation based on the network request information. The network diagnostic request information indicates the first and second service providers for which the user wants to perform network diagnostics. The network diagnostic request information includes: the second original address of the second service provider and information related to the original address of the first service provider. The network diagnostic request information may also include: the name information, destination service protocol, and port information of the second service provider. The information related to the original address of the first service provider can be the first original address of the first service provider or the application node information of the first service provider.
[0158] In one example, the origin address information of the first service provider includes the application node information of the first service provider. The terminal queries the application ledger to find the server IP address of the first service provider corresponding to the application node information, thus obtaining the first origin address of the first service provider. The application ledger can include the mapping relationship between application node information and server IP addresses.
[0159] In one example, the origin address information of the first service provider is the first origin address of the first service provider. The terminal obtains the first origin address of the first service provider and the second origin address of the second service provider from the network diagnostic request information.
[0160] Step 602: In the mapping relationship between the original address and the converted address of the second service provider, query the first converted address of the second service provider.
[0161] In this embodiment of the application, the terminal queries the first converted address of the second service provider from the mapping relationship between the original address and the converted address of the second service provider.
[0162] Step 603: Match the sub-access relationship from the first original address to the first translated address with the multiple access relationships included in the address translation rules, and take the successfully matched access relationship as the target access relationship.
[0163] In this embodiment of the application, the terminal matches the sub-access relationship from the first original address to the first translated address with multiple access relationships included in the address translation rule, and takes the successfully matched access relationship as the target access relationship.
[0164] Step 604: In the mapping relationship between the access relationship and the converted address of the first service provider, query the second converted address of the first service provider corresponding to the target access relationship.
[0165] In this embodiment, the terminal presets a mapping relationship between access relationships and the converted addresses of the first service provider. Then, the terminal queries the second converted address of the first service provider corresponding to the target access relationship within the mapping relationship between access relationships and the converted addresses of the first service provider.
[0166] Step 605: The first original address, the first translated address, the second translated address, and the second original address are combined to form the communication path information after address translation.
[0167] In this embodiment, the terminal uses the first original address, the first translated address, the second translated address, and the second original address to construct the address-translated communication path information. Specifically, the terminal uses the first original address and the first translated address to construct the information of a first sub-path. Simultaneously, the terminal uses the second original address and the second translated address to construct the information of a second sub-path. Then, the terminal uses the information of the first sub-path and the information of the second sub-path to construct the address-translated communication path information.
[0168] In the aforementioned network diagnostic method, the first translated address of the second service provider is queried from the mapping relationship between the original address and the translated address of the second service provider. Then, the sub-access relationship from the first original address to the first translated address is matched with multiple access relationships included in the address translation rule. The successfully matched access relationship is taken as the target access relationship. Then, the second translated address of the first service provider corresponding to the target relationship is queried from the mapping relationship between the access relationship and the translated address of the first service provider. The original address and the translated address of the second service provider are statically mapped, while the original address and the translated address of the first service provider are dynamically mapped. The address translation rule adopts a combination of static routing and dynamic routing to balance confidentiality, security, and flexibility.
[0169] In one embodiment, such as Figure 7 As shown, the specific process for determining whether the communication path information meets the address translation requirements of the second service provider and obtaining the address translation diagnostic result includes the following steps:
[0170] Step 701: In the address conversion requirements of the second service provider, query the conversion requirements corresponding to the first original address.
[0171] The conversion requirements include the range of addresses after conversion.
[0172] In this embodiment, the address translation requirements of the second service provider are address translation requirements of the second service provider for multiple first service providers. The terminal queries the translation requirements corresponding to the first original address from among the address translation requirements of the second service provider.
[0173] Step 702: If the second converted address is within the range of converted addresses, then the address conversion diagnosis result is determined to be that the address conversion is correct.
[0174] In this embodiment, the terminal determines whether the second translated address is within the range of translated addresses. If the second translated address is within the range of translated addresses, the terminal determines that the address translation diagnosis result is correct.
[0175] Step 703: If the second translated address is not within the range of translated addresses, then the address translation diagnosis result is determined to be an address translation error.
[0176] In this embodiment of the application, if the second converted address is not within the range of converted addresses, the terminal determines that the address conversion diagnosis result is an address conversion error.
[0177] In the above network diagnostic method, it is determined whether the second translated address is within the address range required by the second service provider for address translation to the first service provider. This enables address translation diagnosis of the address translation architecture, meets the requirements of the second service provider, further avoids omissions in network diagnosis of the address translation architecture, and further improves the comprehensiveness and accuracy of network diagnosis of the address translation architecture.
[0178] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0179] Based on the same inventive concept, this application also provides a network diagnostic apparatus for implementing the network diagnostic method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more network diagnostic apparatus embodiments provided below can be found in the limitations of the network diagnostic method described above, and will not be repeated here.
[0180] In one embodiment, such as Figure 8 As shown, a network diagnostic device 800 is provided, including: an acquisition module 810, an address translation diagnostic module 820, a communication diagnostic module 830, and a network diagnostic module 840, wherein:
[0181] The acquisition module 810 is used to acquire communication path information after address translation; the communication path information includes information on the first sub-path from the first original address of the first service provider to the first translated address of the second service provider, and information on the second sub-path from the second translated address of the first service provider to the second original address of the second service provider;
[0182] Address translation diagnostic module 820 is used to determine the address translation diagnostic result corresponding to the communication path information based on the address translation requirements of the second service provider;
[0183] The communication diagnostic module 830 is used to, when the address translation diagnostic result indicates that the address translation is correct, acquire the communication configuration information of the network devices along the sub-path for each sub-path segment, and determine whether the sub-path meets the communication conditions based on the communication configuration information of the network devices along the sub-path, and obtain the communication diagnostic result of the sub-path.
[0184] The network diagnostic module 840 is used to generate network diagnostic results based on the communication path information, the address translation diagnostic results, and the communication diagnostic results of each sub-path.
[0185] Optionally, the network equipment along the route includes access control equipment along the route; the communication diagnostic module 830 is specifically used for:
[0186] Based on the communication configuration information of the network devices along the route, determine whether the sub-path meets the preset routing communication conditions, and obtain the routing diagnosis result of the sub-path;
[0187] Based on the communication configuration information of the access control devices along the route, determine whether the sub-path meets the preset access control conditions, and obtain the access control diagnostic result of the sub-path;
[0188] Based on the routing diagnostic results and access control diagnostic results of the sub-path, a communication diagnostic result for the sub-path is generated.
[0189] Optionally, the communication configuration information includes routing configuration information; the communication diagnostic module 830 is specifically used for:
[0190] Based on the sub-path information of the sub-path, in the preset routing information of the first service provider, query the order in which the data in the sub-path passes through the network devices along the route of the first service provider and the order in which the data in the sub-path passes through the network devices along the route of the first service provider.
[0191] For each network device along the route, based on the routing configuration information of the network device along the route, the routing configuration information of the two adjacent network devices along the route, and the preset routing communication conditions, it is determined whether the network device along the route is routable to the adjacent network devices, and the routing diagnosis result of the network device along the route is obtained.
[0192] The routing diagnosis results of the sub-paths are determined based on the routing diagnosis results of each of the network devices along the route.
[0193] Optionally, the communication configuration information includes access control configuration information; the communication diagnostic module 830 is specifically used for:
[0194] Based on the sub-path information of the sub-path, in the preset routing rules of the access control devices of the first service provider, query the access control devices along the route of the data in the sub-path that pass through the first service provider.
[0195] For each access control device along the route, the source address and destination address of the sub-path are checked for consistency with the source address and destination address contained in the access control rules of the access control device along the route, and the consistency check result of the access control device along the route is obtained.
[0196] Based on the consistency verification results of each access control device along the route, the access control diagnostic results of the sub-path are determined.
[0197] Optionally, when the sub-path is the first sub-path, the communication diagnostic module 830 is specifically used for:
[0198] Based on the routing diagnostic results of each of the network devices along the route, a routing diagnostic result for the sub-path containing a routing diagnostic identifier is generated.
[0199] Optionally, when the sub-path is the second sub-path, the communication diagnostic module 830 is specifically used for:
[0200] Based on the first original address, query the connection requirements corresponding to the first original address from among the connection requirements of the second service provider; the connection requirements include access type requirements, access device requirements, and access port requirements;
[0201] The data in the second sub-path is subjected to a consistency check between the connection information of the second service provider and the connection requirements corresponding to the first original address, and the connection information of the last along-path network device in the first service provider and the second service provider, to obtain the consistency check result.
[0202] The routing diagnosis result of the sub-path is determined based on the routing diagnosis results of each network device along the route and the consistency detection results.
[0203] Optionally, the acquisition module 810 is specifically used for:
[0204] Obtain the first original address of the first service provider and the second original address of the second service provider before address translation;
[0205] In the mapping relationship between the original address and the converted address of the second service provider, query the first converted address of the second service provider;
[0206] The sub-access relationship from the first original address to the first converted address is matched with multiple access relationships included in the preset address conversion rules, and the successfully matched access relationship is taken as the target access relationship;
[0207] In the mapping relationship between the access relationship and the converted address of the first service provider, query the second converted address of the first service provider corresponding to the target access relationship;
[0208] The first original address, the first converted address, the second converted address, and the second original address constitute the communication path information after address conversion.
[0209] Optionally, the address translation diagnostic module 820 is specifically used for:
[0210] In the address conversion requirements of the second service provider, query the address conversion requirements corresponding to the first original address; the address conversion requirements include the range of addresses after conversion;
[0211] If the second converted address is within the range of the converted address, then the address conversion diagnosis result corresponding to the communication path information is determined to be a correct address conversion;
[0212] If the second converted address is not within the range of the converted addresses, then the address conversion diagnosis result corresponding to the communication path information is determined to be an address conversion error.
[0213] Each module in the aforementioned network diagnostic device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0214] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 9As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a network diagnostic method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0215] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0216] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0217] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0218] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0219] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0220] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0221] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0222] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A network diagnostic method, characterized in that, The method includes: Obtain the communication path information after address translation; the communication path information includes information on the first sub-path from the first original address of the first service provider to the first translated address of the second service provider, and information on the second sub-path from the second translated address of the first service provider to the second original address of the second service provider; Based on the address translation requirements of the second service provider, determine the address translation diagnostic result corresponding to the communication path information; If the address translation diagnosis result indicates that the address translation is correct, for each sub-path, the communication configuration information of the network devices along the sub-path is obtained, and based on the communication configuration information of the network devices along the sub-path, it is determined whether the sub-path meets the communication conditions, and the communication diagnosis result of the sub-path is obtained. Based on the communication path information, the address translation diagnostic results, and the communication diagnostic results of each sub-path, a network diagnostic result is generated; The determination of the address translation diagnostic result corresponding to the communication path information based on the address translation requirements of the second service provider includes: In the address conversion requirements of the second service provider, query the address conversion requirements corresponding to the first original address; the address conversion requirements include the range of addresses after conversion; If the second converted address is within the range of the converted address, then the address conversion diagnosis result corresponding to the communication path information is determined to be a correct address conversion; If the second converted address is not within the range of the converted addresses, then the address conversion diagnosis result corresponding to the communication path information is determined to be an address conversion error.
2. The method according to claim 1, characterized in that, The network devices along the route include network access control devices along the route; the step of determining whether the sub-path meets the communication conditions based on the communication configuration information of the network devices along the route, and obtaining the communication diagnostic result of the sub-path, includes: Based on the communication configuration information of the network devices along the route, determine whether the sub-path meets the preset routing communication conditions, and obtain the routing diagnosis result of the sub-path; Based on the communication configuration information of the access control devices along the route, determine whether the sub-path meets the preset access control conditions, and obtain the access control diagnostic result of the sub-path; Based on the routing diagnostic results and access control diagnostic results of the sub-path, a communication diagnostic result for the sub-path is generated.
3. The method according to claim 2, characterized in that, The communication configuration information includes routing configuration information; the step of determining whether the sub-path meets the preset routing communication conditions based on the communication configuration information of the network devices along the route, and obtaining the routing diagnosis result of the sub-path, includes: Based on the sub-path information of the sub-path, in the preset routing information of the first service provider, query the order in which the data in the sub-path passes through the network devices along the route of the first service provider and the order in which the data in the sub-path passes through the network devices along the route of the first service provider. For each network device along the route, based on the routing configuration information of the network device along the route, the routing configuration information of the two adjacent network devices along the route, and the preset routing communication conditions, it is determined whether the network device along the route is routable to the adjacent network devices, and the routing diagnosis result of the network device along the route is obtained. The routing diagnosis results of the sub-path are determined based on the routing diagnosis results of each of the network devices along the route.
4. The method according to claim 2, characterized in that, The communication configuration information includes access control configuration information; the step of determining whether the sub-path meets the preset access control conditions based on the communication configuration information of the access control devices along the route, and obtaining the access control diagnostic result of the sub-path, includes: Based on the sub-path information of the sub-path, in the preset routing rules of the access control devices of the first service provider, query the access control devices along the way of the data in the sub-path within the first service provider. For each access control device along the route, the source address and destination address of the sub-path are checked for consistency with the source address and destination address contained in the access control rules of the access control device along the route, and the consistency check result of the access control device along the route is obtained. Based on the consistency verification results of each access control device along the route, the access control diagnostic results of the sub-path are determined.
5. The method according to claim 3, characterized in that, When the sub-path is the first sub-path, determining the routing diagnosis result of the sub-path based on the routing diagnosis results of each of the network devices along the route includes: Based on the routing diagnostic results of each of the network devices along the route, a routing diagnostic result for the sub-path containing a routing diagnostic identifier is generated.
6. The method according to claim 3, characterized in that, When the sub-path is the second sub-path, determining the routing diagnosis result of the sub-path based on the routing diagnosis results of each of the network devices along the route includes: Based on the first original address, query the connection requirements corresponding to the first original address from among the connection requirements of the second service provider; the connection requirements include access type requirements, access device requirements, and access port requirements; The data in the second sub-path is subjected to a consistency check between the connection information of the second service provider and the connection requirements corresponding to the first original address, and the connection information of the last along-path network device in the first service provider and the second service provider, to obtain the consistency check result. The routing diagnosis result of the sub-path is determined based on the routing diagnosis results of each network device along the route and the consistency detection results.
7. The method according to claim 1, characterized in that, The acquisition of the communication path information after address translation includes: Obtain the first original address of the first service provider and the second original address of the second service provider before address translation; In the mapping relationship between the original address and the converted address of the second service provider, query the first converted address of the second service provider; The sub-access relationship from the first original address to the first converted address is matched with multiple access relationships included in the preset address conversion rules, and the successfully matched access relationship is taken as the target access relationship; In the mapping relationship between the access relationship and the converted address of the first service provider, query the second converted address of the first service provider corresponding to the target access relationship; The first original address, the first converted address, the second converted address, and the second original address constitute the communication path information after address conversion.
8. A network diagnostic device, characterized in that, The device includes: The acquisition module is used to acquire communication path information after address translation; the communication path information includes information on the first sub-path from the first original address of the first service provider to the first translated address of the second service provider, and information on the second sub-path from the second translated address of the first service provider to the second original address of the second service provider; The address translation diagnostic module is used to determine the address translation diagnostic result corresponding to the communication path information based on the address translation requirements of the second service provider. The communication diagnostic module is used to, when the address translation diagnostic result indicates that the address translation is correct, acquire the communication configuration information of the network devices along the sub-path for each sub-path segment, and determine whether the sub-path meets the communication conditions based on the communication configuration information of the network devices along the sub-path, and obtain the communication diagnostic result of the sub-path. The network diagnostic module is used to generate network diagnostic results based on the communication path information, the address translation diagnostic results, and the communication diagnostic results of each sub-path. The address translation diagnostic module is specifically used to query the address translation requirement corresponding to the first original address among the address translation requirements of the second service provider; the address translation requirement includes a range of translated addresses; if the second translated address is within the range of translated addresses, the address translation diagnostic result corresponding to the communication path information is determined to be correct; if the second translated address is not within the range of translated addresses, the address translation diagnostic result corresponding to the communication path information is determined to be incorrect.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method and device for determining strategy path
CN110430130A
Network fault diagnosis method and device
CN115225462A