A super spreader detection method based on register group

By using a register group-based detection method in a high-speed network to distinguish between large and small flows in real time and conduct offline decoding, the problem of wasted storage space and reduced detection accuracy is solved, and the efficiency and accuracy of super-spreader detection are improved.

CN118555154BActive Publication Date: 2024-10-29STATE GRID ANHUI ELECTRIC POWER CO LTD +2
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411029292.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-10-29
Estimated Expiration
2044-07-30

AI Technical Summary

Technical Problem

In high-speed networks, existing super-spreader detection methods cannot distinguish large flows and small flows encountered at measurement points in real time, resulting in wasted storage space and reduced detection accuracy.

Method used

Using a register group-based detection method, a data structure is created on the SRAM during each measurement cycle, the packet information is encoded through hashing technology, and downloaded to the analysis server for offline decoding at the end of the measurement cycle to identify super-spreaders.

Benefits of technology

It achieves real-time distinction between large flows and small flows at each measurement point, improving storage space utilization efficiency and the accuracy of super-spreader detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118555154B_ABST
    Figure CN118555154B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a super-spreader detection method based on a register group, which belongs to the field of network traffic measurement. The super-spreader detection method based on a register group includes: in each measurement cycle, the router opens up a continuous memory space on the SRAM to create a data structure that records network traffic information; when a data packet arrives, the traffic information carried by the data packet is encoded into the data structure in the SRAM through hash technology; after the measurement cycle, the data structure in the current cycle is downloaded to the analysis server for offline decoding, so as to find super-spreaders. This method can distinguish between large flows and small flows encountered at each measurement point, thereby avoiding recording a large amount of element information of small flows, improving the utilization efficiency of storage space and the accuracy of super-spreader detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network flow measurement, and in particular to a super spreader detection method based on a register group. Background Art

[0002] In high-speed networks, super spreaders are generally defined as nodes with extremely high propagation power, such as hosts with too many connections. These nodes can quickly spread information to a large number of other nodes, which has a significant impact on the overall propagation dynamics of the network. Therefore, super spreader detection is widely used in functional modules such as network management and security. For example, a super spreader is likely to be an infected host connected to many other hosts for worm propagation, or a server that is flooded by a zombie host network under a DDOS attack. In the field of network measurement, we generally regard all packets with the same flow label as a flow, and the number of different elements in the flow is called the cardinality. If we further use the source address (or destination address) as the flow label and the destination address (or source address) as the element, then the task of detecting super spreaders hidden in the massive high-speed network flow is to find all flows in the network whose cardinality exceeds a given threshold. This task needs to return both the flow label and the cardinality information of the super spreader.

[0003] In order to meet the requirements of packet forwarding rate in high-speed networks, super-spreader detection methods need to use fast-updating on-chip storage (such as SRAM) to record traffic information. Since the on-chip storage space is very limited, existing research needs to use hashing and other technologies to encode traffic information online, thereby reducing the method's occupation of on-chip storage space. In simple scenarios, all data packets in the network will pass through one measurement point, and a single measurement point can be used to measure all traffic information of all flows. However, in complex scenarios, the traffic of a super-spreader is likely to pass through multiple measurement points, and each measurement point can only measure part of the traffic information of the super-spreader. Therefore, the super-spreader detection method needs to be able to merge the measurement data of multiple measurement points to detect super-spreaders from the perspective of the entire network. However, the existing methods that allow the merging of measurement data have a huge time overhead for decoding the measurement data merged from multiple measurement points or the measurement data of a single measurement point. Therefore, each measurement point cannot distinguish between the large and small flows encountered by the measurement point in real time, and can only record the element information of the large flow and the element information of the small flow together. Since the number of small flows is very large, recording the element information of large flows and small flows together indiscriminately will, on the one hand, cause the elements of small flows to unnecessarily occupy a large amount of precious on-chip storage space, resulting in a waste of on-chip storage space; on the other hand, the elements of small flows will become noise in the cardinality estimation process of large flows, reducing the accuracy of the estimated value of the cardinality of large flows, and thus leading to a decrease in the accuracy of super-spreader detection.

[0004] In order to solve the above-mentioned problems existing in super-spreader detection, the present invention aims to design a super-spreader detection method based on a register group, which can distinguish the large flows and small flows encountered at each measurement point in real time while ensuring that the measurement data of multiple measurement points can be merged, thereby avoiding recording a large amount of element information of small flows, improving the utilization efficiency of storage space and the accuracy of super-spreader detection. Summary of the invention

[0005] The purpose of an embodiment of the present invention is to provide a super-spreader detection method based on a register group, which can distinguish between large flows and small flows encountered at each measurement point, thereby avoiding recording a large amount of element information of small flows, improving the utilization efficiency of storage space and the accuracy of super-spreader detection.

