In-band flow measurement method, electronic device, storage medium, and program product

By selecting a resource port on the head node device for timestamp marking, the problem of inaccurate link latency determination under multiple traffic ingress ports is solved, and accurate calculation of link latency is achieved.

WO2026066225A1PCT designated stage Publication Date: 2026-04-02ZTE CORP
View PDF 6 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-06-06
Publication Date
2026-04-02

AI Technical Summary

Technical Problem

When the head node device has multiple traffic ingress ports, existing flow detection technology cannot accurately determine the link latency, resulting in the inability to accurately calculate the link latency.

Method used

The head node device selects a resource port from multiple traffic ingress ports for timestamp marking. By timestamping the target traffic on this port, it ensures that subsequent node devices can uniquely determine the forwarding path to which the link delay belongs within a detection cycle.

Benefits of technology

It enables accurate detection of link latency under multiple traffic ingress ports, ensuring that subsequent node devices can accurately calculate link latency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025099546_02042026_PF_FP_ABST
    Figure CN2025099546_02042026_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides an in-band flow measurement method, an electronic device, a storage medium, and a program product. The method comprises: receiving target traffic; and performing timestamping on the target traffic at a first resource-facing port, wherein the first resource-facing port is a port predetermined from among a plurality of target traffic ingress ports and is configured for performing in-band flow measurement on the target traffic, and the plurality of target traffic ingress ports are ports of a head node device that receive the target traffic.
Need to check novelty before this filing date? Find Prior Art

Description

In-stream detection method, electronic device, storage medium and program product

[0001] Cross-reference to related applications

[0002] The present application claims priority to the Chinese patent application No. 202411385506.9, filed on September 30, 2024, and entitled "In-stream detection method, electronic device, storage medium and program product", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD

[0003] The present application relates to the technical field of network, and in particular to an in-stream detection method, an electronic device, a storage medium and a program product. BACKGROUND

[0004] In a communication network, an in-stream detection technology can be used to detect the transmission quality of the network, such as link latency, packet loss, jitter, etc. In some communication scenarios, such as a tunnel scenario, the ingress port of the target traffic received in the head node device usually has multiple ones. When detecting the link latency based on the in-stream detection technology in the related art, the received target traffic is time-stamped and forwarded with the service stream at each ingress port. Thus, for the successor node device, multiple messages with time-stamped marks will be received within a detection period (or a dyeing period). Since these messages originate from different ingress ports of the head node device, the successor node device cannot determine which forwarding path the calculated link latency specifically belongs to, resulting in that the link latency cannot be accurately obtained. SUMMARY

[0005] The present application provides an in-stream detection method, an electronic device, a storage medium and a program product, which are used to solve the problem that when detecting the link latency based on the in-stream detection technology in the related art, the link latency cannot be accurately obtained in the case that the head node device includes multiple traffic ingress ports.

[0006] In a first aspect, an in-stream detection method is provided, which is applied to a head node device and includes: receiving target traffic; time-stamping and marking the target traffic at a first resource port, the first resource port being one port determined in advance from multiple target traffic ingress ports for in-stream detection of the target traffic, and the multiple target traffic ingress ports being ports of the head node device that receive the target traffic.

[0007] In a second aspect, an electronic device is provided, which includes: a processor; a memory for storing instructions executable by the processor; and wherein the processor is configured to execute the instructions to implement the method of the first aspect.

[0008] In a third aspect, a computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the method according to the first aspect.

[0009] In a fourth aspect, a computer program product is provided. The computer program product includes a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of the method according to the first aspect. BRIEF DESCRIPTION OF DRAWINGS

[0010] In order to more clearly illustrate the technical solutions in the application or prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments described in the application, and for those skilled in the art, other drawings can also be obtained without creative labor.

[0011] FIG. 1 is a flow diagram of a flow detection method according to an embodiment of the application;

[0012] FIG. 2 is a schematic diagram of selecting a resource port for flow detection in an Srv6 Policy scenario according to an embodiment of the application;

[0013] FIG. 3 is a flow diagram of a resource board selection method according to an embodiment of the application;

[0014] FIG. 4 is a flow diagram of a resource port selection method according to an embodiment of the application;

[0015] FIG. 5 is a structural diagram of an electronic device according to an embodiment of the application;

[0016] FIG. 6 is a structural diagram of a flow detection device according to an embodiment of the application. DETAILED DESCRIPTION

[0017] In order to enable those skilled in the art to better understand the technical solutions in the application, the technical solutions in the application will be described clearly and completely in the following with reference to the drawings in one or more embodiments of the application. Obviously, the described embodiments are only some embodiments of the application, not all embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor should be within the protection scope of the application.

[0018] The terms "first", "second", etc. in the present application and claims are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the present application can be implemented in an order other than those illustrated or described herein. In addition, "and / or" in the present application and claims means at least one of the connected objects, and the character " / " generally means that the front and rear associated objects are in an "or" relationship.

[0019] It should be noted that the technical solutions provided by the embodiments of the present application are applicable to the scenario that the head node device includes multiple traffic ingress ports, such as the head node device in the tunnel scenario, including but not limited to the Srv6 Policy and Srv6 be scenarios. Based on the technical solutions provided by the embodiments of the present application, when performing in-situ flow detection, the head node device can select one port from the multiple ingress ports receiving the target traffic, and perform time stamp marking (inserting time stamp marking in the target traffic) on the target traffic at the port, so that the subsequent node device can determine a unique packet with in-situ flow detection time stamp marking within one detection period (or coloring period), and when calculating the link delay, it can be determined which forwarding path the calculated link delay belongs to, so that the link delay can be accurately obtained.

