DDoS attack detection method, device, equipment and readable storage medium

By calculating the source IP information entropy and building a dynamic baseline, the problem that DDoS attack detection in the prior art is difficult to distinguish between normal traffic and attack traffic, real-time fast judgment and efficient detection of DDoS attacks are achieved.

CN114389830BActive Publication Date: 2024-11-08CHINA MOBILE COMM LTD RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011122419.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-20
Publication Date
2024-11-08
Estimated Expiration
2040-10-20

AI Technical Summary

Technical Problem

The existing DDoS attack detection methods are difficult to distinguish between normal large traffic and attack traffic, cannot adapt to real-time changing network environments, and the entropy-based detection methods cannot dynamically adapt to changes in the network environment.

Method used

By obtaining the traffic sequence of the IP to be monitored, the source IP information entropy is calculated, and a dynamic baseline is constructed using the SG filter and exponential weighted moving average method, and the source IP information entropy and dynamic baseline are compared to determine whether there is a DDoS attack.

Benefits of technology

It improves the efficiency and accuracy of DDoS attack detection, can adapt to changes in the network environment in real time, and quickly determine whether there is a DDoS attack.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114389830B_ABST
    Figure CN114389830B_ABST
Patent Text Reader

Abstract

The present invention provides a DDoS attack detection method, device, equipment and readable storage medium, which belongs to the field of network security technology and realizes rapid detection and judgment of DDoS attacks. The DDoS attack detection method provided by the present invention obtains a flow matrix by obtaining the flow sequence of the IP to be monitored, calculates the source IP information entropy of the IP to be monitored according to the flow matrix, thereby determining the dynamic baseline corresponding to the source IP of the IP to be monitored, and then compares the source IP information entropy of the IP to be monitored with the dynamic baseline to determine whether there is a DDoS attack. The above method provided by the present application can realize real-time and rapid judgment on whether there is a DDoS attack on the IP to be monitored by constructing a dynamic baseline of the source IP information entropy of the IP to be monitored, which not only improves the efficiency and accuracy of DDoS detection, but also can adapt to the real-time changing network environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network security technology, and in particular to a DDoS attack detection method, device, equipment and readable storage medium. Background Art

[0002] Distributed Denial of Service (DDoS) is a covert denial of service attack in which the attacker selects a proxy host to dispatch other zombie machines (zombies) to initiate network requests to the target host. Compared with DOS attacks, DDoS attacks have smaller traffic on a single link, making them difficult to detect by network devices and therefore easier to form. The total amount of abnormal traffic after DDoS attacks is large and extremely destructive. In recent years, in order to evade most existing DDoS attack detection and defense methods, hackers have gradually turned to using low-rate DDoS attacks with small traffic (such as CC attacks), which has brought challenges to the detection of DDoS attacks.

[0003] At present, the DDoS attack detection methods include: monitoring abnormal traffic based on network traffic statistics, detection based on network traffic behavior characteristics, detection based on entropy, etc. All of the above methods have certain defects, such as: the method based on network traffic statistics cannot effectively distinguish between normal large traffic and DDoS attack traffic; the detection based on network traffic behavior characteristics requires a lot of training data and cannot adapt to the real-time requirements of the existing network; the detection method based on entropy mostly uses fixed thresholds and cannot dynamically adapt to the real-time changing network environment. Summary of the invention

[0004] The present invention proposes a DDoS attack detection method, device, equipment and readable storage medium to improve detection efficiency and accuracy to adapt to the real-time changing network environment.

[0005] In order to solve the above-mentioned technical problems, the present invention is achieved as follows:

[0006] In a first aspect, an embodiment of the present invention provides a distributed denial of service (DDoS) attack detection method, the method comprising:

[0007] Get the traffic sequence of the IP to be monitored;

[0008] Acquire the traffic matrix of the IP to be monitored according to the traffic sequence, and calculate the source IP information entropy of the IP to be monitored according to the traffic matrix;

[0009] Determine a dynamic baseline corresponding to the source IP of the IP to be monitored, wherein the dynamic baseline is obtained by fitting the source IP information entropy in the traffic matrix using an SG filter and an exponentially weighted moving average method;

[0010] The source IP information entropy of the IP to be monitored is compared with the dynamic baseline to determine whether there is a DDoS attack.

[0011] Optionally, the step of obtaining the traffic sequence of the IP to be monitored includes:

[0012] For each day within a preset period, the traffic sequence of the IP to be monitored is obtained at fixed time intervals.

[0013] Optionally, the method further includes:

[0014] The abnormal data in each column of the traffic matrix is ​​replaced with the average value of the column where the abnormal data is located, and the abnormal data includes unreasonable values ​​and / or empty data.

[0015] Optionally, calculating the source IP information entropy of the IP to be monitored according to the traffic matrix includes:

[0016] Calculate the probability of the target source IP of the IP to be monitored in the column where each sliding time window is located in the traffic matrix;

[0017] The length of the sliding time window is an integer multiple of the fixed time interval.

[0018] Optionally, the calculating the source IP information entropy of the IP to be monitored according to the traffic matrix further includes:

[0019] According to the probability of all source IPs in the IP to be monitored appearing in their corresponding sliding time windows, an information entropy time series of the source IPs in the IP to be monitored in each sliding window is generated.

