Method for detecting time delay, electronic equipment and readable storage medium

By obtaining the incoming time stamp and link delay of the node, the node delay is calculated, which solves the problem that data processing equipment cannot obtain node delay information, and optimizes the visibility of IOAM delay data.

CN120223584APending Publication Date: 2025-06-27ZTE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311833686.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-27
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

The data processing device cannot obtain the device delay information of the node, resulting in the inability to realize real-time perception and monitoring of the network operating status.

Method used

By obtaining the inbound time stamp of the target data packet received by the first node and the second node, and using the TWAMP protocol to measure the link delay between the first node and the second node, the node delay of the first node is calculated.

Benefits of technology

It solves the problem that data processing equipment cannot obtain node delay information, optimizes the visibility of IOAM delay data, and realizes accurate monitoring and analysis of network delay.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120223584A_ABST
    Figure CN120223584A_ABST
Patent Text Reader

Abstract

The invention discloses a time delay detection method, electronic equipment and a readable storage medium, and belongs to the field of communication. The time delay detection method comprises the following steps: acquiring a first incoming timestamp of a target data packet received by a first node; wherein the first incoming timestamp is reported by the first node based on in-band operation management and maintenance; acquiring a second incoming timestamp of the target data packet received by a second node; wherein the second incoming timestamp is reported by the second node based on in-band operation management and maintenance, and the target data packet is sent to the second node from the first node; obtaining a first link time delay between the first node and the second node, wherein the first link time delay is obtained based on a bidirectional active measurement protocol; and determining the node time delay of the first node based on the first incoming timestamp, the second incoming timestamp and the first link time delay.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of communications, and particularly relates to a method for detecting latency, an electronic device, and a readable storage medium. Background Art

[0002] In-band Operation, Administration, and Maintenance (IOAM) is a network measurement and monitoring technology. Nodes can use IOAM to sample service traffic, add IOAM information (such as device identification, ingress and egress interfaces, timestamps, etc.) to the sampled data, and then actively send the sampled data to a data processing device for analysis.

[0003] In related technologies, a data processing device can achieve real-time perception and monitoring of the network operating state based on the timestamps reported by nodes. However, when IOAM is enabled, nodes cannot report effective egress timestamp data, resulting in the data processing device being unable to obtain the device latency information of nodes. Summary of the Invention

[0004] Embodiments of this application provide a method for detecting latency, an electronic device, and a readable storage medium, which can solve the problem in related technologies that a data processing device cannot obtain the device latency information of nodes.

[0005] In a first aspect, embodiments of this application provide a method for detecting latency, which includes:

[0006] Obtain a first ingress timestamp when a first node receives a target data packet; wherein, the first ingress timestamp is reported by the first node based on IOAM;

[0007] Obtain a second ingress timestamp when a second node receives the target data packet; wherein, the second ingress timestamp is reported by the second node based on IOAM, and the target data packet is sent from the first node to the second node;

[0008] Obtain a first link latency between the first node and the second node, where the first link latency is obtained based on the Two-Way Active Measurement Protocol (TWAMP);

[0009] Determine the node latency of the first node based on the first ingress timestamp, the second ingress timestamp, and the first link latency.

[0010] In a second aspect, embodiments of this application provide another method for detecting latency, which is applied to a first node and includes:

[0011] Determine the first incoming timestamp when the target data packet is received based on IOAM, and report the first incoming timestamp to the server;

[0012] Obtain the first link delay between the first node and the second node based on TWAMP, and report the first link delay to the server, so that the server determines the node delay of the first node based on the first incoming timestamp, the second incoming timestamp, and the first link delay;

[0013] Wherein, the target data packet is sent from the first node to the second node, and the second incoming timestamp is the incoming timestamp when the second node receives the target data packet.

[0014] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory. The memory stores a program or instruction that can run on the processor. When the program or instruction is executed by the processor, the steps of the method described in the first aspect are implemented.

[0015] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0016] In an embodiment of the present application, obtain the first incoming timestamp when the first node receives the target data packet; wherein, the first incoming timestamp is reported by the first node based on IOAM; obtain the second incoming timestamp when the second node receives the target data packet; wherein, the second incoming timestamp is reported by the second node based on IOAM, and the target data packet is sent from the first node to the second node; obtain the first link delay between the first node and the second node, and the first link delay is obtained based on TWAMP; determine the node delay of the first node based on the first incoming timestamp, the second incoming timestamp, and the first link delay. In this way, the first link delay between the first node and the second node is obtained through TWAMP, which solves the problem that link delay data cannot be obtained due to node self-limitation. Combining with the first incoming timestamp and the second incoming timestamp obtained through IOAM, the node delay of the first node is determined, which solves the problem that the data processing device in the related art cannot obtain the device delay information of the node. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 is a schematic diagram of the overall concept of a method for detecting delay provided by the present application;

[0018] Figure 2 is a flowchart of a method for detecting delay provided by the present application;

[0019] Figure 3 It is a flowchart of another method for detecting delay provided by this application;

[0020] Figure 4 It is a flowchart of another method for detecting delay provided by this application;

[0021] Figure 5 It is a flowchart of another method for detecting delay provided by this application;

[0022] Figure 6 It is a flowchart of another method for detecting delay provided by this application;

[0023] Figure 7 It is a flowchart of another method for detecting delay provided by this application;

[0024] Figure 8 It is a flowchart of another method for detecting delay provided by this application;

[0025] Figure 9 It is a block diagram of the structure of an electronic device provided by this application. Detailed implementation manners

[0026] Next, the technical solutions in the embodiments of this application will be clearly described in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art belong to the scope protected by this application.

[0027] The terms "first", "second", etc. in the specification and claims of this application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such used data can be interchanged under appropriate circumstances so that the embodiments of this application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are usually of the same type, and the number of objects is not limited. For example, the first object can be one or multiple. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally means an "or" relationship between the associated objects before and after.

[0028] Based on the in-band detection principle, IOAM provides end-to-end and hop-by-hop performance detection capabilities for the bearer network service flow, which can quickly sense network performance-related faults and perform accurate fault location and troubleshooting. Through the IOAM technology, without inserting additional Operation Administration and Maintenance (OAM) messages, the detection information (including detection instructions and detection data) can be carried in the service messages to be detected, thus realizing in-band performance detection. In practical applications, the IOAM technology is mainly used for packet loss detection and delay detection along with service forwarding.

