DDoS attack detection method, system, equipment and medium
By counting user detection indicators and historical DDoS attack records, we construct an objective function based on the probability of missing alarms and false alarms, and solve for the optimal detection threshold. This solves the problem of difficulty in updating DDoS attack detection thresholds in the existing technology, and improves the efficiency of edge computing. Accuracy and robustness of DDoS detection.
Patent Information
- Application Number
- CN202311586289.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-23
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2043-11-23
AI Technical Summary
The existing technology makes it difficult to update the DDoS attack detection threshold in time to ensure detection performance, especially when the system settings change, resulting in a decline in the detection performance of the edge server when facing DDoS attacks.
By counting the detection indicators of multiple users, we obtain the probability distribution of historical DDoS attack records, calculate system parameters, and construct an objective function based on the probability of missed alarms and false alarms to solve for the optimal detection threshold to ensure that the edge server can accurately identify DDoS attacks. who.
It improves the accuracy and robustness of DDoS detection in edge computing. By revealing the mathematical relationship between detection thresholds and detection performance, it ensures that detection thresholds are updated in time when system settings change, improving detection performance.
Smart Images

Figure CN117857080B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network security technology, and in particular to a detection method, system, device and medium for DDoS attacks. Background Art
[0002] Due to the limited computing power and imperfect security systems of edge servers, edge computing is vulnerable to network attacks, especially distributed denial of service (DDoS) attacks. During a DDoS attack, hackers operate malware-infected devices as DDoS attackers, exhausting the computing and communication resources of the target server by sending too many malicious requests. The edge server that encounters a DDoS attack will lose its service capabilities. In order to prevent DDoS attacks, the edge server introduces a set of detection indicators based on the behavioral characteristics of DDoS attackers, then monitors the detection indicators of users accessing it, and sets detection thresholds to detect DDoS attackers among them. In this case, the edge server can identify and reject requests from detected DDoS attackers.
[0003] In view of the above situation, the common practice is to compare the detection performance under different detection threshold settings in simulation experiments, and select a set of detection thresholds with the best detection performance as the fixed detection threshold set by the edge server; the second is that the edge server periodically counts the mean and variance of the detection indicators of all visiting users, and regularly calculates and updates the detection threshold. However, the threshold setting method depends on simulation or statistical results. When the system settings change, these methods are difficult to update the detection threshold in time to ensure detection performance. Summary of the invention
[0004] Based on the above technical problems, the present application aims to provide a DDoS attack detection method, system, device and medium to solve at least one of the above problems.
[0005] In a first aspect, the present application provides a DDoS attack detection method, which is applied to an edge server system, wherein the edge server system includes a server layer and a user layer, wherein the server layer includes a plurality of edge servers, and the user layer includes a plurality of users;
[0006] The method comprises:
[0007] In response to the requests of the multiple users, counting the detection indicators of the multiple users;
[0008] Obtain historical DDoS attack records, count the probability distributions satisfied by the historical DDoS attack records, and calculate system parameters corresponding to the probability distributions;
[0009] constructing an objective function based on the system parameters, and calculating a detection threshold based on the objective function;
[0010] For each user, the detection index of each user is compared with the detection threshold corresponding to the user one by one. If the detection index of a user is greater than the detection threshold corresponding to the detection index, the user is determined to be a DDoS attacker.
[0011] In some embodiments of the present application, the counting of detection indicators of the multiple users includes:
[0012] Counting the number of all requests generated by each of the multiple users and sent to the same edge server within a preset time as a first detection indicator, and counting the time taken by the same edge server to process n requests as a third detection indicator, where n is greater than or equal to 1 and less than or equal to the number of all requests;
[0013] The total number of requests generated by each of the multiple users within a preset time is counted, and a ratio of the first detection indicator to the total number of requests is calculated as a second detection indicator.
[0014] In some embodiments of the present application, constructing an objective function based on the system parameters includes:
[0015] According to the system parameters, respectively solve the missed alarm probability and the false alarm probability;
[0016] An objective function is constructed based on the missed alarm probability and the false alarm probability.
[0017] In some embodiments of the present application, the calculating the detection threshold based on the objective function includes:
[0018] Calculating a detection threshold corresponding to the third detection indicator;
[0019] Calculating a detection threshold corresponding to the first detection indicator;
[0020] Substitute the detection threshold corresponding to the third detection index and the detection threshold corresponding to the first detection index into the objective function to calculate the detection threshold corresponding to the second detection index.
[0021] In some embodiments of the present application, the calculating the detection threshold corresponding to the third detection indicator includes:
[0022] A detection threshold corresponding to the third detection indicator is calculated according to an average rate at which the same edge server processes requests sent by the normal user and the DDoS attacker, and a second preset closed-form solution formula.
[0023] In some embodiments of the present application, the calculating the detection threshold corresponding to the first detection indicator includes:
[0024] A detection threshold corresponding to the first detection indicator is calculated according to the average number of requests generated by the normal user and the DDoS attacker within a preset time, the probability that the total number of requests generated by the normal user and the DDoS attacker within the preset time is sent to the same edge server, and a first preset closed-form solution formula.
[0025] In some embodiments of the present application, substituting the detection threshold corresponding to the third detection index and the detection threshold corresponding to the first detection index into the objective function to calculate the detection threshold corresponding to the second detection index includes:
[0026] Substituting a detection threshold corresponding to the third detection index and a detection threshold corresponding to the first detection index into the objective function, and minimizing the objective function;
[0027] The variable value is updated in the process of minimizing the objective function using the simulated annealing method to obtain an optimal solution as the detection threshold corresponding to the second detection index.
[0028] In some embodiments of the present application, after determining that the user is a DDoS attacker, the method further includes:
[0029] Block the IP address of the DDoS attacker, or limit the maximum number of connections of the IP address of the DDoS attacker, and / or perform system upgrades.
[0030] A second aspect of the present application provides an edge server system, the system comprising:
[0031] A statistics module, configured to count the detection indicators of the multiple users in response to the requests of the multiple users;
[0032] A calculation module is configured to obtain historical DDoS attack records, count the probability distributions satisfied by the historical DDoS attack records, and calculate system parameters corresponding to the probability distributions;
[0033] A construction module is configured to construct an objective function based on the system parameters and calculate a detection threshold based on the objective function;
[0034] The determination module is configured to compare the detection indicators of each user with the detection threshold corresponding to the user one by one for each user. If the detection indicators of a user are all greater than the detection threshold corresponding to the detection indicators, the user is determined to be a DDoS attacker.
[0035] A third aspect of the present application provides an electronic device, including a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the DDoS attack detection method described in each embodiment of the present application.
[0036] A fourth aspect of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the DDoS attack detection method described in each embodiment of the present application is implemented.
[0037] The technical solution provided in the embodiments of the present application has at least the following technical effects or advantages:
[0038] The DDoS attack detection method in each embodiment of the present application uses the missed alarm probability and the false alarm probability to represent the detection performance of the DDoS attack and derives the function expression of the missed alarm probability, the false alarm probability, and the detection threshold, thereby revealing the mathematical relationship between the detection threshold and the detection performance; by solving the closed-form solution of the optimal detection threshold that minimizes the missed alarm probability and the false alarm probability, the accuracy and robustness of DDoS detection in edge computing are improved.
[0039] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] 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 application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0041] Figure 1 It is a schematic diagram of the steps of a method for detecting a DDoS attack in an exemplary embodiment of the present application;
[0042] Figure 2 is a structural diagram of an edge server system in an exemplary embodiment of the present application;
[0043] Figure 3 It is a schematic diagram of a process in which an edge server responds to a user request in an exemplary embodiment of the present application;
[0044] Figure 4 It is a flowchart of a method for detecting a DDoS attack in an exemplary embodiment of the present application;
[0045] Figure 5 is a schematic diagram of the structure of another edge server system in an exemplary embodiment of the present application;
[0046] Figure 6 It is a structural schematic diagram of an electronic device provided by an exemplary embodiment of the present application.
[0047] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. DETAILED DESCRIPTION
[0048] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It is understood that the embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It should also be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.
[0049] Edge servers are located close to end users, so they can achieve lower network latency, allowing data to be transmitted faster and improving user experience. However, due to the limited computing power and imperfect security systems of edge servers, edge computing is vulnerable to network attacks, especially distributed denial of service (DDoS) attacks. During a DDoS attack, hackers operate malware-infected devices as DDoS attackers, exhausting the computing and communication resources of the target server by sending too many malicious requests. The edge server that encounters the DDoS attack will lose its service capacity.
[0050] In order to prevent DDoS attacks, the edge server introduces a set of detection indicators based on the behavioral characteristics of DDoS attackers, then monitors the detection indicators of users accessing it, and sets detection thresholds to detect DDoS attackers. In this case, the edge server can identify and reject requests from detected DDoS attackers. In response to this situation, a common approach is to compare the detection performance under different detection threshold settings in simulation experiments, and select a set of detection thresholds with the best detection performance as the fixed detection threshold set by the edge server; the second is that the edge server periodically counts the mean and variance of the detection indicators of all visiting users, and regularly calculates and updates the detection threshold according to Chebyshev's theorem.
[0051] However, the above threshold setting methods rely on simulation or statistical results, and the mathematical relationship between the detection threshold and the detection performance is still unknown. When the system settings change, it is difficult for the above methods to update the detection threshold in time to ensure the detection performance. For the constantly changing system, we need to reveal the mathematical relationship between the detection threshold and the detection performance, so as to calculate the new detection threshold in time to ensure the detection performance when the system settings change.
[0052] Therefore, in some embodiments of the present application, a method for applying to an edge server system is provided, wherein the edge server system includes a server layer and a user layer, wherein the server layer includes a plurality of edge servers, and the user layer includes a plurality of users; Figure 1 As shown, the method includes steps S1-S3.
[0053] S1. In response to requests from multiple users, count detection indicators of the multiple users and calculate system parameters corresponding to the detection indicators.
[0054] Figure 2 It is a schematic diagram of the structure of an edge server system, such as Figure 2 As shown, the edge server system includes a server layer and a user layer. The server layer includes multiple edge servers, and the user layer includes multiple users. There are normal users and there may be DDoS attackers. Before counting the detection indicators of multiple users and calculating the system parameters corresponding to the detection indicators, it can be determined whether the system settings of the edge server system have changed, and statistics and calculations can be performed after the changes occur.
[0055] In order to describe the process of edge servers responding to user requests, this application introduces an M / M / N queuing model, which contains M users and N edge servers, represented as {u1,u2,...,u M} and {s1,s2,...,s N}. Figure 3 FIG. 1 is a schematic diagram of a process in which an edge server responds to a user request in an exemplary embodiment of the present application. Figure 3 As shown, each edge server processes only one request at a time and maintains a request queue to store the later requests. Each user randomly selects an edge server with a certain probability to send its current request.
[0056] In a preferred implementation, the detection indicators of multiple users are counted, including: counting the number of all requests generated by each of the multiple users within a preset time and sent to the same edge server as a first detection indicator, and counting the time taken by the same edge server to process n requests as a third detection indicator, wherein n is greater than or equal to 1 and less than or equal to the number of all requests; counting the total number of requests generated by each of the multiple users within a preset time, and calculating the ratio of the first detection indicator to the total number of requests as a second detection indicator. Compared with normal users, DDoS attackers usually send more requests with a higher proportion to a server, and the requests of DDoS attackers also take longer to process on the server. Therefore, the design of the first detection indicator, the second detection indicator, and the third detection indicator are more scientific and reasonable. Specifically, user u i Generate and send to the server within the preset time j The number of requests is the first detection indicator, and k ij Indicates; Servers j Processing user u i The total time of sending n requests is the third detection indicator, t s,ij Indicates; k ij With x i The ratio of is the second detection index, expressed as ωij Indicates that x i Represents user u i The number of requests generated within a preset time. j and user u i , to analyze the service process between them, we can omit the subscript of the detection index and use k,ω,t s It represents the detection index of the user, and x represents the number of requests generated by the user within the preset time.
[0057] S2. Obtain historical DDoS attack records, count the probability distributions satisfied by the historical DDoS attack records, and calculate system parameters corresponding to the probability distributions.
[0058] In a specific implementation, historical DDoS attack records are obtained, the probability distribution satisfied by the historical DDoS attack records is counted, and the system parameters corresponding to the probability distribution are calculated, including: obtaining historical DDoS attack records through the security log of the edge server system; cleaning the obtained historical DDoS attack records, wherein cleaning includes deleting invalid, redundant or erroneous data; analyzing the cleaned data to identify the pattern and characteristics of DDoS attack events; using statistical methods to determine the probability distribution satisfied by the historical DDoS attack records based on the information obtained from the analysis, such as Poisson distribution, exponential distribution, etc.; after the probability distribution is established, the relevant system parameters, i.e., the system parameters corresponding to the determined probability distribution, are obtained based on different probability properties. Assume that for a certain user u i , x i It represents the number of requests generated within a preset time length, which follows the Poisson distribution P(m i ), then we can find the parameter m of the Poisson distribution i For u i Target servers j , t ij Indicates its i The processing time of a request follows the exponential distribution E(θ i ), we can find the parameter θ of the exponential distribution i . k ij Indicates that within the set time it receives a message from u i The number of requests follows the binomial distribution B(x i ,p i ), we can find the parameter p of the binomial distribution i It should be noted that when obtaining historical DDoS attack records, it is not limited to obtaining users belonging to DDoS attacks, but also includes records of normal users, so as to compare the two and facilitate subsequent analysis and calculation.
[0059] For example, based on the analysis and statistics of historical DDoS attack records, m1 and m2 represent the average number of requests generated by normal users and DDoS attackers within a preset time, respectively, and p1 and p2 represent the probability that normal users and DDoS attackers send their generated requests to a certain edge server (the same server). Let θ1 and θ2 represent the average rate at which the same edge server processes requests from normal users and DDoS attackers, respectively. The joint probability distribution of x and k can be expressed as formula (1) and formula (2), respectively:
[0060]
[0061]
[0062] Among them, P1 represents the joint probability of normal users regarding x and k, P2 represents the joint probability of DDoS attackers regarding x and k, and x represents the number of requests generated by the user within a preset time.
[0063] The time t taken by a certain edge server or the same edge server to process the requests sent by normal users and DDoS attackers s The probability distribution of is respectively formula (3) and formula (4):
[0064]
[0065]
[0066] Among them, θ1 and θ2 represent the average rate at which the same edge server processes requests from normal users and DDoS attackers, respectively. Based on formulas (1) to (4), the probability distribution satisfied by historical DDoS attack records is statistically analyzed to obtain parameters corresponding to the probability distribution, such as m1m2p1p2θ1θ2, which are parameters corresponding to the probability distribution form. It can be understood that the objective function is subsequently constructed based on the parameters m1m2p1p2θ1θ2, and the detection threshold is calculated based on the objective function. If all three detection indicators of a user exceed their thresholds (k>k th ,ω>ω th ,t s >t s,th ), then the user is judged to be a DDoS attacker, otherwise the user is judged to be a normal user.
[0067] S3. Construct an objective function based on the system parameters, and calculate a detection threshold based on the objective function.
[0068] In a specific implementation, constructing an objective function based on system parameters includes: solving the missed alarm probability and the false alarm probability according to the system parameters; and constructing an objective function based on the missed alarm probability and the false alarm probability. It should be noted that the above "solving" the missed alarm probability and the false alarm probability is actually to obtain the expressions of the missed alarm probability and the false alarm probability. Here, the expressions of the missed alarm probability and the false alarm probability are respectively expressed by formula (5) and formula (6):
[0069]
[0070]
[0071] Among them, F miss represents the missed alarm probability function, F false represents the false alarm probability function, k th ,ω th ,t s,th Represents the detection threshold corresponding to the first detection index, the second detection index, and the third detection index. Thus, the present application uses the probability of missed alarm and the probability of false alarm to represent the detection performance, and derives the function expression of the probability of missed alarm and the probability of false alarm about the detection threshold, thereby revealing the mathematical relationship between the detection threshold and the detection performance. The objective function constructed based on the probability of missed alarm and the probability of false alarm is as shown in formula (7):
[0072]
[0073] Among them, F * represents the objective function, k th ,ω th ,t s,th The detection thresholds corresponding to the first detection indicator, the second detection indicator, and the third detection indicator can be respectively regarded as the first detection threshold, the second detection threshold, and the third detection threshold.
[0074] In another specific implementation, the detection threshold is calculated based on the objective function, including: calculating the detection threshold corresponding to the first detection indicator; calculating the detection threshold corresponding to the third detection indicator; substituting the detection threshold corresponding to the first detection indicator and the detection threshold corresponding to the third detection indicator into the objective function to calculate the detection threshold corresponding to the second detection indicator. Specifically, the detection threshold corresponding to the third detection indicator is calculated, including: calculating the detection threshold corresponding to the third detection indicator according to the average rate at which the same edge server processes requests sent by normal users and DDoS attackers, and the second preset closed-form solution formula. The detection threshold corresponding to the first detection indicator is calculated, including: calculating the detection threshold corresponding to the first detection indicator according to the average number of requests generated by normal users and DDoS attackers within a preset time, the probability that normal users and DDoS attackers will send the generated requests to the same edge server within a preset time, and the first preset closed-form solution formula.
[0075] It should be noted that in order to obtain the best detection performance, that is, to minimize the probability of missed alarms and false alarms, the edge server needs to select the optimal threshold k th * ,ω th * ,t s,th * , so that F * (k th ,ω th ,t s,th ) is minimized, in order to solve k th * ,ω th * ,t s,th * , we can first use the partial derivative analysis method to obtain t s,th * ,k th * Specifically, by listing the following set of equations (Formula (8)) to solve t s,th =t s,th * ,k th =k th * :
[0076]
[0077] Solving the above equations to obtain t s,th * ,k th * The closed-form solution of is given by formula (9) and formula (10):
[0078]
[0079]
[0080] Wherein, l is an integer, the minimum value is 0, the maximum value is n-1, and n is greater than or equal to 1 and less than or equal to the number of all requests. It can be understood that formula (9) is the second preset closed-form solution formula, and formula (10) is the first preset closed-form solution formula. User u i Generate and send to the server within the preset time j The number of requests is the first detection indicator, and k ij Indicates that the server s j Processing user u i The total time of sending n requests is the third detection indicator, t s,ij It means that k ij With x i The ratio of is the second detection index, expressed as ω ij Indicates that x i Represents user u i The number of requests generated within a preset time, indicating t s,th * and k th * It is calculated according to formula (9) i.e. the second preset closed-form solution formula and formula (10) i.e. the first preset closed-form solution formula and the third detection index t s,ij and the first detection index k ij The corresponding detection threshold is then used to s,th * and k th * Get the second detection index ω ij The corresponding detection threshold ω th * .
[0081] In a preferred implementation, the detection threshold corresponding to the first detection index and the detection threshold corresponding to the third detection index are substituted into the objective function to calculate the detection threshold corresponding to the second detection index, including: substituting the detection threshold corresponding to the first detection index and the detection threshold corresponding to the third detection index into the objective function in formula (7), and minimizing the objective function even if the missed alarm probability and the false alarm probability reach the minimum value; using the simulated annealing method to update the variable value in the process of minimizing the objective function to obtain the optimal solution as the detection threshold ω corresponding to the second detection index. th * .
[0082] like Figure 4As shown, when the system settings change, the historical DDoS attack records are obtained, the probability distribution satisfied by the historical DDoS attack records is counted, and the system parameters corresponding to the probability distribution, such as m1m2p1p2θ1θ2, are calculated, and m1m2p1p2θ1θ2 is substituted into formula (9) and formula (10) to calculate the new optimal detection threshold t s,th * ,k th * , then t s,th * ,k th * Substitute the objective function F * (k th ,ω th ,t s,th ), use the simulated annealing algorithm to solve ω th * The solution process is a cyclic iterative process. In each iteration, the current detection threshold is randomly perturbed, the objective function value is calculated, and then a decision is made whether to accept the new detection threshold. The acceptance rule can be that if the new detection threshold causes the objective function constructed by the missed alarm probability and the false alarm probability to reach the minimum, then it is accepted to obtain the optimal solution. In this way, the optimal detection threshold k is optimized based on the missed alarm probability and the false alarm probability. th * ,ω th * ,t s,th * , which can ensure accurate detection of DDoS attackers.
[0083] S4. For each user, the detection index of each user is compared with the corresponding detection threshold one by one. If the detection index of a user is greater than the detection threshold corresponding to the detection index, the user is determined to be a DDoS attacker.
[0084] Refer to Figure 4 , if the detection index of a user is greater than the detection threshold corresponding to the detection index, that is, the first detection index is greater than k th * , the second detection index is greater than ω th * and the third detection index is greater than t s,th *, it can be determined that the user is a DDoS attacker. After determining that the user is a DDoS attacker, the IP address of the DDoS attacker can be blocked, or the maximum number of connections of the IP address of the DDoS attacker can be limited, and / or the system can be upgraded. Because there are multiple users in the user layer, all users must be screened to find all DDoS attackers. It can be seen that this application uses the missed alarm probability and the false alarm probability to represent the detection performance of DDoS attacks and derives the function expression of the missed alarm probability and the false alarm probability with respect to the detection threshold, thereby revealing the mathematical relationship between the detection threshold and the detection performance; by solving the closed-form solution of the optimal detection threshold that minimizes the missed alarm probability and the false alarm probability, the accuracy and robustness of DDoS detection in edge computing are improved.
[0085] In some embodiments of the present application, an edge server system is further provided to execute the DDoS attack detection method described in each embodiment of the present application, such as Figure 5 As shown, the system comprises:
[0086] A statistics module 501 is configured to count the detection indicators of the multiple users in response to the requests of the multiple users;
[0087] The calculation module 502 is configured to obtain historical DDoS attack records, count the probability distributions satisfied by the historical DDoS attack records, and calculate system parameters corresponding to the probability distributions;
[0088] A construction module 503 is configured to construct an objective function based on the system parameters, and calculate a detection threshold based on the objective function;
[0089] The determination module 504 is configured to compare the detection index of each user with the detection threshold corresponding to the user one by one for each user. If the detection index of a user is greater than the detection threshold corresponding to the detection index, the user is determined to be a DDoS attacker.
[0090] When the construction module realizes the construction of the objective function based on the system parameters, the following are executed: solving the missed alarm probability and the false alarm probability respectively according to the system parameters; and constructing the objective function based on the missed alarm probability and the false alarm probability. When the construction module realizes the calculation of the detection threshold based on the objective function, the following are specifically executed: calculating the detection threshold corresponding to the first detection index; calculating the detection threshold corresponding to the third detection index; substituting the detection threshold corresponding to the first detection index and the detection threshold corresponding to the third detection index into the objective function to calculate the detection threshold corresponding to the second detection index.
[0091] It can be understood that the edge server system includes a server layer and a user layer from another dimension, the server layer includes multiple edge servers, and the user layer includes multiple users. The edge server system uses the missed alarm probability and the false alarm probability to represent the detection performance of DDoS attacks and derives the function expression of the missed alarm probability, the false alarm probability, and the detection threshold, thereby revealing the mathematical relationship between the detection threshold and the detection performance; by solving the closed-form solution of the optimal detection threshold that minimizes the missed alarm probability and the false alarm probability, the accuracy and robustness of DDoS detection in edge computing are improved.
[0092] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application.
[0093] Please refer to the following Figure 6 , which is a schematic diagram of an electronic device provided by some embodiments of the present application. Figure 6 As shown, the electronic device 2 includes: a processor 200, a memory 201, a bus 202 and a communication interface 203, wherein the processor 200, the communication interface 203 and the memory 201 are connected via the bus 202; the memory 201 stores a computer program that can be run on the processor 200, and the processor 200 executes any DDoS attack detection method in each embodiment of the present application when running the computer program. The method includes: responding to requests from multiple users, counting detection indicators of multiple users; obtaining historical DDoS attack records, counting the probability distribution satisfied by the historical DDoS attack records, and calculating system parameters corresponding to the probability distribution; constructing an objective function based on the system parameters, and calculating a detection threshold based on the objective function; for each user, comparing the detection indicators of each user with the detection threshold corresponding to the detection indicator one by one, and if the detection indicators of a certain user are all greater than the detection threshold corresponding to the detection indicator, the user is determined to be a DDoS attacker.
[0094] The memory 201 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 203 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.
[0095] The bus 202 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The memory 201 is used to store programs, and the processor 200 executes the programs after receiving the execution instruction. The DDoS attack detection method disclosed in any implementation of the embodiment of the present application may be applied to the processor 200, or implemented by the processor 200.
[0096] The processor 200 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 200. The above processor 200 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to be executed, or the hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 201, and the processor 200 reads the information in the memory 201, and completes the steps of the DDoS attack detection method in combination with its hardware. The steps include: responding to the requests of multiple users, counting the detection indicators of multiple users; obtaining historical DDoS attack records, counting the probability distribution satisfied by the historical DDoS attack records, and calculating the system parameters corresponding to the probability distribution; constructing an objective function based on the system parameters, and calculating the detection threshold based on the objective function; for each user, comparing the detection indicators of each user with the corresponding detection threshold one by one, if the detection indicators of a certain user are all greater than the detection threshold corresponding to the detection indicator, then determining that the user is a DDoS attacker.
[0097] The present application also provides a computer-readable storage medium corresponding to the DDoS attack detection method provided in the above embodiment, on which a computer program is stored, and when the computer program is executed by the processor, the DDoS attack detection method provided in any of the above embodiments will be executed. In addition, examples of the computer-readable storage medium may also 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 optical or magnetic storage media, which will not be described one by one here.
[0098] In addition, an embodiment of the present application further provides a computer program product, including a computer program, which, when executed by a processor, implements any one of the DDoS attack detection methods in the aforementioned embodiments.
[0099] Those skilled in the art will appreciate that the various component embodiments of the present application may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all functions of some or all components of the virtual machine creation device according to the embodiments of the present application.
[0100] The above is only a preferred specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for detecting a DDoS attack, characterized in that: Applied to an edge server system, the edge server system comprises a server layer and a user layer, the server layer comprises a plurality of edge servers, and the user layer comprises a plurality of users; The method comprises: In response to the requests of the multiple users, counting the detection indicators of the multiple users; Obtain historical DDoS attack records, count the probability distributions satisfied by the historical DDoS attack records, and calculate system parameters corresponding to the probability distributions; constructing an objective function based on the system parameters, and calculating a detection threshold based on the objective function; For each user, the detection index of each user is compared with the detection threshold corresponding to the detection index one by one. If the detection index of a user is greater than the detection threshold corresponding to the detection index, the user is determined to be a DDoS attacker; The objective function is: Among them, F * represents the objective function, k th ,ω th ,t s,th represents the detection threshold corresponding to the first detection index, the second detection index, and the third detection index, F miss represents the missed alarm probability function, F false represents the false alarm probability function, k,t s Represents the detection index of the user, k th is the threshold value corresponding to k, x represents the number of requests generated by the user within the preset time, P1(x,k) represents the joint probability of x and k for normal users, f2(t s ) represents the time t taken by the request sent by the DDoS attacker s The probability distribution of .
2. The DDoS attack detection method according to claim 1, characterized in that: The counting of detection indicators of the plurality of users includes: Counting the number of all requests generated by each of the multiple users and sent to the same edge server within a preset time as a first detection indicator, and counting the time taken by the same edge server to process n requests as a third detection indicator, where n is greater than or equal to 1 and less than or equal to the number of all requests; The total number of requests generated by each of the multiple users within a preset time is counted, and a ratio of the first detection indicator to the total number of requests is calculated as a second detection indicator.
3. The method for detecting DDoS attacks according to claim 1, characterized in that: The constructing the objective function based on the system parameters comprises: According to the system parameters, respectively solve the missed alarm probability and the false alarm probability; An objective function is constructed based on the missed alarm probability and the false alarm probability.
4. The method for detecting DDoS attacks according to claim 2, characterized in that: The calculating the detection threshold based on the objective function comprises: Calculating a detection threshold corresponding to the third detection indicator; Calculating a detection threshold corresponding to the first detection indicator; Substitute the detection threshold corresponding to the third detection index and the detection threshold corresponding to the first detection index into the objective function to calculate the detection threshold corresponding to the second detection index.
5. The method for detecting DDoS attacks according to claim 4, characterized in that: The calculating a detection threshold corresponding to the third detection indicator includes: A detection threshold corresponding to the third detection indicator is calculated based on an average rate at which the same edge server processes requests sent by normal users and the DDoS attacker, and a second preset closed-form solution formula.
6. The method for detecting DDoS attacks according to claim 5, characterized in that: The calculating a detection threshold corresponding to the first detection indicator includes: A detection threshold corresponding to the first detection indicator is calculated according to the average number of requests generated by the normal user and the DDoS attacker within a preset time, the probability that the total number of requests generated by the normal user and the DDoS attacker within the preset time is sent to the same edge server, and a first preset closed-form solution formula.
7. The method for detecting DDoS attacks according to claim 4, characterized in that: Substituting the detection threshold corresponding to the third detection index and the detection threshold corresponding to the first detection index into the objective function to calculate the detection threshold corresponding to the second detection index includes: Substituting a detection threshold corresponding to the third detection index and a detection threshold corresponding to the first detection index into the objective function, and minimizing the objective function; The variable value is updated in the process of minimizing the objective function using the simulated annealing method to obtain an optimal solution as the detection threshold corresponding to the second detection index.
8. The DDoS attack detection method according to any one of claims 1 to 7, characterized in that: After determining that the user is a DDoS attacker, the method further includes: Block the IP address of the DDoS attacker, or limit the maximum number of connections of the IP address of the DDoS attacker, and / or perform system upgrades.
9. An edge server system, characterized in that: The system comprises: A statistics module, configured to count the detection indicators of the multiple users in response to the requests of the multiple users; A calculation module is configured to obtain historical DDoS attack records, count the probability distributions satisfied by the historical DDoS attack records, and calculate system parameters corresponding to the probability distributions; A construction module is configured to construct an objective function based on the system parameters and calculate a detection threshold based on the objective function; A determination module is configured to compare the detection index of each user with the detection threshold corresponding to the user one by one for each user, and if the detection index of a user is greater than the detection threshold corresponding to the detection index, the user is determined to be a DDoS attacker; The objective function is: Among them, F * represents the objective function, k th ,ω th ,t s,th represents the detection threshold corresponding to the first detection index, the second detection index, and the third detection index, F miss represents the missed alarm probability function, F false represents the false alarm probability function, k,t s Represents the detection index of the user, k th is the threshold value corresponding to k, x represents the number of requests generated by the user within the preset time, P1(x,k) represents the joint probability of x and k for normal users, f2(t s ) represents the time t taken by the request sent by the DDoS attacker s The probability distribution of .
10. An electronic device comprising a memory and a processor, characterized in that: The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the DDoS attack detection method according to any one of claims 1 to 8.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for detecting a DDoS attack as described in any one of claims 1 to 8 is implemented.