[0006] In order to achieve the above object, an embodiment of the present invention provides a super spreader detection method based on a register group, comprising:

[0007] In each measurement cycle, the router allocates a continuous memory space on the SRAM to create a data structure that records network traffic information;

[0008] When a data packet arrives, the traffic information carried by the data packet is encoded into a data structure in the SRAM through hashing technology;

[0009] After the measurement cycle, the data structure in the current cycle is downloaded to the analysis server for offline decoding to find super spreaders.

[0010] Optionally, when a data packet arrives, encoding the traffic information carried by the data packet into a data structure in the SRAM by using a hashing technique includes:

[0011] Initialize all flow label fields and counter fields in the bucket array and all registers in the register array;

[0012] Obtaining the data packet;

[0013] The index of the virtual register group corresponding to the element carried by the data packet is calculated according to formula (1):

[0014] , formula (1)

[0015] in, represents the index of the virtual register set, represents a hash function with good randomness, Represents a bitwise exclusive OR operation, Indicates the flow label carried by the data packet. Indicates the elements carried in the data packet. Indicates the number of virtual registers;

[0016] The index of the physical register group corresponding to the virtual register is calculated according to formula (2):

[0017] , formula (2)

[0018] in, Represents the index of the physical register group, It is a hash function with good randomness. Indicates the number of physical register groups;

[0019] The index of the register to which the data packet is mapped in the register group is calculated according to formula (3):

[0020] , formula (3)

[0021] in, Indicates the index of the register to which the data packet is mapped within the register group. It is a hash function with good randomness. Indicates the number of registers contained in the register group;

[0022] Calculate the hash function according to formula (4) The position of the leftmost 1 in the binary encoding of the generated data packet is:

[0023] , formula (4)

[0024] in, Indicates the position of the leftmost 1 in the binary code, the function Indicates the position of the leftmost 1 in the binary code of the calculated input, let ;

[0025] exist If the value is greater than the corresponding register value, the bucket array is updated;

[0026] Determine whether the flow label is recorded in the bucket array flow;

[0027] The flow label is recorded in the bucket array. In the case of a flow, the value of the register is set to ;

[0028] There is no record in the bucket array with a flow label of In the case of a stream, the value of the register is not changed.

[0029] Optionally, the data structure consists of a A bucket array containing buckets and a The register array of register groups is composed of each bucket in the bucket array. cells, each of which contains two fields, namely the flow label field and the counter field. Bucket The flow label field and counter field of a cell are recorded as and , each register group in the register array contains registers, each of which is a 5-bit counter. The first register bank The registers are denoted as .

[0030] Optionally, the update bucket array includes:

[0031] According to formula (5), the register group is calculated The probability of being updated by any new element that hashes to its group:

[0032] , formula (5)

[0033] in, represents the probability, Represents a variable, Indicates the first The first register bank registers;

[0034] The index of the bucket to which the data packet is mapped is calculated according to formula (6):

[0035] , formula (6)

[0036] in, Indicates the index of the bucket to which the data packet is mapped, represents a hash function with good randomness, Indicates the number of buckets in the bucket array;

[0037] Determine the corresponding bucket according to the index of the bucket to which the data packet is mapped , and judge the bucket Is there a cell in The flow label is recorded as flow;

[0038] In the bucket There is a record with a flow label of Stream Cell In this case, the cell The corresponding counter field Plus ;

[0039] In the bucket There is no cell in which the flow label is In the case of a flow, determine whether a cell exists No traffic information is recorded;

[0040] In a cell If the flow information is not recorded, the cell Corresponding flow label field Set to , the cell The corresponding counter field Set to ;

[0041] Get the bucket when there is no cell that does not record traffic information The cell with the smallest counter value in , and let the cell be ;

[0042] According to formula (7), the data packet is mapped into a range in decimal :

[0043] ,Formula (7)

[0044] in, is a hash function A sufficiently large constant within the output range;

[0045] Determine the decimal Is it less than ;

[0046] In the decimal Less than In this case, the cell Corresponding flow label field Set to , the cell The corresponding counter field Set to ;

[0047] In judging the decimal Not less than In the case of The value of .

[0048] Optionally, the hash function Are independent of each other.

[0049] Optionally, after the measurement period, downloading the data structure in the current period to an analysis server for offline decoding, thereby finding super spreaders includes:

[0050] Get all bucket arrays and register arrays;

[0051] Determining whether the offline decoding is single-measurement-point offline decoding or multi-measurement-point offline decoding;

[0052] When the offline decoding is single-measurement-point offline decoding, estimating the cardinality of the flow according to the counter field of the cell in the bucket array to determine whether the flow is a super spreader;