[0029] In the related art, a visualization function for link delay and packet loss data can be provided, but there are still some limitations in actual use. When the IOAM function in hop-by-hop mode is enabled, both the network side and the user side of all devices in the service path need to report corresponding timestamps and statistical data to the data collector, and the data collector calculates the delay and packet loss data and generates a topology map of the delay and packet loss results for the corresponding service. However, due to the limitations of some devices, in hop-by-hop mode, when the message carrying the IOAM label leaves these devices, only the valid incoming network-side timestamp can be reported, and the valid outgoing network-side timestamp cannot be reported. For example, as Figure 1 shown, when the IOAM function in hop-by-hop mode is enabled, both the A side of the PE node (e.g., operator edge router) and the C side of the P node (e.g., operator backbone router) can report valid incoming timestamp data, but the B side of the PE device and the D side of the P device cannot report valid outgoing timestamp data, which causes the data processing device to be unable to obtain the device delay information of the node, thereby affecting the visibility of in-band delay data.

[0030] Therefore, this application proposes a method for detecting delay, which can solve the problem that the data processing device cannot obtain the device delay information of the node and optimize the visibility of IOAM delay data in hop-by-hop mode. Figure 1 It is a schematic diagram of the overall concept of a method for detecting delay provided by this application. As Figure 1As shown in the figure, the IOAM and TWAMP functions are configured simultaneously on multiple devices in the service path for detection. Then, the nodes on the service path use the IOAM function to collect timestamp data and the TWAMP function to collect link delay data. After that, the data collector obtains the inbound timestamp reported by the node based on IOAM, and then obtains the second link delay. At the same time, the data collector obtains the first link delay reported by the node based on TWAMP. Then, based on the first link delay and the second link delay, the complete link delay data and node delay data can be obtained, solving the problem that the data processing device cannot obtain the device delay information of the node. Furthermore, a complete delay data topology map can be obtained, improving the visibility of the overall delay data. Among them, the data collector is located on the data processing device, and the data processing device can refer to a processing server.

[0031] Figure 2 is a flowchart of a method for detecting delay provided by an embodiment of the present application. As Figure 2 shown, the method for detecting delay provided by the embodiment of the present application includes:

[0032] Step 210: Obtain the first inbound timestamp when the first node receives the target data packet; wherein, the first inbound timestamp is reported by the first node based on IOAM;

[0033] In this step, the IOAM function includes an end-to-end mode and a hop-by-hop mode. Among them, the end-to-end mode can refer to monitoring the data at the input end and the output end without processing the intermediate data. As Figure 1 shown, in the end-to-end mode of the IOAM function, the relevant data at point A and point E are monitored, and then the delay and packet loss situations in the service process are judged.

[0034] The hop-by-hop mode can mean that each node passed by the service reports its own data. A service will pass through multiple devices from the user to the server, and one device is one node. Hop-by-hop can mean that on this link, all devices process the generated data through the IOAM function. As Figure 1 shown, in the hop-by-hop mode of the IOAM function, each node reports its own data. However, due to the limitations of the node itself, the node cannot report a valid outbound timestamp. Therefore, the data collector can only obtain the inbound timestamps of each node. For example, the data collector cannot obtain the outbound timestamp B of the first PE node and the outbound timestamp D of the first P node, but can obtain the inbound timestamp A of the first PE node and the inbound timestamp C of the first P node. By analogy, the data collector can obtain the inbound timestamps of each node on the link.

[0035] In this step, before obtaining the inbound timestamp of the node, the IOAM function can be switched from the end-to-end mode to the hop-by-hop mode.

[0036] It should be noted that the IOAM function can be pre-deployed on the PE nodes and P nodes involved in the service. Specifically, the IOAM function of the PE node can be deployed by issuing configurations, and the IOAM function of the P node can be deployed by self-learning or issuing configurations.

[0037] In this step, under the hop-by-hop mode of the IOAM function, the data collector can obtain the incoming timestamp data reported by the nodes (for example, the first node or the second node). For example, the incoming timestamp data of the PE node and the incoming timestamp data of the P node. Therefore, through the hop-by-hop mode of the IOAM function, the first incoming timestamp when the first node receives the target data packet is obtained.

[0038] In addition, before reporting the first incoming timestamp, the first node can also perform validity verification on the first incoming timestamp. The validity verification includes at least one of the following:

[0039] First, determine whether the incoming timestamp to be verified is 0; if the incoming timestamp to be verified is 0, determine that the verification result of the incoming timestamp to be verified is invalid; if the incoming timestamp to be verified is not 0, determine that the verification result of the incoming timestamp to be verified is valid;

[0040] For example, when the number of data packets is not zero but the timestamp is zero, the first node itself can determine that the verification result of the incoming timestamp to be verified is invalid.

[0041] Second, determine whether the difference between the incoming timestamp to be verified and the target timestamp is less than a threshold; if the difference is greater than or equal to the threshold, determine that the verification result of the incoming timestamp to be verified is invalid; if the difference is less than the threshold, determine that the verification result of the incoming timestamp to be verified is valid; where the target timestamp includes one of the following: a pre-set timestamp; the current time point of the first node; the reporting time point of the incoming timestamp of the target data packet.

[0042] Among them, the validity verification can be completed by the node. The node can obtain the difference between its own current time point (for example, the time point when the incoming timestamp is obtained or the time point when the incoming timestamp is reported) and the incoming timestamp, and determine whether the difference is less than the threshold (the threshold can be configured, for example, twice the coloring period). If it is less, it is considered that the verification result of the incoming timestamp is valid; if it is greater, it is considered that the verification result of the incoming timestamp is invalid. For example, if the coloring period is 30 seconds, and the difference between the incoming timestamp that the node is about to report and the time point when the incoming timestamp is reported is greater than twice the coloring period, that is, 60 seconds, then the incoming timestamp is considered invalid.

[0043] The node can also obtain the difference between the incoming timestamp data and the preset timestamp. For example, if the preset timestamp is January 1, 2000, and the incoming timestamp is earlier than January 1, 2000, the verification result of the incoming timestamp is considered invalid.

[0044] The node can also obtain the difference between the incoming timestamp data and the reporting time point of the incoming timestamp of the target data packet, and the difference should be less than the threshold. If the difference is greater than or equal to the threshold, it is determined that the verification result of the incoming timestamp to be verified is invalid; if the difference is less than the threshold, it is determined that the verification result of the incoming timestamp to be verified is valid. Among them, the threshold can be obtained from empirical values or set according to requirements.

[0045] Step 220: Obtain the second incoming timestamp when the second node receives the target data packet; where the second incoming timestamp is reported by the second node based on IOAM, and the target data packet is sent from the first node to the second node;

[0046] In this step, the method of obtaining the second incoming timestamp is similar to the method of obtaining the first incoming timestamp, and the specific content can refer to the corresponding description in Step 210.

[0047] Step 230: Obtain the first link delay between the first node and the second node, and the first link delay is obtained based on TWAMP;

