In-band network telemetering method, system and device based on flow selection and storage medium

Through in-band network telemetry method based on traffic selection, dynamic programming algorithms and adaptive strategies, the problem of redundant information and insufficient information caused by unbalanced sampling in the prior art is solved, and efficient and accurate network state perception is achieved.

CN120151252APending Publication Date: 2025-06-13NORTHEASTERN UNIV CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510305309.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-14
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

In the existing in-band network telemetry technology, the passive telemetry method based on frequency sampling has an unbalanced sampling strategy, which leads to the high-activity port producing a large amount of redundant telemetry information, while the low-activity port may have insufficient telemetry information.

Method used

The in-band network telemetry method based on traffic selection is adopted, and a directed graph is determined by obtaining the vertex set and edge set, a set of traffic to be selected is obtained, a target traffic set is determined based on the directed graph and the set of traffic to be selected, and a telemetry data packet is inserted into it is selected, so as to realize real-time monitoring of the switch status.

Benefits of technology

Through dynamic programming algorithms and adaptive strategies, traffic selection is optimized, telemetry overhead is reduced, redundant information and insufficient information caused by unbalanced sampling is solved, and the accuracy and efficiency of network state perception is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120151252A_ABST
    Figure CN120151252A_ABST
Patent Text Reader

Abstract

The invention discloses an in-band network telemetering method based on flow selection, network telemetering is used for measuring the state of a switch in a network, and the method is characterized by comprising the following steps: obtaining a vertex set and an edge set, and determining a directed graph according to the vertex set and the edge set; obtaining a plurality of to-be-selected flows, wherein the plurality of to-be-selected flows form a to-be-selected flow set; determining a target traffic set according to the directed graph and the to-be-selected traffic set; selecting target traffic from the target traffic set; target data is inserted into the telemetry data packet in the target traffic to obtain a target telemetry data packet, and the target telemetry data packet brings out the target data from the outlet end of the switch; the target data is data used for indicating the state of the switch. The situation that a large amount of redundant telemetry information is generated by a high-activity port due to an unbalanced sampling strategy and the situation that the telemetry information is insufficient possibly occurs to a low-activity port is avoided. The invention also provides an in-band network telemetering system and equipment based on flow selection, and a storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of network telemetry, and in particular, to an in-band network telemetry method, system, device and storage medium based on traffic selection. Background Art

[0002] In recent years, with the acceleration of the global informatization process, the number of various network devices has been increasing year by year and shows an increasingly rapid trend. Users' dependence on cloud servers has also become greater and greater, which has led to the expansion of large-scale network data centers, a sharp increase in the number of network physical devices, and an exponential growth in network complexity. At the same time, with the increasing data center traffic and the ever-changing technological development, new challenges have been posed to the network monitoring and management of large data centers. Among them, network measurement will be a key technology, which can provide strong data support for aspects such as the rapid location of network faults, the timely monitoring of applications, the effective planning and management of bandwidth, and Internet security. Therefore, designing a fine-grained, low-bandwidth, and lightweight measurement scheme has become a hot topic and a difficult problem in the field of network measurement. Traditional network measurement adopts polling or end-to-end network measurement schemes, and it is difficult to obtain fine-grained network information of the entire network in real time. Subsequently, software-defined networks emerged, enabling the data plane to have a certain programmable ability. The programmability of the data plane makes the network structure more flexible, thus reshaping traditional network measurement. Since the advent of software-defined networks, the programmability of the data plane has been promoting the development of programmable networks and completely decoupling the control plane and the data plane. After the emergence of programmable protocol-independent packet processors and corresponding forwarding models in the programmable data plane, in-band network telemetry came into being. It can obtain fine-grained network information in real time, and at the same time, the programmability of the data plane greatly improves the flexibility of the measurement scheme. Currently, in-band network telemetry technology has become a landmark technology in network telemetry and is widely used in large-scale network data centers.

