SYN Flood attack detection and mitigation method based on GCBF

By using the generational counting Bloom filter and SYN Cookie mechanism on programmable switches, the problems of insufficient generalization and high resource consumption in the existing technology are solved, and high precision and low accuracy are achieved Misconception attack detection and mitigation effects.

CN119094220APending Publication Date: 2024-12-06HUNAN UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411291750.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-14
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

When detecting and mitigating SYN Flood attacks, the traditional methods are insufficiently generalized, the machine learning methods consume a lot of computing resources, and the non-machine learning methods occupy a lot of switch resources, making it difficult to achieve high-precision and low misjudgment detection and mitigation.

Method used

Using the SYN Flood attack detection and mitigation method based on generational counting Blood filter (GCBF), the SYN cookie mechanism is deployed on a programmable switch, tracking the TCP connection status through GCBF, recording TCP connection information, detecting and filtering attackers, using TTL blacklist and general blacklist are dynamically filtered to reduce resource usage and reduce misjudgment.

Benefits of technology

It realizes high-precision SYN Flood attack detection and mitigation, reduces the use of programmable switch space resources, reduces misjudgment, and improves network stability and management flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119094220A_ABST
    Figure CN119094220A_ABST
Patent Text Reader

Abstract

The invention discloses an SYN Flood attack detection and mitigation method based on a GCBF, and belongs to the field of computer network security, and the scheme comprises the following steps: firstly, realizing an SYN cookie proxy on a P4 switch, and verifying a TCP connection request; meanwhile, a GCBF and a sketch are used for recording and tracking TCP connection information, fractional alternation is carried out in a plurality of filters, old elements are deleted by covering expired data, detected SYN Flood attacks and variant attackers Digest are reported to a controller, and a TTL blacklist is added. Then, packet loss filtering is carried out on data packets by using the established TTL blacklist and the general blacklist at the switch inlet, and TTL or streams with the blacklist hitting times exceeding a threshold value are added into the general blacklist; the attack detection and mitigation method provided by the invention has relatively high accuracy and relatively low false alarm rate, can be actually deployed on a P4 programmable switch, and has a good effect on detecting and mitigating SYN Flood attacks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of computer network security, and in particular relates to a SYNFlood attack detection and mitigation method based on GCBF. Background Art

[0002] Among the many means of network attacks, the representative Distributed Denial of Service (DDoS) attack has become one of the important factors that seriously threaten the security and stability of the network. DDoS attack is an extended form of Denial of Service (DoS) attack. It carries out large-scale attacks through multi-point collaboration. Unlike traditional DoS attacks, DoS attacks are usually launched by a single source, attacking the security vulnerabilities of the target system, using deception or counterfeit technology to overload system resources, making the server unable to process normal requests, resulting in service interruption. DDoS, on the other hand, is a collective attack by hundreds or thousands of controlled hosts, which are equipped with malware and launch attacks in collaboration to consume the target's bandwidth or resources, blocking the normal access of legitimate users, and thus affecting the normal operation of the website or service.

[0003] SYN Flood attack, a common form of DDoS attack, has become an urgent problem to be solved in the field of network security because it is difficult to trace the source and prevent, and it is easy to initiate with low execution cost. SYN Flood attack abuses the TCP three-way handshake process. The attacker sends a large number of forged SYN requests to the target server to consume the server's semi-connected queue resources, making it impossible for normal user requests to be processed, thereby achieving the purpose of denial of service.

[0004] Among the detection and defense methods for SYNFlood, the traditional defense methods include general methods and defense methods specifically for SYNFlood attacks. Since SYNFlood attacks are a type of DDoS attacks, general DDoS attack defense methods can also effectively detect and defend SYN Flood attacks. This general method is simple and effective, but the attack features it describes are too generalized and not targeted, which results in the inability to accurately detect and mitigate SYN Flood attacks. Existing detection and mitigation schemes for SYNFlood attacks are generally divided into two types: one is based on machine learning methods to detect and mitigate attackers, and the other is a non-machine learning method, which records network information such as attack flows or data packets by designing data structures, or designs data packet processing logic to analyze network flows or data packets. Both are based on the processing logic in the Programming Protocol-Independent Packet Processors (P4) language to detect and mitigate attackers. The machine learning model of the former is generally very complex, requiring a large amount of computing resources for real-time data processing and decision-making, and needs to overcome the calculation limitations of the P4 language on floating points, division, etc., which may impose a large burden on the processing power and memory resources of the switch; at the same time, the machine learning model requires a large amount of high-quality training data, and the application of complex models for real-time attack detection may also introduce a lot of delays. The data structure and complex data processing logic of the latter generally require a large amount of switch space to record network information in order to provide a strong basis for attack detection.

