A data message detection method, device and system

By encapsulating detection information in data packets, information telemetry and collection on the transmission path are realized, which solves the problem of inconsistency between OAM detection packets and data flow paths, and ensures accurate identification and detection of data transmission paths.

CN116208524BActive Publication Date: 2024-09-17HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310135834.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-06-06
Publication Date
2024-09-17
Estimated Expiration
2038-06-06

AI Technical Summary

Technical Problem

Existing OAM detection packets are inconsistent with the transmission path of the data flow, especially in load sharing situations, and cannot achieve accurate identification and packet-by-packet detection of the data transmission path.

Method used

Information telemetry is implemented by encapsulating detection information in data packets on the transmission path, and the information of data packets is collected while ensuring packet forwarding performance, including control information issued by each network device in the detection domain based on the controller. Collect information.

Benefits of technology

It realizes the on-path collection and detection of data packets on the transmission path, ensures accurate identification and detection of data transmission paths, and solves the problem of inconsistency between traditional OAM detection message paths and data flow paths.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116208524B
    Figure CN116208524B
Patent Text Reader

Abstract

A method, device and system for detecting data packets. The method includes: a first network device receives first control information sent by a controller. The first network device receives a first data packet sent by a previous-hop network device of the first network device, the first data packet including first detection information, the first detection information including a first detection node identifier, a first sequence number and first acquisition information. The first network device determines the first acquisition data corresponding to the first acquisition information based on the first acquisition information, and the first network device updates the first detection node identifier. The first network device sends the first data packet carrying the updated first detection information to the next-hop network device of the first network device. Thus, information telemetry of the data packet on the transmission path is realized.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims a divisional application of the Chinese patent application with application number 201810574118.3 filed on June 6, 2018, and invention name “A method, device and system for detecting data messages”, all contents of which are incorporated by reference in this application. Technical Field

[0002] The present application relates to the field of communication technology, and in particular to a method, device and system for detecting a data message. Background Art

[0003] Operation, administration and maintenance (OAM) is a technology that provides transmission path status detection for the network. Network devices that communicate with each other detect whether the path used to transmit data messages is in a normal state through the OAM messages sent. Specifically, the first network device can construct an OAM detection message based on OAM technology, and the first network device sends the OAM detection message to the second network device via the transmission path to be detected. After receiving the OAM detection message, the second network device determines the status of the transmission path by analyzing the OAM detection message.

[0004] However, it is impossible to ensure that the transmission path of the traditional OAM detection message is consistent with the transmission path of the data flow. When the transmission path to be tested has load sharing, the inconsistency between the OAM detection message and the data flow transmission path is more serious.

[0005] Internet Protocol (IP) Flow Performance Measurement (FPM) is a method for directly measuring data flows between multiple points to obtain network packet loss statistics, service path delay and other performance indicators. IP FPM technology achieves the carrying and transmission of detection information by dyeing the data packets included in the data flow. Specifically, the first network device dyes the specific data bits included in the data packets in the data flow, and then the first network device sends the data packets with the dyeing mark to the second network device. The second network device identifies and counts the received data packets with the dyeing mark, thereby determining the performance of the transmission path.

[0006] However, IP FPM technology only provides coloring for data packets. Therefore, IP FPM technology cannot identify the data transmission path, and IP FPM technology can only detect each flow, not each packet. Summary of the invention

[0007] In view of this, an embodiment of the present application provides a data packet detection method, device and system, which realizes information telemetry of the data packet on the transmission path by encapsulating detection information in the data packet on the transmission path, thereby realizing information collection of the data packet on the transmission path while ensuring the message forwarding performance.

[0008] The technical solutions provided in the embodiments of the present application are as follows.

[0009] In a first aspect, a method for detecting a data message is provided, the method comprising: a first network device receives first control information sent by a controller, the first control information includes a detection task type, and the detection task type indicates the detection task that the controller requires the first network device to perform. In addition, the first network device receives a first data message sent by a previous-hop network device of the first network device, the first data message includes first detection information, the first detection information includes a first detection node identifier, a first sequence number, and first acquisition information, wherein the first detection node identifier indicates the position of the network device that processes the first detection information in the detection domain, the first sequence number indicates the sequence number of the first data message including the first detection information, the first acquisition information indicates the acquisition information corresponding to the detection task type, the detection domain is the detection range determined by the controller, the detection domain includes multiple network devices, and the multiple network devices include the first network device. Then, the first network device determines the first acquisition data corresponding to the first acquisition information according to the first acquisition information, and the first network device updates the first detection node identifier. The first network device sends the first data message carrying the updated first detection information to the next-hop network device of the first network device.

[0010] Based on the solution provided in the embodiment, each network device in the detection domain can use the detection information included in the data packet to realize information collection for the detection task required by the controller according to the control information sent by the controller, thereby realizing the in-path collection of data packets on the transmission path and the detection of the transmission path while ensuring the message forwarding performance.

[0011] In a possible implementation of the first aspect, the first network device is a head node device of the detection domain. After the first network device receives a first data packet sent by a previous-hop network device of the first network device, the method further includes the first network device encapsulating the first detection information in the first data packet.

[0012] In another possible implementation of the first aspect, the first network device is an end node device of the detection domain, and before the first network device sends the first data packet carrying the updated first detection information to the next-hop network device of the first network device, the method also includes: the first network device deleting the first detection information in the first data packet.

[0013] In another possible implementation manner of the first aspect, the method further includes the first network device sending first reporting detection information to the controller, where the first reporting detection information includes the updated first detection node identifier, the first serial number, and the first collected data.

[0014] In another possible implementation of the first aspect, the detection task type is packet loss detection, the first control information also includes a detection start time and a detection end time, the first network device is a head node device of the detection domain, the first data packet is the first data packet sent by the first network device to the next-hop network device of the first network device from the detection start time, the first acquisition data includes a device identifier of the first network device, and the method further includes the first network device receiving a second data packet sent by the previous-hop network device of the first network device. The first network device encapsulates second detection information in the second data packet, and the second detection information includes a second detection node identifier, a second sequence number, and second acquisition information. The first network device determines the second acquisition data corresponding to the second acquisition information according to the second acquisition information, and the first network device updates the second detection node identifier, the second acquisition data includes the device identifier of the first network device, the second sequence number is greater than the first sequence number, and the second detection node identifier is the same as the first detection node identifier. The first network device sends the second data packet carrying the updated second detection information to the next-hop network device of the first network device, and the second data packet is the last data packet sent by the first network device to the next-hop network device of the first network device before the detection end time. The first network device sends first reported detection information and second reported detection information to the controller, wherein the first reported detection information includes the updated first detection node identifier, the first serial number and the first collected data, and the second reported detection information includes the updated second detection node identifier, the second serial number and the second collected data.

[0015] In another possible implementation of the first aspect, the detection task type is packet loss detection, the first control information also includes a detection start time and a detection end time, the first network device is an intermediate node device or a tail node device of the detection domain, the first acquisition data includes a device identifier of the first network device, and the method also includes the first network device increasing the value of the detection end time by a predetermined time length and updating the value of the detection end time. The first network device receives a second data packet sent by a previous-hop network device of the first network device within a time period between the detection start time and the updated detection end time, the second data packet including second detection information, and the second detection information including a second detection node identifier, a second sequence number, and second acquisition information. The first network device determines the second collection data corresponding to the second collection information according to the second collection information, and the first network device updates the second detection node identifier, the second collection data includes the device identifier of the first network device, the second sequence number is the maximum sequence number among the sequence numbers of multiple data packets received by the first network device within the time period, the first data packet is the data packet received by the first network device within the time period, and the first sequence number is the minimum sequence number among the sequence numbers of the multiple data packets received by the first network device within the time period. The first network device sends the second data packet carrying the updated second detection information to the next hop network device of the first network device. The first network device generates third reporting detection information, the third reporting detection information includes a third detection node identifier, a third sequence number and third collection data, the third detection node identifier is the same as the updated second detection node identifier, the third collection data includes the device identifier of the first network device, the third sequence number is the missing sequence number among the sequence numbers of the multiple data packets received by the first network device within the time period, and the third sequence number is greater than the first sequence number and less than the second sequence number. The first network device sends first reported detection information, second reported detection information and third reported detection information to the controller, wherein the first reported detection information includes the updated first detection node identifier, the first serial number and the first collected data, and the second reported detection information includes the updated second detection node identifier, the second serial number and the second collected data.

[0016] In a second aspect, a method for detecting a data message is provided, the method comprising: a controller determines a detection domain, the detection domain is a detection range determined by the controller, and the detection domain includes multiple network devices. Then, the controller sends first control information to the multiple network devices, the first control information includes a detection task type, and the detection task type indicates the detection task that the controller requires the multiple network devices to perform. In addition, the controller receives first reported detection information sent by the first network device, the first reported detection information is obtained by the first network device according to the first detection information, the first detection information is the detection information obtained from the first data message before the first network device sends the first data message to the next hop network device of the first network device, the first reported detection information includes a first detection node identifier, a first sequence number and a first acquisition data, wherein the first detection node identifier indicates the position of the network device processing the first detection information in the detection domain, the first sequence number indicates the sequence number of the first data message including the first detection information, the first acquisition data is the acquisition data corresponding to the first acquisition information determined by the first network device according to the first acquisition information in the first detection information, the first acquisition information indicates the acquisition information corresponding to the detection task type, and the multiple network devices include the first network device.

[0017] Based on the solution provided in the embodiment, each network device in the detection domain can use the detection information included in the data packet to realize information collection for the detection task required by the controller according to the control information sent by the controller, thereby realizing the in-path collection of data packets on the transmission path and the detection of the transmission path while ensuring the message forwarding performance.

