Network measurement scheme capable of realizing cross-platform deployment

Through the two-stage Sketch algorithm of the Heavy-Holde data structure, the accuracy and efficiency problems of the existing network measurement algorithm when recording elephant flow and mouse flow are solved, cross-platform deployment is achieved, and the accuracy of network measurement and equipment are significantly improved. efficiency.

CN118659891APending Publication Date: 2024-09-17SHENZHEN UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410236427.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-01
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

It is difficult for existing network measurement algorithms to simultaneously record elephant flows and mouse flows with high precision and speed, and cannot be deployed across platforms, which affects the measurement accuracy of elephant flows when there is insufficient memory.

Method used

Using the Heavy-Holde data structure, a two-stage Sketch algorithm, the elephant flow part is updated through the MJRTY algorithm, and combined with CM-Sketch to process the light flow part, using hash tables and counters to record and process the elephant flow and mouse flow respectively, which is suitable for Equipped with CPU and P4 platform to achieve cross-platform deployment.

Benefits of technology

Under the same memory conditions, Heavy-Holder is more accurate and efficient than existing algorithms. It can detect elephant flows with a precision and recall rate of more than 99.8%, and improve the work efficiency of the device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118659891A
    Figure CN118659891A
Patent Text Reader

Abstract

The invention relates to the technical field of measuring scheme accessory devices, in particular to a cross-platform deployable network measuring scheme, which can pass through a brand new data structure called Heve-Holder, is different from the existing single-stage Sketch algorithm, is a two-stage Sketch, can separate elephant flow and mouse flow for storage, and can realize cross-platform deployment of the elephant flow and the mouse flow. According to the method, the precision of mouse flow measurement can be guaranteed while the precision of elephant flow measurement can be met, cross-platform deployment can be achieved, the Heve-Holder is achieved on a CPU platform and a P4 platform, experimental results show that in different measurement tasks, compared with a current advanced algorithm, the Heve-Holder has excellent performance, the Heve-Holder is a two-stage Sketch, the algorithm is simple, the algorithm is easy to implement, and the method is suitable for large-scale popularization and application. The elephant stream is stored by referring to the update thought of the MJRTY algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of measurement scheme accessory devices, and in particular to a network measurement scheme that can be deployed across platforms. Background Art

[0002] As we all know, with the rapid development of science and technology in today's society, computer networks have become an indispensable part of people's daily life, study and office. However, with the increasing scale of network use, especially for large data centers, the risks brought by the network are also increasing. Network congestion, attack scanning and DDos (distributed denial of service) attacks are causing harm to the network all the time. In this case, network measurement is extremely important. Network measurement provides indispensable information for service quality, congestion control, capacity planning, network operation, network accounting and billing, and anomaly detection in data centers and backbone networks. According to research, data The vast majority of traffic in the flow is small flow, called mouse flow, and only a small part of the flow is heavy flow, also called elephant flow. However, it is this small part of elephant flow that occupies 80% of the bandwidth in the network. Mouse flow does not cause any harm, and accurately recording mouse flow will not help network measurement at all. On the contrary, it will waste a lot of time and space. In the case of severe memory shortage, it will affect the measurement of elephant flow. Therefore, a good measurement algorithm should be developed for elephant flow, and record elephant flow as accurately, quickly and universally as possible. However, most of the existing data flow algorithms do not take into account six measurement tasks at the same time, but only one or more measurement tasks. Summary of the invention

[0003] In order to solve the above technical problems, the present invention provides a new data structure, called Heavy-Holde, which is different from the existing single-stage Sketch algorithm. It is a two-stage Sketch that can store the elephant flow and the mouse flow separately. It can meet the requirements of measuring the accuracy of the elephant flow while ensuring the accuracy of the mouse flow measurement. Secondly, it can be deployed across platforms. We have implemented Heavy-Holder on both the CPU platform and the P4 platform. Experimental results show that Heavy-Holder has excellent performance in different measurement tasks compared with the current advanced algorithms.