[0003] Different from traditional network measurement, in-band network telemetry combines packet forwarding and network measurement. It embeds and collects network status information during the packet transmission process. When a packet passes through a switch in the network, each switch will add status information such as link utilization, latency, and queue depth to the packet in real time. Finally, this information is extracted at the egress switch or monitoring point for network performance monitoring, fault diagnosis, and optimization, thus achieving efficient and real-time network status awareness and management. In the existing technology, there is a significant problem with the passive telemetry method based on frequency sampling: at the ports where packets pass frequently, i.e., active ports, the system will mark more packets to carry telemetry information, while at the ports where packets pass less frequently, i.e., inactive ports, the number of marked packets is relatively small. This unbalanced sampling strategy results in a large amount of redundant telemetry information at high-activity ports, while there may be insufficient telemetry information at low-activity ports. Summary of the Invention

[0004] Based on this, it is necessary to address the above problems and propose an in-band network telemetry method, system, device, and storage medium based on traffic selection.

[0005] An in-band network telemetry method based on traffic selection, where the network telemetry is used to measure the status of switches in the network. The method is characterized in that it includes:

[0006] Obtain a vertex set and an edge set, and determine a directed graph according to the vertex set and the edge set;

[0007] Obtain multiple traffic flows to be selected, and the multiple traffic flows to be selected form a set of traffic flows to be selected;

[0008] Determine a target traffic flow set according to the directed graph and the set of traffic flows to be selected;

[0009] Select a target traffic flow from the target traffic flow set;

[0010] Insert target data into the telemetry packets in the target traffic flow to obtain target telemetry packets, and the target telemetry packets carry the target data out from the egress end of the switch; the target data is data used to indicate the status of the switch.

[0011] In one embodiment, after selecting the target traffic flow from the target traffic flow set, it further includes:

[0012] When a new traffic flow to be selected is added to the set of traffic flows to be selected, select the target traffic flow set according to the following criteria:

[0013]

[0014] Among them, C is the current set of target flows, C all is the set of target flows under the global flow, C part is the set of target flows under the local flow;

[0015] When the original flows to be selected in the set of flows to be selected terminate, the set of target flows is selected according to the following criteria:

[0016]

[0017] Among them, C is the current set of target flows, C all is the set of target flows under the global flow, C part is the set of target flows under the local flow.

[0018] In one embodiment, the expression of the directed graph is as follows:

[0019] G=(V,E)

[0020] Among them, V represents the set of vertices, and E represents the set of links containing n network links;

[0021] The expression of the set of flows to be selected is as follows:

[0022]

[0023] Among them, S i represents any target flow, and E represents the set of edges containing n edges.

[0024] In one embodiment, determining the set of target flows C according to the directed graph and the set of flows to be selected includes: the determination of the set of target flows satisfies the first condition, the second condition, and the third condition;

[0025] The first condition is: ∪ S∈C S = E, that is, the target flows cover all the network links;

[0026] The second condition is: |C| is the smallest, that is, the number of flows to be selected contained in the set of target flows is as small as possible;

[0027] The third condition is: R(C)=∑ u∈U (T(u)-1) is the smallest, where R(x) is the redundancy function, representing the number of elements repeatedly covered by any set of target flows; T(x) is the coverage times of the network link, representing the number of times any network link is covered.

[0028] In one embodiment, selecting a target flow from the set of target flows includes:

[0029] Traverse each flow in the target flow set;

[0030] Perform binary conversion on each of the flows to determine the network link corresponding to the flow;

[0031] When the network links corresponding to multiple flows are non-repetitive and fully covered, the multiple flows are the target flows.

[0032] In one embodiment, the inserting target data into the telemetry data packet in the target flow to obtain target telemetry data includes:

[0033] Unpack the telemetry data packet to obtain a first telemetry data structure;

[0034] Insert target data into the first telemetry data structure to obtain a second telemetry data structure;

[0035] Synthesize the second telemetry data structure to obtain a target telemetry data packet.

[0036] In one embodiment, the target data includes: average switch delay, time stamp of each telemetry data packet at each egress port, ingress port time stamp, number of switches passed by a single telemetry data packet, number of telemetry data packets, average queue depth, queue depth of each switch, telemetry bandwidth overhead per unit time, and size of telemetry data carried by the telemetry data packet; the specific expressions are as follows:

[0037]