[0005] Compared with traditional network devices, which usually adopt closed hardware and software structures, have limited functions, poor scalability, and the data plane and control plane functions are tightly coupled together, resulting in limited functions of network devices and difficulty in flexible network management and innovation. The Software-Defined Networking (SDN) architecture separates the network control plane and data plane, and uses a centralized controller to globally control and manage the network. The data plane device is only responsible for forwarding data packets, and the network is dynamically programmed and automatically managed through the controller. In order to solve the limitation that only the control plane in SDN is programmable and the data plane is still relatively static, P4 has emerged to realize programmable data planes. Network administrators or application developers use programming languages ​​such as P4 to define the processing logic of data packets, so that network behavior can be dynamically adjusted and customized according to specific needs and scenarios.

[0006] The present invention detects and mitigates SYN Flood attacks based on a programmable network architecture. In order to overcome the problems of the generalization of traditional DDoS methods, the complexity of machine learning methods, and the occupation of more limited resources of programmable switches by non-machine learning methods in existing SYNFlood attack detection and mitigation methods, a SYN Flood attack detection and mitigation method based on generational counting bloom filter (CGBF) is proposed. A SYN Cookie mechanism is deployed on a programmable switch as an agent for establishing a TCP connection, and the SYN request packet sent by the client is verified. The TCP connection status is tracked using CGBF, and the TCP connection information is recorded to detect SYN Flood attackers who send too many SYN request packets. A sketch is used to record the TCP connection information verified by the SYN Cookie, and a SYN Flood variant attacker who cracks the SYN Cookie and passes the verification is detected according to the number of subsequent data transmission packets and the number of SYN request packets. The detected attackers are added to the TTL blacklist and the general blacklist according to the blacklist hit frequency, and the two constructed blacklists are used to filter and discard the attackers when the data packets enter the switch entrance to mitigate the SYN Flood attack. Summary of the invention

[0007] In view of the shortcomings of the existing SYN Flood attack detection and mitigation solutions in the programmable data plane, the present invention proposes a SYN Flood attack detection and mitigation method based on GCBF. The SYN Flood attack detection and mitigation method is deployed on the programmable data plane, processes each data packet entering the switch, and records and tracks the characteristics of each flow. While ensuring high-precision detection and effective mitigation of SYN Flood attacks, the method reduces the occupation of programmable switch space resources and reduces the misjudgment of benign users due to network congestion when flooding attacks occur.

[0008] The technical solution adopted by the present invention to achieve the above-mentioned objectives is as follows: the SYN Flood attack detection and mitigation method mainly includes four steps: switch proxy, flow tracking and abnormal flow detection, abnormal flow reporting, and filtering and mitigation.

[0009] 1. Switch proxy. Implement SYN Cookie proxy based on P4 programmable switch to verify the TCP connection request sent by the client. For the verified client, the switch proxy initiates a three-way handshake to the server again and performs sequence number conversion in subsequent data packet forwarding.

[0010] 2. Flow tracking and abnormal flow detection. Use GCBF to track all TCP connection states in step 1, and the counter in the Bloom filter records the number of SYN request packets in a fixed time window for each flow. When the user completes the three-way handshake to establish a TCP connection, use the sketch to track the TCP connection information, record the number of data transmission packets and SYN request packets for each flow, calculate the expected thresholds of the number of SYN request data packets and data transmission packets at each fixed time, and determine whether it is a SYN Flood attacker or a SYN Flood variant attacker based on the threshold.

[0011] 3. Report abnormal flows. The flow identifiers of SYN Flood attackers and variant attackers detected during flow tracking are reported to the controller through Digest, added to the TTL blacklist, and the initial lifetime TTL is set. The controller periodically decrements it and removes it from the TTL blacklist when the TTL is reduced to zero.

[0012] 4. Filtering mitigation. When a data packet enters the switch, it is filtered using the constructed TTL blacklist and general blacklist. If it hits the TTL blacklist times or its TTL exceeds the threshold, it is added to the general blacklist. For data packets that hit any blacklist, the packets are directly dropped to filter out attack packets. Beneficial Effects