[0004] A network measurement solution that can be deployed across platforms of the present invention includes Heavy-Holder, which is a two-stage Sketch. The elephant flow is stored by referring to the update idea of ​​the MJRTY algorithm. Each bucket stores three fields: flow ID, number of votes and weight. Given an incoming data packet with a flow ID of f, the following three situations will occur:

[0005] S1: If there is no record in the bucket, f is considered to be a new flow, and it is inserted into the bucket, increasing the number of votes and weight;

[0006] S2: If the ID is the same as the stream ID in the bucket, the vote count and weight will be increased. Otherwise, the weight will be decreased;

[0007] S3: The weight is less than 0, evict the flow from the bucket and insert f into it.

[0008] The data structure including the Heavy-Holder consists of two parts: the heavy flow part that records the elephant flow and the light flow part that records the mouse flow:

[0009] S1: The reflow part includes: The reflow part is a hash table associated with the hash function H(·); Each bucket in the reflow part records the flow information: flow ID, vote count and weight. The vote count records the number of packets belonging to this flow (flow size). The weight records the weight of the packet. When the weight is greater than zero, it means that this flow has the right to use this bucket; when the weight is less than zero, it means that this flow has lost the right to use this bucket and needs to be expelled;

[0010] S2: The light flow part includes: The light flow part is a CM-Sketch; CM-Sketch is composed of d arrays (L1, L2, ..., L d ), each array has an associated hash function, and each array has w counters. The insertion process is as follows: given an incoming data packet, CM-Sketch first extracts the flow ID, then calculates the hash values ​​of d hash functions respectively to locate a counter in each array, and finally increases the counters corresponding to the d arrays by 1. The query is equivalent to the insertion: for the flow ID to be queried, first calculate the hash value through d hash functions, then take out the corresponding counter values ​​in d arrays, and finally report the smallest counter value as the measurement result.

[0011] Preferably, the update algorithm also includes initializing all counters in the buckets of the heavy-flow part and the light-flow part of the Heavy-Holder to 0 before the data stream is input, and the input data packet will be inserted into the heavy-flow part by default, and the judgment is made according to the result of the insertion of the heavy-flow part. If the insertion is successful in the heavy-flow part, the update algorithm ends, otherwise, it is determined according to the value of the weight whether to expel the data stream to the light-flow part, and it needs to be inserted into the light-flow part, so it needs to be further inserted into the light-flow part; the operation scheme is as follows:

[0012] Given an incoming packet with flow ID f, use the hash function to hash it into bucket H[h(f)%B], where B is the number of buckets in the heavy flow part, and the elements stored in the bucket of the heavy flow part are (K i , V i, W i );

[0013] Determine the K in the bucket i Is it 0? If K i is 0, indicating that data packet f is the first flow mapped to the bucket, then update K i =f, V i =1, W i =1, insertion ends;

[0014] If K i If it is not 0, then we need to consider two cases. The first case is K i The identifier of flow f is the same, indicating that the data packet f and the data packet stored in the bucket belong to the same data flow, so simply update K i =f, V i =V i +1, W i =W i +1, insertion ends;

[0015] The second case is K i The identifier of flow f is different, indicating that a hash collision occurs between data packet f and the data packet stored in the bucket. At this time, only W is updated. i W i –1, for the updated W i Make a judgment, if the updated W i It is still greater than or equal to 0, indicating that the flow currently stored in the bucket is an elephant flow, and the mouse flow collides, thus reducing the weight number W in the bucket. i , does not reduce its vote count V i , its weight is reduced by 1, and flow f needs to be inserted into the light flow part.

[0016] Updated W i If it is less than 0, it means that the elephant flow currently stored in the bucket is the assumed elephant flow, which will be replaced by the elephant flow; this is to update the heavy flow part K i =f, V i =V i +1, W i =W i +1, and remove the assumed elephant flow and light flow part originally in the bucket. The value of the light flow part is not 1, but the original V in the bucket. i ;

[0017] The insertion of light flows is done strictly according to the update strategy of CMSketch. The data packet f is hashed d times to obtain d hash values. The corresponding position in the d arrays is found and its count is increased by the corresponding value.