[0018] In a possible implementation manner of the second aspect, the detection task type is packet loss detection, the first control information also includes a detection start time and a detection end time, the first network device is a head node device of the detection domain, the first data packet is the first data packet sent by the first network device to the next-hop network device of the first network device from the detection start time, and the first acquisition data includes a device identifier of the first network device. The method also includes, the controller receiving second reported detection information sent by the first network device, the second reported detection information is determined by the first network device according to the second detection information, the second detection information is detection information obtained from the second data packet before the first network device sends the second data packet to the next-hop network device of the first network device, the second reported detection information includes a second detection node identifier, a second sequence number and second acquisition data, the second acquisition data includes the device identifier of the first network device, the second sequence number is greater than the first sequence number, the second detection node identifier is the same as the first detection node identifier, and the second data packet is the last data packet sent by the first network device to the next-hop network device of the first network device before the detection end time.

[0019] In another possible implementation manner of the second aspect, the method also includes, the controller receiving third reported detection information sent by the second network device, the third reported detection information including a third detection node identifier and third collection data, the third detection node identifier indicating the position of the second network device in the detection domain, the third collection data including the device identifier of the second network device, the third reported detection information also including a third sequence number, a fourth sequence number and a fifth sequence number, wherein the third sequence number is the minimum sequence number among the sequence numbers of multiple data packets received by the second network device within a time period obtained by adding a predetermined time period to the detection start time and the detection end time, the fourth sequence number is the missing sequence number among the sequence numbers of the multiple data packets received by the second network device within the time period, the fifth sequence number is the maximum sequence number among the sequence numbers of the multiple data packets received by the second network device within the time period, the second network device is an intermediate node device or a tail node device in the detection domain, and the multiple network devices include the second network device.

[0020] In another possible implementation manner of the second aspect, the method further includes: the controller determining a packet loss rate according to the first reported detection information, the second reported detection information, and the third reported detection information.

[0021] In another possible implementation of the second aspect, the method further includes: the controller determines fourth reported detection information according to the fourth sequence number, the value of the fourth detection node identifier included in the fourth reported detection information is the smallest among all reported detection information including the fourth sequence number received by the controller. The controller determines a packet loss location node according to fourth collected data included in the fourth reported detection information.

[0022] In the first aspect and any possible implementation of the first aspect, or in the second aspect and any possible implementation of the second aspect, optionally, the first detection information also includes a flow identifier, and the flow identifier indicates a data flow to which the first data packet belongs.

[0023] In the first aspect and any possible implementation of the first aspect, or in the second aspect and any possible implementation of the second aspect, optionally, the first detection information also includes a first length and a first version number, wherein the first length indicates the length of the first detection information, and the first version number indicates the protocol version of the first detection information.

[0024] In a third aspect, a first network device is provided, wherein the first network device has a function of implementing the first network device behavior in the above method. The function can be implemented based on hardware, or can be implemented based on hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above function.

[0025] In one possible design, the structure of the first network device includes a processor and an interface, and the processor is configured to support the first network device to perform the corresponding functions in the above method. The interface is used to support communication between the first network device and the second network device, send information or instructions involved in the above method to the second network device, or receive information or instructions involved in the above method from the second network device. The first network device may also include a memory, which is coupled to the processor and stores necessary program instructions and data for the first network device.

[0026] In another possible design, the first network device includes: a processor, a transmitter, a receiver, a random access memory, a read-only memory, and a bus. The processor is respectively coupled to the transmitter, the receiver, the random access memory, and the read-only memory through the bus. When the first network device needs to be run, it is started by the basic input / output system solidified in the read-only memory or the bootloader boot system in the embedded system to guide the first network device into a normal operating state. After the first network device enters the normal operating state, the application program and the operating system are run in the random access memory, so that the processor executes the method in the first aspect or any possible implementation of the first aspect.

[0027] In a fourth aspect, a first network device is provided, the first network device comprising: a main control board and an interface board, and further, a switching network board. The first network device is used to execute the method in the first aspect or any possible implementation of the first aspect. Specifically, the first network device comprises a module for executing the method in the first aspect or any possible implementation of the first aspect.

[0028] In a fifth aspect, a first network device is provided, the first network device comprising a controller and a first forwarding sub-device. The first forwarding sub-device comprises: an interface board, and further, may also comprise a switching network board. The first forwarding sub-device is used to perform the function of the interface board in the fourth aspect, and further, may also perform the function of the switching network board in the fourth aspect. The controller comprises a receiver, a processor, a transmitter, a random access memory, a read-only memory, and a bus. The processor is respectively coupled to the receiver, the transmitter, the random access memory, and the read-only memory through the bus. When the controller needs to be run, it is started by the basic input / output system solidified in the read-only memory or the bootloader boot system in the embedded system, and the controller is guided to enter a normal operating state. After the controller enters the normal operating state, the application program and the operating system are run in the random access memory, so that the processor performs the function of the main control board in the fourth aspect.

[0029] In a sixth aspect, a computer storage medium is provided for storing programs, codes or instructions used for the above-mentioned first network device. When a processor or hardware device executes these programs, codes or instructions, the functions or steps of the first network device in the above aspect can be completed.

[0030] In a seventh aspect, a controller is provided, wherein the controller has the function of implementing the controller behavior in the above method. The function can be implemented based on hardware, or can be implemented based on hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.

[0031] In one possible design, the structure of the controller includes a processor and an interface, and the processor is configured to support the controller to perform the corresponding functions in the above method. The interface is used to support communication between the controller and the second network device, send information or instructions involved in the above method to the second network device, or receive information or instructions involved in the above method from the second network device. The controller may also include a memory, which is coupled to the processor and stores program instructions and data necessary for the controller.

[0032] In another possible design, the controller includes: a processor, a transmitter, a receiver, a random access memory, a read-only memory, and a bus. The processor is respectively coupled to the transmitter, the receiver, the random access memory, and the read-only memory through the bus. When the controller needs to be run, it is started by the basic input / output system solidified in the read-only memory or the bootloader boot system in the embedded system to guide the controller into a normal operating state. After the controller enters the normal operating state, the application program and the operating system are run in the random access memory, so that the processor executes the method in the first aspect or any possible implementation of the first aspect.

[0033] In an eighth aspect, a controller is provided, the controller comprising: a main control board and an interface board, and further, a switching network board. The controller is used to execute the method in the first aspect or any possible implementation of the first aspect. Specifically, the controller includes a module for executing the method in the first aspect or any possible implementation of the first aspect.

[0034] In the ninth aspect, a controller is provided, the controller comprising a main control device and a first forwarding sub-device. The first forwarding sub-device comprises: an interface board, and further, may also comprise a switching network board. The first forwarding sub-device is used to perform the function of the interface board in the fourth aspect, and further, may also perform the function of the switching network board in the fourth aspect. The main control device comprises a receiver, a processor, a transmitter, a random access memory, a read-only memory, and a bus. The processor is respectively coupled to the receiver, the transmitter, the random access memory, and the read-only memory through the bus. When the main control device needs to be run, it is started by the basic input / output system solidified in the read-only memory or the bootloader boot system in the embedded system, and the main control device is guided to enter a normal operating state. After the main control device enters a normal operating state, an application program and an operating system are run in the random access memory, so that the processor performs the function of the main control board in the fourth aspect.

[0035] In the tenth aspect, a computer storage medium is provided for storing programs, codes or instructions used for the above-mentioned controller. When a processor or hardware device executes these programs, codes or instructions, the functions or steps of the controller in the above-mentioned aspects can be completed.

[0036] In the eleventh aspect, a network system is provided, comprising a first network device and a controller, wherein the first network device is the first network device in the third aspect, the fourth aspect, or the fifth aspect, and the controller is the controller in the seventh aspect, the eighth aspect, or the ninth aspect.

[0037] The data message detection method provided in the embodiment of the present application, specifically, provides an in-situ flow information telemetry (in-band flow information telemetry) method. Each network device in the detection domain can use the detection information included in the data message to realize information collection for the detection task required by the controller according to the control information sent by the controller, thereby realizing the in-situ collection of data messages on the transmission path and the detection of the transmission path while ensuring the message forwarding performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 A schematic diagram of a network structure of an embodiment of the present application;

[0039] Figure 2 This is another schematic diagram of a network structure according to an embodiment of the present application;

[0040] Figure 3 A flow chart of a method for detecting a data message according to an embodiment of the present application;

[0041] Figure 4 A detection information format diagram of an embodiment of the present application;

[0042] Figure 5 A schematic diagram of the structure of a first network device according to an embodiment of the present application;

[0043] Figure 6 A schematic diagram of the hardware structure of a first network device according to an embodiment of the present application;

[0044] Figure 7 A schematic diagram of the hardware structure of another first network device according to an embodiment of the present application;

[0045] Figure 8 A schematic diagram of the structure of a controller according to an embodiment of the present application;

[0046] Fig. 9 A schematic diagram of the hardware structure of the controller according to an embodiment of the present application. DETAILED DESCRIPTION

[0047] The following describes the embodiments in detail.

[0048] Figure 1 Schematic diagram of a network structure of an embodiment of the present application. The network includes a controller and multiple network devices. The multiple network devices are connected via communication links for transmitting data streams. Figure 1 As shown, external node device 1, head node device, intermediate node device 1, intermediate node device 2, tail node device and external node device 2 are connected in sequence through communication links. Data flow can reach external node device 2 from external node device 1 via head node device, intermediate node device 1, intermediate node device 2 and tail node device.

[0049] The controller can be used to collect information and detect the performance of the transmission path of the data packets on the transmission path between the above-mentioned multiple network devices, and the transmission path performance detection includes the detection of packet loss rate and packet loss location. In an embodiment of the present application, the transmission path may include the path through which the data stream flows. The controller can determine the detection domain, and the detection domain is the detection range determined by the controller. Specifically, in a possible implementation, the network engineer sends the device information of the transmission path to be detected to the controller through the network management device or the user device, and the device information includes the first node device identifier and the tail node device identifier of the transmission path to be detected. The controller can receive the device information through, for example, a northbound interface (northboundinterface, NBI). In another possible implementation, the controller determines the first node device identifier and the tail node device identifier of the transmission path to be detected according to a predetermined control strategy. The controller can obtain the topology of multiple network devices in the network, so that the controller determines the first node device identifier and the tail node device identifier of the transmission path to be detected according to the topology of multiple network devices. For example, the predetermined control strategy is to collect detection information and perform performance detection on the transmission path between the forwarding devices included in the data center (data center, DC). The controller determines the head node device identifier and the tail node device identifier of the transmission path to be detected according to the topology of the DC.

