Sketch data processing method and device based on cooperation of programmable switch and DPU, and medium
By converting Sketch data processing tasks into basic operation sets, and using automatic task segmentation algorithm to obtain the optimal unloading solution, collaborating with fast paths and ordinary paths, the problem of scalability and universality loss caused by performance improvement in the existing technology is solved, and high-performance and low-overhead Sketch data processing is achieved.
Patent Information
- Application Number
- CN202411836031.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-13
AI Technical Summary
The existing Sketch data processing methods have lost their scalability and versatility while improving performance, and cannot effectively handle any type of Sketch data processing tasks.
By converting Sketch data processing tasks into basic operation sets, and using automatic task segmentation algorithm to obtain the optimal unloading solution, collaboratively coordinating fast paths and ordinary paths, the unloading and collaborative processing of Sketch data processing tasks is realized.
It realizes the ability to maintain large throughput and small latency while keeping core consumption small, with higher performance and lower overhead, achieving scalability and versatility.
Smart Images

Figure CN119814646A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer network technology, and in particular to a Sketch data processing method, device, and medium based on the collaboration of a programmable switch and a DPU. Background Art
[0002] Sketch is an emerging approximate network measurement algorithm that uses data structures inside switches to measure traffic at a linear rate. This data is collected and processed periodically to ensure that network management applications can detect and resolve network events, such as attack flow detection. However, existing solutions treat Sketch data processing as a trade-off, either sacrificing scalability by dedicating a large number of servers to improve the performance of running any type of Sketch data processing tasks, or maintaining high scalability by offloading tasks to switches, but losing versatility due to limited switch functionality. Summary of the invention
[0003] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a Sketch data processing method, device, and medium based on the collaboration of a programmable switch and a DPU, which comprehensively utilizes the ordinary path located on the smart network card and the fast path located on the TOR (Top-of-Rack) switch, and realizes scalable and general Sketch data processing by maximizing the offloading of tasks to the fast path and coordinating the fast path and the ordinary path.
[0004] In a first aspect, an embodiment of the present invention provides a Sketch data processing method based on collaboration between a programmable switch and a DPU, the method comprising:
[0005] Convert Sketch data processing tasks into a set of basic operations;
[0006] The basic operation set is processed by the automatic task segmentation algorithm to obtain the optimal offloading solution of the basic operation set on the fast path and the normal path;
[0007] According to the optimal offloading scheme of the basic operation set on the fast path and the normal path, the fast path and the normal path collaborate to complete the Sketch data processing task; during operation, the Sketch data stream first reaches the fast path, and the fast path and the normal path respectively perform the corresponding Sketch data processing operations. At the same time, the fast path will control the rate of sending Sketch key-value pair data to the normal path to prevent the normal path from being saturated.
[0008] In a second aspect, an embodiment of the present invention provides an electronic device, comprising a memory and a processor, wherein the memory is coupled to the processor; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the above-mentioned Sketch data processing method based on the collaboration between a programmable switch and a DPU.
[0009] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned Sketch data processing method based on the collaboration between a programmable switch and a DPU.
[0010] Compared with the prior art, the present invention has the following beneficial effects:
[0011] The present invention provides a Sketch data processing method based on the collaboration of a programmable switch and a DPU, by converting the Sketch data processing task into a basic operation set, and obtaining the optimal unloading scheme of the basic operation set on a fast path and a normal path, the Sketch data processing task is unloaded to the data plane switch by collaborating the work of the fast path and the normal path, and a large throughput and a small delay are maintained under the condition of small core consumption. The present invention has higher performance and lower overhead. The method is simple and convenient, flexible to implement, and has strong practicality.
[0012] The present invention gives full play to the collaboration between the fast path on the switch and the ordinary path of the smart network card. The fast path processes part of the Sketch data and then sends it to the ordinary path, controls the sending rate of the fast path, prevents the ordinary path from being saturated, generates Sketch data processing results that can be directly queried, and can process any task input by the user, achieving scalability and versatility.
[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0014] Figure 1 It is a schematic diagram of a Sketch data processing method based on collaboration between a programmable switch and a DPU provided in an embodiment of the present invention;
[0015] Figure 2 is a schematic diagram of a Sketch data processing task provided by an embodiment of the present invention;
[0016] Figure 3 is a flowchart of automatic segmentation of tasks provided by an embodiment of the present invention;
[0017] Figure 4 This is an example of a hash table in the flow number estimation provided by an embodiment of the present invention;
[0018] Figure 5 is an example diagram of internal path coordination provided by an embodiment of the present invention;
[0019] Figure 6 It is a schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0020] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and a detailed implementation method and a specific operation process are given. Obviously, the described embodiment is only a part of the embodiment of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present invention.
[0021] like Figure 1 As shown, the present invention provides a Sketch data processing method based on the collaboration of a programmable switch and a DPU, constructs a processing method for automatically offloading Sketch tasks to a fast path and a normal path, and coordinates the performance of both. The workflow can be divided into the following three steps:
[0022] Step S1: Task transformation. Step S1 accepts any user task as input. In the face of highly heterogeneous tasks, it abstracts the input task into a set of basic operations in a unified way. These basic operations can shield the low-level hardware implementation and allow users to express tasks intuitively.
[0023] Specifically, the process of task conversion in step S1 includes the following sub-steps:
[0024] S1-1: Analyze the Sketch data form to understand its characteristics. Sketch data can be directly regarded as a collection of key-value pairs. The key represents the index of the value in the Sketch data structure, and the value represents the value of the Sketch counter indexed by the key.
[0025] S1-2: Analyze Sketch data processing requirements to understand its characteristics. Users' requirements for Sketch data processing can be summarized into the following three points:
[0026] (1) Select and process a portion of the Sketch data, for example, inspect the data collected at the ingress switch to identify DDoS flows, detect events in data from a certain period, or merge data from multiple periods and multiple switches.
[0027] (2) Decode the encoded Sketch data.
[0028] (3) Determine the traffic statistics targets in the Sketch data, including: the number of packets / bytes of the flow, existence statistics indicating whether a given flow is recorded by the Sketch data, maximum / minimum statistics for extracting the maximum or minimum value of a given flow from the Sketch data, and distinction statistics for counting the number of different values of a given flow in the Sketch data.
[0029] S1-3: Divide operations into three categories, corresponding to the three types of Sketch data processing requirements in S1-2.
[0030] Operation category 1: data filtering, which aims to filter out Sketch data of interest, including the following operations: (1) filtering, filtering certain parts of Sketch data according to user-specified conditions, for example, filtering out counters with values equal to zero; (2) merging, summarizing Sketch data collected from different switches or periods.
[0031] Operation category 2: Data results, mainly decoding Sketch data, including operation decoding, decoding the collected Sketch data to restore the original Sketch data.
[0032] Operation category 3: Data conversion, converting Sketch data into flow-level statistics, including the following operations: (1) existence, checking whether the Sketch data records the flow; (2) maximum / minimum, obtaining the maximum / minimum value of the flow; (3) flow number estimation, obtaining the number of different flows recorded by the Sketch data.
[0033] Step S2: Process the basic operation set through the automatic task segmentation algorithm to obtain the optimal offloading solution for the basic operation set on the fast path and the normal path. Given a set of tasks, let the user first indicate which servers and smart network cards support which tasks. For example, the user can specify that two servers are assigned to each task. When a task is assigned to multiple servers, the smart network card on each server will become an instance of the normal path for processing Sketch data based on the task. In addition, different tasks share the same fast path.
[0034] For each task, step S2 needs to perform four sub-steps:
[0035] S2-1: Decompose each input task into a set of operations and analyze the resource consumption of each operation.
[0036] Offloading operations to the fast path can improve program performance and scalability. Since fast path resources are limited, it is necessary to understand the switch resource consumption of each operation type to prevent fast path resource saturation during offloading. The analysis of operation resource consumption is completed in the following four stages.
[0037] Phase 1: For each operation, it is necessary to determine whether it can be implemented in the fast path. If an operation meets one of the following two rules, it cannot be implemented on the fast path:
[0038] 1. Using floating point variables or loops;
[0039] 2. An instruction that is not supported by the switch ASIC pipeline is used.
[0040] According to these rules, among the six operations described in S1-3, only the decoding operation cannot be implemented on the fast path due to its complex decoding algorithm. That is, the filtering operation, the merging operation, the existence operation, the maximum / minimum operation, and the stream number estimation operation can be deployed on the fast path.
[0041] Phase 2: Determine the implementation of the operation in the fast path.
[0042] The input Sketch data is in the form of key-value pairs, each of which corresponds to a header and a parser in the fast path. When a key-value pair reaches the fast path, the parser in the fast path extracts its value and fills it into the header input of subsequent operations.
[0043] The following are the specific implementations of 5 of the 6 operations described in S1-3 that can be implemented in the fast path:
[0044] The filtering operation uses a match-action table, where each rule matches a set of fields in the input key-value pair.
[0045] The merge operation requires a register array in the fast path. For the two sets of Sketch data that need to be merged, the first set of data is first placed in the register array, where the key of the data is used as the index of the array and the value is stored in the corresponding register. Then, for each key-value pair of the second set of data, the key is used to index to its corresponding register, and the value is added to the value stored in the register to obtain the merged data.
[0046] Existence operations use a match-action table where each rule matches a specific key or value. If a key-value pair in the Sketch data matches a rule, the operation records the pair. If a rule is not matched after a timeout, the operation returns a value indicating that it was not found.
[0047] The maximum / minimum operation uses a single register in the fast path. When the key-value pair reaches the fast path, its value is compared with the register value, which is initialized to zero (for maximum operations) or MAXINT (for minimum operations). If the value is higher / lower than the register value, the register records the value. When all values have passed through the register, the value in the register is the result of the operation.
[0048] The stream count estimation operation uses the register array to build a hash table. For each distinct value v, the fast path hashes v to obtain an index that addresses the hash table entry. If the entry is empty, v is inserted into the entry. The final operation returns the number of non-empty entries as the number of distinct values.
[0049] For the flow number estimation operation, a key point is how to mitigate hash conflicts. Due to the skewness of traffic in production networks, most Sketch counters are recorded as 0, and only a few hash table entries are recorded as non-zero values. Therefore, when a conflict occurs, if the new value is zero, the fast path will discard the new value, otherwise, call a new hash function to address another table entry. If the new table entry is empty, the new value is inserted into the table entry. Otherwise, it will repeat the above process. However, repeatedly addressing different table entries is challenging because the fast path disables loops. In response, the present method utilizes recirculation, that is, recirculating the new value on the fast path to access the hash table again. This method has three benefits. (1) It does not use loops and adapts well to the one-pass nature of the fast path. (2) It avoids consuming normal switch throughput because the value is circulated in the internal pipeline. This pipeline is isolated from the normal pipeline that processes Sketch data and is dedicated to processing loops and synthetic packets. (3) Since most table entries are recorded as zero, the conflicting value can quickly find an empty table entry after several recirculations. Figure 4 Demonstrates operation in the face of hash collisions.
[0050] Phase 3: Given the above implementation, analyze the switch resource consumption of each operation type by using a static compilation approach. This approach calls the switch compiler to compile the implementation of each operation. The compiler reports the consumption of each type of switch resources. This approach is used because the reported consumption is fixed and will not change due to runtime dynamics (e.g., traffic workload changes).
[0051] S2-2: Extract execution dependencies between operations from each input task. It is necessary to preserve these dependencies when partitioning tasks because they determine the correctness of Sketch data processing.
[0052] Define the execution dependency between any pair of Sketch data processing operations. For any two operations Oi and O j , O j →O i The dependency relationship is expressed as O j The execution of O i The execution of O j Must be in O i After running, if one of the three conditions occurs in the task, then O j →O i Existence: 1. The read operation is after the write operation or the write operation is after the write operation. i Modification O j The data to be read or written; 2. The write operation is after the read operation. i Read O j Written data; 3. Control dependency, O i Output a variable in the if-else statement that determines whether to execute O j .
[0053] This method extracts all execution dependencies between the operations called by each input task. It builds the control flow of the task, enumerates each operation in the control flow, and determines the input and output of the operation. Then it enumerates each pair of operations. If the input and output of these operations meet a condition, the two operations are determined to be dependent on each other, and the pair of operations is filled into a set Φ to record this dependency.
[0054] S2-3: Optimal task splitting, based on the analysis result information and dependency information, divides the task into two parts, including operations offloaded to the fast path and other operations on the normal path. It has three goals, including (1) maximizing the offloading of operations to the fast path to maximize scalability; (2) preserving switch resource constraints to avoid deployment failures; (3) preserving the execution dependencies between operations to ensure the correctness of Sketch data processing.
[0055] These goals are achieved by formulating the task partitioning problem as an optimization challenge. It takes the first of the three goals mentioned above as the optimization objective, aiming to find the best decision. The remaining two objectives are encoded as constraints during the optimization process.
[0056] The following is a description of the optimization model:
[0057] Input: The input consists of the following three parts: (1) a set of operations that make up the task, Each operation Corresponding to one of the five operations (i.e., filtering operation, merging operation, existence operation, maximum / minimum operation, and flow number estimation operation). (2) The number of switch resources consumed by each operation, i.e., the analysis result of switch resource consumption. (3) The dependency relationship between operations, which is recorded in Φ.
[0058] Output: The output is a set {x(O)}: if O is on the fast path, then x(O) = 1; otherwise, x(O) = 0.
[0059] Goal: For each task the goal is to offload as much operations as possible to the fast path:
[0060] Restrictions: To ensure successful deployment of the operation, the following restrictions need to be added:
[0061] 1. Switch resource consumption limit, for all operations offloaded to the fast path, that is, operations that satisfy x(O) = 1, their cumulative resource consumption should be less than the total resource consumption of the fast path. The cumulative resource consumption is obtained by adding the analysis results. The total resource consumption of the fast path can be obtained directly from the switch compiler report.
[0062] 2. Execution dependency restrictions. In order to maintain dependencies, this method adopts a two-pronged restriction to maintain each dependency O in Φ j ∈O i Case 1: x(O i )=1. Operation O i is placed on the fast path. Depends on O i Operation j It can be placed on either the fast path or the normal path. (1) If x(O j )=1, that is, O j Also placed on the fast path, limiting the placement of O j The first switch pipeline stage must occur before placing O i After the last level. (2) If x(O j )=0, that is, O j If it is on the normal path, no additional restrictions are introduced, because the normal path is always called after the fast path, satisfying O j →O i . Case 2: x(O i )=0. Operation O i is placed on the common path. Therefore, x(O j )=0 is always true. Otherwise, O j Must be in O iThis violates the dependency. Therefore, this method restricts the normal path to O in its control flow. j Previously executed O i .
[0063] S2-4: Operation deployment. After the optimal task division in S2-3, the operations corresponding to the tasks are divided into two groups, namely, the operations offloaded to the fast path and the operations on the normal path.
[0064] For collections That is, the operations that are offloaded to the fast path, this method converts their operations into data plane programs that are acceptable to the fast path. Specifically, this workflow has five steps: (1) Each operation is converted into a code element corresponding to its fast path implementation. (2) The elements in the fast path control flow are chained according to the original execution order of the operations specified in the task. (3) The format of the input data in the header is defined. At the beginning, the fast path extracts the value from the input data and records it in the header. Then, it passes the header to the element in the control flow to perform the operation. (4) This method inserts coordination logic at the end of the fast path to achieve correct task execution between devices. (5) The data plane program is input into the switch compiler, which converts the data plane program into the underlying configuration and loads it into the switch ASIC pipeline.
[0065] For collections That is, the operations on the normal path. This method converts the operations of the task into a C++ program and executes it on the normal path. The conversion steps are as follows: (1) According to the order between the operations in the task, these operations are linked in sequence in the C++ program. (2) The C++ program is directly run on the CPU core of the smart NIC of the normal path. If the normal path has multiple instances (when the user assigns multiple servers to the task), each instance runs the same C++ program.
[0066] Step S3: Fast path and normal path collaboration. To address the performance gap between the O(10 tbps) fast path and the O(100 gbps) normal path, and to prevent the normal path from being saturated when processing a large amount of Sketch data, the intermediate results of Sketch data processing in the fast path are transferred to the normal path for subsequent processing, and stateful packet processing and sending rate control are used to minimize the collaboration overhead.
[0067] The distribution of operations can be divided into three cases: (1) All operations are executed in the fast path. In this case, the fast path needs to generate a state package to carry the operation results and send the state package to the normal path; (2) Some operations are executed in the fast path and some operations are executed in the normal path. In this case, the fast path needs to send the intermediate results of Sketch data processing to the normal path through the state package; (3) All operations are executed in the normal path. The fast path only needs to transfer Sketch data represented by key-value pairs to the normal path.
[0068] This step uses S3-1 stateful packet processing and S3-2 sending rate control in the fast path to minimize coordination overhead.
[0069] S3-1: Status packet processing.
[0070] Synthetic state packets are created in the fast path without affecting the normal switch throughput. The purpose of these state packets is to retrieve the results of offload operations, namely merge, maximum and minimum. The results of these operations are stored in registers. Each state packet has a register address, indexes to the correct register through the address, and loads the register data on its packet header field. If all state packets have been sent to the normal path, the fast path completes the state packet processing task.
[0071] In order to prevent the processing of state packets from occupying the normal switch bandwidth and interfering with the processing of Sketch data, the fast path only processes the state packets in the internal pipeline and isolates them from the normal bandwidth. At the same time, in order to avoid overloading the internal pipeline, this method limits the number of state data packets. According to previous studies, most Sketch data is recorded as zero due to the influence of traffic skewness. Therefore, if a register is recorded as zero, its value does not need to be transferred. Therefore, the fast path only generates state packets for non-zero registers. In addition, this method minimizes the length of the state packet and only records the register index and value.
[0072] S3-2: Sending rate control.
[0073] Regardless of whether the fast path sends state packets or Sketch data to the normal path, the sending rate needs to be limited to avoid saturation of the normal path. i represents the processing capacity of the i-th normal path instance, and there are K instances processing the normal path Sketch data processing of a given task in parallel. The fast path is connected to the K normal path instances through K ports. In this case, its rate control includes three stages.
[0074] Phase 1: The fast path decides which instance to send the key-value pair (denoted by P) corresponding to the state package or Sketch data. By default, it uses a round-robin method to dispatch P to one of K instances. It enables users to use other methods, for example, to distribute key-value pairs based on the hash result of the key.
[0075] Phase 2: For the i-th normal path instance, the time when the fast path sends the first P to this instance is recorded as
[0076] Phase 3: When issuing a subsequent P to the i-th instance, the fast path records the current time as t i . Let l denote the size of P. If Then releasing P may overload the i-th instance. The fast path simply recycles P until the inequality fails. Once it releases P, it i From 0 to t i .
[0077] Figure 5 The collaboration of internal paths in this method is shown, and the fast path runs a merge operation to merge the Sketch data of two periods into four registers. At T1, the fast path creates the first state packet P1 to carry the first register data. Assume that there are K=2 normal path instances. The fast path chooses to send the first instance of P1 through polling. At T2, P2 undergoes a similar workflow and is sent to the second instance. At T3, the fast path observes zeros in the register data, so there is no need to issue P3. At T4, the fast path finds that issuing P4 may overwhelm the first instance (i.e., l / (T4-T1)>C1). Therefore, it stops sending P4 through recycling. At T5, l / (T5-T1)≤C1, at which time the fast path determines that P4 can be sent safely.
[0078] Example 1
[0079] This method is implemented on a 32×400Gbps Intel Tofino2 programmable switch and a 400Gbps NVIDIA BlueField-3 DPU, and a fast path and a normal path are established on these two devices respectively. Its core is executed on a separate server, receiving input tasks for Sketch data processing. The core realizes the interaction between the fast path and the normal path through the data plane driver.
[0080] The core of this method has two modules. (1) It presents the Sketch data processing operation library to the user and accepts the input task. It then performs automatic task splitting to split each task and solves the offload problem through Gurobi optimal solution. (2) Based on the solved decision, this method uses two drivers to deploy the operation. The first driver sends the offload end operation to the switch operating system, compiles and installs these operations to the fast path in the application-specific integrated circuit pipeline, and the second driver sends other operations to the SoC core of the smart network card to execute the operation through DOCA.
[0081] The fast path of the switch application-specific integrated circuit pipeline receives Sketch data represented by key-value pairs. For each pair of values, it parses and records the value in the header, which matches the header type to determine which task's operation to handle the pair. The packet generator and fast path are used to create state packets, using intra-switch timestamps to support send rate control.
[0082] The normal path runs on the SmartNIC SoC CPU core, which parses the received state packets or key-value pairs and extracts their data to perform the remaining operations in Sketch data processing. Once all operations are completed, it seals the final results in RDMA (Remote Direct Memory Access) requests, which are written to the host memory as input to the application.
[0083] Accordingly, the present application also provides an electronic device, comprising: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the Sketch data processing method based on the collaboration between the programmable switch and the DPU as described above. Figure 6 As shown, it is a hardware structure diagram of any device with data processing capability where the Sketch data processing method based on programmable switch and DPU cooperation provided by the embodiment of the present invention is located, except Figure 6 In addition to the processor, memory and network interface shown, any device with data processing capability in which the apparatus in the embodiment is located may also include other hardware, generally based on the actual functions of the device with data processing capability, which will not be described in detail.
[0084] Accordingly, the present application also provides a computer-readable storage medium on which computer instructions are stored, and when the instructions are executed by the processor, the Sketch data processing method based on the collaboration between the programmable switch and the DPU as described above is implemented. The computer-readable storage medium can be an internal storage unit of any device with data processing capabilities described in any of the foregoing embodiments, such as a hard disk or a memory. The computer-readable storage medium can also be an external storage device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), an SD card, a flash card (Flash Card), etc. equipped on the device. Furthermore, the computer-readable storage medium can also include both an internal storage unit and an external storage device of any device with data processing capabilities. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capabilities, and can also be used to temporarily store data that has been output or is to be output.
[0085] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A Sketch data processing method based on the collaboration between a programmable switch and a DPU, characterized in that: The method comprises: Convert Sketch data processing tasks into a set of basic operations; The basic operation set is processed by the automatic task segmentation algorithm to obtain the optimal offloading solution of the basic operation set on the fast path and the normal path; According to the optimal offloading scheme of the basic operation set on the fast path and the normal path, the fast path and the normal path collaborate to complete the Sketch data processing task; during operation, the Sketch data stream first reaches the fast path, and the fast path and the normal path respectively perform the corresponding Sketch data processing operations. At the same time, the fast path will control the rate of sending Sketch key-value pair data to the normal path to prevent the normal path from being saturated.
2. According to claim 1, a Sketch data processing method based on the collaboration between a programmable switch and a DPU is characterized in that: The process of converting Sketch data processing tasks into a set of basic operations includes: Analyze the characteristics of Sketch data; the Sketch data is a set of key-value pairs, where the key represents the index of the value in the Sketch data structure, and the value represents the value of the Sketch counter indexed by the key; The Sketch data processing requirements are divided into: processing selected Sketch data, decoding encoded Sketch data, and obtaining stream-level Sketch data statistics; According to the Sketch data processing requirements, the Sketch data processing operation types and their specific operations are divided; including: The first operation type: data filtering; the data filtering is used to filter out the required Sketch data, including filtering operations and merging operations; The second operation type: data decoding; the data decoding mainly decodes the encoded Sketch data, including a decoding operation; The third operation type: data conversion; the data conversion is used to convert Sketch data into flow-level statistical data, including existence operations, maximum / minimum operations, and flow number estimation operations.
3. According to claim 1, a Sketch data processing method based on the collaboration between a programmable switch and a DPU is characterized in that: The process of processing the basic operation set through the automatic task segmentation algorithm and obtaining the optimal offloading solution of the basic operation set on the fast path and the normal path includes: Perform resource analysis and dependency extraction on the basic operation set, and divide the basic operation set into operations offloaded to the fast path and operations on the normal path according to the resource analysis results and the dependency extraction results; Deploy the operations on the divided fast path and the operations on the normal path.
4. A Sketch data processing method based on the collaboration between a programmable switch and a DPU according to claim 1, 2 or 3, characterized in that: The process of resource analysis for the basic operation set includes: Determine whether the basic operation can be implemented on the fast path, so as to determine the basic operations that can be implemented on the fast path; the judgment process is: if the operation meets any of the following two rules, it is not implemented on the fast path: (1) Using floating-point variables or loops; (2) An instruction that is not supported by the switch application-specific integrated circuit pipeline is used; The input of the operation is Sketch data abstracted as key-value pairs. Each key-value pair consists of a data packet header and a parser. The static compilation method is used to further measure the switch resources consumed by each type of operation. The switch compiler is called to compile the implementation of each operation. The compiler reports the consumption of each type of switch resources.
5. A Sketch data processing method based on the collaboration between a programmable switch and a DPU according to claim 1 or 3, characterized in that: The process of extracting dependencies for a set of basic operations includes: First, define the dependency relationship between any pair of Sketch data processing operations. i and O j , depends on O j →O i Indicates O j The execution of O i , O j Must be executed on O i After that, if one of the following three conditions occurs in a task, O j →O i exist:
1. The read operation is after the write operation or the write operation is after the write operation. i Modification O j the data read or written; 2. Write operation is after read operation, O i Read O j Written data; 3. Control Dependence, O i Output a variable in the if-else statement that determines whether to execute O j , extract all execution dependencies between the operations called by each input task, build the control flow of the task, enumerate each operation in the control flow, and determine the input and output of the operation, then enumerate each pair of operations. If the input of one operation matches the output of another operation, it can be determined that the two operations are interdependent, and fill the pair of operations into a set Φ to record this dependency.
6. A Sketch data processing method based on collaboration between a programmable switch and a DPU according to claim 1 or 3, characterized in that: The process of dividing the basic operation set into operations offloaded to the fast path and operations on the normal path according to the resource analysis result and the dependency extraction result includes: According to the resource analysis results and dependency extraction results, the basic operation set is divided into operations offloaded to the fast path and operations on the normal path; The optimization goal is to offload as many operations in the basic operation set as possible to the fast path. The first constraint condition is set as: complying with switch resource restrictions; The second constraint is set as: follow the execution dependencies between operations, and achieve these goals by transforming the basic operation set partitioning problem into an optimization problem; The input is: (1) Each task consists of a set of operations, Indicates that each operation corresponds to one of the operations that can be implemented in the fast path; (2) Each operation consumes a portion of switch resources, i.e., the analysis result of switch resource consumption; (3) A set Φ that records the dependencies between different operations; The output is a set {x(O)}: if O is on the fast path, then x(O) = 1; otherwise, x(O) = 0; The goal of each task is to offload as much operations as possible to the fast path: Constraints are required to ensure successful deployment of operations, mainly including:
1. Switch resource consumption. For all operations offloaded to the fast path, i.e., operations satisfying x(O)=1, their cumulative resource consumption should be less than the capacity of the fast path. The cumulative resource consumption is obtained by adding the resource consumption analysis results. The capacity of the fast path is directly obtained from the report of the switch compiler.
2. Execution dependency. To maintain dependencies, keep each dependency O in Φ j →O i ; Case 1: x(O i )=1, that is, operation O i is placed on the fast path, which depends on O i Operation j It can be placed on the fast path or the normal path; if x(O j )=1, that is, O j is also placed on the fast path, you need to limit the placement of O j The first switch pipeline stage must be located at the placement O i After the last level; if x(O j )=0, that is, O j If it is on a normal path, no additional restrictions are introduced; Case 2: x(O i )=0, that is, operation O i is placed on the normal path, it must be ensured that x(O j )=0 holds, otherwise, O j Will definitely be in O i This violates the dependency, and the normal path must be executed before O in its control flow. j Previously executed O i .
7. According to claim 3, a Sketch data processing method based on the collaboration between a programmable switch and a DPU is characterized in that: The process of deploying the operations on the divided fast path and the operations on the normal path includes: For collections Translate its operations into data plane programs acceptable to the fast path, including: Each operation is converted into a code element corresponding to its fast-path implementation; Chain the elements in the fast-path control flow in the original execution order of the operations specified in the task; Define the format of the input data in the header. At the beginning, the fast path extracts the value from the input data and records it in the header. Then, it passes the header to the element in the control flow to perform the operation. Insert coordination logic at the end of the fast path to achieve correct task execution between devices; Input the data plane program into the switch compiler, which converts the data plane program into the underlying configuration and loads it into the switch application-specific integrated circuit pipeline; For collections The operations of the task are converted into C++ programs and executed on the common path. Different operations are linked in the C++ program according to the order between the operations in the task. The C++ program is run directly on the CPU core of the Smart NIC of the common path. If there are multiple instances of the common path, each instance runs the same C++ program.
8. The Sketch data processing method based on the collaboration between a programmable switch and a DPU according to claim 1, characterized in that: According to the optimal offloading scheme of the basic operation set on the fast path and the normal path, the process of collaborating between the fast path and the normal path to complete the Sketch data processing task includes: State packet processing: Create a composite state packet on the fast path. The state packet is used to retrieve the results of the offload operations, namely merge, maximum and minimum. The results of these operations are stored in registers. Each state packet has a register address. It indexes to the correct register through the address and loads the register data on its packet header field. If all state packets have been sent to the normal path, the fast path completes the state packet processing task; Sending rate control: It is necessary to control the sending rate of status packets or Sketch data to avoid saturation of common paths. i It represents the processing capacity of the i-th normal path instance, and there are K instances that process the normal path Sketch data of a given task in parallel. The fast path is connected to the K normal path instances through K ports. The fast path first decides to which instance to send the state packet or key-value pair (represented by P), and uses a loop to distribute P to one of the K instances. It also allows users to use other methods for distribution. Secondly, for the i-th normal path instance, the fast path records the time when P is first sent to the instance as When issuing a subsequent P to the i-th instance, the fast path records the current time as t i , let l represent the size of P, if Then releasing P may overload the i-th instance, in which case the fast path recycles P until the inequality fails. Once it releases P, it Change to t i .
9. An electronic device, comprising a memory and a processor, characterized in that: The memory is coupled to the processor; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the Sketch data processing method based on the collaboration of a programmable switch and a DPU as described in any one of claims 1-8 above.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by the processor, the Sketch data processing method based on the collaboration between a programmable switch and a DPU as described in any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Network flow cardinal number online real-time estimation method based on sketch structure
CN113360532A
Differential privacy big data processing method based on programmable switch
CN115480917A
Universal sketch configuration method based on programmable switch
CN115484157A
Passive measurement method and device for high-speed network flow
CN115834427A
Cross-device multi-application service performance evaluation method and system
CN116389300A