[0020] The technical solutions provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0021] FIG. 1 is a flowchart of an in-situ flow detection method according to an embodiment of the present application. The in-situ flow detection method can be applied to a head node device performing in-situ flow detection in a network, that is, the in-situ flow detection method can be executed by the head node device, or in other words, the in-situ flow detection method can be executed by software or hardware installed in the head node device. The in-situ flow detection method shown in FIG. 1 includes the following steps.

[0022] S102: Receiving target traffic.

[0023] S104: Time stamp marking the target traffic at the first resource port, the first resource port being a port pre-determined from the multiple target traffic ingress ports for performing in-situ flow detection on the target traffic, and the multiple target traffic ingress ports being ports of the head node device receiving the target traffic.

[0024] The head node device includes multiple traffic ingress ports, and each traffic ingress port can have traffic (or data flow) flowing in. In the present embodiment, in the case that the target traffic (or target data flow) flows into the head node device, the head node device can receive the target traffic through the multiple traffic ingress ports. Among them, the ingress port receiving the target traffic can be represented as a target traffic ingress port, and the number of target traffic ingress ports is multiple.

[0025] In the case of receiving the target traffic, when performing the in-situ flow detection, the target traffic can be time-stamped at a first resource port of the multiple target traffic ingress ports. The first resource port is a port determined in advance from the multiple target traffic ingress ports for in-situ flow detection, and is an active port.

[0026] In this way, since the target traffic can be time-stamped at only one port (i.e., the first resource port) of the multiple target traffic ingress ports when performing in-situ flow detection, the subsequent node device can determine a unique packet with a time stamp within one detection period (or coloring period), and when calculating the link delay, it can be determined which forwarding path the calculated link delay belongs to, thereby ensuring the accuracy of the link delay.

[0027] In some embodiments, when determining the first resource port from the multiple target traffic ingress ports, the determination timing can be after receiving the target traffic and before performing in-situ flow detection. Before the target traffic is time-stamped at the first resource port, the following steps can be included: determining the multiple target traffic ingress ports according to the ports receiving the target traffic; and determining the first resource port from the multiple target traffic ingress ports.

[0028] When determining (or identifying) the multiple target traffic ingress ports according to the ports receiving the target traffic, various implementations can be included, which are not limited here. Taking the head node device as an example, in the case of Srv6 Policy, in some embodiments, the target Policy traffic can be identified first, and then the corresponding multiple ingress ports (i.e., the multiple target traffic ingress ports) can be determined according to the target Policy traffic. When identifying the target Policy traffic, it can be identified by an access control list (ACL). When determining the multiple target traffic ingress ports according to the target Policy traffic, the path information of the target Policy traffic can be identified according to the segment list of the target Policy traffic first, and then the corresponding multiple target traffic ingress ports can be determined according to the path information of the target Policy traffic.

[0029] It should be noted that the head node device can include a control plane and a forwarding plane (the forwarding plane and the control plane can be regarded as two functional modules in the head node device). In some embodiments, when determining the multiple target traffic ingress ports according to the ports receiving the target traffic, it can be implemented by the forwarding plane in the head node device.

[0030] After the multiple target traffic ingress ports are determined, when the first resource port is determined from the multiple target traffic ingress ports, in some embodiments, the following steps can be included: determining the first resource board from the resource boards corresponding to the multiple target traffic ingress ports; and determining the first resource port from the ports of the first resource board.

[0031] The head node device includes a forwarding plane board, and the forwarding plane board can include multiple resource boards. Each resource board can include multiple resource ports, and each resource port is a traffic ingress port. When the first resource port is determined from the multiple target traffic ingress ports, two levels of selection (or election) are involved, that is, a resource board is first selected from the resource boards corresponding to the multiple target traffic ingress ports as a first resource board, and then a port is selected from the ports of the first resource board as the first resource port.

[0032] It should be noted that the number of resource boards corresponding to the multiple target traffic ingress ports can be one or more. In the case where the multiple target traffic ingress ports correspond to one resource board, the one resource board is the first resource board, and there is no need to select the resource board. In the case where the multiple target traffic ingress ports correspond to multiple resource boards, a resource board needs to be selected from the multiple resource boards as the first resource board. Embodiments of the present application take the case where the multiple target traffic ingress ports correspond to multiple resource boards as an example for description.

[0033] In the case where the multiple target traffic ingress ports correspond to multiple resource boards, in some embodiments, determining the first resource board from the resource boards corresponding to the multiple target traffic ingress ports can include any one of the following mode 1 and mode 2.

[0034] Mode 1: determining the first resource board from the resource boards corresponding to the multiple target traffic ingress ports according to first indication information, the first indication information being used to indicate identification information of the first resource board.

[0035] The first indication information can be configured or indicated by a user, that is, the user can artificially configure or indicate which resource board in the head node device is the first resource board. In the case where the user configures or indicates the first indication information, when the first resource board is determined, the resource board corresponding to the identification information of the first resource board indicated by the first indication information can be determined from the resource boards corresponding to the multiple target traffic ingress ports according to the identification information of the first resource board indicated by the first indication information (different resource boards correspond to different identification information, and the identification information of one resource board can uniquely identify one resource board), and the resource board is determined as the first resource board. In this way, since the first resource board can be determined according to the first indication information configured or indicated by the user, the first resource port used for in-situ flow health monitoring can be subsequently selected from the first resource board configured or indicated by the user, so that the user demand can be met.

