NETWORK PERFORMANCE DETECTION METHOD AND APPARATUS, AND NETWORK DEVICE
20220407791 · 2022-12-22
Inventors
Cpc classification
H04L43/08
ELECTRICITY
International classification
Abstract
A network performance detection method and apparatus, and a related network device are disclosed. According to the network performance detection method, a first IFIT header includes reporting manner indication information indicating that reporting is performed by an egress node device. After obtaining a first IFIT detection packet including the first IFIT header, a first network device can provide and process a second IFIT detection packet, where the second IFIT detection packet is obtained by adding a first device identifier and a first data flow detection result to the first IFIT detection packet. In other words, a detection result obtained by detecting a first data flow is reported only by the egress node device, and all node devices on a transmission link of the first data flow each includes the detection result in a same IFIT detection packet and sends the same IFIT detection packet to the egress node device.
Claims
1. A network performance detection method, comprising: obtaining, by a first network device, a first in-situ flow information telemetry (IFIT) detection packet, wherein the first IFIT detection packet comprises a first IFIT header including reporting manner indication information, and the reporting manner indication information indicates that a detection result is reported by an egress node device; providing, by the first network device, a second IFIT detection packet, wherein the second IFIT detection packet is obtained by adding a first device identifier and a first data flow detection result to the first IFIT detection packet, the first device identifier is an identifier of the first network device, and the first data flow detection result is a detection result obtained by the first network device by detecting a first data flow in a first period; and processing, by the first network device, the second IFIT detection packet.
2. The method according to claim 1, wherein before the providing, by the first network device, a second IFIT detection packet, the method further comprises: obtaining, by the first network device, a first data packet, wherein the first data packet comprises a second IFIT header including a detection task type, and the first data packet is a packet in the first data flow transmitted by the first network device in the first period; detecting, by the first network device, the first data packet based on the detection task type, to obtain a first packet detection result; and determining, by the first network device, the first data flow detection result based on the first packet detection result.
3. The method according to claim 1, wherein the first network device is an ingress node device, and the first IFIT detection packet is a detection packet generated by the first network device after the first period ends or a detection packet generated after the first network device receives a retransmission request sent by a control device, wherein the retransmission request is sent when the control device does not receive the first data flow detection result.
4. The method according to claim 3, wherein the processing, by the first network device, the second IFIT detection packet comprises: sending, by the first network device, the second IFIT detection packet to a second network device, wherein the second network device is a next-hop network device of the first network device.
5. The method according to claim 1, wherein the first network device is an intermediate node device, the first IFIT detection packet further comprises a second device identifier and a second data flow detection result, the second device identifier is an identifier of a second network device, the second network device is a previous-hop network device of the first network device, and the second data flow detection result is a detection result obtained by the second network device by detecting the first data flow in the first period; and the processing, by the first network device, the second IFIT detection packet comprises: sending, by the first network device, the second IFIT detection packet to a third network device, wherein the third network device is a next-hop network device of the first network device.
6. The method according to claim 1, wherein the first network device is the egress node device, the first IFIT detection packet further comprises a second device identifier and a second data flow detection result, the second device identifier is an identifier of a second network device, the second network device is a previous-hop network device of the first network device, and the second data flow detection result is a detection result obtained by the second network device by detecting the first data flow in the first period; and the first IFIT detection packet further comprises a third device identifier and a third data flow detection result, the third device identifier is an identifier of a third network device, the third network device is an ingress node device, and the third data flow detection result is a detection result obtained by the third network device by detecting the first data flow in the first period.
7. The method according to claim 6, wherein the processing, by the first network device, the second IFIT detection packet comprises: sending, by the first network device, the first data flow detection result, the second data flow detection result, and the third data flow detection result to a control device.
8. The method according to claim 6, wherein before the providing, by the first network device, a second IFIT detection packet, the method further comprises: obtaining, by the first network device, a first data packet, wherein the first data packet comprises a second IFIT header including a detection task type, and wherein the processing, by the first network device, the second IFIT detection packet comprises: determining, by the first network device, a performance detection result based on the first data flow detection result, the second data flow detection result, and the third data flow detection result, wherein the performance detection result indicates performance of transmitting the first data flow by the first network device, the second network device, and the third network device; and sending, by the first network device, the performance detection result to a control device.
9. The method according to claim 8, wherein when the detection task type is packet loss detection, the performance detection result comprises one or more of a total quantity of lost node packets, a node packet loss rate, a total quantity of discarded node bytes, a node byte discarding rate, a total quantity of lost link packets, or a total quantity of discarded link bytes; and the total quantity of lost node packets is a total quantity of data packets discarded by a corresponding node device in the first period, the node packet loss rate is a rate at which the corresponding node device discards the data packets in the first period, the total quantity of discarded node bytes is a total quantity of bytes discarded by the corresponding node device in the first period, the node byte discarding rate is a rate at which the corresponding node device discards the bytes in the first period, the total quantity of lost link packets is a total quantity of data packets discarded on a first transmission link in the first period, the total quantity of discarded link bytes is a total quantity of bytes discarded on the first transmission link in the first period, and the first transmission link is a transmission link of the first data flow.
10. The method according to claim 8, wherein when the detection task type is delay detection, the performance detection result comprises an average node delay and/or a link delay; and the average node delay is an average duration used by a corresponding node device from receiving a data packet to sending the data packet in the first period, the link delay is a sum of average node delays corresponding to various node devices on a first transmission link in the first period, and the first transmission link is a transmission link of the first data flow.
11. A network performance detection apparatus applied to a first network device, wherein the apparatus comprises: a non-transitory memory storing instructions; and at least one processor coupled to the non-transitory memory; wherein the instructions, when executed by the at least one processor, cause the apparatus to be configured to: obtain a first IFIT detection packet, wherein the first IFIT detection packet comprises a first IFIT header including reporting manner indication information, and the reporting manner indication information indicates that a detection result is reported by an egress node device; provide a second IFIT detection packet, wherein the second IFIT detection packet is a detection packet obtained by adding a first device identifier and a first data flow detection result to the first IFIT detection packet, the first device identifier is an identifier of the first network device, and the first data flow detection result is a detection result obtained by the first network device by detecting a first data flow in a first period; and process the second IFIT detection packet.
12. The apparatus according to claim 11, wherein the instructions, when executed by the at least one processor, further cause the apparatus to be configured to: obtain a first data packet, wherein the first data packet comprises a second IFIT header including a detection task type, and the first data packet is a packet in the first data flow transmitted by the first network device in the first period; detect the first data packet based on the detection task type, to obtain a first packet detection result; and determine the first data flow detection result based on the first packet detection result.
13. The apparatus according to claim 11, wherein the first network device is an ingress node device, and the first IFIT detection packet is a detection packet generated by the first network device after the first period ends or a detection packet generated after the first network device receives a retransmission request sent by a control device, wherein the retransmission request is sent when the control device does not receive the first data flow detection result.
14. The apparatus according to claim 13, wherein the instructions, when executed by the at least one processor, further cause the apparatus to be configured to: send the second IFIT detection packet to a second network device, wherein the second network device is a next-hop network device of the first network device.
15. The apparatus according to claim 11, wherein the first network device is an intermediate node device, the first IFIT detection packet further comprises a second device identifier and a second data flow detection result, the second device identifier is an identifier of a second network device, the second network device is a previous-hop network device of the first network device, and the second data flow detection result is a detection result obtained by the second network device by detecting the first data flow in the first period; and the instructions, when executed by the at least one processor, further cause the apparatus to be configured to: send the second IFIT detection packet to a third network device, wherein the third network device is a next-hop network device of the first network device.
16. The apparatus according to claim 11, wherein the first network device is the egress node device, the first IFIT detection packet further comprises a second device identifier and a second data flow detection result, the second device identifier is an identifier of a second network device, the second network device is a previous-hop network device of the first network device, and the second data flow detection result is a detection result obtained by the second network device by detecting the first data flow in the first period; and the first IFIT detection packet further comprises a third device identifier and a third data flow detection result, the third device identifier is an identifier of a third network device, the third network device is an ingress node device, and the third data flow detection result is a detection result obtained by the third network device by detecting the first data flow in the first period.
17. The apparatus according to claim 16, wherein the instructions, when executed by the at least one processor, further cause the apparatus to be configured to: send the first data flow detection result, the second data flow detection result, and the third data flow detection result to a control device.
18. The apparatus according to claim 16, wherein the instructions, when executed by the at least one processor, further cause the apparatus to be configured to: obtain a first data packet, wherein the first data packet comprises a second IFIT header including a detection task type; determine a performance detection result based on the first data flow detection result, the second data flow detection result, and the third data flow detection result, wherein the performance detection result indicates performance of transmitting the first data flow by the first network device, the second network device, and the third network device; and send the performance detection result to a control device.
19. The apparatus according to claim 18, wherein when the detection task type is packet loss detection, the performance detection result comprises one or more of a total quantity of lost node packets, a node packet loss rate, a total quantity of discarded node bytes, a node byte discarding rate, a total quantity of lost link packets, or a total quantity of discarded link bytes; and the total quantity of lost node packets is a total quantity of data packets discarded by a corresponding node device in the first period, the node packet loss rate is a rate at which the corresponding node device discards the data packets in the first period, the total quantity of discarded node bytes is a total quantity of bytes discarded by the corresponding node device in the first period, the node byte discarding rate is a rate at which the corresponding node device discards the bytes in the first period, the total quantity of lost link packets is a total quantity of data packets discarded on a first transmission link in the first period, the total quantity of discarded link bytes is a total quantity of bytes discarded on the first transmission link in the first period, and the first transmission link is a transmission link of the first data flow.
20. The apparatus according to claim 18, wherein when the detection task type is delay detection, the performance detection result comprises an average node delay and/or a link delay; and the average node delay is an average duration used by a corresponding node device from receiving a data packet to sending the data packet in the first period, the link delay is a sum of average node delays corresponding to various node devices on a first transmission link in the first period, and the first transmission link is a transmission link of the first data flow.
Description
BRIEF DESCRIPTION OF DRAWINGS
[0057]
[0058]
[0059]
[0060]
[0061]
[0062]
[0063]
[0064]
[0065]
[0066]
[0067]
DESCRIPTION OF EMBODIMENTS
[0068] To make the objectives, technical solutions, and advantages of this application clearer, the following further describes implementations of this application in detail with reference to the accompanying drawings.
[0069] A network architecture and a service scenario described in embodiments of this application are intended to describe the technical solutions in embodiments of this application more clearly, and do not constitute any limitation on the technical solutions provided in embodiments of this application. A person of ordinary skill in the art may know that with evolution of the network architecture and emergence of a new service scenario, the technical solutions provided in embodiments of this application are also applicable to a similar technical problem.
[0070] It should be understood that “at least one” mentioned in this specification means one or more and “a plurality of” means two or more. In descriptions of this application, “I” means “or” unless otherwise specified. For example, A/B may represent A or B. In this specification, “and/or” describes only an association relationship for describing associated objects and represents that three relationships may exist. For example, A and/or B may represent the following three cases: Only A exists, both A and B exist, and only B exists. In addition, to clearly describe the technical solutions in embodiments of this application, terms such as “first” and “second” are used in embodiments of this application to distinguish between same items or similar items whose functions and purposes are basically the same. A person skilled in the art may understand that the terms such as “first” and “second” do not limit a quantity and an execution sequence, and the terms such as “first” and “second” do not indicate a definite difference.
[0071] In an IFIT technology, IFIT information carried in a packet may be used to perform feature marking on a node device through which a data flow in a network passes. Feature marking may also be referred to as coloring. The IFIT information may be used as a whole to form an IFIT header, for example, may be used as an extension header of the multi-protocol label switching (MPLS) protocol, the segment routing (SR) protocol, or the like. Alternatively, the IFIT information may be dispersedly included in, for example, an internet protocol (IP) header based on field information or the like. Each-hop node device through which the data flow passes reports collected metadata such as a timestamp and a quantity of packets to a control device, so that the control device further calculates a network delay and a packet loss status, recovers a link, and the like based on the reported data.
[0072] In embodiments of this application, a possible structure of an IFIT header used in an SR protocol network is that shown in
[0073] 1. Flow instruction indicator (FII) field: The field is mainly used to identify that data information after the field is IFIT packet information. For example, the following field information may be included.
[0074] Flow instruction indicator label (FII Label): A default value may be configured to identify a data flow on which IFIT detection is performed.
[0075] An S flag is used to mark whether it is a stack bottom, for example, a value 1 indicates a stack bottom, and a value 0 indicates a non-stack bottom.
[0076] Some related information in an outer SR label header, such as a priority EXP and a time to live (TTL), may be inherited.
[0077] 2. Flow instruction header (FIH) field: The field is mainly used to carry information related to IFIT detection. For example, the following field information may be included.
[0078] A flow identifier (Flow ID) is a globally unique identifier allocated to each data flow on which IFIT detection is performed.
[0079] An L flag is a packet loss detection coloring flag. For example, “1” indicates that a lost packet is collected, and “0” indicates that a lost packet is not collected.
[0080] A D flag is a delay measurement coloring flag. For example, “1” indicates that a timestamp is collected, and “0” indicates that a timestamp is not collected.
[0081] A header type indicator (HTI) marks a detection content range and a range of nodes that need to send an IFIT detection result, for example, different mark values may be used to distinguish whether to perform detection on a link node having an IFIT capability besides nodes at two detection ends; and whether to include a flow instruction extension header (FIEH) field.
[0082] An R flag may be used as a reserved flag.
[0083] 3. Flow instruction extension header (FIEH) field: The field is used as an extension field and is mainly used to carry other information related to IFIT detection. For example, the following field information may be included.
[0084] A flow identifier extension (Flow ID Ext) is used to extend a flow identifier bit width.
[0085] A V flag marks a reverse flow. For example, “0” indicates that a current flow is a forward flow and a receive end may automatically create a reverse flow. “1” indicates that a current flow is a reverse flow and a receive end does not automatically create a reverse flow.
[0086] A period length has different values indicating different period lengths of detection periods, such as 1 s, 10 s, 30 s, 1 min, and 10 min.
[0087] An IFIT header is usually carried in a packet to indicate a network device to perform IFIT detection. For example, a packet type may be a data packet, or may be an IFIT detection packet used to transmit a detection result. In an actual application scenario, a plurality of data packets or IFIT detection packets may be sent continuously. For example, the plurality of data packets may constitute one data flow. Alternatively, the plurality of data packets or IFIT detection packets are sent at intervals in a specific period.
[0088] In embodiments of this application, a possible structure of an IFIT header used in an MPLS protocol network is that shown in
[0089] 1. An MPLS extension header (EH) includes the following field information.
[0090] An extension header label (EHL) indicates that the following is the MPLS extension header, a label value 4 indicates a stack bottom label.
[0091] An extension header count (EH count) has a value of 1.
[0092] An extension header total length (EH total length) is in a unit of 4 bytes, has a value of 3, and has a total of 12 bits.
[0093] A telemetry instruction header type (next header), namely, a TIH header type indicates a detection type.
[0094] 2. Telemetry instruction header (TIH): After the MPLS extension header, an encapsulation format in an end-to-end mode is the same as that in a hop-by-hop mode. The field includes the following field information.
[0095] A next extension header type (next header) has a value of 0xFF, indicating that there is no next-layer extension header.
[0096] A telemetry instruction header length is in a unit of a long word (4 bits) and has a value of 2.
[0097] A version indicates a version number of an IFIT protocol.
[0098] An F flag is used to mark whether a fragment is a subsequent fragment. For example, “1” indicates that a fragment is a subsequent fragment and IFIT detection is not performed. This ensures that an IFIT header is added to only the first fragment and IFIT detection is performed on the first fragment after a large data packet is fragmented. “0” indicates that a fragment is not a subsequent fragment.
[0099] An I flag is an instruction bit, has 1 bit and a value of 0, and is not used currently.
[0100] A T flag is a forwarding bit, has 1 bit and a value of 0, and is not used currently.
[0101] An L flag is a packet loss detection coloring flag. For example, “1” indicates that a lost packet is collected, and “0” indicates that a lost packet is not collected.
[0102] A D flag is a delay measurement coloring flag. For example, “1” indicates that a timestamp is collected, and “0” indicates that a timestamp is not collected.
[0103] A flow identifier (Flow ID) is a globally unique identifier allocated to each data flow on which IFIT is performed.
[0104] A mask length (DIP mask or SIP mask) indicates use of a reverse flow. For example, a value 0 indicates that the reverse flow is not enabled.
[0105] A period length has different values indicating different period lengths of detection periods, such as 1 s, 10 s, 30 s, 1 min, and 10 min.
[0106] An R reverse flow flag is set to, for example, “1” indicating that the reverse flow is enabled.
[0107]
[0108] In this embodiment, there are mainly two phases. A first phase is a data packet transmission phase, and a second phase is an IFIT detection packet transmission phase. Therefore, the following describes functions of devices in the system architecture in two phases.
[0109] 1. Data Packet Transmission Phase
[0110] The control device 304 is configured to deliver an IFIT detection task to the ingress node device, and deliver a subscription task to the egress node device. The subscription task is a task of subscribing to an event in which the egress node device reports a detection result.
[0111] The source end device 301 is configured to send a data packet that belongs to a first data flow, and the data packet may be transmitted to the ingress node device through a core network.
[0112] The ingress node device is configured to receive the IFIT detection task sent by the control device 304. The ingress node device is further configured to: detect a data packet in a first period based on the IFIT detection task delivered by the control device 304, to obtain a packet detection result; set an IFIT header based on the IFIT detection task delivered by the control device 304, where the IFIT header includes a detection task type; and after adding the IFIT header to the data packet, send the data packet to a next-hop network device.
[0113] The intermediate node device is configured to: receive the data packet that is sent by the previous-hop network device and to which the IFIT header is added; detect the data packet in the first period based on the detection task type included in the IFIT header in the data packet, to obtain a packet detection result; and send the data packet to which the IFIT header is added to a next-hop network device.
[0114] The egress node device is configured to receive the subscription task sent by the control device 304. The egress node device is further configured to: receive the data packet that is sent by the previous-hop network device and to which the IFIT header is added; detect the data packet in the first period based on the detection task type included in the IFIT header in the data packet, to obtain a packet detection result; strip the IFIT header in the data packet; and send the data packet whose IFIT header is stripped to the destination end device 302.
[0115] 2. IFIT Detection Packet Transmission Phase
[0116] The ingress node device is configured to generate an IFIT detection packet after the first period ends. The IFIT detection packet includes an IFIT header, the IFIT header includes reporting manner indication information, and the reporting manner indication information indicates that a detection result is reported by the egress node device. The ingress node device is further configured to: process the packet detection result in the first period to obtain a data flow detection result, add the data flow detection result to the IFIT detection packet, and transmit the IFIT detection packet to the next-hop network device.
[0117] The intermediate node device is configured to: receive the IFIT detection packet sent by the previous-hop network device, process the packet detection result of the intermediate node device in the first period to obtain a data flow detection result, add the data flow detection result to the IFIT detection packet, and send the IFIT detection packet to the next-hop network device.
[0118] The egress node device is configured to: receive the IFIT detection packet sent by the previous-hop network device, and report a data flow detection result of each node device to the control device 304 based on the subscription task sent by the control device 304; or process a data flow detection result of each node device to obtain a performance detection result, and report the performance detection result to the control device.
[0119] The control device 304 is configured to: receive data reported by the egress node device, and further process the received data.
[0120] In this embodiment, the source end device 301 and the destination end device 302 may be any device, for example, base stations or terminals. The network device 303 may be a device such as a router, a switch, or a bridge. The control device 304 may be one server or a server cluster including a plurality of servers, or may be another computer device.
[0121]
[0122] The processor 401 may be a general-purpose central processing unit (CPU), a network processor (NP), a microprocessor, or may be one or more integrated circuits configured to implement the solutions of this application, for example, an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0123] The communication bus 402 is configured to transfer information between the foregoing components. The communication bus 402 may be classified into an address bus, a data bus, a control bus, and the like. For ease of indication, the bus is indicated by using only one bold line in the figure. However, it does not indicate that there is only one bus or only one type of bus.
[0124] The memory 403 may be a read-only memory (ROM), a random access memory (RAM), an electrically erasable programmable read-only memory (EEPROM), an optical disc (including a compact disc read-only memory (CD-ROM), a compact disc, a laser disc, a digital versatile disc, a Blu-ray disc, or the like), a magnetic disk storage medium or another magnetic storage device, or any other medium that can be used to carry or store expected program code in a form of instructions or a data structure and that is accessible to a computer. However, this is not limited hereto. The memory 403 may exist independently and is connected to the processor 401 by using the communications bus 402. Alternatively, the memory 403 may be integrated with the processor 401.
[0125] The communication interface 404 is configured to communicate with another device or a communication network by using any transceiver-type apparatus. The communication interface 404 includes a wired communication interface, and may further include a wireless communication interface. The wired communication interface may be, for example, an Ethernet interface. The Ethernet interface may be an optical interface, an electrical interface, or a combination thereof. The wireless communication interface may be a wireless local area network (WLAN) interface, a cellular network communication interface, a combination thereof, or the like.
[0126] In some embodiments, the network device may include a plurality of processors, for example, the processor 401 and a processor 405 shown in
[0127] During specific implementation, in an embodiment, the network device may further include an output device 406 and an input device 407. The output device 406 communicates with the processor 401, and may display information in a plurality of manners. For example, the output device 406 may be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. The input device 407 communicates with the processor 401, and may receive an input from a user in a plurality of manners. For example, the input device 407 may be a mouse, a keyboard, a touchscreen device, a sensing device, or the like.
[0128] In some embodiments, the memory 403 is configured to store program code 410 for executing the solutions in this application, and the processor 401 may execute the program code 410 stored in the memory 403. The program code may include one or more software modules. The network device may implement, by using the processor 401 and the program code 410 in the memory 403, a network performance detection method provided in the following embodiment in
[0129] The following describes in detail the network performance detection method provided in embodiments of this application. Based on the foregoing descriptions, there are mainly two phases in embodiments of this application. Therefore, for ease of understanding, a data packet transmission process is first described.
[0130] A first network device obtains a first data packet, where the first data packet includes a second IFIT header, the second IFIT header includes a detection task type, and the first data packet is a packet in a first data flow transmitted by the first network device in a first period. The first network device detects the first data packet based on the detection task type, to obtain a first packet detection result. The first network device stores the first packet detection result, and processes the first data packet.
[0131] In embodiments of this application, the first network device may be an ingress node device, an intermediate node device, or an egress node device. Therefore, the following separately describes processes in which the ingress node device, the intermediate node device, and the egress node device transmit a data packet.
[0132] 1. The First Network Device is the Ingress Node Device
[0133] When the first network device is the ingress node device, the first network device may perform timing on a period length of the first period. In a timing process, before the first network device obtains the first data packet, the first network device may receive a second data packet that belongs to the first data flow and that is sent by a source end device. The first network device provides the first data packet. To be specific, the first network device sets the second IFIT header based on a stored IFIT detection task, and adds the second IFIT header to the second data packet, to obtain the first data packet. Then, the first network device may detect the first data packet based on the detection task type in the second IFIT header, to obtain the first packet detection result. Then, the first network device may store the first packet detection result, and send the first data packet to a next-hop network device of the first network device.
[0134] In some embodiments, the IFIT detection task stored in the first network device may be delivered by a control device. In other words, before IFIT detection is performed, the control device may deliver the IFIT detection task to the first network device. Optionally, after receiving the IFIT detection task delivered by the control device, the first network device may feed back response information for acknowledging reception of the IFIT detection task to the control device, so that the control device learns that the IFIT detection task is successfully delivered, thereby facilitating management of operation and maintenance personnel.
[0135] The IFIT detection task may include one or more of the following information: reporting manner indication information, detection mode indication information, a period length of a detection period, a key attribute of an IFIT detection flow, an identifier of the ingress node device, an identifier of an egress node device, the detection task type, or the like.
[0136] The reporting manner indication information indicates that a detection result is reported by the egress node device. The detection mode indication information indicates that a detection mode is an end-to-end detection mode or a hop-by-hop detection mode. The key attribute of the IFIT detection flow indicates a key attribute of a data flow on which IFIT detection is performed, and the key attribute may include a source address, a destination address, a source port, a destination port, a COS value, and the like. The detection task type may include packet loss detection, delay detection, traffic detection, and the like.
[0137] It should be noted that, if an option of the packet loss detection, the delay detection, or the traffic detection is default, that is, is not set, it may be considered by default that corresponding detection needs to be performed. For example, if the packet loss detection is default, it may be considered by default that the packet loss detection needs to be performed. For another example, if the delay detection is default, it may be considered by default that the delay detection needs to be performed. Similarly, by default, other information in the IFT detection task may be detected in a default manner. In addition, the control device may deliver the IFIT detection task to the first network device based on interfaces such as a NetConf Yang, a gNMI, and a CLI.
[0138] A structure of the second IFIT header may be that shown in
[0139] Bit-7: indicates a detection result reporting manner, where a value “0” indicates hop-by-hop reporting, and a value “1” indicates egress node reporting.
[0140] Bit-6: indicates a packet processing mode, where a value “0” indicates a detection result reporting mode, and a value “1” indicates a detection result statistics mode.
[0141] Bit-5: indicates a detection mode, where a value “0” indicates an end-to-end detection mode, and a value “1” indicates a hop-by-hop detection mode.
[0142] Bit-4: indicates a detection result cache period, where a value “0” indicates that a detection result of only one period is cached, and a value “1” indicates that detection results of N periods are cached based on a global configuration. N is an integer greater than 1, and may be 3, 4, 5, or the like.
[0143] It should be noted that, because different values of each of the four most significant bits of the HTI field indicate different meanings, the foregoing is merely an example, and values of bits and meanings indicated by the values may alternatively be combined in another manner. In addition, the four most significant bits of the HTI field indicate the foregoing four types of information. The foregoing is merely an example, and specific bits indicating specific types of information may be alternatively combined in another manner. The manner in the foregoing example is used as an example. A value of the bit-7 of the HTI field in the second IFIT header is “1”. A value of the bit-6 is “1”. A value of the bit-5 may be “0” or “1”, depending on whether end-to-end detection or hop-by-hop detection is currently performed. A value of the bit-4 may be “0” or “1”, depending on whether a detection result of one period is currently cached or detection results of N periods are currently cached.
[0144] It should be noted that in embodiments of this application, the foregoing information may be indicated by using the four most significant bits of the HTI field, or in another manner. This is not limited in embodiments of this application. In addition,
[0145] It can be learned from the foregoing descriptions that the detection task type may include the packet loss detection, the delay detection, the traffic detection, and the like, and the detection task type may be determined by using a related flag in the second IFIT header. In an example, when the detection task type is the packet loss detection, the first network device may collect statistics about whether the first data packet is sent through an egress interface of the first network device. If the first data packet is sent, it may be determined that the first data packet is not discarded, that is, a quantity of data packets discarded inside the first network device is 0. Similarly, a quantity of bytes discarded inside the first network device is 0. When the detection task type is the delay detection, the first network device may determine whether the first data packet is a delay-colored packet. If the first data packet is the delay-colored packet, the first network device may collect statistics about a moment at which the first network device receives the second data packet and a moment at which the first network device sends the first data packet, and determine a duration between the two moments as a duration used by the first network device to send the first data packet. When the detection task type is the traffic detection, the first network device may detect a total quantity of bytes of the first data packet. That is, the foregoing detected data may be stored as the first packet detection result.
[0146] The delay-colored packet may mean that a delay measurement coloring flag in the second IFIT header is “1”. It should be noted that, in embodiments of this application, delay detection may not be performed on all data packets in the first period, but a data packet is randomly selected, and the data packet is set to a delay-colored packet, so that delay detection is performed only on the delay-colored packet. Certainly, in some other embodiments, delay detection may be performed on a plurality of or all data packets in the first period. This is not limited in embodiments of this application.
[0147] Because the bit-4 of the HTI field in the second IFIT may indicate that the detection result of the period is cached or the detection results of the N periods are cached, if the detection result of the period is cached, the first network device may rewrite a detection result of a previous period with the first packet detection result. If the detection results of the N periods are cached, the first network device may determine a quantity of periods of the currently stored detection results. If the quantity of periods does not reach N, the first packet detection result may be directly stored. If the quantity of periods reaches N, the first packet detection result may be used to rewrite a detection result of an earliest period.
[0148] In some embodiments, the first network device may store the first packet detection result based on a period identifier of the first period and a flow identifier of the first data flow. That is, a mapping relationship among the period identifier of the first period, the flow identifier of the first data flow, and the first packet detection result is stored. The flow identifier of the first data flow may be 5-tuple information of a data packet included in the first data flow, or certainly, may be a flow identifier allocated to the first data flow when the first network device receives, for the first time, the data packet included in the first data flow. The period identifier of the first period and the flow identifier of the first data flow may be determined from the second IFIT header.
[0149] In some embodiments, to ensure accuracy of a detection result, the first network device may perform data normalization based on the period length of the detection period, that is, set a start time point of an IFIT detection task based on the period length of the detection period, further set a timer to record the period length of the detection period, set a period number of the first detection period, and the like. The period number may be used as a period identifier. For example, assuming that the period length of the detection period is 10 seconds, the first network device may perform data normalization based on the 10 seconds, that is, set, as the start time point of the IFIT detection task, an absolute time point that is an integer multiple of the first 10 seconds after receiving the IFIT detection task. Assuming that a time point at which the IFIT detection task is received is 14:23:02, the first network device may set 14:23:10 as the start time point, and set the timer to update a period number every 10 seconds. The period number of the first detection period is 1, and the period number is increased by 1 every 10 seconds.
[0150] Optionally, the first network device may not perform the IFIT detection task in the first detection period after receiving the IFIT detection task, and the first detection period is used to synchronize detection periods of various network devices. To be specific, after receiving the first data packet that belongs to the first data flow, the ingress node device may set the second IFIT header in the first detection period, add the second IFIT header to the first data packet, and sequentially transmit, to the egress node device through each intermediate node device, the data packet carrying the second IFIT header. The second IFIT header may include the period length of the detection period, the detection task type, the reporting manner indication information, the period number, and the like. In the first detection period, the period number may be equal to 1. Various network devices may determine, based on the period number, that the detection period is the first detection period, and perform data normalization based only on the period length of the detection period, to synchronize the periods of the network devices. In a detection period other than the first detection period, the first network device needs to perform the IFIT detection task.
[0151] It should be noted that, in embodiments of this application, the second IFIT header may carry the period number. In this way, another network device may determine, by using the period number, data packets that belong to a same period.
[0152] 2. The First Network Device is the Intermediate Node Device
[0153] When the first network device is the intermediate node device, the first data packet obtained by the first network device is a data packet sent by a previous-hop network device of the first network device. In other words, the first network device may receive the first data packet sent by the previous-hop network device of the first network device. The first network device may determine the detection task type from the second IFIT header included in the first data packet, and therefore detect the first data packet based on the detection task type, to obtain the first packet detection result. The first network device stores the first packet detection result, and sends the first data packet to a next-hop network device of the first network device.
[0154] Optionally, based on the foregoing descriptions of 1, a structure of the second IFIT header is that shown in
[0155] A manner in which the first network device serving as the intermediate node device stores the first packet detection result is similar to the foregoing manner in which the first packet detection result is stored in 1, and details are not described in embodiments of this application again. In addition, for a manner in which the first network device detects the first data packet based on the detection task type, refer to the descriptions of 1.
[0156] 3. The First Network Device is the Egress Node Device
[0157] When the first network device is the egress node device, the first data packet obtained by the first network device is a data packet sent by a previous-hop network device of the first network device. In other words, the first network device may receive the first data packet sent by the previous-hop network device of the first network device. The first network device may determine the detection task type from the second IFIT header included in the first data packet, and therefore detect the first data packet based on the detection task type, to obtain the first packet detection result. The first network device stores the first packet detection result, parses out the second IFIT header from the first data packet to obtain a second data packet, and sends the second data packet to a destination end device. In other words, the second IFIT header in the first data packet is stripped to obtain the second data packet, and the second data packet is sent to the destination end device.
[0158] Optionally, based on the foregoing descriptions of 1, a structure of the second IFIT header is that shown in
[0159] A manner in which the first network device serving as the egress node device stores the first packet detection result is similar to the foregoing manner in which the first packet detection result is stored in 1, and details are not described in embodiments of this application again. In addition, for a manner in which the first network device detects the first data packet based on the detection task type, refer to the descriptions of 1.
[0160]
[0161] After the data packet is transmitted according to the foregoing method and IFIT detection is performed in a process of transmitting the data packet, the first network device may transmit a detection result according to the following method after the first period ends.
[0162] Step 701: A first network device obtains a first IFIT detection packet, where the first IFIT detection packet includes a first IFIT header, the first IFIT header includes reporting manner indication information, and the reporting manner indication information indicates that a detection result is reported by an egress node device.
[0163] Based on the foregoing descriptions, the first network device may be an ingress node device, an intermediate node device, or the egress node device.
[0164] When the first network device is the ingress node device, the first IFIT detection packet is a detection packet generated by the first network device after a first period ends, or the first IFIT detection packet is a detection packet generated after the first network device receives a retransmission request sent by a control device, where the retransmission request is sent when the control device does not receive a first data flow detection result. In other words, the ingress node device may generate the first IFIT detection packet after the first period ends, or may generate the first IFIT detection packet after receiving the retransmission request sent by the control device.
[0165] It should be noted that, in the solution provided in this embodiment, the egress node device reports the first data flow detection result in the first period to the control device. If determining that the first data flow detection result in the first period is not received, the control device may send the retransmission request to the ingress node device. After receiving the retransmission request, the ingress node device may respond to the retransmission request, query a locally stored detection result, and regenerate the first IFIT detection packet. The retransmission request may include an identifier of the ingress node device, a flow identifier of a first data flow, and a period identifier of the first period.
[0166] When the first network device is the intermediate node device, the first IFIT detection packet further includes a second device identifier and a second data flow detection result, the second device identifier is an identifier of a second network device, the second network device is a previous-hop network device of the first network device, and the second data flow detection result is a detection result obtained by the second network device by detecting the first data flow in the first period. In other words, in this embodiment, the first IFIT detection packet received by the intermediate node device further includes the identifier of the previous-hop network device and the detection result obtained by the previous-hop network device by detecting the first data flow in the first period.
[0167] When the first network device is the egress node device, the first IFIT detection packet further includes a second device identifier and a second data flow detection result, the second device identifier is an identifier of a second network device, the second network device is a previous-hop network device of the first network device, and the second data flow detection result is a detection result obtained by the second network device by detecting the first data flow in the first period. In addition, the first IFIT detection packet further includes a third device identifier and a third data flow detection result, the third device identifier is an identifier of a third network device, the third network device is an ingress node device, and the third data flow detection result is a detection result obtained by the third network device by detecting the first data flow in the first period. In other words, in this embodiment, the first IFIT detection packet received by the egress node device further includes the identifier of the previous-hop network device, the detection result obtained by the previous-hop network device by detecting the first data flow in the first period, the identifier of the ingress node device, and the detection result obtained by the ingress node device by detecting the first data flow in the first period.
[0168] It should be noted that the detection mode may be an end-to-end detection mode or a hop-by-hop detection mode. When the detection mode is the hop-by-hop detection mode, for the intermediate node device and the egress node device, the first IFIT detection packet may carry an identifier of each-hop network device before the first network device and a detection result obtained by each-hop network device by detecting the first data flow in the first period. However, when the detection mode is the end-to-end detection mode, for the intermediate node device and the egress node device, the first IFIT detection packet may carry the identifier of the ingress node device and the detection result obtained by the ingress node device by detecting the first data flow in the first period, but does not include an identifier of the intermediate node device and a detection result obtained by the intermediate node device by detecting the first data flow in the first period.
[0169] In addition, a manner of determining the second data flow detection result and the third data flow detection result is similar to a manner of determining the first data flow detection result. Therefore, the manner of determining the second data flow detection result and the third data flow detection result is not described in detail in this embodiment. For details, refer to the following manner of determining the first data flow detection result.
[0170] In addition, a structure of the first IFIT header may be the same as a structure of a second IFIT header, that is, the structure of the first IFIT header may be that shown in
[0171] Step 702: The first network device provides a second IFIT detection packet, where the second IFIT detection packet is a detection packet obtained by adding a first device identifier and the first data flow detection result to the first IFIT detection packet, the first device identifier is an identifier of the first network device, and the first data flow detection result is a detection result obtained by the first network device by detecting the first data flow in the first period.
[0172] In some embodiments, after the first network device obtains the first IFIT detection packet, the first network device may add the first device identifier and the first data flow detection result to the first IFIT detection packet, to obtain the second IFIT detection packet. In this way, the first data flow detection result needs to be determined before the first data flow detection result is added to the first IFIT detection packet.
[0173] Optionally, the structure of the first IFIT header is the structure shown in
[0174] It should be noted that using the bit-6 of the HTI field in the second IFIT header to indicate whether the current phase is the detection result reporting phase is merely an example, and another manner may be alternatively used for indication. This is not limited in this embodiment of this application.
[0175] An implementation in which the first network device determines the first data flow detection result may be as follows: The first network device obtains, from a stored mapping relationship based on the flow identifier of the first data flow and the period identifier of the first period, a packet detection result obtained by the first network device by detecting each data packet in the first period, where the packet detection result includes the foregoing first packet detection result. Then, the first network device may process each obtained packet detection result to obtain the first data flow detection result.
[0176] In an example, when the detection task type is packet loss detection, the first network device may collect statistics about a sum of quantities of data packets discarded in packet detection results, to obtain a total quantity of data packets discarded inside the first network device. The first network device may further collect statistics about a sum of quantities of bytes discarded in the packet detection results, to obtain a total quantity of bytes discarded inside the first network device.
[0177] In another example, when the detection task type is delay detection, the first network device may collect statistics about durations obtained through statistics collection based on a delay-colored packet in each packet detection result, and determine an average value of the durations as an average duration used by the first network device from receiving a data packet to sending a data packet in the first period.
[0178] In some embodiments, the first data flow detection result may include content in
[0179] It should be noted that, it can be learned from the foregoing descriptions that the control device may be globally configured to cache the detection results of the N periods, or cache the detection result of the only one period. If the detection result of the only one period is cached, a time interval from a time point at which the ingress node device completes detection of a data packet of one period to a time point at which the ingress node device receives the retransmission request sent by the control device may exceed one period length. In this case, the value of the status code included in the first data flow detection result is 2. In other words, the control device globally configures to cache the detection results of the N periods, so that it can be ensured that a detection result of each period can be finally reported to the control device.
[0180] When the first period ends, a first data packet received by the ingress node device may still be in a queue and has not been sent in a timely manner. Therefore, the data packet still belongs to the first period. In this case, if the ingress node device immediately generates the first IFIT detection packet, adds the first device identifier and the first data flow detection result to the first IFIT detection packet to obtain the second IFIT detection packet, and starts to transmit the second IFIT detection packet, the second IFIT detection packet may reach a network device after the ingress node device earlier than a data packet, in the queue, that belongs to the first period. The network device after the ingress node device first determines a data flow detection result based on a stored packet detection result, and ignores a packet detection result of the data packet. In other words, in this case, the data flow detection result determined by the network device after the ingress node device cannot entirely include detection results of all data packets in the first period, that is, there is a risk of miss detection. Based on this, the ingress node device may generate the first IFIT detection packet after a specified duration when the first period ends, to ensure that each network device can entirely detect the data packets transmitted in the first period.
[0181] For example, the specified duration may be ⅓ of the period length or 3/10 of the period length. For example, the period length is 10 seconds, and the specified duration may be 3 seconds, that is, the first IFIT detection packet is generated at an interval of 3 seconds after the first period ends.
[0182] Step 703: The first network device processes the second IFIT detection packet.
[0183] In this embodiment, the first network device may be the ingress node device, the intermediate node device, or the egress node device. Based on this, after providing the second IFIT detection packet, different node devices process the second IFIT detection packet in different manners. The following describes this.
[0184] When the first network device is the ingress node device, the first network device may send the second IFIT detection packet to the second network device, and the second network device is a next-hop network device of the first network device.
[0185] When the first network device is the intermediate node device, the first network device may send the second IFIT detection packet to the third network device, and the third network device is a next-hop network device of the first network device.
[0186] When the first network device is the egress node device, the first network device may send the first data flow detection result, the second data flow detection result, and the third data flow detection result, that is, results obtained by the network devices on a transmission link of the first data flow through detection in a detection mode, to the control device. Alternatively, the first network device may determine a performance detection result based on the first data flow detection result, the second data flow detection result, and the third data flow detection result, and send the performance detection result to the control device. The performance detection result indicates performance of transmitting the first data flow by the first network device, the second network device, and the third network device.
[0187] Optionally, in this embodiment, when the first network device is the egress node device, after receiving the first IFIT detection packet, the first network device may parse the first IFIT header to obtain the second data flow detection result and the third data flow detection result, and then process the first data flow detection result, the second data flow detection result, and the third data flow detection result to obtain the performance detection result. Alternatively, the first network device may add the identifier of the first network device and the first data flow detection result to the first IFIT detection packet according to the foregoing method, to obtain the second IFIT detection packet, then parse the second IFIT detection packet to obtain all detection results, and perform processing to obtain the performance detection result.
[0188] In conclusion, in this embodiment, the ingress node device and the intermediate node device do not report the detection results, but add the detection results to the first IFIT detection packet hop by hop and then transmit the first IFIT detection packet to the egress node device. After receiving the IFIT detection packet sent by the previous-hop network device, the egress node device may directly report all the detection results to the control device, or the egress node device may process all the detection results to obtain the performance detection result, and then report the performance detection result to the control device.
[0189] It can be learned from the foregoing descriptions that the detection task type may be the packet loss detection, the delay detection, or the like. When the detection task type is the packet loss detection, the performance detection result may include one or more of a total quantity of lost node packets, a node packet loss rate, a total quantity of discarded node bytes, a node byte discarding rate, a total quantity of lost link packets, or a total quantity of discarded link bytes. When the detection task type is the delay detection, the performance detection result includes an average node delay and/or a link delay.
[0190] The total quantity of lost node packets is a total quantity of data packets discarded by a corresponding node device in the first period, the node packet loss rate is a rate at which the corresponding node device discards the data packets in the first period, the total quantity of discarded node bytes is a total quantity of bytes discarded by the corresponding node device in the first period, the node byte discarding rate is a rate at which the corresponding node device discards the bytes in the first period, the total quantity of lost link packets is a total quantity of data packets discarded on a first transmission link in the first period, the total quantity of discarded link bytes is a total quantity of bytes discarded on the first transmission link in the first period, and the first transmission link is a transmission link of the first data flow. The average node delay is an average duration used by a corresponding node device from receiving a data packet to sending the data packet in the first period, and the link delay is a sum of average node delays corresponding to various node devices on the first transmission link in the first period.
[0191] In addition, the detection task type may further be traffic detection, jitter detection, link recovery, or the like. In other words, the egress node device may further obtain traffic (a total quantity, a total discarding quantity, and the like), a jitter, a link, and the like of the first data flow transmitted in the first period.
[0192] It should be noted that, in this embodiment, the egress node device may encapsulate the detection results into a user datagram protocol (UDP) packet for reporting, or may encapsulate the detection results into another protocol packet for reporting. This is not limited in this embodiment of this application. The egress node device processes the detection results to obtain the performance detection result, and then encapsulates and reports the performance detection result to the control device, so that a calculation amount of the control device can be reduced, and a data flow processing capability can be improved. In addition, in this embodiment, only the egress node device performs operations such as IFIT encoding, telemetry header encapsulation, and table lookup and sending on the detection results, so that processing operations of other node devices can be reduced. When there are large-scale flows in an entire network, there is a small limitation on this embodiment of this application by a specification of an IFIT protocol supported by board hardware of a node device and an entire system.
[0193] Optionally, to ensure that a detection result is not lost as much as possible, a higher priority may be set for an IFIT detection packet to which a detection result is added hop by hop. In this way, a priority may be identified by using a quality of service (QoS) mechanism, to ensure that the packet is not discarded during QoS scheduling.
[0194]
[0195] Detection results of various node devices may be sequentially arranged in a node sequence. The node packet rate is a rate at which a corresponding node device transmits data packets, and may be determined by dividing a total quantity of data packets transmitted by the corresponding node device in the first period by a period length of the first period, that is, determined by dividing the total quantity of node packets by the period length of the first period. The node byte rate is a rate at which a corresponding node device transmits bytes, and may be determined by dividing a total quantity of bytes transmitted by the corresponding node device in the first period by the period length of the first period, that is, determined by dividing the total quantity of node bytes by the period length of the first period. The node packet loss rate is a rate at which a corresponding node device discards data packets, and may be determined by dividing a total quantity of data packets discarded by the corresponding node device in the first period by the period length of the first period, that is, determined by dividing the total quantity of lost node packets by the period length of the first period. The node byte discarding rate is a rate at which the corresponding node device discards bytes, and may be determined by dividing a total quantity of bytes discarded by the corresponding node device in the first period by the period length of the first period, that is, determined by dividing the total quantity of discarded node bytes by the period length of the first period. The average node delay is an average value of delays from receiving delay-colored packets through an ingress interface transmitted by a corresponding node device in the first period to sending the delay-colored packets through an egress interface.
[0196] The link sequence number is a sequence number allocated to a corresponding link after the egress node device recovers the link based on a node identifier carried in a detection result. The identifier of the node of the ingress interface is an identifier of an ingress node device of the link. The ingress interface name is an interface through which the ingress node device of the link receives a data packet that belongs to the first data flow. The identifier of the node of the egress interface is an identifier of an egress node device of the link. The egress interface name is an interface through which the egress node device of the link sends a data packet that belongs to the first data flow. The total quantity of lost link packets is a total quantity of data packets discarded inside each node device on the link plus a total quantity of data packets discarded between node devices. The total quantity of discarded link bytes is a total quantity of bytes discarded inside each node device on the link plus a total quantity of bytes discarded between node devices. The link delay is an average value of delay lengths inside each node device and between node devices on the link.
[0197] It should be noted that the link herein may be an entire link from the ingress node device communicating with a source end device to the egress node device communicating with a destination end device, or may be a part of the entire link.
[0198]
[0199] After receiving a reported packet that carries the performance detection result or carries the plurality of data flow detection results, the control device may determine the performance detection result of the first period, compare the performance detection result with a stored detection result of a previous period, generate a change log, and analyze a link of each period to obtain a link topology and the like.
[0200] In this embodiment, each network device adds a detection result to the IFIT detection packet hop by hop, and the egress node device performs processing and reporting. In addition, a payload of the IFIT detection packet is empty. Therefore, a proportion of valid payload carried in the IFIT detection packet is very high, this greatly reduces bandwidth consumed by a detection task. In addition, in this embodiment, a structure of an original IFIT header may remain unchanged, and meanings of only some unused bit values in a header type indicator field in the IFIT header are used to be compatible with an original IFIT protocol.
[0201] In conclusion, in embodiments of this application, the first IFIT detection packet includes the first IFIT header, and the first IFIT header includes the reporting manner indication information indicating that the detection result is reported by the egress node device. Therefore, after obtaining the first IFIT detection packet, the first network device can provide and process the second IFIT detection packet. The second IFIT detection packet is a detection packet obtained by adding the first device identifier and the first data flow detection result to the first IFIT detection packet. In other words, the detection result obtained by detecting the first data flow in the first period is reported only by the egress node device, and a node device on the transmission link of the first data flow includes, in a same IFIT detection packet, the detection result obtained by detecting the first data flow in the first period and sends the same IFIT detection packet to the egress node device. In this way, a quantity of reported packets can be reduced, consumed bandwidth is greatly reduced, and an amount of data that needs to be processed by the control device can be reduced, thereby improving a processing capability of the control device.
[0202]
[0203] The first obtaining module 1101 is configured to obtain a first IFIT detection packet, where the first IFIT detection packet includes a first IFIT header, the first IFIT header includes reporting manner indication information, and the reporting manner indication information indicates that a detection result is reported by an egress node device.
[0204] The providing module 1102 is configured to provide a second IFIT detection packet, where the second IFIT detection packet is a detection packet obtained by adding a first device identifier and a first data flow detection result to the first IFIT detection packet, the first device identifier is an identifier of the first network device, and the first data flow detection result is a detection result obtained by the first network device by detecting a first data flow in a first period.
[0205] The processing module 1103 is configured to process the second IFIT detection packet.
[0206] Optionally, the apparatus 1100 further includes:
[0207] a second obtaining module, configured to obtain a first data packet, where the first data packet includes a second IFIT header, the second IFIT header includes a detection task type, and the first data packet is a packet in the first data flow transmitted by the first network device in the first period;
[0208] a first determining module, configured to detect the first data packet based on the detection task type, to obtain a first packet detection result; and
[0209] a second determining module, configured to determine the first data flow detection result based on the first packet detection result.
[0210] Optionally, the first network device is an ingress node device, and the first IFIT detection packet is a detection packet generated by the first network device after the first period ends, or the first IFIT detection packet is a detection packet generated after the first network device receives a retransmission request sent by a control device, where the retransmission request is sent when the control device does not receive the first data flow detection result.
[0211] Optionally, the processing module 1103 includes:
[0212] a first sending module, configured to send the second IFIT detection packet to a second network device, where the second network device is a next-hop network device of the first network device.
[0213] Optionally, the first network device is an intermediate node device, the first IFIT detection packet further includes a second device identifier and a second data flow detection result, the second device identifier is an identifier of a second network device, the second network device is a previous-hop network device of the first network device, and the second data flow detection result is a detection result obtained by the second network device by detecting the first data flow in the first period.
[0214] The processing module 1103 includes:
[0215] a second sending module, configured to send the second IFIT detection packet to a third network device, where the third network device is a next-hop network device of the first network device.
[0216] Optionally, the first network device is the egress node device, the first IFIT detection packet further includes a second device identifier and a second data flow detection result, the second device identifier is an identifier of a second network device, the second network device is a previous-hop network device of the first network device, and the second data flow detection result is a detection result obtained by the second network device by detecting the first data flow in the first period; and
[0217] the first IFIT detection packet further includes a third device identifier and a third data flow detection result, the third device identifier is an identifier of a third network device, the third network device is an ingress node device, and the third data flow detection result is a detection result obtained by the third network device by detecting the first data flow in the first period.
[0218] Optionally, the processing module 1103 includes:
[0219] a third sending module, configured to send the first data flow detection result, the second data flow detection result, and the third data flow detection result to a control device.
[0220] Optionally, the processing module 1103 includes:
[0221] a determining submodule, configured to determine a performance detection result based on the first data flow detection result, the second data flow detection result, and the third data flow detection result, where the performance detection result indicates performance of transmitting the first data flow by the first network device, the second network device, and the third network device; and
[0222] a sending submodule, configured to send the performance detection result to a control device.
[0223] Optionally, when the detection task type is packet loss detection, the performance detection result includes one or more of a total quantity of lost node packets, a node packet loss rate, a total quantity of discarded node bytes, a node byte discarding rate, a total quantity of lost link packets, or a total quantity of discarded link bytes; and
[0224] the total quantity of lost node packets is a total quantity of data packets discarded by a corresponding node device in the first period, the node packet loss rate is a rate at which the corresponding node device discards the data packets in the first period, the total quantity of discarded node bytes is a total quantity of bytes discarded by the corresponding node device in the first period, the node byte discarding rate is a rate at which the corresponding node device discards the bytes in the first period, the total quantity of lost link packets is a total quantity of data packets discarded on a first transmission link in the first period, the total quantity of discarded link bytes is a total quantity of bytes discarded on the first transmission link in the first period, and the first transmission link is a transmission link of the first data flow.
[0225] Optionally, when the detection task type is delay detection, the performance detection result includes an average node delay and/or a link delay; and
[0226] the average node delay is an average duration used by a corresponding node device from receiving a data packet to sending the data packet in the first period, the link delay is a sum of average node delays corresponding to various node devices on a first transmission link in the first period, and the first transmission link is a transmission link of the first data flow.
[0227] In this embodiment, the first IFIT detection packet includes the first IFIT header, and the first IFIT header includes the reporting manner indication information indicating that the detection result is reported by the egress node device. Therefore, after obtaining the first IFIT detection packet, the first network device can provide and process the second IFIT detection packet. The second IFIT detection packet is a detection packet obtained by adding the first device identifier and the first data flow detection result to the first IFIT detection packet. In other words, the detection result obtained by detecting the first data flow in the first period is reported only by the egress node device, and a node device on the transmission link of the first data flow includes, in a same IFIT detection packet, the detection result obtained by detecting the first data flow in the first period and sends the same IFIT detection packet to the egress node device. In this way, a quantity of reported packets can be reduced, consumed bandwidth is greatly reduced, and an amount of data that needs to be processed by the control device can be reduced, thereby improving a processing capability of the control device.
[0228] It should be noted that when the network performance detection apparatus provided by the foregoing embodiment detects network performance, division into the foregoing functional modules is merely used as an example for description. During actual application, the foregoing functions can be allocated to different functional modules for implementation based on a requirement, that is, an inner structure of an apparatus is divided into different functional modules to implement all or some of the functions described above. In addition, the network performance detection apparatus provided in the foregoing embodiment and the embodiment of the network performance detection method belong to a same concept. For a specific implementation process of the network performance detection apparatus, refer to the method embodiment. Details are not described herein again.
[0229] All or some of the foregoing embodiments may be implemented by using software, hardware, firmware, or any combination thereof. When software is used to implement embodiments, all or some of embodiments may be implemented in a form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the procedures or functions according to embodiments of this application are all or partially generated. The computer may be a general-purpose computer, a dedicated computer, a computer network, or another programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or may be transmitted from a computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center to another website, computer, server, or data center in a wired (for example, a coaxial cable, an optical fiber, or a digital subscriber line (DSL)) or wireless (for example, infrared, radio, or microwave) manner. The computer-readable storage medium may be any usable medium accessible to a computer, or a data storage device, such as a server or a data center, integrating one or more usable media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, or a magnetic tape), an optical medium (for example, a digital versatile disc (DVD)), a semiconductor medium (for example, a solid state disk (SSD)), or the like. It should be noted that the computer-readable storage medium mentioned in this application may be a non-volatile storage medium. In other words, the computer-readable storage medium may be a non-transitory storage medium.
[0230] The foregoing descriptions are merely non-limiting example embodiments of this application, but are not intended to limit this application. Any modification, equivalent replacement, or improvement made without departing from the spirit and principle of this application should fall within the protection scope of this application.