[0013] The SYN Flood attack detection and mitigation method belongs to a non-machine learning method that uses the data structure on the switch for detection and mitigation. Aiming at the shortcomings of the existing SYN Flood detection and mitigation scheme that the Bloom filter cannot be deleted and the updateable Bloom filter occupies more space resources, it is improved to a generational rotation, overwriting and deleting the GCBF of the old elements, so that the Bloom filter can be updated, reducing the false alarm rate of the Bloom filter, reducing the misjudgment of benign users caused by network congestion caused by flooding attacks, and reducing the use of programmable switch space resources due to update. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 The traditional SYN Flood attack model and the SYN Flood variant attack model are demonstrated. In the experiment, this method adjusts the attack model by changing the packet rate and frequency, simulates the attack effects of different attackers, and observes the effects of detection and mitigation schemes on attackers with different parameters.

[0015] Figure 2 A schematic diagram of managing TTL blacklists and general blacklists is constructed for programmable switches to interact with controllers.

[0016] Figure 3 Schematic diagram of traditional Bloom filter collision and improved GCBF generation rotation.

[0017] Figure 4 The figure is a flow chart of the SYN Flood attack detection and mitigation method based on GCBF. DETAILED DESCRIPTION

[0018] The present invention is further described below in conjunction with the accompanying drawings.

[0019] like Figure 4 As shown, the SYN Flood attack detection and mitigation method mainly includes four steps: switch agent, flow tracking and anomaly detection, reporting abnormal flow, and filtering mitigation.

[0020] 1. Switch agent. Based on the P4 programmable switch, the SYN Cookie verification mechanism is deployed on the switch as a SYN agent to verify the TCP connection request. When the data packet enters the switch entrance, it is determined whether it is a SYN request packet based on whether the SYN flag is 1. For the SYN request packet, the source IP, source port, destination IP, and destination port in the packet header are extracted, and then combined with the time counter tim to prevent replay attacks. e The maximum segment length mss_ecoding used to unify the sending and receiving data packets is concatenated into a 32-bit Cookie after hashing, and placed in the SYN-ACK packet sent back by the switch agent as the sequence number. When receiving the corresponding ACK confirmation packet, the switch agent checks and verifies the Cookie. e For the effectiveness of SYN Cooki e For authenticated users, the switch agent initiates a TCP connection request to the server to complete a three-way handshake. At this point, the TCP connection from the client to the server is officially established.

[0021] Since the sequence numbers of the switch agent and the client and server are different during the three-way handshake, the switch as a proxy needs to handle this difference so that the data packet can be forwarded normally and transparently between the client and the server. e Once correct, the difference in the sequence numbers of each stream is recorded so that corresponding sequence number conversion can be performed in subsequent data packet requests and responses.

[0022] 2. Flow tracking and anomaly detection. For flows that send TCP connection requests, GCBF is used to record the status and information of each TCP connection. The counter in GCBF counts the SYN request packets of each flow. If the number of SYN request packets exceeds the threshold, it is identified as a SYN Flood attacker. GCBF consists of several CBFs. Only one CBF can be written at the same time. As the time window changes, different CBFs are rotated to write. When a data packet enters the switch entrance, three values ​​are used to determine whether the data packet belongs to the current time window and update the time window: end_window_time is used to record the end time of the current time window. The ingress_global_timestamp in the standard metadata gives the timestamp of the current data packet entering the switch. WINDOW TIME is a constant that saves the length of the time window. When ingress_global_timestamp is less than end_window_time, the data packet belongs to the current time window, and the connection information to be recorded is written to the current CBF. Otherwise, end_window_time is updated. The calculation method for updating end_window_time is as follows: end_window_time=ingress_global_timestamp+WINDOW_TIME

[0023] When the time window changes, the corresponding CBF also needs to be rotated, and the number of the currently used CBF current_filter_index needs to be updated. The calculation method for updating current_filter_index is as follows: current_filter_index=(current_filter_index+1) / n Where n is the number of CBFs in the GCBF.

[0024] For flows verified by SYN Cookie, a sketch is used to track the connection information, record the number of data transmission packets and SYN request packets for each flow, and use the exponentially weighted moving average method to calculate the expected threshold of data transmission packets ewma_http at fixed intervals. t , SYN request packet expected threshold ewma_syn t And the difference between the two ewma_diff t If the number of data packets detected or the difference between the two is lower than the calculated expected threshold, it is identified as a SYN Flood variant attacker. The expected threshold and its difference are calculated as follows: ewma_http t=βewma_http t-1 +(1-β)http t , β∈(0,1) ewma_syn t =βewma_syn t-1 +(1-β)syn t , β∈(0,1) ewma_diff t =ewma_http t -ewma_syn t Among them, β represents the weight coefficient for historical measurement values, and β is set to 0.7. t-1 is the expected threshold of data transmission packets calculated last time, ewma_syn t-1 is the expected threshold of the SYN request packet calculated last time, http t and syn t They are respectively the means of the number of data transmission packets and the number of SYN request packets of each flow from the calculation of the last expected threshold to this calculation, and the estimated values ​​are obtained by using the shift method.

