A flood attack and defense drill method and device based on programmable switch
By utilizing the high flexibility and fast packet processing capabilities of programmable switches, a flood attack program was designed based on the flood attack method. This solved the problem of slow speed in existing flood attacks and enabled efficient network security attack drills with a throughput of Tbps.
Patent Information
- Application Number
- CN202211641066.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-20
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2042-12-20
AI Technical Summary
Existing methods for generating flood attacks are slow, inefficient, and require controlling a large number of hosts, which is time-consuming and labor-intensive.
A flooding attack method based on programmable switches is adopted. Taking advantage of the high flexibility and fast packet processing capability of programmable switches, a flooding attack program is designed and a high-efficiency flooding attack is achieved through the pipeline of programmable switches.
It significantly improves the speed of sending abnormal traffic during flood attacks, enabling low-cost, high-difficulty network security attack drills with a throughput of up to Tbps.
Smart Images

Figure CN116112376B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a method and device for conducting flood attack and defense drills based on a programmable switch. Background Art
[0002] Nowadays, network attacks are gradually increasing, and network security faces severe challenges. Flooding attacks, as an important means of network attacks, can quickly occupy various network resources of the attacked party, thereby preventing normal users from accessing the attacked party's network. This type of attack method is simple and effective, and is widely used by attackers.
[0003] Researchers have developed various means of defending against flood attacks and applied them to various systems. In order to test the effectiveness of such systems, various organizations often organize attack drills to test the defense effect. Attack drills are network security exercises used to evaluate the network defense systems of various institutions. In specific practice, the organizer will organize the attackers and defenders, and the attackers will launch network attacks on the defenders to detect the defense capabilities of the defenders. Flood attacks are widely used as an important means of attack.
[0004] The existing flood attack generation methods are mostly to write software scripts to generate abnormal traffic, and then send the abnormal traffic to the network through the host network card to launch the attack. The disadvantage of this method is that the speed of software generating abnormal traffic is slow (mostly gigabit or 10 Gigabit), and the attack efficiency is not high. The attacker often needs to control a large number of hosts at the same time to operate, which is time-consuming and laborious. Summary of the invention
[0005] The present invention aims to solve one of the technical problems in the related art at least to a certain extent.
[0006] To this end, the present invention proposes a flood attack defense drill method based on a programmable switch. The programmable switch uses a programmable switch chip customized by an Ethernet switch chip hardware manufacturer. While achieving highly flexible programmability, it also retains the characteristics of fast data packet processing of traditional switches. Its delay is generally in nanoseconds, and its throughput can reach Tbps. Its throughput is more than a thousand times that of the host's traditional network card. The use of a programmable switch can greatly increase the sending speed of abnormal traffic in flood attacks, and realize low-cost and high-difficulty network security attack drills. Based on the programmable switch, a method for generating abnormal traffic that can be used for flood attacks is designed.
[0007] Another object of the present invention is to provide a flood attack and defense drill device based on a programmable switch.
[0008] To achieve the above-mentioned object, the present invention proposes, on one hand, a flood attack and defense drill method based on a programmable switch, comprising:
[0009] Establish data connection between source host and target host;
[0010] After the data connection is established, the flood attack based on the data packet between the source host and the target host is analyzed to obtain the analysis result of the flood attack type;
[0011] Obtaining the processing capacity values of all pipelines of the programmable switch, and performing a single-pipeline flood attack program design based on the programmable switch based on the processing capacity values and the flood attack type analysis results to obtain a seed data packet used by the programmable switch for flood attack;
[0012] Based on the seed data packet used for flooding attack and the processing capacity value of all pipelines of the programmable switch, the type of the seed data packet at each pipeline inlet port is controlled, and the type of flooding attack of each pipeline of the programmable switch is controlled according to the result of the seed data packet type control.
[0013] In addition, the flood attack defense drill method based on a programmable switch according to the above embodiment of the present invention may also have the following additional technical features:
[0014] Further, in one embodiment of the present invention, the analyzing the flooding attack based on the data packet between the source host and the target host after the data connection is established to obtain the flooding attack type analysis result includes:
[0015] When the source host and the target host establish a TCP connection, the source host sends a SYN packet to the target host; after receiving the SYN packet, the target host feeds back a SYN ACK packet to the source host;
[0016] When the source host does not feed back an ACK packet to the target host and repeats this action, the source host sends a TCP SYN flood attack; when the source host checks its own TCP connection table to see if there is a connection with the sender of the ACK packet, if so, it sends ACK data to complete the TCP connection, if not, it sends an ACK RST packet to disconnect the connection; the source host forges a large number of SYN ACK packets and sends them to the target host, that is, the source host sends an ACK flood attack; and,
[0017] UDP flooding attack based on UDP User Datagram Protocol packets between the source host and the target host.
[0018] Further, in one embodiment of the present invention, the single-pipeline flood attack program design based on the programmable switch based on the processing capacity value and the flood attack type analysis result obtains the seed data packet used by the programmable switch for flood attack, including:
[0019] Designing different flooding attack programs for the programmable switch based on the processing capacity values of all pipelines of the programmable switch;
[0020] Generate different seed data packages using a preset network language database;
[0021] Sending the different seed data packets to the ingress port of the programmable switch, using the different seed data packets using different flooding attack programs, and after the programmable switch receives the different seed data packets, modifying the sending address of the current seed data packet by a preset cyclic shift function;
[0022] After modifying the sending address, the forwarding process is entered to implement cyclic sending of seed data packets for flooding attacks at the maximum rate through a preset forwarding method.
[0023] Further, in one embodiment of the present invention, the different seed packets include TCP SYN, TCPSYN ACK and UDP seed packets; the different seed packets are used by different flooding attack programs, including:
[0024] Using a first flood attack program to process the TCP SYN flood attack, and using a TCP SYN seed data packet;
[0025] Utilizing a second flood attack program to process the ACK flood attack, and using a SYN ACK seed data packet; and,
[0026] The UDP flood attack is processed correspondingly using a third flood attack program, and a UDP seed data packet is used.
[0027] Furthermore, in one embodiment of the present invention, the forwarding method includes:
[0028] Monitor whether the control plane of the flood attack program conveys a stop attack signal. If so, stop the subsequent process; otherwise, continue the subsequent process;
[0029] When the seed data packet is forwarded, the current seed data packet is cloned to the ingress of the current pipeline of the programmable switch, so that the seed data packet is looped back, and then the current seed data packet is sent to the network.
[0030] To achieve the above object, the present invention, on the other hand, proposes a flood attack and defense drill device based on a programmable switch, comprising:
[0031] A data connection establishment module is used to establish a data connection between a source host and a target host;
[0032] An attack type analysis module is used to analyze the flooding attack based on data packets between the source host and the target host after the data connection is established, and obtain the flooding attack type analysis result;
[0033] A pipeline programming module, used to obtain the processing capacity values of all pipelines of the programmable switch, and perform single-pipeline flood attack programming based on the programmable switch based on the processing capacity values and the flood attack type analysis results to obtain a seed data packet used by the programmable switch for flood attack;
[0034] An attack type control module is used to control the type of the seed data packet at each pipeline inlet port based on the seed data packet used for flooding attack and the processing capacity value of all pipelines of the programmable switch, and control the flooding attack type of each pipeline of the programmable switch according to the type control result of the seed data packet.
[0035] The flood attack defense drill method and device based on a programmable switch in the embodiment of the present invention can greatly improve the sending speed of abnormal traffic of flood attacks and realize low-cost and high-difficulty network security attack drills.
[0036] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0038] Figure 1 is a flow chart of a flood attack defense drill method based on a programmable switch according to an embodiment of the present invention;
[0039] Figure 2 is a flow chart of establishing a TCP protocol connection according to an embodiment of the present invention;
[0040] Figure 3 is a schematic diagram of a TCP SYN flood attack program according to an embodiment of the present invention;
[0041] Figure 4 is a schematic diagram of an ACK flood attack procedure according to an embodiment of the present invention;
[0042] Figure 5 is a schematic diagram of a UDP flood attack program according to an embodiment of the present invention;
[0043] Figure 6 is a schematic diagram of a flood attack generation mode of a single pipeline according to an embodiment of the present invention;
[0044] Figure 7 is a schematic diagram of multiple pipelines in a programmable switch according to an embodiment of the present invention;
[0045] Figure 8 It is a structural diagram of a flood attack defense drill device based on a programmable switch according to an embodiment of the present invention. DETAILED DESCRIPTION
[0046] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0047] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only 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 should fall within the scope of protection of the present invention.
[0048] The following describes a method and device for flood attack defense drill based on a programmable switch according to an embodiment of the present invention with reference to the accompanying drawings.
[0049] Figure 1 It is a flow chart of a flood attack defense drill method based on a programmable switch according to an embodiment of the present invention.
[0050] like Figure 1 As shown, the method includes but is not limited to the following steps:
[0051] S1, establish data connection between source host and target host;
[0052] S2, after the data connection is established, analyzing the flooding attack based on the data packet between the source host and the target host, and obtaining the analysis result of the flooding attack type;
[0053] S3, obtaining the processing capacity values of all pipelines of the programmable switch, and designing a single pipeline flooding attack program based on the programmable switch based on the processing capacity values and the flooding attack type analysis results to obtain a seed data packet used by the programmable switch for flooding attack;
[0054] S4, based on the seed data packet used for flooding attack and the processing capacity value of all pipelines of the programmable switch, the type of seed data packet at the inlet port of each pipeline is controlled, and the type of flooding attack of each pipeline of the programmable switch is controlled according to the result of the type control of the seed data packet.
[0055] Specifically, a flow chart of a method for conducting a flood attack and defense drill based on a programmable switch according to an embodiment of the present invention is provided below in conjunction with the accompanying drawings.
[0056] It can be understood that P4 (Programming Protocol-independent Packet Processors) language: This language is a programming language applied to the data plane of programmable switches. P4 language allows users to program the data packet parsing process so that the data plane of the network device processes the data packet in a specified manner. It encapsulates a series of data structures, algorithms and callable APIs for users to call according to their own needs.
[0057] Programmable switch: It uses a programmable switch chip customized by an Ethernet switch chip hardware manufacturer. While achieving highly flexible programmability, it also retains the fast data packet processing characteristics of traditional switches. Its latency is generally in nanoseconds, and its throughput can reach Tbps.
[0058] Flooding attack is an attack method that sends a large number of false requests to the target system in a short period of time, causing the target system to be overwhelmed with useless information and unable to provide normal services to legitimate users.
[0059] The method of the embodiment of the present invention can be used by an administrator to configure relevant parameters to conduct large-scale simulated attack drills.
[0060] Flood attacks send a large number of false messages to the attacked party in a short period of time. This type of attack blocks the data transmission of other benign connections by occupying the other party's network bandwidth or deceiving the attacked party to establish a large number of invalid connections to fill up the host network cache, thereby blocking the network communication of the attacked party.
[0061] First, we analyze the commonly used flood attacks, including TCP SYN flood attack, ACK flood attack, and UDP flood attack. The following are the explanations:
[0062] In one embodiment of the present invention, the attack mode is analyzed by taking the TCP connection establishment process as an example. The TCP protocol is a transmission control protocol with a connection. Figure 2 As shown in the figure, ① when the connection is established, host A sends a SYN message to host B, requesting to establish a connection. ② After receiving it, host B opens up space for the connection establishment and feeds back a SYN ACK message to host A, indicating that it has the ability to receive and process data. ③ Finally, host A feeds back an ACK to B, indicating that it also has the ability to receive and process data. At this point, the connection is successfully established.
[0063] (1) TCP SYN flood attack. Figure 2In the TCP connection establishment process, once host A tricks host B into establishing a connection but does not proceed to step ③, it will occupy some resources of host B. When different hosts in the network perform the above actions on host B, that is, the attacker sends a TCP SYN flood attack, it will consume the network bandwidth resources of the attacked host and cause the TCP cache resources of the attacked host to be quickly consumed.
[0064] (2) ACK flood attack. Figure 1 In the TCP connection establishment process, once host B executes step ② to host A and sends a SYN ACK packet, host A will check its own TCP connection table to see if there is a connection with the sender of the ACK. If host A finds that there is a connection, it will send an ACK packet to complete the TCP connection. If not, it will send an ACK RST to disconnect the connection. An attacker can forge a large number of SYN ACK packets and send them to the target host, which can consume the target host's network bandwidth and CPU resources and block the establishment of other benign connections. It may even cause the target host's CPU resources to be over-consumed and cause a crash.
[0065] (3) UDP flood attack. UDP (User Datagram Protocol) is a connectionless and stateless network protocol. Unlike the TCP protocol, UDP does not require a three-way handshake to establish a connection before transmitting information. Instead, it can send information directly. This makes UDP flood attacks easy to create and highly efficient. UDP flood attacks can be further divided into large and small data packet attacks. Large data packet attacks (packet loads greater than the Ethernet MTU, i.e. greater than 1500B) will cause the target device to need to fragment and reassemble the data packets; while dense small data packets will cause the target device to generate heavy data packet parsing pressure. The goal of UDP flood attacks is mainly to occupy the network bandwidth and CPU resources of the attacked party, thereby blocking other benign network transmission services.
[0066] Furthermore, the programmable switch of the embodiment of the present invention is programmed using the P4 language. By writing the P4 language, the control of the programmable switching chip hardware can be achieved to realize the corresponding functions. The programmable switch generally contains dozens of pipelines. The throughput of each pipeline is about hundreds of Gbps, and the total processing capacity of all pipelines is about several Tbps. Through the P4 language, different pipelines can be flexibly used to perform different flooding attacks, thereby combining rich attack traffic. Different pipelines can send different types of attacks. By adjusting the "seed data packet" at the entrance of each pipeline, a mixed attack of multiple flooding attacks can be realized. The flood attack program design of a single pipeline is as follows: Figure 3 , Figure 4 , Figure 5, corresponding to TCP SYN, ACK, and UDP flood attacks respectively. Specific process of the program:
[0067] 1) First, according to Figure 3 , Figure 4 , Figure 5 Design and implement a flood attack program for programmable switches.
[0068] 2) Generate three types of seed packets. Seed packets can be directly generated using tools such as the SCAPY library in Python. The parameters used during generation are set according to the type of seed packets. The destination IP is the host to be attacked; the source IP can be set manually as needed. The packet type can be set to TCP SYN, TCP SYN ACK, and UDP packets respectively. Other default parameters can be used.
[0069] 3) The administrator sends a “seed packet” to the ingress port of the programmable switch that is already running the matching algorithm. Figure 3 The program responds to TCP SYN flood attacks, using TCP SYN seed packets; Figure 4 The program responds to ACK flood attacks, using SYN ACK seed packets; Figure 5 The program responds to UDP flood attacks, using UDP seed packets.
[0070] 4) After receiving the data packet, the programmable switch will modify the sending address of the current data packet through the source IP circular shift function. In this way, the attacked host can be confused and the purpose of the attacker can be hidden. The attacked party can be deceived to allocate resources such as cache for the network connection.
[0071] 5) After modifying the address, enter the forwarding process. First check whether the control plane conveys the "stop attack" signal. This signal can be identified by general parameters. If yes, stop the subsequent process, otherwise continue the subsequent process. When forwarding, first clone a copy of the current data packet to the ingress of the current pipeline to achieve data packet loopback, and then send the current data packet to the network. In this way, it is possible to send data packets used for flooding attacks cyclically at the maximum rate.
[0072] Furthermore, if Figure 6As shown. Based on this mechanism, during initialization, a "seed" data packet is placed in the inlet port of each pipeline. The data packet can be one of the TCP SYN flood attack, ACK flood attack, and UDP flood attack. After the data packet is processed by the pipeline, at the end, a copy of the data packet is copied to the parser through the clone function in the P4 language, and the data packet is sent through port 1. In this way, after the pipeline receives a seed data packet, it can continuously send attack traffic from the outlet port to the target host.
[0073] By setting the "seed data packets" of all pipelines, administrators can freely combine the three flood attack modes to achieve rich attack rehearsal effects.
[0074] Furthermore, there are multiple pipelines in the programmable switch. Figure 7 Taking three pipelines as an example, the internal structure of the programmable switch is shown. By controlling the seed data packets of each ingress port, the type of flooding attack of each pipeline can be controlled, thereby achieving a single or mixed high-intensity flooding attack. In summary, the present invention uses a programmable switch to achieve a single or mixed flooding attack at the Tbps level.
[0075] According to the flood attack and defense drill method based on a programmable switch according to the embodiment of the present invention, a single or mixed flood attack of the Tbps level is realized under the premise of using only one programmable switch. Compared with the existing Gbps-level software script method (1Tbps==1000Gbps), the present invention can greatly improve the sending speed of abnormal traffic of flood attacks and realize low-cost and high-difficulty network security attack drills.
[0076] In order to implement the above embodiment, Figure 8 As shown, this embodiment also provides a flood attack defense drill device 10 based on a programmable switch. The device 10 includes a data connection establishment module 100, an attack type analysis module 200, a pipeline programming module 300 and an attack type control module 400.
[0077] The data connection establishment module 100 is used to establish a data connection between the source host and the target host;
[0078] The attack type analysis module 200 is used to analyze the flooding attack based on the data packet between the source host and the target host after the data connection is established, and obtain the flooding attack type analysis result;
[0079] The pipeline programming module 300 is used to obtain the processing capacity values of all pipelines of the programmable switch, and perform single-pipeline flood attack programming based on the programmable switch based on the processing capacity values and the flood attack type analysis results to obtain the seed data packet used by the programmable switch for flood attack;
[0080] The attack type control module 400 is used to control the type of the seed data packet at the inlet port of each pipeline based on the seed data packet used for flooding attack and the processing capacity value of all pipelines of the programmable switch, and control the flooding attack type of each pipeline of the programmable switch according to the type control result of the seed data packet.
[0081] Furthermore, the attack type analysis module 200 is also used for:
[0082] When the source host and the target host establish a TCP connection, the source host sends a SYN packet to the target host. After receiving the SYN packet, the target host sends a SYN ACK packet back to the source host.
[0083] When the source host does not send back an ACK packet to the target host and repeats this action, the source host sends a TCPSYN flood attack; when the source host checks its own TCP connection table to see if there is a connection with the sender of the ACK packet, if so, it sends ACK data to complete the TCP connection, if not, it sends an ACK RST packet to disconnect the connection; the source host forges a large number of SYN ACK packets and sends them to the target host, that is, the source host sends an ACK flood attack; and,
[0084] UDP flooding attack based on UDP User Datagram Protocol packets between the source host and the target host.
[0085] Furthermore, the pipeline programming module 300 includes:
[0086] A flood attack program design subunit, used for designing different flood attack programs for the programmable switch based on the processing capacity values of all pipelines of the programmable switch;
[0087] A seed data packet generating subunit is used to generate different seed data packets using a preset network language database;
[0088] A seed data packet address modification subunit, used to send different seed data packets to the programmable switch inlet port, use the different seed data packets using different flood attack programs, and after the programmable switch receives the different seed data packets, modify the sending address of the current seed data packet through a preset cyclic shift function;
[0089] The seed data packet forwarding subunit is used to enter the forwarding process after modifying the sending address, and to use a preset forwarding method to cyclically send the seed data packet used for flooding attack at the maximum rate.
[0090] Furthermore, different seed data packets include TCP SYN, TCP SYN ACK and UDP seed data packets; the seed data packet address modification subunit is also used to:
[0091] Using a first flood attack program to process the TCP SYN flood attack, and using a TCP SYN seed data packet;
[0092] Utilizing a second flood attack program to process the ACK flood attack, and using a SYN ACK seed data packet; and,
[0093] The UDP flood attack is processed correspondingly using a third flood attack program, and a UDP seed data packet is used.
[0094] Furthermore, the seed data packet forwarding subunit is also used for:
[0095] Monitor whether the control plane of the flood attack program conveys a stop attack signal. If so, stop the subsequent process; otherwise, continue the subsequent process;
[0096] When the seed data packet is forwarded, the current seed data packet is cloned to the ingress of the current pipeline of the programmable switch, so that the seed data packet is looped back, and then the current seed data packet is sent to the network.
[0097] According to the flood attack defense drill device based on a programmable switch according to the embodiment of the present invention, a single or mixed flood attack of the Tbps level is realized under the premise of using only one programmable switch. Compared with the existing Gbps-level software script method (1Tbps==1000Gbps), the present invention can greatly improve the sending speed of abnormal traffic of flood attacks and realize low-cost and high-difficulty network security attack drills.
[0098] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0099] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
Claims
1. A flood attack and defense drill method based on a programmable switch, characterized in that: The following steps are involved: Establish data connection between source host and target host; After the data connection is established, the flood attack based on the data packet between the source host and the target host is analyzed to obtain the analysis result of the flood attack type; Obtaining the processing capacity values of all pipelines of the programmable switch, and performing a single-pipeline flood attack program design based on the programmable switch based on the processing capacity values and the flood attack type analysis results to obtain a seed data packet used by the programmable switch for flood attack; Based on the seed data packet for flooding attack and the processing capacity values of all pipelines of the programmable switch, the type of the seed data packet at each pipeline inlet port is controlled, and the type of flooding attack of each pipeline of the programmable switch is controlled according to the type control result of the seed data packet; The single-pipeline flood attack program design based on the programmable switch based on the processing capacity value and the flood attack type analysis result is performed to obtain a seed data packet used by the programmable switch for flood attack, including: Designing different flooding attack programs for the programmable switch based on the processing capacity values of all pipelines of the programmable switch; Generate different seed data packages using a preset network language database; Sending the different seed data packets to the ingress port of the programmable switch, using the different seed data packets using different flooding attack programs, and after the programmable switch receives the different seed data packets, modifying the sending address of the current seed data packet by a preset cyclic shift function; After modifying the sending address, the forwarding process is entered to implement cyclic sending of seed data packets for flooding attacks at the maximum rate through a preset forwarding method.
2. The method according to claim 1, characterized in that After the data connection is established, the flood attack based on the data packet between the source host and the target host is analyzed to obtain the flood attack type analysis result, including: When the source host and the target host establish a TCP connection, the source host sends a SYN packet to the target host; after receiving the SYN packet, the target host feeds back a SYN ACK packet to the source host; When the source host does not feed back an ACK packet to the target host and repeats this action, the source host sends a TCPSYN flood attack; when the source host checks its own TCP connection table to see if there is a connection with the sender of the ACK packet, if so, it sends ACK data to complete the TCP connection, if not, it sends an ACK RST packet to disconnect the connection; the source host forges a large number of SYN ACK packets and sends them to the target host, that is, the source host sends an ACK flood attack; and, UDP flooding attack based on UDP User Datagram Protocol packets between the source host and the target host.
3. The method according to claim 1, characterized in that The different seed data packets include TCP SYN, TCPSYN ACK and UDP seed data packets; the different seed data packets are used by different flood attack programs, including: Using the first flood attack program to process the TCP SYN flood attack, and using the TCP SYN seed data packet; Utilize the second flood attack procedure to process the ACK flood attack, and use the SYN ACK seed data packet; and, The third flood attack program is used to process the UDP flood attack and use the UDP seed data packet.
4. The method according to claim 1, characterized in that: The forwarding method includes: Monitor whether the control plane of the flood attack program conveys a stop attack signal. If so, stop the subsequent process; otherwise, continue the subsequent process; When the seed data packet is forwarded, the current seed data packet is cloned to the ingress of the current pipeline of the programmable switch, so that the seed data packet is looped back, and then the current seed data packet is sent to the network.
5. A flood attack and defense drill device based on a programmable switch, characterized in that: include: A data connection establishment module is used to establish a data connection between a source host and a target host; An attack type analysis module is used to analyze the flooding attack based on data packets between the source host and the target host after the data connection is established, and obtain the flooding attack type analysis result; A pipeline programming module, used to obtain the processing capacity values of all pipelines of the programmable switch, and perform single-pipeline flood attack programming based on the programmable switch based on the processing capacity values and the flood attack type analysis results to obtain a seed data packet used by the programmable switch for flood attack; An attack type control module, configured to control the type of the seed data packet at each pipeline inlet port based on the seed data packet for flooding attack and the processing capacity value of all pipelines of the programmable switch, and control the flooding attack type of each pipeline of the programmable switch according to the type control result of the seed data packet; The pipeline programming module comprises: A flood attack program design subunit, used for designing different flood attack programs for the programmable switch based on the processing capacity values of all pipelines of the programmable switch; A seed data packet generating subunit is used to generate different seed data packets using a preset network language database; A seed data packet address modification subunit, used to send the different seed data packets to the programmable switch inlet port, use the different seed data packets using different flood attack programs, and after the programmable switch receives the different seed data packets, modify the sending address of the current seed data packet by a preset cyclic shift function; The seed data packet forwarding subunit is used to enter the forwarding process after modifying the sending address, and use a preset forwarding method to cyclically send the seed data packet used for flooding attack at the maximum rate.
6. The device according to claim 5, characterized in that The attack type analysis module is further used for: When the source host and the target host establish a TCP connection, the source host sends a SYN packet to the target host; after receiving the SYN packet, the target host feeds back a SYN ACK packet to the source host; When the source host does not feed back an ACK packet to the target host and repeats this action, the source host sends a TCPSYN flood attack; when the source host checks its own TCP connection table to see if there is a connection with the sender of the ACK packet, if so, it sends ACK data to complete the TCP connection, if not, it sends an ACK RST packet to disconnect the connection; the source host forges a large number of SYN ACK packets and sends them to the target host, that is, the source host sends an ACK flood attack; and, UDP flooding attack based on UDP User Datagram Protocol packets between the source host and the target host.
7. The device according to claim 5, characterized in that The different seed data packets include TCP SYN, TCPSYN ACK and UDP seed data packets; the seed data packet address modification subunit is also used for: Using the first flood attack program to process the TCP SYN flood attack, and using the TCP SYN seed data packet; Utilize the second flood attack procedure to process the ACK flood attack, and use the SYN ACK seed data packet; and, The third flood attack program is used to process the UDP flood attack and use the UDP seed data packet.
8. The device according to claim 5, characterized in that The seed data packet forwarding subunit is further used for: Monitor whether the control plane of the flood attack program conveys a stop attack signal. If so, stop the subsequent process; otherwise, continue the subsequent process; When the seed data packet is forwarded, the current seed data packet is cloned to the ingress of the current pipeline of the programmable switch, so that the seed data packet is looped back, and then the current seed data packet is sent to the network.