[0036] In an example, the first indication information can also be sent to the head node device by other devices, such as a subsequent node device performing in-stream detection or a network management server. In the case where the other devices send the first indication information to the head node device, when determining the first resource board, the resource board corresponding to the identification information of the first resource board indicated by the first indication information can be determined from the resource boards corresponding to the plurality of target traffic ingress ports according to the identification information of the first resource board indicated by the first indication information (different resource boards correspond to different identification information, and the identification information of one resource board can uniquely identify one resource board), and the resource board is determined as the first resource board. In this way, since the first resource board can be determined according to the first indication information indicated by the other devices, the first resource port for performing in-stream detection can be selected from the first resource board indicated by the other devices, so that the port corresponding to the subsequent node device can detect and receive the message with the timestamp mark, and then the in-stream detection can be facilitated.

[0037] Method 2: Create a session at each target traffic ingress port; monitor the created session, and determine the active port from the plurality of target traffic ingress ports according to the monitoring result; determine the first resource board from the resource board corresponding to the active port.

[0038] Method 1 is that the head node device determines the first resource board according to the indication of the first indication information, and method 2 is that the head node device determines the first resource board from the resource boards corresponding to the plurality of target traffic ingress ports. Therefore, the automatic selection of the resource board can be realized, and the flexibility is better.

[0039] When the head node device determines the first resource board from the resource boards corresponding to the plurality of target traffic ingress ports, a session can be created at each target traffic ingress port, then the created session is monitored, and the active port is determined from the plurality of target traffic ingress ports according to the monitoring result. The active port can be understood as a port through which traffic flows. After the active port is determined, the first resource board can be determined from the resource board corresponding to the active port, and the first resource board includes at least one active port.

[0040] It should be noted that the number of active ports determined from the plurality of target traffic ingress ports can be one or more, and the number of resource boards corresponding to the plurality of active ports can also be one or more. In this way, when determining the first resource board from the resource boards corresponding to the active ports, if the number of active ports is one, the resource board corresponding to the one active port can be determined as the first resource board; if the number of active ports is a plurality, and the plurality of active ports correspond to one resource board, the one resource board can be determined as the first resource board; if the number of active ports is a plurality, and the plurality of active ports correspond to a plurality of resource boards, one resource board needs to be selected from the plurality of resource boards as the first resource board. In some embodiments, when selecting one resource board from the plurality of resource boards as the first resource board, the following steps can be included: determining the latest active port from the active ports; and determining the resource board on which the latest active port is located as the first resource board.

[0041] The latest active port can be understood as the port through which the latest traffic flows. When selecting the first resource board, the resource board on which the latest active port is located can be determined as the first resource board. In this way, since the port performing flow detection needs to be an active port, after the latest active port is selected as the first resource board, it can be ensured that the active port is included in the first resource board, and when determining the first resource port from the ports of the first resource board subsequently, it can be ensured that an active port can be selected as the first resource port.

[0042] In some possible embodiments, other resource boards can also be selected as the first resource board, for example, the resource board with the most active ports can be selected as the first resource board, and the selection method of the first resource board is not limited herein.

[0043] After the first resource board is determined from the resource boards corresponding to the plurality of target traffic ingress ports by the method described above, the first resource port can be further determined from the ports of the first resource board.

[0044] It should be noted that the first resource board can include one or more active ports. When determining the first resource port from the ports of the first resource board, if the first resource board includes one active port, the one active port can be determined as the first resource port. If the first resource board includes a plurality of active ports, one port needs to be selected from the plurality of active ports as the first resource port. The embodiments of the present application are described by taking the case that the first resource board includes a plurality of active ports as an example.

[0045] In the case that the first resource board includes multiple active ports, in some embodiments, determining the first resource board from the ports of the first resource board can include any one of the following manner 3 and manner 4.

[0046] Manner 3: determining the first resource port from the first resource board according to second indication information, the second indication information being used to indicate identification information of the first resource port.

[0047] The second indication information can be configured or indicated by a user, that is, the user can artificially configure or indicate which active port in the first resource board is the first resource port. In the case that the user configures or indicates the second indication information, when determining the first resource port, the resource port corresponding to the identification information of the first resource port indicated by the second indication information can be determined from the ports of the first resource board (in the same resource board, different resource ports correspond to different identification information, that is, in one resource board, the identification information of one resource port can uniquely identify one resource port, the identification information of the resource port has local uniqueness, or in different resource boards, different resource ports correspond to different identification information, the identification information of the resource port has global uniqueness), and the resource port is determined as the first resource port. In this way, since the first resource port can be determined from the first resource board according to the second indication information configured or indicated by the user, when subsequent flow detection is performed, the resource port configured or indicated by the user can be used for flow detection, so that the user demand can be met.

[0048] In an example, the second indication information can also be sent to the head node device by other devices, which can be, for example, a subsequent node device performing flow detection or a network management server. In the case that the other devices send the second indication information to the head node device, when determining the first resource port, the resource port corresponding to the identification information of the first resource port indicated by the second indication information can be determined from the ports of the first resource board, and the resource port is determined as the first resource port. In this way, since the first resource port can be determined from the first resource board according to the second indication information indicated by the other devices, when subsequent flow detection is performed, the resource port indicated by the other devices can be used for flow detection, so that the port of the subsequent node device can be facilitated to detect and receive the message with the timestamp mark, and then the flow detection can be facilitated to be implemented.