[0050] The controller determines the detection domain according to the first node device identifier and the tail node device identifier, and determines the first node device and the tail node device of the detection domain. On the transmission path in the detection domain, the network device located between the first node device and the tail node device is an intermediate node device, such as Figure 1 The intermediate node device 1 and the intermediate node device 2 in the.

[0051] Optionally, the controller may also determine a flow identifier. A network engineer may send the flow identifier to the controller through a network management device or a user device, or the controller may determine the flow identifier according to a predetermined control strategy. The flow identifier is used to identify a data flow. The controller determines which data flow on the transmission path to be detected to collect detection information through the flow identifier.

[0052] Figure 1 In the detection domain shown, the head node device, the intermediate node device 1, the intermediate node device 2 and the tail node device communicate through a transmission path. In a possible implementation, Figure 1 The detection domain may include multiple transmission paths. For example, the intermediate node device 1 is connected to the intermediate node device 3 (not shown) through a link, and the intermediate node device 3 is connected to the tail node device through a link. In this way, the data stream can be sent from the intermediate node device 1 to the intermediate node device 2 and the intermediate node device 3 in a load-sharing manner.

[0053] Figure 2 This is another schematic diagram of a network structure of an embodiment of the present application. Figure 2 exist Figure 1 Based on the network structure shown in the figure, the tail node device 2 is added. Figure 1 The tail node device in Figure 2 In FIG, it is represented as tail node device 1. Tail node device 2 is connected to intermediate node device 1 through a link, and tail node device 2 is also connected to external node device 2 through a link. Figure 2 In the detection domain shown, the detection domain has multiple transmission path exits ( Figure 2 In the example, there are 2 nodes in the middle), that is, tail node device 1 is connected to external node device 2 through the port of tail node device 1, and tail node device 2 is connected to external node device 2 through the port of tail node device 2. In this way, data streams can be sent from middle node device 1 to middle node device 2 and tail node device 2 in a load-sharing manner.

[0054] The controller communicates with each network device in the detection domain through a communication link. The controller can send control information (such as Figure 1 and Figure 2, the controller points to each network device in the detection domain as shown by the dotted line with an arrow), the control information includes a detection task type, and the detection task type indicates the detection task that the controller requires the network device in the detection domain to perform. For example, the detection task type is packet loss detection. In this way, the first node device in the detection domain determines the collection information in the detection information included in the data message for the detection task type of packet loss detection, and the collection information indicates that the device identifier is to be collected. The first node device collects the device identifier of the first node device according to the indication of the collection information. The first node device generates reported detection information, and the reported detection information corresponds to the detection information, and the reported detection information includes the device identifier of the first node device. The first node device sends the data message carrying the detection information to the next-hop network device (intermediate node device) of the first node device. The detection information also includes a detection node identifier and a sequence number, the detection node identifier indicates the position of the network device (for example, the first node device) that processes the detection information in the detection domain, and the sequence number indicates the sequence number of the data message including the detection information. In this way, the intermediate node devices and the tail node devices in the detection domain all collect the device identifier according to the indication of the collection information in the detection information according to the above implementation method, and update the detection node identifier in the detection information. In this way, the detection information is transmitted along the transmission path in the detection domain with the data message, and the network device through which the data message flows can collect data according to the detection information in the data message.

[0055] The controller also sends information carrying a first node identifier to the first node device determined by the controller. The first node identifier can be represented by a device identifier or an IP address of a device. After receiving the first node identifier, the first node device can determine that it is the first node device according to the first node identifier. Thus, the first node device can perform an operation of encapsulating detection information in a data message. Optionally, the first node identifier can be carried in the aforementioned control information sent by the controller to the first node device.

[0056] The controller also sends information carrying the tail node identifier to the tail node device determined by the controller. The tail node identifier can be represented by a device identifier or an IP address of a device. After receiving the tail node identifier, the tail node device can determine that it is a tail node device according to the tail node identifier. Thus, the tail node device can perform an operation of encapsulating detection information in a data message. Optionally, the tail node identifier can be carried in the aforementioned control information sent by the controller to the tail node device.

[0057] The control information may also include a flow identifier so that the network equipment in the detection domain detects the data flow indicated by the flow identifier. In an embodiment of the present application, the data flow can be distinguished according to the service type of the transmitted data, such as a video stream and a voice stream, etc., and the data flow can also be distinguished according to part or all of the information in the five-tuple information. The flow identifier can be identification information directly configured by the controller or the network management device, or it can be identification information determined by the controller or the network management device according to the five-tuple information.

[0058] Each network device in the detection domain can send the reported detection information to the controller (such as Figure 1 and Figure 2 , each network device in the detection domain is shown by a solid line with an arrow pointing to the controller). For example, the intermediate node device in the detection domain performs an information collection operation according to the indication of the detection information in the data message received from the previous-hop node device of the intermediate node device. After the intermediate node device completes the collection, it sends the generated reported detection information to the controller. The controller determines the performance of the transmission path based on the received reported detection information. Each network device in the detection domain can send the reported detection information corresponding to each data message to the controller separately, or can merge the reported detection information corresponding to multiple data messages and send them to the controller. For example, after processing the detection information 1 corresponding to the data message 1, the intermediate node device in the detection domain sends the reported detection information 1 generated according to the detection information 1 to the controller; after processing the detection information 2 corresponding to the data message 2, the intermediate node device sends the reported detection information 2 generated according to the detection information 2 to the controller. Alternatively, after processing detection information 1 corresponding to data message 1 and detection information 2 corresponding to data message 2, the intermediate node device combines reported detection information 1 and reported detection information 2 to generate reported detection information 3 and sends the result to the controller.

[0059] Through the above implementation, by encapsulating detection information in the data message on the transmission path, information collection of the data message on the transmission path is achieved, thereby achieving the collection of data messages on the transmission path while ensuring message forwarding performance.

[0060] Figure 3 This is a flow chart of a method for detecting a data message according to an embodiment of the present application. Specifically, Figure 3 The invention relates to a flow chart of an in-situ flow information telemetry (in-band flow information telemetry) method. Figure 3 The method shown can be applied in Figure 1 or Figure 2 In the network structure shown. The method includes:

[0061] S101. A controller determines a detection domain, where the detection domain is a detection range determined by the controller and includes multiple network devices.

[0062] According to the aforementioned implementation, in a possible implementation, the controller may receive device information of a transmission path to be detected sent by a network management device or a user device, and the device information includes a first node device identifier and a tail node device identifier of the transmission path to be detected. For example, a network engineer requires detection of a transmission path between a first network device and a second network device. The network engineer sends the device identifier of the first network device and the device identifier of the second network device to the controller through a network management device or a user device. After receiving the device identifier of the first network device and the device identifier of the second network device, the controller uses the first network device as the first node device of the transmission path to be detected and the second network device as the tail node device of the transmission path to be detected, thereby determining the detection domain. In another possible implementation, the controller uses the first network device as the first node device of the transmission path to be detected and the second network device as the tail node device of the transmission path to be detected according to the topology of multiple network devices. Wherein, the transmission path to be detected between the first network device and the second network device includes at least one intermediate node device. In another possible implementation, the controller may determine the head node device of the detection domain according to the source address of the data flow, and determine the tail node device of the detection domain according to the destination address of the data flow, so that the controller determines the detection domain.

[0063] like Figure 1 As shown, the detection domain determined by the controller includes the head node device, the intermediate node device 1, the intermediate node device 2 and the tail node device. Figure 2 As shown, the detection domain determined by the controller includes a head node device, an intermediate node device 1, an intermediate node device 2, a tail node device 1, and a tail node device 2.

[0064] According to the aforementioned embodiment, the controller may also determine a flow identifier. The flow identifier is used to identify a data flow. The controller determines which data flow on the transmission path to be detected to collect detection information through the flow identifier. For example, the flow identifier determined by the controller is 01, and when the controller detects the transmission path to be detected, it detects data flow 01.

[0065] S102: The controller sends first control information to the multiple network devices, where the first control information includes a detection task type, and the detection task type indicates a detection task that the controller requires the multiple network devices to perform.

[0066] S103. The first network device receives the first control information sent by the controller.

[0067] The controller may send the first control information to multiple network devices in the detection domain. The detection task type included in the first control information indicates the detection task that the controller requires the multiple network devices to perform. For example, the controller sends the first control information to the head node device, the intermediate node device, and the tail node device in the detection domain, and the detection task type included in the first control information is packet loss detection. In this way, after receiving the first control information sent by the controller, the head node device, the intermediate node device, and the tail node device in the detection domain can determine that the detection task to be performed is packet loss detection according to the detection task type.

[0068] Optionally, the first control information may also include a flow identifier. In this way, after receiving the first control information sent by the controller, the head node device, the intermediate node device and the tail node device in the detection domain may perform corresponding detection tasks for the data flow indicated by the controller.

[0069] When the first network device is the first node device in the detection domain, the controller can send information carrying the first node identifier to the first network device. The first node identifier can be represented by a device identifier or an IP address of the device, etc. After the first network device receives the information carrying the first node identifier, it can determine that it is the first node device. Thus, the first network device can perform an operation of encapsulating detection information in a data message. In a possible implementation, the controller does not send the information carrying the first node identifier separately, but the controller can carry the first node identifier in the control information sent to the first network device as the first node device, so as to notify the first network device that it is the first node device.

[0070] When the first network device is a tail node device in the detection domain, the controller may send information carrying a tail node identifier to the first network device. The tail node identifier may be represented by a device identifier or an IP address of a device, etc. After the first network device receives the information carrying the tail node identifier, it may determine that it is a tail node device. Thus, the first network device may perform an operation of deleting the detection information in a data message. In a possible implementation, the controller does not send information carrying a tail node identifier separately, but the controller may carry the tail node identifier in the control information sent to the first network device as a tail node device, so as to notify the first network device that it is a tail node device.