[0025] 3. Report abnormal flows. The flow identification tuple <source IP, source port> of the SYN Flood attack flow and variant attack flow detected by GCBF and sketch records is reported to the controller through Digest. The controller sends new entries to the TTL blacklist and assigns an initial TTL value. All TTL blacklist entries and corresponding TTL values ​​are stored in the controller in the form of a dictionary and are periodically decremented by the controller background. When it decrements to zero, it indicates that it may be a benign user misjudged by the network status, and an instruction is issued to delete it from the TTL blacklist.

[0026] 4. Filtering and mitigation. The gradually constructed TTL blacklist and general blacklist are used to filter attack packets at the switch entrance to mitigate SYN Flood. When a packet enters the switch, it is first filtered according to the general blacklist. If it hits, the packet is directly dropped; if it does not hit, it is filtered again using the TTL blacklist. If it hits, it is also filtered and dropped. At the same time, because it is already in the TTL blacklist and is detected as an attacker again, its TTL value is increased through the digest report controller, and the number of times it hits the TTL blacklist is increased accordingly. If the TTL value or the number of times it hits the TTL blacklist exceeds the threshold, it will be deleted from the TTL blacklist and added to the general blacklist, so as to build a dynamic TTL blacklist and general blacklist.

[0027] Figure 1The traditional SYN Flood attack model and the SYN Flood variant attack model are shown in Figure 1. As shown in Figure 2, the traditional SYN Flood sends a large number of SYN request packets through a botnet or a fake IP, but does not respond to the server's SYN-ACK reply. At this time, the server has allocated resources for it and added it to the half-open queue. When the SYN Flood attack is launched, the server's resources are quickly exhausted, resulting in the inability to respond to normal user requests. As shown in Figure 2, this method takes into account a SYN Flood variant attack that cracks the SYN Cookie verification mechanism. After successfully establishing a TCP connection, this attack does not transmit useful data, but instead splits the HTTP data packet into very small data packets and sends them to the server at an extremely slow rate, so that the TCP connection remains active for a long time without disconnecting. If the server reaches the upper limit of the number of concurrent connections, and the maliciously occupied connection is not released, the server will not be able to accept new requests, resulting in a denial of service. Therefore, in this method, the traditional SYN Flood attack is detected by a judgment method that the SYN request packet exceeds the threshold, and the SYN Flood variant attack is detected by a judgment method that the number of data transmission packets within a certain period of time is lower than the threshold.

[0028] Figure 2 A schematic diagram of managing TTL blacklists and general blacklists for programmable switches and controllers to interact. The switch and controller interact to dynamically manage the TTL blacklist, and the controller background performs the task of periodically decreasing TTL. If the number of hits or the TTL value in the dynamic TTL blacklist exceeds the threshold, it is considered to be an attacker rather than a misjudged benign user and is added to the general blacklist.

[0029] Figure 3 This is a schematic diagram of the collision of the traditional Bloom filter and the improved GCBF generational rotation diagram. As shown in Figure a, the Bloom filter cannot delete elements and multiple elements are mapped to the same position to cause collisions. As the number of elements increases, its false alarm rate increases rapidly, so the GCBF is improved and designed. As shown in Figure b, assuming that the length of a time window is 0.5s and the element expiration time is 1s, the data in the first time window is recorded in BF1 within 0 to 0.5s. At 1.5s, the elements in BF1 have expired, so the data in the next time window, that is, time window 4, is written into BF1 to delete the old elements in an overwriting manner to avoid the accumulation of old elements and the gradual increase of the false alarm rate.

Claims

