Traffic detection method, electronic device, and computer-readable storage medium
By acquiring SRv6 policies and next-hop node information, determining the traffic detection path and sending detection packets, the problem of loose node detection is solved, and traffic detection and network optimization are realized across the entire path.
Patent Information
- Application Number
- PCT/CN2025/099490
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-06-28
- Filing Date
- 2025-06-06
- Publication Date
- 2026-01-02
AI Technical Summary
In existing technologies, traffic detection based on SRv6 only supports the detection of mandatory nodes, making it difficult to detect traffic from loosely connected nodes.
By obtaining information about the target SRv6 policy and the next-hop node, the traffic detection path is determined, and traffic detection messages are sent to detect the data traffic information of loose nodes. The network management device sends messages to the necessary nodes to indicate traffic detection.
It enables traffic detection for loose nodes, allowing network management devices to monitor the status of the entire path, optimize network paths, and meet the higher requirements of SRv6 for path selection.
Smart Images

Figure CN2025099490_02012026_PF_FP_ABST
Abstract
Description
Traffic detection method, electronic device and computer readable storage medium
[0001] Cross-reference to Related Applications
[0002] The present application claims priority to the Chinese patent application No. 202410861124.2, filed on June 28, 2024, and entitled "Traffic detection method, electronic device and computer readable storage medium", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0003] The present application belongs to the field of communication technology, and particularly relates to a traffic detection method, an electronic device and a computer readable storage medium. BACKGROUND
[0004] Segment Routing IPv6 (SRv6) based on the IPv6 forwarding plane can realize more fine-grained traffic engineering and path optimization, and therefore, is increasingly used in the existing network and adopted by many network service providers, data centers and enterprise networks.
[0005] In the related art, in the SRv6 in-stream detection technology realized based on SRv6, only the traffic detection of the mandatory nodes defined in the SRv6 policy (SRv6Policy) is supported, and how to realize the traffic detection of the loose nodes for some paths with loose nodes is still a technical problem urgently to be solved in the field. SUMMARY
[0006] The purpose of the embodiments of the present application is to provide a traffic detection method, an electronic device and a computer readable storage medium, which can realize the traffic detection of loose nodes.
[0007] In a first aspect, a traffic detection method is provided, applied to a first node, the first node being a mandatory node defined in a target SRv6 policy, and the method comprising: obtaining information of the target SRv6 policy and a next hop node, wherein the next hop node is a next hop mandatory node of the first node in the target SRv6 policy; determining a first traffic detection path between the first node and the next hop node according to the target SRv6 policy and the next hop node; and sending a first traffic detection packet to the next hop node through the first traffic detection path, wherein the first traffic detection packet carries data traffic information of the first node, and the first traffic detection packet is used to detect data traffic information of each second node on the target SRv6 policy, the second node being a loose node not defined in the target SRv6 policy.
[0008] Secondly, a traffic detection method is provided, applied to a network management device. The method includes: determining to enable traffic detection for a second node corresponding to a target SRv6 policy, wherein the second node is a loose node not defined in the target SRv6 policy; sending a first message to each mandatory node defined in the target SRv6 policy; wherein, for any first node among the mandatory nodes, the first message is used to instruct the enabling of traffic detection for the second node corresponding to the target SRv6 policy.
[0009] Thirdly, a traffic detection device is provided, applied to a first node, which is a mandatory node defined in a target SRv6 policy. The device includes: an acquisition module, used to acquire information about the target SRv6 policy and a next-hop node, wherein the next-hop node is a mandatory next-hop node of the first node in the target SRv6 policy; a processing module, used to determine a first traffic detection path between the first node and the next-hop node according to the target SRv6 policy and the next-hop node; and a sending module, used to send a first traffic detection message to the next-hop node through the first traffic detection path, wherein the first traffic detection message carries data traffic information of the first node, and the first traffic detection message is used to detect the data traffic information of each second node on the first traffic detection path in the target SRv6 policy, wherein the second node is a loose node not defined in the target SRv6 policy.
[0010] Fourthly, a traffic detection device is provided, applied to a network management device. The device includes: a processing module, configured to determine to enable traffic detection for a second node corresponding to a target SRv6 policy, wherein the second node is a loose node not defined in the target SRv6 policy; and a sending module, configured to send a first message to each mandatory node defined in the target SRv6 policy; wherein, for any first node among the mandatory nodes, the first message is used to instruct the enabling of traffic detection for the second node corresponding to the target SRv6 policy.
[0011] Fifthly, embodiments of this application provide an electronic device, including: a memory, a processor, and computer-executable instructions stored in the memory and executable on the processor, wherein the computer-executable instructions, when executed by the processor, implement the steps of the method described in the first or second aspect.
[0012] In a sixth aspect, embodiments of this application provide a computer-readable storage medium for storing computer-executable instructions that, when executed by a processor, implement the steps of the method described in the first or second aspect. Attached Figure Description
[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced. Obviously, the accompanying drawings in the following description only represent some of the embodiments of the present application, and all other drawings obtained by those of ordinary skill in the art without creative effort based on these drawings should belong to the protection scope of the present application.
[0014] FIG. 1 is a flow diagram of a traffic detection method according to an example embodiment of the present application.
[0015] FIG. 2 is a flow diagram of a traffic detection method according to another example embodiment of the present application.
[0016] FIG. 3 is a flow diagram of a traffic detection method according to another example embodiment of the present application.
[0017] FIG. 4 is a schematic diagram of an application scenario of a traffic detection method according to an example embodiment of the present application.
[0018] FIG. 5 is a flow diagram of a traffic detection method according to another example embodiment of the present application.
[0019] FIG. 6 is a schematic diagram of a traffic detection apparatus according to an example embodiment of the present application.
[0020] FIG. 7 is a schematic diagram of a traffic detection apparatus according to another example embodiment of the present application.
[0021] FIG. 8 is a schematic diagram of an electronic device according to an example embodiment of the present application. DETAILED DESCRIPTION
[0022] In order to make the technical solutions in the present application better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments only represent some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should belong to the protection scope of the present application.
[0023] The technical solutions provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings and some embodiments and their application scenarios.
[0024] FIG. 1 shows a flowchart of a traffic detection method 100 provided by an embodiment of the present application, which can be executed by a first node, such as by software or hardware installed in the first node. The first node is a mandatory node defined in a target SRv6 policy. As shown in FIG. 1, the method can include but is not limited to the following steps.
[0025] S110, obtaining information of the target SRv6 policy and a next-hop node.
[0026] The next-hop node is a next-hop mandatory node of the first node in the target SRv6 policy. For example, assuming that the mandatory nodes in the detection path during flow detection are defined in the target SRv6 policy to include node A, node B, and node C, and the detection path is node A→node B→node C, if the first node is node B, then node A is the previous-hop node of the first node, and node C is the next-hop node of the first node.
[0027] In this embodiment, the mandatory node can also be referred to as a waypoint node, and the loose node mentioned later can also be referred to as a non-waypoint node, which is not limited here.
[0028] S120, determining a first traffic detection path between the first node and the next-hop node according to the target SRv6 policy and the next-hop node.
[0029] The first traffic detection path can include the first node, the next-hop node, and at least one second node between the first node and the next-hop node, and the second node is a loose node not defined in the target SRv6 policy. In this embodiment, the loose node supports flow detection technology.
[0030] In an example, when determining the first traffic detection path between the first node and the next-hop node, the first node can calculate the first traffic detection path between the first node and the next-hop node according to a preconfigured topology routing rule, and then send a data traffic statistics message, such as a first traffic detection packet in S130, hop by hop based on the first traffic detection path, to achieve the purpose of flow statistics of data traffic information of each node on the first traffic detection path.
[0031] S130, sending a first traffic detection packet to the next-hop node through the first traffic detection path.
[0032] The first flow detection message carries or includes the data flow information of the first node, and is used to detect the data flow information of each second node on the target SRv6 policy on the first flow detection path.
[0033] For example, assuming that the first flow detection path is first node→node S1→node S2→node S3→next hop node, and nodes S1, S2 and S3 are loose nodes, after the first node sends the first flow detection message to the next hop node through the first flow detection path, when node S1 receives the first flow detection message, it can add or write the detected data flow information of the node to the first flow detection message, and then continue to send the first flow detection message to the next hop node through the first flow detection path. This process is repeated until the next hop node, which is the terminal node or destination node on the first flow detection path, receives the first flow detection message. The first flow detection message can include the data flow information of the first node, the data flow information of node S1, the data flow information of node S2 and the data flow information of node S3. Thus, the data flow detection of the loose nodes on the first flow detection path can be realized, which can be used for subsequent global path optimization and the like.
[0034] In an example, the first flow detection message can further include the identification information of the target SRv6 policy, the node address information of each node on the first flow detection path, and the like.
[0035] In this embodiment, for any first node in the mandatory nodes defined in the target SRv6 policy, the first flow detection path between the first node and the next hop node can be determined according to the target SRv6 policy and the information of the next hop node of the first node, and the first flow detection message is sent to the next hop node through the first flow detection path, so as to realize the flow detection of the loose nodes not defined in the target SRv6 policy.
[0036] In some embodiments, the first node can obtain the information of the target SRv6 policy and the next hop node in various ways in S110. For example, the first node can obtain the target SRv6 policy pre-configured or stored in the local memory, and determine the information of the next hop mandatory node (i.e., the next hop node) of the first node in the target SRv6 policy according to the information of the first node.
[0037] For example, the first node can further obtain the target SRv6 policy and the information of the next-hop node from a network management device. The network management device can be a core control device or a core management device of the multiple mandatory nodes defined in the target SRv6 policy, and can be configured to send control information to the multiple mandatory nodes, receive traffic detection information reported by the multiple mandatory nodes, and perform global routing planning.
[0038] Based on this, for the case that the first node obtains the target SRv6 policy and the information of the next-hop node from the network management device, the implementation manner can include but is not limited to S111-S112 shown in FIG. 2, and the content is as follows.
[0039] S111, receiving a first message from a network management device.
[0040] S112, determining the target SRv6 policy and the information of the next-hop node according to the first message.
[0041] The first message is used to indicate to start traffic detection on the second node corresponding to the target SRv6 policy. In this embodiment, as an implementation manner, the first message can include but is not limited to at least one of 11)-13).
[0042] 11) first indication information, used to indicate to start traffic detection on the second node corresponding to the target SRv6 policy.
[0043] 12) first identification, used to identify the target SRv6 policy.
[0044] 13) second identification, used to identify the next-hop mandatory node of the first node.
[0045] When the first node determines the target SRv6 policy and the information of the next-hop node according to the first message, one or more of the foregoing 11)-13) can be determined.
[0046] For example, assuming that the first message only includes the first indication information, the first node can determine a pre-configured or stored SRv6 policy as the target SRv6 policy, and determine the information of the next-hop mandatory node of the first node in the target SRv6 policy as the information of the next-hop node.
[0047] In an implementation manner, if multiple SRv6 policies are pre-configured or stored in the first node, an SRv6 policy in an up (UP) state among the multiple SRv6 policies can be determined as the target SRv6 policy.
[0048] For example, if the first information only includes the first identifier, the first node can determine the information of the next hop node according to the target SRv6 policy identified by the first identifier.
[0049] For example, if the first information only includes the second identifier, the first node can determine the target SRv6 policy as a pre-configured specific SRv6 policy including a detection path corresponding to the first node and the next hop node, wherein the specific SRv6 policy includes or defines the first node and the next hop node.
[0050] Of course, for the case that the first message includes two or three of the above 11)-13), the first node determines the target SRv6 policy and the information of the next hop node in a manner similar to the above, which will not be repeated here.
[0051] In some embodiments, if none of 11)-13) is included in the first message, the first node can determine a pre-configured or stored SRv6 policy as the target SRv6 policy, and determine the information of the next hop node as the information of the next hop node through which the first node must pass in the target SRv6 policy.
[0052] In some embodiments, for the case that the first node receives the first message from the network management device in S111, the network management device can send the first message to each of the nodes defined in the target SRv6 policy to instruct each of the nodes to start traffic detection on the second node corresponding to the target SRv6 policy, i.e., to detect data traffic information of the second node, in the case that it is determined to start traffic detection on the second node corresponding to the target SRv6 policy, wherein the first node is any one of the nodes defined in the target SRv6 policy.
[0053] In an example, the first message for instructing to start traffic detection on the second node corresponding to the target SRv6 policy can include: the first message for instructing the first node to determine a first traffic detection path between the first node and a next hop node, and to detect data traffic information of each of the second nodes on the target SRv6 policy on the first traffic detection path through a first traffic detection packet, wherein the first traffic detection path is a detection path between the first node and the next hop node, and the next hop node is a next hop node through which the first node must pass in the target SRv6 policy.
[0054] In some embodiments, the network management device determines to start traffic detection on the second node corresponding to the target SRv6 policy in various manners.
[0055] For example, assuming that a target traffic detection switch is deployed in the network management device, the network management device can determine to start traffic detection on the second node corresponding to the target SRv6 policy in response to the target traffic detection switch being turned on, where the target traffic detection switch being turned on indicates that data traffic information of the second node is detected. In an example, the target traffic detection switch can be a physical switch, control signaling or instructions, etc., which is not limited herein.
[0056] For another example, assuming that a target traffic detection switch is deployed in one or more of the nodes defined in the target SRv6 policy, when any of the nodes (e.g., the first node) with the traffic detection switch is turned on in response to the target traffic detection switch, a third message can be sent to the network management device to request traffic detection on the second node corresponding to the target SRv6 policy. Correspondingly, the network management device determines to start traffic detection on the second node corresponding to the target SRv6 policy according to the third message when the third message sent by any of the first nodes is received.
[0057] As an implementation manner, the network management device determines to start traffic detection on the second node corresponding to the target SRv6 policy according to the third message can include: determining the SRv6 policy corresponding to the identification information of the first node as the target SRv6 policy according to the identification information of the first node carried in the third message.
[0058] That is, the network management device preconfigures or stores one or more SRv6 policies, and when the network management device receives the third message, the SRv6 policy corresponding to the identification information of the first node can be selected from the preconfigured or stored one or more SRv6 policies as the target SRv6 policy.
[0059] The “SRv6 policy corresponding to the identification information of the first node” can be understood as that the identification information of the first node is included in the information of the nodes defined in the SRv6 policy, or there is an association relationship between the SRv6 policy and the identification information of the first node, etc., which is not limited herein.
[0060] In some embodiments, if the network management device determines that there are multiple SRv6 policies corresponding to the identification information of the first node, the target SRv6 policy is the SRv6 policy in an active state among the multiple SRv6 policies.
[0061] In some embodiments, for the case that the network device sends the first message to each of the nodes defined in the target SRv6 policy, for the nodes belonging to the same Segment Routing Header (SRH) path, considering that the last node in an SRH path does not have a next hop node, the network device can send the first message to all the nodes in the SRH path except the last node. Of course, if the network device sends the first message to each of the nodes in the SRH path, the last node in the SRH path can ignore the first message or report the data flow information of the node to the network device in the form of a second message, which is not limited herein.
[0062] In the foregoing, the first node is the starting node for data flow detection, and is used to perform the flow detection method described in S110-S130. In addition to being the starting node for data flow detection, the first node can also be the terminal node or destination node for data flow detection. For example, as shown in FIG. 3, when the first node is the terminal node or destination node, the process of data flow detection that can be implemented by the first node can include but is not limited to S310-S320.
[0063] S310, receiving a second flow detection packet.
[0064] The second flow detection packet is a detection packet sent by a previous hop node to the first node through a second flow detection path. The second flow detection path is a flow detection path between the previous hop node and the first node, which is determined by the previous hop node according to the target SRv6 policy and information of the first node. The previous hop node is the previous hop node of the first node on the target SRv6 policy.
[0065] S320, in a case that the first node is determined to be the destination address corresponding to the second flow detection packet according to the second flow detection packet, determining the data flow information of the previous hop node on the target SRv6 policy and the data flow information of each third node on the target SRv6 policy on the second flow detection path according to the second flow detection packet. The third node is a loose node not defined in the target SRv6 policy.
[0066] Exemplarily, assuming that the second traffic detection path determined by the previous hop node of the first node is: previous hop node→third node→first node, the data traffic information of the previous hop node and the data traffic information of the third node are included in the second traffic detection packet received by the first node, so that the traffic detection for the third node, which is a loose node, can be completed.
[0067] It is worth noting that the second traffic detection path, the second traffic detection packet, and the third node mentioned in the foregoing S310-S320 are similar to the first traffic detection path, the first traffic detection packet, and the second node involved in the foregoing S110-S130, and the only difference is that the second traffic detection path is determined by the previous hop node of the first node, and the second traffic detection packet is sent by the previous hop node to the first node through the second traffic detection path, for the data traffic information of the loose node between the previous hop node and the first node, while the first traffic detection path is determined by the first node, and the first traffic detection packet is sent by the first node to the next hop node through the first traffic detection path, for the data traffic information of the loose node between the first node and the next hop node, therefore, as to the second traffic detection path, the second traffic detection packet, and the third node mentioned in the foregoing S310-S320, reference can be made to the relevant description of the first traffic detection path, the first traffic detection packet, and the second node in the foregoing S110-S130, which will not be repeated here.
[0068] In some embodiments, after performing S320, the first node can further obtain the data traffic information of the first node on the target SRv6 policy, and send a second message to the network management device, the second message including the data traffic information of the first node on the target SRv6 policy, the data traffic information of the previous hop node on the target SRv6 policy, and the data traffic information of each third node on the target SRv6 policy on the second traffic detection path.
[0069] That is, as the terminal node or the destination node on the second traffic detection path, the first node can collect the data traffic information of each node detected by the second traffic detection packet and the data traffic information of the node itself, and then report the second signal to the network management device, so that the network management device can perform at least one of data traffic control and network path optimization according to the second message, thereby improving network performance and meeting the higher requirements of SRv6 on path selection of control traffic.
[0070] The foregoing data flow detection scheme provided by the embodiments of the present application, the network management device detects the data flow information of the mandatory node defined in the SRv6 policy and the data flow information of the loose node not defined in the SRv6 policy, so that the network management device can master the full path state based on the reported data flow information of the mandatory node and the data flow information of the loose node, and then optimize the path according to the real-time network state, realize more fine traffic engineering and path optimization, and meet the higher requirements proposed by the SRv6 for the path selection of the control flow.
[0071] The technical scheme provided by the present application can be applied to but not limited to the SRv6 scenario.
[0072] Based on the foregoing description of the flow detection method provided by the present application, for the convenience of understanding, the implementation process thereof will be further exemplarily described in combination with Example 1, and the content is as follows.
[0073] Example 1
[0074] As shown in FIG. 4, it is assumed that for a layer 3 virtual private network (L3 Virtual Private Network, L3VPN) or layer 2 Ethernet Virtual Private Network (L2EVPN), there is an SRv6 policy path, that is, node B→node C→node D→node E→node F, wherein node B, node D, and node F are mandatory nodes defined in the SRv6 policy, that is, nodes included in the SRH path defined in the SRv6 policy, and node C and node E are loose nodes not defined in the SRv6 policy, and node B, node C, node D, node E, and node F all support the flow detection technology. Then, the data flow detection process for the loose nodes in the SRv6 policy path is as follows.
[0075] 1) Node F sends a third message to the network management device in response to the target flow detection switch being turned on, to request to perform flow detection on the second node corresponding to the target SRv6 policy.
[0076] 2) After receiving the third message, the network management device finds the SRv6 policy including the identifier information of node F as the target SRv6 policy from all preconfigured SRv6 policies according to the identifier information of node F carried in the third message.
[0077] 3) The network management device determines the mandatory nodes defined in the target SRv6 policy, such as node B, node D, and node F, and determines the next hop node of each mandatory node, such as the next hop node of node B being node D and the next hop node of node D being node F.
[0078] 4) The network management device sends a first message to node B, node D and node F respectively, to indicate that the target traffic detection switch is turned on.
[0079] The first message can include at least one of first indication information, a first identifier and a second identifier. The first indication information is used to indicate that the traffic detection for the target SRv6 policy corresponding to the second node is turned on. The first identifier is used to identify the target SRv6 policy. The second identifier is used to identify the next hop node of the mandatory node.
[0080] 5) Taking node B as an example, after receiving the first message, node B determines the target SRv6 policy and the information of the next hop node of node B, i.e., the information of node D, according to the first message.
[0081] 6) Node B determines the traffic detection path 1 from node B to node D, i.e., node B→node C→node D shown in FIG. 4, according to the target SRv6 policy and the information of node D.
[0082] 7) Node B sends a traffic detection packet 1 to node D through the traffic detection path 1, wherein the traffic detection packet 1 includes the data traffic information of node B.
[0083] 8) Node C, after receiving the traffic detection packet 1 from node B, writes the data traffic information of node C into the traffic detection packet 1 and then sends the traffic detection packet 1.
[0084] 9) Node D, after receiving the traffic detection packet 1, determines the data traffic information of node B, the data traffic information of node C and the data traffic information of node D according to the traffic detection packet 1, if node D is determined to be a terminal node or a target node according to the destination address carried in the traffic detection packet 1.
[0085] 10) Node D sends a second message to the network management device, wherein the second message includes the data traffic information of node B, the data traffic information of node C and the data traffic information of node D.
[0086] For node D, similar to the traffic detection process between node B and node D, node D can determine the traffic detection path 2, i.e., node D→node E→node F shown in FIG. 4, after receiving the first message, and sends a traffic detection packet to node F through the traffic detection path 2, to realize the detection of the data traffic of each node on the traffic detection path 2. Node F reports the detected data traffic information of node D, the data traffic information of node E and the data traffic information of node F to the network management device in the form of a second message.
[0087] For the node F, after receiving the first message, since it is determined according to the first message that there is no next hop node to be passed through, the first message can be ignored, or the node F can also count the data flow information of the node and report the data flow information to the network management device.
[0088] In addition, as an implementation manner, the network management device can also not send the first message to the node F.
[0089] The foregoing 1)-10) can realize the data flow detection of the loose node on the SRv6 policy A path in the example 1, so that the network management device can master the whole path state according to the detected data flow information, and further optimize the path according to the real-time network state, realize more fine traffic engineering and path optimization, and meet the higher requirements of SRv6 on the path selection of control flow.
[0090] In addition, the foregoing process provided in the example 1 can refer to the related description in the foregoing method embodiment 100 and achieve the same or corresponding technical effects. To avoid repetition, it will not be repeated here. In addition, the example 1 can include more or fewer steps than the foregoing 1)-10), which is not limited here.
[0091] FIG. 5 shows a flowchart of a flow detection method 500 provided by the embodiments of the present application. The method can be executed by a network management device and can be executed by software and / or hardware installed in the network management device. As shown in FIG. 5, the method 500 can include but is not limited to the following steps.
[0092] S510, determining to start flow detection for a second node corresponding to a target SRv6 policy, the second node being a loose node not defined in the target SRv6 policy.
[0093] S520, sending a first message to each mandatory node defined in the target SRv6 policy.
[0094] For any first node in the each mandatory node, the first message is used to indicate that the first message is used to indicate to start flow detection for the second node corresponding to the target SRv6 policy.
[0095] In some embodiments, the first message is configured to instruct to start the traffic detection on the second node corresponding to the target SRv6 policy, including: the first message is configured to instruct the first node to determine a first traffic detection path between the first node and a next hop node, and to detect data traffic information of each second node on the target SRv6 policy on the first traffic detection path through a first traffic detection packet, the first traffic detection path being a detection path between the first node and the next hop node, and the next hop node being a next hop node of the first node in the target SRv6 policy.
[0096] In some embodiments, the first message includes at least one of: first indication information configured to instruct to start the traffic detection on the second node corresponding to the target SRv6 policy; a first identifier configured to identify the target SRv6 policy; and a second identifier configured to identify the next hop node of the mandatory node.
[0097] In some embodiments, the determining to start the traffic detection on the second node corresponding to the target SRv6 policy includes: in response to a target traffic detection switch being turned on, determining to start the traffic detection on the second node corresponding to the target SRv6 policy, the target traffic detection switch being turned on being configured to represent that the data traffic information of the second node is detected.
[0098] In some embodiments, the determining to start the traffic detection on the second node corresponding to the target SRv6 policy includes: receiving a third message sent by any first node of the mandatory nodes, the third message being configured to request to perform the traffic detection on the second node corresponding to the target SRv6 policy; and determining to start the traffic detection on the second node corresponding to the target SRv6 policy according to the third message.
[0099] In some embodiments, the determining to start the traffic detection on the second node corresponding to the target SRv6 policy according to the third message includes: determining, according to the identifier information of the first node carried in the third message, an SRv6 policy corresponding to the identifier information of the first node as the target SRv6 policy.
[0100] In some embodiments, in a case where the SRv6 policy corresponding to the identifier information of the first node is multiple, the target SRv6 policy is an SRv6 policy in an active state among the multiple SRv6 policies.
[0101] In some embodiments, the method further comprises: receiving a second message sent by each first node in each of the mandatory nodes; wherein the second message comprises data traffic information of the first node on the target SRv6 policy, data traffic information of a previous hop node of the first node on the target SRv6 policy, data traffic information of each third node on a second traffic detection path on the target SRv6 policy, the previous hop node being a previous hop mandatory node of the first node on the target SRv6 policy, the second traffic detection path being a traffic detection path between the previous hop node and the first node, and the third node being a loose node not defined in the target SRv6 policy.
[0102] In some embodiments, the method further comprises: performing at least one of control of data traffic and optimization of a network path according to the second message.
[0103] The foregoing implementation modes provided in the method embodiment 500 have the same or corresponding technical features as the foregoing method embodiment 100, and thus the implementation modes in the method embodiment 500 can refer to the related description in the foregoing method embodiment 100 and achieve the same or corresponding technical effects. To avoid repetition, the foregoing implementation modes are not described here again.
[0104] FIG. 6 shows a structural schematic diagram of a data traffic detection apparatus 600 provided by an embodiment of the present application. The apparatus 600 comprises: an acquisition module 610, configured to acquire information of a target SRv6 policy and a next hop node, wherein the next hop node is a next hop mandatory node of the first node in the target SRv6 policy; a processing module 610, configured to determine a first traffic detection path between the first node and the next hop node according to the target SRv6 policy and the information of the next hop node; and a sending module 630, configured to send a first traffic detection packet to the next hop node through the first traffic detection path, wherein the first traffic detection packet carries data traffic information of the first node, and the first traffic detection packet is used to detect data traffic information of each second node on the target SRv6 policy on the first traffic detection path, and the second node is a loose node not defined in the target SRv6 policy.
[0105] In some embodiments, the acquisition of the target SRv6 policy and the next hop node comprises: receiving a first message from a network management device; and determining the information of the target SRv6 policy and the next hop node according to the first message; wherein the first message is used to instruct to start traffic detection on a second node corresponding to the target SRv6 policy.
[0106] In some embodiments, the first message comprises at least one of the following: first indication information, used to indicate to turn on flow detection for a second node corresponding to the target SRv6 policy; a first identifier, used to identify the target SRv6 policy; and a second identifier, used to identify a next-hop-through node of the first node.
[0107] In some embodiments, the obtaining module 610 is further configured to: receive a second flow detection packet, the second flow detection packet being a detection packet sent by a previous-hop node to the first node through a second flow detection path, the second flow detection path being a flow detection path between the previous-hop node and the first node determined by the previous-hop node according to the target SRv6 policy and information of the first node, the previous-hop node being a previous-hop-through node of the first node on the target SRv6 policy; and in a case where it is determined according to the second flow detection packet that the first node is a destination address corresponding to the second flow detection packet, determine, according to the second flow detection packet, data flow information of the previous-hop node on the target SRv6 policy and data flow information of each third node on the target SRv6 policy on the second flow detection path, the third node being a loose node not defined in the target SRv6 policy.
[0108] In some embodiments, after the determining, according to the second flow detection packet, of the data flow information of the previous-hop node on the target SRv6 policy and the data flow information of each third node on the target SRv6 policy on the second flow detection path, the obtaining module 610 is further configured to: obtain data flow information of the first node on the target SRv6 policy; and the sending module 630 is further configured to: send, to a network management device, a second message comprising the data flow information of the first node on the target SRv6 policy, the data flow information of the previous-hop node on the target SRv6 policy, and the data flow information of each third node on the target SRv6 policy on the second flow detection path.
[0109] In some embodiments, the processing module 620 is further configured to: in response to a target flow detection switch being turned on, send, through the sending module 620, a third message to a network management device, the third message being used to request to perform flow detection of a loose node corresponding to the target SRv6 policy.
[0110] The apparatus 600 provided by the embodiments of the present application can perform the methods described in the foregoing method embodiments 100, and achieve the functions and beneficial effects of the methods described in the foregoing method embodiments, which will not be described here again.
[0111] Fig. 7 shows a structural schematic diagram of a data flow detection apparatus 700 provided by an embodiment of the present application, the apparatus 700 comprising: a processing module 710, configured to determine to start flow detection on a second node corresponding to a target SRv6 policy, the second node being a loose node not defined in the target SRv6 policy; and a sending module, configured to send a first message to each mandatory node defined in the target SRv6 policy; wherein the first message is used to indicate that the first message is used to indicate to start flow detection on the second node corresponding to the target SRv6 policy.
[0112] In some embodiments, the first message is used to indicate to start flow detection on the second node corresponding to the target SRv6 policy, comprising: the first message is used to indicate that the first node determines a first flow detection path between the first node and a next hop node, and detects data flow information of each second node on the target SRv6 policy through a first flow detection packet on the first flow detection path, the first flow detection path being a detection path between the first node and the next hop node, and the next hop node being a next hop mandatory node of the first node in the target SRv6 policy.
[0113] In some embodiments, the first message comprises at least one of the following: first indication information, used to indicate to start flow detection on the second node corresponding to the target SRv6 policy; a first identifier, used to identify the target SRv6 policy; and a second identifier, used to identify a next hop node of the mandatory node.
[0114] In some embodiments, the determination to start flow detection on the second node corresponding to the target SRv6 policy comprises: in response to a target flow detection switch being turned on, determining to start flow detection on the second node corresponding to the target SRv6 policy, the target flow detection switch being turned on being used to represent that data flow information of the second node is detected.
[0115] In some embodiments, the determination to start flow detection on the second node corresponding to the target SRv6 policy comprises: receiving a third message sent by any first node of the mandatory nodes, the third message being used to request to perform flow detection on the second node corresponding to the target SRv6 policy; and determining to start flow detection on the second node corresponding to the target SRv6 policy according to the third message.
[0116] In some embodiments, the determination to start flow detection on the second node corresponding to the target SRv6 policy according to the third message comprises: determining, according to identifier information of the first node carried in the third message, an SRv6 policy corresponding to the identifier information of the first node as the target SRv6 policy.
[0117] In some embodiments, in a case where a plurality of SRv6 policies correspond to the identification information of the first node, the target SRv6 policy is an SRv6 policy in an active state among the plurality of SRv6 policies.
[0118] In some embodiments, the apparatus 700 further includes a receiving module configured to receive a second message sent by each first node of the nodes; wherein the second message includes data flow information of the first node on the target SRv6 policy, data flow information of a previous hop node of the first node on the target SRv6 policy, data flow information of each third node on a second flow detection path on the target SRv6 policy, the previous hop node being a previous hop node of the first node on the target SRv6 policy, the second flow detection path being a flow detection path between the previous hop node and the first node, and the third node being a loose node not defined in the target SRv6 policy.
[0119] In some embodiments, the processing module 710 is further configured to perform at least one of data flow control and network path optimization according to the second message.
[0120] The apparatus 700 provided by the embodiments of the present application can perform the methods described in the foregoing method embodiments 500, and achieve the functions and advantages of the methods described in the foregoing method embodiments, which will not be described here again.
[0121] FIG. 8 shows a hardware structure schematic diagram of an electronic device according to an embodiment of the present application. Referring to the figure, at the hardware level, the electronic device includes a processor, and can further include 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 other services.
[0122] The processor, the network interface and the memory can be connected with each other through an internal bus, which can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus or the like. The bus can be divided into an address bus, a data bus, a control bus and the like. For the convenience of representation, only one bidirectional arrow is used in the figure, but it does not mean that there is only one bus or only one type of bus.
[0123] The memory is used for storing programs. The programs can include program codes including computer operation instructions. The memory can include an internal memory and a non-volatile memory, and provide instructions and data for the processor.
[0124] The processor reads the corresponding computer programs from the non-volatile memory into the internal memory and then runs, and forms the device for positioning the designated user at a logical level. The processor executes the programs stored in the memory, and is used for executing the methods disclosed in the embodiments shown in FIGS. 1-5 and realizing the functions and beneficial effects of the methods described in the foregoing method embodiments, which will not be described herein again.
[0125] The method disclosed in the embodiments of the present application as shown in FIG. 1-5 can be applied to a processor or implemented by the processor. The processor can be an integrated circuit chip having a processing capability of signals. In the implementation process, each step of the method can be completed by integrated logic circuits in the hardware of the processor or instructions in the form of software. The processor 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 embodiments of 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 embodiments of the present application can be directly embodied as a hardware coding processor for execution, or a combination of hardware and software modules in the coding processor for execution. The software module can be located in 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 in the memory is read by the processor, and the hardware thereof is combined to complete the steps of the method.
[0126] The electronic device can also perform the methods described in the foregoing method embodiments, and achieve the functions and beneficial effects of the methods described in the foregoing method embodiments, which will not be repeated here.
[0127] Of course, in addition to the software implementation, the electronic device of the present application does not exclude other implementation manners, 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 a logic device.
[0128] The embodiments of the present application also propose a computer readable storage medium storing one or more programs, which, when executed by an electronic device including a plurality of application programs, cause the electronic device to perform the method disclosed in the embodiments of FIG. 1-5 and achieve the functions and beneficial effects of the methods described in the foregoing method embodiments, which will not be repeated here.
[0129] The computer readable storage medium includes a non-transitory and transitory, removable and non-removable medium and can be implemented by any method or technology for information storage. 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 a computing device. According to the definition herein, computer readable storage media does not include transitory computer readable media, such as modulated data signals and carrier waves.
[0130] The embodiments of the present application also provide a computer program product, which comprises a computer program stored on a non-transitory computer readable storage medium, and the computer program comprises program instructions, when the program instructions are executed by a computer, the following processes are implemented: the method disclosed in the embodiments of FIG. 1-5 and the functions and beneficial effects of the methods described in the foregoing method embodiments, which are not described here again.
[0131] In summary, the above only describes the preferred embodiments of the present application, and is not 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 shall be included in the protection scope of the present application.
[0132] The system, device, module or unit disclosed 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 may, for example, be 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.
[0133] It is also to be noted that the terms "comprising", "including", and any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises a... " does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the recited element.
[0134] The various embodiments described in this specification are presented as examples. Each example is provided by way of explanation of the overall subject matter and is not a limitation on the overall subject matter. Changes in, or replacements to, parts of certain examples are covered by this specification. The various embodiments described in this specification are presented as examples. Each example is provided by way of explanation of the overall subject matter and is not a limitation on the overall subject matter. Changes in, or replacements to, parts of certain examples are covered by this specification.
Claims
1. A traffic detection method applied to a first node, wherein the first node is a mandatory node defined in a target SRv6 policy, the method comprising: Obtain information about the target SRv6 policy and the next-hop node, wherein the next-hop node is the node that the first node must pass through in the target SRv6 policy; Determine the first traffic detection path between the first node and the next-hop node based on the target SRv6 policy and the next-hop node; A first traffic detection message is sent to the next-hop node through the first traffic detection path. The first traffic detection message carries the data traffic information of the first node. The first traffic detection message is used to detect the data traffic information of each second node on the first traffic detection path in the target SRv6 policy. The second node is a loose node not defined in the target SRv6 policy.
2. The method as described in claim 1, wherein, The step of obtaining the target SRv6 policy and the next-hop node includes: Receive the first message from the network management device; The target SRv6 strategy and the information of the next-hop node are determined based on the first message; The first message is used to instruct the activation of traffic detection for the second node corresponding to the target SRv6 policy.
3. The method as described in claim 2, wherein, The first message includes at least one of the following: The first instruction information is used to instruct the activation of traffic detection for the second node corresponding to the target SRv6 policy; A first identifier is used to identify the target SRv6 strategy; The second identifier is used to identify the next hop node that the first node must pass through.
4. The method of claim 1, wherein, The method further includes: Receive a second traffic detection message. The second traffic detection message is a detection message sent by the previous hop node to the first node through a second traffic detection path. The second traffic detection path is the traffic detection path between the previous hop node and the first node. The previous hop node is the node that the first node must pass through on the previous hop in the target SRv6 policy. If the first node is determined to be the destination address corresponding to the second traffic detection message based on the second traffic detection message, the data traffic information of the previous hop node on the target SRv6 policy and the data traffic information of each third node on the second traffic detection path on the target SRv6 policy are determined based on the second traffic detection message, wherein the third node is a loose node not defined in the target SRv6 policy.
5. The method of claim 4, wherein, After determining the data traffic information of the previous hop node on the target SRv6 policy and the data traffic information of each third node on the second traffic detection path on the target SRv6 policy based on the second traffic detection message, the method further includes: Obtain the data traffic information of the first node on the target SRv6 policy; Send a second message to the network management device. The second message includes the data traffic information of the first node on the target SRv6 policy, the data traffic information of the previous hop node on the target SRv6 policy, and the data traffic information of each third node on the second traffic detection path on the target SRv6 policy.
6. The method of claim 1, wherein, The method further includes: In response to the target traffic detection switch being turned on, a third message is sent to the network management device. The third message is used to request data traffic detection of the loose nodes corresponding to the target SRv6 policy.
7. A traffic detection method applied to a network management device, the method comprising: Determine to enable data traffic detection for the second node corresponding to the target SRv6 policy, where the second node is a loose node not defined in the target SRv6 policy; Send the first message to each of the mandatory nodes defined in the target SRv6 strategy; Specifically, for any first node among the required nodes, the first message is used to instruct the activation of traffic detection for the second node corresponding to the target SRv6 policy.
8. The method of claim 7, wherein, The first message is used to instruct the activation of traffic detection for the second node corresponding to the target SRv6 policy, including: the first message instructs the first node to determine a first traffic detection path between itself and the next-hop node, and to detect the data traffic information of each second node on the first traffic detection path on the target SRv6 policy through a first traffic detection message, wherein the first traffic detection path is the detection path between the first node and the next-hop node, and the next-hop node is the next-hop mandatory node of the first node in the target SRv6 policy.
9. The method of claim 8, wherein, The first message includes at least one of the following: The first instruction information is used to enable traffic detection for the second node corresponding to the target SRv6 policy; A first identifier is used to identify the target SRv6 strategy; The second identifier is used to identify the next hop node of the required node.
10. The method of claim 8, wherein, The step of determining to enable data traffic detection for the second node corresponding to the target SRv6 policy includes: In response to the target traffic detection switch being turned on, it is determined that data traffic detection for the second node corresponding to the target SRv6 policy will be enabled. The target traffic detection switch being turned on is used to indicate that data traffic information of the second node is being detected.
11. The method of claim 8, wherein, The step of determining to enable data traffic detection for the second node corresponding to the target SRv6 policy includes: Receive a third message sent by any first node among the required nodes, the third message being used to request data traffic detection for the second node corresponding to the target SRv6 policy; Based on the third message, it is determined that data traffic detection will be initiated for the second node corresponding to the target SRv6 strategy.
12. The method of claim 11, wherein, The step of determining to enable data traffic detection for the second node corresponding to the target SRv6 policy based on the third message includes: Based on the identification information of the first node carried in the third message, the SRv6 policy corresponding to the identification information of the first node is determined as the target SRv6 policy.
13. The method of claim 12, wherein, When there are multiple SRv6 policies corresponding to the identification information of the first node, the target SRv6 policy is the active SRv6 policy among the multiple SRv6 policies.
14. The method according to any one of claims 7-13, wherein, The method further includes: Receive the second message sent by each of the first nodes in each of the required nodes; The second message includes data traffic information of the first node on the target SRv6 policy, data traffic information of the previous hop node of the first node on the target SRv6 policy, and data traffic information of each third node on the second traffic detection path on the target SRv6 policy. The previous hop node is a necessary node for the first node to pass through on the target SRv6 policy. The second traffic detection path is a traffic detection path between the previous hop node and the first node. The third node is a loose node not defined in the target SRv6 policy.
15. The method of claim 14, wherein, The method further includes: Based on the second message, at least one of the following is performed: data traffic control or network path optimization.
16. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the method as claimed in any one of claims 1-15.
17. A computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the steps of the method as described in any one of claims 1-15.
Citation Information
Patent Citations
SRv6-based road-associated network measurement method
CN113328915A
Tunnel quality detection method based on SRv6 and related device
CN115695246A
Service measurement method of SRv6 network and SRv6 network
CN117478564A
Packet encapsulation method, packet forwarding method, announcement method, electronic device, and storage medium
US20230126801A1
Message processing method and device, and computer-readable storage medium
WO2019080927A1