Traffic flow detection method, device, medium and related equipment
By adding a target header to the service flow packets, the problem of inconsistent IPv4 and IPv6 packet header formats is solved, achieving uniformity and flexibility in service flow detection and supporting scheduling of multiple SLA types.
Patent Information
- Application Number
- CN202211122401.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-15
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2042-09-15
AI Technical Summary
Existing service flow detection methods suffer from poor uniformity due to the inconsistency in IPv4 and IPv6 packet header formats, making it difficult to achieve flexible flow-following detection and fine-grained scheduling of multiple SLA types.
By receiving configuration information, a target header is added to the packets of the target service flow to form a second target packet, which is then transmitted in the network. The target header is used for detection, thereby unifying the packet detection method for different Internet Protocol versions.
It improves the uniformity of service flow detection methods, avoids performance degradation, realizes IPv4 flow detection, and supports flexible scheduling of multiple SLA types.
Smart Images

Figure CN117749669B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a service flow detection method, apparatus, medium and related equipment. Background Technology
[0002] In network communication, different users have different Service Level Agreement (SLA) requirements. Services with different SLA requirements should be planned to match these requirements, and a service flow can be understood as a series of messages sent continuously over a period of time. Typically, flow-based inspection is used to directly inspect the quality of the service flow using the messages themselves.
[0003] However, due to the inconsistency in the header formats of Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6), different Internet Protocol versions (such as IPv4 and IPv6) currently have their own set of flow detection methods, resulting in poor uniformity of service flow detection methods. Summary of the Invention
[0004] This application provides a service flow detection method, apparatus, medium, and related equipment, which improves the uniformity of service flow detection methods.
[0005] To achieve the above objectives, in a first aspect, embodiments of this application provide a service flow detection method, applied to a first device, wherein the first device is the first node device in a packet forwarding path, comprising:
[0006] Receive configuration information, which is used to indicate relevant information for detecting service flows;
[0007] According to the configuration information, a target header is added to the first target message of the target service flow to obtain a second target message, wherein the target header is a header determined according to the configuration information;
[0008] The second target message is sent to a second device, which is either an intermediate node device or a tail node device in the message forwarding path.
[0009] Secondly, embodiments of this application provide a service flow detection method, applied to a second device, wherein the second device is an intermediate node device or a tail node device in a packet forwarding path, including:
[0010] The system receives a third target message sent by a third device, wherein the third device is a first node device or an intermediate node device in the message forwarding path, and the third target message includes a first target message of the target service flow and a target message header; the target message header is a message header determined based on configuration information, or the target message header is a message header obtained by updating the message header determined based on the configuration information; wherein the configuration information is used to indicate relevant information for detecting the service flow;
[0011] The target service flow is detected based on the target message header.
[0012] Thirdly, embodiments of this application provide a service flow detection device, comprising:
[0013] The first receiving module is used to receive configuration information, which is used to indicate relevant information for detecting the service flow;
[0014] The first determining module is used to add a target header to the first target message of the target service flow according to the configuration information to obtain a second target message, wherein the target header is a header determined according to the configuration information;
[0015] The first sending module is used to send the second target message to the second device, which is an intermediate node device or a tail node device in the message forwarding path.
[0016] Fourthly, embodiments of this application provide a service flow detection device, comprising:
[0017] The second receiving module is used to receive a third target message sent by a third device, wherein the third device is a first node device or an intermediate node device in the message forwarding path, and the third target message includes a first target message of the target service flow and a target message header; the target message header is a message header determined based on configuration information, or the target message header is a message header obtained by updating the message header determined based on the configuration information; wherein the configuration information is used to indicate relevant information for detecting the service flow;
[0018] The second determining module is used to detect the target service flow based on the target message header.
[0019] Fifthly, embodiments of this application provide an electronic device, including a processor, a memory, and a computer program stored in the memory and executable on the processor. When executed by the processor, the computer program implements the steps in the traffic flow detection method as described in the first aspect, or the steps in the traffic flow detection method as described in the second aspect.
[0020] In a sixth aspect, embodiments of this application provide a readable storage medium storing a program that, when executed by a processor, implements the steps in the service flow detection method as described in the first aspect, or the steps in the service flow detection method as described in the second aspect.
[0021] In this embodiment, configuration information indicating relevant information for detecting service flows is received. Based on the configuration information, a target header is added to the first target packet of the target service flow to obtain a second target packet, which is then sent to the second device. This allows for the unified addition of target headers to packets of different Internet Protocol versions, and service flow detection is performed based on these headers. This unifies the flow detection methods for packets of different Internet Protocol versions, thereby improving the uniformity of the service flow detection method. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings are described below. Obviously, the following drawings are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the listed drawings without creative effort.
[0023] Figure 1 This is a schematic diagram of the structure of a network system to which the embodiments of this application can be applied;
[0024] Figure 2 This is one of the flowcharts illustrating the service flow detection method provided in the embodiments of this application;
[0025] Figure 3 This is one of the structural schematic diagrams of the second target message provided in the embodiments of this application;
[0026] Figure 4 This is a second schematic diagram of the structure of the second target message provided in the embodiments of this application;
[0027] Figure 5 This is a second schematic flowchart of the service flow detection method provided in the embodiments of this application;
[0028] Figure 6 This is the third flowchart illustrating the service flow detection method provided in this application embodiment;
[0029] Figure 7 This is one of the structural schematic diagrams of the service flow detection device provided in the embodiments of this application;
[0030] Figure 8 This is a second schematic diagram of the business flow detection device provided in the embodiments of this application;
[0031] Figure 9This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0032] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0033] The terms "first," "second," etc., used in the embodiments of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or devices. Additionally, the use of "and / or" in this application indicates at least one of the connected objects, such as A and / or B and / or C, representing seven possibilities: including A alone, B alone, C alone, and the presence of both A and B, both B and C, both A and C, and the presence of A, B, and C.
[0034] In the embodiments of this application, the terms "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the terms "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.
[0035] See Figure 1 , Figure 1 This is a schematic diagram of the structure of a network system to which the embodiments of this application can be applied, such as... Figure 1 As shown, the system includes a head node device 11, intermediate node devices 12, a tail node device 13, and a control device 14. The intermediate node device 12 includes one or more devices, where n is a positive integer greater than 1. Messages are forwarded along the direction of the head node device 11, intermediate node devices 12, and tail node devices 13; that is, the head node device 11, intermediate node devices 12, and tail node devices 13 form a message forwarding path. The head node device 11, intermediate node devices 12, and tail node devices 13 can communicate with each other. The control device 14 can communicate with the head node device 11, intermediate node devices 12, and tail node devices 13 respectively.
[0036] The following describes the service flow detection method provided in the embodiments of this application.
[0037] See Figure 2 , Figure 2 This is one of the flowcharts of the service flow detection method provided in the embodiments of this application. Figure 2 The service flow detection method shown can be executed by the first device, which is the first node device 11 in the packet forwarding path.
[0038] like Figure 2 As shown, the service flow detection method may include the following steps:
[0039] Step 101: Receive configuration information, which is used to indicate relevant information for detecting service flows;
[0040] In practice, the control device 14 can send configuration information through the Network Configuration Protocol (NETCONF), or other devices can send configuration information to the first device.
[0041] A service flow corresponds to multiple consecutive messages. For example, all messages corresponding to a video constitute a service flow. Each message can carry at most one data packet, or it can carry no data packet. See also Figure 3 Each message consists of two parts: the original business message header and the valid data.
[0042] The detection of service flows includes, but is not limited to, detecting the latency and packet loss of the corresponding messages. Latency refers to the time delay of a message in the message forwarding path, and packet loss refers to whether, if the message carries data packets, those data packets are lost in the message forwarding path.
[0043] Step 102: According to the configuration information, add a target header to the first target packet of the target service flow to obtain a second target packet. The target header is a header determined according to the configuration information.
[0044] As mentioned above, the target service flow corresponds to multiple consecutive first target messages, each of which includes the original service message header and valid data. For example... Figure 3 As shown, after adding a target header to the first target message, a second target message is obtained, and the target header is used to detect the service flow.
[0045] The added target header does not interfere with the original business header; that is, adding the target header does not modify the original business header. The added target header also does not interfere with the valid data; that is, adding the target header does not affect the valid data. In other words, the target header is added to the outer layer of the first target packet. The original business header and valid data of the first target packet are considered inner layers relative to the target header. In other words, the original business header and valid data (payload) are encapsulated inside the packet, while the content related to business flow detection is encapsulated within the outer target header.
[0046] The added outer header, i.e., the target header, has good scalability and can support multiple functions (such as detecting latency and packet loss in the service flow). In this embodiment, adding an outer target header saves signaling overhead compared to adding a Destination Options Header (DOH) or a Hop by Hop (HBH) scheme, and has less impact on the Maximum Transmission Unit (MTU) of packet forwarding.
[0047] Furthermore, in this embodiment, by adding an outer target header, the original service header is not modified, and the original service header and valid data are not affected, thus avoiding related impacts.
[0048] It should be noted that for each of the multiple consecutive first target messages in the target service flow, a target message header is added to obtain multiple second target messages.
[0049] Optionally, the first target message includes at least one of IPv4 messages and IPv6 messages.
[0050] Optionally, the target packet header is an Internet Protocol version 6 (IPv6) packet header or an IPv6 segment routing IPv6 best efficiency (SRv6BE) tunnel encapsulation header.
[0051] Step 103: Send the second target message to the second device, where the second device is an intermediate node device or a tail node device in the message forwarding path.
[0052] In practice, the first device sequentially sends multiple consecutive second target packets corresponding to the target service flow, so that the second device can detect the target service flow based on the target packet header.
[0053] In native IP packet forwarding scenarios, packets lack an additional tunnel header. Therefore, on one hand, the IPv4 and IPv6 service packet header formats are inconsistent. Using the original service packet header for service flow inspection makes it difficult to unify the flow detection methods for different Internet Protocol versions (e.g., IPv4 and IPv6), hindering the flexible application of flow detection. On the other hand, the native IP service packet format is limited by current standards and the packet format itself, especially the IPv4 header. IPv4-related standards have ceased evolution, and the reserved bits in the existing IPv4 header are insufficient to meet the bit requirements of flow detection. Therefore, using the original service packet header for service flow inspection makes native IPv4 flow detection difficult to implement. If an option header is added for service flow inspection (i.e., flow detection), due to the current forwarding model of forwarding devices, flow detection packets need to be sent to the CPU for processing, which significantly reduces device performance. This performance degradation increases dramatically with the increase in flow detection services in the network. In summary, it is difficult to achieve flow detection based on bare IP service flows under the existing technology. The solutions provided by the existing technology are not conducive to the fine-grained and flexible scheduling of service flows, the implementation of multiple types of SLAs, and do not utilize the implementation of IPv4 flow detection, nor can they unify the flow detection methods of different Internet Protocol versions (such as IPv4 and IPv6).
[0054] In this embodiment, by receiving configuration information indicating relevant information for detecting service flows, a target header is added to the first target packet of the target service flow according to the configuration information to obtain a second target packet, which is then sent to the second device. This allows for the unified addition of target headers to packets of different Internet Protocol versions, and service flow detection is performed based on these headers. This unifies the flow detection methods for packets of different Internet Protocol versions, thereby improving the uniformity of the service flow detection method.
[0055] Furthermore, in this embodiment of the application, by adding a target header to the first target packet of the target service flow to obtain a second target packet, and sending the second target packet to the second device, the service flow can be detected by adding the target header without using the reserved bits of the original IPv4 service packet header, thereby enabling flow detection of bare IPv4.
[0056] Furthermore, the solution provided in the embodiments of this application will not reduce the performance of the network forwarding device.
[0057] Optionally, the configuration information includes at least one of the following:
[0058] The first information is used to indicate whether the first target message is a flow-following detection message or a non-flow-following detection message;
[0059] The second information is used to indicate whether the detection mode for the target service flow is an end-to-end detection mode or a point-by-point detection mode.
[0060] The third information is used to indicate the duration of the detection period for detecting the target service flow;
[0061] The fourth information is used to indicate the category of the detection period to which the second target message belongs;
[0062] The fifth piece of information is used to indicate whether to perform latency detection on the target service flow within the target detection period.
[0063] In practice, the first target message being a flow-following detection message means that the first target message needs to be detected by the flow (that is, the first target message needs to be detected, or the target service flow needs to be detected).
[0064] The first target message being a non-flow-following detection message means that the first target message does not need to be flow-following detected (that is, the first target message does not need to be detected, or the target service flow does not need to be detected).
[0065] The detection mode for the target service flow is the end-to-end detection mode, which means that the packet is forwarded according to the packet forwarding path, and the detection result of the service flow is reported when it reaches the tail node device.
[0066] The detection mode for the target service flow is the point-to-point detection mode, which means that the message is forwarded according to the message forwarding path, and each intermediate node device and tail node device must report the current detection result of the service flow.
[0067] The detection period is a time length, for example, 20 seconds. As mentioned earlier, the target service flow corresponds to multiple second target packets. The first device sequentially sends these multiple second target packets to detect the service flow, using the detection period as the detection scale. If the detection period is 20 seconds, it means that the target service flow is detected based on the multiple second target packets sent by the first device within each 20-second interval.
[0068] A single inspection of a target service flow can include multiple inspection periods, with multiple secondary target packets corresponding to the target service flow being assigned to different inspection periods. The category of the inspection period to which a secondary target packet belongs indicates which inspection period the secondary target packet belongs to; for example, a secondary target packet belongs to the second inspection period.
[0069] The fourth information can be used to identify the second target messages in different detection periods, making it easier to confirm packet loss within each detection period. For example, if the fourth information in the first detection period is represented by the character "1", then the fourth information of all 10 second target messages in the first detection period will be represented by the character "1". If the fourth information in the second detection period is represented by the character "0", then the fourth information of all 10 second target messages in the second detection period will be represented by the character "0". In this way, by alternating between the characters "1" and "0", second target messages in different detection periods can be distinguished, and the tail node device can directly determine the packet loss situation by counting the number of second target messages with this packet loss identifier (referring to the fourth information).
[0070] If packet loss detection of the target service flow is required, a second device (either an intermediate or tail node device in the packet forwarding path) can send the detection results of the target service flow to the control device. The control device then counts the packet loss of multiple second target packets within each detection period (e.g., every 20 seconds). For example, in the first 20 seconds, the first device sends 5 second target packets, each carrying data packets (i.e., a total of 5 data packets). The intermediate or tail node device can then count whether these 5 second target packets were lost in the packet forwarding path (or, in other words, whether these 5 data packets were lost). The counting method for the nth 20 seconds is the same as that for the first 20 seconds.
[0071] For example, the tail node device counts the second target packets within the same detection period and compares the count values to determine packet loss. If, in the first detection period, the head node device sends 10 second target packets with identifier 1 (meaning the fourth information is represented as 1), and the tail node device receives 9 second target packets with identifier 1 and one second target packet with identifier 0 in the same period, this means that 10 - 9 = 1 second target packet was lost in the first detection period.
[0072] The target detection period can be any one, any number of, or all of the multiple detection periods corresponding to the target service flow. If the target detection period is all the detection periods corresponding to the target service flow, and it is necessary to detect the latency of the target service flow within the target detection period, the second device can statistically analyze the latency of multiple second target packets every 20 seconds. For example, if the first device sends 5 second target packets within the first 20 seconds, it can obtain the transmission time of any one of these 5 target packets and determine the latency based on the transmission time and the reception time of the packet at the second device.
[0073] Optionally, the step of adding a target header to the first target packet of the target service flow according to the configuration information to obtain the second target packet includes:
[0074] Based on the configuration information, determine the values of the fields in the target packet header, and obtain the target packet header;
[0075] Add a target header to the first target message of the target service flow to obtain the second target message.
[0076] In practical implementation, different characters can be used to represent configuration information, and these characters can be written into fields in the target packet header. For example, binary characters "0" and "1" can be used to represent different configuration information, and different configuration information can be determined based on different positions in the fields. For instance, in one field of the target packet header, "0" can indicate that the first target packet is a non-follow-the-flow detection packet, and "1" can also indicate that the first target packet is a non-follow-the-flow detection packet. In this way, the second device receiving the second target packet can determine whether to detect the target service flow and how to detect it based on the values of the fields in the target packet header.
[0077] Optionally, determining the value of a field in the target header based on the configuration information includes at least one of the following:
[0078] Based on the first information, determine the value of the first field in the target message header;
[0079] Based on the second information, determine the value of the second field in the target message header;
[0080] Based on the third information, determine the value of the third field in the target message header;
[0081] Based on the fourth information, determine the value of the fourth field in the target message header;
[0082] Based on the fifth information, determine the value of the fifth field in the target message header;
[0083] In the case where the fifth information indicates that delay detection is performed on the target service flow, the first device sends the transmission time information of the second target message to the control device.
[0084] When the target packet header is an IPv6 packet header or another type of packet header, the method for detecting raw IP service flows is the same as when the target packet header is an SRv6 BE tunnel encapsulation header, and the fields carrying configuration information in the target packet header are the same. For ease of explanation, the following will use an SRv6 BE tunnel encapsulation header as an example; the encapsulation scenario when the target packet header is an IPv6 packet header or another type of packet header can be compared.
[0085] For specific implementation details, please refer to [link / reference]. Figure 4The detailed fields of the target message header in the second target message provided in this application embodiment are as follows: Figure 4 As shown, the lowest two bits of the Traffic class field and the highest four bits of the Flow label field can be used as the first, second, fourth, and fifth fields, respectively, and the remaining two bits can be used as the third field.
[0086] For example, the lowest two bits of the Traffic class field are used as the flow detection flag (F) and flow detection mode bit (E), respectively. The F bit, with a value of "1" or "0", indicates a flow-detected message and a non-flow-detected message, respectively. The E bit, based on the detection mode, distinguishes between "end-to-end detection mode" and "point-to-point detection mode" by setting a bit to "1" or "0". The highest four bits of the Flowlabel field are used to mark the detection period (P), packet loss (L), and latency (D), respectively. The period bit requires 2 bits, and packet loss and latency each occupy 1 bit. Setting the L bit to "1" indicates the presence of data packets in the second target message; setting the L bit to "0" indicates that the detection period to which the second target message belongs is the first detection period. Setting the D bit to "1" indicates that latency detection of the target traffic flow is required. Only one second target message can have its D bit set to "1" within a detection period. Based on the latency of this second target message, the latency of the target traffic flow within that detection period is determined.
[0087] It should be noted that, Figure 4 This is just one example of the target message header format; the characters used to represent different meanings can be freely defined.
[0088] Optionally, the configuration information carries a first identifier, and the target service flow includes: a service flow determined according to the first identifier. Specifically, the configuration information may carry a first identifier, the first device determines the target service flow based on the first identifier, and adds a target header to the first target message of the target service flow according to the configuration information to obtain a second target message.
[0089] In this embodiment of the application, by using the configuration information to carry a first identifier to determine the target service flow, the target service flow can be detected in a targeted manner without having to detect all service flows, thereby saving signaling overhead and network resources.
[0090] Optionally, the configuration information may also include 5-tuple information. A 5-tuple is a communication term, typically referring to a set of five values: source IP address, source port, destination IP address, destination port, and transport layer protocol. By including 5-tuple information in the configuration information, the transmission path of the first destination packet can be indicated, etc.
[0091] See Figure 6This application also provides a service flow detection method, applied to a second device, which is an intermediate node device or a tail node device in a packet forwarding path, comprising:
[0092] Step 201: Receive a third target message sent by a third device, wherein the third device is a first node device or an intermediate node device in the message forwarding path, and the third target message includes a first target message of the target service flow and a target message header; the target message header is a message header determined based on configuration information, or the target message header is a message header obtained by updating the message header determined based on the configuration information; wherein the configuration information is used to indicate relevant information for detecting the service flow;
[0093] When the third device is the first node device in the packet forwarding path, the target packet header is the packet header determined based on the configuration information, and the second device is the first intermediate node device in the packet forwarding path.
[0094] When the third device is an intermediate node device in the packet forwarding path, the target packet header is the packet header obtained by updating the packet header determined based on the configuration information, and the second device is the second intermediate node device in the packet forwarding path or an intermediate node device after the second intermediate node device.
[0095] Step 202: Detect the target service flow based on the target message header.
[0096] In practice, the target service flow can be inspected based on the target message header, and the method for inspecting the target service flow can be determined.
[0097] Optionally, step 202 includes:
[0098] If the first target message is determined to be a flow-following detection message based on the value of the first field in the target message header, the target service flow is detected to obtain a first detection result;
[0099] Determine whether to send the first detection result to the control device.
[0100] In other words, if the first target message is determined to be a flow detection message based on the value of the first field in the target message header, each intermediate node device or tail node device will detect the target service flow based on the target message header and obtain a first detection result. It will then determine whether to send the first detection result to the control device.
[0101] The detection of the target service flow includes, but is not limited to, detecting packet loss and latency.
[0102] Optionally, the step of detecting the target service flow to obtain a first detection result includes:
[0103] Determine the category of the detection period described in the third target message to obtain a first sub-result, wherein the first detection result includes the first sub-result;
[0104] The step of determining whether to send the first detection result to the control device includes:
[0105] Determine whether to send the first sub-result to the control device;
[0106] Alternatively, based on the first sub-result, a second sub-result can be obtained, and it can be determined whether to send the second sub-result to the control device.
[0107] In specific implementation, if the intermediate node device or the tail node device detects that the third target message belongs to the first detection period, it can determine whether to directly send the third target message belonging to the first detection period to the control device; alternatively, based on the first sub-result, it can count the number of third target messages belonging to the nth detection period among the multiple received third target messages, where n is a positive integer, to obtain the packet loss situation of the nth detection period, and determine whether to send the second sub-result to the control device.
[0108] Optionally, the step of detecting the target service flow to obtain a first detection result includes:
[0109] Obtain the reception time information of the third target message, wherein the first detection result includes the reception time information;
[0110] The step of determining whether to send the first detection result to the control device includes:
[0111] Determine whether to send the reception time information of the third target message to the control device.
[0112] In specific implementation, if it is determined that latency detection of the target service flow needs to be performed based on the value of the fifth field in the target message header, it is then determined whether to send the reception time information of the third target message to the control device. If it is necessary to send it, the reception time information can be carried in other messages, such as an "upload message," and sent to the control device.
[0113] Optionally, when the second device is an intermediate node device in the message forwarding path, after determining whether to send the first detection result to the control device, the method further includes:
[0114] Multiple third target messages are sent to a fourth device, which is an intermediate node device or a tail node device in the message forwarding path.
[0115] Optionally, after determining whether to send the first detection result to the control device, the method further includes:
[0116] If the detection mode for the target service flow is determined to be point-by-point detection mode based on the value of the second field in the target message header, the first detection result is sent to the control device.
[0117] In specific implementation, when the second device is an intermediate node device in the packet forwarding path and the detection mode for the target service flow is determined to be point-to-point detection mode based on the value of the second field in the target packet header, each intermediate node device must report the first detection result to the control device. Specifically, the first detection result can be carried in other packets, such as "upload packet," and sent to the control device.
[0118] Optionally, when the second device is a tail node device in the message forwarding path, after determining whether to send the first detection result to the control device, the method further includes:
[0119] The first detection result is sent to the control device.
[0120] In practice, the tail node device detects the service flow and reports the first detection result to the control device. Specifically, the first detection result can be carried in other messages, such as an "upload message," and sent to the control device.
[0121] Optionally, after determining whether to send the first detection result to the control device, the method further includes:
[0122] Based on the third target message, the first target message is obtained;
[0123] The first target message is sent to a fourth device, which is the target node device of the target service flow.
[0124] For example, see Figure 5 On the head node device R1, based on the configuration information issued by the control device, when a target service flow is matched and requires flow-following detection, an SRv6 BE tunnel encapsulation header is added to the first target packet. The head node device sets the flag bit F in the target packet header to 1, sets the detection mode bit according to the mode definition (here, an example can be used where the E flag bit is 0 in end-to-end mode and 1 in point-to-point detection mode), and marks the detection period, packet loss, and delay measurement bits according to the configuration information, recording the timestamp at this time. Assuming the period P is 0-1, and using point-to-point detection mode, the encapsulation diagram of the first second target packet within a certain detection period is shown below. Figure 4As shown. The detailed identifiers of the L and D bits in all second target messages within this detection period are as follows: Figure 5 As shown. At intermediate node devices R3 and R4, if the F flag is detected as 1, the target service flow should be inspected to obtain the first inspection result. Based on this result, the data packets are colored, and latency-related timestamps are added. If the inspection mode is point-to-point inspection, the first inspection result is sent to the control device. At the tail node device R2, the first inspection result also needs to be sent. The target packet header encapsulated by the head node device R1 can be stripped to obtain the first target packet. Based on the five-tuple information carried in the configuration information, the first target packet can be forwarded to the target node device, completing the packet forwarding. The target node device is the device corresponding to the destination IP address in the five-tuple information. The control device will also obtain packet loss and latency information based on the statistical information sent by the intermediate node devices and / or the tail node devices, realizing flow-based inspection of the service flow.
[0125] It should be noted that this embodiment is used as a reference for... Figure 2 The method embodiment corresponds to the embodiment of the second device; therefore, please refer to the embodiment of the second device. Figure 2 The relevant descriptions in the method embodiments can achieve the same beneficial effects. To avoid repetition, they will not be repeated here.
[0126] See Figure 7 This application embodiment also provides a service flow detection device 300, including:
[0127] The first receiving module 301 is used to receive configuration information, which is used to indicate relevant information for detecting service flows;
[0128] The first determining module 302 is used to add a target header to the first target message of the target service flow according to the configuration information to obtain a second target message, wherein the target header is a header determined according to the configuration information;
[0129] The first sending module 303 is used to send the second target message to the second device, which is an intermediate node device or a tail node device in the message forwarding path.
[0130] Optionally, the configuration information includes at least one of the following:
[0131] The first information is used to indicate whether the first target message is a flow-following detection message or a non-flow-following detection message;
[0132] The second information is used to indicate whether the detection mode for the target service flow is an end-to-end detection mode or a point-by-point detection mode.
[0133] The third information is used to indicate the duration of the detection period for detecting the target service flow;
[0134] The fourth information is used to indicate the category of the detection period to which the second target message belongs;
[0135] The fifth piece of information is used to indicate whether to perform latency detection on the target service flow within the target detection period.
[0136] Optionally, the first determining module 302 includes:
[0137] Based on the configuration information, determine the values of the fields in the target packet header, and obtain the target packet header;
[0138] Add a target header to the first target message of the target service flow to obtain the second target message.
[0139] Optionally, determining the value of a field in the target header based on the configuration information includes at least one of the following:
[0140] Based on the first information, determine the value of the first field in the target message header;
[0141] Based on the second information, determine the value of the second field in the target message header;
[0142] Based on the third information, determine the value of the third field in the target message header;
[0143] Based on the fourth information, determine the value of the fourth field in the target message header;
[0144] Based on the fifth information, determine the value of the fifth field in the target message header;
[0145] In the case where the fifth information indicates that delay detection is performed on the target service flow, the first device sends the transmission time information of the second target message to the control device.
[0146] Optionally, the first target message includes at least one of IPv4 messages and IPv6 messages.
[0147] Optionally, the configuration information carries a first identifier, and the target service flow includes: the service flow determined according to the first identifier.
[0148] The service flow detection device 300 provided in this application embodiment can realize the application and Figure 2 The various processes that can be implemented in the corresponding business flow detection method embodiments, and the same beneficial effects, will not be described again here to avoid repetition.
[0149] See Figure 8 This application embodiment also provides a service flow detection device 400, including:
[0150] The second receiving module 401 is used to receive a third target message sent by a third device, wherein the third device is a first node device or an intermediate node device in the message forwarding path, and the third target message includes a first target message of the target service flow and a target message header; the target message header is a message header determined based on configuration information, or the target message header is a message header obtained by updating the message header determined based on the configuration information; wherein the configuration information is used to indicate relevant information for detecting the service flow;
[0151] The second determining module 402 is used to detect the target service flow based on the target message header.
[0152] Optionally, the second determining module 402 includes:
[0153] If the first target message is determined to be a flow-following detection message based on the value of the first field in the target message header, the target service flow is detected to obtain a first detection result;
[0154] Determine whether to send the first detection result to the control device.
[0155] Optionally, the step of detecting the target service flow to obtain a first detection result includes:
[0156] Determine the category of the detection period described in the third target message to obtain a first sub-result, wherein the first detection result includes the first sub-result;
[0157] The step of determining whether to send the first detection result to the control device includes:
[0158] Determine whether to send the first sub-result to the control device;
[0159] Alternatively, based on the first sub-result, a second sub-result can be obtained, and it can be determined whether to send the second sub-result to the control device.
[0160] Optionally, the step of detecting the target service flow to obtain a first detection result includes:
[0161] Obtain the reception time information of the third target message, wherein the first detection result includes the reception time information;
[0162] The step of determining whether to send the first detection result to the control device includes:
[0163] Determine whether to send the reception time information of the third target message to the control device.
[0164] Optionally, when the second device is an intermediate node device in the message forwarding path, after determining whether to send the first detection result to the control device, the method further includes:
[0165] Multiple third target messages are sent to a fourth device, which is an intermediate node device or a tail node device in the message forwarding path.
[0166] Optionally, after determining whether to send the first detection result to the control device, the device 400 further includes:
[0167] If the detection mode for the target service flow is determined to be point-by-point detection mode based on the value of the second field in the target message header, the first detection result is sent to the control device.
[0168] Optionally, when the second device is a tail node device in the message forwarding path, after determining whether to send the first detection result to the control device, the device 400 further includes:
[0169] The first detection result is sent to the control device.
[0170] Optionally, after determining whether to send the first detection result to the control device, the device 400 further includes:
[0171] Based on the third target message, the first target message is obtained;
[0172] The first target message is sent to a fourth device, which is the target node device of the target service flow.
[0173] The service flow detection device 400 provided in this embodiment of the application can realize the application and Figure 6 The various processes that can be implemented in the corresponding business flow detection method embodiments, and the same beneficial effects, will not be described again here to avoid repetition.
[0174] This application provides an electronic device. For example... Figure 9 As shown, the electronic device 500 includes a processor 501, a memory 502, and a computer program stored in the memory 502 and executable on the processor. The various components of the electronic device 500 are coupled together via a bus system 503. It is understood that the bus system 503 is used to enable communication between these components.
[0175] The processor 501 is used for:
[0176] Receive configuration information, which is used to indicate relevant information for detecting service flows;
[0177] According to the configuration information, a target header is added to the first target message of the target service flow to obtain a second target message, wherein the target header is a header determined according to the configuration information;
[0178] The second target message is sent to a second device, which is either an intermediate node device or a tail node device in the message forwarding path.
[0179] Optionally, the configuration information includes at least one of the following:
[0180] The first information is used to indicate whether the first target message is a flow-following detection message or a non-flow-following detection message;
[0181] The second information is used to indicate whether the detection mode for the target service flow is an end-to-end detection mode or a point-by-point detection mode.
[0182] The third information is used to indicate the duration of the detection period for detecting the target service flow;
[0183] The fourth information is used to indicate the category of the detection period to which the second target message belongs;
[0184] The fifth piece of information is used to indicate whether to perform latency detection on the target service flow within the target detection period.
[0185] Optionally, the processor 501 is also used for:
[0186] Based on the configuration information, determine the values of the fields in the target packet header, and obtain the target packet header;
[0187] Add a target header to the first target message of the target service flow to obtain the second target message.
[0188] Optionally, the processor 501 is also used for:
[0189] Based on the first information, determine the value of the first field in the target message header;
[0190] Based on the second information, determine the value of the second field in the target message header;
[0191] Based on the third information, determine the value of the third field in the target message header;
[0192] Based on the fourth information, determine the value of the fourth field in the target message header;
[0193] Based on the fifth information, determine the value of the fifth field in the target message header;
[0194] In the case where the fifth information indicates that delay detection is performed on the target service flow, the first device sends the transmission time information of the second target message to the control device.
[0195] Optionally, the first target message includes at least one of IPv4 messages and IPv6 messages.
[0196] Optionally, the configuration information carries a first identifier, and the target service flow includes: the service flow determined according to the first identifier.
[0197] Alternatively, processor 501 is used for:
[0198] The system receives a third target message sent by a third device, wherein the third device is a first node device or an intermediate node device in the message forwarding path, and the third target message includes a first target message of the target service flow and a target message header; the target message header is a message header determined based on configuration information, or the target message header is a message header obtained by updating the message header determined based on the configuration information; wherein the configuration information is used to indicate relevant information for detecting the service flow;
[0199] The target service flow is detected based on the target message header.
[0200] Optionally, the processor 501 is also used for:
[0201] If the first target message is determined to be a flow-following detection message based on the value of the first field in the target message header, the target service flow is detected to obtain a first detection result;
[0202] Determine whether to send the first detection result to the control device.
[0203] Optionally, the processor 501 is also used for:
[0204] Determine the category of the detection period described in the third target message to obtain a first sub-result, wherein the first detection result includes the first sub-result;
[0205] The step of determining whether to send the first detection result to the control device includes:
[0206] Determine whether to send the first sub-result to the control device;
[0207] Alternatively, based on the first sub-result, a second sub-result can be obtained, and it can be determined whether to send the second sub-result to the control device.
[0208] Optionally, the processor 501 is also used for:
[0209] Obtain the reception time information of the third target message, wherein the first detection result includes the reception time information;
[0210] The step of determining whether to send the first detection result to the control device includes:
[0211] Determine whether to send the reception time information of the third target message to the control device.
[0212] Optionally, the processor 501 is also used for:
[0213] Multiple third target messages are sent to a fourth device, which is an intermediate node device or a tail node device in the message forwarding path.
[0214] Optionally, the processor 501 is also used for:
[0215] If the detection mode for the target service flow is determined to be point-by-point detection mode based on the value of the second field in the target message header, the first detection result is sent to the control device.
[0216] Optionally, the processor 501 is also used for:
[0217] The first detection result is sent to the control device.
[0218] Optionally, the processor 501 is also used for:
[0219] Based on the third target message, the first target message is obtained;
[0220] The first target message is sent to a fourth device, which is the target node device of the target service flow.
[0221] The electronic device 400 provided in this application embodiment can realize the present application and Figure 2 or Figure 6 The various processes that can be implemented in the corresponding business flow detection method embodiments, and the same beneficial effects, will not be described again here to avoid repetition.
[0222] This application also provides a computer-readable storage medium storing a computer program. When executed by a processor, this computer program implements the various processes of the above-described service flow detection method embodiments and achieves the same technical effects. To avoid repetition, it will not be described again here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0223] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A business flow detection method, characterized in that, Applied to a first device, which is the first node device in the packet forwarding path, including: Receive configuration information, which is used to indicate relevant information for detecting service flows; Based on the configuration information, a target header is added to the first target packet of the target service flow to obtain a second target packet. The target header is a header determined according to the configuration information; the target header is a header added to the outer layer of the first target packet. Send the second target message to the second device, where the second device is an intermediate node device or a tail node device in the message forwarding path; The configuration information includes at least one of the following: The first information is used to indicate whether the first target message is a flow-following detection message or a non-flow-following detection message; The second information is used to indicate whether the detection mode for the target service flow is an end-to-end detection mode or a point-by-point detection mode. The third information is used to indicate the duration of the detection period for detecting the target service flow; The fourth information is used to indicate the category of the detection period to which the second target message belongs; The fifth piece of information is used to indicate whether to perform latency detection on the target service flow within the target detection period.
2. The method according to claim 1, characterized in that, The step of adding a target header to the first target packet of the target service flow according to the configuration information to obtain the second target packet includes: Based on the configuration information, determine the values of the fields in the target packet header, and obtain the target packet header; Add a target header to the first target message of the target service flow to obtain the second target message.
3. The method according to claim 2, characterized in that, Determining the value of a field in the target header based on the configuration information includes at least one of the following: Based on the first information, determine the value of the first field in the target message header; Based on the second information, determine the value of the second field in the target message header; Based on the third information, determine the value of the third field in the target message header; Based on the fourth information, determine the value of the fourth field in the target message header; Based on the fifth information, determine the value of the fifth field in the target message header; In the case where the fifth information indicates that delay detection is performed on the target service flow, the first device sends the transmission time information of the second target message to the control device.
4. The method according to claim 1, characterized in that, The first target message includes at least one of IPv4 messages and IPv6 messages.
5. The method according to claim 1, characterized in that, The configuration information carries a first identifier, and the target service flow includes: the service flow determined according to the first identifier.
6. A service flow detection method, characterized in that, Applied to a second device, which is an intermediate node device or a tail node device in the packet forwarding path, including: The system receives a third target message sent by a third device, wherein the third device is either the first node device or an intermediate node device in the message forwarding path, and the third target message includes a first target message of the target service flow and a target message header; the target message header is a message header determined based on configuration information, or the target message header is a message header obtained by updating the message header determined based on the configuration information; wherein the configuration information is used to indicate relevant information for detecting the service flow; and the target message header is a message header added to the outer layer of the first target message. The target service flow is detected based on the target message header; The configuration information includes at least one of the following: The first information is used to indicate whether the first target message is a flow-following detection message or a non-flow-following detection message; The second information is used to indicate whether the detection mode for the target service flow is an end-to-end detection mode or a point-by-point detection mode. The third information is used to indicate the duration of the detection period for detecting the target service flow; The fourth information is used to indicate the category of the detection period to which the second target message belongs; The fifth piece of information is used to indicate whether to perform latency detection on the target service flow within the target detection period.
7. The method according to claim 6, characterized in that, The step of detecting the target service flow based on the target packet header includes: If the first target message is determined to be a flow-following detection message based on the value of the first field in the target message header, the target service flow is detected to obtain a first detection result; Determine whether to send the first detection result to the control device.
8. The method according to claim 7, characterized in that, The step of detecting the target service flow to obtain a first detection result includes: Determine the category of the detection period described in the third target message to obtain a first sub-result, wherein the first detection result includes the first sub-result; The step of determining whether to send the first detection result to the control device includes: Determine whether to send the first sub-result to the control device; Alternatively, based on the first sub-result, a second sub-result can be obtained, and it can be determined whether to send the second sub-result to the control device.
9. The method according to claim 7, characterized in that, The step of detecting the target service flow to obtain a first detection result includes: Obtain the reception time information of the third target message, wherein the first detection result includes the reception time information; The step of determining whether to send the first detection result to the control device includes: Determine whether to send the reception time information of the third target message to the control device.
10. The method according to claim 7, characterized in that, When the second device is an intermediate node device in the packet forwarding path, after determining whether to send the first detection result to the control device, the method further includes: Multiple third target messages are sent to a fourth device, which is an intermediate node device or a tail node device in the message forwarding path.
11. The method according to claim 10, characterized in that, The step of determining whether to send the first detection result to the control device includes: If the detection mode for the target service flow is determined to be point-by-point detection mode based on the value of the second field in the target message header, the first detection result is sent to the control device.
12. The method according to claim 7, characterized in that, When the second device is a tail node device in the packet forwarding path, after determining whether to send the first detection result to the control device, the method further includes: The first detection result is sent to the control device.
13. The method according to claim 12, characterized in that, After determining whether to send the first detection result to the control device, the method further includes: Based on the third target message, the first target message is obtained; The first target message is sent to a fourth device, which is the target node device of the target service flow.
14. A business flow detection device, characterized in that, include: The first receiving module is used to receive configuration information, which is used to indicate relevant information for detecting the service flow; The first determining module is used to add a target header to the first target message of the target service flow according to the configuration information to obtain a second target message, wherein the target header is a header determined according to the configuration information; The target message header is the message header added to the outer layer of the first target message; The first sending module is used to send the second target message to the second device, where the second device is an intermediate node device or a tail node device in the message forwarding path. The configuration information includes at least one of the following: The first information is used to indicate whether the first target message is a flow-following detection message or a non-flow-following detection message; The second information is used to indicate whether the detection mode for the target service flow is an end-to-end detection mode or a point-by-point detection mode. The third information is used to indicate the duration of the detection period for detecting the target service flow; The fourth information is used to indicate the category of the detection period to which the second target message belongs; The fifth piece of information is used to indicate whether to perform latency detection on the target service flow within the target detection period.
15. A business flow detection device, characterized in that, include: The second receiving module is used to receive a third target message sent by a third device, wherein the third device is a first node device or an intermediate node device in the message forwarding path, and the third target message includes a first target message of the target service flow and a target message header; the target message header is a message header determined based on configuration information, or the target message header is a message header obtained by updating the message header determined based on the configuration information; wherein the configuration information is used to indicate relevant information for detecting the service flow; the target message header is a message header added to the outer layer of the first target message; The second determining module is used to detect the target service flow based on the target message header; The configuration information includes at least one of the following: The first information is used to indicate whether the first target message is a flow-following detection message or a non-flow-following detection message; The second information is used to indicate whether the detection mode for the target service flow is an end-to-end detection mode or a point-by-point detection mode. The third information is used to indicate the duration of the detection period for detecting the target service flow; The fourth information is used to indicate the category of the detection period to which the second target message belongs; The fifth piece of information is used to indicate whether to perform latency detection on the target service flow within the target detection period.
16. An electronic device, characterized in that, It includes a processor, a memory, 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 traffic flow detection method as claimed in any one of claims 1 to 5, or the steps of the traffic flow detection method as claimed in any one of claims 6 to 13.
17. A readable storage medium, characterized in that, The readable storage medium stores a program that, when executed by a processor, implements the steps in the traffic flow detection method as described in any one of claims 1 to 5, or the steps in the traffic flow detection method as described in any one of claims 6 to 13.
Citation Information
Patent Citations
In-situ flow detection method and device
CN113382437A