1. A SYN Flood attack detection and mitigation method based on GCBF, characterized in that: GCBF is Generational Counting Bloom Filter, and SYN Flood is Synchronous Flood. This method is deployed on a P4 programmable switch. The attack detection and mitigation method includes the following four steps: Step 1, switch agent: P4 programmable switch acts as a SYN agent, deploys SYN Cookie verification mechanism to verify the TCP connection request sent by the client, and performs three-way handshake with the client. For the client that passes the verification, the switch agent initiates a three-way handshake to the server again, and performs sequence number conversion in subsequent data packet forwarding; Step 2, flow tracking and abnormal flow detection: Use GCBF to track all TCP connection states in step 1. The counter in the Bloom filter records the number of SYN request packets in the fixed time window of each flow. The expected threshold of SYN request packets is calculated every fixed time. If it exceeds the threshold, it is determined to be a SYN Flood attacker. Use a sketch to record the number of SYN request packets and subsequent data transmission packets of the user verified by SYN Cookie. The expected threshold of the number of data transmission packets, the number of SYN request packets and the difference between the two are calculated every fixed time. If the number of data transmission packets and the difference between the two are less than the threshold, it is determined to be a SYNFlood attack variant. Step 3, reporting abnormal flows: For the SYN Flood attacker and variant attacker detected in step 2, report their flow identification tuple <source IP, source port> to the controller. If it does not hit the blacklist, add it to the TTL blacklist, that is, the blacklist with a lifetime, and set the initial lifetime TTL, which is periodically decremented by the controller. When the TTL is reduced to zero, it is removed from the TTL blacklist; Step 4, filtering and mitigation: When a data packet enters the switch, it is filtered using the TTL blacklist and general blacklist constructed in step 3. If it hits the TTL blacklist, its TTL in the blacklist is increased. If it hits the TTL blacklist several times or its TTL exceeds the threshold, it is added to the general blacklist. If it hits the general blacklist, it is directly dropped to filter the attack data packet.

2. The SYN Flood attack detection and mitigation method according to claim 1, characterized in that: The 32-bit Cookie in step 1 consists of three fields: the first 5 bits of time are the time counter, which is placed in the Cookie to prevent replay attacks. The next 3 bits of mss_encoding are the maximum segment length, which is unified with the client to facilitate the exchange of data packets. The last 24 bits of hash_value are the hashed values ​​of the source IP, source port, destination IP, destination port and time counter. The three fields are concatenated into a Cookie as the sequence number of the SYN-ACK packet sent by the switch agent.

3. The SYN Flood attack detection and mitigation method according to claim 1, characterized in that: In step 2, the GCBF is composed of several CBFs, i.e., counting Bloom filters. The connection information in the same time window is recorded in the same CBF. As the time window changes, the CBF is rotated and used, and the old elements are deleted by overwriting. When the data packet enters the switch, it is determined whether the data packet belongs to the current time window and the time window is updated according to three values: end_window_time is used to record the end time of the current time window, ingress_global_timestamp in the standard metadata gives the timestamp of the current data packet entering the switch, WINDOW_TIME is a constant that saves the length of the time window. When ingress_global_timestamp is less than end_window_time, the data packet belongs to the current time window. Otherwise, end_window_time is updated, and the number of the currently used CBF, current_filter_index, is updated accordingly. The calculation method for updating end_window_time and current_filter_index is as follows: end_window_time=ingress_globa;_timestamp+WINDOW_TIME current_filter_index=(current_filter_index+1) / n Where n is the number of CBFs in the GCBF.

4. The SYN Flood attack detection and mitigation method according to claim 1, characterized in that: The time window length in step 2 is set to the average time required for the three-way handshake, and the connection information of the three-way handshake process is recorded in the same CBF as much as possible. The expiration time of the element in the CBF is set to the average active time of a TCP connection, and the expected threshold of data transmission packets is calculated using the exponentially weighted moving average method based on this interval. t , SYN request packet expected threshold ewma_syn t And the difference between the two ewma_diff t , which is calculated as follows: ewma_http t =β×ewma_http t-1 +(1-β)×http t ,β∈(0,1) ewma_syn t =β×ewma_syn t-1 +(1-β)×syn t , β∈(0,1) euma_diff t =euma_http t -ewma_syn t Among them, β represents the weight coefficient for historical measurement values, and β is set to 0.

7. t-1 is the expected threshold of data transmission packets calculated last time, ewma_syn t-1 is the expected threshold of the SYN request packet calculated last time, http t and syn t They are respectively the means of the number of data transmission packets and the number of SYN request packets of each flow from the calculation of the last expected threshold to this calculation, and the estimated values ​​are obtained by using the shift method.

5. The SYN Flood attack detection and mitigation method according to claim 1, characterized in that: In step 3, after the switch reports the abnormal flow identifier to the controller, the controller assigns an initial TTL to it, and while sending the table item to the TTL blacklist, the controller saves the TTL corresponding to the blacklist table item based on the dictionary in the controller, and decrements the TTL value of all table items in the controller background periodically. When the TTL is decremented to 0, the blacklist table item and the corresponding dictionary item are deleted.

Citation Information

Cited By

  • DDoS attack abnormal traffic checking method for network security service

    CN119996086A

  • Method for Detecting Abnormal Traffic of DDoS Attacks for Network Security Services

    CN119996086B