[0049] Manner 4: determining the most active port in the first resource board as the first resource port.

[0050] The mode 3 is that the head node device determines the first resource port according to the indication of the second indication information, and the mode 4 is that the head node device determines the first resource board from the first resource boards, so that the automatic selection of the first resource port can be realized, and the flexibility is better.

[0051] When the head node device determines the first resource port from the first resource board, in some embodiments, the most active port can be determined from the ports of the first resource board first, and then the most active port is determined as the first resource port. Wherein, the activity degree of the port can be determined according to the size, frequency and other indicators of the flow passing through the port, which is not limited here. Since the most active port in the first resource board can be selected as the first resource port for flow detection, the flow detection can be realized conveniently, and the business requirements can be met. In other possible embodiments, when the first resource port is determined from the first resource board, other active ports except the most active port can also be selected as the first resource port to meet different business requirements.

[0052] Based on the above content, when the head node device determines the first resource port from the multiple target traffic entry ports, at least four implementation modes are included, as follows.

[0053] (1) The first resource board is determined from the resource boards corresponding to the multiple target traffic entry ports according to the first indication information first, and then the first resource port is determined from the first resource board according to the second indication information, at this time, the first indication information and the second indication information can be the same indication information, which indicates the identification information of the first resource board and also indicates the identification information of the first resource port (corresponding to the technical solution of the combination of the above mode 1 and mode 3, at this time, the head node device determines the first resource board and the first resource port according to the indication information).

[0054] (2) The first resource board is determined from the resource boards corresponding to the multiple target traffic entry ports according to the first indication information first, and then the most active port in the first resource board is determined as the first resource port (corresponding to the technical solution of the combination of the above mode 1 and mode 4, at this time, the head node device determines the first resource board according to the indication information, and then automatically selects the first resource port from the first resource board).

[0055] (3) The session is created at each of the target traffic entry ports first, the created session is monitored, the active port is determined from the multiple target traffic entry ports according to the monitoring result, then the first resource board is determined from the resource board corresponding to the active port, and finally the first resource port is determined from the first resource board according to the second indication information (corresponding to the technical solution of the combination of the above mode 2 and mode 3, at this time, the head node device automatically selects the first resource board, and then determines the first resource port from the first resource board according to the indication information).

[0056] (4) first create a session at each of the target traffic ingress ports, monitor the created session, determine the active port from the multiple target traffic ingress ports according to the monitoring result, then determine the first resource board from the resource boards corresponding to the active port, and finally determine the first resource port in the first resource board as the most active port (corresponding to the combination of the above-mentioned mode 2 and mode 4 technical solutions, at this time the head node device automatically elects the first resource board and automatically elects the first resource port from the first resource board, that is, two-level election).

[0057] It should be noted that the head node device can include a forwarding plane and a control plane. In some embodiments, when the head node device determines the first resource board by creating a session, it can be achieved through interaction between the forwarding plane and the control plane. When selecting the most active port in the first resource board as the first resource port, it can be achieved by the forwarding plane. After the forwarding plane determines the multiple target traffic ingress ports, it can create a session at each target traffic ingress port, then monitor the created session, determine whether each target traffic ingress port is an active port, and report the information of the candidate resource board to the control plane in units of resource boards, the number of candidate resource boards can be one or more, and the present embodiment can be described by taking multiple candidate resource boards as an example, each candidate resource board includes at least one active port. After the control plane receives the information of the candidate resource board reported by the forwarding plane, it can select a resource board from the candidate resource board as the first resource board (for example, it can select the latest reported resource board by the forwarding plane as the first resource board, which is the resource board where the latest active port is located), and then notify the forwarding plane of the selected first resource board. After the forwarding plane receives the first resource board notified by the control plane, it can select the most active port in the first resource board as the first resource port.

[0058] After the head node device determines the first resource port from the multiple target traffic ingress ports, it can perform flow detection according to the first resource port. The target traffic can be time-stamped and forwarded with the service flow at the first resource port. For the successor node device, it will receive a message with a time-stamp within a detection period (or a dyeing period), so that the successor node device can determine a unique forwarding link and record the packet receiving time and then report it to the network management server. The network management server can calculate the difference between the time-stamp information reported by the head node device and the successor node device in the current detection period to obtain the link delay.

[0059] In the embodiments of the present application, after the head node device determines the first resource port from the plurality of target traffic ingress ports, the head node device can also dynamically update the first resource port and perform flow-based detection based on the updated resource port. In some embodiments, after the head node device determines the first resource port from the plurality of target traffic ingress ports, the head node device can include the following steps: determining a second resource port from the plurality of target traffic ingress ports in the case that the first resource port is invalid; and performing timestamp marking on the target traffic at the second resource port.

[0060] The invalidation of the first resource port can be that the first resource port becomes an inactive port. The inactive port can be understood as a port through which no traffic flows. There are various methods for determining whether the first resource port is an inactive port, which are not limited herein. For example, if the first resource port has no traffic in a detection period, the first resource port can be considered as an inactive port. The inactive port can be represented as an invalid port.

[0061] The invalidation of the first resource port can also be that the resource board on which the first resource port is located is invalid. The invalidation of the resource board on which the first resource port is located includes at least one of the following: the resource board on which the first resource port is located is offline; all ports in the resource board on which the first resource port is located are inactive ports.