[0048] The TWAMP protocol involves two entities, the sender and the receiver. The sender sends control information to the receiver, requesting the receiver to initiate a series of test data. After receiving the request, the receiver responds and initiates data testing, thereby realizing network performance statistics (delay, jitter, packet loss rate). The specific method is as follows:

[0049] Delay: Generated by the timestamps carried by the probe frames. The sender carries the sending timestamp t1 when sending the probe frame, the receiver carries the receiving timestamp t1' and the response timestamp t2' when responding to the probe frame, and the sender records the receiving timestamp t2 when receiving the response probe frame. Finally, the delay of a single cycle is calculated through four timestamps, specifically as follows: D1 = t2 - t1 - (t2' - t1').

[0050] Jitter: Calculated from the absolute value of the delay data of adjacent cycles. Through the above delay calculation formula, the delay value of adjacent cycles D2 = t4 - t3 - (t4' - t3') can be obtained. Finally, the jitter value is calculated through two delay values, specifically as follows: D = |D2 - D1|.

[0051] Packet loss rate: Calculated by the number of packets sent and received by the sender. When the number of packets sent by the sender is P1 and the number of packets received is P2, its packet loss rate is: Loss = (P1 - P2) / P1.

[0052] For example, as Figure 1 shown, the first PE node acts as the sender, and the first P node acts as the receiver. The PE node and the P node can obtain the delay D1 (i.e., the link delay between points B and C, i.e., the first link delay) after sending probe frames multiple times. Among them, both the PE node and the P node can report the first link delay.

[0053] In the embodiments of the present application, the TWAMP function can be used to obtain the first link delay between the first node and the second node.

[0054] For example, in a possible implementation manner, in adjacent devices in the service path (i.e., directly interacting devices, such as the first PE node and the first P node), the TWAMP function of the network-side link is enabled. Among them, the network-side link includes all nodes except the entrance and exit in the service path and involves all devices. Specifically, the TWAMP function is deployed on all PE nodes and P nodes on the link. When the delay data is abnormal or when the issued requirements are received, the link delay data between nodes is obtained and reported to the data collector. Among them, the TWAMP function provides automatic activation in abnormal situations and can also be actively activated.

[0055] When the IOAM function is enabled in the end-to-end mode and the hop-by-hop mode, the TWAMP function can be enabled at the same time. However, in the end-to-end mode, the practical value of enabling the TWAMP function is not high. Therefore, in order to reduce resource consumption, the TWAMP function may not be enabled in the IOAM function of the end-to-end mode. Generally, only the network-side TWAMP function of adjacent devices is configured when the IOAM function of the hop-by-hop mode is enabled.

[0056] In the embodiments of the present application, since the service is continuously executed. Therefore, during the execution of the service, the data involved in the service will always stay in the nodes. The nodes upload the data in the previous period at regular intervals and perform coloring. This period is the coloring period.

[0057] In this step, the coloring period of the IOAM can be an integer multiple of the TWAMP packet sending period. Therefore, within one coloring period of the IOAM, multiple link delays can be obtained based on the TWAMP. Then, when the number of link delays obtained within one coloring period of the IOAM is greater than 2, M link delays between the first node and the second node within one coloring period of the IOAM can be obtained. Based on the M link delays, the link average delay is determined, and the link average delay is determined as the first link delay.

[0058] For example, if the coloring period of IOAM is 10 s (configurable, such as 30 s or 60 s) and the packet sending period of TWAMP is 1 s (configurable, such as 2 s or 3 s), then there will be ten link delays within one coloring period of IOAM. Therefore, the average value of the ten link delays can be obtained, and the average value is used as the average link delay, and the average link delay is determined as the first link delay.

[0059] In addition, when the number of link delays obtained within one IOAM coloring period is greater than 4, abnormal data can be excluded by the exclusion method, and then the average link delay is calculated. That is, when M is greater than 4, the maximum delay and the minimum delay among the M link delays are removed to obtain M - 2 link delays; then the average value of the M - 2 link delays is calculated, and the average value is determined as the average link delay, and the average link delay is determined as the first link delay.

[0060] In this way, the maximum and minimum values among the M link delays can be excluded, and then the average TWAMP link delay within the current IOAM period is calculated, so that the result of the obtained first link delay is more accurate.

[0061] Step 240: Determine the node delay of the first node based on the first incoming timestamp, the second incoming timestamp, and the first link delay.

[0062] In this step, the method for determining the node delay of the first node includes: calculating a first difference between the first incoming timestamp and the second incoming timestamp, and using the first difference as the second link delay between the first node and the second node; calculating a second difference between the second link delay and the first link delay, and using the second difference as the node delay of the first node.

[0063] For example, as Figure 1 shown, point PE is the first node and point P is the second node. Then, after the data collector obtains the first incoming timestamp reported at point A and the second incoming timestamp reported at point C, the second link delay is the second incoming timestamp minus the first incoming timestamp, obtaining a first difference AC (i.e., the time difference from point A to point C). At this time, based on TWAMP, the first link delay BC (i.e., the time difference from point B to point C) is obtained, and then the second link delay AC minus the first link delay BC can be used to determine the node delay AB of the first node (i.e., the time difference from point A to point B).

[0064] In this step, before determining the node delay in the first stage, the validity of the first incoming timestamp and the second incoming timestamp can also be verified, and the first incoming timestamp with a valid verification result is used as the first verification timestamp, and the second incoming timestamp with a valid verification result is used as the second verification timestamp;

[0065] Among them, the purpose of the validity verification is to check the timestamp to avoid obtaining invalid timestamp data. The validity verification includes at least one of the following:

[0066] First, determine whether the incoming timestamp to be verified is 0; if the incoming timestamp to be verified is 0, determine that the verification result of the incoming timestamp to be verified is invalid; if the incoming timestamp to be verified is not 0, determine that the verification result of the incoming timestamp to be verified is valid;

[0067] For example, when the number of data packets is not zero but the timestamp is zero, it can be determined that the verification result of the incoming timestamp to be verified is invalid.

[0068] Second, determine whether the difference between the incoming timestamp to be verified and the target timestamp is less than the threshold; if the difference is greater than or equal to the threshold, determine that the verification result of the incoming timestamp to be verified is invalid; if the difference is less than the threshold, determine that the verification result of the incoming timestamp to be verified is valid; where the target timestamp includes one of the following: a pre-set timestamp; the current time point of the first node; the reporting time point of the incoming timestamp of the target data packet.

[0069] Among them, the validity verification can be completed by the node. The node can obtain the difference between its own current time point (for example, the time point when the incoming timestamp is obtained or the time point when the incoming timestamp is reported) and the incoming timestamp, and determine whether the difference is less than the threshold (the threshold can be configured, for example, twice the coloring period). If it is less, the verification result of the incoming timestamp is considered valid, and if it is greater, the verification result of the incoming timestamp is considered invalid. For example, if the coloring period is 30 seconds, and the difference between the incoming timestamp that the node is about to report and the time point when the incoming timestamp is reported is greater than twice the coloring period, that is, 60 seconds, then the incoming timestamp is considered invalid.