[0071] S104. The first network device receives a first data packet sent by a previous-hop network device of the first network device, where the first data packet includes first detection information, and the first detection information includes a first detection node identifier, a first sequence number, and first collection information, wherein the first detection node identifier indicates a position of a network device that processes the first detection information in a detection domain, the first sequence number indicates a sequence number of the first data packet including the first detection information, the first collection information indicates collection information corresponding to the detection task type, and the detection domain is a detection range determined by the controller, the detection domain includes multiple network devices, and the multiple network devices include the first network device.

[0072] The first detection information includes a first detection node identifier, a first serial number and first collection information. Figure 4 is a detection information format diagram of an embodiment of the present application. Specifically, the first detection node identifier corresponds to Figure 4 The first detection node identifier indicates the location of the network device that processes the first detection information in the detection domain. For example, in combination with Figure 1 , in the head node device, the value of the first detection node identifier (next hop) is 0; in the intermediate node device 1, the value of the first detection node identifier is updated to 1; in the intermediate node device 2, the value of the first detection node identifier is updated to 2; in the tail node device, the value of the first detection node identifier is updated to 3. That is, when the first data packet carrying the first detection information is processed by a network device in the detection domain, the network device increases the value of the first detection node identifier by a step value, for example, the step value is 1. Similarly, Figure 2 The network devices in the detection domain use the same method as above to update the first detection node identifier. It should be noted that: if the value of the first detection node identifier is updated to 1 in the intermediate node device 1, then the value of the first detection node identifier is updated to 2 in the intermediate node device 2 and the tail node device 2.

[0073] The first serial number corresponds to Figure 4The first sequence number field in the detection domain. The first sequence number indicates the sequence number of the first data packet including the first detection information. The value of the first sequence number is determined by the head node device in the detection domain, and the starting value of the first sequence number is determined by the head node device. For example, assume that data stream 01 includes a total of 1000 data packets. The initial value of the first sequence number determined by the head node device is 0. When the head node device receives the first control information sent by the controller and encapsulates the first detection information for the data packet in the data stream 01 according to the first control information, assuming that the data packet located in the head node device is the 100th data packet in the data stream 01 (recorded as data packet 100), the head node device sets the value of the sequence number of data packet 100 to 0. Subsequently, the value of the sequence number of the 101st data packet in the data stream 01 (recorded as data packet 101) is set to 100.

[0074] The first collected information corresponds to Figure 4 The collection information field in the detection domain. The first collection information indicates the collection information corresponding to the detection task type. The network equipment in the detection domain collects corresponding information according to the indication of the first collection information. For example, the detection task type is packet loss detection, and the content of the first collection information is the device identification of the network device. Specifically, the value of the first collection information is 01, and 01 means that the device identification of the network device is collected. For example, the intermediate node device in the detection domain collects the device identification of the intermediate node device according to the indication of the first collection information (requiring the collection of the device identification of the network device). In the implementation manner of the present application, optionally, the device identification can be a loopback IP address of the network device.

[0075] Optionally, the first detection information may also include a length field and a version field. Figure 4 As shown, the length field indicates the length of the first detection information, so that when the network device processes the first detection information, it can locate the first detection information according to the indication of the length field. The version field indicates the version of generating the first detection information, so that the network devices in the detection domain can process the first detection information according to a unified version.

[0076] Optionally, the length of the version field is 2 bits, the length of the length field is 4 bits, the length of the next hop field is 6 bits, the length of the sequence number field is 16 bits, and the length of the collection information field is 32 bits. In addition, Figure 4 A collection information field is shown in FIG. 1 . In practical applications, the first detection information may include more than one collection information field, so that the network device in the detection domain can process multiple collection information fields and collect multiple information at the same time.

[0077] When the first network device is a head node device in a detection domain, the first network device may execute step S1041: S1041: the first network device encapsulates the first detection information in the first data packet.

[0078] Specifically, the first network device as the first node device, after receiving the first control information sent by the controller, performs the detection task indicated by the first control information. During the period when the first network device performs the detection task, the first network device performs the operation of encapsulating the first detection information on the data message processed by the first network device. For example, the first data message is a data message processed by the first network device during the period when the first network device performs the detection task, and the first network device encapsulates the first detection information into the first data message. In addition, the first network device sets the first detection node identifier, the first sequence number and the first acquisition information. For example, the first network device receives data message 01 from the previous hop network device of the first network device (a network device connected to the first network device outside the detection domain), and data message 01 is the data message received by the first network device at the beginning of the detection task. The first network device encapsulates detection information 01 in data message 01, the detection node identifier value of the detection information 01 is 0, the sequence number value is 0, and the acquisition information value is 01 (indicating the device identifier of the acquisition network device). After the first network device encapsulates detection information 01 in data message 01, it can perform corresponding collection operations according to the subsequent S105. Then, the first network device receives data message 02 from the previous-hop network device of the first network device, and data message 02 is the next data message of data message 01. The first network device encapsulates detection information 02 in data message 02, and the value of the detection node identifier of the detection information 02 is 0, the value of the sequence number is 1, and the value of the collection information is 01. After the first network device encapsulates detection information 02 in data message 02, it can perform corresponding collection operations according to the subsequent S105.

[0079] Optionally, when the first network device as the first node device encapsulates the first detection information in the first data packet, the encapsulation position of the first detection information can be determined according to the type of the data packet. In a possible implementation, the first network device can add a type-length-value (TLV) field in the first data packet, so that the first network device locates the first detection information through the TLV field. For example, the first data packet is an MPLS packet. The first network device adds a generic associated channel header label (GAL) to the MPLS packet, and the first network device adds the first detection information after the GAL. For another example, the first data packet is an Internet Protocol version 6 (IPv6) packet, and the IPV6 packet includes a hop by hop (HBH) extension header. The first network device adds a TLV in the HBH extension header to locate the first detection information.

[0080] When the first network device is an intermediate node device in the detection domain, the first network device can receive the first data message sent by the previous hop network device of the first network device (assuming that the previous hop network device of the first network device is the first node device), and the first data message includes the first detection information. The first network device can perform the subsequent collection operation indicated in S105 according to the first detection information.

[0081] When the first network device is a tail node device in the detection domain, the first network device can receive the first data packet sent by the previous hop network device of the first network device (assuming that the previous hop network device of the first network device is an intermediate node device), and the first data packet includes the first detection information. The first network device can perform the subsequent collection operation indicated by S105 according to the first detection information. After the first network device completes the collection operation, it can also perform the following operation indicated by S1051: S1051, the first network device deletes the first detection information in the first data packet. The first network device transmits the first data packet in which the first detection information is deleted to the next hop network device outside the detection domain. In this way, it can be avoided that the network devices outside the detection domain cannot recognize the first detection information in the first data packet.

[0082] S105. The first network device determines first collected data corresponding to the first collected information according to the first collected information, and the first network device updates the first detection node identifier.

[0083] S106. The first network device sends the first data packet carrying the updated first detection information to a next-hop network device of the first network device.

[0084] Combined with the explanation in S104 above, for example, when the first network device is the first node device in the detection domain, the first network device receives data packet 01, and encapsulates detection information 01 in data packet 01, the detection node identifier value of the detection information 01 is 0, the sequence number value is 0, and the collection information value is 01 (indicating the device identifier of the collection network device). The first network device collects the device identifier of the first network device (for example, the device identifier of the first node device is 001) according to the indication of the value 01 of the collection information in the detection information 01, and updates the value of the detection node identifier to 0 (still on the local jump device). Then, the first network device stores the collected data after collection, wherein the value of the collected data is the device identifier of the first network device. Specifically, the first network device generates the reported detection information 01 corresponding to the detection information 01 according to the detection information 01, and the reported detection information 01 includes the detection node identifier with a value of 0, the sequence number with a value of 0 and the collection data with a value of 001. The first network device stores the reported detection information 01. After processing the data message 01, the first network device sends the data message 01 carrying the updated detection information 01 to the intermediate node device in the detection domain according to the original transmission path of the data message 01. Similarly, the first network device performs the same operation on the detection information 02 in the data message 02.

[0085] When the first network device is an intermediate node device in the detection domain, the first network device receives the data packet 01 from the first node device, and the data packet 01 includes the detection information 01, the detection node identifier of the detection information 01 has a value of 0, the sequence number has a value of 0, and the collection information has a value of 01. The first network device collects the device identifier of the first network device (for example, the device identifier of the intermediate node device is 002) according to the indication of the value 01 of the collection information in the detection information 01, and updates the value of the detection node identifier to 1. Then, the first network device stores the collected data after collection, wherein the value of the collected data is the device identifier of the first network device. Specifically, the first network device generates the reported detection information 01 corresponding to the detection information 01 according to the detection information 01, and the reported detection information 01 includes the detection node identifier with a value of 1, the sequence number with a value of 0, and the collection data with a value of 002. The first network device stores the reported detection information 01. After processing the data message 01, the first network device sends the data message 01 carrying the updated detection information 01 to the next-hop network device (e.g., tail node device) of the intermediate node device in the detection domain according to the original transmission path of the data message 01. Similarly, the first network device performs the same operation on the detection information 02 in the data message 02.

[0086] When the first network device is a tail node device in the detection domain, the first network device receives the data packet 01 from the intermediate node device, the data packet 01 includes the detection information 01, the detection node identifier of the detection information 01 has a value of 1, the sequence number has a value of 0, and the collection information has a value of 01. The first network device collects the device identifier of the first network device (for example, the device identifier of the tail node device is 003) according to the indication of the value 01 of the collection information in the detection information 01, and updates the value of the detection node identifier to 2. Then, the first network device stores the collected data after collection, wherein the value of the collected data is the device identifier of the first network device. Specifically, the first network device generates the reported detection information 01 corresponding to the detection information 01 according to the detection information 01, the reported detection information 01 includes the detection node identifier with a value of 2, the sequence number with a value of 0, and the collection data with a value of 003. The first network device stores the reported detection information 01. After processing the data message 01, the first network device deletes the detection information 01 in the data message 01, and sends the data message 01 that does not include the detection information 01 to the next-hop network device of the tail node device in the detection domain (e.g., a network device connected to the tail node device outside the detection domain) according to the original transmission path of the data message 01. Similarly, the first network device performs the same operation on the detection information 02 in the data message 02.