[0062] In the case that the first resource port is invalid, the first resource port can be updated, that is, a second resource port is determined from the plurality of target traffic ingress ports, and timestamp marking is performed on the target traffic at the second resource port, so as to perform flow-based detection based on the second resource port. The second resource port is an active port different from the first resource port in the plurality of target traffic ingress ports.

[0063] In some embodiments, in the case that the invalidation of the first resource port is that the first resource port becomes an inactive port, determining the second resource port from the plurality of target traffic ingress ports can include: determining a candidate resource port from the plurality of target traffic ingress ports, the candidate resource port being an active port in the resource board on which the first resource port is located; and determining the most active port in the candidate resource port as the second resource port.

[0064] That is, in the case that the first resource port is invalid, if the resource board on which the first resource port is located is not invalid, a port can be selected as the second resource port from the remaining active ports of the resource board on which the first resource port is located. For example, the most active port can be selected as the second resource port. Alternatively, an active port can be randomly selected as the second resource port.

[0065] In some embodiments, in the case that the first resource port fails as the resource board where the first resource port is located fails, determining the second resource port from the plurality of target traffic ingress ports can include: determining a second resource board from the resource boards corresponding to the plurality of target traffic ingress ports, the second resource board being a non-failed resource board, and the second resource board including active ports; and determining the most active port in the second resource board as the second resource port.

[0066] In the case that the resource board where the first resource port is located fails, all ports in the resource board will be unavailable, at this time, a resource board can be selected from candidate resource boards as a second resource board, and a port can be selected from the second resource board as a second resource port. The candidate resource board can be a non-failed resource board other than the first resource board from all resource boards corresponding to the plurality of target traffic ingress ports, and the second resource board includes at least one active port. In determining the second resource board from the resource boards corresponding to the plurality of target traffic ingress ports, the resource board where the most recently active port other than the first resource port in the plurality of target traffic ingress ports is located can be determined as the second resource board. Of course, other selection methods can also be used, such as selecting the resource board with the most active ports as the second resource board, etc., which are not limited herein. In determining the second resource port from the second resource board, the most active port in the second resource board can be determined as the second resource port. Alternatively, one of the active ports can be randomly selected as the second resource port, which is not limited herein.

[0067] It should be noted that in some embodiments, in the case that the first resource port fails, the head node device can generate prompt information to prompt that the first resource port fails. In this case, the user or other device can indicate a new resource board and / or resource port, at this time, the head node device in determining the second resource port from the plurality of target traffic ingress ports can use the same implementation as that described above for determining the first resource port from the plurality of target traffic ingress ports, which will not be described in detail herein.

[0068] In some embodiments, the head node device can set a resource port pool, which can include identification information of multiple candidate resource ports, a state of each candidate resource port (such as whether it is an active port), and resource board information where each candidate resource port is located. When determining the second resource port, the second resource port can be determined from the resource port pool. The candidate resource ports in the resource port pool can be dynamically updated. For example, in the case that a certain candidate resource port becomes an inactive port, the candidate resource port can be removed from the resource port pool; in the case that a certain resource board fails, all candidate resource ports belonging to the resource board can be removed from the resource port pool; and in the case that a port from a certain resource board is selected as the first resource port, the remaining active ports in the resource board can be added to the resource port pool as candidate resource ports.

[0069] Similarly, in some embodiments, the head node device can also set a resource board pool, which can include identification information of multiple candidate resource boards and a state of each candidate resource board (such as whether it is failed). When determining the second resource board, the second resource board can be determined from the resource board pool. The candidate resource boards in the resource board pool can also be dynamically updated. For example, in the case that a certain candidate resource board fails, the candidate resource board can be removed from the resource board pool; and in the case that a certain resource board changes from offline to online, the resource board can be added to the resource board pool.

[0070] In order to facilitate understanding of the on-flow detection method provided by the embodiments of the present application, the following will take the operator backbone router in the Srv6 Policy scenario as an example to explain how to automatically elect a resource port. The operator backbone router needs to deploy an on-flow detection service with Policy as the granularity to probe the traffic forwarding path, link delay, and packet loss information. Considering that the Policy traffic can have multiple ingress ports, the on-flow detection timestamp marking packets received by the subsequent device node within one coloring period are not unique, and therefore, a unique policy traffic ingress port needs to be selected in the head node device as the resource port for on-flow detection to ensure the accuracy of the link delay measurement. Please refer to FIG. 2.

[0071] The communication network scenario shown in FIG. 2 is an Srv6 Policy scenario, and the service traffic enters the Policy forwarding path from CE1 through ports 1 to N (N is an integer greater than 1), that is, PEl→PE2→PE3, and finally reaches the terminal CE2. As can be seen from FIG. 2, the head node device PEl includes N traffic ingress ports, and when performing on-flow detection, one port needs to be selected for on-flow detection, and the process is as follows.

[0072] Step 21: PE1 identifies the policy traffic characteristics, and the forwarding plane of PE1 creates a session at the ingress ports (i.e. port 1 to port N) of PE1 and notifies the resource board information of the port to the control plane of PE1.

[0073] Step 22: The control plane of PE1 selects a resource board from the known resource boards (such as selecting the latest reported board), and notifies the selected resource board to the forwarding plane of PE1.