[0038] where, T d represents the average switch delay, time_stamp out represents the time stamp of the telemetry data packet at each egress port, time_stamp in represents the ingress port time stamp, m i represents the number of switches passed by a single telemetry data, n represents the number of telemetry data packets, D queue represents the average queue depth, D queue_i represents the queue depth of each switch, B represents the telemetry bandwidth overhead per unit time, B i represents the size of telemetry data carried by each telemetry data packet, and t represents the telemetry time.

[0039] An in-band network telemetry system based on traffic selection, the system includes:

[0040] A first determination module, configured to obtain a vertex set and an edge set, and determine a directed graph according to the vertex set and the edge set;

[0041] A component module, configured to obtain multiple traffic flows to be selected, and the multiple traffic flows to be selected form a traffic flow set to be selected;

[0042] A second determination module, configured to determine a target traffic flow set according to the directed graph and the traffic flow set to be selected;

[0043] A selection module, configured to select a target traffic flow from the target traffic flow set;

[0044] An insertion module, configured to insert target data into the telemetry data packet in the target traffic flow to obtain a target telemetry data packet, and the target telemetry data packet takes the target data out from the outlet end of the switch; the target data is data for indicating the state of the switch.

[0045] A computer device, including a memory and a processor, where the memory stores a computer program, and when the computer program is executed by the processor, the processor is caused to execute the following steps:

[0046] Obtain a vertex set and an edge set, and determine a directed graph according to the vertex set and the edge set;

[0047] Obtain multiple traffic flows to be selected, and the multiple traffic flows to be selected form a traffic flow set to be selected;

[0048] Determine a target traffic flow set according to the directed graph and the traffic flow set to be selected;

[0049] Select a target traffic flow from the target traffic flow set;

[0050] Insert target data into the telemetry data packet in the target traffic flow to obtain a target telemetry data packet, and the target telemetry data packet takes the target data out from the outlet end of the switch; the target data is data for indicating the state of the switch.

[0051] A computer-readable storage medium, storing a computer program, and when the computer program is executed by a processor, the processor is caused to execute the following steps:

[0052] Obtain a vertex set and an edge set, and determine a directed graph according to the vertex set and the edge set;

[0053] Obtain multiple traffic flows to be selected, and the multiple traffic flows to be selected form a traffic flow set to be selected;

[0054] Determine a target traffic flow set according to the directed graph and the traffic flow set to be selected;

[0055] Select a target traffic flow from the target traffic flow set;

[0056] Insert target data into the telemetry data packets in the target traffic to obtain target telemetry data packets, which carry the target data out from the egress port of the switch; the target data is data for indicating the status of the switch.

[0057] In the present invention, a vertex set and an edge set are obtained, and a directed graph is determined according to the vertex set and the edge set; multiple candidate traffic flows are obtained, and the multiple candidate traffic flows form a candidate traffic flow set; a target traffic flow set is determined according to the directed graph and the candidate traffic flow set; a target traffic flow is selected from the target traffic flow set; target data is inserted into the telemetry data packets in the target traffic flow to obtain target telemetry data packets, which carry the target data out from the egress port of the switch; the target data is data for indicating the status of the switch. At the ports where data packets pass frequently, i.e., active ports, the system will mark more telemetry data packets to carry the target data, while at the ports where fewer telemetry data packets pass, i.e., inactive ports, the number of marked telemetry data packets is relatively small, avoiding the situation that an unbalanced sampling strategy leads to a large amount of redundant telemetry information at high-activity ports, while there may be insufficient telemetry information at low-activity ports. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0059] Wherein:

[0060] Figure 1 FIG. is an application environment diagram of an in-band network telemetry method based on traffic selection in an embodiment;

[0061] Figure 2 FIG. is a flowchart of an in-band network telemetry method based on traffic selection in an embodiment;

[0062] Figure 3 FIG. is a structural block diagram of an in-band network telemetry system based on traffic selection in an embodiment;