[0053] When the offline decoding is multi-measurement point offline decoding, the register arrays of the multiple measurement points are merged, the cardinality of the flow is estimated according to the merged register array, and after the cardinality of the flow is corrected in combination with the counter field of the cell in the bucket array, it is determined whether the flow is a super spreader.

[0054] Optionally, when the offline decoding is single-measurement-point offline decoding, estimating the cardinality of the flow according to the counter field of the cell in the bucket array, and determining whether the flow is a super spreader includes:

[0055] Traversing all cells in the bucket array and determining whether the counter field of the cell is greater than a preset threshold;

[0056] When the counter field of a cell is greater than a set threshold, it is determined that the flow recorded in the flow label field corresponding to the cell is a super spreader, and the counter field corresponding to the cell is a cardinality estimate.

[0057] Optionally, when the offline decoding is multi-measurement point offline decoding, the register arrays of the multiple measurement points are merged, the cardinality of the flow is estimated according to the merged register array, and after the cardinality of the flow is corrected in combination with the counter field of the cell in the bucket array, determining whether the flow is a super spreader includes:

[0058] In When there are measurement points, traverse the bucket array of each measurement point to obtain a total flow label set and a mapping table between the flow labels and counter values ​​recorded in the bucket array of each measurement point;

[0059] The register array after merging the register arrays of each measurement point is calculated according to formula (8):

[0060] , formula (8)

[0061] in, Represents the merged register array No. The first register bank registers, Represents a variable, Indicates the number of measurement points, Indicates The first register array of the measurement point The first register bank registers;

[0062] According to formula (9), the flow label after merging multiple measurement points is calculated as follows: The cardinality of the stream:

[0063] , formula (9)

[0064] in, is the base number, Yes and The coefficients associated with the values ​​of are as follows:

[0065] , formula (10)

[0066] Correcting the base to obtain a first corrected base;

[0067] The upper bound of the cardinality is calculated according to formula (11):

[0068] , Formula (11)

[0069] in, represents the upper bound, Indicated in The flow label recorded in the bucket array of the measurement point is The single measurement point cardinality estimate of the flow is The bucket array of the measurement point does not record the flow label In the case of a flow, let , Indicates The minimum counter value in the bucket array of measurement points;

[0070] The lower bound of the cardinality is calculated according to formula (12):

[0071] , formula (12)

[0072] in, Indicates the lower bound;

[0073] Correcting the first corrected base number according to the upper bound and the lower bound to obtain a second corrected base number;

[0074] Determining whether the second correction base is greater than a preset threshold;

[0075] When the second corrected cardinality is greater than the preset threshold, the corresponding flow is determined to be a super spreader, and the cardinality estimation value of the flow is the second corrected cardinality;

[0076] When the second correction base is not greater than the preset threshold, it is determined that the corresponding flow is not a super spreader.

[0077] Optionally, the correcting the base to obtain a first corrected base includes:

[0078] According to formula (13), the first modified base is obtained:

[0079] , formula (13)

[0080] in, is the first modified base number, Indicates that the flow label is The number of registers that have a value of 0 among all registers to which the stream is mapped.

[0081] Optionally, the modifying the first modified cardinality according to the upper bound and the lower bound to obtain a second modified cardinality includes:

[0082] The second modified base is obtained according to formula (14):

[0083] , formula (14)

[0084] in, Indicates the second modified base.

[0085] Through the above technical solution, the present invention provides a super spreader detection method based on register groups. In each measurement cycle, the router opens up a continuous memory space on the SRAM to create a data structure for recording network traffic information. The data structure can be composed of a A bucket array containing buckets and a The method is composed of a register array of register groups. When a data packet arrives, the traffic information carried by the data packet can be encoded into the data structure in the SRAM through hash technology. After the measurement cycle is over, the data structure in the current cycle can be downloaded to the analysis server, so that offline encoding can be performed, and then super spreaders can be found. This method can improve the utilization efficiency of storage space and the accuracy of super spreader detection.

[0086] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0087] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:

[0088] Figure 1 is a flow chart of a super spreader detection method based on a register set according to an embodiment of the present invention;

[0089] Figure 2 is a flow chart of a super spreader detection method based on a register group according to an embodiment of the present invention, in which traffic information carried by a data packet is encoded into a data structure in an SRAM;

[0090] Figure 3 is a flowchart of updating a bucket array of a super spreader detection method based on a register group according to an embodiment of the present invention;

[0091] Figure 4 is a first flow chart of finding super spreaders in a super spreader detection method based on a register set according to an embodiment of the present invention;

[0092] Figure 5 is a second flow chart of finding super spreaders of a super spreader detection method based on a register set according to an embodiment of the present invention;