[0074] Step 23: The forwarding plane of PE1 determines all active ports (i.e. ports with traffic flowing through) in the resource board notified by the control plane, and selects a resource port from the active ports as the first resource port (such as selecting the most active resource port as the first resource port).

[0075] The first resource port can be dynamically updated. For example, the control plane of PE1 can perceive whether the resource board where the first resource port is located is offline, and if it is perceived that the resource board is offline, the control plane of PE1 can reselect a resource board and notify the reselected resource board to the forwarding plane of PE1, and the forwarding plane of PE1 can reselect a resource port from the resource board as the first resource port. For another example, the forwarding plane of PE1 can detect the active state of the first resource port, and in the case of detecting that the first resource port changes from an active port to an inactive port (i.e. deactivation, no data traffic flowing through), it can automatically switch to the remaining active ports in the resource board where the first resource port is located, i.e. select an active port from the resource board where the first resource port is located as a new first resource port, and if all ports in the resource board where the first resource port is located are unavailable, i.e. are inactive ports, the control plane of PE1 can be notified to reselect a resource board.

[0076] Step 24: PE1 inserts a flow detection timestamp mark in the target policy traffic of the first resource port, and records the current time according to this, and reports to the network management server.

[0077] Step 25: PE2 receives the target policy traffic, parses and obtains the flow detection timestamp mark therein. For the N traffic ingress ports of PE1, since a unique resource port has been selected to insert the flow detection timestamp mark, PE2 only receives one timestamp mark packet in a staining period, which represents a determined forwarding link, and PE2 records the packet receiving time and reports to the network management server, and the network management server can make a difference between the timestamp information reported by PE1 and PE2 in the current staining period, so as to obtain the link delay.

[0078] In the above step 21 and step 22, through the interaction between the forwarding plane and the control plane of PE1, one resource board can be selected from the plurality of resource boards of PE1. In some embodiments, the process of selecting the resource board by the forwarding plane and the control plane of PE1 can be as shown in FIG. 3. FIG. 3 is a flowchart of a resource board selection method according to an embodiment of the present application. The implementation of the embodiment shown in FIG. 3 is as follows.

[0079] Firstly, the forwarding plane can identify the target Policy traffic and determine the target traffic entry port to which the on-flow detection service needs to be deployed. After identifying the target traffic entry port, a session can be created in units of ports, and the on-flow detection timestamp label is not inserted by default. Secondly, the forwarding plane monitors the session state of the target traffic entry port and counts whether the target traffic entry port is an active port. For the active port, the forwarding plane can report the resource board information of the active port to the control plane in units of resource boards. Finally, the control plane can determine whether the resource board pool is empty. Since the forwarding plane has reported the resource board information, the resource board pool is not empty. In the case that the resource board pool is not empty, the control plane can select a resource board from the resource board pool and notify the forwarding plane of the selected resource board. In the case that the resource board pool is empty, the resource board pool can be updated, and in the case that the resource board pool becomes non-empty, the control plane can select a resource board from the resource board pool.

[0080] After the control plane notifies the forwarding plane of the resource board, the forwarding plane can select a resource port from the resource board as the on-flow detection port, i.e., the first resource port. In some embodiments, the process of selecting the resource port by the forwarding plane can be as shown in FIG. 4. The implementation of the embodiment shown in FIG. 4 is as follows.

[0081] Firstly, for each resource board, the forwarding plane can determine whether it is the resource board selected by the control plane. If the resource board is the resource board selected by the control plane, a resource port can be selected from the resource board as the on-flow detection port, and the on-flow detection timestamp label can be inserted in the target traffic of the on-flow detection port. For other active ports in the resource board, they can be added to the resource port pool as candidate resource ports. If the resource board is not the resource board selected by the control plane, the resource board can be added to the resource board pool as a candidate resource board, and the active ports in the resource board can be added to the resource port pool as candidate resource ports.

[0082] In some embodiments, the resource board pool in the embodiment shown in FIG. 3 and the resource port pool in the embodiment shown in FIG. 4 can also be dynamically updated so as to dynamically update the flow detection port.

[0083] In an example, the updating mechanism of the resource board pool is as follows: mechanism 1: the forwarding plane reports to the control plane that the resource board selected by the control plane is invalid after determining that all resource ports in the resource board are aged (aging when there is no traffic in a staining period); the control plane selects a new resource board (with active ports) from the resource board pool and notifies the forwarding plane; the forwarding plane selects a resource port in the newly selected resource board as the flow detection port. Mechanism 2: in the case that a resource board is offline, the control plane marks the resource board as invalid, and the resource board marked as invalid is not involved in the resource board election of the control plane.

[0084] The updating mechanism of the resource port pool is as follows: after the forwarding plane selects a resource port (such as the most active resource port) from a resource board as the flow detection port, the remaining active ports in the resource board can be marked as candidate resource ports and added to the resource port pool, and when the flow detection port is deactivated, a resource port (such as the most active port in the candidate resource ports) can be selected from the candidate resource ports in the resource board as a new flow detection port.

[0085] The above illustrates how the head node device selects a resource port from multiple target traffic entry ports for flow detection. Based on the technical solutions provided in the embodiments of the present application, the head node device can only time-stamp mark the target traffic at the first resource port, thereby enabling the subsequent node device to determine a unique packet with time-stamp mark in a detection period (or staining period), and when calculating the link delay, the calculated link delay can be determined to belong to which forwarding path, thereby ensuring the accuracy of the link delay.