[0063] Figure 4 FIG. is a structural block diagram of a computer device in an embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0064] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0065] Figure 1 It is an in-band network telemetry application environment diagram based on traffic selection in an embodiment. Refer to Figure 1 , this in-band network telemetry method based on traffic selection is applied to an in-band network telemetry system based on traffic selection. The in-band network telemetry system based on traffic selection includes a terminal 110 and a server 120. The terminal 110 and the server 120 are connected through a network. The terminal 110 may specifically be a desktop terminal or a mobile terminal, and the mobile terminal may specifically be at least one of a mobile phone, a tablet computer, a laptop computer, etc. The server 120 may be implemented by an independent server or a server cluster composed of multiple servers. The terminal 110 is used to obtain a vertex set and an edge set, and determine a directed graph according to the vertex set and the edge set; obtain multiple traffic to be selected, and the multiple traffic to be selected constitute a traffic set to be selected. The server 120 is used to determine a target traffic set according to the directed graph and the traffic set to be selected; select target traffic from the target traffic set; insert target data into the telemetry data packet in the target traffic to obtain a target telemetry data packet, and the target telemetry data packet takes the target data out of the outlet end of the switch; the target data is data used to indicate the state of the switch.

[0066] Different from traditional network measurement, in-band network telemetry combines packet forwarding and network measurement. Through the technology of embedding and collecting network status information during the packet transmission process, when a packet passes through a switch in the network, each switch will add status information such as link utilization rate, delay, and queue depth to the packet in real time, and finally extract this information at the egress switch or monitoring point for network performance monitoring, fault diagnosis, and optimization, so as to achieve efficient and real-time network status perception and management. In the prior art, there is a significant problem with the passive telemetry method based on frequency sampling: at the port where packets pass frequently, that is, the active port, the system will mark more packets to carry telemetry information, while at the port where packets pass less frequently, that is, the inactive port, the number of marked packets is relatively small. This unbalanced sampling strategy results in a large amount of redundant telemetry information at high-activity ports, while there may be insufficient telemetry information at low-activity ports. To solve the above technical problems, such as Figure 2As shown, in one embodiment, a method for in-band network telemetry based on traffic selection is provided. This method can be applied to both terminals and servers. In this embodiment, it is illustrated by taking the application to a terminal as an example. The network telemetry is used to measure the status of switches in the network. The method includes:

[0067] S10: Obtain a vertex set and an edge set, and determine a directed graph according to the vertex set and the edge set;

[0068] S20: Obtain multiple traffic flows to be selected, and the multiple traffic flows to be selected form a set of traffic flows to be selected;

[0069] S30: Determine a set of target traffic flows according to the directed graph and the set of traffic flows to be selected;

[0070] S40: Select a target traffic flow from the set of target traffic flows;

[0071] S50: Insert target data into the telemetry data packets in the target traffic flow to obtain target telemetry data packets, and the target telemetry data packets carry the target data out from the egress port of the switch; the target data is data for indicating the status of the switch.

[0072] At the ports where data packets pass frequently, that is, active ports, the system will mark more telemetry data packets to carry the target data. While at the ports where telemetry data packets pass less frequently, that is, inactive ports, the number of marked telemetry data packets is relatively small, avoiding the situation where unbalanced sampling strategies lead to a large amount of redundant telemetry information at high-activity ports, while there may be insufficient telemetry information at low-activity ports.

[0073] In one embodiment, after selecting the target traffic flow in step S40, it further includes:

[0074] When a new traffic flow to be selected is added to the set of traffic flows to be selected, the set of target traffic flows is selected according to the following criteria:

[0075]

[0076] Where C is the current set of target traffic flows, C all is the set of target traffic flows under global traffic, and C part is the set of target traffic flows under local traffic;

[0077] When the original traffic flows to be selected in the set of traffic flows to be selected terminate, the set of target traffic flows is selected according to the following criteria:

[0078]

[0079] Among them, C is the current set of target flows, and C all is the set of target flows under the global traffic, and C part is the set of target flows under the local traffic.

[0080] In one embodiment, the expression of the directed graph in step S10 is as follows:

[0081] G = (V, E) (3)

[0082] Among them, V represents the set of vertices, and E represents the set of links containing n network links;

[0083] The expression of the set of flows to be selected is as follows:

[0084]

[0085] Among them, S i represents any target flow, and E represents the set of edges containing n edges.

[0086] In one embodiment, in step S30, determining the set of target flows according to the directed graph and the set of flows to be selected includes: the determination of the set of target flows satisfies the first condition, the second condition, and the third condition;

[0087] The first condition is: ∪ S∈C S = E, that is, the target flows cover all the network links;

