With rapid development of Internet, an Internet Protocol (English: Internet Protocol, IP for short) network has become a cornerstone for information bearing. In an IP network, network devices communicate with each other by transmitting data packets. However, a transmit end network device does not detect whether a receive end network device has received the data packet. In this case, if the data packet is lost, experience of a user using the network device degrades (for example, when a user watches a video by using the network device, an IP service packet corresponding to a video service is lost, and consequently a video image cannot be displayed normally). Therefore, it may be determined, by detecting whether a data packet is lost, whether a fault occurs on the network, so as to maintain the network in time.
Currently, when a network device 1 sends an IP service packet to a network device 2, the network device 1 may determine, together with the network device 2 by inserting a statistics collection packet into the IP service packet, whether the IP service packet is lost. As shown in FIG. 1, for an IP service stream sent to the network device 1, a statistics collection packet A and a statistics collection packet B are inserted into a service packet of the IP service stream, where the statistics collection packet A records a quantity TX1 of IP service packets that are sent by the network device 1 before the network device 1 sends the statistics collection packet A. The statistics collection packet B records a quantity TX2 of IP service packets that are sent by the network device 1 before the network device 1 sends the statistics collection packet B. When receiving the statistics collection packet A, the network device 2 records a quantity RX1 of IP service packets that are received by the network device 2 before this moment. When receiving the statistics collection packet B, the network device 2 records a quantity RX2 of IP service packets that are received by the network device 2 before this moment. The network device 2 determines whether RX2-RX1 is equal to TX2-TX1. If RX2-RX1 is equal to TX2-TX1, it indicates that the IP service packet between the statistics collection packet A and the statistics collection packet B is not lost. Otherwise, the IP service packet is lost.
When the foregoing method is used to detect whether an IP service packet is lost, a statistics collection packet should be inserted between adjacent IP service packets and then is sent. The statistics collection packet is information on a control plane and the IP service packet is information on a data plane. Therefore, in order to achieve that the statistics collection packet is sent on a data plane and a existed sequence between the statistics collection packet and the IP service packet is maintained, an implementation process is relatively complex, and even, some network devices do not have the function, and cannot detect, by using the method, whether an IP service packet is lost.