[0070] The node can also obtain the difference between the incoming timestamp data and the pre-set timestamp. For example, if the pre-set timestamp is January 1, 2000, and the incoming timestamp is earlier than January 1, 2000, then the verification result of the incoming timestamp is considered invalid.

[0071] The node can also obtain the difference between the incoming timestamp data and the reporting time point of the incoming timestamp of the target data packet, and the difference should be less than a threshold. If the difference is greater than or equal to the threshold, it is determined that the verification result of the incoming timestamp to be verified is invalid; if the difference is less than the threshold, it is determined that the verification result of the incoming timestamp to be verified is valid. Wherein, the threshold can be obtained from empirical values or can be set according to requirements.

[0072] In the embodiments of the present application, any one of the validity verification methods can be selected to verify the validity of the timestamp data. Two validity verification methods can also be used simultaneously to verify the validity of the timestamp data. When both validity verification methods consider the incoming timestamp data to be valid, the node reports the timestamp data.

[0073] In addition, the data collector can also perform validity verification of the data. For example, nodes (or devices) in the service path send incoming timestamp data and link delay data to the data collector. When the data collector obtains the incoming timestamp data and the link delay data, it can verify the validity of the data through the above-mentioned validity verification methods.

[0074] After obtaining the first incoming timestamp with a valid verification result, that is, the first verification timestamp, and the second incoming timestamp with a valid verification result, that is, the second verification timestamp, then based on the first verification timestamp, the second verification timestamp, and the first link delay, the node delay of the first node is determined.

[0075] Then, based on the node delay of the first node and the first link delay, a service delay topology graph is generated; the service delay topology graph is displayed; wherein, the service delay topology graph includes the node delay of the first node and the first link delay.

[0076] For example, as Figure 1 shown, the data collector collects the incoming timestamp data from point A to point C based on the IOAM function, calculates the second link delay AC from point A to point C, and then subtracts the first link delay BC of TWAMP reported by the first PE node (or the first P node) to calculate the node delay AB of the PE device. Through this method, the node delays of each node on the service path can be calculated respectively, and combined with the link delay data obtained based on the TWAMP function, the final delay result topology graph is generated.

[0077] Therefore, the data collector can obtain the link delay data and node delay data related to each node, and then clearly draw a complete service delay topology graph, improving the user experience, optimizing the visibility of the IOAM delay data, and enabling the user to more accurately perceive the changes in service delay.

[0078] In addition, the method for detecting latency provided in the embodiments of the present application can be applied to private network services and also to public network services. For example, in a possible scenario, after configuring private network services such as L2VPN or L3VPN, the IOAM function is configured for multiple devices. At the same time, in another possible scenario, in a public network service, the IOAM function can also be configured for multiple devices to be detected to detect specified traffic flow characteristics. Among them, the traffic flow characteristics include source IP, destination IP, protocol number, etc.

[0079] In the embodiments of the present application, obtain a first inbound timestamp when the first node receives a target data packet; wherein, the first inbound timestamp is reported by the first node based on IOAM; obtain a second inbound timestamp when the second node receives the target data packet; wherein, the second inbound timestamp is reported by the second node based on IOAM, and the target data packet is sent from the first node to the second node; obtain a first link latency between the first node and the second node, where the first link latency is obtained based on TWAMP; based on the first inbound timestamp, the second inbound timestamp, and the first link latency, determine the node latency of the first node. In this way, the first link latency between the first node and the second node is obtained through TWAMP, solving the problem that link latency data cannot be obtained due to node self-limitation. Combining the first inbound timestamp and the second inbound timestamp obtained through IOAM, the node latency of the first node is determined, solving the problem that data processing devices in the related art cannot obtain device latency information of nodes.

[0080] Figure 3 is a flowchart of a method for detecting latency provided in the embodiments of the present application. As Figure 3 shown, the method for detecting latency provided in the embodiments of the present application includes:

[0081] Step 310: Obtain a first inbound timestamp when the first node receives a target data packet; wherein, the first inbound timestamp is reported by the first node based on IOAM;

[0082] Step 320: Obtain a second inbound timestamp when the second node receives the target data packet; wherein, the second inbound timestamp is reported by the second node based on IOAM, and the target data packet is sent from the first node to the second node;

[0083] For specific explanations of Step 310 and Step 320, reference can be made to the descriptions of the corresponding steps in Figure 2 the corresponding part.

[0084] Step 330: Obtain M link latencies between the first node and the second node within one coloring period of the IOAM;

[0085] In the embodiments of the present application, since the service is continuously executed. Therefore, during the execution of the service, the data involved in the service will always stay in the node. The node uploads the data within the previous period at regular intervals and performs coloring. This period is the coloring period.

[0086] In this step, the coloring period of the IOAM can be an integer multiple of the TWAMP packet sending period. Therefore, within one coloring period of the IOAM, multiple link delays can be obtained based on TWAMP.

[0087] Then, when the number of link delays obtained within one IOAM coloring period is greater than 2, M link delays between the first node and the second node within one coloring period of the IOAM can be obtained. Based on the M link delays, the link average delay is determined, and the link average delay is determined as the first link delay.

[0088] For example, if the coloring period of the IOAM is 10s (configurable, such as 30s or 60s), and the packet sending period of TWAMP is 1s (configurable, such as 2s or 3s), then there will be ten link delays within one coloring period of the IOAM. Therefore, the average value of the ten link delays can be obtained, and the average value is used as the link average delay, and the link average delay is determined as the first link delay.

[0089] Step 340: Remove the maximum delay and the minimum delay among the M link delays to obtain M - 2 link delays;

[0090] In this step, when the number of link delays obtained within one IOAM coloring period is greater than 4, abnormal data can also be excluded by the exclusion method, and then the link average delay is calculated.

[0091] Step 350: Calculate the average value of the M - 2 link delays, determine the average value as the link average delay, and determine the link average delay as the first link delay;

[0092] When M is greater than 4, remove the maximum delay and the minimum delay among the M link delays to obtain M - 2 link delays; then calculate the average value of the M - 2 link delays, determine the average value as the link average delay, and determine the link average delay as the first link delay.

[0093] In this way, the maximum and minimum values among the M link delays can be excluded, and then the TWAMP link average delay within the current IOAM period can be calculated, making the result of the obtained first link delay more accurate.

[0094] Step 360: Determine the node delay of the first node based on the first incoming timestamp, the second incoming timestamp, and the first link delay.