[0020] Optionally, determining the dynamic baseline corresponding to the source IP of the IP to be monitored includes:

[0021] The information entropy time series of the source IP of the IP to be monitored is smoothed for the first time by fitting the local polynomial least square method of the SG filter to obtain a first sequence;

[0022] Performing a second smoothing on the first number series by exponentially weighted moving average to obtain a source IP information entropy baseline value of the IP to be monitored at each time point;

[0023] According to the source IP information entropy baseline value, a dynamic baseline corresponding to the source IP of the IP to be monitored is generated.

[0024] Optionally, the method further includes determining a DDoS attack identification threshold according to the dynamic baseline, including:

[0025] Calculating the variance of the elements in the traffic matrix to the dynamic baseline;

[0026] According to the variance, the DDoS attack identification threshold is determined according to the following formula:

[0027]

[0028] Where t∈(1,T), T is the total number of sliding time windows, α is the control parameter, is the variance of the elements in the traffic matrix in the tth time window to the dynamic baseline.

[0029] Optionally, comparing the source IP information entropy of the IP to be monitored with the dynamic baseline to determine whether a DDoS attack occurs includes:

[0030] If the entropy value of the source IP of the IP to be monitored is greater than the first threshold at the first time point, it is determined that the probability of the existence of a DDoS attack is greater than a preset value;

[0031] If the entropy value of the source IP of the IP to be monitored is less than the first threshold at the second time point, it is determined that the probability of no DDoS attack is greater than a preset value.

[0032] In a second aspect, an embodiment of the present invention provides a distributed denial of service (DDoS) attack detection device, the device comprising:

[0033] The first receiving module is used to obtain the flow sequence of the IP to be monitored;

[0034] A first processing module is used to obtain a traffic matrix of the IP to be monitored according to the traffic sequence, and calculate the source IP information entropy of the IP to be monitored according to the traffic matrix;

[0035] The second processing module is used to determine the dynamic baseline corresponding to the source IP of the IP to be monitored, wherein the dynamic baseline is obtained by fitting the source IP information entropy in the traffic matrix using an SG filter and an exponentially weighted moving average method;

[0036] The third processing module is used to compare the source IP information entropy of the IP to be monitored with the dynamic baseline to determine whether there is a DDoS attack.

[0037] Optionally, the first receiving module includes:

[0038] The first sub-receiving module is used to obtain the traffic sequence of the IP to be monitored at fixed time intervals for each day within a preset period.

[0039] Optionally, the device further comprises:

[0040] The fourth processing module is used to replace the abnormal data in each column of the traffic matrix with the average value of the column where the abnormal data is located, and the abnormal data includes unreasonable values ​​and / or empty data.

[0041] Optionally, the first processing module includes:

[0042] The first sub-processing module is used to calculate the probability of occurrence of the target source IP of the IP to be monitored in the vertical column where each sliding time window is located in the traffic matrix;

[0043] The length of the sliding time window is an integer multiple of the fixed time interval.

[0044] Optionally, the first processing module further includes:

[0045] The second sub-processing module is used to generate an information entropy time series of the source IPs in the monitored IPs in each sliding window according to the probability of all source IPs in the monitored IPs appearing in their corresponding sliding time windows.

[0046] Optionally, the second processing module includes:

[0047] The third sub-processing module is used to perform a first smoothing on the information entropy time series of the source IP of the IP to be monitored by fitting the local polynomial least square method of the SG filter to obtain a first sequence;

[0048] Performing a second smoothing on the first number series by exponentially weighted moving average to obtain a source IP information entropy baseline value of the IP to be monitored at each time point;

[0049] According to the source IP information entropy baseline value, a dynamic baseline corresponding to the source IP of the IP to be monitored is generated.

[0050] Optionally, the device further comprises:

[0051] The fifth processing module is used to determine a DDoS attack identification threshold according to the dynamic baseline:

[0052] Calculating the variance of the elements in the traffic matrix to the dynamic baseline;

[0053] According to the variance, the DDoS attack identification threshold is determined according to the following formula:

[0054]

[0055] Where t∈(1,T), T is the total number of sliding time windows, α is the control parameter, is the variance of the elements in the traffic matrix in the tth time window to the dynamic baseline.

[0056] Optionally, the third processing module includes:

[0057] The judgment module is used to perform the following judgments:

[0058] If the entropy value of the source IP of the IP to be monitored is greater than the first threshold at the first time point, it is determined that the probability of the existence of a DDoS attack is greater than a preset value;

[0059] If the entropy value of the source IP of the IP to be monitored is less than the first threshold at the second time point, it is determined that the probability of no DDoS attack is greater than a preset value.

[0060] In a third aspect, an embodiment of the present invention provides a distributed denial of service (DDoS) attack detection device, the device comprising:

[0061] The transceiver is used to obtain the flow sequence of the IP to be monitored;

[0062] The processor is used to obtain the traffic matrix of the IP to be monitored according to the traffic sequence, and calculate the source IP information entropy of the IP to be monitored according to the traffic matrix;

[0063] The processor is further used to determine a dynamic baseline corresponding to the source IP of the IP to be monitored, wherein the dynamic baseline is obtained by fitting the source IP information entropy in the traffic matrix using an SG filter and an exponentially weighted moving average method;