[0093] Figure 6 It is a third flow chart of finding super spreaders according to a super spreader detection method based on a register group according to an embodiment of the present invention. DETAILED DESCRIPTION

[0094] The specific implementation of the embodiment of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.

[0095] Figure 1 1 is a flow chart of a super spreader detection method based on a register group according to an embodiment of the present invention. In the present invention, the process of the detection method may include:

[0096] In step S1, in each measurement cycle, the router opens up a continuous memory space on the SRAM to create a data structure for recording network traffic information.

[0097] In step S2, when a data packet arrives, the traffic information carried by the data packet is encoded into a data structure in the SRAM through hash technology.

[0098] In step S3, after the measurement cycle, the data structure in the current cycle is downloaded to the analysis server for offline decoding to find super spreaders.

[0099] In the present invention, the detection method can be performed on one or more routers. In each measurement cycle, the router can open up a continuous memory space on the SRAM to create a data structure for recording network traffic information. Whenever a data packet arrives, the router will encode the traffic information carried by the data packet into the data structure in the SRAM through hash technology. After the measurement cycle ends, the router can download the data structure of this cycle to the analysis server for offline decoding. The analysis server can estimate the cardinality of the recorded flow by decoding the obtained data structure, and find out the super spreaders whose cardinality exceeds a preset threshold. The offline decoding part can be divided into single-measurement point offline decoding and multi-measurement point offline decoding. The former estimates the cardinality of the flow recorded by a single router, and the latter estimates the cardinality of the flow after merging the traffic information recorded by multiple routers, so that super spreaders exceeding a preset threshold can be quickly found.

[0100] In the present invention, if Figure 2 As shown, the process of encoding the traffic information carried by the data packet into the data structure in the SRAM may include:

[0101] In step S4, all flow label fields and counter fields in the bucket array and all registers in the register array are initialized.

[0102] In step S5, a data packet is obtained.

[0103] In step S6, the index of the virtual register group corresponding to the element carried by the data packet is calculated according to formula (1):

[0104] , formula (1)

[0105] in, represents the index of the virtual register set, represents a hash function with good randomness, Represents a bitwise exclusive OR operation, Indicates the flow label carried by the data packet. Indicates the elements carried in the data packet. Indicates the number of virtual registers;

[0106] In step S7, the index of the physical register group corresponding to the virtual register is calculated according to formula (2):

[0107] , formula (2)

[0108] in, Represents the index of the physical register group, It is a hash function with good randomness. Indicates the number of physical register groups;

[0109] In step S8, the index of the register to which the data packet is mapped in the register group is calculated according to formula (3):

[0110] , formula (3)

[0111] in, Indicates the index of the register to which the data packet is mapped within the register group. It is a hash function with good randomness. Indicates the number of registers contained in the register group;

[0112] In step S9, the hash function is calculated according to formula (4): The position of the leftmost 1 in the binary encoding of the generated data packet is:

[0113] , formula (4)

[0114] in, Indicates the position of the leftmost 1 in the binary code, the function Indicates the position of the leftmost 1 in the binary code of the calculated input, let ;

[0115] In step S10, If it is greater than the value of the corresponding register, the bucket array is updated.

[0116] In step S11, it is determined whether the bucket array records the flow label of flow.

[0117] In step S12, the flow label is recorded in the bucket array. In the case of a flow, set the register value to .

[0118] In step S13, there is no record in the bucket array with a flow label of In the case of a stream, the register value is not changed.

[0119] In the present invention, the data structure consists of a A bucket array containing buckets and a The register array of register groups is composed of each bucket in the bucket array. cells, each of which contains two fields, namely the flow label field and the counter field. Bucket The flow label field and counter field of a cell are recorded as and , each register group in the register array contains registers, each of which is a 5-bit counter. The first register bank The registers are denoted as At the beginning of the measurement cycle, all flow label fields and counter fields in the bucket array and all registers in the register array can be initialized to 0. We abstract all packets with the same flow label as a flow, and the number of different elements in the flow is recorded as the cardinality of the flow. Each flow is assigned A virtual register group is used to record the element information of the stream, where each virtual register group is randomly mapped to a physical register group, so the virtual register groups of all streams share the register array In physical register set.