[0095] In the embodiments of the present application, the first link delay between the first node and the second node is obtained through TWAMP, which solves the problem that the link delay data cannot be obtained due to the limitations of the node itself. By combining the first incoming timestamp and the second incoming timestamp obtained through IOAM, the node delay of the first node is determined, which solves the problem that the data processing device in the related art cannot obtain the device delay information of the node. In the process of obtaining the first link delay based on the TWAMP function, a more accurate first link delay is obtained by excluding the maximum delay and the minimum delay and calculating the average link delay, which can accurately display the delay status of the link.

[0096] Figure 4 It is a flowchart of a method for detecting delay provided by the embodiments of the present application. As Figure 4 shown, the method for detecting delay provided by the embodiments of the present application includes:

[0097] Step 410: Obtain the first incoming timestamp when the first node receives the target data packet; wherein, the first incoming timestamp is reported by the first node based on IOAM;

[0098] Step 420: Obtain the second incoming timestamp when the second node receives the target data packet; wherein, the second incoming timestamp is reported by the second node based on IOAM, and the target data packet is sent from the first node to the second node;

[0099] Step 430: Obtain the first link delay between the first node and the second node, where the first link delay is obtained based on TWAMP;

[0100] For the specific explanations of Step 410, Step 420, and Step 430, reference can be made to the descriptions of the corresponding steps in Figure 2 the corresponding part.

[0101] Step 440: Calculate the first difference between the first incoming timestamp and the second incoming timestamp, and use the first difference as the second link delay between the first node and the second node;

[0102] In this step, as Figure 1 shown, when the PE point is the first node and the P point is the second node. After the data collector obtains the first incoming timestamp reported by point A and the second incoming timestamp reported by point C, the second link delay is the second incoming timestamp minus the first incoming timestamp, and the obtained first difference AC.

[0103] Step 450: Calculate a second difference between the second link delay and the first link delay, and use the second difference as the node delay of the first node.

[0104] In this step, based on TWAMP, obtain the first link delay BC, and then subtract the first link delay BC from the second link delay AC to determine the node delay AB of the first node.

[0105] Step 460: Generate a service delay topology map based on the node delay of the first node and the first link delay;

[0106] In this step, the node delays of each node on the service path can be calculated respectively, and combined with the link delay data obtained based on the TWAMP function, to generate the final delay result topology map. Therefore, the data collector can obtain the link delay data and node delay data related to each node, and then clearly draw the complete service delay topology map, improving the user experience, optimizing the visibility of IOAM delay data, and enabling the user to more accurately perceive the change of service delay.

[0107] Step 470: Display the service delay topology map; wherein, the service delay topology map includes the node delay of the first node and the first link delay.

[0108] In this step, the service delay topology map can be displayed on the display interface, so as to grasp the situation of service delay in real time.

[0109] In the embodiment of the present application, the first link delay between the first node and the second node is obtained through TWAMP, which solves the problem that link delay data cannot be obtained due to node self - limitations. Then, combined with the first incoming timestamp and the second incoming timestamp obtained through IOAM, the node delay of the first node is determined, which solves the problem that the data processing device in the related art cannot obtain the device delay information of the node. In this process, the second link delay is determined through the first incoming timestamp and the second incoming timestamp, and then the node delay of the first node is determined according to the second link delay and the first link delay. Through specific calculations, accurate data of the node delay can be obtained, and then a complete service delay topology map can be obtained to facilitate real - time monitoring of the service delay situation.

[0110] Figure 5 It is a flowchart of a method for detecting delay provided by an embodiment of the present application. As Figure 5 shown, the method for detecting delay provided by the embodiment of the present application includes:

[0111] Step 510: Obtain a first incoming timestamp when the first node receives a target data packet; wherein, the first incoming timestamp is reported by the first node based on IOAM;

[0112] Step 520: Obtain a second incoming timestamp when the second node receives the target data packet; wherein, the second incoming timestamp is reported by the second node based on IOAM, and the target data packet is sent from the first node to the second node;

[0113] Step 530: Obtain a first link delay between the first node and the second node, where the first link delay is obtained based on TWAMP;

[0114] For the specific explanations of Step 510, Step 520, and Step 530, reference can be made to the descriptions of the corresponding steps in Figure 2 the following.

[0115] Step 540: Perform validity verification on the first incoming timestamp and the second incoming timestamp, and use the first incoming timestamp with a valid verification result as the first verification timestamp, and use the second incoming timestamp with a valid verification result as the second verification timestamp;

[0116] Among them, the purpose of the validity verification is to verify the timestamp to avoid obtaining invalid timestamp data. The validity verification includes at least one of the following:

[0117] First, determine whether the incoming timestamp to be verified is 0; if the incoming timestamp to be verified is 0, determine that the verification result of the incoming timestamp to be verified is invalid; if the incoming timestamp to be verified is not 0, determine that the verification result of the incoming timestamp to be verified is valid;

[0118] For example, when the number of data packets is not zero but the timestamp is zero, it can be determined that the verification result of the incoming timestamp to be verified is invalid.

[0119] Second, determine whether the difference between the incoming timestamp to be verified and a target timestamp is less than a threshold; if the difference is greater than or equal to the threshold, determine that the verification result of the incoming timestamp to be verified is invalid; if the difference is less than the threshold, determine that the verification result of the incoming timestamp to be verified is valid; where the target timestamp includes one of the following: a pre-set timestamp; the current time point of the first node; the reporting time point of the incoming timestamp of the target data packet.

[0120] Among them, the validity verification can be completed by the node. The node can obtain the difference between its own current time point (for example, the time point when obtaining the incoming timestamp or reporting the incoming timestamp) and the incoming timestamp, and determine whether the difference is less than a threshold (the threshold can be configured, for example, twice the coloring period). If it is less, the verification result of the incoming timestamp is considered valid; if it is greater, the verification result of the incoming timestamp is considered invalid. For example, if the coloring period is thirty seconds, and the difference between the incoming timestamp that the node is about to report and the time point of reporting the incoming timestamp is greater than twice the coloring period, that is, sixty seconds, then the incoming timestamp is considered invalid.

[0121] The node can also obtain the difference between the incoming timestamp data and the pre-set timestamp. For example, the pre-set timestamp is January 1, 2000. If the incoming timestamp is earlier than January 1, 2000, the verification result of the incoming timestamp is considered invalid.

[0122] The node can also obtain the difference between the incoming timestamp data and the reporting time point of the incoming timestamp of the target data packet, and the difference should be less than a threshold. If the difference is greater than or equal to the threshold, it is determined that the verification result of the incoming timestamp to be verified is invalid; if the difference is less than the threshold, it is determined that the verification result of the incoming timestamp to be verified is valid. Among them, the threshold can be obtained from empirical values or set according to requirements.