[0087] Optionally, the first network device and the controller may further perform the following S107 and S108 operations:

[0088] S107. The first network device sends first reporting detection information to the controller, where the first reporting detection information includes the updated first detection node identifier, the first serial number, and the first collected data.

[0089] S108. The controller receives the first reported detection information sent by the first network device.

[0090] The first network device can send the first reported detection information collected and stored to the controller. Correspondingly, the controller can perform performance detection on the transmission path in the detection domain based on the received first reported detection information. For example, the controller calculates the packet loss rate and packet loss location based on the collected reported detection information of each network device in the detection domain. Optionally, the first network device can send the reported detection information corresponding to each data packet collected and stored to the controller, or the first network device can select the reported detection information corresponding to each data packet collected and stored based on the first control information issued by the controller, and then send part of the reported detection information to the controller. In addition, the first network device can also merge multiple reported detection information into one reported detection information and send it to the controller.

[0091] The data packet detection method provided in this embodiment specifically relates to an on-path flow information telemetry method. Each network device in the detection domain can use the detection information included in the data packet to realize information collection for the detection task required by the controller according to the control information sent by the controller, thereby realizing on-path collection of data packets on the transmission path and detection of the transmission path while ensuring the message forwarding performance.

[0092] The following implementation is based on the above S101-S106, and is described by taking the detection task type in the first control information as packet loss detection as an example. Specifically, the detection task type is packet loss detection, the first control information also includes the detection start time and the detection end time, the first network device is the first node device of the detection domain, the first data packet is the first data packet sent by the first node device to the next hop network device of the first node device from the detection start time, the first collected data includes the device identifier of the first node device, and the method also includes:

[0093] S201. The first node device receives a second data message sent by a previous-hop network device of the first node device.

[0094] S202: The head node device encapsulates second detection information in the second data message, where the second detection information includes a second detection node identifier, a second serial number, and second collection information.

[0095] S203. The first node device determines the second collection data corresponding to the second collection information based on the second collection information, and the first node device updates the second detection node identifier, the second collection data includes the device identifier of the first node device, the second serial number is greater than the first serial number, and the second detection node identifier is the same as the first detection node identifier.

[0096] S204. The first node device sends the second data packet carrying the updated second detection information to the next-hop network device of the first node device. The second data packet is the last data packet sent by the first node device to the next-hop network device of the first node device before the detection ends.

[0097] S205. The first node device sends first reported detection information and second reported detection information to the controller, wherein the first reported detection information includes the updated first detection node identifier, the first serial number and the first collected data, and the second reported detection information includes the updated second detection node identifier, the second serial number and the second collected data.

[0098] S206. The controller receives the first reported detection information and the second reported detection information sent by the head node device.

[0099] According to the aforementioned implementation mode, after the first node device receives the first control information sent by the controller, the first node device can determine that the detection task performed by the first node device is packet loss detection according to the detection task type in the first control information. In addition, the first node device can also determine the detection start time and detection end time of packet loss detection according to the first control information. Assume that data message 01 (corresponding to the above-mentioned first data message) is the first data message sent by the first node device to the next-hop network device of the first node device from the detection start time. The first node device can encapsulate detection information 01 in data message 01 according to the aforementioned implementation mode, and obtain the reported detection information 01 according to the detection information 01. Among them, the value of the detection node identifier of the detection information 01 is 0, the value of the sequence number is 0, and the value of the collection information is 01 (indicating the device identifier of the collection network device). The value of the detection node identifier of the reported detection information 01 is 0, the value of the sequence number is 0, and the value of the collection data is 001 (for example, the device identifier of the first node device is 001).

[0100] During the time period between the detection start time and the detection end time, the first node device processes multiple data packets according to the aforementioned implementation method, thereby obtaining and storing multiple reported detection information, and sending multiple processed data packets to the next-hop network device of the first node device.

[0101] The first node device also receives a data message 101 (corresponding to the second data message mentioned above) sent by the previous-hop network device of the first node device, and the data message 101 is the last data message sent by the first node device to the next-hop network device of the first node device before the detection ends. It can be seen that 100 data messages are sent to the next-hop network device of the first node device within the time period between the detection start time and the detection end time. The first node device encapsulates detection information 101 in the data message 101, and the detection information 101 includes a detection node identifier value of 0, a sequence number value of 100, and a collection information value of 01. The first node device determines the corresponding reported detection information 101 based on the collection information of the detection information 101, and updates the detection node identifier. The detection node identifier value included in the reported detection information 101 is 0, the sequence number value is 100, and the collection data value is 001.

[0102] After obtaining the reported detection information 01, the first node device stores the reported detection information 01 in the cache area of ​​the first node device, and then the first node device sends the data packet 01 carrying the updated detection information 01 to the next-hop network device of the first node device. After obtaining the reported detection information 101, the first node device stores the reported detection information 101 in the cache area of ​​the first node device, and then the first node device sends the data packet 101 carrying the updated detection information 101 to the next-hop network device of the first node device. The first node device also sends the reported detection information 01 and the reported detection information 101 to the controller. The controller receives the reported detection information 01 and the reported detection information 101, so that the controller can perform packet loss detection on the transmission path in the detection domain according to the reported detection information 01 and the reported detection information 101. It should be understood that the first node device can send the reported detection information corresponding to the first data packet in the detection cycle and the reported detection information corresponding to the last data packet to the controller. The head node device may also send the reported detection information corresponding to all data messages within the detection period to the controller.

[0103] The following implementation is based on the above S101-S106 and is described in combination with the above S201-S206. Specifically, the first network device is an intermediate node device of the detection domain, the first data message is a data message received by the intermediate node device from the first node device from the start time of the detection, the first collected data includes the device identification of the first node device, and the method further includes:

[0104] S301: The intermediate node device increases the value of the detection end time by a predetermined time period, and updates the value of the detection end time.

[0105] S302. The intermediate node device receives a second data packet sent by the previous-hop network device of the intermediate node device within a time period between the detection start time and the updated detection end time, wherein the second data packet includes second detection information, and the second detection information includes a second detection node identifier, a second serial number, and second collection information.

[0106] S303. The intermediate node device determines the second collection data corresponding to the second collection information based on the second collection information, and the intermediate node device updates the second detection node identifier, the second collection data includes the device identifier of the intermediate node device, the second sequence number is the maximum sequence number among the sequence numbers of multiple data packets received by the intermediate node device within the time period, the first data packet is the data packet received by the intermediate node device within the time period, and the first sequence number is the minimum sequence number among the sequence numbers of multiple data packets received by the intermediate node device within the time period.

[0107] S304: The intermediate node device sends the second data packet carrying the updated second detection information to the next-hop network device of the intermediate node device.

[0108] S305. The intermediate node device generates third reporting detection information, wherein the third reporting detection information includes a third detection node identifier, a third sequence number and third acquisition data, wherein the third detection node identifier is the same as the updated second detection node identifier, and the third acquisition data includes the device identifier of the intermediate node device, and the third sequence number is a missing sequence number among the sequence numbers of multiple data packets received by the intermediate node device within the time period, and the third sequence number is greater than the first sequence number and less than the second sequence number.

[0109] S306. The intermediate node device sends the first reported detection information, the second reported detection information and the third reported detection information to the controller, wherein the first reported detection information includes the updated first detection node identifier, the first serial number and the first collected data, and the second reported detection information includes the updated second detection node identifier, the second serial number and the second collected data.

[0110] S307: The controller receives the first reported detection information, the second reported detection information, and the third reported detection information sent by the intermediate node device.

[0111] In combination with the aforementioned implementation mode, after the intermediate node device receives the first control information sent by the controller, the intermediate node device can determine that the detection task performed by the first node device is packet loss detection based on the detection task type in the first control information. In addition, the intermediate node device can also determine the detection start time and detection end time of the packet loss detection based on the first control information. The intermediate node device increases the value of the detection end time by a predetermined duration and updates the value of the detection end time. For example, the detection start time is 10:00 on May 7, 2018, and the detection end time is 10:02 on May 7, 2018. The intermediate node device updates the detection end time to 10:05 on May 7, 2018, so that the intermediate node device can receive all data packets sent by the first node device within the detection period.

[0112] Combined with the description of S201-S206 above, the intermediate node device receives the data message 01 sent by the first node device, determines to report the detection information 01 according to the detection information 01, and updates the detection node identifier. Therefore, after being processed by the intermediate node device, the detection information 01 includes the detection node identifier value of 1, the sequence number value of 0, and the value of the collected information of 01; the detection node identifier value of the reported detection information 01 is 1, the sequence number value of 0, and the value of the collected data is 002 (for example, the device identifier of the intermediate node device is 002). The intermediate node device processes the multiple data messages sent by the first node device after the data message 01 according to the above implementation mode. Then, the intermediate node device receives the data message 101 sent by the first node device, determines to report the detection information 101 according to the detection information 101, and updates the detection node identifier. Therefore, after being processed by the intermediate node device, the detection information 101 includes a detection node identifier value of 1, a serial number value of 100, and a collection information value of 01; the detection node identifier value of the reported detection information 101 is 1, a serial number value of 100, and a collection data value of 002 (for example, the device identifier of the intermediate node device is 002).

[0113] After obtaining the reported detection information 01, the intermediate node device stores the reported detection information 01 in the buffer area of ​​the intermediate node device, and then the intermediate node device sends the data message 01 carrying the updated detection information 01 to the next-hop network device of the intermediate node device. After obtaining the reported detection information 101, the intermediate node device stores the reported detection information 101 in the buffer area of ​​the intermediate node device, and then the intermediate node device sends the data message 101 carrying the updated detection information 101 to the next-hop network device of the intermediate node device. Moreover, after the detection period ends, the intermediate node device can determine that the sequence number included in the reported detection information 01 is the smallest sequence number among the sequence numbers of multiple data messages received by the intermediate node device within the time period, and the sequence number in the reported detection information 101 is the largest sequence number among the sequence numbers of multiple data messages received by the intermediate node device within the time period.