[0064] The processor is further used to compare the source IP information entropy of the IP to be monitored with the dynamic baseline to determine whether there is a DDoS attack.

[0065] Optionally, the transceiver is further configured to obtain the traffic sequence of the IP to be monitored at fixed time intervals for each day within a preset period.

[0066] Optionally, the processor is further configured to replace abnormal data in each column of the traffic matrix with an average value of the column where the abnormal data is located, wherein the abnormal data includes unreasonable values ​​and / or empty data.

[0067] Optionally, the processing is further used to calculate the probability of occurrence of the target source IP of the IP to be monitored in the vertical column where each sliding time window is located in the traffic matrix;

[0068] The length of the sliding time window is an integer multiple of the fixed time interval.

[0069] Optionally, the processor is also used to generate an information entropy time series of the source IPs in the monitored IPs in each sliding window according to the probability of all source IPs in the monitored IPs appearing in their corresponding sliding time windows.

[0070] Optionally, the processor is further used to perform a first smoothing on the information entropy time series of the source IP of the IP to be monitored by fitting the local polynomial least squares method of the SG filter to obtain a first sequence;

[0071] Performing a second smoothing on the first number series by exponentially weighted moving average to obtain a source IP information entropy baseline value of the IP to be monitored at each time point;

[0072] According to the source IP information entropy baseline value, a dynamic baseline corresponding to the source IP of the IP to be monitored is generated.

[0073] Optionally, the processor is further configured to determine a DDoS attack identification threshold according to the dynamic baseline:

[0074] Calculating the variance of the elements in the traffic matrix to the dynamic baseline;

[0075] According to the variance, the DDoS attack identification threshold is determined according to the following formula:

[0076]

[0077] Where t∈(1,T), T is the total number of sliding time windows, α is the control parameter, is the variance of the elements in the traffic matrix in the tth time window to the dynamic baseline.

[0078] Optionally, when determining whether a DDoS attack occurs, the process is further used to perform the following determination:

[0079] If the entropy value of the source IP of the IP to be monitored is greater than the first threshold at the first time point, it is determined that the probability of the existence of a DDoS attack is greater than a preset value;

[0080] If the entropy value of the source IP of the IP to be monitored is less than the first threshold at the second time point, it is determined that the probability of no DDoS attack is greater than a preset value.

[0081] In a fourth aspect, an embodiment of the present invention provides a network device comprising: a memory, a processor, and a program stored in the memory and executable on the processor; the processor is used to read the program in the memory to implement the steps in the DDoS attack detection method as described in the embodiment of the present invention.

[0082] In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the DDoS attack detection method as described in the embodiment of the present invention are implemented.

[0083] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:

[0084] The DDoS attack detection method provided by the present invention obtains a traffic matrix by acquiring the traffic sequence of the IP to be monitored, calculates the source IP information entropy of the IP to be monitored according to the traffic matrix, thereby determining the dynamic baseline corresponding to the source IP of the IP to be monitored, and then compares the source IP information entropy of the IP to be monitored with the dynamic baseline to determine whether a DDoS attack exists. The above method provided by the present application can realize real-time and rapid judgment on whether a DDoS attack exists on the IP to be monitored by constructing a dynamic baseline of the source IP information entropy of the IP to be monitored, thereby improving the efficiency and accuracy of DDoS detection and adapting to the real-time changing network environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0085] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0086] Figure 1 A flow chart of a DDoS attack detection method provided by an embodiment of the present invention;

[0087] Figure 2 A baseline fitting schematic diagram of a DDoS attack detection method provided by an embodiment of the present invention;

[0088] Figure 3 A baseline fitting schematic diagram of a DDoS attack detection method provided by an embodiment of the present invention;

[0089] Figure 4 A schematic diagram of the structure of a DDoS attack detection device provided by an embodiment of the present invention;

[0090] Figure 5 A schematic diagram of the structure of a DDoS attack detection device provided by an embodiment of the present invention;

[0091] Figure 6 A schematic diagram of a network device structure provided by an embodiment of the present invention;

[0092] Figure 7 A schematic diagram of a network device structure provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0093] In the embodiments of the present invention, the term "and / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0094] In the embodiments of the present invention, the term "plurality" refers to two or more than two, and other quantifiers are similar.

[0095] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0096] refer to Figure 1 , Figure 1 A flow chart of a DDoS attack detection method provided by an embodiment of the present invention, the method comprising:

[0097] Step 101, obtaining the traffic sequence of the IP to be monitored.

[0098] Specifically, the traffic sequence of the IP to be monitored includes the historical traffic of the IP to be monitored. When obtaining the traffic sequence, it can be divided into two situations: holiday traffic and normal day traffic. Since for some network devices with relatively large traffic, the traffic fluctuation between holidays and normal working days will be large, if mixed, it is easy to cause inaccurate detection results. Therefore, separately obtaining the holiday traffic and weekday traffic of the IP to be monitored can make the detection results more accurate.

[0099] Optionally, the step of obtaining the traffic sequence of the IP to be monitored in step 101 includes:

[0100] For each day within a preset period, the traffic sequence of the IP to be monitored is obtained at fixed time intervals.