[0120] When a data packet arrives, the router can first map the element carried by the data packet to a physical register in the register array, and then determine whether the element can update the register. Therefore, the virtual register corresponding to the data packet can be obtained first. The router can calculate the index of the virtual register group corresponding to the element carried by the data packet through a hash function, that is, the index of the virtual register group can be obtained through formula (1). After obtaining the index of the virtual register, the index of the physical register group corresponding to the virtual register group can be calculated, that is, the index of the physical register group can be obtained through formula (2), and then the index of the register mapped to the data packet in the register group can be calculated according to formula (3). After obtaining the index of the register mapped to the data packet in the register group, another method with good randomness and an output range of Hash function Generate the binary code of the data packet, and the position of the leftmost 1 in the binary code can be calculated by the formula (4). Among them, the function It can represent the position of the leftmost 1 in the binary code of the calculated input, and the maximum output value is 31, thus ensuring that the 5-bit register can store the maximum output value. , , . In getting After that, If the value is greater than the register value, the bucket array can be updated, otherwise the processing of the data packet can be terminated. After updating the bucket array, first determine whether the flow label is recorded in the bucket array. The bucket array records the flow label In the case of a flow, the value of this register can be set to , to update the register, there is no record of flow label in the bucket array In the case of a flow, the register is not updated.

[0121] In one embodiment of the present invention, Figure 3 As shown, the process of updating the bucket array may include:

[0122] In step S14, the register set is calculated according to formula (5) The probability of being updated by any new element that hashes to its group:

[0123] , formula (5)

[0124] in, represents the probability, Represents a variable, Indicates the first The first register bank registers.

[0125] In step S15, the index of the bucket to which the data packet is mapped is calculated according to formula (6):

[0126] , formula (6)

[0127] in, Indicates the index of the bucket to which the data packet is mapped, represents a hash function with good randomness, Indicates the number of buckets in the bucket array.

[0128] In step S16, the corresponding bucket is determined according to the index of the bucket to which the data packet is mapped , and judge the bucket Is there a cell in The flow label is recorded as of flow.

[0129] In step S17, in the bucket There is a record with a flow label of Stream Cell In this case, the cell The corresponding counter field Plus .

[0130] In step S18, in the bucket There is no cell in which the flow label is In the case of a flow, determine whether a cell exists No traffic information is recorded.

[0131] In step S19, if there is a cell If the flow information is not recorded, the cell Corresponding flow label field Set to , the cell The corresponding counter field Set to .

[0132] In step S20, if there is no cell that does not record flow information, obtain the bucket The cell with the smallest counter value in , and set the cell to .

[0133] In step S21, according to formula (7), the data packet is mapped into a range of decimal :

[0134] ,Formula (7)

[0135] in, is a hash function A sufficiently large constant within the output range.

[0136] In step S22, the decimal Is it less than .

[0137] In step S23, in the decimal Less than In this case, the cell Corresponding flow label field Set to , the cell The corresponding counter field Set to .

[0138] In step S24, when determining the decimal Not less than In the case of The value of .

[0139] In the present invention, when updating a bucket, the probability that the register group is updated by any new element hashed to the array can be calculated by formula (5), and then the index of the bucket to which the data packet is mapped can be calculated by formula (6). After obtaining the index of the bucket to which the data packet is mapped, the corresponding bucket can be determined according to the index. . After getting the corresponding bucket After that, you can traverse the bucket All cells in the Different update strategies are implemented for the state of the bucket. After that, we can judge the bucket Whether there is a cell recording the flow, if there is a cell recording the flow, you can Plus In the bucket If all cells do not record flows, determine whether there is a cell that does not record flow information, that is, determine whether there is a cell whose counter value is 0. If there is a cell that does not record flow information, that is, the counter value of the cell is 0, the corresponding flow label field can be Set to , the cell The corresponding counter field Set to In the bucket If all cells in the bucket record traffic, that is, the counter values ​​of all cells are not 0, then Find the cell with the smallest counter value in , and then a good random hash function can be used Map the packet to a range in decimal , that is, the decimal is obtained by formula (7) . In getting the decimal After that, we can determine the decimal Is it less than In this decimal Less than In this case, you can add cells Corresponding flow label field Set to , the cell The corresponding counter field Set to , otherwise, the value of the cell is not changed, so the update of the bucket array can be completed.

[0140] In one embodiment of the present invention, the hash function Can be independent of each other.

[0141] In one embodiment of the present invention, Figure 4 As shown, the first step in finding super spreaders can include:

[0142] In step S25, all bucket arrays and register arrays are obtained.

[0143] In step S26, it is determined whether the off-line decoding is single-measurement-point off-line decoding or multi-measurement-point off-line decoding.

[0144] In step S27, when the offline decoding is single-measurement-point offline decoding, the cardinality of the flow is estimated according to the counter field of the cell in the bucket array to determine whether the flow is a super spreader.

[0145] In step S28, when the offline decoding is multi-measurement point offline decoding, the register arrays of the multiple measurement points are merged, the cardinality of the flow is estimated based on the merged register array, and after the cardinality of the flow is corrected in combination with the counter field of the cell in the bucket array, it is determined whether the flow is a super spreader.