[0123] Step 550: Determine the node delay of the first node based on the first verification timestamp, the second verification timestamp, and the first link delay;

[0124] In this step, the method for determining the node delay of the first node can refer to the descriptions of Figure 4 Steps 440 and 450.

[0125] In the embodiments of the present application, the first link delay between the first node and the second node is obtained through TWAMP, which solves the problem that the link delay data cannot be obtained due to the limitations of the node itself. Combined with the first incoming timestamp and the second incoming timestamp obtained through IOAM, the node delay of the first node is determined, which solves the problem that the data processing device in the related art cannot obtain the device delay information of the node. Before determining the node delay of the first node, the validity of the incoming timestamp data is verified to avoid the existence of invalid data affecting the calculation result of the delay data.

[0126] Figure 6 It is a flowchart of a method for detecting delay provided by the embodiments of the present application. As Figure 6 shown, the method for detecting delay provided by the embodiments of the present application includes:

[0127] Step 601: Obtain the first incoming timestamp when the first node receives the target data packet; wherein, the first incoming timestamp is reported by the first node based on IOAM;

[0128] Step 602: Obtain the second incoming timestamp when the second node receives the target data packet; wherein, the second incoming timestamp is reported by the second node based on IOAM, and the target data packet is sent from the first node to the second node;

[0129] Step 603: Obtain M link delays between the first node and the second node within one coloring period of the IOAM;

[0130] Step 604: Remove the maximum delay and the minimum delay from the M link delays to obtain M - 2 link delays;

[0131] Step 605: Calculate the average value of the M - 2 link delays, determine the average value as the link average delay, and determine the link average delay as the first link delay;

[0132] Step 606: Perform validity verification on the first incoming timestamp and the second incoming timestamp, and use the first incoming timestamp with a valid verification result as the first verified timestamp, and use the second incoming timestamp with a valid verification result as the second verified timestamp;

[0133] Wherein, the validity verification includes at least one of the following:

[0134] Judge whether the incoming timestamp to be verified is 0; if the incoming timestamp to be verified is 0, determine that the verification result of the incoming timestamp to be verified is invalid; if the incoming timestamp to be verified is not 0, determine that the verification result of the incoming timestamp to be verified is valid;

[0135] Judge whether the difference between the incoming timestamp to be verified and the target timestamp is less than a threshold; if the difference is greater than or equal to the threshold, determine that the verification result of the incoming timestamp to be verified is invalid; if the difference is less than the threshold, determine that the verification result of the incoming timestamp to be verified is valid;

[0136] Wherein, the target timestamp includes one of the following: a preset timestamp; the current time point of the first node; the reporting time point of the incoming timestamp of the target data packet.

[0137] Step 607: Calculate the first difference between the first verified timestamp and the second verified timestamp, and use the first difference as the second link delay between the first node and the second node;

[0138] Step 608: Calculate a second difference between the second link delay and the first link delay, and use the second difference as the node delay of the first node.

[0139] Step 609: Generate a service delay topology map based on the node delay of the first node and the first link delay;

[0140] Step 610: Display the service delay topology map; wherein, the service delay topology map includes the node delay of the first node and the first link delay.

[0141] For example, in a specific implementation of this application, first, configure L2VPN or L3VPN private network services based on multiple devices, and then configure end-to-end mode IOAM services based on the private network services through a data collector. The user side ports of the PE nodes report IOAM data (including delay data and packet loss data) to implement the monitoring of the delay and packet loss results of the entire service path. Wherein, the user side ports are the leftmost port and the rightmost port of the service path. The end-to-end mode IOAM function involved in this step directly calculates the whole-process data from one user port to another user port.

[0142] Second step, when the delay data in the end-to-end mode of the IOAM function of the service path is greater than the expected value, packet loss occurs, or a demand sent down is received, switch the IOAM mode from the end-to-end mode to the hop-by-hop mode through the data collector, and configure TWAMP in the network side links of adjacent devices. The collection of IOAM for user side data can be implemented without configuring user side TWAMP.

[0143] Third step, all devices in the service path report IOAM and TWAMP data to the data collector.

[0144] Fourth step, the data collector calculates the second link delay based on the IOAM function and the link average delay (i.e., the first link delay) based on the TWAMP function respectively;

[0145] Fifth step, the data collector couples the second link delay based on the IOAM function and the link average delay based on the TWAMP function, calculates the node delay data in the service path and the link delay data based on TWAMP, and generates a service topology map.

[0146] Sixth step, after confirming the abnormal points in the service through the delay topology map or the packet loss result, it is possible to choose to switch the hop-by-hop mode back to the end-to-end mode, and the data collector simultaneously issues a command to close the TWAMP function configured for adjacent devices to save resources.

[0147] In an embodiment of the present application, obtain a first inbound timestamp when a first node receives a target data packet; wherein, the first inbound timestamp is reported by the first node based on IOAM; obtain a second inbound timestamp when a second node receives the target data packet; wherein, the second inbound timestamp is reported by the second node based on IOAM, and the target data packet is sent from the first node to the second node; obtain a first link delay between the first node and the second node, where the first link delay is obtained based on TWAMP; based on the first inbound timestamp, the second inbound timestamp, and the first link delay, determine the node delay of the first node. In this way, the first link delay between the first node and the second node is obtained through TWAMP, solving the problem that link delay data cannot be obtained due to node self-limitation. Then, in combination with the first inbound timestamp and the second inbound timestamp obtained through IOAM, the node delay of the first node is determined, solving the problem that a data processing device in the related art cannot obtain the device delay information of a node.

[0148] Figure 7 It is a flowchart of a method for detecting delay provided by an embodiment of the present application. As Figure 7 shown, the method for detecting delay provided by an embodiment of the present application is applied to a first node, and the method includes:

[0149] Step 710: Determine a first inbound timestamp for receiving a target data packet based on IOAM, and report the first inbound timestamp to a server;

[0150] In this step, the first node determines the first inbound timestamp for receiving the target data packet based on the IOAM function configured by itself, and then reports the first inbound timestamp to the data collector at regular intervals. Among them, the time point of the first inbound timestamp is earlier than the reporting time point of the first inbound timestamp.

[0151] Step 720: Obtain a first link delay between the first node and the second node based on TWAMP, and report the first link delay to the server, so that the server determines the node delay of the first node based on the first inbound timestamp, the second inbound timestamp, and the first link delay; wherein, the target data packet is sent from the first node to the second node, and the second inbound timestamp is the inbound timestamp when the second node receives the target data packet.