[0018] Preferably, the query further includes estimating the flow value of a single flow f(k) after all input data flows are updated to Heavy-Holder, first searching the heavy flow part of each flow, calculating a hash value f for the flow identifier according to the same hash function, and then determining the location B[i] of the storage bucket, and then judging K in the bucket. i Is it equal to f? If they are equal, report the corresponding V in this bucket i As an estimated value of stream f, if they are not equal, you need to search in the light stream part. This stream f will calculate d hash values ​​based on d different hash functions, and then take out the value from the bucket corresponding to each array based on this hash value. Finally, report the smallest value among these values ​​as an estimated value of stream f, and the query ends here.

[0019] Preferably, the P4 version adaptation also includes adaptation for using registers to store data, using stateful algorithms and logic units (stateful ALUs) at each stage of the switch to search and update entries in the register array, given a flow ID, given an incoming data packet with a flow ID of f1, to run in steps, trying to insert the heavy flow part several times, and if it fails, inserting the light flow part.

[0020] Preferably, the platform data structure also includes the pipeline process that the data flow goes through in the P4 platform. After the data flow enters the switch, it will be parsed by the parser, and the data packet header will be parsed according to the given logic, and then enter the pipeline. Each pipeline of the P4 platform has 12 stages, each stage does not interfere with each other, and has a strict progressive order. According to the adaptation made, stage 0 and stage 1 will be used to store (ID, weight) and (ID, number of votes) respectively. The register in stage 1 will respond to the return value of the register in stage 0.

[0021] Preferably, the main process of the platform also includes that due to the limitation of the P4 language, no more than four judgment conditions are allowed inside the register, so the data flow has to be screened under limited conditions. The following is the specific process implemented by the P4 platform:

[0022] S1: All flows will find the corresponding bucket in the register through a hash value mapped by the hash function. This flow will complete the first step in the weight register and determine whether this flow is a large flow according to the MJRTY algorithm. The corresponding source code has been given in Algorithm 1. The specific situation is as follows:

[0023] (1) Case 1: f≠f1, count≠0, which means that only a hash collision has occurred, but there is no eviction. Therefore, the count value is reduced by 1, and 1 is returned to indicate that everything is normal.

[0024] (2) Case 2: It is the opposite of Case 1 and can be divided into the following two cases:

[0025] Solution 1: f≠f1, count=0. This indicates that not only a hash collision has occurred, but also eviction has occurred. This is because when the flow IDs are not equal, count should be subtracted by 1. However, if it is subtracted again, it will be a negative number. Therefore, we change the idea, add 1 to count, store f in the bucket, and return 0 to indicate eviction has occurred.

[0026] Solution 2: f = f1. Regardless of the value of count, the value of count will be increased by 1, and 1 will be returned to indicate that everything is normal.

[0027] After the steps just now, it is possible to determine whether a flow can continue to be stored in the large flow part. Next, the count register needs to be updated. The corresponding source code has been given in Algorithm 2. Note that polar = 0 means that a flow is determined to be expelled, and it is determined that the current flow is a flow that should be stored in the large flow part, so the ID and count in the bucket are updated.

[0028] Compared with the prior art, the beneficial effects of the present invention are as follows: in the process of executing the test task, under the same memory conditions, Heavy-Holder has better accuracy than CM, CU, Count and MV-Sketch. When using 600KB of memory, the ARE of Heavy-Holder is 5.1, 3.4, 10 and 25 times lower than CM, CU, Count and MV-Sketch respectively. For abnormal flow size detection, for most memory sizes, Heavy-Holder is much more accurate than the other five algorithms. Even if the memory is less than 200KB, Heavy-Holder can achieve an accuracy and recall rate of more than 99.8%. But if Figure 6 As shown in the figure, the ARE of Heavy-Holder is only 0.000983, which is much lower than the other five algorithms. We found that the F1 score of Heavy-Holder always reaches above 99.7%, while the best F1 score of other algorithms is 97%. Although the F1 score of MV-Sketch is also above 94%, Figure 8As shown, when using 200KB, 600KB and 1000KB of memory, the ARE of Heavy-Holder is 13.9 and 8.0% lower than that of MV-Sketch, respectively. This allows the scheme to take into account the operating efficiency of different data flows while ensuring a better algorithm, thereby improving the working efficiency of the equipment and increasing the practicality of a network measurement solution that can be deployed across platforms. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 It is a schematic diagram of the overall process of the present invention;