[0146] In the present invention, after the server obtains the encoded data of a measurement point, the encoded data can be decoded to estimate the cardinality of the flow at the measurement point and find out the super spreader whose cardinality exceeds the preset threshold. After obtaining all the bucket arrays and register arrays, it can be determined whether the offline decoding is single-measurement point offline decoding or multi-measurement point offline decoding. In the case of single-measurement point offline decoding, the cardinality of the flow can be estimated according to the counter field of the cell in the bucket array, so that it can be determined whether the flow is a super spreader. When the offline decoding is multi-measurement point offline decoding, the register arrays of the multiple measurement points can be merged, and the cardinality of the flow can be corrected according to the merged register array, and it can be determined whether the flow is a super spreader. Flows can be distinguished by flow labels.

[0147] In one embodiment of the present invention, Figure 5 As shown, the second process of finding super spreaders can include:

[0148] In step S29, all cells in the bucket array are traversed and it is determined whether the counter field of the cell is greater than a preset threshold.

[0149] In step S30, when the counter field of the cell is greater than the set threshold, it is determined that the flow recorded in the flow label field corresponding to the cell is a super spreader, and the counter field corresponding to the cell is a cardinality estimate.

[0150] In the present invention, when judging that the offline decoding is single-measurement-point offline decoding, all cells in the bucket array can be traversed and it can be judged whether the counter field of the cell is greater than a preset threshold. When the counter field of the cell is greater than the preset threshold, it can be determined that the flow recorded in the flow label field corresponding to the cell is a super spreader, and the counter field corresponding to the cell can be an estimated cardinality of the flow. When the counter field of the cell is not greater than the preset threshold, it can be determined that the flow corresponding to the cell is not a super spreader.

[0151] In one embodiment of the present invention, Figure 6 As shown, the third process of finding super spreaders can include:

[0152] In step S31, when there are d measurement points, the bucket array of each measurement point is traversed to obtain a total flow label set and a mapping table between flow labels and counter values ​​recorded in the pass array of each measurement point.

[0153] In step S32, the register array after the register arrays of each measurement point are merged is calculated according to formula (8):

[0154] , formula (8)

[0155] in, Represents the merged register array No. The first register bank registers, Represents a variable, Indicates the number of measurement points, Indicates The first register array of the measurement point The first register bank registers;

[0156] In step S33, the flow label after merging multiple measurement points is calculated according to formula (9): The cardinality of the stream:

[0157] , formula (9)

[0158] in, is the base number, Yes and The coefficients associated with the values ​​of are as follows:

[0159] , formula (10).

[0160] In step S34, the base is corrected to obtain a first corrected base.

[0161] In step S35, the upper bound of the cardinality is calculated according to formula (11).

[0162] , Formula (11)

[0163] in, represents the upper bound, Indicated in The flow label recorded in the bucket array of the measurement point is The single measurement point cardinality estimate of the flow is The bucket array of the measurement point does not record the flow label In the case of a flow, let , Indicates The minimum counter value in the bucket array of measurement points;

[0164] In step S36, the lower bound of the cardinality is calculated according to formula (12).

[0165] , formula (12)

[0166] in, Indicates the lower bound;

[0167] In step S37, the first modified base is modified according to the upper bound and the lower bound to obtain a second modified base.

[0168] In step S38, it is determined whether the second correction base is greater than a preset threshold.

[0169] In step S39, when the second corrected cardinality is greater than a preset threshold, the corresponding flow is determined to be a super spreader, and the cardinality estimation value of the flow is the second corrected cardinality.

[0170] In step S40, when the second correction base is not greater than the preset threshold, it is determined that the corresponding flow is not a super spreader.

[0171] In the present invention, when the off-line decoding is multiple measurement point off-line decoding, After the encoded data of the measurement points are obtained, the encoded data of these measurement points can be merged and then decoded, so that the cardinality of the merged flow can be estimated, and the super spreaders whose cardinality exceeds the preset threshold can be found. When the offline decoding is for multiple measurement points, the bucket arrays of the multiple measurement points can be traversed to obtain the total flow label set and the mapping table between the flow labels and counter values ​​recorded in the bucket arrays of each measurement point. The mapping table can be The register arrays of each measurement point can be merged, and the register value in the merged register array can be the maximum value of the corresponding register values ​​in all measurement points. That is, the register array after merging the register arrays of each measurement point can be calculated by formula (8). For each flow in the total flow label set, its cardinality after merging multiple measurement points can be estimated by the merged register array. Let its flow label be , the cardinality of the flow after merging multiple measurement points can be calculated by formula (9). During the estimation process, there may be a situation where the estimated cardinality deviation is too large, and further correction is required to obtain the first corrected cardinality. After obtaining the first corrected cardinality, the upper and lower bounds of the cardinality can be calculated according to formulas (11) and (12). After obtaining the upper and lower bounds, the first corrected cardinality can be corrected according to the upper and lower bounds to obtain the second corrected cardinality, and then it can be determined whether the second corrected cardinality is greater than the preset threshold. When the second corrected cardinality is greater than the preset threshold, it can be determined that the corresponding flow is a super spreader, and the estimated cardinality of the flow can be the second corrected cardinality. When the second corrected cardinality is not greater than the preset threshold, it can be determined that the corresponding flow is not a super spreader. Among them, Indicates the number of virtual registers The number of registers contained in the register group The product of .