[0101] For example, for obtaining the traffic sequence of the IP to be monitored on weekdays, y days are used as a preset period, and the traffic every 5 minutes in these y days is obtained to generate the traffic sequence of the IP to be monitored, such as:

[0102] The traffic sequence of the IP to be monitored on the first day is: a 11 , a 12 , ..., a 1q ;

[0103] The traffic sequence of the IP to be monitored on the second day is: a 21 , a 22 , ..., a 2q ;

[0104] …

[0105] The traffic sequence of the IP to be monitored on day y is: a y1 , a y2, ..., a yq ;

[0106] Where y is the number of days in the preset cycle, and q is the number of fixed time intervals on each day. For example, if the preset cycle is set to 30 days and the fixed time interval is 5 minutes, then y=30 and q is 288.

[0107] Similarly, for the traffic sequence of the IP to be monitored during holidays, in order to ensure sufficient data, the traffic sequence can be obtained based on the historical half-year holidays as a preset period.

[0108] Step 102: Obtain the traffic matrix of the IP to be monitored according to the traffic sequence, and calculate the source IP information entropy of the IP to be monitored according to the traffic matrix.

[0109] Specifically, the traffic sequence includes the traffic sequence of the IP to be monitored at each fixed time interval of each day in a preset period. For example, referring to the traffic sequence in the above steps, the generated traffic matrix is:

[0110]

[0111] Where y is the number of days in the preset cycle, and q is the number of fixed time intervals per day. For example, if the preset cycle is set to 30 days and the fixed time interval is 5 minutes, then q is 288, and the traffic matrix has 288 columns and 30 rows. The horizontal columns of the above matrix are the traffic sequences of the monitored IP at each fixed time interval on a certain day in the preset cycle, and the vertical columns are the traffic sequences of the monitored IP at a fixed time interval from the first day to the yth day of the preset cycle.

[0112] Optionally, in step 102, calculating the source IP information entropy of the IP to be monitored according to the traffic matrix includes:

[0113] Calculate the probability of the target source IP of the IP to be monitored in the column where each sliding time window is located in the traffic matrix;

[0114] The length of the sliding time window is an integer multiple of the fixed time interval.

[0115] Specifically, if the length of the sliding time window is set to 12 times the fixed time interval, such as the fixed time interval is 5 minutes, the length of the sliding time window is 60 minutes. At this time, the traffic matrix has a total of 288 columns and the number of sliding time windows is 12.

[0116] Exemplarily, the information entropy of the source IP in each vertical column (each time period is a fixed time interval) in each sliding time window in the traffic matrix is ​​calculated. In order to avoid the impact of burst traffic of a single sample on the overall situation, the sliding window is accumulated in the vertical sliding window, and the sliding window can be set to an integer multiple of the traffic matrix column.

[0117] In the sliding window, the probability of the target source IP appearing in the samples of the preset number of days (i.e., the probability of appearing in the sliding time window in the traffic matrix) is P t (x i ):

[0118]

[0119] Among them, x i It represents the i-th source IP among all source IPs appearing in time window t, t∈(1,T). Since different devices and networks are constantly accessing the monitored IP, multiple different source IPs may appear even in the same sliding time window. Therefore, it is necessary to calculate the probability of each source IP appearing in each sliding time window.

[0120] Optionally, in step 102, calculating the source IP information entropy of the IP to be monitored according to the traffic matrix further includes:

[0121] According to the probability of all source IPs in the IP to be monitored appearing in their corresponding sliding time windows, an information entropy time series of the source IPs in the IP to be monitored in each sliding window is generated.

[0122] Specifically, the source IP information entropy in each sliding time window of each IP to be monitored is generated according to the probability of all source IPs in the IP to be monitored appearing in their corresponding sliding time windows, and the probability of all source IPs appearing in each sliding time window. The specific calculation formula is as follows:

[0123]

[0124] Among them, H(sip) t It represents the source IP information entropy of the t-th sliding time window of the IP to be monitored, t∈(1,T), T is the total number of sliding time windows t of the IP to be monitored, and N is the total number of source IPs in the sliding time window.

[0125] Afterwards, the information entropy time series is generated according to the source IP information entropy of each sliding time window of each IP to be monitored. For example, if there are 12 sliding time windows in total, the generated information entropy time series is:

[0126] [H1,H2,…,H T-1 ,H T ]

[0127] The more dispersed the source IP distribution is, the larger the entropy value is, and the more concentrated the distribution is, the smaller the entropy value is. Therefore, the size of the entropy value reflects the degree of concentration or dispersion of the source IP distribution.

[0128] Step 103, determining a dynamic baseline corresponding to the source IP of the IP to be monitored, wherein the dynamic baseline is obtained by fitting the source IP information entropy in the traffic matrix using an SG filter and an exponentially weighted moving average method;

[0129] Specifically, according to the information entropy time series of the source IP in the IP to be monitored obtained in the above steps in each sliding window, multiple smoothing is performed to obtain the dynamic baseline corresponding to the source IP of the IP to be monitored.