[0030] Figure 2 It is a data structure diagram of the Heavy-Holder of the present invention;

[0031] Figure 3 It is a data structure diagram of the P4 version Heavy-Holder of the present invention;

[0032] Figure 4 It is a schematic diagram of the ARE structure of flow size estimation of the present invention;

[0033] Figure 5 It is a schematic diagram of the ARE structure of abnormal large flow estimation of the present invention;

[0034] Figure 6 It is a schematic diagram of the F1 score structure of abnormal large flow estimation of the present invention;

[0035] Figure 7 It is a schematic diagram of the F1 score structure of the abnormal large change flow estimation of the present invention;

[0036] Figure 8 It is a schematic diagram of the ARE structure of abnormal large change flow estimation of the present invention;

[0037] Fig. 9 is a schematic diagram of the WMRE structure of flow size distribution estimation of the present invention;

[0038] Fig.10 It is a schematic diagram of the RE structure of entropy estimation of the present invention;

[0039] Fig.11 It is a schematic diagram of the RE structure of the cardinality estimation of the present invention; DETAILED DESCRIPTION

[0040] The specific implementation of the present invention is further described in detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.

[0041] Embodiment: A test solution for a network measurement solution that can be deployed across platforms is as follows:

[0042] S1: CPU platform: The experiments are run on a host with an 8-core CPU (Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz). Each processor has three levels of cache: 512KB L1 cache per core, 2MB L2 cache per core, and 12MB L3 cache shared by all cores. The implementation is in C++;

[0043] S2: P4 platform: Heavy-Holder was implemented on a Tofino switch using Intel SDE 9.2.0. It was implemented using P4 language. Due to the limitation of pipeline mode, the data structure and algorithm were slightly changed, but the accuracy was not much lower than that of CPU platform.

[0044] S3: Tracking; The data set used in the experiment is CAIDA, which is the real traffic in the anonymous network collected on the backbone network of Chicago, USA. The data set file type is PCAP file, and the data traffic in it is the original anonymous data packet without the MAC layer. Here, the data flow size is defined by the number of data packets, that is, the flow value of a data packet is 1. The CAIDA4 tracking with a monitoring interval of 5s is used as the default tracking, which contains 1.1M to 2.80M data packets and 60K to 110K flows.

[0045] S4: Index; (1) Average relative error: where ψ is the number of flows, f i and They are the actual value and estimated value of the flow, respectively. From the expression, we can see that the corresponding relationship between ARE and flow value estimation accuracy is that the smaller the ARE value is, the closer the estimated value is to the actual value, that is, the higher the accuracy of flow value estimation is, and vice versa. ARE is used to evaluate the accuracy of flow size estimation and heavy hitter detection;

[0046] (2) F1 score: The PR (Precision Rate) in the formula represents the precision rate of the test result, PR = c1 / t1, t1 represents the measured value, and c1 represents the true value in t1. The smaller the PR value, the more false positive values ​​there are in the test result. The RR (Recall Rate) in the formula represents the recall rate of the test result, RR = c1 / t2, c1 has the same meaning as above, and t2 represents the actual true value. The smaller the PR value, the more false negative values ​​there are in the test result. The corresponding relationship of F1score evaluation accuracy is:

[0047] The closer the F1score value is to 1, the closer the estimated value is to the true value, that is, the more accurate the detection result is, and vice versa. Use F1 Score to evaluate the accuracy of abnormally large flows (Heavy Hitter) and abnormally large changes (Heavy Change) detection.

[0048] (3) Weighted average relative error: Where z is the maximum flow size n i and are the true value and estimated value of the flow of size i, respectively. From the expression, we can see that the corresponding relationship between the WMRE evaluation entropy accuracy is that the smaller the WMRE value, the closer the estimated value is to the true value, that is, the higher the accuracy of the frequency distribution estimation, and vice versa. Use WMRE to evaluate the accuracy of flow size distribution;

[0049] As a preferred embodiment of the above embodiment: a query specific implementation method of a network measurement solution that can be deployed across platforms also includes:

[0050] S1: For the elephant flow, if the heavy flow part has never been expelled, then this estimate is an unbiased estimate, and the reported estimate is the true value of the flow f;

[0051] S2: If eviction has occurred, it means that the large flow needs to consume as many packets as the small flow to evict it, so the estimated value reported at this time will be smaller than the actual value. But this result is acceptable. Because compared with the large flow, colliding with a small part of the value is acceptable. For the mouse flow;

[0052] S3: Most of them are concentrated in the light flow part, and CMSketch is used to estimate them. Therefore, the accuracy and error of the mouse flow measurement are similar to CMSketch. In this way, Heavy-Holder not only ensures the measurement accuracy of large flows, but also ensures that the measurement task for small flows can be carried out.

[0053] As a preferred embodiment of the above embodiment: a version adaptation solution of a network measurement solution that can be deployed across platforms also includes:

[0054] S1: Due to the limitation of the pipeline working mode of P4 switch, some very common operations cannot be implemented, such as traversal, loop, exchange, etc. Therefore, it is destined that exquisite algorithms like CUSketch cannot be implemented in P4 switch. In the basic version, it has always been emphasized that three fields (ID, number of votes, weight) are stored in a bucket. However, in the data plane of P4, due to resource limitations, only registers can be used to store these data. Because the data in the metadata is similar to a temporary variable of a function, it will be re-declared and defined when the next data packet arrives. The data update of ordinary flow tables requires the participation of the control plane. Therefore, if you want to update entries in the data plane, you can only use registers. In each stage of the switch, stateful algorithms and logic units (stateful ALUs) are used to search and update entries in the register array. However, this raises another problem, that is, each stateful ALU can only update a pair of 32-bit registers at most, that is, two fields, so the first adaptation made for this point is to split the three fields for storage. The three fields are split into (ID, weight) and (ID, number of votes) and stored in two registers respectively.

[0055] S2: Given an incoming packet with a flow ID of f1, the following three situations will occur: 1. If there is no record in the bucket, f1 is considered to be a new flow, and it is inserted into the bucket, and the number of votes and weight are set to 1. 2. If it is the same as the flow ID in the bucket, the number of votes and weight will be increased at the same time. Otherwise, if it is not the same as the flow ID in the bucket, the weight is reduced. If the weight is less than 0, the flow is expelled from the bucket and f1 is inserted into it. From this, it can be seen that to determine whether a flow can be stored in the heavy flow part, the flow ID is always looked at first, and then the weight. If the weight is reduced to 0, it will "backtrack" to update the flow ID and the number of votes. However, this cannot be done in the data plane of P4, because the pipeline works in a way that makes its processing method only forward. Assuming that the data packet is in stage 4 at a certain moment, it can only operate the actions reserved for it in stage 4, and cannot operate the data before stage 4. So the second adaptation is made: change the judgment of the flow ID first and then the weight to the weight first and then the judgment of the flow ID. That is, the physical stage of the (ID, weight) register must be before the (ID, number of votes)

[0056] S3: If only two registers are used in the heavy flow part to store the three fields of a bucket, and as long as a collision is found, it is inserted into the light flow part, then the memory resources of the switch will be greatly wasted. And it will cause such a counterproductive phenomenon: compared with the huge data packet entries, the number of storage buckets in the heavy flow part is negligible, so the heavy flow part only stores a small part of the elephant flow, and most of the flow is still inserted into the light flow part. Then there is no difference between this and CM-Sketch, except that there is an additional "filter". So in order to make more traffic stored in the heavy flow part, it should not be inserted into the heavy flow part only once, but try to insert it several times, such as three or four times. If the insertion is not successful after three attempts, then it can only be inserted into the light flow part, which will largely separate the large and small flows. So the third adaptation is made: try to insert it into the heavy flow part several times, and if it is still not successful, insert it into the light flow part.

[0057] As a preferred embodiment of the above, a main process of a network measurement solution that can be deployed across platforms also includes:

[0058] S1: f≠f1, count≠0, which means that only a hash collision has occurred, but there is no eviction, so only the count value is reduced by 1, and 1 is returned to indicate that everything is normal;

