Stream detection method, electronic equipment, storage medium and program product
By selecting a resource port in the head node device to time-stamp the target traffic, the problem of inaccurate link delay detection in multiple incoming ports is solved, and the accurate calculation of link delay is achieved.
Patent Information
- Application Number
- CN202411385506.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2024-11-12
AI Technical Summary
When the head node device has multiple traffic inlet ports, it is difficult for existing flow-access detection technology to accurately detect link delays, because the successor node device cannot determine which forwarding path the calculated link delay belongs to.
By selecting a resource port from multiple target traffic inlet ports in the head node device for time stamping, the successor node device can determine a unique message with a time stamping mark within one detection cycle, thereby determining the link delay The specific forwarding path of the attribution.
Ensure the accuracy of link delay, so that the successor node device can accurately calculate link delay within one detection cycle.
Smart Images

Figure CN118945088A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network technology, and in particular to a flow detection method, electronic equipment, storage medium and program product. Background Art
[0002] In a communication network, the flow detection technology can be used to detect the transmission quality of the network, such as link delay, packet loss, jitter, etc. In some communication scenarios, such as tunnel scenarios, there are usually multiple ingress ports in the head node device that receive the target traffic. When detecting link delay based on the flow detection technology in the relevant technology, the received target traffic will be timestamped at each ingress port and forwarded with the service flow. In this way, for the subsequent node device, multiple messages with timestamps will be received within a detection cycle (or staining cycle). Since these messages originate from different ingress ports of the head node device, the subsequent node device cannot determine which forwarding path the calculated link delay belongs to, resulting in the inability to accurately obtain the link delay. Summary of the invention
[0003] The present application provides a flow detection method, electronic device, storage medium and program product, which are used to solve the problem that when a head node device includes multiple traffic inlet ports, the link delay cannot be accurately obtained when detecting the link delay based on the flow detection technology in the related technology.
[0004] To solve the above technical problems, this application is implemented as follows: In a first aspect, a flow detection method is provided, which is applied to a head node device, including: Receive target traffic; The target traffic is timestamped at a first resource port, where the first resource port is a port pre-determined from a plurality of target traffic inlet ports for performing in-flow detection on the target traffic, and the plurality of target traffic inlet ports are ports in the head node device for receiving the target traffic.
[0005] In a second aspect, an electronic device is provided, including: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method as described in the first aspect.
[0006] According to 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 execute the method according to the first aspect.
[0007] According to a fourth aspect, a computer program product is provided, the computer program product comprising a non-transitory computer-readable storage medium storing a computer program, wherein the computer program is operable to cause a computer to execute part or all of the steps in the method described in the first aspect.
[0008] In the embodiment of the present application, the head node device can determine in advance a port, namely the first resource port, from multiple target traffic inlet ports for receiving target traffic. When performing flow detection, the target traffic can be timestamped only at the first resource port. Thus, the subsequent node device can determine the only message with a timestamp within a detection cycle (or staining cycle). When calculating the link delay, it can determine which forwarding path the calculated link delay specifically belongs to, thereby ensuring the accuracy of the link delay. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the present application or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0010] Figure 1 It is a schematic diagram of a flow chart of a flow detection method according to an embodiment of the present application; Figure 2 It is a schematic diagram of selecting a resource port for following-the-flow detection in a Srv6 Policy scenario in an embodiment of the present application; Figure 3 It is a flowchart of a resource board selection method according to an embodiment of the present application; Figure 4 It is a flowchart of a resource port selection method according to an embodiment of the present application; Figure 5 is a schematic diagram of the structure of an electronic device according to an embodiment of the present application; Figure 6 It is a schematic structural diagram of a flow detection device according to an embodiment of the present application. DETAILED DESCRIPTION
[0011] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in this application will be described clearly and completely below in conjunction with the drawings in one or more embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0012] The terms "first", "second", etc. in the present application and claims are used to distinguish similar objects, and are not used to describe a particular order or precedence. It should be understood that the data used in this way can be interchanged where appropriate 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 objects associated with each other are in an "or" relationship.
[0013] It should be noted that the technical solution provided in the embodiment of the present application is applicable to the scenario where the head node device includes multiple traffic inlet ports, such as the head node device in the tunnel scenario, which includes but is not limited to the Srv6 Policy and Srv6be scenarios. Based on the technical solution provided in the embodiment of the present application, when performing flow detection, the head node device can select a port from multiple inlet ports for receiving target traffic, and timestamp the target traffic at the port (insert a timestamp mark in the target traffic), thereby enabling the subsequent node device to determine the only message with the flow detection timestamp mark within a detection cycle (or staining cycle), and when calculating the link delay, it can be determined to which forwarding path the calculated link delay specifically belongs, so that the link delay can be accurately obtained.
[0014] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0015] Figure 1 It is a flow chart of a flow detection method of an embodiment of the present application. The flow detection method can be applied to a head node device for performing flow detection in a network, that is, the flow detection method can be executed by the head node device. In other words, the flow detection method can be executed by software or hardware installed in the head node device. Figure 1 The flow detection method shown includes the following steps.
[0016] S102: Receive target traffic.
[0017] S104: Timestamp the target traffic at a first resource port, where the first resource port is a port pre-determined from a plurality of target traffic inlet ports for performing in-flow detection on the target traffic, and the plurality of target traffic inlet ports are ports in a head node device for receiving the target traffic.
[0018] The head node device includes multiple traffic inlet ports, and each traffic inlet port can have traffic (or data flow) flowing in. In this embodiment, when there is target traffic (or target data flow) flowing into the head node device, the head node device can receive the target traffic through multiple traffic inlet ports. Among them, the inlet port receiving the target traffic can be represented as the target traffic inlet port, and the number of the target traffic inlet ports is multiple.
[0019] When receiving target traffic, during the follow-up detection, the target traffic can be timestamped at the first resource port of multiple target traffic inlet ports. The first resource port is a port for follow-up detection determined in advance from multiple target traffic inlet ports and is an active port.
[0020] In this way, since the target traffic can be timestamped at only one port (i.e., the first resource port) among multiple target traffic ingress ports during flow detection, the subsequent node device can determine the only message with a timestamp within a detection cycle (or staining cycle). When calculating the link delay, it can be determined to which forwarding path the calculated link delay specifically belongs, thereby ensuring the accuracy of the link delay.
[0021] In some implementations, when determining the first resource port from multiple target traffic inlet ports, the determination timing may be after receiving the target traffic and before performing the flow detection. Specifically, before the first resource port timestamps the target traffic, the following steps may be included: Determine multiple target traffic inlet ports according to the port receiving the target traffic; A first resource port is determined from a plurality of target traffic ingress ports.
[0022] When determining (or identifying) multiple target traffic inlet ports based on the port receiving the target traffic, the specific implementation methods may include multiple ones, which are not specifically limited here. Taking the head node device as the head node device in the Srv6 Policy scenario as an example, when determining multiple target traffic inlet ports, in some implementations, the target Policy traffic can be identified first, and then the corresponding multiple inlet ports, that is, multiple target traffic inlet ports, can be determined based on the target Policy traffic. Among them, when identifying the target Policy traffic, it can be identified through an access control list (Access Control List, ACL). When determining multiple target traffic inlet ports based on the target Policy traffic, the path information of the target Policy traffic can be first identified based on the segment list (segmentList) of the target Policy traffic, and then the corresponding multiple target traffic inlet ports can be determined based on the path information of the target Policy traffic.
[0023] It should be noted that the head node device may include a control plane and a forwarding plane (the forwarding plane and the control plane may be regarded as two functional modules in the head node device). In some embodiments, when multiple target traffic inlet ports are determined according to the port receiving the target traffic, it may be implemented by the forwarding plane in the head node device.
[0024] After determining a plurality of target traffic inlet ports, when determining a first resource port from the plurality of target traffic inlet ports, in some implementations, the following steps may be included: Determining a first resource board from resource boards corresponding to a plurality of target traffic ingress ports; A first resource port is determined from the ports of the first resource board.
[0025] The head node device includes a forwarding plane board, which may include multiple resource boards, each of which may include multiple resource ports, and each resource port is a traffic inlet port. When determining the first resource port from multiple target traffic inlet ports, two-level selection (or election) is involved, that is, first selecting a resource board from the resource boards corresponding to the multiple target traffic inlet ports as the first resource board, and then selecting a port from the ports of the first resource board as the first resource port.
[0026] It should be noted that the number of resource boards corresponding to multiple target traffic inlet ports can be one or more. In the case where multiple target traffic inlet 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 multiple target traffic inlet ports correspond to multiple resource boards, it is necessary to select one resource board from the multiple resource boards as the first resource board. The embodiment of the present application is described by taking multiple target traffic inlet ports corresponding to multiple resource boards as an example.
[0027] In the case where multiple target traffic inlet ports correspond to multiple resource boards, in some implementations, determining the first resource board from the resource boards corresponding to the multiple target traffic inlet ports may include any one of the following methods 1 and 2: Mode 1: According to the first indication information, a first resource board is determined from resource boards corresponding to a plurality of target traffic ingress ports, and the first indication information is used to indicate identification information of the first resource board.
[0028] The first indication information can be configured or indicated by the user, that is, the user can manually 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 determining the first resource board, the resource board corresponding to the identification information can be determined from the resource boards corresponding to the multiple target flow inlet 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 a resource board can uniquely identify a 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 for follow-up detection can be selected from the first resource board configured or indicated by the user subsequently, thereby meeting the user's needs.
[0029] Optionally, the first indication information may also be sent to the head node device by other devices, and the other devices may be, for example, a successor node device or a network management server that performs flow detection. In the case where 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 can be determined from the resource boards corresponding to the multiple target traffic inlet 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 a resource board can uniquely identify a 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 other devices, the first resource port for flow detection can be selected from the first resource board indicated by other devices subsequently, so that the port corresponding to the successor node device can be convenient for detecting and receiving messages with timestamp marks, and then it can be convenient for implementing flow detection.
[0030] Method 2: Create a session at each target traffic inlet port; monitor the created session, and determine an active port from multiple target traffic inlet ports according to the monitoring result; and determine a first resource board from resource boards corresponding to the active ports.
[0031] 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 multiple target traffic inlet ports. In this way, automatic selection of resource boards can be achieved with better flexibility.
[0032] When the head node device determines the first resource board from the resource boards corresponding to multiple target traffic inlet ports, specifically, a session can be created at each target traffic inlet port, and then the created session can be monitored, and an active port can be determined from the multiple target traffic inlet ports based on the monitoring results. An active port can be understood as a port through which traffic flows. After determining the active port, the first resource board can be determined from the resource boards corresponding to the active port, and the first resource board includes at least one active port.
[0033] It should be noted that the number of active ports determined from multiple target traffic inlet ports may be one or more, and the number of resource boards corresponding to multiple active ports may 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, then a resource board corresponding to the one active port can be determined as the first resource board; if the number of active ports is multiple, and the multiple active ports correspond to one resource board, then the one resource board can be determined as the first resource board; if the number of active ports is multiple, and the multiple active ports correspond to multiple resource boards, then it is necessary to select one resource board from the multiple resource boards as the first resource board. Among them, when selecting a resource board from multiple resource boards as the first resource board, in some embodiments, the following steps may be included: Determine the latest active port from the active ports; The resource board where the latest active port is located is determined as the first resource board.
[0034] The latest active port can be understood as the port through which traffic has recently flowed. When selecting the first resource board, the resource board where the latest active port is located can be determined as the first resource board. In this way, since the port for flow detection needs to be an active port, after the latest active port is used as the first resource board, it can be ensured that the first resource board includes active ports, and when the first resource port is subsequently determined from the ports of the first resource board, it can be ensured that an active port can be selected as the first resource port.
[0035] Optionally, in some possible implementations, other resource boards may be selected as the first resource board. For example, a resource board with the most active ports may be selected as the first resource board. No specific limitation is imposed on the selection method of the first resource board.
[0036] After the first resource board is determined from the resource boards corresponding to the multiple target traffic inlet ports by the above-described method, the first resource port may be further determined from the ports of the first resource board.
[0037] It should be noted that the first resource board may 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 an active port, the one active port may be determined as the first resource port. If the first resource board includes multiple active ports, it is necessary to select one port from the multiple active ports as the first resource port. The embodiment of the present application is described by taking the first resource board including multiple active ports as an example.
[0038] In the case where the first resource board includes multiple active ports, in some implementations, determining the first resource board from the ports of the first resource board may include any one of the following methods 3 and 4: Mode 3: Determine the first resource port from the first resource board according to the second indication information, where the second indication information is used to indicate identification information of the first resource port.
[0039] The second indication information can be configured or indicated by the user, that is, the user can manually configure or indicate which active port in the first resource board is the first resource port. In the case where the user configures or indicates the second indication information, when determining the first resource port, the resource port corresponding to the identification information can be determined from the ports of the first resource board according to the identification information of the first resource port indicated by the second indication information (in the same resource board, different resource ports correspond to different identification information, that is, in a resource board, the identification information of a resource port can uniquely identify a resource port, and the identification information of the resource port has local uniqueness, or, in different resource boards, different resource ports correspond to different identification information, and 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 the subsequent flow detection is performed, the resource port configured or indicated by the user can be used for flow detection, thereby meeting the user's needs.
[0040] Optionally, the second indication information may also be sent to the head node device by other devices, and the other devices may be, for example, a successor node device or a network management server that performs flow detection. In the case where 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 can be determined from the port of the first resource board according to the identification information of the first resource port indicated by the second indication information, 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 the flow detection is subsequently performed, the resource port indicated by the other devices can be used to perform the flow detection, so that the port corresponding to the successor node device can be convenient for detecting and receiving the message with the timestamp mark, and then the flow detection can be convenient for implementing the flow detection.
[0041] Mode 4: Determine the most active port in the first resource board as the first resource port.
[0042] Method 3 is that the head node device determines the first resource port according to the indication of the second indication information, and method 4 is that the head node device determines the first resource board from the first resource boards, thereby realizing automatic selection of the first resource port with better flexibility.
[0043] When the head node device determines the first resource port from the first resource board, in some implementations, it can first determine the most active port from the ports of the first resource board, and then determine the most active port as the first resource port. Among them, the activity level of the port can be determined based on indicators such as the size and frequency of the traffic flowing through the port, which are not specifically limited here. Since the most active port in the first resource board can be used as the first resource port for follow-up detection, it is easy to implement follow-up detection to meet business needs. Optionally, in other possible implementations, when determining the first resource port from the first resource board, other active ports other than the most active port can also be selected as the first resource port to meet different business needs.
[0044] Based on the above content, it can be known that when the head node device determines the first resource port from multiple target traffic inbound ports, there are at least four implementation methods, which are as follows: (1) First, according to the first indication information, determine the first resource board from the resource boards corresponding to the multiple target traffic inlet ports, and then according to the second indication information, determine the first resource port from the first resource board. In this case, the first indication information and the second indication information may be the same indication information, which indicates both the identification information of the first resource board and the identification information of the first resource port (corresponding to the technical solution combining the above-mentioned method 1 and method 3, in this case, the head node device determines the first resource board and the first resource port according to the indication information).
[0045] (2) First, according to the first indication information, determine the first resource board from the resource boards corresponding to the multiple target traffic inlet ports, and then determine the most active port in the first resource board as the first resource port (corresponding to the technical solution combining the above-mentioned method 1 and method 4, in this case, 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).
[0046] (3) First, create a session at each of the target traffic inlet ports, monitor the created sessions, determine an active port from the multiple target traffic inlet ports based on the monitoring results, then determine the first resource board from the resource boards corresponding to the active ports, and finally determine the first resource port from the first resource board based on the second indication information (corresponding to the technical solution combining the above-mentioned method 2 and method 3, in this case, the head node device automatically selects the first resource board, and then determines the first resource port from the first resource board based on the indication information).
[0047] (4) First, a session is created at each of the target traffic inlet ports, and the created sessions are monitored. An active port is determined from the multiple target traffic inlet ports according to the monitoring results. Then, a first resource board is determined from the resource boards corresponding to the active ports. Finally, the most active port in the first resource board is determined as the first resource port (corresponding to the technical solution combining the above-mentioned method 2 and method 4. At this time, the head node device automatically selects the first resource board and automatically selects the first resource port from the first resource board, i.e., a two-level election).
[0048] It should be noted that the head node device may include a forwarding plane and a control plane. In some implementations, when the head node device determines the first resource board by creating a session, it can be implemented through the interaction between the forwarding plane and the control plane. When the most active port is selected from the first resource board as the first resource port, it can be implemented by the forwarding plane. Specifically, after determining multiple target traffic inlet ports, the forwarding plane can create a session at each target traffic inlet port, and then monitor the created session to determine whether each target traffic inlet 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. This embodiment can be described by taking multiple candidate resource boards as an example, and each candidate resource board includes at least one active port. After receiving the information of the candidate resource board reported by the forwarding plane, the control plane can select a resource board from the candidate resource boards as the first resource board (for example, the resource board reported most recently by the forwarding plane can be selected as the first resource board, and the resource board reported most recently is the resource board where the most active port is located), and then notify the forwarding plane of the selected first resource board. After receiving the first resource board notified by the control plane, the forwarding plane may select the most active port in the first resource board as the first resource port.
[0049] After the head node device determines the first resource port from multiple target traffic ingress ports, it can perform flow detection based on the first resource port. Specifically, the target traffic can be timestamped at the first resource port and forwarded along with the service flow. For the successor node device, a message with a timestamp will be received within a detection cycle (or staining cycle). In this way, the successor node device can determine the only forwarding link, and record the packet receiving time accordingly and then report it to the network management server. The network management server can calculate the difference between the timestamp information reported by the head node device and the successor node device in the current detection cycle to obtain the link delay.
[0050] In the embodiment of the present application, after the head node device determines the first resource port from multiple target traffic inlet ports, it can also dynamically update the first resource port and perform flow detection based on the updated resource port. Specifically, in some embodiments, after the head node device determines the first resource port from multiple target traffic inlet ports, it can include the following steps: In the case where the first resource port fails, determining a second resource port from a plurality of target traffic inlet ports; The target traffic is timestamped at the second resource port.
[0051] The failure of the first resource port may be that the first resource port becomes an inactive port, and an inactive port may be understood as a port through which no traffic flows. There are many methods for determining whether the first resource port is an inactive port, which are not specifically limited here. For example, if the first resource port has no traffic within a detection cycle, the first resource port may be considered to be an inactive port, and an inactive port may be represented as a deactivated port.
[0052] The failure of the first resource port may also be the failure of the resource board where the first resource port is located. The failure of the resource board where the first resource port is located includes at least one of the following: The resource board where the first resource port is located is offline; All ports on the resource board where the first resource port is located are inactive ports.
[0053] In the case where the first resource port fails, the first resource port can be updated, that is, a second resource port is determined from multiple target traffic inlet ports, and the target traffic is timestamped at the second resource port to perform flow detection based on the second resource port. The second resource port is an active port among the multiple target traffic inlet ports that is different from the first resource port.
[0054] In some implementations, when the first resource port fails and becomes an inactive port, determining the second resource port from a plurality of target traffic inbound ports may include: Determine a candidate resource port from a plurality of target traffic inbound ports, the candidate resource port being an active port in the resource board where the first resource port is located; The most active port among the candidate resource ports is determined as the second resource port.
[0055] That is to say, in the case where the first resource port fails, if the resource board where the first resource port is located is not failed, a port can be preferentially selected from the remaining active ports of the resource board where the first resource port is located as the second resource port. For example, the most active port can be selected as the second resource port. Optionally, an active port can also be randomly selected as the second resource port.
[0056] In some implementations, when the failure of the first resource port is caused by the failure of a resource board where the first resource port is located, determining the second resource port from a plurality of target traffic inlet ports may include: Determine a second resource board from resource boards corresponding to multiple target traffic inbound ports, the second resource board being a non-failed resource board and including an active port; The most active port in the second resource board is determined as the second resource port.
[0057] In the case where 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 the candidate resource boards as the second resource board, and a port can be selected from the second resource board as the second resource port. Among them, the candidate resource board can be a non-failed resource board other than the first resource board among all resource boards corresponding to multiple target traffic inlet ports, and the second resource board includes at least one active port. Among them, when determining the second resource board from the resource boards corresponding to multiple target traffic inlet ports, the resource board where the latest active port is located among the other ports in the multiple target traffic inlet ports other than the first resource port can be determined as the second resource board. Of course, there can also be other selection methods, such as selecting the resource board with the most active ports as the second resource board, etc., which are not specifically limited here. When determining the second resource port from the second resource board, the most active port in the second resource board can be used as the second resource port. Optionally, one of the active ports can also be randomly selected as the second resource port, which is not specifically limited here.
[0058] It should be noted that, in some embodiments, when the first resource port fails, the head node device may generate a prompt message to prompt that the first resource port fails. In this case, the user or other device may indicate a new resource board and / or resource port. At this time, when the head node device determines the second resource port from multiple target traffic inlet ports, the specific implementation method may be the same as the specific implementation method of determining the first resource port from multiple target traffic inlet ports described above, and will not be described in detail here.
[0059] Optionally, in some embodiments, the head node device may set a resource port pool, which may include identification information of multiple candidate resource ports, the status of each candidate resource port (such as whether it is an active port), and the 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. Among them, the candidate resource ports in the resource port pool can be dynamically updated. For example, when a candidate resource port becomes an inactive port, the candidate resource port can be removed from the resource port pool. When a resource board fails, all candidate resource ports belonging to the resource board can be removed from the resource port pool. When a port is selected from a resource board as the first resource port, the remaining active ports in the resource board can be used as candidate resource ports and added to the resource port pool.
[0060] Similarly, in some implementations, the head node device may also set up a resource board pool, which may include identification information of multiple candidate resource boards and the status of each candidate resource board (such as whether it is invalid). In the case of the second resource board, the second resource board can be determined from the resource board pool. Among them, the candidate resource boards in the resource board pool can also be dynamically updated. For example, when a candidate resource board fails, the candidate resource board can be removed from the resource board pool, and when a resource board changes from offline to online, the resource board can be added to the resource board pool.
[0061] In order to facilitate understanding of the flow detection method provided in the embodiment of the present application, the operator backbone network router in the Srv6 Policy scenario will be used as an example to illustrate how to automatically select resource ports. The operator backbone router needs to deploy flow detection services at the Policy granularity to detect traffic forwarding paths, link delays, and packet loss information. Considering that Policy traffic may have multiple ingress ports, the flow detection timestamp message received by the subsequent device node within a dyeing cycle is not unique. Therefore, it is necessary to select a unique policy traffic ingress port in the head node device as the resource port for flow detection to ensure the accuracy of link delay measurement. For details, please refer to Figure 2 .
[0062] Figure 2 The communication network scenario shown is a Srv6 Policy scenario. Service traffic enters the Policy forwarding path from CE1 through port 1 to port N (N is an integer greater than 1), that is, PE1→PE2→PE3, and finally reaches the end point CE2. Figure 2 It can be seen that the head node device PE1 includes N traffic inbound ports. When performing follow-up detection, it is necessary to select one port from them for follow-up detection. The specific process is as follows: Step 21: PE1 identifies the policy traffic characteristics, and the forwarding plane of PE1 creates a session at the ingress port of PE1 (i.e., port 1 to port N), and notifies the control plane of PE1 of the information of the resource board to which the port belongs.
[0063] Step 22: The control plane of PE1 selects a resource board from the known resource boards (for example, the most recently reported board), and notifies the forwarding plane of PE1 of the selected resource board.
[0064] Step 23: The forwarding plane of PE1 determines all active ports (i.e., ports through which traffic flows) in the resource board notified by the control plane, and selects a resource port from these active ports as the first resource port (for example, the most active resource port is selected as the first resource port).
[0065] The first resource port can be dynamically updated. For example, the control plane of PE1 can sense whether the resource board where the first resource port is located is offline. If it is sensed that the resource board is offline, the control plane of PE1 can reselect the resource board and notify the forwarding plane of PE1 of the reselected resource board. 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. When it is detected that the first resource port changes from an active port to an inactive port (i.e., inactive, with 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 the new first resource port. Optionally, if all ports in the resource board where the first resource port is located are unavailable, i.e., they are all inactive ports, it can be reported to the control plane of PE1, and the control plane reselects the resource board.
[0066] Step 24: PE1 inserts a flow detection timestamp into the target policy traffic of the first resource port, records the current time accordingly, and reports it to the network management server.
[0067] Step 25: PE2 receives the target policy traffic, parses it and obtains the flow detection timestamp tag. For the N traffic inlet ports of PE1, since a unique resource port has been selected to insert the flow detection timestamp tag, PE2 only receives one timestamp tag message in one dyeing cycle, representing the determined forwarding link. PE2 records the packet receiving time and reports it to the network management server. The network management server can make a difference between the timestamp information reported by PE1 and PE2 in the current dyeing cycle, so as to obtain the link delay.
[0068] In the above steps 21 and 22, through the interaction between the forwarding plane and the control plane of PE1, a resource board can be selected from multiple resource boards of PE1. In some more specific implementations, the process of selecting a resource board by the forwarding plane and the control plane of PE1 can be as follows: Figure 3 shown. Figure 3 is a flowchart of a resource board selection method according to an embodiment of the present application. Figure 3 The specific implementation of the illustrated embodiment is as follows.
[0069] First, the forwarding plane can identify the target Policy traffic and determine the target traffic inlet port where the flow detection service needs to be deployed. After identifying the target traffic inlet port, a session can be created in units of ports, and the flow detection timestamp tag is not inserted by default. Secondly, the forwarding plane monitors the session status of the target traffic inlet port and counts whether the target traffic inlet port is an active port. For those with traffic, it can be considered an active port. For those without traffic (for example, there is no traffic in a detection cycle), it is considered an inactive port. For active ports, the forwarding plane can report the resource board information to which the active port belongs 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. When 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. Among them, when the forwarding plane identifies the target Policy traffic, the forwarding plane can forward the non-target Policy traffic normally. When the resource board pool is empty, you can wait for the resource board pool to be updated. When the resource board pool becomes non-empty, the control plane selects a resource board from the resource board pool.
[0070] 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 flow detection port, that is, the first resource port. In some more specific implementations, the process of selecting the resource port by the forwarding plane can be as follows: Figure 4 shown. Figure 4 The specific implementation of the illustrated embodiment is as follows.
[0071] First, for each resource board, the forwarding plane can determine whether it is a resource board selected by the control plane. If the resource board is a resource board selected by the control plane, a resource port can be selected from the resource board as a flow detection port, and a flow detection timestamp mark can be inserted into the target traffic of the flow detection port. For other active ports in the resource board, they can be used as candidate resource ports and added to the resource port pool. If the resource board is not a resource board selected by the control plane, the resource board can be used 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.
[0072] In some embodiments, Figure 3 The resource board pool and Figure 4 The resource port pool in the illustrated embodiment can also be dynamically updated so as to dynamically update the flow detection port.
[0073] Specifically, the update mechanism of the resource board pool is as follows: Mechanism 1: After the forwarding plane determines that the resource ports on the resource board selected by the control plane are aged (if there is no traffic within a dyeing cycle, it is considered aged), it reports to the control plane that the resource board is invalid. 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.
[0074] Mechanism 2: When a resource board is offline, the control plane marks the resource board as invalid. The resource board marked as invalid does not participate in the resource board election of the control plane.
[0075] The update 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. When the flow detection port becomes inactive, a resource port (such as the most active port among the candidate resource ports) can be selected from the candidate resource ports of the resource board as a new flow detection port.
[0076] The above example illustrates how the head node device selects a resource port from multiple target traffic inlet ports for follow-up detection. Based on the technical solution provided by the embodiment of the present application, when the head node device performs follow-up detection, it can only timestamp the target traffic at the first resource port, thereby enabling the subsequent node device to determine the only message with a timestamp within a detection cycle (or staining cycle), and when calculating the link delay, it can determine which forwarding path the calculated link delay specifically belongs to, thereby ensuring the accuracy of the link delay.
[0077] 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 recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0078] Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. Figure 5At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. Of course, the electronic device may also include hardware required for other services.
[0079] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0080] The memory is used to store the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.
[0081] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a flow detection device at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations: Receive target traffic; The target traffic is timestamped at a first resource port, where the first resource port is a port pre-determined from a plurality of target traffic inlet ports for performing in-flow detection on the target traffic, and the plurality of target traffic inlet ports are ports in a head node device for receiving the target traffic.
[0082] The above application Figure 5The method performed by the flow detection device disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in this application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in this application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0083] The electronic device may also perform Figure 1 , Figure 3 and Figure 4 The method is to realize the flow detection device in Figure 1 , Figure 3 and Figure 4 The functions in the illustrated embodiments will not be described in detail in this application.
[0084] Of course, in addition to software implementation methods, 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 to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0085] The present application also proposes a computer-readable storage medium, which stores one or more programs, wherein the one or more programs include instructions, which, when executed by a portable electronic device including a plurality of application programs, enable the portable electronic device to execute Figure 1 , Figure 3 and Figure 4The method of the embodiment shown is specifically used to perform the following operations: Receive target traffic; The target traffic is timestamped at a first resource port, where the first resource port is a port pre-determined from a plurality of target traffic inlet ports for performing in-flow detection on the target traffic, and the plurality of target traffic inlet ports are ports in a head node device for receiving the target traffic.
[0086] Figure 6 This is a schematic diagram of the structure of a flow detection device 60 according to an embodiment of the present application. Figure 6 In a software implementation, the flow detection device 60 may include: a receiving module 61 and a flow detection module 62, wherein: A receiving module 61 receives target traffic; The in-flow detection module 62 timestamps the target traffic at a first resource port, where the first resource port is a port pre-determined from a plurality of target traffic inlet ports for performing in-flow detection on the target traffic, and the plurality of target traffic inlet ports are ports in the head node device for receiving the target traffic.
[0087] In some implementations, the flow detection device 60 further includes a determination module; before the first resource port timestamps the target flow, the determination module includes: Determining the multiple target traffic inlet ports according to the port receiving the target traffic; The first resource port is determined from the plurality of target traffic ingress ports.
[0088] In some implementations, the determining module determines the first resource port from the multiple target traffic inbound ports, including: Determine a first resource board from the resource boards corresponding to the multiple target traffic inlet ports; The first resource port is determined from the ports of the first resource board.
[0089] In some implementations, the determining module determines the first resource board from the resource boards corresponding to the multiple target traffic ingress ports, including any of the following: Determine, according to first indication information, a first resource board from resource boards corresponding to the plurality of target traffic ingress ports, wherein the first indication information is used to indicate identification information of the first resource board; A session is created at each of the target traffic inlet ports; the created sessions are monitored, and an active port is determined from the multiple target traffic inlet ports according to the monitoring result; and the first resource board is determined from the resource boards corresponding to the active ports.
[0090] In some implementations, the determining module determines the first resource board from the resource boards corresponding to the active ports, including: Determining a most recently active port from the active ports; The resource board where the latest active port is located is determined as the first resource board.
[0091] In some implementations, the determining module determines the first resource port from the ports of the first resource board, including any of the following: Determine the first resource port from the first resource board according to second indication information, where the second indication information is used to indicate identification information of the first resource port; The most active port in the first resource board is determined as the first resource port.
[0092] In some implementations, the determining module further includes: In the event that the first resource port fails, determining a second resource port from the plurality of target traffic inlet ports; The target traffic is timestamped at the second resource port.
[0093] In some implementations, the failure of the first resource port includes the first resource port becoming an inactive port; the determination module determines the second resource port from the multiple target traffic inbound ports, including: Determine a candidate resource port from the multiple target traffic inbound ports, the candidate resource port being an active port in the resource board where the first resource port is located; The most active port among the candidate resource ports is determined as the second resource port.
[0094] In some implementations, the failure of the first resource port includes the failure of a resource board where the first resource port is located; the determination module determines the second resource port from the multiple target traffic inlet ports, including: Determine a second resource board from the resource boards corresponding to the multiple target traffic inbound ports, the second resource board being a non-failed resource board and including an active port; The most active port in the second resource board is determined as the second resource port.
[0095] In some implementations, the failure of the resource board where the first resource port is located includes at least one of the following: 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 inactive ports.
[0096] The flow detection device 60 provided in the present application can also perform Figure 1 , Figure 3 and Figure 4 The method is to realize the flow detection device 60 in Figure 1 , Figure 3 and Figure 4 The functions of the illustrated embodiments will not be described in detail in this application.
[0097] The present application also proposes a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute part or all of the steps in the above-mentioned embodiment of the flow detection method.
[0098] In short, the above description is only a preferred embodiment of the present application and is not intended 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 shall be included in the protection scope of the present application.
[0099] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may 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.
[0100] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. 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 disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0101] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0102] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
Claims
1. A flow detection method, applied to a head node device, comprising: Receive target traffic; The target traffic is timestamped at a first resource port, where the first resource port is a port pre-determined from a plurality of target traffic inlet ports for performing in-flow detection on the target traffic, and the plurality of target traffic inlet ports are ports in the head node device for receiving the target traffic.
2. The method according to claim 1, before the first resource port timestamps the target traffic, the method further comprises: Determining the multiple target traffic inlet ports according to the port receiving the target traffic; The first resource port is determined from the plurality of target traffic ingress ports.
3. The method according to claim 2, wherein determining the first resource port from the plurality of target traffic inbound ports comprises: Determine a first resource board from the resource boards corresponding to the multiple target traffic inlet ports; The first resource port is determined from the ports of the first resource board.
4. The method according to claim 3, wherein determining the first resource board from the resource boards corresponding to the plurality of target traffic inlet ports comprises any one of the following: Determine, according to first indication information, a first resource board from resource boards corresponding to the plurality of target traffic ingress ports, wherein the first indication information is used to indicate identification information of the first resource board; Creating a session at each of the target traffic ingress ports; Monitor the created session, and determine an active port from the multiple target traffic inbound ports according to the monitoring result; The first resource board is determined from the resource boards corresponding to the active ports.
5. The method according to claim 4, wherein determining the first resource board from the resource boards corresponding to the active ports comprises: Determining a most recently active port from the active ports; The resource board where the latest active port is located is determined as the first resource board.
6. The method according to claim 3, wherein determining the first resource port from the ports of the first resource board comprises any one of the following: Determine the first resource port from the first resource board according to second indication information, where the second indication information is used to indicate identification information of the first resource port; The most active port in the first resource board is determined as the first resource port.
7. The method according to any one of claims 1 to 6, further comprising: In the event that the first resource port fails, determining a second resource port from the plurality of target traffic inlet ports; The target traffic is timestamped at the second resource port.
8. The method of claim 7, wherein the failure of the first resource port comprises the first resource port becoming an inactive port; The determining of the second resource port from the plurality of target traffic inlet ports comprises: Determine a candidate resource port from the multiple target traffic inbound ports, the candidate resource port being an active port in the resource board where the first resource port is located; The most active port among the candidate resource ports is determined as the second resource port.
9. The method according to claim 7, wherein the failure of the first resource port comprises the failure of a resource board where the first resource port is located; The determining of the second resource port from the plurality of target traffic inlet ports comprises: Determine a second resource board from the resource boards corresponding to the multiple target traffic inbound ports, the second resource board being a non-failed resource board and including an active port; The most active port in the second resource board is determined as the second resource port.
10. The method according to claim 9, wherein the failure of the resource board where the first resource port is located comprises at least one of the following: 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 inactive ports.
11. An electronic device, comprising: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method according to any one of claims 1 to 10.
12. A computer-readable storage medium, when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 10.
13. A computer program product, comprising a non-transitory computer-readable storage medium storing a computer program, wherein the computer program is operable to cause a computer to execute part or all of the steps in the method according to any one of claims 1 to 10.
Citation Information
Cited By
In-band flow measurement method, electronic device, storage medium, and program product
WO2026066225A1