[0172] In one embodiment of the present invention, when the technology is modified to obtain the first modified base, the first modified base can be obtained according to formula (13):

[0173] , formula (13)

[0174] in, is the first modified base number, Indicates that the flow label is The number of registers that have a value of 0 among all registers to which the stream is mapped.

[0175] In one embodiment of the present invention, the first modified base can be modified according to the upper bound and the lower bound to obtain a second modified base. The second modified base can be obtained by formula (14):

[0176] The second modified base is obtained according to formula (14):

[0177] , formula (14)

[0178] in, Indicates the second modified base.

[0179] Through the above technical solution, the present invention provides a super spreader detection method based on register groups. In each measurement cycle, the router opens a continuous memory space on the SRAM to create a data structure for recording network traffic information. The data structure can be composed of a A bucket array containing buckets and a The method is composed of a register array of register groups. When a data packet arrives, the traffic information carried by the data packet can be encoded into the data structure in the SRAM through hash technology. After the measurement cycle is over, the data structure in the current cycle can be downloaded to the analysis server, so that offline encoding can be performed, and then super spreaders can be found. This method can improve the utilization efficiency of storage space and the accuracy of super spreader detection.

[0180] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0181] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0182] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0183] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0184] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0185] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0186] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0187] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0188] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A super spreader detection method based on register groups, characterized in that: include: In each measurement cycle, the router allocates a continuous memory space on the SRAM to create a data structure that records network traffic information; When a data packet arrives, the traffic information carried by the data packet is encoded into a data structure in the SRAM through hashing technology; After the measurement period, the data structure in the current period is downloaded to the analysis server for offline decoding to find super spreaders; When a data packet arrives, the traffic information carried by the data packet is encoded into the data structure in the SRAM through hash technology, including: Initialize all flow label fields and counter fields in the bucket array and all registers in the register array; Obtaining the data packet; The index of the virtual register group corresponding to the element carried by the data packet is calculated according to formula (1): , Formula (1) in, represents the index of the virtual register set, represents a hash function with good randomness, Represents a bitwise exclusive OR operation, Indicates the flow label carried by the data packet. Indicates the elements carried in the data packet. Indicates the number of virtual registers; The index of the physical register group corresponding to the virtual register is calculated according to formula (2): , Formula (2) in, Represents the index of the physical register group, It is a hash function with good randomness. Indicates the number of physical register groups; The index of the register to which the data packet is mapped in the register group is calculated according to formula (3): , Formula (3) in, Indicates the index of the register to which the data packet is mapped within the register group. It is a hash function with good randomness. Indicates the number of registers contained in the register group; Calculate the hash function according to formula (4) The position of the leftmost 1 in the binary encoding of the generated data packet is: , Formula (4) in, Indicates the position of the leftmost 1 in the binary code, the function Indicates the position of the leftmost 1 in the binary code of the calculated input, let ; exist If the value is greater than the corresponding register value, the bucket array is updated; Determine whether the flow label is recorded in the bucket array flow; The flow label is recorded in the bucket array. In the case of a flow, the value of the register is set to ; There is no record in the bucket array with a flow label of In the case of a stream, the value of the register is not changed.

2. The method according to claim 1, characterized in that The data structure consists of a A bucket array containing buckets and a The register array of the register group is composed of each bucket in the bucket array. cells, each of which contains two fields, namely the flow label field and the counter field. Bucket No. The flow label field and counter field of a cell are recorded as and , each register group in the register array contains registers, each of which is a 5-bit counter. The first register bank The registers are denoted as .