[0152] In an embodiment of the present application, the first node determines a first incoming timestamp for receiving a target data packet based on IOAM, and reports the first incoming timestamp to the server; obtains a first link delay between the first node and the second node based on TWAMP, and reports the first link delay to the server, so that the server determines a node delay of the first node based on the first incoming timestamp, a second incoming timestamp, and the first link delay; wherein, the target data packet is sent from the first node to the second node, and the second incoming timestamp is the incoming timestamp when the second node receives the target data packet. In this process, the first node obtains the first link delay between the first node and the second node through TWAMP, solving the problem that link delay data cannot be obtained due to node self-limitation. Then, based on the first incoming timestamp and the first link delay reported by the first node, the node delay of the first node can be further obtained in combination with the second incoming timestamp, solving the problem that the data processing device in the related art cannot obtain the device delay information of the node.

[0153] Figure 8 is a flowchart of a method for detecting delay provided by an embodiment of the present application. As Figure 8 shown, the method for detecting delay provided by an embodiment of the present application includes:

[0154] Step 810: Determine a first incoming timestamp for receiving a target data packet based on IOAM,

[0155] Step 820: Validate the validity of the incoming timestamp when the first node receives the target data packet, and use the incoming timestamp with a valid verification result as the first incoming timestamp, and report the first incoming timestamp to the server;

[0156] Among them, the purpose of the validity verification is to verify the timestamp to avoid obtaining invalid timestamp data. The validity verification includes at least one of the following:

[0157] First, determine whether the incoming timestamp to be verified is 0; when the incoming timestamp to be verified is 0, determine that the verification result of the incoming timestamp to be verified is invalid; when the incoming timestamp to be verified is not 0, determine that the verification result of the incoming timestamp to be verified is valid;

[0158] For example, when the number of data packets is not zero but the timestamp is zero, it can be determined that the verification result of the incoming timestamp to be verified is invalid.

[0159] Second, determine whether the difference between the to-be-verified incoming timestamp and the target timestamp is less than a threshold value; if the difference is greater than or equal to the threshold value, determine that the verification result of the to-be-verified incoming timestamp is invalid; if the difference is less than the threshold value, determine that the verification result of the to-be-verified incoming timestamp is valid; wherein, the target timestamp includes one of the following: a preset timestamp; the current time point of the first node; the reporting time point of the incoming timestamp of the target data packet.

[0160] Among them, the validity verification can be completed by the node. The node can obtain the difference between its own current time point (for example, the time point when the incoming timestamp is obtained or the time point when the incoming timestamp is reported) and the incoming timestamp, and determine whether the difference is less than the threshold value (the threshold value can be configured, for example, twice the coloring period). If it is less, it is considered that the verification result of the incoming timestamp is valid, and if it is greater, it is considered that the verification result of the incoming timestamp is invalid. For example, if the coloring period is thirty seconds, and the difference between the incoming timestamp that the node is about to report and the time point when the incoming timestamp is reported is greater than twice the coloring period, that is, sixty seconds, then the incoming timestamp is considered invalid.

[0161] The node can also obtain the difference between the incoming timestamp data and the preset timestamp. For example, if the preset timestamp is January 1, 2000, and the incoming timestamp is earlier than January 1, 2000, then the verification result of the incoming timestamp is considered invalid.

[0162] The node can also obtain the difference between the incoming timestamp data and the reporting time point of the incoming timestamp of the target data packet, and the difference should be less than the threshold value. If the difference is greater than or equal to the threshold value, determine that the verification result of the to-be-verified incoming timestamp is invalid; if the difference is less than the threshold value, determine that the verification result of the to-be-verified incoming timestamp is valid. Among them, the threshold value can be obtained from empirical values or set according to requirements.

[0163] Step 830: In response to a target condition, enable the TWAMP function;

[0164] Among them, the target condition includes at least one of the following:

[0165] The IOAM function of the first node switches from the end-to-end mode to the hop-by-hop mode;

[0166] The first node has a delay anomaly;

[0167] The first node receives a TWAMP function enabling instruction.

[0168] Therefore, the TWAMP function can be automatically enabled when the IOAM function switches from the end-to-end mode to the hop-by-hop mode, or can be automatically enabled when a delay anomaly occurs at the first node, or can be enabled according to an instruction when receiving a TWAMP function enabling instruction. In a specific implementation process, the TWAMP function can be enabled when any one of the above three target conditions is met, or can also be enabled when multiple of the above three target conditions are met.

[0169] Step 840: Obtain a first link delay between the first node and the second node based on the TWAMP function, and report the first link delay to the server, so that the server determines a node delay of the first node based on the first incoming timestamp, the second incoming timestamp, and the first link delay; wherein, the target data packet is sent from the first node to the second node, and the second incoming timestamp is the incoming timestamp when the second node receives the target data packet.

[0170] In the embodiment of the present application, the first node obtains the first link delay between the first node and the second node through TWAMP, solving the problem that link delay data cannot be obtained due to node self-limitation. Then, based on the first incoming timestamp and the first link delay reported by the first node, the node delay of the first node can be further obtained in combination with the second incoming timestamp, solving the problem that the data processing device in the related art cannot obtain the device delay information of the node.

[0171] As Figure 9 shown, the embodiment of the present application provides an electronic device 900, and the electronic device can be various types of computers, such as a terminal or a server, etc.

[0172] The electronic device 900 includes: a processor 910 and a memory 920. The memory 920 stores a program, and when the program is executed by the processor 910, it implements the steps of any one of the methods described above. For example, when the program is executed by the processor 910, it implements the following process: obtain a first incoming timestamp when the first node receives a target data packet; wherein, the first incoming timestamp is reported by the first node based on IOAM; obtain a second incoming timestamp when the second node receives the target data packet; wherein, the second incoming timestamp is reported by the second node based on IOAM, and the target data packet is sent from the first node to the second node; obtain a first link delay between the first node and the second node, and the first link delay is obtained based on TWAMP; determine a node delay of the first node based on the first incoming timestamp, the second incoming timestamp, and the first link delay.

[0173] In the electronic device provided by the embodiment of the present application, obtain the first inbound timestamp when the first node receives the target data packet; wherein, the first inbound timestamp is reported by the first node based on IOAM; obtain the second inbound timestamp when the second node receives the target data packet; wherein, the second inbound timestamp is reported by the second node based on IOAM, and the target data packet is sent from the first node to the second node; obtain the first link delay between the first node and the second node, the first link delay is obtained based on TWAMP; based on the first inbound timestamp, the second inbound timestamp and the first link delay, determine the node delay of the first node. In this way, the first link delay between the first node and the second node is obtained through TWAMP, which solves the problem that link delay data cannot be obtained due to the limitations of the node itself. Combining with the first inbound timestamp and the second inbound timestamp obtained through IOAM, the node delay of the first node is determined, which solves the problem that the data processing device in the related art cannot obtain the device delay information of the node. The embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, each process of the method embodiment for detecting delay described above is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be elaborated here.