[0059] S2: f≠f1, count=0, which indicates that not only a hash collision has occurred, but also eviction has occurred. Because when the flow IDs are not equal, count should be reduced by 1. However, if it is reduced again, it will be a negative number. Therefore, we change the idea and increase count by 1, store f in the bucket, and return 0 to indicate eviction has occurred; f=f1, no matter what the value of count is, the value of count is increased by 1, and 1 is returned to indicate that everything is normal;

[0060] S3:

[0061]

[0062] S4: When updating the ID and count in the bucket:

[0063]

[0064] The terms "vertical," "horizontal," "left," "right," and the like are used herein for illustrative purposes only.

[0065] The “first”, “second” and “third” in the present invention do not represent specific quantities and orders, but are merely used to distinguish names.

[0066] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A cross-platform deployable network measurement solution, including Heavy-Holder is a two-stage Sketch that stores elephant flows by referring to the update idea of ​​the MJRTY algorithm. Each bucket stores three fields: flow ID, number of votes, and weight. Given an incoming data packet with flow ID f, the following three situations will occur: S1: If there is no record in the bucket, f is considered to be a new flow, and it is inserted into the bucket, increasing the number of votes and weight; S2: If the ID is the same as the stream ID in the bucket, the vote count and weight will be increased. Otherwise, the weight will be decreased; S3: The weight is less than 0, evict the flow from the bucket and insert f into it. It is characterized in that The data structure of Heavy-Holder consists of two parts: the heavy flow part that records the elephant flow and the light flow part that records the mouse flow: S1: The reflow part includes: The reflow part is a hash table associated with the hash function H(·); Each bucket in the reflow part records the flow information: flow ID, vote count and weight. The vote count records the number of packets belonging to this flow (flow size). The weight records the weight of the packet. When the weight is greater than zero, it means that this flow has the right to use this bucket; when the weight is less than zero, it means that this flow has lost the right to use this bucket and needs to be expelled; S2: The light flow part includes: The light flow part is a CM-Sketch; CM-Sketch is composed of d arrays (L1, L2, ..., L d ), each array has an associated hash function, and each array has w counters. The insertion process is as follows: given an incoming data packet, CM-Sketch first extracts the flow ID, then calculates the hash values ​​of d hash functions respectively to locate a counter in each array, and finally increases the counters corresponding to the d arrays by 1. The query is equivalent to the insertion: for the flow ID to be queried, first calculate the hash value through d hash functions, then take out the corresponding counter values ​​in d arrays, and finally report the smallest counter value as the measurement result.

2. A network measurement solution that can be deployed across platforms as claimed in claim 1, characterized in that: The update algorithm also includes initializing all counters in the buckets of the heavy-flow part and the light-flow part of the Heavy-Holder to 0 before the data stream is input. The input data packet will be inserted into the heavy-flow part by default, and the judgment will be made based on the result of the insertion of the heavy-flow part. If the insertion is successful in the heavy-flow part, the update algorithm ends. Otherwise, it is determined whether to expel the data stream to the light-flow part based on the value of the weight. If it needs to be inserted into the light-flow part, it needs to be further inserted into the light-flow part. The operation plan is as follows: Given an incoming packet with flow ID f, use the hash function to hash it into bucket H[h(f)%B], where B is the number of buckets in the heavy flow part, and the elements stored in the bucket of the heavy flow part are (K i , V i , W i ); Determine the K in the bucket i Is it 0? If K i is 0, indicating that data packet f is the first flow mapped to the bucket, then update K i =f, V i =1, W i =1, insertion ends; If K i If it is not 0, then we need to consider two cases. The first case is K i The identifier of flow f is the same, indicating that the data packet f and the data packet stored in the bucket belong to the same data flow, so simply update K i =f, V i =V i +1, W i =W i +1, insertion ends; The second case is K i The identifier of flow f is different, indicating that a hash collision occurs between data packet f and the data packet stored in the bucket. At this time, only W is updated. i W i –1, for the updated W i Make a judgment, if the updated W i It is still greater than or equal to 0, indicating that the flow currently stored in the bucket is an elephant flow, and the mouse flow collides, thus reducing the weight number W in the bucket. i , does not reduce its vote count V i , its weight is reduced by 1, and flow f needs to be inserted into the light flow part. Updated W i If it is less than 0, it means that the elephant flow currently stored in the bucket is a hypothetical elephant flow, which will be replaced by the elephant flow; This is the part that will update the reflow K i =f, V i =V i +1, W i =W i +1, and remove the assumed elephant flow and light flow part originally in the bucket. The value of the light flow part is not 1, but the original V in the bucket. i ; The insertion of light flows is done strictly according to the update strategy of CMSketch. The data packet f is hashed d times to obtain d hash values. The corresponding position in the d arrays is found and its count is increased by the corresponding value.

