This application relates to the field of network technologies, and in particular, to a packet loss positioning method, apparatus, and system, and a computer storage medium.
With rapid development of Internet protocol (IP) technologies, more and more services are transmitted by using an IP network, that is, traffic flows are forwarded between a transmitting end and a receiving end by using a network device to implement communication. Currently, most services are sensitive to packet loss. Especially, real-time services such as video on demand or video conferencing are extremely sensitive to packet loss.
At present, packet loss positioning is generally performed by using a packet conservation algorithm for Internet (iPCA). An analysis device periodically obtains a quantity of packets received and a quantity of packets sent by each network device in a network in a statistical period. When a quantity of packets sent by a network device in the statistical period is less than a quantity of packets received by the network device, the network device is determined as a packet loss device in the statistical period.
However, with the current packet loss positioning method, only whether packet loss occurs on a network device can be determined, resulting in relatively low packet loss positioning precision.
This application provides a packet loss positioning method, apparatus, and system, and a computer storage medium, to resolve a problem of relatively low packet loss positioning precision.
According to a first aspect, a packet loss positioning method is provided. A network device obtains an identifier of a target traffic flow, where the target traffic flow is a traffic flow in which packet loss occurs on the network device. The network device generates packet loss information of the target traffic flow, where the packet loss information includes the identifier of the target traffic flow and an identifier of the network device. The network device sends the packet loss information to an analysis device, so that the analysis device determines a packet loss location of the target traffic flow.
In this application, because the packet loss information reported by the network device to the analysis device includes the identifier of the traffic flow in which packet loss occurs on the network device and the identifier of the network device, based on the packet loss information, the analysis device can determine that packet loss occurs on the network device, and can determine the traffic flow in which packet loss occurs on the network device. Compared with an existing packet loss positioning method, this improves packet loss positioning precision. When a service of a traffic flow is faulty, the analysis device may determine a packet loss location of the traffic flow based on historical packet loss information of the traffic flow, to implement fast packet loss positioning.
In an embodiment, the packet loss information further includes one or more of a statistical moment, a packet loss quantity of the target traffic flow within a statistical time, and information about an inbound port of the target traffic flow on the network device.
The analysis device can further determine, based on the packet loss information, a time within which packet loss occurs in the target traffic flow, a packet loss quantity, and an inbound port of the target traffic flow on a packet loss device, to further improve the packet loss positioning precision.
In an embodiment, the network device may further periodically collect statistics on a traffic flow in which packet loss occurs on the network device.
In an embodiment, the identifier of the target traffic flow includes 5-tuple information of the target traffic flow.
According to a second aspect, another packet loss positioning method is provided an analysis device receives packet loss information that is of a target traffic flow and that is sent by a network device, where the packet loss information includes an identifier of the target traffic flow and an identifier of the network device, and the target traffic flow is a traffic flow in which packet loss occurs on the network device. The analysis device determines a packet loss location of the target traffic flow based on the packet loss information.
In an embodiment, the packet loss information further includes one or more of a statistical moment, a packet loss quantity of the target traffic flow within a statistical time, and information about an inbound port of the target traffic flow on the network device.
In an embodiment, after receiving the packet loss information sent by the network device, the analysis device may store the packet loss information in a database. A process in which the analysis device determines a packet loss location of the target traffic flow based on the packet loss information includes: when a query instruction for the target traffic flow is received, the analysis device determines a packet loss location of the target traffic flow based on the database, where the query instruction carries the identifier of the target traffic flow.
In this application, the analysis device may store received packet loss information in a database. When a service of a traffic flow is faulty, the analysis device can query historical packet loss information of the traffic flow based on the database, to determine a packet loss location, to implement fast packet loss positioning.
According to a third aspect, a packet loss positioning apparatus is provided, applied to a network device. The apparatus includes a plurality of function modules, and the plurality of function modules interact to implement the method in the first aspect and the implementations of the first aspect. The plurality of function modules may be implemented based on software, hardware, or a combination of software and hardware, and the plurality of function modules may be arbitrarily combined or divided based on implementation.
According to a fourth aspect, another packet loss positioning apparatus is provided, applied to an analysis device. The apparatus includes a plurality of function modules, and the plurality of function modules interact to implement the method in the second aspect and the implementations of the second aspect. The plurality of function modules may be implemented based on software, hardware, or a combination of software and hardware, and the plurality of function modules may be arbitrarily combined or divided based on implementation.
According to a fifth aspect, a network device is provided. The network device includes a processor and a memory.
The memory is configured to store a computer program. The computer program includes program instructions.
The processor is configured to invoke the computer program to implement the packet loss positioning method according to the first aspect or an embodiment of the first aspect.
According to a sixth aspect, an analysis device is provided. The analysis device includes a processor and a memory.
The memory is configured to store a computer program. The computer program includes program instructions.
The processor is configured to invoke the computer program to implement the packet loss positioning method according to the second aspect or an embodiment of the second aspect.
According to a seventh aspect, a packet loss positioning system is provided. The system includes a network device and an analysis device, the network device includes the packet loss positioning apparatus according to the third aspect or an embodiment of the third aspect, and the analysis device includes the packet loss positioning apparatus according to the fourth aspect or an embodiment of the fourth aspect.
According to an eighth aspect, a computer storage medium is provided. The computer storage medium stores instructions. When the instructions are executed by a processor of a network device, the packet loss positioning method according to the first aspect or an embodiment of the first aspect is implemented; or when the instructions are executed by a processor of an analysis device, the packet loss positioning method according to the second aspect or an embodiment of the second aspect is implemented.
The technical solutions provided in this application bring at least the following beneficial effects:
According to the packet loss positioning method provided in this application, a network device may obtain an identifier of a target traffic flow in which packet loss occurs, generate packet loss information that includes the identifier of the target traffic flow and an identifier of the network device, and then send the packet loss information to an analysis device. The analysis device can determine a packet loss location of the target traffic flow based on the packet loss information. Because the packet loss information reported by the network device to the analysis device includes the identifier of the traffic flow in which packet loss occurs on the network device and the identifier of the network device, based on the packet loss information, the analysis device can determine that packet loss occurs on the network device, and can determine the traffic flow in which packet loss occurs on the network device. Compared with an existing packet loss positioning method, this improves packet loss positioning precision. In addition, the packet loss information may further include a statistical moment, a packet loss quantity of the target traffic flow within a statistical time, and information about an inbound port of the target traffic flow on the network device. In this case, the analysis device can further determine, based on the packet loss information, a time within which packet loss occurs in the target traffic flow, a packet loss quantity, and an inbound port of the target traffic flow on a packet loss device, to further improve the packet loss positioning precision.
In addition, because each network device in a communications network may report, to the analysis device in real time, packet loss information of a traffic flow in which packet loss occurs, the analysis device can implement real-time packet loss positioning for traffic flows in the entire network. In addition, the analysis device may further store received packet loss information in a database. When a service of a traffic flow is faulty, the analysis device can query historical packet loss information of the traffic flow based on the database, to determine a packet loss location, to implement fast packet loss positioning.
To make the objectives, technical solutions, and advantages of this application clearer, the following further describes the implementations of this application in detail with reference to the accompanying drawings.
In a current packet loss positioning method, an analysis device can obtain only a total quantity of packets received and a total quantity of packets sent by a network device in a statistical period. Therefore, the analysis device can determine only whether packet loss occurs on the network device in the statistical period. That is, only a network device on which packet loss occurs can be determined, but a traffic flow in which packet loss occurs on the network device cannot be determined. In addition, when a service is faulty, if there are a plurality of network devices on which packet loss occurs in a network, the current packet loss positioning method cannot determine a network device or network devices on which packet loss occurs in a traffic flow of the faulty service, either. Therefore, current packet loss positioning precision is relatively low.
In an embodiment, the analysis device 101 may be one server, or a server cluster including two or more servers, or a cloud computing service center. The network device 102 may be a switch, a router, or the like. The analysis device 101 is connected to each network device 102 in the communications network by using a wired network or a wireless network.
The communications network provided in an embodiment of the application may be a data center network (DCN), a metropolitan area network, a wide area network, a campus network, or the like. A type of the communications network is not limited in an embodiment of the application. In an embodiment, the communications network provided may be a two-layer network or a three-layer network.
For example,
For example,
In an embodiment of the application, the network device 102 in the packet loss positioning system shown in
Operation 401: A network device periodically collects statistics on a traffic flow in which packet loss occurs on the network device.
In an embodiment,
In an embodiment, the forwarding chip has a plurality of network interfaces, a network interface for receiving a traffic flow is an inbound port of the traffic flow on the network device, and inbound ports of all packets in a same traffic flow are the same. After entering the forwarding chip from a network interface of the forwarding chip, a packet of the traffic flow may be processed by the forwarding chip, or transmitted by the forwarding chip to the control chip and processed by the control chip. A packet processing action of the forwarding chip and/or the control chip includes drop. In an embodiment of the application, the forwarding chip and/or the control chip may record information about a dropped packet. The information about the packet includes 5-tuple information of the packet and information about an inbound port of the packet on the network device. The 5-tuple information includes a source IP address, a destination IP address, a source port, a destination port, and a transport layer protocol of the packet. The information about the inbound port of the packet on the network device includes a port number of the inbound port of the packet on the network device. The transport layer protocol includes transport control protocol (TCP) and user datagram protocol (UDP).
The network device may periodically collect statistics on a traffic flow in which packet loss occurs on the network device and a packet loss quantity. For example, at an end moment of each statistical time, the network device obtains all traffic flows in which packet loss occurs within the statistical time and a packet loss quantity of each traffic flow in which packet loss occurs.
Operation 402: The network device obtains an identifier of a target traffic flow, where the target traffic flow is a traffic flow in which packet loss occurs on the network device.
In an embodiment, the identifier of the target traffic flow includes 5-tuple information of the target traffic flow. Because 5-tuple information of all packets of a same traffic flow is the same, 5-tuple information of the traffic flow is 5-tuple information of a packet of the traffic flow.
For example, the identifier of the target traffic flow may be “SIP:192.168.0.93; DIP:192.168.92.10; SPORT:23; DPORT:16300; TCP”, indicating that a packet in the target traffic flow is transmitted based on TCP, whose source IP address is 192.168.0.93, destination IP address is 192.168.92.10, source port is 23, and destination port is 16300.
Operation 403: The network device generates packet loss information of the target traffic flow.
The packet loss information includes the identifier of the target traffic flow and an identifier of the network device. The identifier of the network device is used to uniquely identify the network device in a communications network. In an embodiment, the identifier of the network device includes an IP address of the network device.
In an embodiment, the packet loss information further includes one or more of a statistical moment, a packet loss quantity of the target traffic flow within a statistical time, and information about an inbound port of the target traffic flow on the network device. In an embodiment, the statistical moment includes a start moment and an end moment of the statistical time. For example, the statistical moment is “start: 2019-3-3 12:22:33; end: 2019-3-3 12:28:33”. Alternatively, the statistical moment includes a moment at which the packet loss information is generated or an end moment of the statistical time. For example, the statistical moment is “2019-6-25 20:35:16.635”. Statistical times of all network devices in the communications network may be the same, or may be different. This is not limited in an embodiment of the application. When the network device periodically collects statistics on a traffic flow in which packet loss occurs on the network device, a statistical time is a statistical period.
Operation 404: The network device sends the packet loss information to an analysis device.
In an embodiment of the application, the network device sends the packet loss information to the analysis device in a form of a packet. The packet loss information may include the identifier of the target traffic flow, the identifier of the network device, the statistical moment, the packet loss quantity of the target traffic flow within the statistical time, and the information about the inbound port of the target traffic flow. The identifier of the target traffic flow, the statistical moment, the packet loss quantity of the target traffic flow within the statistical time, and the information about the inbound port of the target traffic flow on the network device may be carried in a payload field of the packet for transmission, and the identifier of the network device may be carried in a packet header for transmission or carried in the payload field of the packet for transmission.
For example,
Operation 405: The analysis device determines a packet loss location of the target traffic flow based on the packet loss information.
In an embodiment, after receiving the packet loss information sent by the network device, the analysis device may store the packet loss information in a database. When receiving a query instruction for the target traffic flow, the analysis device determines a packet loss location of the target traffic flow based on the database. The packet loss location of the traffic flow refers to a network device on which packet loss occurs in the traffic flow. The query instruction for the target traffic flow carries the identifier of the target traffic flow, and the query instruction may be triggered after a service of the target traffic flow is faulty.
For example, the packet loss information of the target traffic flow in the database is stored in a form of a table, and the packet loss information received by the analysis device includes the 5-tuple information of the target traffic flow, the identifier of the network device, the statistical moment (the start moment and the end moment of the statistical time), the information about the inbound port of the target traffic flow on the network device, and the packet loss quantity of the target traffic flow within the statistical time. In this case, a storage form of the packet loss information of the target traffic flow in the database may be shown in Table 1.
For example, when the analysis device receives a query instruction that is for a traffic flow and that carries 5-tuple information “a source IP address is 1.1.1.1, a destination IP address is 2.2.2.2, a source port is 1000, a destination port is 80, and a transport layer protocol is UDP”, the analysis device may determine, by querying Table 1, that a packet loss location of the traffic flow is Dev1, and a packet loss quantity is 7. The analysis device may further obtain a time within which packet loss occurs and an inbound port of the traffic flow on the packet loss device, to implement precise packet loss positioning in the network.
A sequence of operations of the packet loss positioning method provided in an embodiment of the present disclosure may be properly adjusted, and an operation may be correspondingly added or deleted based on a situation. Any method that can be readily figured out by one of ordinary skilled in the art within the technical scope disclosed in this application shall fall within the protection scope of this application. Therefore, details are not described again.
In conclusion, according to the packet loss positioning method provided in an embodiment of the application, a network device may obtain an identifier of a target traffic flow in which packet loss occurs, generate packet loss information that includes the identifier of the target traffic flow and an identifier of the network device, and then send the packet loss information to an analysis device. The analysis device may determine a packet loss location of the target traffic flow based on the packet loss information. Because the packet loss information reported by the network device to the analysis device includes the identifier of the traffic flow in which packet loss occurs on the network device and the identifier of the network device, based on the packet loss information, the analysis device can determine that packet loss occurs on the network device, and can determine the traffic flow in which packet loss occurs on the network device. Compared with an existing packet loss positioning method, this improves packet loss positioning precision. In addition, the packet loss information may further include a statistical moment, a packet loss quantity of the target traffic flow within a statistical time, and information about an inbound port of the target traffic flow on the network device. In this case, the analysis device can further determine, based on the packet loss information, a time within which packet loss occurs in the target traffic flow, a packet loss quantity, and an inbound port of the target traffic flow on a packet loss device, to further improve the packet loss positioning precision.
In addition, because each network device in a communications network may report, to the analysis device in real time, packet loss information of a traffic flow in which packet loss occurs, the analysis device can implement real-time packet loss positioning for traffic flows in the entire network. In addition, the analysis device may further store received packet loss information in a database. When a service of a traffic flow is faulty, the analysis device can query historical packet loss information of the traffic flow based on the database, to determine a packet loss location, to implement fast packet loss positioning.
an obtaining module 701, configured to obtain an identifier of a target traffic flow, where the target traffic flow is a traffic flow in which packet loss occurs on the network device;
a generation module 702, configured to generate packet loss information of the target traffic flow, where the packet loss information includes the identifier of the target traffic flow and an identifier of the network device; and
a sending module 703, configured to send the packet loss information to an analysis device, so that the analysis device determines a packet loss location of the target traffic flow.
In an embodiment, the packet loss information further includes one or more of a statistical moment, a packet loss quantity of the target traffic flow within a statistical time, and information about an inbound port of the target traffic flow on the network device.
In an embodiment, as shown in
a statistics collection module 704, configured to periodically collect statistics on a traffic flow in which packet loss occurs on the network device.
In an embodiment, the identifier of the target traffic flow includes 5-tuple information of the target traffic flow.
In conclusion, according to the packet loss positioning apparatus provided in an embodiment of the application, a network device obtains, by using the obtaining module, an identifier of a target traffic flow in which packet loss occurs, generates, by using the generation module, packet loss information that includes the identifier of the target traffic flow and an identifier of the network device, and then sends the packet loss information to an analysis device by using the sending module. Because the packet loss information reported by the network device to the analysis device includes the identifier of the traffic flow in which packet loss occurs on the network device and the identifier of the network device, based on the packet loss information, the analysis device can determine that packet loss occurs on the network device, and can determine the traffic flow in which packet loss occurs on the network device. Compared with an existing packet loss positioning method, this improves packet loss positioning precision.
a receiving module 901, configured to receive packet loss information that is of a target traffic flow and that is sent by a network device, where the packet loss information includes an identifier of the target traffic flow and an identifier of the network device, and the target traffic flow is a traffic flow in which packet loss occurs on the network device; and
a determining module 902, configured to determine a packet loss location of the target traffic flow based on the packet loss information.
In an embodiment, the packet loss information further includes one or more of a statistical moment, a packet loss quantity of the target traffic flow within a statistical time, and information about an inbound port of the target traffic flow on the network device.
In an embodiment, as shown in
a storage module 903, configured to store the packet loss information in a database. The determining module 902 is configured to: when a query instruction for the target traffic flow is received, determine a packet loss location of the target traffic flow based on the database, where the query instruction carries the identifier of the target traffic flow.
In conclusion, according to the packet loss positioning apparatus provided in an embodiment of the application, the analysis device receives, by using the receiving module, the packet loss information that is of the target traffic flow and that is sent by the network device. Because the packet loss information reported by the network device to the analysis device includes the identifier of the traffic flow in which packet loss occurs on the network device and the identifier of the network device, based on the packet loss information, the analysis device can determine that packet loss occurs on the network device, and can determine the traffic flow in which packet loss occurs on the network device. Compared with an existing packet loss positioning method, this improves packet loss positioning precision.
The memory 1101 is configured to store a computer program. The computer program includes program instructions.
The processor 1102 is configured to invoke the computer program to implement operations performed by the network device in the packet loss positioning method shown in
In an embodiment, the network device 110 further includes a communications bus 1103 and a communications interface 1104.
The processor 1101 includes one or more processing cores, and the processor 1101 executes various functional applications and data processing by running the computer program.
The memory 1102 may be configured to store a computer program. In an embodiment, the memory may store an operating system and an application program unit required for at least one function. The operating system may be an operating system such as a real-time operating system (e.g., Real-Time eXecutive (RTX)), Linux, Unix, Windows, or OS X.
There may be a plurality of communications interfaces 1104, and the communications interfaces 1104 are configured to communicate with another device, for example, communicate with an analysis device.
The memory 1102 and the communications interface 1104 are separately connected to the processor 1101 by using the communications bus 1103.
The memory 1201 is configured to store a computer program. The computer program includes program instructions.
The processor 1202 is configured to invoke the computer program to implement operations performed by the analysis device in the packet loss positioning method shown in
In an embodiment, the analysis device 120 further includes a communications bus 1203 and a communications interface 1204.
The processor 1201 includes one or more processing cores, and the processor 1201 executes various functional applications and data processing by running the computer program.
The memory 1202 may be configured to store a computer program. In an embodiment, the memory may store an operating system and an application program unit required for at least one function. The operating system may be an operating system such as a real-time operating system (e.g., Real-Time eXecutive (RTX)), Linux, Unix, Windows, or OS X.
There may be a plurality of communications interfaces 1204, and the communications interfaces 1204 are configured to communicate with another device, for example, communicate with a network device.
The memory 1202 and the communications interface 1204 are separately connected to the processor 1201 by using the communications bus 1203.
An embodiment of this application further provides a computer storage medium. The computer storage medium stores instructions. When the instructions are executed by a processor of a network device, operations performed by the network device in the packet loss positioning method shown in
One of ordinary skill in the art may understand that all or some of the operations of the embodiments may be implemented by hardware or a program instructing related hardware. The program may be stored in a computer-readable storage medium. The storage medium may include: a read-only memory, a magnetic disk, or an optical disc.
In an embodiment of the application, the terms “first”, “second”, and “third” are used only for description purposes, and cannot be understood as indicating or implying relative importance. The term “at least one” means one or more, and the term “a plurality of” means two or more, unless otherwise expressly specified.
The term “and/or” in this application describes only an association relationship for describing associated objects and represents that three relationships may exist. For example, A and/or B may represent the following three cases: Only A exists, both A and B exist, and only B exists. In addition, the character “/” in this specification generally indicates an “or” relationship between the associated objects.
The foregoing descriptions are merely optional embodiments of this application, but are not intended to limit this application. Any modification, equivalent replacement, improvement, or the like made without departing from the concept and principle of this application should fall within the protection scope of this application.
Number | Date | Country | Kind |
---|---|---|---|
201910678152.X | Jul 2019 | CN | national |
This application is a continuation of International Application No. PCT/CN2020/103614, filed on Jul. 22, 2020, which claims priority to Chinese Patent Application No. 201910678152.X, filed on Jul. 25, 2019. The disclosures of the aforementioned applications are hereby incorporated by reference in their entireties.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2020/103614 | Jul 2020 | US |
Child | 17581012 | US |