[0114] Assume that the data packet 51 with the sequence number 50 is lost, that is, the intermediate node device cannot receive the data packet 51 sent by the first node device. The intermediate node device can determine that the data packet 51 with the sequence number 50 is not received based on the data packet with the smallest sequence number and the data packet with the largest sequence number received from the first node device, as well as the data packets corresponding to the sequence numbers between the smallest sequence number and the largest sequence number. The intermediate node device generates and reports detection information 51, and the detection node identifier value included in the detection information 51 is 1, the sequence number value is 50, and the value of the collected data is 002. The intermediate node device stores the detection information 51.

[0115] The intermediate node device also sends the reporting detection information 01 and the reporting detection information 101, as well as the reporting detection information 51 corresponding to the data packet 51 that is not received, to the controller. The controller can determine the total number of data packets sent by the first node device based on the reporting detection information sent by the first node device, and the controller can determine the number of packet losses in the transmission path from the first node device to the intermediate node device based on the reporting detection information sent by the intermediate node device (for example, determine that data packet 21, data packet 45 and data packet 51 are lost according to the above method). In this way, the controller can determine the packet loss rate of the transmission path from the first node device to the intermediate node device.

[0116] In the description of the above implementation, the intermediate node device is used as an example. In fact, the above S301-S307 can also be applied to the tail node device. Further, according to the above implementation, the tail node device can also delete the detection information in the data message and restore the data message to a data message without the detection information.