[0088] The second condition is: |C| is the smallest, that is, the number of flows to be selected contained in the set of target flows is as small as possible;

[0089] The third condition is: R(C) = Σ u∈U (T(u) - 1) is the smallest, where R(x) is the redundancy function, representing the number of elements covered repeatedly by any set of target flows; T(x) is the coverage times of the network link, representing the number of times any network link is covered.

[0090] Specifically, compared with the traditional set covering problem, the target flow selection problem considers the number of repeated elements between the selected sets. In network measurement, the number of repeated elements represents the repeated network ports. However, in a network measurement, it is unnecessary to collect the information of repeated network links. These unnecessary network link information will increase the additional link bandwidth burden. Passive measurement can reduce the occurrence of repetition as much as possible through flow selection.

[0091] In one embodiment, in step S40, selecting the target flow from the set of target flows includes:

[0092] S401: Traverse each traffic in the target traffic set;

[0093] S402: Perform binary conversion on each of the traffic to determine the network link corresponding to the traffic;

[0094] S403: When the network links corresponding to multiple traffic are non - repetitive and fully covered, the multiple traffic are the target traffic.

[0095] Specifically, when traversing each traffic in the target traffic set and selecting the target traffic to implement network measurement, it is necessary to evaluate each traffic in each target traffic set until all active network links are covered.

[0096] Since storing the target traffic represented by the node sequence requires a large amount of memory space and has low access efficiency, by traversing all network links that appear in the given traffic set and recording the occurrence order of all network links, the occurrence order of these network links is the key to representing the target traffic with a binary number for state compression. Secondly, whenever the algorithm selects a target traffic to add to the selected traffic set, only the binary number of this traffic needs to be added to the binary number represented by the selected traffic set. Finally, state compression is also applied to evaluate the number of duplicate network links between the candidate traffic and the selected traffic set. By performing an AND operation on the binary number representing the candidate traffic and the binary number representing the selected traffic set, the number of 1s in the statistical result can quickly obtain the number of duplicate links. According to the state transition equation, update the traffic selection result. The sub - problem of the dynamic programming algorithm of the present invention is the link combination covered by the selected traffic, rather than the combination of the selected traffic. The state transition equation is as follows:

[0097] dp[comb] = min(dp[comb], dp[prev] + [flow])

[0098] This equation means that for the current network link coverage state dp[comb], if the previous network link coverage state dp[prev] plus the currently traversed target traffic flow can use a smaller total number of traffic and have fewer duplicate network links between the target traffic, then use this target traffic combination to replace the original traffic combination, otherwise do not replace. In addition, since the sub - problem of dynamic programming is the combination of all network links, for a traffic set with n network links, the combination situation of all network links is 2 n ones.

[0099] In one embodiment, the inserting target data into the telemetry data packet in the target traffic in step S50 to obtain target telemetry data includes:

[0100] S501: Unpack the telemetry data packet to obtain a first telemetry data structure;

[0101] S502: Insert target data into the first telemetry data structure to obtain a second telemetry data structure;

[0102] S503: Synthesize the second telemetry data structure to obtain a target telemetry data packet.

[0103] Specifically, unpack the content in the telemetry data packet into a first telemetry data structure in P4 code.

[0104] Since there are many data packets entering the port, which are divided into ordinary data packets and available telemetry data packets. For ordinary data packets, record the statistical information in the register of the switch's input port. For telemetry data packets, put the statistical information in the register and other target data related to the telemetry data packet into the telemetry information stack of the telemetry data packet, that is, form a second telemetry data structure.

[0105] In the egress processing stage, it is the same as the ingress processing stage, except that the input port information of the switch is changed to the output port information.

[0106] Recombine the second telemetry data structure and the collected information into a target telemetry data packet.

[0107] After collecting the target data, it is also necessary to separate the collected target data in the last-hop switch, encapsulate it into a data packet and send it to the remote server, and save it in the database for analyzing and processing the current network situation.

[0108] In one embodiment, the target data includes: average switch delay, timestamp of each telemetry data packet at each output port, input port timestamp, number of switches passed by a single telemetry data packet, number of telemetry data packets, average queue depth, queue depth of each switch, telemetry bandwidth overhead per unit time, and size of telemetry data carried by the telemetry data packet; the specific expressions are as follows:

[0109]

[0110] Wherein, T d represents the average switch delay, time_stamp out represents the timestamp of the telemetry data packet at each output port, time_stamp in represents the input port timestamp, m i represents the number of switches passed by a single telemetry data packet, n represents the number of telemetry data packets, D queue represents the average queue depth, D queue_irepresents the queue depth of each switch, B represents the telemetry bandwidth overhead per unit time, B i represents the size of the telemetry data carried by each telemetry packet, and t represents the telemetry time.

[0111] Based on the existing in-band network telemetry architecture, the present invention utilizes a traffic selection algorithm and a telemetry strategy that combines an adaptive algorithm with local planning and global planning to achieve low-overhead in-band network-wide telemetry. Moreover, through the algorithm, the number of selected flows is minimized, and the repetition between the ports through which the selected flows pass is minimized, thereby reducing the telemetry overhead. At the same time, the problem of uneven measurement caused by frequency sampling-based telemetry is solved. The invention reduces the number of data packets and bandwidth overhead by 85.2% and 58.2% respectively.

[0112] This application also provides an in-band network telemetry system based on traffic selection, as Figure 3 shown. The system includes:

[0113] A first determination module 10, configured to obtain a vertex set and an edge set, and determine a directed graph according to the vertex set and the edge set;

[0114] A composition module 20, configured to obtain multiple flows to be selected, and the multiple flows to be selected form a set of flows to be selected;

[0115] A second determination module 30, configured to determine a set of target flows according to the directed graph and the set of flows to be selected;

[0116] A selection module 40, configured to select target flows from the set of target flows;

[0117] An insertion module 50, configured to insert target data into the telemetry packets in the target flows to obtain target telemetry packets, and the target telemetry packets carry the target data out from the outlet end of the switch; the target data is data used to indicate the status of the switch. In one embodiment, a computer device is proposed, including a memory and a processor. When the computer program stored in the memory is executed by the processor, the processor performs the following steps:

[0118] S10: Obtain a vertex set and an edge set, and determine a directed graph according to the vertex set and the edge set;

[0119] S20: Obtain multiple flows to be selected, and the multiple flows to be selected form a set of flows to be selected;

[0120] S30: Determine a set of target flows according to the directed graph and the set of flows to be selected;

[0121] S40: Select target flows from the set of target flows;

[0122] S50: Insert target data into the telemetry data packet in the target traffic to obtain a target telemetry data packet, and the target telemetry data packet takes the target data out from the outlet end of the switch; the target data is data for indicating the status of the switch.

[0123] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which when executed by a processor, causes the processor to perform the following steps:

[0124] S10: Obtain a vertex set and an edge set, and determine a directed graph according to the vertex set and the edge set;

[0125] S20: Obtain multiple traffic flows to be selected, and the multiple traffic flows to be selected form a traffic flow set to be selected;

[0126] S30: Determine a target traffic flow set according to the directed graph and the traffic flow set to be selected;

[0127] S40: Select a target traffic flow from the target traffic flow set;

[0128] S50: Insert target data into the telemetry data packet in the target traffic to obtain a target telemetry data packet, and the target telemetry data packet takes the target data out from the outlet end of the switch; the target data is data for indicating the status of the switch.

[0129] Figure 4 The internal structure diagram of a computer device in one embodiment is shown. The computer device may specifically be a terminal or a server. As Figure 4 shown, the computer device includes a processor, a memory, and a network interface connected through a system bus. Among them, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program, which when executed by the processor, enables the processor to implement an in-band network telemetry method based on traffic selection. The internal memory may also store a computer program, which when executed by the processor, enables the processor to perform an in-band network telemetry method based on traffic selection. Those skilled in the art can understand that Figure 4 the structure shown in is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0130] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.

[0131] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.

[0132] The above-described embodiments merely represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application should be subject to the appended claims.

Claims