[0130] It is worth noting that the sudden rise or fall of network traffic due to factors such as DDoS attacks, emergencies, Internet behavior, Internet time, network failures, and record failures has a strong random dynamic change characteristic, which is the noise in the process of building a baseline for network traffic. Therefore, the key to model construction is to eliminate the impact of network noise. Using a smoothing algorithm without manual intervention can automatically reduce the impact of fluctuating data. The following points should be noted for the selection of a smoothing algorithm:

[0131] 1. The selection of coefficient K: When k is relatively small, the smoothing effect of the predicted data is not obvious, and it highlights the recent changes in the data; when k is large, there is a better smoothing effect, but the data is not sensitive and there will be a delay;

[0132] 2. If the ordinary moving average rule is used, the calculation is complicated, and all the new data introduced need to be calculated and modified.

[0133] 3. The data baseline is automatically fitted without human intervention, so it is necessary not only to smooth out large fluctuations, but also to smooth out the impact of small fluctuations on the baseline.

[0134] Taking the above problems into consideration, the embodiment of the present invention adopts a combination of SG filter (Savitzky-Golay) and exponentially weighted moving average for the information entropy time series of the source IP in the monitored IP in each sliding window, and adaptively fits the baseline based on the source IP information entropy to obtain a dynamic threshold curve suitable for each time point.

[0135] Optionally, in step 103, determining the dynamic baseline corresponding to the source IP of the IP to be monitored includes:

[0136] The information entropy time series of the source IP of the IP to be monitored is smoothed for the first time by fitting the local polynomial least square method of the SG filter to obtain a first sequence;

[0137] Performing a second smoothing on the first number series by exponentially weighted moving average to obtain a source IP information entropy baseline value of the IP to be monitored at each time point;

[0138] According to the source IP information entropy baseline value, a dynamic baseline corresponding to the source IP of the IP to be monitored is generated.

[0139] Among them, the SG filter is a method based on local polynomial least squares fitting in the time domain. Its characteristic is that it can identify large fluctuations in source IP information entropy caused by bursts such as DDoS attacks in the network, while ensuring that the shape and width of the waveform remain unchanged.

[0140] Specifically, the smoothing method is shown as follows:

[0141] The information entropy time series of the source IP of the IP to be monitored is smoothed for the first time by fitting the local polynomial least square method of the SG filter to obtain the first series:

[0142] The information entropy time series [H1, H2, ..., H T-1 ,H T Each data in ] is passed through H t [n](n∈[-M,M],n=2M+1) is fitted with K+1 polynomials, where H t Take [H1,H2,…,H T-1 ,H T ], smooth each data in it, and use H t The M data before and after are fitted, P n H t [n] The smoothed data is expressed as:

[0143]

[0144] Among them, M, k, K, and α are all parameters and can be adjusted according to the preset.

[0145] P represents data H t After smoothing, the corresponding expanded data is:

[0146]

[0147] α can be obtained according to the mean square error k The value of (k=0,…,K).