[0117] In the description of the above implementation, the data message with the smallest sequence number and the data message with the largest sequence number received by the intermediate node device are described by taking the first data message (first data message) and the last data message (second data message) sent by the first node device within the detection period as an example. In actual applications, packet loss may occur during the transmission process, or a network device in the detection domain may send a data message to two network devices in a load sharing manner (such as Figure 2 Therefore, each network device in the detection domain only needs to determine the reporting detection information corresponding to the data message with the smallest sequence number and the reporting detection information corresponding to the data message with the largest sequence number within the detection period, and then the network device determines the reporting detection information corresponding to the data message lost between the data message with the smallest sequence number and the data message with the largest sequence number.

[0118] In a possible implementation, the network device in the detection domain can merge multiple reported detection information and report the merged reported detection information to the controller. For example, in the above S306, the intermediate node device generates fourth reported detection information based on the first reported detection information, the second reported detection information and the third reported detection information, and the fourth reported detection information includes a detection node identifier (the location of the intermediate node device in the detection domain), a device identifier of the intermediate node device, and a sequence number included in the first reported detection information, a sequence number included in the second reported detection information and a sequence number included in the third reported detection information.

[0119] The controller may also determine the packet loss location of the lost data message in the detection domain according to the reported detection information received from each network device in the detection domain. Figure 1 As shown, the controller can determine that the data packet with the fifth sequence number value of 50 is lost according to the reported detection information reported by the tail node device. According to the value of the fifth sequence number, the controller searches for the reported detection information reported by the intermediate node device 1 and the intermediate node device 2, and finds the value of the detection node identifier included in the report detection information that is the smallest, and includes the fifth sequence number. Assume that the controller determines that the fifth reported detection information in the intermediate node device 1 includes the fifth sequence number, and the value of the fifth detection node identifier included in the fifth reported detection information is the smallest. The controller determines the packet loss location node based on the fifth acquisition data (device identifier of the intermediate node device 1) included in the fifth reported detection information.

[0120] In the above-mentioned implementation manner, the network equipment in the detection domain does not report the reported detection information of all data messages in the detection period to the controller, but reports the reported detection information with the smallest sequence number and the reported detection information with the largest sequence number, as well as the reported detection information corresponding to the lost data message. In practical applications, the network equipment in the detection domain can report the reported detection information of all data messages in the detection period to the controller. In this way, the controller can directly calculate the packet loss rate and perform packet loss positioning according to the reported detection information reported by each node, without the need for each network node to perform pre-processing. In the implementation manner in which the network equipment in the detection domain reports all reported detection information, when the controller realizes packet loss positioning, the controller first determines the lost sequence number, and then searches for the lost sequence number in the collected reported detection information, and the value of the detection node identifier is the largest reported detection information (e.g., the sixth reported detection information). The controller determines the packet loss positioning node according to the sixth acquisition data included in the sixth reported detection information.

[0121] Figure 5 Schematic diagram of the structure of the first network device 1000 according to an embodiment of the present application. Figure 5 The first network device 1000 shown in the figure can execute the corresponding steps executed by the first network device in the method of the above embodiment. Figure 5 As shown, the first network device 1000 includes a receiving unit 1002 , a processing unit 1004 and a sending unit 1006 .

[0122] The receiving unit 1002 is configured to receive first control information sent by a controller, where the first control information includes a detection task type, where the detection task type indicates a detection task that the controller requires the first network device to perform;

[0123] The receiving unit 1002 is further used to receive a first data packet sent by a previous-hop network device of the first network device, the first data packet including first detection information, the first detection information including a first detection node identifier, a first sequence number and first collection information, wherein the first detection node identifier indicates a position of a network device that processes the first detection information in a detection domain, the first sequence number indicates a sequence number of the first data packet including the first detection information, the first collection information indicates collection information corresponding to the detection task type, the detection domain is a detection range determined by the controller, the detection domain includes multiple network devices, and the multiple network devices include the first network device;

[0124] The processing unit 1004 is used to determine the first collected data corresponding to the first collected information according to the first collected information, and the processing unit 1004 is also used to update the first detection node identifier;

[0125] The sending unit 1006 is configured to send the first data packet carrying the updated first detection information to a next-hop network device of the first network device.

[0126] Optionally, the processing unit 1004 is further configured to, after the receiving unit 1002 receives a first data packet sent by a previous-hop network device of the first network device, encapsulate the first detection information in the first data packet.

[0127] Optionally, the processing unit 1004 is further configured to delete the first detection information in the first data packet before the sending unit 1006 sends the first data packet to a next-hop network device of the first network device.

[0128] Optionally, the sending unit 1006 is further configured to send first reported detection information to the controller, where the first reported detection information includes an updated first detection node identifier, the first serial number, and the first collected data.

[0129] Optionally, the detection task type is packet loss detection, the first control information also includes the detection start time and the detection end time, the first network device is the first node device of the detection domain, the first data packet is the first data packet sent by the sending unit 1006 to the next-hop network device of the first network device from the detection start time, and the first acquisition data includes the device identifier of the first network device. The receiving unit 1002 is also used to receive a second data packet sent by the previous-hop network device of the first network device. The processing unit 1004 is also used to encapsulate second detection information in the second data packet, and the second detection information includes a second detection node identifier, a second sequence number, and second acquisition information. The processing unit 1004 is also used to determine the second acquisition data corresponding to the second acquisition information according to the second acquisition information, and the processing unit 1004 is also used to update the second detection node identifier, the second acquisition data includes the device identifier of the first network device, the second sequence number is greater than the first sequence number, and the second detection node identifier is the same as the first detection node identifier. The sending unit 1006 is further configured to send the second data packet carrying the updated second detection information to the next-hop network device of the first network device, wherein the second data packet is the last data packet sent by the sending unit 1006 to the next-hop network device of the first network device before the detection end time. The sending unit 1006 is further configured to send first reported detection information and second reported detection information to the controller, wherein the first reported detection information includes the updated first detection node identifier, the first sequence number, and the first collected data, and the second reported detection information includes the updated second detection node identifier, the second sequence number, and the second collected data.

[0130] Optionally, the detection task type is packet loss detection, the first control information also includes a detection start time and a detection end time, the first network device is an intermediate node device or a tail node device of the detection domain, and the first acquisition data includes a device identifier of the first network device. The processing unit 1004 is also used to increase the value of the detection end time by a predetermined time length and update the value of the detection end time. The receiving unit 1002 is also used to receive a second data packet sent by a previous-hop network device of the first network device within a time period between the detection start time and the updated detection end time, the second data packet including second detection information, and the second detection information including a second detection node identifier, a second sequence number and second acquisition information. The processing unit 1004 is further configured to determine the second collection data corresponding to the second collection information according to the second collection information, and the processing unit 1004 is further configured to update the second detection node identifier, the second collection data includes the device identifier of the first network device, the second sequence number is the maximum sequence number among the sequence numbers of multiple data packets received by the receiving unit 1002 within the time period, the first data packet is the data packet received by the receiving unit 1002 within the time period, and the first sequence number is the minimum sequence number among the sequence numbers of the multiple data packets received by the receiving unit 1002 within the time period. The sending unit 1006 is further configured to send the second data packet carrying the updated second detection information to the next-hop network device of the first network device. The processing unit 1004 is also used to generate third reported detection information, the third reported detection information includes a third detection node identifier, a third sequence number and third collected data, the third detection node identifier is the same as the updated second detection node identifier, the third collected data includes the device identifier of the first network device, the third sequence number is the missing sequence number in the sequence numbers of the multiple data packets received by the receiving unit 1002 within the time period, and the third sequence number is greater than the first sequence number and less than the second sequence number. The sending unit 1006 is also used to send the first reported detection information, the second reported detection information and the third reported detection information to the controller, wherein the first reported detection information includes the updated first detection node identifier, the first sequence number and the first collected data, and the second reported detection information includes the updated second detection node identifier, the second sequence number and the second collected data.

[0131] Figure 5The first network device shown can execute the corresponding steps executed by the first network device in the method of the above embodiment. Each network device in the detection domain can use the detection information included in the data message to realize information collection for the detection task required by the controller according to the control information sent by the controller, thereby realizing the on-path collection of data messages on the transmission path and the detection of the transmission path while ensuring the message forwarding performance.

[0132] Figure 6 Schematic diagram of the hardware structure of the first network device 1100 according to an embodiment of the present application. Figure 6 The first network device 1100 shown can execute the corresponding steps executed by the first network device in the method of the above embodiment.

[0133] like Figure 6 As shown, the first network device 1100 includes a processor 1101, a memory 1102, an interface 1103 and a bus 1104. The interface 1103 can be implemented in a wireless or wired manner, and can be a network card. The processor 1101, the memory 1102 and the interface 1103 are connected via a bus 1104.

[0134] The interface 1103 may specifically include a transmitter and a receiver, which are used to send and receive information between the first network device and the previous hop network device or the next hop network device of the first network device in the above embodiment; and / or to send and receive information between the controllers in the above embodiment. For example, the interface 1103 is used to support receiving the first control information sent by the controller; to receive the first data message sent by the previous hop network device of the first network device; and / or to send the first data message carrying the updated first detection information to the next hop network device of the first network device. As an example, the interface 1103 is used to support Figure 3 The processor 1101 is used to execute the processing performed by the first network device in the above embodiment. For example, the processor 1101 is used to determine the first collection data corresponding to the first collection information; to update the first detection node identifier; and / or other processes of the technology described herein. As an example, the processor 1101 is used to support Figure 3The process S105 in the method is shown in FIG. 105. The memory 1102 includes an operating system 11021 and an application 11022, which are used to store programs, codes or instructions. When the processor or hardware device executes these programs, codes or instructions, the processing process involving the first network device in the method embodiment can be completed. Optionally, the memory 1102 may include a read-only memory (English: Read-only Memory, abbreviated: ROM) and a random access memory (English: Random Access Memory, abbreviated: RAM). Among them, the ROM includes a basic input / output system (English: Basic Input / Output System, abbreviated: BIOS) or an embedded system; the RAM includes an application and an operating system. When the first network device 1100 needs to be run, it is started by the BIOS solidified in the ROM or the bootloader boot system in the embedded system, and the first network device 1100 is guided to enter a normal operating state. After the first network device 1100 enters a normal operating state, the application and operating system in the RAM are run, thereby completing the processing process involving the first network device in the method embodiment.

[0135] Understandably, Figure 6 Only a simplified design of the first network device 1100 is shown. In practical applications, the first network device may include any number of interfaces, processors or memories.

[0136] Figure 7 A schematic diagram of the hardware structure of another first network device 1200 according to an embodiment of the present application. Figure 7 The first network device 1200 shown can execute the corresponding steps executed by the first network device in the method of the above embodiment.

[0137] like Figure 7 The first network device 1200 includes: a main control board 1210, an interface board 1230, a switching network board 1220 and an interface board 1240. The main control board 1210, the interface boards 1230 and 1240, and the switching network board 1220 are connected to the system backplane through a system bus to achieve intercommunication. Among them, the main control board 1210 is used to complete functions such as system management, equipment maintenance, and protocol processing. The switching network board 1220 is used to complete data exchange between various interface boards (interface boards are also called line cards or service boards). The interface boards 1230 and 1240 are used to provide various service interfaces (for example, POS interfaces, GE interfaces, ATM interfaces, etc.) and realize the forwarding of data packets.

[0138] The interface board 1230 may include a central processor 1231, a forwarding table entry memory 1234, a physical interface card 1233, and a network processor 1232. The central processor 1231 is used to control and manage the interface board and communicate with the central processor on the main control board. The forwarding table entry memory 1234 is used to store forwarding table entries. The physical interface card 1233 is used to complete the reception and transmission of traffic. The network processor 1232 is used to control the physical interface card 1233 to receive and send traffic according to the forwarding table entries.

[0139] Specifically, the physical interface card 1233 is used to receive a data packet sent by a previous-hop network device of the first network device; to send a data packet to a next-hop network device of the first network device; and / or to exchange information with a controller.

[0140] After receiving the data message, the physical interface card 1233 sends the data message to the central processor 1211 via the central processor 1231, and the central processor 1211 processes the data message.

[0141] The central processor 1211 is used to determine the first collected data corresponding to the first collected information.

[0142] The central processor 1211 is further configured to update the first detection node identifier.

[0143] The central processor 1231 is further used to control the network processor 1232 to obtain the forwarding table entries in the forwarding table entry memory 1234 , and the central processor 1231 is further used to control the network processor 1232 to complete the reception and transmission of traffic via the physical interface card 1233 .

[0144] It should be understood that the operation on the interface board 1240 in the embodiment of the present invention is consistent with the operation of the interface board 1230, and for the sake of brevity, it will not be repeated. It should be understood that the first network device 1200 of this embodiment can correspond to the functions and / or various steps implemented in the above method embodiment, and it will not be repeated here.

[0145] In addition, it should be noted that there may be one or more main control boards, and when there are multiple boards, they may include a main main control board and a standby main control board. There may be one or more interface boards. The stronger the data processing capability of the first network device, the more interface boards are provided. There may also be one or more physical interface cards on the interface board. There may be no switching network board, or there may be one or more switching network boards. When there are multiple switching network boards, load sharing redundant backup can be achieved together. Under the centralized forwarding architecture, the first network device may not need a switching network board, and the interface board assumes the processing function of the service data of the entire system. Under the distributed forwarding architecture, the first network device may have at least one switching network board, and the data exchange between multiple interface boards is realized through the switching network board, providing large-capacity data exchange and processing capabilities. Therefore, the data access and processing capabilities of the first network device of the distributed architecture are greater than those of the device of the centralized architecture. Which architecture to adopt depends on the specific networking deployment scenario, and no limitation is made here.

[0146] In addition, an embodiment of the present application provides a computer storage medium for storing computer software instructions used for the above-mentioned first network device, which includes a program designed for executing the above-mentioned method embodiment.

[0147] Figure 8 Schematic diagram of the structure of the controller 2000 according to an embodiment of the present application. Figure 8 The controller 2000 shown in the figure can execute the corresponding steps executed by the controller in the method of the above embodiment. Figure 8 As shown, the controller 2000 includes a receiving unit 2002 , a processing unit 2004 and a sending unit 2006 .

[0148] The processing unit 2004 is configured to determine a detection domain, wherein the detection domain is a detection range determined by the processing unit 2004, and the detection domain includes a plurality of network devices;

[0149] A sending unit 2006 is configured to send first control information to the multiple network devices, where the first control information includes a detection task type, where the detection task type indicates a detection task that the controller requires the multiple network devices to perform;

[0150] A receiving unit 2002 is used to receive first reported detection information sent by a first network device, wherein the first reported detection information is determined by the first network device based on first detection information, and the first detection information is detection information obtained from the first data packet before the first network device sends a first data packet to a next-hop network device of the first network device, and the first reported detection information includes a first detection node identifier, a first sequence number and first acquisition data, wherein the first detection node identifier indicates a position of a network device that processes the first detection information in the detection domain, the first sequence number indicates a sequence number of the first data packet including the first detection information, the first acquisition data is acquisition data corresponding to the first acquisition information determined by the first network device based on the first acquisition information in the first detection information, the first acquisition information indicates acquisition information corresponding to the detection task type, and the multiple network devices include the first network device.

[0151] Optionally, the detection task type is packet loss detection, the first control information also includes a detection start time and a detection end time, the first network device is the first node device of the detection domain, the first data packet is the first data packet sent by the first network device to the next-hop network device of the first network device from the detection start time, the first acquisition data includes the device identifier of the first network device, the receiving unit 2002 is also used to receive second reported detection information sent by the first network device, the second reported detection information is determined by the first network device according to the second detection information, the second detection information is the detection information obtained from the second data packet before the first network device sends the second data packet to the next-hop network device of the first network device, the second reported detection information includes a second detection node identifier, a second sequence number and second acquisition data, the second acquisition data includes the device identifier of the first network device, the second sequence number is greater than the first sequence number, the second detection node identifier is the same as the first detection node identifier, and the second data packet is the last data packet sent by the first network device to the next-hop network device of the first network device before the detection end time.

[0152] Optionally, the receiving unit 2002 is also used to receive third reported detection information sent by the second network device, the third reported detection information including a third detection node identifier and third collected data, the third detection node identifier indicating the position of the second network device in the detection domain, the third collected data including the device identifier of the second network device, and the third reported detection information also including a third sequence number, a fourth sequence number and a fifth sequence number, wherein the third sequence number is the minimum sequence number among the sequence numbers of multiple data packets received by the second network device within a time period obtained by adding a predetermined time period to the detection start time and the detection end time, the fourth sequence number is the missing sequence number among the sequence numbers of the multiple data packets received by the second network device within the time period, and the fifth sequence number is the maximum sequence number among the sequence numbers of the multiple data packets received by the second network device within the time period, the second network device is an intermediate node device or a tail node device in the detection domain, and the multiple network devices include the second network device.

[0153] Optionally, the processing unit 2004 is further configured to determine a packet loss rate according to the first reported detection information, the second reported detection information, and the third reported detection information.

[0154] Optionally, the processing unit 2004 is further configured to determine fourth reported detection information according to the fourth sequence number, and the value of the fourth detection node identifier included in the fourth reported detection information is the smallest among all reported detection information including the fourth sequence number received by the receiving unit 2002. The processing unit 2004 is further configured to determine a packet loss location node according to fourth collected data included in the fourth reported detection information.

[0155] Figure 8 The controller shown can execute the corresponding steps executed by the controller in the method of the above embodiment. Each network device in the detection domain can use the detection information included in the data message to realize information collection and reporting for the detection task required by the controller according to the control information sent by the controller, thereby realizing the on-path collection of data messages on the transmission path and the detection of the transmission path while ensuring the message forwarding performance.

[0156] Fig. 9 Schematic diagram of the hardware structure of the controller 2100 according to an embodiment of the present application. Fig. 9 The controller 2100 shown can execute the corresponding steps executed by the controller in the method of the above embodiment.

[0157] like Fig. 9As shown, the controller 2100 includes a processor 2101, a memory 2102, an interface 2103 and a bus 2104. The interface 2103 can be implemented wirelessly or wired, and can be a network card. The processor 2101, the memory 2102 and the interface 2103 are connected via a bus 2104.

[0158] The interface 2103 may specifically include a transmitter and a receiver, which are used to send and receive information between the controller and the first network device in the above embodiment. For example, the interface 2103 is used to support control information sent to the first network device; and / or to receive reported detection information sent by the first network device. As an example, the interface 2103 is used to support Figure 3 The processor 2101 is used to perform the processing performed by the controller in the above embodiment. For example, the processor 2101 is used to determine the detection domain; and / or other processes of the technology described herein. As an example, the processor 2101 is used to support Figure 3 The process S101 in the embodiment. The memory 2102 includes an operating system 21021 and an application 21022, which are used to store programs, codes or instructions. When the processor or hardware device executes these programs, codes or instructions, the processing process of the controller involved in the method embodiment can be completed. Optionally, the memory 2102 may include a read-only memory (English: Read-only Memory, abbreviated: ROM) and a random access memory (English: Random Access Memory, abbreviated: RAM). Among them, the ROM includes a basic input / output system (English: Basic Input / Output System, abbreviated: BIOS) or an embedded system; the RAM includes an application and an operating system. When the controller 2100 needs to be run, it is started by the BIOS solidified in the ROM or the bootloader boot system in the embedded system, and the controller 2100 is guided to enter a normal operating state. After the controller 2100 enters a normal operating state, the application and operating system in the RAM are run, thereby completing the processing process of the controller involved in the method embodiment.

[0159] Understandably, Fig. 9 Only a simplified design of the controller 2100 is shown. In actual applications, the controller may include any number of interfaces, processors or memories.

[0160] In addition, an embodiment of the present application provides a computer storage medium for storing computer software instructions used by the above-mentioned controller, which includes a program designed for executing the above-mentioned method embodiment.

[0161] In the above Figure 5 , Figure 6 , Figure 7 , Figure 8 or Fig. 9 In the implementation manner, optionally, the first detection information also includes a flow identifier, and the flow identifier indicates a data flow to which the first data packet belongs.

[0162] In the above Figure 5 , Figure 6 , Figure 7 , Figure 8 or Fig. 9 In the implementation manner, optionally, the first detection information also includes a first length and a first version number, wherein the first length indicates the length of the first detection information, and the first version number indicates a protocol version of the first detection information.

[0163] The embodiment of the present application also includes a network system, wherein the network system includes a first network device and a controller, wherein the first network device is the aforementioned Figure 5 or Figure 6 or Figure 7 The first network device in the embodiment of the present invention, wherein the controller is the aforementioned Figure 8 or Fig. 9 Controller in .

[0164] The steps of the method or algorithm described in conjunction with the disclosure of the present application can be implemented in a hardware manner, or can be implemented by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a mobile hard disk, a CD-ROM or any other form of storage medium well known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and can write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in a user device. Of course, the processor and the storage medium can also be present in the user device as discrete components.

[0165] Those skilled in the art should be aware that in one or more of the above examples, the functions described in this application can be implemented in hardware or in a combination of hardware and software. When implemented using a combination of hardware and software, the software can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein the communication media includes any medium that is convenient for transmitting a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.

[0166] The specific implementations described above further describe the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only a specific implementation of the present application.

Claims

1. A method for processing a data message, It is characterized in that The method comprises: The first network device receives a first data packet sent by a previous-hop network device of the first network device, where the first data packet includes first collection information; The first network device performs a detection indicated by the first collection information on the data flow to which the first data packet belongs according to the first collection information to obtain first collection data; The first network device sends a first data packet carrying the first collection information to a next-hop network device of the first network device, wherein the first data packet does not carry the first collection data, wherein the first network device, the previous-hop network device and the next-hop network device are in a detection domain.

2. The method according to claim 1, It is characterized in that The method further comprises: The first network device sends a report message to the controller, where the report message includes the first collected data, and the report message also includes at least one of the following information: The serial number and the first detection node identifier.

3. The method according to claim 1 or 2, It is characterized in that The first collection information indicates a type of the first collection data.

4. The method according to claim 1 or 2, It is characterized in that The first collection information indicates a detection task type, and the detection task type is packet loss detection.

5. The method according to claim 1, It is characterized in that The first data message also includes a first detection node identifier, where the first detection node identifier indicates a location of a network device that processes the first collected information in the detection domain.

6. The method according to claim 5, It is characterized in that The method further comprises: The first network device updates the first detection node identifier.

7. The method according to claim 1, It is characterized in that The first data packet also includes a first sequence number, which indicates a sequence number of the first data packet.

8. The method according to claim 1, It is characterized in that The first data message also includes a flow identifier, and the flow identifier is used to indicate the detected data flow.

9. The method according to claim 1 or 2, It is characterized in that The first data message is an Internet Protocol version 6 (IPv6) message.

10. The method according to claim 9, It is characterized in that The IPv6 message includes an extension header, and the extension header includes the first collection information.

11. The method according to claim 10, It is characterized in that The extended header includes a hop-by-hop HBH extended header, and the HBH extended header includes the first collection information.

12. A method for processing a data message, It is characterized in that The method comprises: The head node device encapsulates the collected information into a data message to obtain a first data message, wherein the first data message includes the first collected information; The head node device performs detection indicated by the first collection information on the data flow to which the first data packet belongs according to the first collection information to obtain first collection data; The first node device sends a first data packet carrying the first collection information to a next-hop network device of the first node device, wherein the first data packet does not carry the first collection data, wherein the first node device and the next-hop network device are in a detection domain.

13. The method according to claim 12, It is characterized in that The method further comprises: The head node device sends a report message to the controller, where the report message includes the first collected data, and the report message also includes at least one of the following information: The serial number and the first detection node identifier.

14. The method according to claim 12 or 13, It is characterized in that The first collection information indicates a type of the first collection data.

15. The method according to claim 12 or 13, It is characterized in that The first collection information indicates a detection task type, and the detection task type is packet loss detection.

16. The method of claim 12, It is characterized in that The first data message also includes a first detection node identifier, where the first detection node identifier indicates a location of a network device that processes the first collected information in the detection domain.

17. The method of claim 12, It is characterized in that The first data packet also includes a first sequence number, which indicates a sequence number of the first data packet.

18. The method of claim 12, It is characterized in that The first data message also includes a flow identifier, and the flow identifier is used to indicate the detected data flow.

19. The method according to claim 12 or 13, It is characterized in that The first data message is an Internet Protocol version 6 IPv6 message.

20. The method of claim 19, It is characterized in that The IPv6 message includes an extension header, and the extension header includes the first collection information.

21. The method of claim 20, It is characterized in that The extended header includes a hop-by-hop HBH extended header, and the HBH extended header includes the first collection information.

22. A first network device, It is characterized in that The first network device comprises: A receiver, configured to receive a first data message sent by a previous-hop network device of the first network device, wherein the first data message includes first collection information; a processor, configured to perform, according to the first collected information, a detection indicated by the first collected information on a data stream to which the first data packet belongs, to obtain first collected data; A transmitter is used to send a first data packet carrying the first collection information to a next-hop network device of the first network device, wherein the first data packet does not carry the first collection data, wherein the first network device, the previous-hop network device and the next-hop network device are in a detection domain.

23. The first network device according to claim 22, It is characterized in that The transmitter is further configured to send a report message to the controller, where the report message includes the first collected data, and the report message also includes at least one of the following information: The serial number and the first detection node identifier.

24. The first network device according to claim 22 or 23, It is characterized in that The first collection information indicates a type of the first collection data.

25. The first network device according to claim 22 or 23, It is characterized in that The first collection information indicates a detection task type, and the detection task type is packet loss detection.

26. The first network device according to claim 22, It is characterized in that The first data message also includes a first detection node identifier, where the first detection node identifier indicates a location of a network device that processes the first collected information in the detection domain.

27. The first network device according to claim 26, It is characterized in that The processor is further configured to update the first detection node identifier.

28. The first network device according to claim 22, It is characterized in that The first data packet also includes a first sequence number, which indicates a sequence number of the first data packet.

29. The first network device according to claim 22, It is characterized in that The first data message also includes a flow identifier, and the flow identifier is used to indicate the detected data flow.

30. The first network device according to claim 22 or 23, It is characterized in that The first data message is an Internet Protocol version 6 IPv6 message.

31. The first network device according to claim 30, It is characterized in that The IPv6 message includes an extension header, and the extension header includes the first collection information.

32. The first network device according to claim 31, It is characterized in that The extended header includes a hop-by-hop HBH extended header, and the HBH extended header includes the first collection information.

33. A first node device, It is characterized in that The first node device comprises: A processor, configured to encapsulate the collected information into a data message to obtain a first data message, wherein the first data message includes the first collected information; The processor is further configured to perform, according to the first collection information, a detection indicated by the first collection information on the data stream to which the first data packet belongs, to obtain first collection data; A transmitter is used to send a first data packet carrying the first collection information to a next-hop network device of the first node device, wherein the first data packet does not carry the first collection data, wherein the first node device and the next-hop network device are in a detection domain.

34. The head node device according to claim 33, It is characterized in that The transmitter is further configured to send a report message to the controller, where the report message includes the first collected data, and the report message also includes at least one of the following information: The serial number and the first detection node identifier.

35. The head node device according to claim 33 or 34, It is characterized in that The first collection information indicates a type of the first collection data.

36. The head node device according to claim 33 or 34, It is characterized in that The first collection information indicates a detection task type, and the detection task type is packet loss detection.

37. The head node device according to claim 33, It is characterized in that The first data message also includes a first detection node identifier, where the first detection node identifier indicates a location of a network device that processes the first collected information in the detection domain.

38. The head node device according to claim 33, It is characterized in that The first data packet also includes a first sequence number, which indicates a sequence number of the first data packet.

39. The head node device according to claim 33, It is characterized in that The first data message also includes a flow identifier, and the flow identifier is used to indicate the detected data flow.

40. The head node device according to claim 33 or 34, It is characterized in that The first data message is an Internet Protocol version 6 IPv6 message.

41. The head node device according to claim 40, It is characterized in that The IPv6 message includes an extension header, and the extension header includes the first collection information.

42. The head node device according to claim 41, It is characterized in that The extended header includes a hop-by-hop HBH extended header, and the HBH extended header includes the first collection information.

43. A network system, It is characterized in that The network system includes a first network device and a first node device, the first network device is the first network device described in any one of claims 22 to 32, and the first node device is the first node device described in any one of claims 33 to 42.