A flow path detection method, device, apparatus, medium and product
By querying the forwarding control information table and link layer discovery protocol in the Underlay network, and combining standardized check items, the problem of path detection between devices from different manufacturers is solved, achieving fast and accurate traffic path detection, which is suitable for complex cloud network environments.
Patent Information
- Application Number
- CN202410986661.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2044-07-23
AI Technical Summary
In the Underlay network environment, existing coloring and route matching technologies are difficult to apply and cannot effectively perform packet analysis and log collection, especially due to inconsistent QoS technology support levels among devices from different manufacturers.
By obtaining the first network element in the traffic path to be detected, querying the forwarding control information table based on the destination address, device type and model, obtaining the next hop information and traffic outgoing interface, and determining the second network element in combination with the link layer discovery protocol, adaptive analysis is performed using standardized check items to mask device differences, thereby achieving fast and automatic end-to-end path detection.
It enables rapid and accurate path detection among devices from various manufacturers and models, ensuring the real-time performance and accuracy of data without affecting packet forwarding performance. It is universal and efficient, and supports physical and virtual network elements from mainstream manufacturers.
Smart Images

Figure CN118869589B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of cloud computing, and particularly refers to a method and device for detecting a traffic path, equipment, a medium and a product. BACKGROUND
[0002] In the prior art, a public cloud service has a large scale, a large number of tenants, and a complex networking architecture. Network problems such as network disconnection, time delay, and packet loss frequently occur. The industry's fault locating method is to perform end-to-end step-by-step troubleshooting on service traffic. First, the path of the traffic is identified, and each hop network element and device on the path is analyzed. The current end-to-end path identification methods mainly include route matching and packet coloring. For an Underlay network environment, the existing coloring technology and route matching technology are difficult to apply. The network often contains devices of various manufacturers and various models, and different devices have different levels of support for QoS (Quality of Service) technology, which makes it impossible to perform packet analysis and log collection. SUMMARY
[0003] The purpose of the present application is to provide a method and device for detecting a traffic path, equipment, a medium and a product, which are used to solve the problem that, for an Underlay network environment, the existing coloring technology and route matching technology are difficult to apply. The network often contains devices of various manufacturers and various models, and different devices have different levels of support for QoS technology, which makes it impossible to perform packet analysis and log collection.
[0004] To achieve the above purpose, an embodiment of the present application provides a method for detecting a traffic path, which comprises the following steps.
[0005] Obtaining a first network element in a to-be-detected traffic path;
[0006] According to the destination address of the to-be-detected traffic path, the device type and model of the first network element, querying a corresponding forwarding control information table on the first network element to obtain next-hop information of the to-be-detected traffic path and a traffic out interface of the first network element;
[0007] According to the next-hop information and the traffic out interface, determining a second network element in the to-be-detected traffic path.
[0008] Optionally, the method further comprises the following steps.
[0009] Checking the first network element by using standardized check items to obtain echo parameters;
[0010] In the case that the echo parameters are different from preset standard echo parameters, obtaining fault information of the first network element.
[0011] Optionally, the detection method, wherein the step of querying the corresponding forwarding control information table on the first network element based on the destination address of the traffic path to be detected, the device type and model of the first network element, and obtaining the next-hop information of the traffic path to be detected and the traffic outgoing interface of the first network element, includes:
[0012] Perform an interface binding virtual private network instance check on the first network element to confirm whether the traffic inflow interface is bound to a virtual private network instance;
[0013] When the traffic ingress interface is bound to a virtual private network instance, the routing table in the forwarding control information table is queried according to the destination address to perform a detailed route check of the destination address virtual private network and obtain the next hop information and the traffic egress interface;
[0014] If the traffic ingress interface is not bound to a virtual private network instance, the routing table in the forwarding control information table is queried according to the destination address to perform a global detailed route check for the destination address, and the next hop information and the traffic egress interface are obtained.
[0015] Optionally, in the detection method, when the device type of the first network element is a firewall, before querying the corresponding forwarding control information table on the first network element according to the destination address of the traffic path to be detected, the device type and model of the first network element, and obtaining the next-hop information of the traffic path to be detected and the traffic outgoing interface of the first network element, the method further includes:
[0016] Perform a destination address network address translation policy check on the first network element, and if the destination address has been translated, obtain the updated destination address;
[0017] The updated destination address is determined as the destination address.
[0018] Optionally, in the detection method, when the device type of the first network element is a Layer 2 communication function switch, the step of querying the corresponding forwarding control information table on the first network element according to the destination address of the traffic path to be detected, the device type and model of the first network element, and obtaining the next-hop information of the traffic path to be detected and the traffic outgoing interface of the first network element further includes:
[0019] Obtain the media access control address;
[0020] Based on the media access control address, the media access control MAC table in the forwarding control information table is queried to obtain the next hop information and the MAC outgoing interface; wherein, the traffic outgoing interface includes the MAC outgoing interface.
[0021] Optionally, in the detection method, determining the second network element in the traffic path to be detected based on the next-hop information and the traffic outgoing interface includes:
[0022] Based on the next-hop information and the traffic outgoing interface, the second network element is determined through the link layer discovery protocol.
[0023] Optionally, in the detection method, when the device type of the first network element is a router, the step of determining the second network element in the traffic path to be detected based on the next-hop information and the traffic outgoing interface further includes:
[0024] Based on the traffic outgoing interface, obtain the physical outgoing interface;
[0025] Based on the physical output interface and the next-hop information, the second network element is determined through the link layer discovery protocol.
[0026] Optionally, the detection method, wherein, when the device type of the first network element is a Layer 3 communication function switch, determining the second network element in the traffic path to be detected based on the next-hop information and the traffic outgoing interface, further includes:
[0027] When the traffic outgoing interface exists in a virtual local area network, the address resolution protocol ARP table in the forwarding control information table is queried according to the next hop information to obtain the medium access control address;
[0028] The physical outgoing interface is obtained by querying the Media Access Control (MAC) table in the Forwarding Control Information Table based on the Media Access Control (MAC) address.
[0029] Based on the physical output interface and the next-hop information, the second network element is determined through the link layer discovery protocol.
[0030] Optionally, in the detection method, the forwarding control information table includes one or more of the following:
[0031] Strategy table;
[0032] Routing table;
[0033] Address Resolution Protocol (ARP) table;
[0034] Media Access Control (MAC) table.
[0035] To achieve the above objectives, embodiments of the present invention provide a traffic path detection device, comprising:
[0036] The first acquisition module acquires the first network element in the traffic path to be detected;
[0037] The second acquisition module is used to query the corresponding forwarding control information table on the first network element according to the destination address of the traffic path to be detected, the device type and model of the first network element, and to obtain the next hop information of the traffic path to be detected and the traffic outgoing interface of the first network element.
[0038] The first determining module is used to determine the second network element in the traffic path to be detected based on the next-hop information and the traffic outgoing interface.
[0039] To achieve the above objectives, embodiments of the present invention provide a network device, including: a processor, a memory, and a program or instructions stored in the memory and executable on the processor; wherein, when the processor executes the program or instructions, it implements the traffic path detection method as described above.
[0040] To achieve the above objectives, embodiments of the present invention provide a readable storage medium having a program or instructions stored thereon, wherein the program or instructions, when executed by a processor, implement the steps in the traffic path detection method described above.
[0041] To achieve the above objectives, embodiments of the present invention provide a computer program product, which includes computer instructions that, when executed by a processor, implement the steps of the traffic path detection method as described above.
[0042] The beneficial effects of the above-described technical solution of the present invention are as follows:
[0043] In this embodiment of the invention, the forwarding control information table of the first network element in the traffic path to be detected is queried according to the destination address of the traffic path to be detected to obtain the next hop information and the traffic outgoing interface. Furthermore, the second network element in the traffic path to be detected is determined. Through fast and automatic end-to-end traffic path detection that is compatible with various manufacturers and models of equipment and has no environmental dependence, the real-time performance and accuracy of the data are guaranteed, and the packet forwarding performance is not affected. Attached Figure Description
[0044] Figure 1 This is a schematic diagram of the traffic path detection method according to an embodiment of the present invention;
[0045] Figure 2 This is a table of standardized check items for the traffic path detection method described in the embodiments of the present invention;
[0046] Figure 3 This is the atomic service interface definition table for the traffic path detection method described in this embodiment of the invention;
[0047] Figure 4 This is one of the flowcharts for the traffic path detection method described in the embodiments of the present invention;
[0048] Figure 5 This is a second flowchart of the traffic path detection method described in an embodiment of the present invention;
[0049] Figure 6 This is the third flowchart of the traffic path detection method described in the embodiments of the present invention;
[0050] Figure 7 This is the fourth flowchart of the traffic path detection method described in the embodiments of the present invention;
[0051] Figure 8 This is the fifth flowchart of the traffic path detection method described in the embodiments of the present invention;
[0052] Figure 9 This is a schematic diagram of the flow path detection device according to an embodiment of the present invention. Detailed Implementation
[0053] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0054] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of the invention. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.
[0055] In various embodiments of the present invention, it should be understood that the sequence number of each process described below does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0056] In addition, the terms "system" and "network" are often used interchangeably in this article.
[0057] In the embodiments provided in this application, it should be understood that "B corresponding to A" means that B is associated with A, and B can be determined based on A. However, it should also be understood that determining B based on A does not mean determining B solely based on A; B can also be determined based on A and / or other information.
[0058] For ease of understanding, the following describes some aspects of the embodiments of the present invention:
[0059] like Figure 1 As shown, an embodiment of the present invention provides a method for detecting traffic paths, comprising:
[0060] S10, Obtain the first network element in the traffic path to be detected;
[0061] It should be noted that, in a real traffic forwarding environment, this embodiment of the invention checks each network element in the traffic path to be detected point-to-point, starting from the first network element.
[0062] S20, based on the destination address of the traffic path to be detected, the device type and model of the first network element, query the corresponding forwarding control information table on the first network element to obtain the next hop information of the traffic path to be detected and the traffic outgoing interface of the first network element;
[0063] It should be noted that, starting from the given source address, the directly connected outgoing interface and the next-hop address are dynamically and recursively searched in real time based on the forwarding control information table of each hop network element, that is, the next-hop information and the traffic outgoing interface of the first network element.
[0064] S30, determine the second network element in the traffic path to be detected based on the next-hop information and the traffic outgoing interface;
[0065] It should be noted that the peer device of the outgoing interface is identified by the LLDP protocol at the link layer. The outgoing interface is the traffic outgoing interface, which can be the routing outgoing interface, the physical outgoing interface obtained from the routing outgoing interface, the MAC outgoing interface, or the physical outgoing interface obtained from the MAC outgoing interface, etc. The peer device is the second network element. No further probing is needed until the second network element is the device where the destination address is located.
[0066] In this embodiment, the forwarding control information table of the first network element in the traffic path to be detected is queried according to the destination address of the traffic path to be detected to obtain the next hop information and the traffic outgoing interface. Furthermore, the second network element in the traffic path to be detected is determined. Through fast and automatic end-to-end traffic path detection that is compatible with various manufacturers and models of equipment and has no environmental dependence, the real-time performance and accuracy of the data are guaranteed, and the packet forwarding performance is not affected.
[0067] Optionally, the detection method further includes:
[0068] The first network element is inspected using standardized inspection items, and the echo parameters are obtained;
[0069] It should be noted that, as Figure 2As shown, this embodiment of the invention fully considers the characteristics of network devices from different manufacturers and models, and designs and develops a lightweight tool based on real-time command-line query and real-time adaptive analysis based on regular expressions. It is compatible with most mainstream manufacturers, uses the standardized inspection items to inspect the first network element, inputs standard input parameters, and obtains the echo parameters.
[0070] If the displayed parameters differ from the preset standard displayed parameters, the fault information of the first network element is obtained;
[0071] It should be noted that, as Figure 2 As shown, the preset standard feedback parameters are the criteria for evaluating whether the first network element has a fault. By comparing the feedback parameters with the preset standard feedback parameters, a standardized check of the first network element is achieved. Since multiple network elements in the traffic path to be detected generally belong to different vendors, it is necessary to encapsulate a standardized atomic service interface for each standardized check item, such as... Figure 3 As shown, it supports defining regular expressions to filter the command-line command execution results text from different manufacturers and models to extract the echo parameters. During the probing process, in addition to the necessary probing steps, configuration, performance, session, and log checks can be added for each hop network element and device as needed. For example, Figure 3 The destination address session check and network element log check are not necessary probing steps and do not involve traffic path detection, thus enabling rapid parallel fault location while path detection is being performed. This invention fully considers the significant differences in working principles, system environments, configuration modes, and operation commands among different models of network devices (network elements), and implements a universal network element standard probing tool based on regular expression adaptive analysis that masks device differences. It provides good support for mainstream manufacturers' equipment, physical network elements, and virtual network elements, and has universal applicability for widespread application.
[0072] Optionally, in the detection method, step S20 includes:
[0073] Perform an interface binding virtual private network instance check on the first network element to confirm whether the traffic inflow interface is bound to a virtual private network instance;
[0074] It should be noted that, as Figure 2 As shown, the interface binding virtual private network instance check is performed on the first network element. By inputting the interface name, if the echo parameter is the virtual private network instance name, it is proven that the first network element has passed the interface binding virtual private network instance check.
[0075] When the traffic ingress interface is bound to a virtual private network instance, the routing table in the forwarding control information table is queried according to the destination address to perform a detailed route check of the destination address virtual private network and obtain the next hop information and the traffic egress interface;
[0076] It should be noted that, assuming the traffic ingress interface is bound to a virtual private network instance, then... Figure 2 The destination address virtual private network (VPN) detailed route check involves inputting the destination address and the echo parameter from the previous standardized check item, i.e., the VPN instance name, to obtain the next-hop information and the traffic outgoing interface. Figure 2 The next hop and output interface name in the corresponding preset standard echo parameters.
[0077] If the traffic ingress interface is not bound to a virtual private network instance, the routing table in the forwarding control information table is queried according to the destination address to perform a global detailed route check for the destination address and obtain the next hop information and the traffic egress interface.
[0078] It should be noted that this is done only after confirming that the traffic ingress interface is not bound to a virtual private network instance. Figure 2 The destination address global detailed route check is performed by inputting the destination address to obtain the next-hop information and the traffic outgoing interface. Figure 2 The next hop and output interface name in the corresponding preset standard echo parameters.
[0079] Optionally, in the detection method, if the device type of the first network element is a firewall, before step S20, the method further includes:
[0080] Perform a destination address network address translation policy check on the first network element, and if the destination address has been translated, obtain the updated destination address;
[0081] The updated destination address is determined as the destination address.
[0082] It should be noted that, Figure 5 For the detection process of traffic paths in the first network element where the device type is a firewall, the destination address network address translation policy is first checked. If the destination address has not changed, the original destination address remains unchanged. If the destination address has changed, the updated destination address is determined as the destination address, that is, the destination address is replaced with an internal address.
[0083] Optionally, in the detection method, when the device type of the first network element is a Layer 2 communication function switch, step S20 further includes:
[0084] Obtain the media access control address;
[0085] Based on the media access control address, query the media access control MAC table in the forwarding control information table to obtain the next hop information and MAC outgoing interface.
[0086] In this embodiment, such as Figure 7 As shown, when the device type of the first network element is a Layer 2 communication function switch, the starting point of the traffic path to be probed is the Media Access Control (MAC) address. The next-hop information and the MAC outgoing interface are obtained by querying the Media Access Control (MAC) table in the forwarding control information table. Figure 2 The standardized check items for the destination media access control details table check are input. The destination media access control address (i.e., the destination address) is entered to obtain the outgoing interface name. Subsequently, the interface information is obtained by checking the corresponding check items in the Layer 2 aggregation group details status check and the physical port details status check through the outgoing interface name.
[0087] Optionally, in the detection method, step S30 includes:
[0088] Based on the next-hop information and the traffic outgoing interface, the second network element is determined through the link layer discovery protocol.
[0089] In this embodiment, the next-hop information and the traffic outgoing interface are used. The traffic outgoing interface may be the MAC outgoing interface or the physical outgoing interface obtained from the MAC outgoing interface. The information of the outgoing interface is queried. The peer device name and peer port name are obtained through the link layer discovery protocol and the outgoing interface information, thus determining the second network element.
[0090] Optionally, in the detection method, when the device type of the first network element is a router, step S30 further includes:
[0091] Based on the traffic outgoing interface, obtain the physical outgoing interface;
[0092] Based on the physical output interface and the next-hop information, the second network element is determined through the link layer discovery protocol.
[0093] In this embodiment, such as Figure 4 As shown, when the device type of the first network element is a router, the physical outgoing interface is obtained according to the traffic outgoing interface. Through the link layer discovery protocol, the peer device name and peer port name are obtained according to the physical outgoing interface and the next hop information, thus determining the second network element.
[0094] It should be noted that, as Figure 4As shown, when the device type of the first network element is a router, it is necessary to first determine whether it is the first hop network element after obtaining the destination address. If it is, a global detailed route check of the destination address is performed directly; if not, the interface where the next hop address of the previous hop network element is located is queried and then an interface binding virtual private network instance check is performed.
[0095] Optionally, the detection method, wherein when the device type of the first network element is a Layer 3 communication function switch, further includes step S30:
[0096] When the traffic outgoing interface exists in a virtual local area network, the address resolution protocol ARP table in the forwarding control information table is queried according to the next hop information to obtain the medium access control address;
[0097] The physical outgoing interface is obtained by querying the Media Access Control (MAC) table in the Forwarding Control Information Table based on the Media Access Control (MAC) address.
[0098] Based on the physical output interface and the next-hop information, the second network element is determined through the link layer discovery protocol.
[0099] In this embodiment, such as Figure 6 As shown, when the device type of the first network element is a Layer 3 communication function switch, after obtaining the traffic outgoing interface, it is determined whether the traffic outgoing interface is a VLAN interface or an aggregation port. If the traffic outgoing interface is an aggregation port, the physical outgoing interface is obtained; if the traffic outgoing interface exists in a VLAN, the Address Resolution Protocol (ARP) table in the forwarding control information table is queried according to the next-hop information, i.e., a destination address resolution protocol detail table check is performed to obtain the Media Access Control (MAC) address, and the MAC address is then queried according to the MAC address in the forwarding control information table to obtain the physical outgoing interface. Next, based on the physical outgoing interface and the next-hop information, the peer device name and peer port name are obtained through the link layer discovery protocol, i.e., the second network element is determined.
[0100] Optionally, in the detection method, the forwarding control information table includes one or more of the following:
[0101] Strategy table;
[0102] Routing table;
[0103] Address Resolution Protocol (ARP) table;
[0104] Media Access Control (MAC) table.
[0105] In this embodiment, Figure 8This invention provides a flowchart example of a traffic path detection method based on the arrangement order of network elements of different device types in an existing traffic path. After the previous hop network element completes the detection, the method determines whether the current network element is a Layer 2 device based on the obtained address of the current network element, and obtains a first determination result.
[0106] If the first judgment result is negative, obtain the destination address and ingress interface information, perform a destination address network address translation policy check, obtain the internal address, determine whether the internal address is empty, that is, determine whether the destination address has not been translated, and obtain the second judgment result.
[0107] If the second judgment result is yes, the original destination address remains unchanged. If the second judgment result is no, the updated destination address is determined as the original destination address, that is, the destination address is replaced with the internal address. Next, an interface binding virtual private network instance check is performed to determine whether the virtual private network instance name is empty, that is, to determine whether the traffic inflow interface is not bound to a virtual private network instance, and a third judgment result is obtained.
[0108] If the third judgment result is yes, obtain the destination address and perform a global detailed route check for the destination address; if the third judgment result is no, obtain the virtual private network instance name and destination address, perform a detailed route check for the virtual private network at the destination address, query the detailed table entry with the longest mask to determine whether the protocol is a directly connected routing protocol, and obtain the fourth judgment result.
[0109] If the fourth judgment result is negative, perform a global detailed route check for the destination address again based on the next-hop information, or perform a detailed route check for the destination virtual private network based on the next-hop information and the virtual private network instance name; if the fourth judgment result is positive, obtain the outgoing interface of the route. Determine if the virtual local area network address is empty, and obtain the fifth judgment result.
[0110] If the fifth judgment result is negative, obtain the last recursive address, perform a destination address resolution protocol detail table check, and obtain the destination media access control address and address resolution protocol output interface. If the first judgment result is positive, obtain the destination media access control address, and based on the destination media access control address and address resolution protocol output interface, perform a destination media access control detail table check to determine if the media access control output interface is empty, and obtain the sixth judgment result.
[0111] If the sixth judgment result is yes, obtain the Address Resolution Protocol (ARP) outgoing interface; if the sixth judgment result is no, obtain the Media Access Control (MAC) outgoing interface. Based on the ARP or MAC outgoing interface, and if the fifth judgment result is yes, based on the routing outgoing interface, determine whether the Layer 3 aggregation group number is empty, and obtain the seventh judgment result.
[0112] If the result of the seventh judgment is negative, obtain the third-level aggregation group number and perform a third-level aggregation group member status check; if the result of the seventh judgment is positive, obtain the outgoing interface, determine whether the second-level aggregation group number is empty, and obtain the result of the eighth judgment.
[0113] If the eighth judgment result is yes, the output interface is output; if the eighth judgment result is no, the Layer 2 aggregation group number is output, and a Layer 2 aggregation group member status check is performed. The result is the same as the Layer 3 aggregation group member status check, and the member port is output. Next, a physical port link layer discovery protocol detailed neighbor check is performed to obtain one or more of the peer device address, peer device ingress interface, destination address, and destination media access control address, thus determining the second network element for next-hop network element probing.
[0114] This invention provides a lightweight cloud network Underlay traffic path adaptive detection method that addresses the issues of accuracy, timeliness, and reasonable resource consumption in end-to-end troubleshooting under network latency and packet loss scenarios, as well as the significant differences between different network devices in terms of working principles, system environment, configuration modes, and operation commands. It realizes a universal network element standard detection tool based on regular expression adaptive analysis that masks device differences. By adaptively checking each hop network element in a point-to-point manner in real time, irrelevant network elements are accurately excluded, ensuring the accuracy and timeliness of data, narrowing the scope of data analysis, and enabling rapid path detection and parallel location within minutes when a fault occurs. No additional data collection, aggregation, or storage is required, and the detection process consumes virtually no network bandwidth before, during, or after the detection, causing no network congestion and having no impact on normal packet forwarding performance. No intrusive packet marking or analysis is required, making it suitable for end-to-end tracing of Underlay traffic in any cloud network architecture, achieving complete business-insensitive tracking from the start to the end of the detection process. The introduction of regular expression-based data extraction and logical analysis methods masks the differences in network device manufacturers and models, providing good support for physical and virtual network elements from mainstream manufacturers, and possessing universal applicability for widespread application.
[0115] like Figure 9 As shown, to achieve the above objectives, embodiments of the present invention provide a traffic path detection device, comprising:
[0116] The first acquisition module 901 acquires the first network element in the traffic path to be detected;
[0117] The second acquisition module 902 is used to query the corresponding forwarding control information table on the first network element according to the destination address of the traffic path to be detected, the device type and model of the first network element, and to obtain the next hop information of the traffic path to be detected and the traffic outgoing interface of the first network element.
[0118] The first determining module 903 is used to determine the second network element in the traffic path to be detected based on the next hop information and the traffic outgoing interface.
[0119] Optionally, the detection device further includes:
[0120] The third acquisition module is used to inspect the first network element using standardized inspection items and acquire the echo parameters;
[0121] The fourth acquisition module is used to acquire the fault information of the first network element when the echo parameters are different from the preset standard echo parameters.
[0122] Optionally, in the detection device, the second acquisition module 902 includes:
[0123] The first processing unit is used to check the interface binding virtual private network instance of the first network element to confirm whether the traffic inlet interface is bound to a virtual private network instance.
[0124] The first acquisition unit is used to, when the traffic ingress interface is bound to a virtual private network instance, query the routing table in the forwarding control information table according to the destination address, perform a detailed route check of the destination address virtual private network, and obtain the next hop information and the traffic egress interface.
[0125] The second acquisition unit is used to query the routing table in the forwarding control information table according to the destination address, perform a global detailed route check of the destination address, and obtain the next hop information and the traffic outgoing interface when the traffic inbound interface is not bound to a virtual private network instance.
[0126] Optionally, the detection device, wherein when the device type of the first network element is a firewall, further includes:
[0127] The fifth acquisition module is used to perform a destination address network address translation policy check on the first network element, and to acquire the updated destination address if the destination address has been translated.
[0128] The second determining module is used to determine the updated destination address as the destination address.
[0129] Optionally, in the detection device, when the device type of the first network element is a Layer 2 communication function switch, the second acquisition module 902 further includes:
[0130] The third acquisition unit is used to acquire the media access control address;
[0131] The fourth acquisition unit is used to query the Media Access Control (MAC) table in the Forwarding Control Information Table according to the Media Access Control (MAC) address, and obtain the next-hop information and the MAC outgoing interface; wherein, the traffic outgoing interface includes the MAC outgoing interface.
[0132] Optionally, in the detection device, the first determining module 903 includes:
[0133] The first determining unit is used to determine the second network element based on the next-hop information and the traffic outgoing interface, through a link layer discovery protocol.
[0134] Optionally, in the detection device, when the device type of the first network element is a router, the first determining module 903 further includes:
[0135] The fifth acquisition unit is used to acquire the physical output interface based on the traffic output interface;
[0136] The second determining unit is used to determine the second network element based on the physical output interface and the next-hop information, through a link layer discovery protocol.
[0137] Optionally, in the detection device, when the device type of the first network element is a Layer 3 communication function switch, the first determining module 903 further includes:
[0138] The sixth acquisition unit is used to query the Address Resolution Protocol (ARP) table in the forwarding control information table to obtain the media access control address when the traffic outgoing interface exists in a virtual local area network.
[0139] The seventh acquisition unit is used to query the Media Access Control (MAC) table in the forwarding control information table based on the Media Access Control (MAC) address to obtain the physical output interface;
[0140] The third determining unit is used to determine the second network element based on the physical output interface and the next-hop information, through a link layer discovery protocol.
[0141] Optionally, in the detection device, the forwarding control information table includes one or more of the following:
[0142] Strategy table;
[0143] Routing table;
[0144] Address Resolution Protocol (ARP) table;
[0145] Media Access Control (MAC) table.
[0146] It should be noted that the apparatus provided in this embodiment of the invention can implement all the method steps implemented in the above method embodiment and can achieve the same technical effect. Therefore, the parts and beneficial effects that are the same as those in the method embodiment will not be described in detail here.
[0147] To achieve the above objectives, embodiments of the present invention provide a network device, including: a processor, a memory, and a program or instructions stored in the memory and executable on the processor; wherein, when the processor executes the program or instructions, it implements the traffic path detection method as described above.
[0148] To achieve the above objectives, embodiments of the present invention provide a readable storage medium having a program or instructions stored thereon, wherein the program or instructions, when executed by a processor, implement the steps in the traffic path detection method described above.
[0149] To achieve the above objectives, embodiments of the present invention provide a computer program product, which includes computer instructions that, when executed by a processor, implement the steps of the traffic path detection method as described above.
[0150] The exemplary embodiments described above are with reference to the accompanying drawings. Many different forms and embodiments are feasible without departing from the spirit and teachings of the invention. Therefore, the invention should not be construed as limiting the exemplary embodiments set forth herein. Rather, these exemplary embodiments are provided to make the invention complete and convey the scope of the invention to those skilled in the art. In these drawings, component dimensions and relative dimensions may be exaggerated for clarity. The terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. As used herein, unless clearly indicated otherwise, the singular forms “a,” “an,” and “the” are intended to include all such forms. It will be further understood that the terms “comprising” and / or “including”, when used in this specification, indicate the presence of the stated features, integers, steps, operations, components, and / or elements, but do not exclude the presence or addition of one or more other features, integers, steps, operations, components, and / or groups thereof. Unless otherwise indicated, when stated, a range of values includes the upper and lower limits of the range and any subranges in between.
[0151] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method of detecting a flow path, characterized by, The method comprises the following steps: acquiring a first network element in a to-be-detected traffic path; querying a corresponding forwarding control information table on the first network element according to a destination address of the to-be-detected traffic path and a device type and model of the first network element, acquiring next-hop information of the to-be-detected traffic path and a traffic out interface of the first network element; determining a second network element in the to-be-detected traffic path according to the next-hop information and the traffic out interface; checking the first network element by using standardized check items, and acquiring echo parameters; in a case where the echo parameters are different from preset standard echo parameters, acquiring fault information of the first network element; supporting definition of a regular expression, filtering text of execution results of command line instructions of different manufacturers and models, and extracting the echo parameters.
2. The method of claim 1, wherein, The step of querying the corresponding forwarding control information table on the first network element according to the destination address of the to-be-detected traffic path and the device type and model of the first network element, and acquiring the next-hop information of the to-be-detected traffic path and the traffic out interface of the first network element comprises the following steps: performing interface binding virtual private network instance checking on the first network element, and confirming whether a traffic in interface is bound to a virtual private network instance; in a case where the traffic in interface is bound to a virtual private network instance, querying a routing table in the forwarding control information table according to the destination address, performing destination address virtual private network detailed route checking, and acquiring the next-hop information and the traffic out interface; in a case where the traffic in interface is not bound to a virtual private network instance, querying a routing table in the forwarding control information table according to the destination address, performing destination address global detailed route checking, and acquiring the next-hop information and the traffic out interface.
3. The method of claim 1, wherein, In a case where the device type of the first network element is a firewall, before the step of querying the corresponding forwarding control information table on the first network element according to the destination address of the to-be-detected traffic path and the device type and model of the first network element, and acquiring the next-hop information of the to-be-detected traffic path and the traffic out interface of the first network element, the method further comprises the following steps: performing destination address network address translation policy checking on the first network element, and acquiring an updated destination address in a case where the destination address has been translated; determining the updated destination address as the destination address.
4. The method of claim 1, wherein, In a case where the device type of the first network element is a two-layer communication function switch, the step of querying the corresponding forwarding control information table on the first network element according to the destination address of the to-be-detected traffic path and the device type and model of the first network element, and acquiring the next-hop information of the to-be-detected traffic path and the traffic out interface of the first network element further comprises the following steps: acquiring a media access control address; querying a media access control (MAC) table in the forwarding control information table according to the media access control address, acquiring the next-hop information and a MAC out interface; wherein the traffic out interface comprises the MAC out interface.
5. The method of claim 1, wherein, The step of determining the second network element in the to-be-detected traffic path according to the next-hop information and the traffic out interface comprises the following steps: According to the next hop information and the traffic out interface, the second network element is determined through a link layer discovery protocol.
6. The method of claim 1, wherein, In a case where the device type of the first network element is a router, the determining the second network element in the to-be-probed traffic path according to the next hop information and the traffic out interface further includes: According to the traffic out interface, a physical out interface is acquired; According to the physical out interface and the next hop information, the second network element is determined through a link layer discovery protocol.
7. The method of claim 1, wherein, In a case where the device type of the first network element is a three-layer communication function switch, the determining the second network element in the to-be-probed traffic path according to the next hop information and the traffic out interface further includes: In a case where the traffic out interface exists in a virtual local area network, an address resolution protocol (ARP) table in the forwarding control information table is queried according to the next hop information, and a media access control (MAC) address is acquired; According to the MAC address, a MAC table in the forwarding control information table is queried, and a physical out interface is acquired; According to the physical out interface and the next hop information, the second network element is determined through a link layer discovery protocol.
8. The method of claim 1, wherein, The forwarding control information table includes one or more of the following: a policy table; a routing table; an ARP table; a MAC table.
9. A flow path probing apparatus, characterized by comprising: The method comprises: a first acquiring module that acquires a first network element in a to-be-probed traffic path; a second acquiring module that acquires next hop information of the to-be-probed traffic path and a traffic out interface of the first network element by querying a corresponding forwarding control information table on the first network element according to a destination address of the to-be-probed traffic path, a device type and model of the first network element; a first determining module that determines a second network element in the to-be-probed traffic path according to the next hop information and the traffic out interface; a third acquiring module that acquires an echo parameter by checking the first network element using standardized check items; a fourth acquiring module that acquires fault information of the first network element in a case where the echo parameter is different from a preset standard echo parameter; The detection device is further configured to support defining a regular expression to filter text of execution results of command line instructions of different manufacturers and models, so as to extract the echo parameter.
10. A network device comprising: A processor, a memory, and a program or instructions stored on the memory and executable on the processor; characterized in that the processor implements the traffic path detection method of any one of claims 1-8 when executing the program or instructions.
11. A readable storage medium, on which a program or instructions are stored, characterized in that, The program or instructions are executable by the processor to implement the steps of the traffic path detection method of any one of claims 1-8.
12. A computer program product, characterised in that, The computer instructions are executable by the processor to implement the steps of the traffic path detection method of any one of claims 1-8.
Citation Information
Patent Citations
Method for establishing communication connection, apparatus and system thereof
CN102348290A
Method and device for acquiring access path
CN108880840A