[0174] In the readable storage medium provided by the embodiment of the present application, obtain the first inbound timestamp when the first node receives the target data packet; wherein, the first inbound timestamp is reported by the first node based on in-band operation, administration, and maintenance (IOAM); obtain the second inbound timestamp when the second node receives the target data packet; wherein, the second inbound timestamp is reported by the second node based on IOAM, and the target data packet is sent from the first node to the second node; obtain the first link delay between the first node and the second node, the first link delay is obtained based on TWAMP; based on the first inbound timestamp, the second inbound timestamp and the first link delay, determine the node delay of the first node. In this way, the first link delay between the first node and the second node is obtained through TWAMP, which solves the problem that link delay data cannot be obtained due to the limitations of the node itself. Combining with the first inbound timestamp and the second inbound timestamp obtained through IOAM, the node delay of the first node is determined, which solves the problem that the data processing device in the related art cannot obtain the device delay information of the node. Wherein, the processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disc, etc.

[0175] It should be noted that, in this text, the term "including", "comprising", or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or device that includes a series of elements not only includes those elements but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article, or device that includes such element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the reverse order according to the functions involved. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0176] Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases, the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present application.

[0177] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them fall within the protection scope of the present application.

Claims

1. A method for detecting delay, comprising: Obtaining a first inbound timestamp when a first node receives a target data packet; wherein, the first inbound timestamp is reported by the first node based on in-band operation, administration, and maintenance (IOAM); Obtaining a second inbound timestamp when a second node receives the target data packet; wherein, the second inbound timestamp is reported by the second node based on IOAM, and the target data packet is sent from the first node to the second node; Obtaining a first link delay between the first node and the second node, where the first link delay is obtained based on the Two-Way Active Measurement Protocol (TWAMP); Determining the node delay of the first node based on the first inbound timestamp, the second inbound timestamp, and the first link delay.

2. The method according to claim 1, wherein The obtaining the first link delay between the first node and the second node includes: Obtaining M link delays between the first node and the second node within one coloring period of the IOAM; Determining a link average delay based on the M link delays, and determining the link average delay as the first link delay; where M≥2.

3. The method according to claim 2, wherein M≥4; The determining the link average delay based on the M link delays includes: Removing the maximum delay and the minimum delay from the M link delays to obtain M-2 link delays; Calculating the average value of the M-2 link delays, and determining the average value as the link average delay.

4. The method according to claim 2, characterized in that, The coloring period of the IOAM is an integer multiple of the TWAMP packet sending period.

5. The method according to any one of claims 1-4, characterized in that, After determining the node delay of the first node, the method further includes: Generating a service delay topology graph based on the node delay of the first node and the first link delay; Displaying the service delay topology graph; where the service delay topology graph includes the node delay of the first node and the first link delay.

6. According to the method of any one of claims 1-4, the determining the node delay of the first node based on the first inbound timestamp, the second inbound timestamp, and the first link delay includes: Calculating a first difference between the first inbound timestamp and the second inbound timestamp, and using the first difference as a second link delay between the first node and the second node; Calculating a second difference between the second link delay and the first link delay, and using the second difference as the node delay of the first node.

7. The method according to any one of claims 1 to 4, characterized in that The determining the node delay of the first node based on the first inbound timestamp, the second inbound timestamp, and the first link delay includes: Performing validity verification on the first inbound timestamp and the second inbound timestamp, and using the first inbound timestamp with a valid verification result as a first verified timestamp, and using the second inbound timestamp with a valid verification result as a second verified timestamp; Determining the node delay of the first node based on the first verified timestamp, the second verified timestamp, and the first link delay; where the validity verification includes at least one of the following: Determine whether the incoming timestamp to be verified is 0; in the case where the incoming timestamp to be verified is 0, determine that the verification result of the incoming timestamp to be verified is invalid; in the case where the incoming timestamp to be verified is not 0, determine that the verification result of the incoming timestamp to be verified is valid; Determine whether the difference between the incoming timestamp to be verified and the target timestamp is less than a threshold; if the difference is greater than or equal to the threshold, determine that the verification result of the incoming timestamp to be verified is invalid; if the difference is less than the threshold, determine that the verification result of the incoming timestamp to be verified is valid; Wherein, the target timestamp includes one of the following: a preset timestamp; the current time point of the first node; the reporting time point of the incoming timestamp of the target data packet.

8. A method for detecting delay, applied to a first node, the method includes: Determine the first incoming timestamp of the received target data packet based on in-band operation, administration, and maintenance (IOAM), and report the first incoming timestamp to the server; Obtain the first link delay between the first node and the second node based on the two-way active measurement protocol (TWAMP), and report the first link delay to the server, so that the server determines the node delay of the first node based on the first incoming timestamp, the second incoming timestamp, and the first link delay; Wherein, the target data packet is sent from the first node to the second node, and the second incoming timestamp is the incoming timestamp when the second node receives the target data packet.

9. The method according to claim 8, wherein The obtaining the first link delay between the first node and the second node based on the two-way active measurement protocol (TWAMP) includes: In response to a target condition, enable the TWAMP function; Obtain the first link delay between the first node and the second node based on the TWAMP function; Wherein, the target condition includes at least one of the following: The IOAM function of the first node switches from the end-to-end mode to the hop-by-hop mode; The first node has a delay anomaly; The first node receives a TWAMP function enabling instruction.

10. The method according to claim 8, wherein Before reporting the first incoming timestamp to the server, the method further includes: Verify the validity of the incoming timestamp when the first node receives the target data packet, and use the incoming timestamp with a valid verification result as the first incoming timestamp; The validity verification includes at least one of the following: Determine whether the incoming timestamp is 0; in the case where the incoming timestamp is 0, determine that the verification result of the incoming timestamp is invalid; in the case where the incoming timestamp to be verified is not 0, determine that the verification result of the incoming timestamp to be verified is valid; Determine whether the difference between the incoming timestamp and the target timestamp is less than a threshold; if the difference is greater than or equal to the threshold, determine that the verification result of the incoming timestamp is invalid; if the difference is less than the threshold, determine that the verification result of the incoming timestamp is valid; Wherein, the target timestamp includes one of the following: a preset timestamp; the current time point of the first node; the reporting time point of the incoming timestamp of the target data packet.

11. An electronic device, characterized in that, It includes a processor and a memory, and the memory stores programs or instructions that run on the processor. When the programs or instructions are executed by the processor, the steps of the method according to any one of claims 1-10 are implemented.

12. A computer-readable storage medium, characterized in that, Programs or instructions are stored on the computer-readable storage medium. When the programs or instructions are executed by a processor, the steps in the method according to any one of claims 1-10 are implemented.