[0148] When using the SG smoothing filter to smooth the source IP information entropy, it actually smoothes out the relatively large fluctuation components and retains the remaining components in the traffic to the greatest extent. However, the SG filter cannot effectively smooth small fluctuations (such as reference Figure 2 Random fluctuations between 5:33 and 8:20 in the time point, or large fluctuations after smoothing will cause inflection points in the smooth curve (refer to Figure 2 SG smoothed curve shown in ).

[0149] Specifically, the first series is smoothed for the second time by exponentially weighted moving average to obtain the source IP information entropy baseline value of the IP to be monitored at each time point as shown below:

[0150]

[0151] The weight of β∈(0,1) is H t is the fitted value at time point t, Y t is the actual value at the tth time point

[0152] The data at the first time point is the original value. The relationship between the source IP information entropy fitted at time t and the information entropy at the previous time point is as follows:

[0153]

[0154]

[0155] …

[0156]

[0157] For example, if α is 0.1, it means that the time window is data within 10 days. From the formula, we can see that the closer the time is to the current moment, the greater the influence of the data, and the weight coefficient of the information entropy at each moment decreases exponentially, thus eliminating the impact of sudden fluctuations.

[0158] Finally, the source IP information entropy baseline value at each time point after smooth fitting is:

[0159]

[0160] Among them, t0, t1, ..., t T Indicates the first and last moments of each sliding time window.

[0161] refer to Figure 3 The baselines after SG smoothing and weighted averaging are shown. It can be seen that SG+exponentially weighted moving average method, the SG method effectively removes the impact of large fluctuations, and the exponentially weighted moving average method smoothes small fluctuations on this basis. The combination of the two better reflects the changing trend of the source IP information entropy in the time series; the weight coefficient of the model also decreases exponentially with time, avoiding the complex calculation problem of weight selection, which is in line with the actual scenario. The closer to the center data in the smoothing window, the greater the weight, and the closer to the edge of the smoothing window, the smaller the weight; its calculation speed is fast, and it can be found from the formula that the current data can be determined based on the historical exponentially weighted moving average, and the model can be changed at any time to adapt.

[0162] Optionally, in step 103, the method further includes determining a DDoS attack identification threshold according to the dynamic baseline:

[0163] Calculating the variance of the elements in the traffic matrix to the dynamic baseline;

[0164] According to the variance, the DDoS attack identification threshold is determined according to the following formula:

[0165]

[0166] Where t∈(1,T), T is the total number of sliding time windows, α is the control parameter, is the variance of the elements in the traffic matrix in the tth time window to the dynamic baseline.

[0167] Specifically, variance The calculation is done according to the following formula:

[0168]

[0169] m refers to m days (for example, 30 days), and j ranges from 1 to m days. t=1,2,...T, which indicates the number of time series, which is consistent with the number of sliding time windows T.

[0170] Step 104, compare the source IP information entropy of the IP to be monitored with the dynamic baseline to determine whether a DDoS attack occurs.

[0171] Optionally, in step 104, comparing the source IP information entropy of the IP to be monitored with the dynamic baseline to determine whether a DDoS attack occurs includes:

[0172] If the entropy value of the source IP of the IP to be monitored is greater than the first threshold at the first time point, it is determined that the probability of the existence of a DDoS attack is greater than a preset value;

[0173] If the entropy value of the source IP of the IP to be monitored is less than the first threshold at the second time point, it is determined that the probability of no DDoS attack is greater than a preset value.

[0174] Specifically, the DDoS attack detection method provided by the present invention is used to quickly detect and determine whether a DDoS attack exists, but the specific network attack type needs to be further determined by combining with other software, such as: the entropy value of the source IP address rises to be greater than the first threshold at a certain point, which means that the number of source IPs appearing at this point in time is relatively scattered and large, and the probability of a DDoS attack is relatively high; on the contrary, if the entropy value at this point sinks to be less than the first threshold, it means that the number of source IP addresses is relatively concentrated within the time, which may be a representation of a large number of other hosts infected by certain worm viruses during an outbreak, and the probability of a DDos attack is very small. A quick judgment is made by the probability of a DDoS attack in different situations.

[0175] Optionally, the method further includes:

[0176] The abnormal data in each column of the traffic matrix is ​​replaced with the average value of the column where the abnormal data is located, and the abnormal data includes unreasonable values ​​and / or empty data.

[0177] When establishing the traffic matrix, some abnormal data can be excluded, making the noise in the matrix smaller and the model judgment results more accurate.

[0178] Optionally, when real-time monitoring of the daily traffic of the existing network is performed, the model to be compared can be determined as a holiday traffic model or a weekday traffic model according to the date, and the source IP information entropy value in various time windows can be calculated. The corresponding time window baseline value can be directly found, and the information entropy can be directly calculated and compared with the threshold to determine whether it is a DDoS attack. If 30% of the source IP information entropy values ​​in the target time window are close to the threshold, it indicates that the system threshold is not suitable for the current situation, and there may be false alarms. The new data can be updated to the model to re-fit the baseline and regenerate the DDoS attack identification threshold.

[0179] In summary, the DDoS attack detection method provided by the embodiment of the present invention obtains a traffic matrix by obtaining the traffic sequence of the IP to be monitored, calculates the source IP information entropy of the IP to be monitored according to the traffic matrix, thereby determining the dynamic baseline corresponding to the source IP of the IP to be monitored, and then compares the source IP information entropy of the IP to be monitored with the dynamic baseline to determine whether a DDoS attack exists. The above method provided by the present application can realize real-time and rapid judgment on whether a DDoS attack exists on the IP to be monitored by constructing a dynamic baseline of the source IP information entropy of the IP to be monitored, which not only improves the efficiency and accuracy of DDoS detection, but also can adapt to the real-time changing network environment.

[0180] Furthermore, the DDoS attack detection method provided by the present invention can also reconstruct or adjust parameters of the dynamic baseline according to the detection results in subsequent use to adapt to the real-time changing network environment.

[0181] Please refer to Figure 4 The embodiment of the present invention provides a distributed denial of service DDoS attack detection device 40, the device comprising:

[0182] The first receiving module 41 is used to obtain the flow sequence of the IP to be monitored;

[0183] The first processing module 42 is used to obtain the traffic matrix of the IP to be monitored according to the traffic sequence, and calculate the source IP information entropy of the IP to be monitored according to the traffic matrix;

[0184] The second processing module 43 is used to determine the dynamic baseline corresponding to the source IP of the IP to be monitored, wherein the dynamic baseline is obtained by fitting the source IP information entropy in the traffic matrix using an SG filter and an exponentially weighted moving average method;

[0185] The third processing module 44 is used to compare the source IP information entropy of the IP to be monitored with the dynamic baseline to determine whether there is a DDoS attack.

[0186] Optional, reference Figure 5 , the first receiving module includes:

[0187] The first receiving submodule 411 is used to obtain the traffic sequence of the IP to be monitored at fixed time intervals for each day within a preset period.

[0188] Optional, reference Figure 5 , the device 40 further comprises:

[0189] The fourth processing module 45 is used to replace the abnormal data in each column of the traffic matrix with the average value of the column where the abnormal data is located, and the abnormal data includes unreasonable values ​​and / or empty data.

[0190] Optional, reference Figure 5 , the first processing module 42 includes:

[0191] The first processing submodule 421 is used to calculate the probability of the target source IP of the monitored IP in the column where each sliding time window is located in the traffic matrix;

[0192] The length of the sliding time window is an integer multiple of the fixed time interval.

[0193] Optional, reference Figure 5 , the first processing module 42 also includes:

[0194] The second processing submodule 422 is used to generate an information entropy time series of the source IPs in the monitored IPs in each sliding window according to the probability of all source IPs in the monitored IPs appearing in their corresponding sliding time windows.

[0195] Optional, reference Figure 5 , the second processing module 43 includes:

[0196] The third sub-processing module 431 is used to perform a first smoothing on the information entropy time series of the source IP of the IP to be monitored by fitting the local polynomial least square method of the SG filter to obtain a first sequence;

[0197] Performing a second smoothing on the first number series by exponentially weighted moving average to obtain a source IP information entropy baseline value of the IP to be monitored at each time point;

[0198] According to the source IP information entropy baseline value, a dynamic baseline corresponding to the source IP of the IP to be monitored is generated.

[0199] Optional, reference Figure 5 , the device 40 further comprises:

[0200] The fifth processing module 46 is used to determine a DDoS attack identification threshold according to the dynamic baseline:

[0201] Calculating the variance of the elements in the traffic matrix to the dynamic baseline;

[0202] According to the variance, the DDoS attack identification threshold is determined according to the following formula:

[0203]

[0204] Where t∈(1,T), T is the total number of sliding time windows, α is the control parameter, is the variance of the elements in the traffic matrix in the tth time window to the dynamic baseline.

[0205] Optional, reference Figure 5 , the third processing module 44 includes:

[0206] The judgment module 441 is used to perform the following judgment:

[0207] If the entropy value of the source IP of the IP to be monitored is greater than the first threshold at the first time point, it is determined that the probability of the existence of a DDoS attack is greater than a preset value;

[0208] If the entropy value of the source IP of the IP to be monitored is less than the first threshold at the second time point, it is determined that the probability of no DDoS attack is greater than a preset value.

[0209] Please refer to Figure 6 The embodiment of the present invention further provides a distributed denial of service DDoS attack detection device 60, the device 60 comprising:

[0210] The transceiver 62 is used to obtain the traffic sequence of the IP to be monitored;

[0211] The processor 61 is used to obtain the traffic matrix of the IP to be monitored according to the traffic sequence, and calculate the source IP information entropy of the IP to be monitored according to the traffic matrix;

[0212] The processor 61 is further used to determine a dynamic baseline corresponding to the source IP of the IP to be monitored, wherein the dynamic baseline is obtained by fitting the source IP information entropy in the traffic matrix using an SG filter and an exponentially weighted moving average method;

[0213] The processor 61 is further configured to compare the source IP information entropy of the IP to be monitored with the dynamic baseline to determine whether a DDoS attack occurs.

[0214] Optionally, the transceiver 62 is further configured to obtain the traffic sequence of the IP to be monitored at fixed time intervals every day within a preset period.

[0215] Optionally, the processor 61 is further configured to replace abnormal data in each column of the traffic matrix with an average value of the column where the abnormal data is located, wherein the abnormal data includes unreasonable values ​​and / or empty data.

[0216] Optionally, the processor 61 is further configured to calculate the probability of occurrence of the target source IP of the IP to be monitored in the vertical column where each sliding time window is located in the traffic matrix;

[0217] The length of the sliding time window is an integer multiple of the fixed time interval.

[0218] Optionally, the processor 61 is further used to generate an information entropy time series of the source IPs in the IPs to be monitored in each sliding window according to the probability of all source IPs in the IPs to be monitored appearing in their corresponding sliding time windows.

[0219] Optionally, the processor 61 is further configured to perform a first smoothing on the information entropy time series of the source IP of the IP to be monitored by fitting the local polynomial least squares method of the SG filter to obtain a first sequence;

[0220] Performing a second smoothing on the first number series by exponentially weighted moving average to obtain a source IP information entropy baseline value of the IP to be monitored at each time point;

[0221] According to the source IP information entropy baseline value, a dynamic baseline corresponding to the source IP of the IP to be monitored is generated.

[0222] Optionally, the processor 61 is further configured to determine a DDoS attack identification threshold according to the dynamic baseline:

[0223] Calculating the variance of the elements in the traffic matrix to the dynamic baseline;

[0224] According to the variance, the DDoS attack identification threshold is determined according to the following formula:

[0225]

[0226] Where t∈(1,T), T is the total number of sliding time windows, α is the control parameter, is the variance of the elements in the traffic matrix in the tth time window to the dynamic baseline.

[0227] Optionally, when determining whether a DDoS attack occurs, the process is further used to perform the following determination:

[0228] If the entropy value of the source IP of the IP to be monitored is greater than the first threshold at the first time point, it is determined that the probability of the existence of a DDoS attack is greater than a preset value;

[0229] If the entropy value of the source IP of the IP to be monitored is less than the first threshold at the second time point, it is determined that the probability of no DDoS attack is greater than a preset value.

[0230] Please refer to Figure 7 The embodiment of the present invention further provides a network device 70, including a processor 71, a memory 72, and a computer program stored in the memory 72 and executable on the processor 81. When the computer program is executed by the processor 71, each process of the above-mentioned DDoS attack detection method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0231] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned DDoS attack detection method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0232] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article 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, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0233] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0234] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.