3. The method according to claim 2, characterized in that The update bucket array includes: According to formula (5), the register group is calculated The probability of being updated by any new element that hashes to its group: , Formula (5) in, represents the probability, Represents a variable, Indicates the first The first register bank registers; The index of the bucket to which the data packet is mapped is calculated according to formula (6): , Formula (6) in, Indicates the index of the bucket to which the data packet is mapped, represents a hash function with good randomness, Indicates the number of buckets in the bucket array; Determine the corresponding bucket according to the index of the bucket to which the data packet is mapped , and judge the bucket Is there a cell in The flow label is recorded as flow; In the bucket There is a record with a flow label of Stream Cell In this case, the cell The corresponding counter field Plus ; In the bucket There is no cell in which the flow label is In the case of a flow, determine whether a cell exists No traffic information is recorded; In a cell If the flow information is not recorded, the cell Corresponding flow label field Set to , the cell The corresponding counter field Set to ; Get the bucket when there is no cell that does not record traffic information The cell with the smallest counter value in , and let the cell be ; According to formula (7), the data packet is mapped into a range in decimal : ,Formula (7) in, is a hash function A sufficiently large constant within the output range; Determine the decimal Is it less than ; In the decimal Less than In this case, the cell Corresponding flow label field Set to , the cell The corresponding counter field Set to ; In judging the decimal Not less than In the case of The value of .

4. The method according to claim 3, characterized in that The hash function Are independent of each other.

5. The method according to claim 3, characterized in that: After the measurement cycle, the data structure in the current cycle is downloaded to the analysis server for offline decoding, so as to find super spreaders including: Get all bucket arrays and register arrays; Determining whether the offline decoding is single-measurement-point offline decoding or multi-measurement-point offline decoding; When the offline decoding is single-measurement-point offline decoding, estimating the cardinality of the flow according to the counter field of the cell in the bucket array to determine whether the flow is a super spreader; When the offline decoding is multi-measurement point offline decoding, the register arrays of the multiple measurement points are merged, the cardinality of the flow is estimated according to the merged register array, and after the cardinality of the flow is corrected in combination with the counter field of the cell in the bucket array, it is determined whether the flow is a super spreader.

6. The method according to claim 5, characterized in that When the offline decoding is a single measurement point offline decoding, estimating the cardinality of the flow according to the counter field of the cell in the bucket array, and determining whether the flow is a super spreader includes: Traversing all cells in the bucket array and determining whether the counter field of the cell is greater than a preset threshold; When the counter field of a cell is greater than a set threshold, it is determined that the flow recorded in the flow label field corresponding to the cell is a super spreader, and the counter field corresponding to the cell is a cardinality estimate.

7. The method according to claim 5, characterized in that When the offline decoding is for multiple measurement points, the register arrays of multiple measurement points are merged, and the cardinality of the flow is estimated according to the merged register array. After the cardinality of the flow is corrected in combination with the counter field of the cell in the bucket array, whether the flow is a super spreader is determined to include: In When there are measurement points, traverse the bucket array of each measurement point to obtain a total flow label set and a mapping table between the flow labels and counter values ​​recorded in the bucket array of each measurement point; The register array after merging the register arrays of each measurement point is calculated according to formula (8): , Formula (8) in, Represents the merged register array No. The first register bank registers, Represents a variable, Indicates the number of measurement points, Indicates The first register array of the measurement point The first register bank registers; According to formula (9), the flow label after merging multiple measurement points is calculated as follows: The cardinality of the stream: , Formula (9) in, is the base number, Yes and The coefficients associated with the values ​​of are as follows: , Formula (10) Correcting the base to obtain a first corrected base; The upper bound of the cardinality is calculated according to formula (11): , Official(11) in, represents the upper bound, Indicated in The flow label recorded in the bucket array of the measurement point is The single measurement point cardinality estimate of the flow is The bucket array of the measurement point does not record the flow label In the case of a flow, let , Indicates The minimum counter value in the bucket array of measurement points; The lower bound of the cardinality is calculated according to formula (12): , Formula (12) in, Indicates the lower bound; Correcting the first corrected base number according to the upper bound and the lower bound to obtain a second corrected base number; Determining whether the second correction base is greater than a preset threshold; When the second corrected cardinality is greater than the preset threshold, the corresponding flow is determined to be a super spreader, and the cardinality estimation value of the flow is the second corrected cardinality; When the second correction base is not greater than the preset threshold, it is determined that the corresponding flow is not a super spreader.

8. The method according to claim 7, characterized in that The modifying the base to obtain a first modified base comprises: According to formula (13), the first correction base is obtained: , Formula (13) in, is the first modified base number, Indicates that the flow label is The number of registers that have a value of 0 among all registers to which the stream is mapped.

9. The method according to claim 8, characterized in that The modifying the first modified base according to the upper bound and the lower bound to obtain a second modified base includes: The second modified base is obtained according to formula (14): , Formula (14) in, Indicates the second modified base.

Citation Information

Patent Citations

  • Multi-target network flow cardinal number fusion measurement method and system

    CN117792961A