3. A network measurement solution that can be deployed across platforms as claimed in claim 2, characterized in that: The query also includes estimating the flow value of a single flow f(k) after all input data flows are updated to Heavy-Holder. Each flow is first searched for the heavy flow part, and a hash value f is calculated for the flow identifier based on the same hash function, and then the location of the storage bucket B[i] is determined, and then the K in the bucket is determined. i Is it equal to f? If they are equal, report the corresponding V in this bucket i As an estimated value of stream f, if they are not equal, you need to search in the light stream part. This stream f will calculate d hash values ​​based on d different hash functions, and then take out the value from the bucket corresponding to each array based on this hash value. Finally, report the smallest value among these values ​​as an estimated value of stream f, and the query ends here.

4. A network measurement solution that can be deployed across platforms as claimed in claim 3, characterized in that: The P4 version adaptation also includes adaptation for using registers to store data. At each stage of the switch, stateful algorithms and logic units (stateful ALUs) are used to find and update entries in the register array. Given a flow ID, an incoming packet with a flow ID of f1 is run in steps, trying to insert the heavy flow part several times. If it fails, the light flow part is inserted.

5. A network measurement solution that can be deployed across platforms as claimed in claim 4, characterized in that: The platform data structure also includes the pipeline process that the data flow goes through on the P4 platform. After the data flow enters the switch, it will be parsed by the parser, and the packet header will be parsed according to the given logic, and then enter the pipeline. Each pipeline of the P4 platform has 12 stages. Each stage does not interfere with each other and has a strict progressive order. According to the adaptation made, stage 0 and stage 1 will be used to store (ID, weight) and (ID, number of votes) respectively. The registers in stage 1 will respond to the return value of the registers in stage 0.

6. A network measurement solution that can be deployed across platforms as claimed in claim 5, characterized in that: The main process of the platform also includes that due to the limitation of P4 language, no more than four judgment conditions are allowed inside the register, so the data flow has to be screened under limited conditions. The following is the specific process implemented by the P4 platform: S1: All flows will find the corresponding bucket in the register through a hash value mapped by the hash function. This flow will complete the first step in the weight register and determine whether this flow is a large flow according to the MJRTY algorithm. The corresponding source code has been given in Algorithm 1. The specific situation is as follows: (1) Case 1: f≠f1, count≠0, which means that only a hash collision has occurred, but there is no eviction. Therefore, the count value is reduced by 1, and 1 is returned to indicate that everything is normal. (2) Case 2: It is the opposite of Case 1 and can be divided into the following two cases: Solution 1: f≠f1, count=0. This indicates that not only a hash collision has occurred, but also eviction has occurred. This is because when the flow IDs are not equal, count should be subtracted by 1. However, if it is subtracted again, it will be a negative number. Therefore, we change the idea, add 1 to count, store f in the bucket, and return 0 to indicate eviction has occurred. Solution 2: f = f1. Regardless of the value of count, the value of count will be increased by 1, and 1 will be returned to indicate that everything is normal. After the steps just now, it is possible to determine whether a flow can continue to be stored in the large flow part. Next, the count register needs to be updated. The corresponding source code has been given in Algorithm 2. Note that polar = 0 means that a flow is determined to be expelled, and it is determined that the current flow is a flow that should be stored in the large flow part, so the ID and count in the bucket are updated.

Citation Information

Cited By

  • Identifying and processing method for elephant flow in distributed energy safety data acquisition device

    CN120811990A