1. An in-band network telemetry method based on traffic selection, wherein the network telemetry is used to measure the state of a switch in the network, characterized in that: The method comprises: Obtain a vertex set and an edge set, and determine a directed graph according to the vertex set and the edge set; Acquire multiple traffic to be selected, where the multiple traffic to be selected constitute a set of traffic to be selected; Determine a target traffic set according to the directed graph and the traffic set to be selected; Selecting a target flow from the target flow set; Inserting target data into the telemetry data packet in the target traffic to obtain a target telemetry data packet, wherein the target telemetry data packet carries the target data out from the egress port of the switch; the target data is data used to indicate the state of the switch.

2. The in-band network telemetry method based on traffic selection according to claim 1, characterized in that: After selecting the target flow from the target flow set, the method further includes: When a new flow to be selected is added to the flow set to be selected, the target flow set is selected according to the following criteria: Among them, C is the current target flow set, C all is the target flow set under global flow, C part is the target flow set under local flow; When the original traffic to be selected in the traffic set to be selected is terminated, the target traffic set is selected according to the following criteria: Among them, C is the current target flow set, C all is the target flow set under global flow, C part is the target flow set under local flow.

3. The in-band network telemetry method based on traffic selection according to claim 2, characterized in that: The expression of the directed graph is as follows: G=(V,E) Among them, V represents the vertex set, E represents the link set containing n network links; The expression of the flow set to be selected is as follows: Among them, S i represents any target flow, and E represents an edge set containing n edges.

4. The in-band network telemetry method based on traffic selection according to claim 3 is characterized in that: The determining of the target flow set according to the directed graph and the flow set to be selected comprises: the determination of the target flow set satisfies a first condition, a second condition and a third condition; The first condition is: S∈C S=E, that is, the target traffic covers all the network links; The second condition is: |C| is minimum, that is, the number of flows to be selected contained in the target flow set is as small as possible; The third condition is: R(C)=Σ u∈U (T(u)-1) is the smallest, where R(x) is the redundancy function, which represents the number of elements repeatedly covered by any target traffic set; T(x) is the number of coverage of the network link, which represents the number of times any network link is covered.

5. The in-band network telemetry method based on traffic selection according to claim 1, characterized in that: The selecting a target flow from the target flow set comprises: Traversing each flow in the target flow set; Performing binary conversion on each of the flows to determine the network link corresponding to the flow; When the network links corresponding to the multiple flows are not repeated and are completely covered, the multiple flows are the target flows.

6. The in-band network telemetry method based on traffic selection according to claim 1, characterized in that: Inserting the target data into the telemetry data packet in the target traffic to obtain the target telemetry data includes: Unpacking the telemetry data packet to obtain a first telemetry data structure; inserting target data into the first telemetry data structure to obtain a second telemetry data structure; The second telemetry data structure is synthesized to obtain a target telemetry data packet.

7. The in-band network telemetry method based on traffic selection according to claim 6, characterized in that: The target data includes: average switch latency, timestamp of each telemetry data packet at each egress port, timestamp of the ingress port, number of switches that a single telemetry data packet passes through, number of telemetry data packets, average queue depth, queue depth of each switch, telemetry bandwidth overhead per unit time, and size of telemetry data carried by the telemetry data packet; the specific expression is as follows: Among them, T d Indicates the average switch delay, time_stamp out Indicates the timestamp of the telemetry data packet at each outbound port, time_stamp in Indicates the inbound port timestamp, m i represents the number of switches that a single telemetry data passes through, n represents the number of telemetry data packets, and D queue represents the average queue depth, D queue_i represents the queue depth of each switch, B represents the telemetry bandwidth overhead per unit time, and B i It represents the size of telemetry data carried by each telemetry data packet, and t represents the telemetry time.

8. An in-band network telemetry system based on flow selection, characterized in that: The system comprises: A first determination module, configured to obtain a vertex set and an edge set, and determine a directed graph according to the vertex set and the edge set; A constituting module, used for acquiring a plurality of traffic to be selected, wherein the plurality of traffic to be selected constitutes a set of traffic to be selected; A second determination module is used to determine a target traffic set according to the directed graph and the traffic set to be selected; A selection module, used for selecting a target flow from the target flow set; An insertion module is used to insert target data into the telemetry data packet in the target traffic to obtain a target telemetry data packet, and the target telemetry data packet brings the target data out from the egress port of the switch; the target data is data used to indicate the state of the switch.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 7.