[0086] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in a different order than the order in which they are recited and still achieve the desired results. In addition, the processes depicted in the figures do not necessarily require the particular order shown, or sequential order, to achieve the desired results. In certain implementations, multitasking and parallel processing can be advantageous.

[0087] Figure 5 is a structural schematic diagram of an electronic device according to an embodiment of the present application. Referring to Figure 5, at the hardware level, the electronic device includes a processor, and further includes an internal bus, a network interface, and a memory. The memory can include a memory, such as a random-access memory (RAM), and can further include a non-volatile memory, such as at least one disk memory. Of course, the electronic device can further include other hardware required by a service.

[0088] The processor, the network interface, and the memory can be connected to each other through the internal bus, which can be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one bidirectional arrow is used in Figure 5, but it does not mean that there is only one bus or only one type of bus.

[0089] The memory is configured to store a program. The program can include program code including computer operation instructions. The memory can include a memory and a non-volatile memory, and provide instructions and data to the processor.

[0090] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs, and forms a flow detection device at the logical level. The processor executes the program stored in the memory, and is configured to perform the following operations: receiving target traffic; time-stamping the target traffic at a first resource port, the first resource port being a port determined in advance from a plurality of target traffic entry ports for performing flow detection on the target traffic, the plurality of target traffic entry ports being ports of the head node device receiving the target traffic.

[0091] The method performed by the in-stream detection device disclosed in the embodiment shown in Fig. 5 of the present application can be applied in a processor or implemented by the processor. The processor can be an integrated circuit chip with processing capability. In the implementation process, each step of the above method can be completed by integrated logic circuits in hardware or instructions in software form in the processor. The processor mentioned above can be a general processor, including a central processing unit (CPU), a network processor (NP), etc.; or a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. Each method, step and logic block diagram disclosed in the present application can be implemented or executed. The general processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the present application can be directly embodied as a hardware code processor for execution, or a combination of hardware and software modules in the code processor for execution. The software module can be located in a random memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register or other mature storage medium in the art. The storage medium is located in the memory, and the processor reads the information in the memory and combines the hardware to complete the steps of the above method.

[0092] The electronic device can also perform the methods of Fig. 1, Fig. 3 and Fig. 4, and implement the functions of the in-stream detection device in the embodiments shown in Fig. 1, Fig. 3 and Fig. 4. The present application will not be repeated here.

[0093] Of course, in addition to the software implementation, the electronic device of the present application does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc. That is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic device.

[0094] The application further provides a computer readable storage medium storing one or more programs, the one or more programs including instructions that, when executed by a portable electronic device including a plurality of applications, enable the portable electronic device to perform the method of the embodiments shown in FIG. 1, FIG. 3 and FIG. 4, and to perform the following operations: receiving target traffic; time-stamping the target traffic at a first resource port, the first resource port being a port determined in advance from a plurality of target traffic ingress ports for performing in-situ flow detection, the plurality of target traffic ingress ports being ports of the head node device receiving the target traffic.

[0095] FIG. 6 is a structural schematic diagram of an in-situ flow detection device 60 according to an embodiment of the application. Referring to FIG. 6, in a software implementation, the in-situ flow detection device 60 can include a receiving module 61 and an in-situ flow detection module 62, wherein: the receiving module 61 receives target traffic; and the in-situ flow detection module 62 time-stamps the target traffic at a first resource port, the first resource port being a port determined in advance from a plurality of target traffic ingress ports for performing in-situ flow detection, the plurality of target traffic ingress ports being ports of the head node device receiving the target traffic.

[0096] In some embodiments, the in-situ flow detection device 60 further includes a determining module; before time-stamping the target traffic at the first resource port, the determining module includes: determining the plurality of target traffic ingress ports according to ports receiving the target traffic; and determining the first resource port from the plurality of target traffic ingress ports.

[0097] In some embodiments, the determining module determines the first resource port from the plurality of target traffic ingress ports includes: determining a first resource board from resource boards corresponding to the plurality of target traffic ingress ports; and determining the first resource port from ports of the first resource board.

[0098] In some embodiments, the determining module determines the first resource board from resource boards corresponding to the plurality of target traffic ingress ports includes any one of the following: determining the first resource board from resource boards corresponding to the plurality of target traffic ingress ports according to first indication information, the first indication information being used to indicate identification information of the first resource board; creating a session at each of the target traffic ingress ports; monitoring the created sessions, determining active ports from the plurality of target traffic ingress ports according to a monitoring result; and determining the first resource board from a resource board corresponding to the active ports.

[0099] In some embodiments, the determining module determines the first resource board from the resource boards corresponding to the active ports, including: determining a latest active port from the active ports; and determining the resource board in which the latest active port is located as the first resource board.

[0100] In some embodiments, the determining module determines the first resource port from the ports of the first resource board, including any one of: determining the first resource port from the first resource board according to second indication information, the second indication information being used to indicate identification information of the first resource port; and determining the most active port in the first resource board as the first resource port.

[0101] In some embodiments, the determining module further includes: in a case where the first resource port is invalid, determining a second resource port from the plurality of target traffic ingress ports; and performing time stamp marking on the target traffic by the second resource port.

[0102] In some embodiments, the invalidation of the first resource port includes that the first resource port becomes an inactive port; and the determining module determines the second resource port from the plurality of target traffic ingress ports, including: determining a candidate resource port from the plurality of target traffic ingress ports, the candidate resource port being an active port in the resource board in which the first resource port is located; and determining the most active port in the candidate resource port as the second resource port.