Claims

1. A distributed denial of service (DDoS) attack detection method, characterized in that: The method comprises: Get the traffic sequence of the IP to be monitored; Acquire the traffic matrix of the IP to be monitored according to the traffic sequence, and calculate the source IP information entropy of the IP to be monitored according to the traffic matrix; Determine a dynamic baseline corresponding to the source IP of the IP to be monitored, wherein the dynamic baseline is obtained by fitting the source IP information entropy in the traffic matrix using an SG filter and an exponentially weighted moving average method; Compare the source IP information entropy of the IP to be monitored with the dynamic baseline to determine whether there is a DDoS attack; Determining the dynamic baseline corresponding to the source IP of the IP to be monitored includes: The information entropy time series of the source IP of the IP to be monitored is smoothed for the first time by fitting the local polynomial least square method of the SG filter to obtain a first sequence; Performing a second smoothing on the first number series by exponentially weighted moving average to obtain a source IP information entropy baseline value of the IP to be monitored at each time point; According to the source IP information entropy baseline value, a dynamic baseline corresponding to the source IP of the IP to be monitored is generated.

2. The method according to claim 1, characterized in that The flow sequence of obtaining the IP to be monitored includes: For each day within a preset period, the traffic sequence of the IP to be monitored is obtained at fixed time intervals.