[0103] In some embodiments, the invalidation of the first resource port includes that the resource board in which the first resource port is located is invalid; and the determining module determines the second resource port from the plurality of target traffic ingress ports, including: determining a second resource board from the resource boards corresponding to the plurality of target traffic ingress ports, the second resource board being a non-invalid resource board, and the second resource board including an active port; and determining the most active port in the second resource board as the second resource port.

[0104] In some embodiments, the invalidation of the resource board in which the first resource port is located includes at least one of: the resource board in which the first resource port is located is offline; and all ports in the resource board in which the first resource port is located are inactive ports.

[0105] The flow detection device 60 provided in the present application can also perform the methods of FIG. 1, FIG. 3 and FIG. 4, and realize the functions of the flow detection device 60 in the embodiments of FIG. 1, FIG. 3 and FIG. 4. The present application will not be repeated here.

[0106] The application further provides a computer program product, which comprises a non-transitory computer-readable storage medium storing a computer program capable of operating a computer to perform some or all of the steps in the stream detection method embodiments described above.

[0107] In conclusion, the above merely illustrates the preferred embodiments of the present application, but should not be used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

[0108] The system, apparatus, module or unit illustrated in the above embodiments can be implemented by a computer chip or entity, or by a product with certain functions. A typical implementation device is a computer. The computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0109] The computer readable medium includes permanent and non-permanent, removable and non-removable media, which can be implemented by any method or technology to store information. The information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to computing devices. According to the definition herein, computer readable medium does not include transitory media such as modulated data signals and carriers.

[0110] It should also be noted that the terms "comprising", "including", or any other variant thereof are intended to cover non-exclusive inclusion, so that processes, methods, articles or devices including a series of elements not only include those elements, but also include other elements not explicitly listed or inherent to such processes, methods, articles or devices. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or device including the element.

[0111] The various embodiments in the present application are described in a progressive manner, and the same or similar parts among the various embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments. In particular, the system embodiments are described more simply because they are basically similar to the method embodiments, and the relevant parts can be referred to the description of the method embodiments.

Claims

1. A method for in-situ flow detection, applied to a head node device, comprising: receiving a target traffic; time stamping the target traffic at a first resource port, the first resource port being one port determined from a plurality of target traffic ingress ports for in-situ flow detection of the target traffic, the plurality of target traffic ingress ports being ports of the head node device receiving the target traffic. 2.The method of claim 1, before time stamping the target traffic at the first resource port, the method further comprising: determining the plurality of target traffic ingress ports according to ports receiving the target traffic; determining the first resource port from the plurality of target traffic ingress ports. 3.The method of claim 2, determining the first resource port from the plurality of target traffic ingress ports comprises: determining a first resource board from resource boards corresponding to the plurality of target traffic ingress ports; determining the first resource port from ports of the first resource board. 4.The method of claim 3, determining the first resource board from resource boards corresponding to the plurality of target traffic ingress ports comprises any one of: determining the first resource board from resource boards corresponding to the plurality of target traffic ingress ports according to first indication information, the first indication information indicating identification information of the first resource board; creating a session for each of the target traffic ingress ports; monitoring the created sessions, and determining an active port from the plurality of target traffic ingress ports according to a monitoring result; determining the first resource board from a resource board corresponding to the active port. 5.The method of claim 4, determining the first resource board from a resource board corresponding to the active port comprises: determining a latest active port from the active port; determining a resource board in which the latest active port is located as the first resource board. 6.The method of claim 3, determining the first resource port from ports of the first resource board comprises any one of: determining the first resource port from the first resource board according to second indication information, the second indication information indicating identification information of the first resource port; determining a most active port in the first resource board as the first resource port. 7.The method of any one of claims 1 to 6, the method further comprising: in a case where the first resource port is invalid, determining a second resource port from the plurality of target traffic ingress ports; time stamping the target traffic at the second resource port.

8. The method of claim 7, the first resource port failure comprising the first resource port becoming an inactive port. Determining the second resource port from the plurality of target traffic ingress ports comprises: determining candidate resource ports from the plurality of target traffic ingress ports, the candidate resource ports being active ports in a resource board in which the first resource port is located; determining a most active port in the candidate resource ports as the second resource port.

9. The method of claim 7, the first resource port failure comprising a resource board on which the first resource port is located failing. Determining the second resource port from the plurality of target traffic ingress ports comprises: determining a second resource board from the resource boards corresponding to the plurality of target traffic ingress ports, the second resource board being a non-failed resource board, the second resource board including active ports; determining the most active port in the second resource board as the second resource port. 10.The method of claim 9, wherein the resource board where the first resource port is located fails, including at least one of: the resource board where the first resource port is located is offline; all ports in the resource board where the first resource port is located are non-active ports. 11.An electronic device, comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the method of any one of claims 1-10. 12.A computer-readable storage medium, when instructions in the storage medium are executed by a processor of an electronic device, enable the electronic device to perform the method of any one of claims 1-10. 13.A computer program product comprising a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of the method of any one of claims 1-10.

Citation Information

Patent Citations

  • Forwarding path selection method and device

    CN105591912A

  • Active stream following detection method, network equipment and communication system

    CN113079091A

  • In-situ flow detection method and device

    CN113382437A

  • Stream detection method, electronic equipment, storage medium and program product

    CN118945088A

  • In-situ flow test method and apparatus, and network device and storage medium

    WO2023125427A1