3. The method according to claim 1, characterized in that The method further comprises: The abnormal data in each column of the traffic matrix is ​​replaced with the average value of the column where the abnormal data is located, and the abnormal data includes unreasonable values ​​and / or empty data.

4. The method according to claim 2, characterized in that: The calculating the source IP information entropy of the IP to be monitored according to the traffic matrix includes: Calculate the probability of the target source IP of the IP to be monitored in the column where each sliding time window is located in the traffic matrix; The length of the sliding time window is an integer multiple of the fixed time interval.

5. The method according to claim 4, characterized in that The calculating the source IP information entropy of the IP to be monitored according to the traffic matrix also includes: According to the probability of all source IPs in the IP to be monitored appearing in their corresponding sliding time windows, an information entropy time series of the source IPs in the IP to be monitored in each sliding window is generated.

6. The method according to claim 1, characterized in that The method further includes: determining a DDoS attack identification threshold according to the dynamic baseline, including: Calculating the variance of the elements in the traffic matrix to the dynamic baseline; According to the variance, the DDoS attack identification threshold is determined according to the following formula: Where t∈(1,T), T is the total number of sliding time windows, α is the control parameter, is the variance of the elements in the traffic matrix in the tth time window to the dynamic baseline.

7. The method according to claim 6, characterized in that The comparing the source IP information entropy of the IP to be monitored with the dynamic baseline to determine whether a DDoS attack exists includes: If the entropy value of the source IP of the IP to be monitored is greater than the first threshold at the first time point, it is determined that the probability of the existence of a DDoS attack is greater than a preset value; If the entropy value of the source IP of the IP to be monitored is less than the first threshold at the second time point, it is determined that the probability of no DDoS attack is greater than a preset value.

8. A DDoS attack detection device, characterized in that: include: The first receiving module is used to obtain the flow sequence of the IP to be monitored; A first processing module is used to obtain a traffic matrix of the IP to be monitored according to the traffic sequence, and calculate the source IP information entropy of the IP to be monitored according to the traffic matrix; The second processing module is used to determine the dynamic baseline corresponding to the source IP of the IP to be monitored, wherein the dynamic baseline is obtained by fitting the source IP information entropy in the traffic matrix using an SG filter and an exponentially weighted moving average method; The third processing module compares the source IP information entropy of the IP to be monitored with the dynamic baseline to determine whether there is a DDoS attack; The second processing module comprises: The third sub-processing module is used to perform a first smoothing on the information entropy time series of the source IP of the IP to be monitored by fitting the local polynomial least square method of the SG filter to obtain a first sequence; Performing a second smoothing on the first number series by exponentially weighted moving average to obtain a source IP information entropy baseline value of the IP to be monitored at each time point; According to the source IP information entropy baseline value, a dynamic baseline corresponding to the source IP of the IP to be monitored is generated.

9. A DDoS attack detection device, comprising a processor and a transceiver, characterized in that: The transceiver is used to obtain the flow sequence of the IP to be monitored; The processor is used to obtain the traffic matrix of the IP to be monitored according to the traffic sequence, and calculate the source IP information entropy of the IP to be monitored according to the traffic matrix; The processor is further used to determine a dynamic baseline corresponding to the source IP of the IP to be monitored, wherein the dynamic baseline is obtained by fitting the source IP information entropy in the traffic matrix using an SG filter and an exponentially weighted moving average method; The processor is further used to compare the source IP information entropy of the IP to be monitored with the dynamic baseline to determine whether there is a DDoS attack; The processor is further used to perform a first smoothing on the information entropy time series of the source IP of the IP to be monitored by fitting the local polynomial least squares method of the SG filter to obtain a first sequence; Performing a second smoothing on the first number series by exponentially weighted moving average to obtain a source IP information entropy baseline value of the IP to be monitored at each time point; According to the source IP information entropy baseline value, a dynamic baseline corresponding to the source IP of the IP to be monitored is generated.

10. A network device, characterized in that: include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the steps of the DDoS attack detection method according to any one of claims 1 to 7 are implemented.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the DDoS attack detection method according to any one of claims 1 to 7 are implemented.