WO2017035717A1 - 一种分布式拒绝服务DDoS攻击检测方法及相关设备 - Google Patents

一种分布式拒绝服务DDoS攻击检测方法及相关设备 Download PDF

Info

Publication number
WO2017035717A1
WO2017035717A1 PCT/CN2015/088458 CN2015088458W WO2017035717A1 WO 2017035717 A1 WO2017035717 A1 WO 2017035717A1 CN 2015088458 W CN2015088458 W CN 2015088458W WO 2017035717 A1 WO2017035717 A1 WO 2017035717A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
flow table
target device
switch
table matching
Prior art date
Application number
PCT/CN2015/088458
Other languages
English (en)
French (fr)
Inventor
徐通
郑涛
董平
孙嘉楠
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2015/088458 priority Critical patent/WO2017035717A1/zh
Priority to CN201580031751.2A priority patent/CN108028828B/zh
Publication of WO2017035717A1 publication Critical patent/WO2017035717A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a DDoS attack detection method and related equipment.
  • SDN Software Defined Network
  • DDoS Distributed Denial of Service
  • a method for detecting DDoS attacks by controllers in SDN by using entropy value change is disclosed.
  • the destination IP address of the data stream, the virtual local area network (VLAN) number, the destination port, or other fields generally exhibit strong randomness, and the entropy value is large.
  • the controller is subjected to a DDoS attack, the randomness of one or some fields of the data stream is reduced, and the entropy value is small, so that whether the controller is subjected to the DDoS attack can be determined according to the entropy value.
  • the entropy value is used to measure the expected value of a random variable.
  • the entropy-based DDoS attack detection method relies on the randomness difference between the normal data stream and the attack data stream, which makes the under-reporting attack occur when the attack data stream is highly random.
  • the randomness of the data stream is not strong, the normal data stream will be mistakenly used as the attack data stream.
  • the situation of false positives is now reported. That is to say, the current DDoS attack detection method needs to rely on the randomness of the normal data stream and the attack data stream for detection, and the accuracy is low.
  • the embodiment of the invention provides a DDoS attack detection method and related device, which can improve the accuracy of DDoS attack detection without relying on the randomness of the normal data stream and the attack data stream for detecting.
  • the embodiment of the present invention provides a DDoS attack detection method, which is applied to a software-defined network SDN, where the SDN includes a controller and at least one border switch, including:
  • the first request message is a border switch corresponding to the target device a request data stream sent to the controller that requires the controller to process;
  • the method further includes:
  • a target physical port Determining, by the at least one physical port of the border switch corresponding to the target device, a target physical port, where the target physical port is the first window in the at least one physical port, if it is determined that the target device is subjected to a DDoS attack.
  • Target data stream is a data flow between a switch and a switch in the SDN
  • the target device is a target edge in the at least one border switch
  • the first switch message in the first window of the preset, and the current request rate of the target device in the SDN for the first request message is calculated, including:
  • the target device is the controller; a first request message in the window, and calculating a current request rate of the target device in the SDN for the first request message, including:
  • the determining, by the current request rate, whether the target device is in an abnormal state includes:
  • the target device is in an abnormal state.
  • the querying the flow table matching information corresponding to the target device includes:
  • Determining, by the flow table matching information, whether the target device is subjected to a DDoS attack including:
  • the second threshold is not exceeded, it is determined that the target device is subjected to a DDoS attack.
  • the target device is a target boundary switch in the at least one border switch; Based on the table matching information, the current flow table matching efficiency corresponding to the target device is calculated, including:
  • the target device is the controller, and the border switch corresponding to the target device includes the SDN All the border switches are configured to calculate the current flow table matching efficiency corresponding to the target device according to the flow table matching information, including:
  • the flow table matching information includes a second-level persistent The time and the number of matching packets; the calculation of the matching efficiency of the flow table corresponding to the matching information of the flow table, including:
  • the quotient of the matching packet number and the second-level duration matches the efficiency.
  • the method further includes:
  • the second request message includes a cause information, a second-level duration, and a matching packet number; Calculating the historical flow table matching efficiency corresponding to the target device according to the second request message, including:
  • the cause information includes the idle timeout information
  • the quotient value of the matched packet number and the target difference value is used as a historical flow table matching efficiency corresponding to the target device, and the target difference value is the second-level duration and a difference in idle time corresponding to the idle timeout information;
  • the cause information includes the hard timeout information
  • the quotient of the matched packet number and the second-level duration is used as the historical flow table matching efficiency corresponding to the target device.
  • the target device is a target boundary switch in the at least one border switch;
  • the target physical port is determined by the at least one physical port of the border switch corresponding to the target device, including:
  • the target device is the controller, and the border switch corresponding to the target device
  • the target physical port is determined in at least one physical port, including:
  • the border network corresponding to the SDN is determined by the at least one border switch in the SDN;
  • the physical port with the highest data stream density corresponding to the first request message in the at least one physical port of the target switch is determined as the target physical port, based on the first request message corresponding to the target switch.
  • the marking the target data stream of the target physical port includes:
  • the target data stream of the target physical port is encapsulated by a general encapsulation technology.
  • the method further includes:
  • an embodiment of the present invention provides a DDoS attack detection apparatus, which is applied to a software-defined network SDN, where the SDN includes a controller and at least one border switch, including:
  • a calculation module configured to monitor a first request message in a preset first window, and calculate a current request rate of the target device in the SDN for the first request message, where the first request message is the target a request data stream sent by the border switch corresponding to the device to the controller that needs to be processed by the controller;
  • An abnormality determining module configured to determine, according to the current request rate, whether the target device is in an abnormal state
  • a query module configured to query flow table matching information corresponding to the target device when the judgment result of the abnormality determining module is that the target device is in an abnormal state
  • the attack determining module is configured to determine, according to the flow table matching information, whether the target device is subjected to a DDoS attack.
  • the device further includes:
  • a port determining module configured to determine a target physical port from the at least one physical port of the border switch corresponding to the target device, where the target physical port is the at least one physical port, when determining that the target device is subjected to a DDoS attack a physical port with a highest data stream density corresponding to the first request message in the first window;
  • a marking module configured to mark a target data stream transmitted by the target physical port, where the target data stream is a data flow between a switch and a switch in the SDN;
  • a redirection module configured to redirect the marked target data stream to a data filtering device bound to a border switch corresponding to the target device, so that the data filtering device pairs the marked target data The stream is processed.
  • the target device is a target border switch in the at least one border switch;
  • the calculation module includes:
  • a first listening unit configured to monitor a first request message sent by the target border switch in the preset first window
  • a first calculating unit configured to calculate a request rate of the first request message, and use the calculated request rate as a current request rate of the target border switch for the first request message.
  • the target device is the controller
  • a second intercepting unit configured to monitor a first request message sent by each border switch in the SDN in a preset first window
  • a second calculating unit configured to separately obtain a request rate of the first request message sent by each border switch in the first window
  • the second calculating unit is further configured to obtain, according to a request rate of each border switch, a current request rate of a boundary network determined by all border switches in the SDN in the first window, and the boundary network
  • the current request rate is the current request rate of the controller for the first request message.
  • the abnormality determining module includes:
  • a first determining unit configured to determine whether the current request rate is higher than a preset first threshold corresponding to the target device, where the first threshold is according to a first request in a preset second window The request rate of the message is determined;
  • the first determining unit is configured to determine that the target device is in an abnormal state when the determination result of the first determining unit is higher than the first threshold.
  • the query module includes:
  • An instruction sending unit configured to send a flow table information query instruction to a border switch corresponding to the target device when the target device is in an abnormal state
  • An information receiving unit configured to receive flow table matching information returned by the border switch corresponding to the target device in response to the flow table information query instruction;
  • the attack determination module includes:
  • An efficiency calculation unit configured to calculate, according to the flow table matching information, a current flow table matching efficiency corresponding to the target device
  • a second determining unit configured to determine whether the current flow table matching efficiency exceeds a preset second threshold corresponding to the target device, where the second threshold is a flow table according to a preset third window The matching of the flow table matching efficiency obtained by the statistical information is determined;
  • the second determining unit is configured to determine that the target device is subjected to a DDoS attack when the determination result of the second determining unit is that the current flow table matching efficiency does not exceed the second threshold.
  • the target device is a target boundary switch in the at least one border switch; Used for:
  • the target device is the controller, and the border switch corresponding to the target device includes All the border switches in the SDN; the efficiency calculation unit is specifically used to:
  • the device further includes:
  • An efficiency determining module configured to monitor a second request message of the border switch corresponding to the target device, and calculate, according to the second request message, a historical flow table matching efficiency corresponding to the target device, where the second request is The message is generated according to the flow table matching information in the preset third window;
  • the threshold determining module is configured to determine a second threshold corresponding to the target device according to a historical flow table matching efficiency corresponding to the target device.
  • the second request message includes a cause information, a second-level duration, and a matching packet number;
  • Modules include:
  • a parsing unit configured to parse the reason information
  • a third determining unit configured to: when the parsing unit parses the result that the cause information includes the idle timeout information, the quotient value of the matched packet number and the target difference value is used as a historical flow table matching efficiency corresponding to the target device
  • the target difference value is a difference between the second-level duration and an idle time corresponding to the idle timeout information
  • the third determining unit is further configured to: when the parsing unit parses the result that the cause information includes hard timeout information, the quotient of the matched packet number and the second-level duration is used as the target device
  • the historical flow table matches the efficiency.
  • the target device is a target boundary switch in the at least one border switch; Used for:
  • the target device is the controller, and the port determining module is specifically configured to:
  • the controller When the controller is determined to be subjected to the DDoS attack, the current flow table matching efficiency of each border switch in the SDN is obtained, and the current flow table matching efficiency is lower than the current flow table matching of the border network corresponding to the SDN.
  • An efficient border switch is used as the target switch, and the border network corresponding to the SDN is determined by the at least one border switch in the SDN;
  • the physical port with the highest data stream density corresponding to the first request message in the at least one physical port of the target switch is determined as the target physical port, based on the first request message corresponding to the target switch.
  • the marking module is specifically configured to:
  • the target data stream of the target physical port is encapsulated by a general encapsulation technology.
  • the device further includes:
  • An obtaining module configured to separately obtain address information of a border switch and a data filtering device in the SDN;
  • the obtaining module is further configured to acquire topology information of the SDN.
  • the binding determining module is configured to determine, according to the topology information, the at least one data filtering device for the border switch, and bind the determined address information of the data filtering device to the address information of the border switch.
  • an embodiment of the present invention provides a network device, which is applied to a software-defined network SDN, where the SDN includes a controller and at least one border switch, including: a communication interface, a memory, and a processor, where the processor respectively The communication interface and the memory connection; wherein
  • the memory is used to store driver software
  • the processor reads the driver software from the memory and executes it under the action of the driver software:
  • the current request rate of the target device in the SDN is the current request rate of the first request message
  • the first request message is a request data stream that is sent by the border switch corresponding to the target device to the controller and needs to be processed by the controller
  • the processor reads the driver software from the memory and, under the action of the driver software, further performs the following steps:
  • a target physical port Determining, by the at least one physical port of the border switch corresponding to the target device, a target physical port, where the target physical port is the first window in the at least one physical port, if it is determined that the target device is subjected to a DDoS attack.
  • Target data stream is a data flow between a switch and a switch in the SDN
  • the target device is a target border switch in the at least one border switch;
  • the processor performs the first request message in the first window of the monitoring preset, and calculates the current request rate of the target device in the SDN for the first request message, the following steps are specifically performed:
  • the target device is the controller; Listening to the first request message in the preset first window, and calculating the target device in the SDN When the current request rate of the first request message is performed, the following steps are specifically performed:
  • the target device is in an abnormal state.
  • the processor performs the following steps when performing the querying the flow table matching information corresponding to the target device:
  • the processor performs the following steps when determining, according to the flow table matching information, whether the target device is subjected to a DDoS attack:
  • the second threshold is not exceeded, it is determined that the target device is subjected to a DDoS attack.
  • the target device is a target boundary switch in the at least one border switch;
  • the target device is the controller
  • the border switch corresponding to the target device includes the SDN
  • the processor performs the following steps when performing the current flow table matching efficiency corresponding to the target device based on the flow table matching information:
  • the flow table matching information includes a second-level persistent The time and the number of matched packets; when the processor performs the flow table matching efficiency corresponding to the calculation of the flow table matching information, the following steps are specifically performed:
  • the quotient value of the matched packet number and the second-order duration is used as the flow table matching efficiency corresponding to the flow table matching information.
  • the processor is further configured to perform the following steps:
  • the second request message includes a cause information, a second duration, and a matching packet number;
  • the cause information includes the idle timeout information
  • the quotient value of the matched packet number and the target difference value is used as a historical flow table matching efficiency corresponding to the target device, and the target difference value is the second-level duration and a difference in idle time corresponding to the idle timeout information;
  • the cause information includes the hard timeout information
  • the quotient of the matched packet number and the second-level duration is used as the historical flow table matching efficiency corresponding to the target device.
  • the target device is a target border switch in the at least one border switch;
  • the target physical port is determined from the at least one physical port of the border switch corresponding to the target device, the following steps are specifically performed:
  • the target device is the controller, and the processor is performing the target from the target
  • the target physical port is determined in at least one physical port of the border switch corresponding to the device, perform the following steps:
  • the physical port with the highest data stream density corresponding to the first request message in one physical port is determined as the target physical port.
  • the processor when performing the marking of the target data stream of the target physical port, Specifically perform the following steps:
  • the target data stream of the target physical port is encapsulated by a general encapsulation technology.
  • the processor reads the driver software from the memory and functions in the driver software Next, also perform the following steps:
  • the embodiment of the invention has the following beneficial effects:
  • the embodiment of the present invention can calculate the current request rate corresponding to the target device in the SDN network by using the first request message that is monitored, and determine whether the target device is in an abnormal state according to the current request rate, so that when the target device is in an abnormal state, By further querying the current flow table matching information, it is determined whether the target device is subjected to a DDoS attack.
  • the DDoS attack detection method in the embodiment of the present invention does not need to rely on the randomness of the normal data stream and the attack data stream, thereby improving the accuracy of the DDoS attack detection.
  • the DDoS attack detection method in the embodiment of the present invention can detect the switch and the controller. The DDoS attack solves the problem that the switch cannot be detected by the DDoS in the prior art.
  • FIG. 1 is a schematic structural diagram of an SDN system according to an embodiment of the present invention.
  • FIG. 2 is a schematic flowchart of a DDoS attack detection method according to an embodiment of the present invention
  • FIG. 3 is a schematic flowchart of a DDoS attack protection method according to an embodiment of the present invention.
  • FIG. 4 is an application scenario diagram of a DDoS attack detection and protection method according to an embodiment of the present invention.
  • FIG. 5 is a schematic flowchart of a DDoS attack detection and protection method according to an embodiment of the present invention.
  • FIG. 6 is a schematic flowchart diagram of another DDoS attack detection and protection method according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of a DDoS attack detecting apparatus according to an embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of another DDoS attack detecting apparatus according to an embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of a network device according to an embodiment of the present invention.
  • the technical solution of the embodiment of the present invention may be specifically applied to a software-defined network SDN, and specifically relates to a DDoS attack detection scheme for SDN, thereby improving the accuracy of DDoS attack detection.
  • FIG. 1 is a structural diagram of an SDN system according to an embodiment of the present invention.
  • the SDN includes a controller, at least one border switch, and an internal switch.
  • the at least one border switch determines the boundary network in the SDN.
  • the controller communicates with each switch (including the border switch and the internal switch) through a control link (shown by a broken line in the figure), including the request packet generated by the transport switch, and the query between the transport controller and the switch. Answer information and more.
  • the switches can also enter through the communication link (shown by the solid line in the figure). Line communication, such as the transmission of data streams from users (including attackers) on the current network.
  • FIG. 2 is a schematic flowchart of a method for detecting a DDoS attack according to an embodiment of the present invention.
  • the method in the embodiment of the present invention may be specifically applied to a software-defined network SDN, where the SDN includes a controller and at least As shown in FIG. 2, the method of the embodiment of the present invention may include the following steps:
  • S101 Listen to the first request message in the first window preset in the current SDN, and calculate a current request rate of the target device in the SDN for the first request message.
  • the method in the embodiment of the present invention may be specifically applied to a network device, such as a controller in the SDN or another independently configured detection device, which is not limited in the embodiment of the present invention.
  • the first request message is a request data stream that is sent by the border switch corresponding to the target device in the SDN to the controller and needs to be processed by the controller, such as a PacketIN data stream.
  • the first request message is specifically a data flow between the controller and the switch in the SDN.
  • the target device may be specifically a controller in the SDN or any border switch, that is, the DDoS attack detection of the controller in the SDN network can be implemented in the embodiment of the present invention, and the DDoS attack on the border switch in the SDN can also be implemented. Detection can also detect DDoS attacks on controllers and border switches in the SDN at the same time.
  • the first window may be a time window or a quantity window, that is, the current request rate is calculated according to a first request message in a current time window, or according to a current number of windows.
  • the first request message is calculated.
  • the target device may be a target border switch in the at least one border switch; then the first request message in the preset first window is monitored, and the target device in the SDN is calculated
  • the current request rate of the first request message may be specifically: listening to the first request message sent by the target border switch in the preset first window; calculating a request rate of the first request message, and calculating the The request rate is the current request rate of the target border switch for the first request message. That is, when the DDoS attack detection is performed on the border switch, the first request message, such as the PacketIN message, sent to the controller in the current time window or the quantity window of the target border switch in the SDN network may be monitored. Obtaining a request rate of the target message from the target border switch in the time window or quantity window, that is, a current request rate.
  • the The target border switch can be any of the border switches in the SDN.
  • the target device may also be a controller in the SDN network; and the first request message in the preset first window is monitored, and the target device in the SDN is calculated for the first
  • the current request rate of the request message may be specifically: listening to the first request message sent by each border switch in the SDN in the preset first window; separately obtaining the number sent by each border switch in the first window a request rate of a request message; obtaining, according to a request rate of each border switch, a current request rate of a boundary network determined by all border switches in the SDN in the first window, and a current request rate of the border network As the current request rate corresponding to the controller.
  • the first request message such as the PacketIN message
  • the first request message sent to the controller in the current time window or the quantity window of the border switch in the SDN network may be separately calculated.
  • the current request rate of the border network such that the computer to control the corresponding current request rate (ie, the current request rate of the border network).
  • S102 Determine, according to the current request rate, whether the target device is in an abnormal state.
  • whether the target device is in an abnormal state may be determined by detecting whether the current request rate of the target device meets a preset rule.
  • the determining, according to the current request rate, whether the target device is in an abnormal state may be: determining whether the current request rate is higher than a preset first corresponding to the target device. a threshold; if higher than the first threshold, determining that the target device is in an abnormal state.
  • the first threshold may be determined according to a request rate of the first request message in the preset second window.
  • the second window may also be a time window or a quantity window, that is, by listening to the first request message in a certain time window or quantity window, and calculating a historical request rate corresponding to the first request message in the window, according to the The historical request rate determines the first threshold.
  • the target device may be a border switch or a controller
  • the first threshold corresponding to the border switch is determined according to a historical request rate calculated according to the first request message that is monitored by the border switch in the second window.
  • the first threshold corresponding to the controller is determined according to the historical request rate of the boundary network calculated according to the first request message of each border switch in the SDN in the monitored SDN.
  • the method further determines that the target device is in an abnormal state when the current request rate corresponding to the first window is higher than the first threshold.
  • the current request rate corresponding to the first window may be counted, and whether the current request rate is higher than a preset first threshold corresponding to the target device; if the first threshold is higher, the device continues to monitor
  • the first request message in the first window is configured to count a new current request rate corresponding to the first window, and determine whether the new current request rate is higher than the first threshold; and repeatedly perform the monitoring in the first window.
  • a request message, the step of counting the new current request rate corresponding to the first window, until it is determined that the current request rate is higher than the first threshold for m consecutive times, the target device may be determined to be in an abnormal state.
  • the flow table matching information corresponding to the target device may include flow table matching information generated according to the first request message corresponding to the target device that is monitored in the first window, and may further include the first window
  • the flow table matching information that is already in the border switch corresponding to the target device may be the flow table matching information of the current certain time window or the quantity window.
  • the flow table matching information may include field information such as a second duration duration_sec and a matching packet number packet_count.
  • S104 Determine, according to the flow table matching information, whether the target device is subjected to a DDoS attack.
  • the querying the flow table matching information corresponding to the target device may be: sending a flow table information query instruction to the border switch corresponding to the target device; and receiving a border switch response corresponding to the target device The flow table matching information returned by the flow table information query instruction.
  • the determining, according to the flow table matching information, whether the target device is subjected to a DDoS attack may be: calculating, according to the flow table matching information, a current flow table matching corresponding to the target device Evaluating whether the current flow table matching efficiency exceeds a preset second threshold corresponding to the target device; if the second threshold is not exceeded, determining that the target device is subjected to a DDoS attack.
  • the second threshold is determined according to the flow table matching efficiency obtained by counting the flow table matching information in the preset third window.
  • the third window may also be a time window or a quantity window, and the second threshold may be determined according to the flow table matching information in a certain time window or quantity window.
  • the target device may be a border switch or a controller, and the second threshold corresponding to the border switch is determined according to the flow table matching efficiency calculated by the boundary switch matching information in the third window of the border switch, where The second threshold corresponding to the controller is determined by the flow table matching efficiency of the boundary network calculated according to the flow table matching information of each border switch in the SDN in the third window.
  • the target device may be a target border switch in the at least one border switch; and the current flow table matching efficiency corresponding to the target device is calculated according to the flow table matching information, which may be specifically Calculating, according to the flow table matching information returned by the target border switch, the flow table matching efficiency corresponding to the flow table matching information, and matching the calculated flow table matching efficiency as the current flow table matching of the target boundary switch effectiveness.
  • the target device may be the controller, where the border switch corresponding to the target device includes all border switches in the SDN; and the calculating, according to the flow table matching information,
  • the current flow table matching efficiency corresponding to the target device may be: calculating, according to the flow table matching information returned by each border switch in the SDN, the flow table matching efficiency corresponding to the flow table matching information returned by each border switch; Obtain an average value of the matching efficiency of the flow table corresponding to each of the border switches, and use the average value as the current flow table matching efficiency corresponding to the controller.
  • the flow table matching information includes a second-order duration and a matching packet number; and the flow table matching efficiency corresponding to the flow table matching information is calculated, which may be specifically: the matching packet number and the second-level continuous The quotient of the time is used as the flow table matching efficiency corresponding to the flow table matching information.
  • the second threshold may be obtained according to a history flow table request rate setting of the border switch corresponding to the target device.
  • the second request message of the border switch corresponding to the target device may be monitored, where the second request message is generated according to the flow table matching information in the preset third window; And determining, according to the history flow table matching efficiency corresponding to the target device, a second threshold corresponding to the target device.
  • the second request message may include the cause information, the second-order duration, and the number of matched packets.
  • the calculating, according to the second request message, the historical flow table matching efficiency corresponding to the target device may be specific.
  • the quotient value of the matched packet number and the target difference value is used as a historical flow table matching efficiency corresponding to the target device, and the target difference value is The difference between the seconds duration and the idle time corresponding to the idle timeout information; if the cause information includes the hard timeout information, the quotient of the matched packet number and the second duration is used as the The historical flow table matching efficiency corresponding to the target device.
  • the controller may perform conventional load balancing optimization. If the result of the determination is that the target device is subjected to a DDoS attack, the DDoS attack may be further protected according to a preset protection rule.
  • the current request rate corresponding to the target device in the SDN network is calculated by using the first request message that is monitored, and the target device is determined to be in an abnormal state according to the current request rate, so that the target device is in the target device.
  • the abnormal state by further querying the current flow table matching information, it is determined whether the target device is subjected to a DDoS attack.
  • the DDoS attack detection method in the embodiment of the present invention does not need to rely on the randomness of the normal data stream and the attack data stream, thereby improving the accuracy of the DDoS attack detection.
  • the DDoS attack detection method in the embodiment of the present invention can detect the switch and the controller. The DDoS attack solves the problem that the switch cannot be detected by the DDoS in the prior art.
  • FIG. 3 is a schematic flowchart of a DDoS attack protection method according to an embodiment of the present invention. As shown in FIG. 3, the protection method in the embodiment of the present invention includes the following steps:
  • S201 Determine the target physical port from the at least one physical port of the border switch corresponding to the target device, if it is determined that the target device is subjected to the DDoS attack.
  • Each of the border switches includes at least one physical port, where the target physical port is a physical port with the highest data stream density corresponding to the first request message in the first window of the at least one physical port, that is, the physical port The first request message in the first window has the largest number of physical ports per request message.
  • the target device may be a target border switch in the at least one border switch, that is, when the device that is subjected to the DDoS attack in the SDN network is detected as a border switch, the border switch corresponding to the target device is Determining the target physical port in the at least one physical port, where the data stream density corresponding to the first request message in the at least one physical port of the target border switch is the largest, based on the first request message.
  • the physical port is determined to be the target physical port.
  • the target device may also be a controller in the SDN, that is, the SDN is detected.
  • the target physical port is determined from the at least one physical port of the border switch corresponding to the target device, which may be specifically: obtaining the current flow table of each border switch in the SDN.
  • the border network corresponding to the SDN is at least the SDN Determining, by a border switch, a physical port having a maximum data stream density corresponding to the first request message in at least one physical port of the target switch, based on a first request message corresponding to the target switch Target physical port.
  • the target data stream may be specifically a data flow between a switch and a switch in the software-defined network SDN, that is, a data flow of a user (including an attacker) in the SDN network.
  • the target data flow of the target physical port is marked, and the hardware of the border switch corresponding to the target device is filled in a data packet idle field corresponding to the target data flow of the target physical port.
  • An address hash hash value; or, a general encapsulation technique is used to encapsulate the target data stream of the target physical port.
  • the priority of the marked target data stream can also be set to the highest to facilitate timely redirecting the target data stream to the data filtering device bound to the target device.
  • S203 Redirect the marked target data stream to a data filtering device bound to a border switch corresponding to the target device, so that the data filtering device processes the marked target data stream.
  • the address information of the border switch and the data filtering device in the SDN may be separately obtained; the topology information of the SDN is obtained; and at least one data filtering device is determined for the border switch according to the topology information. And binding the determined address information of the data filtering device to the address information of the border switch.
  • at least one data filtering device may be bound to each border switch, for example, a data filtering device is bound to each border switch according to the topology of the SDN network and/or the load condition of each data filtering device,
  • the DDoS attack state may determine, according to the newly received first request message and the flow table matching information, the first physical port of the plurality of physical ports in the border switch corresponding to the target device except the last determined target physical port.
  • the physical port with the highest data stream density corresponding to the request message is used as the new target physical port, and the target data stream of the new target physical port is marked and then redirected to the bound data filtering device.
  • the port data stream with more concentrated attacks is gradually redirected to the data filtering device to protect against DDoS attacks.
  • the device can stop the data flow labeling and redirection processing of the target physical port with the highest data density.
  • the target physical port having the highest data stream density of the DDoS attack in the border switch corresponding to the target device is determined. And marking the target data stream of the target physical port and redirecting to the bound data filtering device to implement protection against the DDoS attack of the target device.
  • the data packet received by the device is used to extract the attack feature, so that the data flow of the traffic flow is discarded, intercepted, and blocked on the switch, and the technical solution of the embodiment of the present invention can
  • the data filtering device that is directed to the binding can not only effectively protect the DDoS attack of the target device, but also solve the problem that the prior art protection method is likely to cause normal data flow accidental injury and flow table space overflow.
  • FIG. 4 is a schematic diagram of an application scenario of DDoS attack detection and protection according to an embodiment of the present invention.
  • the SDN in the embodiment of the present invention includes a controller, a border switch X, a border switch Y, an internal switch, and a data filtering device respectively bound to the border switches X and Y (here, the border switch is assumed X and Y are bound to the same data filtering device. Only the connection relationship between the border switch X and the data filtering device is shown in FIG. 4, wherein the border switches X and Y determine the boundary network corresponding to the SDN.
  • the controller and each switch communicate through a control link (shown by a broken line in the figure), including a request packet generated by the transport switch, and a query between the transport controller and the switch. With response information, etc. Wait.
  • the switches can communicate with each other through a communication link (shown by a solid line in the figure), such as transmitting data streams of users (including attackers) in the current network.
  • the DDoS attack detection and protection method in the embodiment of the present invention is described in detail below by taking the target device as a switch and a controller as an example.
  • FIG. 5 is a schematic flowchart of a DDoS attack detection and protection method according to an embodiment of the present invention.
  • the target device is a border switch in an SDN network, that is, required.
  • a border switch hereinafter referred to as a target border switch
  • the DDoS attack detection and protection method in the embodiment of the present invention includes:
  • S301 preset a first threshold and a second threshold corresponding to the target boundary switch.
  • the target border switch can be monitored for a period of time, such as one week.
  • the target border switch is any border switch in the SDN, that is, it can be either the border switch X or the border switch Y, and can also monitor at the same time.
  • the border switch X is used as the target border switch, and the border switch X is monitored as an example.
  • the first request message sent to the controller such as a PacketIN message, is used to calculate the target.
  • the historical rate of request of the border switch for the PacketIN message thereby setting a first threshold for the target border switch according to the historical request rate.
  • Both the border switch and the internal switch generate a PacketIN message whose source address is its own address.
  • the border switch X only generates a PacketIN message whose source address is its own address, and does not generate a PacketIN message whose source address is the address of the intranet switch. Therefore, when the controller receives the PacketIN request message, it can perform statistics by determining whether the source address of the PacketIN is the address of the border switch X. Specifically, when the controller listens to the address of the PacketIN message as the address of the intranet switch, no statistical processing is performed; when the source address of the packetized PacketIN message is the address of the border switch X, statistics are performed, and the message is recorded. Source address, arrival time, and number of arrivals.
  • the rate is the historical request rate (N/t, where t is the time corresponding to the number window, that is, the time when the N PacketIN messages are received, and the t values of different windows are generally different). That is, the PacketN message used to calculate the request rate is the PacketIN message sent by the target border switch to the controller and whose source address is the target border switch.
  • a plurality of historical request rates of the border switch X calculated according to a period of time may be combined and combined for the boundary switch X, a first threshold for determining whether the border switch X is in an abnormal state is set for the boundary switch X.
  • the second threshold may be determined by the flow table matching efficiency of the flow table matching information statistics in the preset third window, for example, by monitoring the flowRemoved sent by the border switch X to the controller for a period of time, such as one week.
  • a flow table deletion message (second request message), configured to calculate a historical flow table matching efficiency of the target boundary switch, so that the target boundary switch is configured to determine whether the target boundary switch is in a DDoS attack according to the historical flow table matching efficiency
  • the second threshold of the state is generated according to the flow table matching information corresponding to the border switch X, and is specifically a message corresponding to the boundary switch X when deleting a certain data flow table therein.
  • the source address of the monitored FlowRemoved message is the address of the intranet switch, the content of the message is not extracted; when the source address of the monitored FlowRemoved message is the address of the border switch X, the message is extracted.
  • the reason in the reason second-order duration duration_sec, and matching packet number packet_count field.
  • the matching efficiency of the plurality of historical flow tables in the preset window such as the preset number window N (third window)
  • the statistical processing obtains the historical flow table matching efficiency distribution of the border switch X, and combines the security risks thereof. If the actual situation is such as a service feature, the second threshold may be set for the border switch X.
  • S302 Listen to the first request message sent by the target border switch in the preset first window.
  • S303 Calculate a request rate of the first request message, and use the calculated request rate as a current request rate of the target border switch for the first request message.
  • S304 Determine whether the current request rate is higher than the first threshold.
  • the state of the border switch X may be determined to be an abnormal state when the current request rate of the border switch X is higher than the first threshold for m consecutive times, where m is an integer greater than 0.
  • the current request rate of the border switch X can be compared with a first threshold corresponding to the border switch X. If the current request rate of the target border switch is higher than (or equal to) the first threshold, the border switch X The corresponding counter is incremented by one. If the border switch X is lower than the first threshold, the counter is cleared. When it is detected that the counter corresponding to the border switch X is accumulated to m, it can be determined that the target border switch is in an abnormal state.
  • S307 Receive flow table matching information returned by the target border switch in response to the flow table information query instruction, and calculate a current flow table matching efficiency corresponding to the target boundary switch.
  • the controller may send the flow to the border switch X in an abnormal state.
  • the table information query instruction (the standard signaling specified by the OpenFlow protocol) is used to query the current matching information of the internal flow table, that is, the flow table matching information corresponding to the border switch X, including the second duration duration_sec and the matching packet number packet_count Information, etc. Determine if the exception is caused by an attack.
  • the calculated current flow table matching efficiency of the border switch X is compared with a second threshold corresponding to the border switch X. If the current flow table matching efficiency is higher than the second threshold, the indication may be indicated.
  • the border switch X is not subjected to a DDoS attack, and the abnormality may be caused by a burst of large traffic; if the flow table matching efficiency is lower than or equal to the second threshold, the border switch X may be indicated to be subjected to a DDoS attack.
  • the DDoS attack protection may be further implemented according to the attack-related detection information, including the PacketIN statistics message and the flow table matching information in the m windows N; Attack, the controller can perform optimizations such as conventional complex equalization.
  • S310 Determine, according to the first request message, a physical port with a maximum data stream density corresponding to the first request message in the at least one physical port of the target border switch as a target physical port.
  • the target border switch includes at least one physical port.
  • the target border switch that is, the border switch X
  • the border switch X includes four physical ports A, B, C, and D.
  • the physical port of the four physical ports having the largest proportion of PacketIN messages may be determined according to the PacketIN statistics message in the m windows N that generate the abnormal alarm. That is, the target physical port, such as port D.
  • S311 Mark the target data stream of the target physical port.
  • the controller may send a redirect flow table instruction to the border switch X, and the corresponding matching domain rule of the flow table instruction
  • the priority of all the target data streams (which may be the data flow between the switch and the switch) entered by the port D is the highest level.
  • the action is to uniformly mark the data stream entered by the port D, for example, in the packet idle field. Fill in the hardware address hash hash value of the border switch X or use general encapsulation technology for packet encapsulation.
  • the flow table command may be sent to the switch between the border switch X and the data filtering device bound thereto (if the intermediate switch does not send the flow table instruction), the matching domain rule corresponding to the flow table instruction is All idle fields are the hardware address hash value of the border switch X or the data packet adopting the general encapsulation technology, and the priority is the highest level, and the action is forwarded to the bound data filtering device.
  • S312 Redirect the marked target data stream to a data filtering device that is bound to the target border switch in advance, so that the data filtering device processes the marked target data stream.
  • the address information of the border switch X and the data filtering device may be obtained according to the network deployment record or the topology analysis.
  • the topology relationship is calculated by the shortest path or load balancing method, and the information interaction cost between the border switch X and the data filtering device is calculated, and the information interaction cost is small (for example, the path between the boundary switch X and the border switch X is the shortest, the intermediate node)
  • At least one data filtering device that is minimal and/or lightly loaded, and binds the address information of the selected data filtering device to the border switch X.
  • the attack-related detection information (including the PacketIN statistics message, the flow table matching information, and the like) of the target border switch may be monitored in real time, and the border switch X is still subjected to the DDoS attack according to the attack-related detection information. If the DDoS attack is still performed, the physical port of the four physical ports of the border switch X, except the port D, which is the most densely populated data stream, such as port C, is determined according to the new attack-related detection information. The target data stream of the port C is redirected to the bound data filtering device. If the DDoS attack is no longer performed, the border switch X is no longer in an abnormal state after the redirection protection is performed. The data flow labeling and redirection processing can be stopped. The border switch X can be deleted in sequence according to a preset time interval. The redirect flow table instruction on the upper limit switch X may be determined according to the processed result of the data filtering device.
  • the current request rate of the switch in the SDN network is calculated by using the first request message that is monitored, and the switch is determined to be in an abnormal state according to the current request rate, so that when the switch is in an abnormal state,
  • the current flow table matching information By further querying the current flow table matching information, it is possible to detect whether the switch is subjected to a DDoS attack without relying on the randomness of the normal data flow and the attack data flow, thereby improving the accuracy of the DDoS attack detection.
  • the embodiment of the present invention also solves the problem that the switch cannot be detected by the DDoS attack in the prior art.
  • the target physical port having the highest data stream density of the DDoS attack in the switch is determined, and the physical port of the target physical port is determined.
  • the target data stream is marked and then redirected to the data filtering device bound to the switch to effectively protect the DDoS attack of the switch, and solve the normal data flow accident and the flow table caused by the existing DDoS attack protection.
  • the problem of space overflow is not limited to, but not limited to, but not limited to a switch, and the physical port of the target physical port is determined.
  • FIG. 6 is a schematic flowchart of another DDoS attack detection and protection method according to an embodiment of the present invention.
  • the target device is a controller in an SDN network, that is, DDoS needs to be performed on the controller.
  • DDoS of the embodiment of the present invention
  • Attack detection and protection methods include:
  • S401 The first threshold and the second threshold corresponding to the preset controller.
  • a first request message such as a PacketIN message
  • a packetetIN message sent by each border switch in the SDN network to the controller may be used to calculate a historical request rate corresponding to the controller, so that the control is based on the historical request rate.
  • the first threshold is set.
  • the history of the switches X and Y can be separately calculated according to the PacketIN message sent by each border switch (including the switches X and Y) in a preset window, such as a preset number of windows N (second window).
  • the historical request rate distribution of all border switches ie, switches X and Y
  • the historical request rate of the border network can be used as The historical request rate corresponding to the controller.
  • the first threshold corresponding to whether the controller is in an abnormal state is set for the controller. .
  • the controller sets a second threshold for determining if the controller is in a DDoS attack state.
  • the historical flow table matching efficiency distribution of each border switch can be statistically obtained, and the historical matching efficiency distribution of all the border switches is averaged to obtain the boundary network.
  • the historical flow table matches the efficiency distribution.
  • the second threshold can be set for the controller.
  • S402 Listen to the first request message sent by each border switch in the current SDN in the preset first window.
  • S403 The request rate of the first request message sent by each border switch in the first window is separately calculated.
  • S404 According to the request rate statistics of each border switch, obtain the foregoing in the first window.
  • the current request rate of the border network determined by all the border switches in the SDN, and the current request rate of the border network is used as the current request rate of the controller for the first request message.
  • the PacketIN message sent by each border switch to the controller can be monitored in real time, and the source address, arrival time, and arrival number of the message are recorded. Determining a preset first window, such as the quantity window N, may be calculated every time the controller receives N PacketIN messages from the border switch in the SDN, that is, when the sum of PacketIN messages sent by all border switches is N.
  • the current request rate corresponding to the controller that is, the current request rate of the border network).
  • S405 Determine whether the current request rate is higher than the first threshold.
  • the state of the controller may be determined to be an abnormal state when the current request rate corresponding to the controller is higher than the first threshold corresponding to the controller for m consecutive times, where m is an integer greater than 0.
  • the current request rate corresponding to the controller may be compared with a first threshold corresponding to the controller, and if the current request rate of the controller is higher than (or equal to) the first threshold, the corresponding counter of the controller Plus one, if the controller is lower than the first threshold, the counter is cleared. When it is detected that the counter corresponding to the controller is accumulated to m, it can be determined that the controller is in an abnormal state.
  • S408 Receive a flow table matching information returned by the border switch corresponding to the controller in response to the flow table information query instruction, and calculate a current flow table matching efficiency corresponding to the controller.
  • the border switch corresponding to the controller is all border switches in the SDN.
  • the controller may send a flow table information query instruction to each of the border switches (including the border switches X and Y) in the SDN for querying the internal flow table thereof.
  • the current flow table matching efficiency of each border switch is averaged to obtain the current flow table matching efficiency of the border network in the abnormal state, and the current flow table matching efficiency of the boundary network can be used as the current corresponding to the controller. Flow table matching efficiency.
  • S409 Determine whether the current flow table matching efficiency exceeds the second threshold.
  • the calculated current flow table matching efficiency corresponding to the controller is compared with a second threshold corresponding to the controller, and if the current flow table matching efficiency corresponding to the controller is higher than the second threshold, The controller may not be attacked by the DDoS; if the matching efficiency of the flow table is lower than or equal to the second threshold, the controller may be attacked by the DDoS.
  • the DDoS attack can be further protected according to the attack-related detection information, including the PacketIN statistics message and the flow table matching information in the m windows N;
  • the controller can perform optimizations such as conventional complex equalization.
  • S411 Acquire a current flow table matching efficiency of each border switch in the SDN, and use the boundary switch whose current flow table matching efficiency is lower than the current flow table matching efficiency of the border network as a target switch.
  • S412 Determine, according to the first request message corresponding to the target switch, a physical port with a maximum data stream density corresponding to the first request message in the at least one physical port of the target switch as a target physical port.
  • the target switch includes at least one physical port. Specifically, when it is determined that the controller is subjected to a DDoS attack, the boundary switch that is the current flow table matching efficiency lower than the current flow table matching efficiency of the boundary network (ie, the current flow table matching efficiency corresponding to the controller) is determined to be the target.
  • the switch determines that the target switch with the lower matching efficiency of the flow table is the border switch X, and can determine the physical ports of the border switch X according to the PacketIN statistics message in the m windows N that generate the abnormal alarm.
  • the physical port with the largest proportion of PacketIN messages is the target physical port. As shown in FIG. 4, it is assumed that the border switch X includes four physical ports A, B, C, and D, and the determined target physical port is port D.
  • the controller may send a redirect flow table instruction to the target switch, that is, the border switch X, where the flow table instruction corresponds.
  • the matching domain rule is that the priority of all the data flows entering the port D (which may be the data flow between the switch and the switch) is the highest level.
  • the action is to uniformly mark the data flows entered by the port D, for example, in the data.
  • the packet idle field fills in the hard of the border switch X
  • the flow table command may be sent to the switch between the target switch and the data filtering device bound to the target switch, and the matching domain rule corresponding to the flow table instruction is that all idle fields are hardware address hash values of the target switch or adopted.
  • the packet of the general encapsulation technology has the highest priority and the action is forwarded to the bound data filtering device.
  • S414 Redirect the marked target data stream to a data filtering device that is bound to the target switch in advance, so that the data filtering device processes the marked target data stream.
  • the attack-related detection information (including the PacketIN statistics message, the flow table matching information, and the like) of each border switch can be monitored in real time, and the controller is still suffering from the DDoS attack according to the attack-related detection information. If the DDoS attack is still performed, the target switch of the flow table matching efficiency lower than the flow table matching efficiency of the border network, such as the physical switch of the border switch X, except for the last data flow, may be determined according to the new attack-related detection information. The most densely populated physical port, such as port C, and the target data stream of port C is redirected to the bound data filtering device. If the controller is no longer in the abnormal state after the redirection protection is performed, the data flow labeling and redirection processing can be stopped. The border switch X can be deleted in sequence according to the preset time interval. The redirect flow table instruction may be used to determine whether to delete the redirect flow table instruction on the border switch X according to the processed detection result by the data filtering device.
  • each of the border switches and the controller may be preset to obtain a corresponding first threshold and a second threshold, so that DDoS can be simultaneously performed on each of the border switches and the controller. Attack detection and protection, which are not described here.
  • the current request rate corresponding to the controller in the SDN network may be calculated by using the first request message that is monitored, and the controller is determined to be in an abnormal state according to the current request rate, so that the controller is in the controller.
  • the abnormal state by further querying the current flow table matching information, it is possible to detect whether the controller is subjected to a DDoS attack without relying on the randomness of the normal data flow and the attack data flow, thereby improving the accuracy of the DDoS attack detection.
  • the embodiment of the present invention may also determine that the flow table matches by detecting that the controller in the SDN network is subjected to the DDoS attack.
  • the target physical port with the highest data density of the DDoS attack in the lower-efficiency target switch, and the target data stream of the target physical port is marked and then redirected to the data filtering device bound to the target switch.
  • the controller effectively protects the DDoS attack and solves the problem of normal data flow accidents and overflow of the flow table caused by the existing DDoS attack protection.
  • FIG. 7 is a schematic structural diagram of a DDoS attack detecting apparatus according to an embodiment of the present invention.
  • the apparatus is applicable to a software defined network SDN, where the SDN includes a controller and at least one border switch.
  • the DDoS attack detection apparatus includes a calculation module 11, an abnormality determination module 12, a query module 13, and an attack determination module 14. among them,
  • the calculating module 11 is configured to monitor a first request message in a preset first window, and calculate a current request rate of the target device in the SDN for the first request message, where the first request message is The boundary switch corresponding to the target device sends to the controller a request data stream that needs to be processed by the controller.
  • the device in the embodiment of the present invention may be specifically configured in a network device, such as a controller in the SDN or another independently configured detection device, which is not limited in the embodiment of the present invention.
  • the first request message is a request data stream that is sent by the border switch corresponding to the target device in the SDN to the controller and needs to be processed by the controller, such as a PacketIN data stream.
  • the first request message is specifically a data flow between the controller and the switch in the SDN.
  • the target device may be specifically a controller in the SDN or any border switch, that is, the DDoS attack detection of the controller in the SDN network can be implemented in the embodiment of the present invention, and the DDoS attack on the border switch in the SDN can also be implemented. Detection can also detect DDoS attacks on controllers and border switches in the SDN at the same time.
  • the first window may be a time window or a quantity window, that is, the current request rate is calculated according to a first request message in a current time window, or according to a current number of windows.
  • the first request message is calculated.
  • the abnormality determining module 12 is configured to determine, according to the current request rate, whether the target device is in an abnormal state.
  • the abnormality determining module 12 can detect whether the current request rate of the target device meets the preset. A rule, such as whether the current request rate exceeds a predetermined first threshold, to determine whether the target device is in an abnormal state.
  • the querying module 13 is configured to query the flow table matching information corresponding to the target device when the determination result of the abnormality determining module 12 is that the target device is in an abnormal state.
  • the flow table matching information corresponding to the target device may include flow table matching information generated according to the first request message corresponding to the target device that is monitored in the first window, and may further include the first window
  • the flow table matching information that is already in the border switch corresponding to the target device may be the flow table matching information of the current certain time window or the quantity window.
  • the flow table matching information may include field information such as a second duration duration_sec and a matching packet number packet_count.
  • the attack determining module 14 is configured to determine, according to the flow table matching information, whether the target device is subjected to a DDoS attack.
  • the attack determination module 14 can detect whether the flow table matching information acquired by the query module 13 meets a preset matching rule, for example, whether the flow table matching efficiency corresponding to the flow table matching information exceeds a preset number.
  • the second threshold is used to determine whether the target device is subject to a DDoS attack.
  • the controller can perform conventional load balancing optimization. If the attack determining module 14 determines that the target device is subjected to a DDoS attack, the DDoS attack may be further protected according to a preset protection rule.
  • FIG. 8 is a schematic structural diagram of another DDoS attack detection apparatus according to an embodiment of the present invention.
  • the apparatus of the embodiment of the present invention includes the calculation module 11 of the DDoS attack detection apparatus, and an abnormality.
  • the judging module 12, the query module 13 and the attack determining module 14 are provided.
  • the device may further include:
  • the port determining module 15 is configured to: when determining that the target device is subjected to a DDoS attack, determine a target physical port from at least one physical port of the border switch corresponding to the target device, where the target physical port is the at least one physical The physical port with the highest data stream density corresponding to the first request message in the first window in the port.
  • Each of the border switches includes at least one physical port, where the target physical port is a physical port with the highest data stream density corresponding to the first request message in the first window of the at least one physical port, that is, the physical port The first request message in the first window has the largest number of physical ports per request message.
  • the marking module 16 is configured to mark the target data stream transmitted by the target physical port.
  • the target data stream may be specifically a data flow between a switch and a switch in the software-defined network SDN, that is, a data flow of a user (including an attacker) in the SDN network.
  • a redirection module 17 configured to redirect the marked target data stream to a data filtering device bound to a border switch corresponding to the target device, so that the data filtering device targets the tagged target The data stream is processed.
  • the target device may be a target boundary switch in the at least one border switch; then the computing module 11 may include (not shown):
  • the first monitoring unit 111 is configured to monitor the first request message sent by the target border switch in the preset first window;
  • the first calculating unit 112 is configured to calculate a request rate of the first request message, and use the calculated request rate as a current request rate of the target border switch for the first request message.
  • the first intercepting unit 111 can listen to the first request message sent by the target border switch to the controller, such as a PacketIN message, in real time, and record the source address, arrival time, and arrival number of the message.
  • the first calculating unit 112 may calculate the request rate of the target border switch, that is, the current request, when the first listening unit 11 monitors the preset first window, such as the number of window N, to the PacketIN message from the target border switch. rate.
  • the target device may also be the controller; then the computing module 11 may include (not shown):
  • the second monitoring unit 113 is configured to monitor a first request message sent by each border switch in the SDN in the preset first window;
  • a second calculating unit 114 configured to separately obtain a request rate of the first request message sent by each border switch in the first window
  • the second calculating unit 115 is further configured to obtain, according to a request rate of each border switch, a current request rate of a boundary network determined by all border switches in the SDN in the first window, and the border network
  • the current request rate is the current request rate of the controller for the first request message.
  • the second monitoring unit 113 can monitor each boundary in the SDN in real time.
  • the PacketIN message sent to the controller is the first request message, and the source address, arrival time, and arrival number of the message are recorded.
  • the second calculating unit 114 may, when the second listening unit 113 listens to the preset first window, such as the quantity window N, to the PacketIN message from the border switch in the SDN, that is, the PacketIN message sent by all the border switches.
  • the quantity sum is N
  • the request rate of each Packet switch for the PacketIN message is calculated, and the sum of the request rates of each border switch is used as the current request rate corresponding to the controller (that is, the current request rate of the border network).
  • abnormality determining module 12 may specifically include (not shown in the figure):
  • the first determining unit 121 is configured to determine whether the current request rate is higher than a preset first threshold corresponding to the target device, where the first threshold is according to a first one in a preset second window. The request rate of the request message is determined;
  • the first determining unit 122 is configured to determine that the target device is in an abnormal state when the determination result of the first determining unit 121 is higher than the first threshold.
  • the first determining unit 122 may determine the state of the target device as an abnormal state when the current request rate corresponding to the target device is higher than the first threshold corresponding to the target device for m times, wherein m is greater than 0. Integer.
  • query module 13 may specifically include (not shown in the figure):
  • the command sending unit 131 is configured to send a flow table information query instruction to the border switch corresponding to the target device when the target device is in an abnormal state;
  • the information receiving unit 132 is configured to receive flow table matching information returned by the border switch corresponding to the target device in response to the flow table information query instruction;
  • the attack determination module 14 may specifically include (not shown):
  • the efficiency calculation unit 141 is configured to calculate, according to the flow table matching information, a current flow table matching efficiency corresponding to the target device;
  • the second determining unit 142 is configured to determine whether the current flow table matching efficiency exceeds a preset second threshold corresponding to the target device, where the second threshold is based on a preset flow in the third window
  • the table matching information is determined by the flow table matching efficiency obtained by the statistics;
  • the second determining unit 143 is configured to determine that the target device is subjected to a DDoS attack when the determination result of the second determining unit 142 is that the current flow table matching efficiency does not exceed the second threshold.
  • the target device may be the at least one boundary The target boundary switch in the switch; the efficiency calculation unit 141 may be specifically configured to:
  • the port determining module 15 can be specifically configured to:
  • the target border switch includes at least one physical port.
  • the port determining module 15 may determine, according to the PacketIN statistics message in the m windows N that generate the abnormal alarm, the PacketIN in the at least one physical port.
  • the physical port with the largest proportion of messages is the target physical port.
  • the target device may also be the controller, and the border switch corresponding to the target device includes all border switches in the SDN; the efficiency calculation unit 141 may also be specific Used for:
  • the port determining module 15 can be specifically configured to:
  • the controller When the controller is determined to be subjected to the DDoS attack, the current flow table matching efficiency of each border switch in the SDN is obtained, and the current flow table matching efficiency is lower than the current flow table matching of the border network corresponding to the SDN.
  • An efficient border switch is used as the target switch, and the border network corresponding to the SDN is determined by the at least one border switch in the SDN;
  • the physical port with the highest data stream density corresponding to the first request message in the at least one physical port of the target switch is determined as the target physical port, based on the first request message corresponding to the target switch.
  • the target switch includes at least one physical port.
  • the port determining module 15 may determine to obtain the current flow table.
  • the boundary switch that matches the current flow table matching efficiency of the border network (that is, the current flow table matching efficiency corresponding to the controller) is the target switch, and can be determined according to the PacketIN statistics message in the m windows N that generate the abnormal alarm.
  • the physical port with the largest proportion of PacketIN messages in each physical port of the target switch is the target physical port.
  • the marking module 16 can be specifically configured to:
  • the target data stream of the target physical port is encapsulated by a general encapsulation technology.
  • the apparatus further includes (not shown):
  • the efficiency determining module 18 is configured to monitor a second request message of the border switch corresponding to the target device, and calculate, according to the second request message, a historical flow table matching efficiency corresponding to the target device, where the second The request message is generated according to the flow table matching information in the preset third window;
  • the threshold determining module 19 is configured to determine a second threshold corresponding to the target device according to a historical flow table matching efficiency corresponding to the target device.
  • the second request message includes cause information, a second-level duration, and a matching packet number;
  • the efficiency determining module 18 may include (not shown):
  • the parsing unit 181 is configured to parse the reason information
  • the third determining unit 182 is configured to: when the parsing unit 181 parses the result that the cause information includes the idle timeout information, the quotient value of the matched packet number and the target difference value is used as a historical flow table corresponding to the target device. a matching efficiency, where the target difference is a difference between the second duration and the idle time corresponding to the idle timeout information;
  • the third determining unit 182 is further configured to: when the parsing unit 181 parses the result that the cause information includes hard timeout information, use the quotient of the matching packet number and the second-level duration as the target The historical flow table matching efficiency corresponding to the device.
  • the apparatus may further include (not shown):
  • the obtaining module 20 is configured to separately obtain address information of the border switch and the data filtering device in the SDN;
  • the obtaining module 20 is further configured to acquire topology information of the SDN.
  • a binding determining module 21 configured to determine, according to the topology information, the border switch to One less data filtering device, and the determined address information of the data filtering device is bound to the address information of the border switch.
  • the obtaining module 20 may obtain address information of the border switch and the data filtering device, such as a hardware address and an IP address of the device, according to the network deployment record or the topology analysis.
  • the binding determination module 21 may calculate the information interaction cost between the border switch and the data filtering device according to the topology relationship between the border switch and the data filtering device, and select the information by using the shortest path or load balancing method. At least one data filtering device having a small interaction cost (such as a shortest path between the border switches, a minimum intermediate node, and/or a light load), and performing address information of the selected data filtering device with the border switch X Bind.
  • the current request rate corresponding to the target device in the SDN network is calculated by using the first request message that is monitored, and the target device is determined to be in an abnormal state according to the current request rate, so that the target device is in the target device.
  • the abnormal state by further querying the current flow table matching information, it is determined whether the target device is subjected to a DDoS attack.
  • the DDoS attack detection method in the embodiment of the present invention does not need to rely on the randomness of the normal data stream and the attack data stream, thereby improving the accuracy of the DDoS attack detection.
  • the DDoS attack detection method in the embodiment of the present invention can detect the switch and the controller.
  • the DDoS attack solves the problem that the switch cannot be detected by the DDoS in the prior art. Further, when it is detected that the target device such as the switch or the controller in the SDN network is subjected to the DDoS attack, the target physical port having the highest data stream density of the DDoS attack is determined by determining the boundary switch corresponding to the target device, and the target physical port is The target data stream of the port is marked and then redirected to the bound data filtering device, so that the protection against the DDoS attack of the target device can be implemented.
  • the data processing amount of the currently used controller exceeds the preset data amount threshold, other idle controllers are enabled, and the method of packet header analysis is used to exceed the threshold control.
  • the data packet received by the device is used to extract the attack feature, so that the data flow of the traffic flow is discarded, intercepted, and blocked on the switch, and the technical solution of the embodiment of the present invention can
  • the data filtering device that is directed to the binding can not only effectively protect the DDoS attack of the target device, but also solve the problem that the prior art protection method is likely to cause normal data flow accidental injury and flow table space overflow.
  • FIG. 9 is a schematic structural diagram of a network device according to an embodiment of the present invention.
  • the network device is applicable to a software-defined network SDN, where the SDN includes a controller and at least one border switch.
  • the network device in the embodiment of the present invention includes: a communication interface 300, a memory 200, and a processor 100, and the processor 100 is respectively connected to the communication interface 300 and the memory 200.
  • the memory 200 may be a high speed RAM memory or a non-volatile memory such as at least one disk memory.
  • the communication interface 300, the memory 200, and the processor 100 may be connected to each other through a bus, or may be connected by other means. In the present embodiment, a bus connection will be described. among them,
  • the memory 200 is configured to store driver software
  • the processor 100 reads the driver software from the memory 200 and executes it under the action of the driver software:
  • the communication interface 300 Monitoring, by the communication interface 300, a first request message in a preset first window, and calculating a current request rate of the target device in the SDN for the first request message, where the first request message is a request data stream that is sent by the border switch corresponding to the target device to the controller that needs to be processed by the controller;
  • the network device in the embodiment of the present invention may be specifically a controller in the SDN or other independently configured detection device.
  • the processor 100 reads the driver software from the memory and, under the action of the driver software, further performs the following steps:
  • a target physical port Determining, by the at least one physical port of the border switch corresponding to the target device, a target physical port, where the target physical port is the first window in the at least one physical port, if it is determined that the target device is subjected to a DDoS attack.
  • Target data stream is a data flow between a switch and a switch in the SDN
  • the target device is a target border switch in the at least one border switch; the processor 100 is configured to perform a first request message in the first window of the monitoring preset, and calculate the SDN.
  • the target device is targeting the current request rate of the first request message, the following steps are specifically performed:
  • the target device is the controller; the processor 100 is configured to execute a first request message in the first window of the monitoring preset, and calculate a target device in the SDN for the first When requesting the current request rate of a message, perform the following steps:
  • the processor 100 performs the following steps when determining whether the target device is in an abnormal state based on the current request rate:
  • the target device is in an abnormal state.
  • the processor 100 performs the following steps when performing the querying the flow table matching information corresponding to the target device:
  • the processor 100 performs the following steps when determining whether the target device is subjected to a DDoS attack based on the flow table matching information:
  • the second threshold is not exceeded, it is determined that the target device is subjected to a DDoS attack.
  • the target device is a target boundary switch in the at least one border switch; and the processor 100 calculates the current flow table corresponding to the target device according to the performing the flow table matching information.
  • matching efficiency perform the following steps:
  • the target device is the controller, and the border switch corresponding to the target device includes all border switches in the SDN; the processor 100 is configured to perform the matching information according to the flow table.
  • the processor 100 is configured to perform the matching information according to the flow table.
  • the flow table matching information includes a second-order duration and a matching number of packets.
  • the quotient of the matching packet number and the second-level duration matches the efficiency.
  • processor 100 is further configured to perform the following steps:
  • the second request message includes the cause information, the second-level duration, and the number of matched packets.
  • the processor 100 calculates the corresponding target device according to the second request message. When the historical flow table matches the efficiency, perform the following steps:
  • the cause information includes the idle timeout information
  • the quotient value of the matched packet number and the target difference value is used as a historical flow table matching efficiency corresponding to the target device, and the target difference value is the second-level duration and a difference in idle time corresponding to the idle timeout information;
  • the cause information includes the hard timeout information
  • the quotient of the matched packet number and the second-level duration is used as the historical flow table matching efficiency corresponding to the target device.
  • the target device is a target boundary switch in the at least one border switch; the processor 100 determines a target physical port in performing the at least one physical port from the border switch corresponding to the target device.
  • the processor 100 determines a target physical port in performing the at least one physical port from the border switch corresponding to the target device.
  • the target device is the controller; when the processor 100 determines the target physical port from the at least one physical port of the border switch corresponding to the target device, performing the following steps:
  • the physical port with the highest data stream density corresponding to the first request message in the at least one physical port of the target switch is determined as the target physical port, based on the first request message corresponding to the target switch.
  • processor 100 performs the following steps when performing the marking of the target data flow of the target physical port:
  • the target data stream of the target physical port is encapsulated by a general encapsulation technology.
  • the processor 100 reads the driver software from the memory and, under the action of the driver software, further performs the following steps:
  • the disclosed apparatus and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as the unit may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. . Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in various embodiments of the present invention may be integrated in one processing unit. It is also possible that each unit physically exists alone, or two or more units may be integrated in one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
  • the above-described integrated unit implemented in the form of a software functional unit can be stored in a computer readable storage medium.
  • the above software functional unit is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform the methods of the various embodiments of the present invention. Part of the steps.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes. .

Abstract

本发明实施例公开了一种分布式拒绝服务DDoS攻击检测方法及相关设备,应用于软件定义网络SDN,所述SDN包括控制器和至少一个边界交换机。其中,所述方法包括:监听预设的第一窗口内的第一请求消息,并计算所述SDN中的目标设备针对所述第一请求消息的当前请求速率,所述第一请求消息为所述目标设备对应的边界交换机发送给所述控制器的需要所述控制器处理的请求数据流;以所述当前请求速率为依据,判断所述目标设备是否处于异常状态;若所述目标设备处于异常状态,则查询所述目标设备对应的流表匹配信息;以所述流表匹配信息为依据,确定所述目标设备是否受到DDoS攻击。采用本发明,能够提升针对SDN的DDoS攻击检测的准确性。

Description

一种分布式拒绝服务DDoS攻击检测方法及相关设备 技术领域
本发明涉及通信技术领域,尤其涉及一种DDoS攻击检测方法及相关设备。
背景技术
软件定义网络(Software Defined Network,简称“SDN”)是一种通过将网络设备控制面与数据面分离开来,从而实现网络流量的灵活控制的新型网络架构,其为核心网络及应用的创新提供了良好的平台。同时,该SDN网络也面临一些安全问题,如容易遭受分布式拒绝服务(Distributed Denial of Service,简称“DDoS”)攻击。在SDN中,所有新进入SDN的数据流都需要向SDN中的控制器请求处理以获取路由结果,当一段时间内发生给控制器的请求过多时则会导致控制器处理性能下降。若DDoS攻击者伪造并发送大量不同流的数据包,则会恶意消耗控制器处理资源。而且,由于该DDoS攻击在制造大量属于不同流的数据包占用控制器资源的同时,控制器会下发大量的流表项,这就可能导致网络中底层交换设备的流表空间溢出。因此,如何有效实现对SDN网络中的设备的DDoS攻击检测成为亟需解决的难题。
目前,仅存在少量针对SDN遭受DDoS攻击检测的研究,其中,披露了一种利用熵值变化检测SDN中控制器遭受DDoS攻击的方法。由于在网络正常时,数据流的目的IP地址、虚拟局域网(Virtual Local Area Network,简称“VLAN”)号、目的端口或其他字段一般会呈现较强的随机性,此时熵值较大;而在控制器遭受到DDoS攻击时,数据流某个或某些字段的随机性会减小,此时熵值较小,从而能够根据熵值大小确定该控制器是否遭受到DDoS攻击。其中,该熵值用于衡量一个随机变量出现的期望值。
然而,该基于熵值的DDoS攻击检测方法依赖于正常数据流和攻击数据流之间的随机性差异,这就使得当攻击数据流随机性较强时,会出现漏报攻击的情况,当正常数据流随机性不强时,则会误将正常数据流作为攻击数据流,出 现误报攻击的情况。也就是说,目前的DDoS攻击检测方法需要依赖于正常数据流和攻击数据流的随机性进行检测,准确性较低。
发明内容
本发明实施例提供一种DDoS攻击检测方法及相关设备,能够提升DDoS攻击检测的准确性,而无需依赖正常数据流和攻击数据流的随机性来进行检测。
第一方面,本发明实施例提供了一种DDoS攻击检测方法,应用于软件定义网络SDN中,所述SDN包括控制器和至少一个边界交换机,包括:
监听预设的第一窗口内的第一请求消息,并计算所述SDN中的目标设备针对所述第一请求消息的当前请求速率,所述第一请求消息为所述目标设备对应的边界交换机发送给所述控制器的需要所述控制器处理的请求数据流;
以所述当前请求速率为依据,判断所述目标设备是否处于异常状态;
若所述目标设备处于异常状态,则查询所述目标设备对应的流表匹配信息;
以所述流表匹配信息为依据,确定所述目标设备是否受到DDoS攻击。
结合第一方面,在第一方面的第一种可能的实现方式中,在所述方法还包括:
若确定所述目标设备受到DDoS攻击,则从所述目标设备对应的边界交换机的至少一个物理端口中确定出目标物理端口,所述目标物理端口为所述至少一个物理端口中所述第一窗口内所述第一请求消息对应的数据流密度最大的物理端口;
对所述目标物理端口传输的目标数据流进行标记,所述目标数据流为所述SDN中交换机与交换机之间的数据流;
将所述标记后的目标数据流重定向至预先与所述目标设备对应的边界交换机绑定的数据过滤设备,以使所述数据过滤设备对所述标记后的目标数据流进行处理。
结合第一方面,或者第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,所述目标设备为所述至少一个边界交换机中的目标边 界交换机;所述监听预设的第一窗口内的第一请求消息,并计算所述SDN中的目标设备针对所述第一请求消息的当前请求速率,包括:
监听预设的第一窗口内所述目标边界交换机发送的第一请求消息;
计算所述第一请求消息的请求速率,并将计算出的所述请求速率作为所述目标边界交换机针对所述第一请求消息的当前请求速率。
结合第一方面,或者第一方面的第一种可能的实现方式,在第一方面的第三种可能的实现方式中,所述目标设备为所述控制器;所述监听预设的第一窗口内的第一请求消息,并计算所述SDN中的目标设备针对所述第一请求消息的当前请求速率,包括:
监听预设的第一窗口内所述SDN中每一个边界交换机发送的第一请求消息;
分别统计得到所述第一窗口内每一个边界交换机发送的第一请求消息的请求速率;
根据每一个边界交换机的请求速率统计得到所述第一窗口内所述SDN中所有边界交换机所确定的边界网络的当前请求速率,并将所述边界网络的当前请求速率作为所述控制器针对所述第一请求消息的当前请求速率。
结合第一方面,或者第一方面的第一种可能的实现方式,或者第一方面的第二种可能的实现方式,或者第一方面的第三种可能的实现方式,在第一方面的第四种可能的实现方式中,所述以所述当前请求速率为依据,判断所述目标设备是否处于异常状态,包括:
判断所述当前请求速率是否高于预置的与所述目标设备对应的第一阈值,其中,所述第一阈值是根据预设的第二窗口内的第一请求消息的请求速率确定出的;
若高于所述第一阈值,则确定所述目标设备处于异常状态。
结合第一方面,或者第一方面的第一种可能的实现方式,或者第一方面的第二种可能的实现方式,或者第一方面的第三种可能的实现方式,或者第一方面的第四种可能的实现方式,在第一方面的第五种可能的实现方式中,所述查询所述目标设备对应的流表匹配信息,包括:
向所述目标设备对应的边界交换机发送流表信息查询指令;
接收所述目标设备对应的边界交换机响应所述流表信息查询指令返回的流表匹配信息;
所述以所述流表匹配信息为依据,确定所述目标设备是否受到DDoS攻击,包括:
以所述流表匹配信息为依据,计算所述目标设备对应的当前流表匹配效率;
判断所述当前流表匹配效率是否超过预置的与所述目标设备对应的第二阈值,其中,所述第二阈值是根据预设的第三窗口内的流表匹配信息统计得到的流表匹配效率而确定出的;
若不超过所述第二阈值,则确定所述目标设备受到DDoS攻击。
结合第一方面的第五种可能的实现方式,在第一方面的第六种可能的实现方式中,所述目标设备为所述至少一个边界交换机中的目标边界交换机;所述以所述流表匹配信息为依据,计算所述目标设备对应的当前流表匹配效率,包括:
根据所述目标边界交换机返回的流表匹配信息,计算所述流表匹配信息对应的流表匹配效率,并将计算出的所述流表匹配效率作为所述目标边界交换机的当前流表匹配效率。
结合第一方面的第五种可能的实现方式,在第一方面的第七种可能的实现方式中,所述目标设备为所述控制器,所述目标设备对应的边界交换机包括所述SDN中的所有边界交换机;所述以所述流表匹配信息为依据,计算所述目标设备对应的当前流表匹配效率,包括:
根据所述SDN中每一个边界交换机返回的流表匹配信息,分别计算每一个边界交换机返回的流表匹配信息对应的流表匹配效率;
计算得到所述每一个边界交换机对应的流表匹配效率的平均值,并将所述平均值作为所述控制器对应的当前流表匹配效率。
结合第一方面的第六种可能的实现方式,或者第一方面的第七种可能的实现方式,在第一方面的第八种可能的实现方式中,所述流表匹配信息包括秒级持续时间和匹配包数;所述计算流表匹配信息对应的流表匹配效率,包括:
将所述匹配包数与所述秒级持续时间的商值作为所述流表匹配信息对应 的流表匹配效率。
结合第一方面的第五种可能的实现方式,在第一方面的第九种可能的实现方式中,所述方法还包括:
监听所述目标设备对应的边界交换机的第二请求消息,所述第二请求消息是根据预设的第三窗口内的流表匹配信息生成的;
以所述第二请求消息为依据,计算所述目标设备对应的历史流表匹配效率;
根据所述目标设备对应的历史流表匹配效率,确定出所述目标设备对应的第二阈值。
结合第一方面的第九种可能的实现方式,在第一方面的第十种可能的实现方式中,所述第二请求消息包括原因信息、秒级持续时间和匹配包数;所述以所述第二请求消息为依据,计算所述目标设备对应的历史流表匹配效率,包括:
解析所述原因信息;
若所述原因信息包括闲置超时信息,则将所述匹配包数与目标差值的商值作为所述目标设备对应的历史流表匹配效率,所述目标差值是所述秒级持续时间与所述闲置超时信息对应的闲置时间的差值;
若所述原因信息包括硬性超时信息,则将所述匹配包数与所述秒级持续时间的商值作为所述目标设备对应的历史流表匹配效率。
结合第一方面的第一种可能的实现方式,在第一方面的第十一种可能的实现方式中,所述目标设备为所述至少一个边界交换机中的目标边界交换机;所述从所述目标设备对应的边界交换机的至少一个物理端口中确定出目标物理端口,包括:
以所述第一请求消息为依据,将所述目标边界交换机的至少一个物理端口中所述第一请求消息对应的数据流密度最大的物理端口确定为目标物理端口。
结合第一方面的第一种可能的实现方式,在第一方面的第十二种可能的实现方式中,所述目标设备为所述控制器;所述从所述目标设备对应的边界交换机的至少一个物理端口中确定出目标物理端口,包括:
获取所述SDN中每一个边界交换机的当前流表匹配效率,并将所述当前流表匹配效率低于所述SDN对应的边界网络的当前流表匹配效率的边界交换 机作为目标交换机,所述SDN对应的边界网络是由所述SDN中所述至少一个边界交换机所确定出的;
以所述目标交换机对应的第一请求消息为依据,将所述目标交换机的至少一个物理端口中所述第一请求消息对应的数据流密度最大的物理端口确定为目标物理端口。
结合第一方面的第一种可能的实现方式,在第一方面的第十三种可能的实现方式中,所述对所述目标物理端口的目标数据流进行标记,包括:
在所述目标物理端口的目标数据流对应的数据包空闲字段填写所述目标设备对应的边界交换机的硬件地址哈希Hash值;或者,
采用通用封装技术对所述目标物理端口的目标数据流进行数据包封装。
结合第一方面的第一种可能的实现方式,在第一方面的第十四种可能的实现方式中,所述方法还包括:
分别获取所述SDN中的边界交换机和数据过滤设备的地址信息;
获取所述SDN的拓扑结构信息;
根据所述拓扑结构信息为所述边界交换机确定至少一个数据过滤设备,并将确定出的数据过滤设备的地址信息与所述边界交换机的地址信息绑定。
第二方面,本发明实施例提供了一种DDoS攻击检测装置,应用于软件定义网络SDN,所述SDN包括控制器和至少一个边界交换机,包括:
计算模块,用于监听预设的第一窗口内的第一请求消息,并计算所述SDN中的目标设备针对所述第一请求消息的当前请求速率,所述第一请求消息为所述目标设备对应的边界交换机发送给所述控制器的需要所述控制器处理的请求数据流;
异常判断模块,用于以所述当前请求速率为依据,判断所述目标设备是否处于异常状态;
查询模块,用于在所述异常判断模块的判断结果为所述目标设备处于异常状态时,查询所述目标设备对应的流表匹配信息;
攻击确定模块,用于以所述流表匹配信息为依据,确定所述目标设备是否受到DDoS攻击。
结合第二方面,在第二方面的第一种可能的实现方式中,所述装置还包括:
端口确定模块,用于在确定所述目标设备受到DDoS攻击时,从所述目标设备对应的边界交换机的至少一个物理端口中确定出目标物理端口,所述目标物理端口为所述至少一个物理端口中所述第一窗口内所述第一请求消息对应的数据流密度最大的物理端口;
标记模块,用于对所述目标物理端口传输的目标数据流进行标记,所述目标数据流为所述SDN中交换机与交换机之间的数据流;
重定向模块,用于将所述标记后的目标数据流重定向至预先与所述目标设备对应的边界交换机绑定的数据过滤设备,以使所述数据过滤设备对所述标记后的目标数据流进行处理。
结合第二方面,或者第二方面的第一种可能的实现方式,在第二方面的第二种可能的实现方式中,所述目标设备为所述至少一个边界交换机中的目标边界交换机;所述计算模块包括:
第一监听单元,用于监听预设的第一窗口内所述目标边界交换机发送的第一请求消息;
第一计算单元,用于计算所述第一请求消息的请求速率,并将计算出的所述请求速率作为所述目标边界交换机针对所述第一请求消息的当前请求速率。
结合第二方面,或者第二方面的第一种可能的实现方式,在第二方面的第三种可能的实现方式中,所述目标设备为所述控制器;所述计算模块包括:
第二监听单元,用于监听预设的第一窗口内所述SDN中每一个边界交换机发送的第一请求消息;
第二计算单元,用于分别统计得到所述第一窗口内每一个边界交换机发送的第一请求消息的请求速率;
所述第二计算单元,还用于根据每一个边界交换机的请求速率统计得到所述第一窗口内所述SDN中所有边界交换机所确定的边界网络的当前请求速率,并将所述边界网络的当前请求速率作为所述控制器针对所述第一请求消息的当前请求速率。
结合第二方面,或者第二方面的第一种可能的实现方式,或者第二方面的第二种可能的实现方式,或者第二方面的第三种可能的实现方式,在第二方面的第四种可能的实现方式中,所述异常判断模块包括:
第一判断单元,用于判断所述当前请求速率是否高于预置的与所述目标设备对应的第一阈值,其中,所述第一阈值是根据预设的第二窗口内的第一请求消息的请求速率确定出的;
第一确定单元,用于在所述第一判断单元的判断结果为高于所述第一阈值时,确定所述目标设备处于异常状态。
结合第二方面,或者第二方面的第一种可能的实现方式,或者第二方面的第二种可能的实现方式,或者第二方面的第三种可能的实现方式,或者第二方面的第四种可能的实现方式,在第二方面的第五种可能的实现方式中,所述查询模块包括:
指令发送单元,用于在所述目标设备处于异常状态时,向所述目标设备对应的边界交换机发送流表信息查询指令;
信息接收单元,用于接收所述目标设备对应的边界交换机响应所述流表信息查询指令返回的流表匹配信息;
所述攻击确定模块包括:
效率计算单元,用于以所述流表匹配信息为依据,计算所述目标设备对应的当前流表匹配效率;
第二判断单元,用于判断所述当前流表匹配效率是否超过预置的与所述目标设备对应的第二阈值,其中,所述第二阈值是根据预设的第三窗口内的流表匹配信息统计得到的流表匹配效率而确定出的;
第二确定单元,用于在所述第二判断单元的判断结果为所述当前流表匹配效率不超过所述第二阈值时,确定所述目标设备受到DDoS攻击。
结合第二方面的第五种可能的实现方式,在第二方面的第六种可能的实现方式中,所述目标设备为所述至少一个边界交换机中的目标边界交换机;所述效率计算单元具体用于:
根据所述目标边界交换机返回的流表匹配信息,计算所述流表匹配信息对应的流表匹配效率,并将计算出的所述流表匹配效率作为所述目标边界交换机的当前流表匹配效率。
结合第二方面的第五种可能的实现方式,在第二方面的第七种可能的实现方式中,所述目标设备为所述控制器,所述目标设备对应的边界交换机包括所 述SDN中的所有边界交换机;所述效率计算单元具体用于:
根据所述SDN中每一个边界交换机返回的流表匹配信息,分别计算每一个边界交换机返回的流表匹配信息对应的流表匹配效率;计算得到所述每一个边界交换机对应的流表匹配效率的平均值,并将所述平均值作为所述控制器对应的当前流表匹配效率。
结合第二方面的第五种可能的实现方式,在第二方面的第八种可能的实现方式中,所述装置还包括:
效率确定模块,用于监听所述目标设备对应的边界交换机的第二请求消息,并以所述第二请求消息为依据,计算所述目标设备对应的历史流表匹配效率,所述第二请求消息是根据预设的第三窗口内的流表匹配信息生成的;
阈值确定模块,用于根据所述目标设备对应的历史流表匹配效率,确定出所述目标设备对应的第二阈值。
结合第二方面的第八种可能的实现方式,在第二方面的第九种可能的实现方式中,所述第二请求消息包括原因信息、秒级持续时间和匹配包数;所述效率确定模块包括:
解析单元,用于解析所述原因信息;
第三确定单元,用于在所述解析单元解析结果为所述原因信息包括闲置超时信息时,将所述匹配包数与目标差值的商值作为所述目标设备对应的历史流表匹配效率,所述目标差值是所述秒级持续时间与所述闲置超时信息对应的闲置时间的差值;
所述第三确定单元,还用于在所述解析单元解析结果为所述原因信息包括硬性超时信息时,将所述匹配包数与所述秒级持续时间的商值作为所述目标设备对应的历史流表匹配效率。
结合第二方面的第一种可能的实现方式,在第二方面的第十种可能的实现方式中,所述目标设备为所述至少一个边界交换机中的目标边界交换机;所述端口确定模块具体用于:
在确定所述目标边界交换机受到DDoS攻击时,以所述第一请求消息为依据,将所述目标边界交换机的至少一个物理端口中所述第一请求消息对应的数据流密度最大的物理端口确定为目标物理端口。
结合第二方面的第一种可能的实现方式,在第二方面的第十一种可能的实现方式中,所述目标设备为所述控制器;所述端口确定模块具体用于:
在确定所述控制器受到DDoS攻击时,获取所述SDN中每一个边界交换机的当前流表匹配效率,并将所述当前流表匹配效率低于所述SDN对应的边界网络的当前流表匹配效率的边界交换机作为目标交换机,所述SDN对应的边界网络是由所述SDN中所述至少一个边界交换机所确定出的;
以所述目标交换机对应的第一请求消息为依据,将所述目标交换机的至少一个物理端口中所述第一请求消息对应的数据流密度最大的物理端口确定为目标物理端口。
结合第二方面的第一种可能的实现方式,在第二方面的第十二种可能的实现方式中,所述标记模块具体用于:
在所述目标物理端口的目标数据流对应的数据包空闲字段填写所述目标设备对应的边界交换机的硬件地址哈希Hash值;或者,
采用通用封装技术对所述目标物理端口的目标数据流进行数据包封装。
结合第二方面的第一种可能的实现方式,在第二方面的第十三种可能的实现方式中,所述装置还包括:
获取模块,用于分别获取所述SDN中的边界交换机和数据过滤设备的地址信息;
所述获取模块,还用于获取所述SDN的拓扑结构信息;
绑定确定模块,用于根据所述拓扑结构信息为所述边界交换机确定至少一个数据过滤设备,并将确定出的数据过滤设备的地址信息与所述边界交换机的地址信息绑定。
第三方面,本发明实施例提供了一种网络设备,应用于软件定义网络SDN,所述SDN包括控制器和至少一个边界交换机,包括:通信接口、存储器和处理器,所述处理器分别与所述通信接口及所述存储器连接;其中,
所述存储器用于存储驱动软件;
所述处理器从所述存储器读取所述驱动软件并在所述驱动软件的作用下执行:
通过所述通信接口监听预设的第一窗口内的第一请求消息,并计算所述 SDN中的目标设备针对所述第一请求消息的当前请求速率,所述第一请求消息为所述目标设备对应的边界交换机发送给所述控制器的需要所述控制器处理的请求数据流;
以所述当前请求速率为依据,判断所述目标设备是否处于异常状态;
若所述目标设备处于异常状态,则查询所述目标设备对应的流表匹配信息;
以所述流表匹配信息为依据,确定所述目标设备是否受到DDoS攻击。
结合第三方面,在第三方面的第一种可能的实现方式中,所述处理器从所述存储器读取所述驱动软件并在所述驱动软件的作用下,还执行以下步骤:
若确定所述目标设备受到DDoS攻击,则从所述目标设备对应的边界交换机的至少一个物理端口中确定出目标物理端口,所述目标物理端口为所述至少一个物理端口中所述第一窗口内所述第一请求消息对应的数据流密度最大的物理端口;
对所述目标物理端口传输的目标数据流进行标记,所述目标数据流为所述SDN中交换机与交换机之间的数据流;
通过所述通信接口将所述标记后的目标数据流重定向至预先与所述目标设备对应的边界交换机绑定的数据过滤设备,以使所述数据过滤设备对所述标记后的目标数据流进行处理。
结合第三方面,或者第三方面的第一种可能的实现方式,在第三方面的第二种可能的实现方式中,所述目标设备为所述至少一个边界交换机中的目标边界交换机;所述处理器在执行所述监听预设的第一窗口内的第一请求消息,并计算所述SDN中的目标设备针对所述第一请求消息的当前请求速率时,具体执行以下步骤:
监听预设的第一窗口内所述目标边界交换机发送的第一请求消息;
计算所述第一请求消息的请求速率,并将计算出的所述请求速率作为所述目标边界交换机针对所述第一请求消息的当前请求速率。
结合第三方面,或者第三方面的第一种可能的实现方式,在第三方面的第三种可能的实现方式中,所述目标设备为所述控制器;所述处理器在执行所述监听预设的第一窗口内的第一请求消息,并计算所述SDN中的目标设备针对 所述第一请求消息的当前请求速率时,具体执行以下步骤:
监听预设的第一窗口内所述SDN中每一个边界交换机发送的第一请求消息;
分别统计得到所述第一窗口内每一个边界交换机发送的第一请求消息的请求速率;
根据每一个边界交换机的请求速率统计得到所述第一窗口内所述SDN中所有边界交换机所确定的边界网络的当前请求速率,并将所述边界网络的当前请求速率作为所述控制器针对所述第一请求消息的当前请求速率。
结合第三方面,或者第三方面的第一种可能的实现方式,或者第三方面的第二种可能的实现方式,或者第三方面的第三种可能的实现方式,在第三方面的第四种可能的实现方式中,所述处理器在执行所述以所述当前请求速率为依据,判断所述目标设备是否处于异常状态时,具体执行以下步骤:
判断所述当前请求速率是否高于预置的与所述目标设备对应的第一阈值,其中,所述第一阈值是根据预设的第二窗口内的第一请求消息的请求速率确定出的;
若高于所述第一阈值,则确定所述目标设备处于异常状态。
结合第三方面,或者第三方面的第一种可能的实现方式,或者第三方面的第二种可能的实现方式,或者第三方面的第三种可能的实现方式,或者第三方面的第四种可能的实现方式,在第三方面的第五种可能的实现方式中,所述处理器在执行所述查询所述目标设备对应的流表匹配信息时,具体执行以下步骤:
通过所述通信接口向所述目标设备对应的边界交换机发送流表信息查询指令;
通过所述通信接口接收所述目标设备对应的边界交换机响应所述流表信息查询指令返回的流表匹配信息;
所述处理器在执行所述以所述流表匹配信息为依据,确定所述目标设备是否受到DDoS攻击时,具体执行以下步骤:
以所述流表匹配信息为依据,计算所述目标设备对应的当前流表匹配效率;
判断所述当前流表匹配效率是否超过预置的与所述目标设备对应的第二阈值,其中,所述第二阈值是根据预设的第三窗口内的流表匹配信息统计得到的流表匹配效率而确定出的;
若不超过所述第二阈值,则确定所述目标设备受到DDoS攻击。
结合第三方面的第五种可能的实现方式,在第三方面的第六种可能的实现方式中,所述目标设备为所述至少一个边界交换机中的目标边界交换机;所述处理器在执行所述以所述流表匹配信息为依据,计算所述目标设备对应的当前流表匹配效率时,具体执行以下步骤:
根据所述目标边界交换机返回的流表匹配信息,计算所述流表匹配信息对应的流表匹配效率,并将计算出的所述流表匹配效率作为所述目标边界交换机的当前流表匹配效率。
结合第三方面的第五种可能的实现方式,在第三方面的第七种可能的实现方式中,所述目标设备为所述控制器,所述目标设备对应的边界交换机包括所述SDN中的所有边界交换机;所述处理器在执行所述以所述流表匹配信息为依据,计算所述目标设备对应的当前流表匹配效率时,具体执行以下步骤:
根据所述SDN中每一个边界交换机返回的流表匹配信息,分别计算每一个边界交换机返回的流表匹配信息对应的流表匹配效率;
计算得到所述每一个边界交换机对应的流表匹配效率的平均值,并将所述平均值作为所述控制器对应的当前流表匹配效率。
结合第三方面的第六种可能的实现方式,或者第三方面的第七种可能的实现方式,在第三方面的第八种可能的实现方式中,所述流表匹配信息包括秒级持续时间和匹配包数;所述处理器在执行计算流表匹配信息对应的流表匹配效率时,具体执行以下步骤:
将所述匹配包数与所述秒级持续时间的商值作为所述流表匹配信息对应的流表匹配效率。
结合第三方面的第五种可能的实现方式,在第三方面的第九种可能的实现方式中,所述处理器还用于执行以下步骤:
监听所述目标设备对应的边界交换机的第二请求消息,所述第二请求消息是根据预设的第三窗口内的流表匹配信息生成的;
以所述第二请求消息为依据,计算所述目标设备对应的历史流表匹配效率;
根据所述目标设备对应的历史流表匹配效率,确定出所述目标设备对应的第二阈值。
结合第三方面的第九种可能的实现方式,在第三方面的第十种可能的实现方式中,所述第二请求消息包括原因信息、秒级持续时间和匹配包数;所述处理器在执行所述以所述第二请求消息为依据,计算所述目标设备对应的历史流表匹配效率时,具体执行以下步骤:
解析所述原因信息;
若所述原因信息包括闲置超时信息,则将所述匹配包数与目标差值的商值作为所述目标设备对应的历史流表匹配效率,所述目标差值是所述秒级持续时间与所述闲置超时信息对应的闲置时间的差值;
若所述原因信息包括硬性超时信息,则将所述匹配包数与所述秒级持续时间的商值作为所述目标设备对应的历史流表匹配效率。
结合第三方面的第一种可能的实现方式,在第三方面的第十一种可能的实现方式中,所述目标设备为所述至少一个边界交换机中的目标边界交换机;所述处理器在执行所述从所述目标设备对应的边界交换机的至少一个物理端口中确定出目标物理端口时,具体执行以下步骤:
以所述第一请求消息为依据,将所述目标边界交换机的至少一个物理端口中所述第一请求消息对应的数据流密度最大的物理端口确定为目标物理端口。
结合第三方面的第一种可能的实现方式,在第三方面的第十二种可能的实现方式中,所述目标设备为所述控制器;所述处理器在执行所述从所述目标设备对应的边界交换机的至少一个物理端口中确定出目标物理端口时,具体执行以下步骤:
获取所述SDN中每一个边界交换机的当前流表匹配效率,并将所述当前流表匹配效率低于所述SDN对应的边界网络的当前流表匹配效率的边界交换机作为目标交换机,所述SDN对应的边界网络是由所述SDN中所述至少一个边界交换机所确定出的;
以所述目标交换机对应的第一请求消息为依据,将所述目标交换机的至少 一个物理端口中所述第一请求消息对应的数据流密度最大的物理端口确定为目标物理端口。
结合第三方面的第一种可能的实现方式,在第三方面的第十三种可能的实现方式中,所述处理器在执行所述对所述目标物理端口的目标数据流进行标记时,具体执行以下步骤:
在所述目标物理端口的目标数据流对应的数据包空闲字段填写所述目标设备对应的边界交换机的硬件地址哈希Hash值;或者,
采用通用封装技术对所述目标物理端口的目标数据流进行数据包封装。
结合第三方面的第一种可能的实现方式,在第三方面的第十四种可能的实现方式中,所述处理器从所述存储器读取所述驱动软件并在所述驱动软件的作用下,还执行以下步骤:
通过所述通信接口分别获取所述SDN中的边界交换机和数据过滤设备的地址信息;
获取所述SDN的拓扑结构信息;
根据所述拓扑结构信息为所述边界交换机确定至少一个数据过滤设备,并
将确定出的数据过滤设备的地址信息与所述边界交换机的地址信息绑定。
与现有技术相比,本发明实施例具有以下有益效果:
本发明实施例可通过监听到的第一请求消息计算得到SDN网络中目标设备对应的当前请求速率,并根据该当前请求速率判断该目标设备是否处于异常状态,从而在该目标设备处于异常状态时,通过进一步查询当前流表匹配信息,实现确定该目标设备是否遭受DDoS攻击。本发明实施例的DDoS攻击检测方法无需依赖正常数据流和攻击数据流的随机性,从而提升了DDoS攻击检测的准确性,而且,本发明实施例的DDoS攻击检测方法能够检测交换机及控制器的DDoS攻击,解决了现有技术中无法检测交换机是否受到DDoS攻击的问题。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付 出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本发明实施例提供的一种SDN系统架构图;
图2是本发明实施例提供的一种DDoS攻击检测方法的流程示意图;
图3是本发明实施例提供的一种DDoS攻击防护方法的流程示意图;
图4是本发明实施例提供的一种DDoS攻击检测和防护方法的应用场景图;
图5是本发明实施例提供的一种DDoS攻击检测和防护方法的流程示意图;
图6是本发明实施例提供的另一种DDoS攻击检测和防护方法的流程示意图;
图7是本发明实施例提供的一种DDoS攻击检测装置的结构示意图;
图8是本发明实施例提供的另一种DDoS攻击检测装置的结构示意图;
图9是本发明实施例提供的一种网络设备的结构示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
应理解,本发明实施例的技术方案可具体应用于软件定义网络SDN中,具体涉及针对SDN的DDoS攻击检测方案,从而能够提升DDoS攻击检测的准确性。
下面对软件定义网络SDN的具体架构进行说明。请参见图1,图1是本发明实施例提供的一种SDN系统架构图。具体的,如图1所示,该SDN中包括控制器、至少一个边界交换机以及内部交换机。其中,该至少一个边界交换机(图1中仅示出两个)确定该SDN中的边界网络。控制器和各交换机(包括边界交换机和内部交换机)之间通过控制链路(如图中虚线所示)进行通信,包括传输交换机产生的请求数据包,以及传输控制器和交换机之间的查询与应答信息等等。此外,该各交换机之间也可通过通信链路(如图中实线所示)进 行通信,比如传输当前网络中的用户(包括攻击者)的数据流。
请参见图2,是本发明实施例的一种DDoS攻击检测方法的流程示意图,具体的,本发明实施例的所述方法可具体应用于软件定义网络SDN中,所述SDN包括控制器和至少一个边界交换机,如图2所示,本发明实施例的所述方法可以包括以下步骤:
S101:监听当前SDN中预设的第一窗口内的第一请求消息,并计算所述SDN中的目标设备针对所述第一请求消息的当前请求速率。
需要说明的是,本发明实施例的所述方法可具体应用于网络设备如该SDN中的控制器或者其他独立设置的检测设备中,本发明实施例不做限定。
其中,所述第一请求消息为所述SDN中的目标设备对应的边界交换机发送给所述控制器的需要所述控制器处理的请求数据流,如PacketIN数据流。该第一请求消息具体为该SDN中控制器和交换机之间的数据流。所述目标设备可以具体为该SDN中的控制器或者任一边界交换机,即本发明实施例能够实现对SDN网络中的控制器的DDoS攻击检测,也可以实现对该SDN中边界交换机的DDoS攻击检测,还可以实现同时对该SDN中的控制器和边界交换机的DDoS攻击进行检测。
具体的,所述第一窗口可以是指时间窗或数量窗,也即,该当前请求速率是根据当前某一时间窗内的第一请求消息计算出的,或者根据当前某一数量窗口内的第一请求消息计算出的。
可选的,所述目标设备可以为所述至少一个边界交换机中的目标边界交换机;则所述监听预设的第一窗口内的第一请求消息,并计算所述SDN中的目标设备针对所述第一请求消息的当前请求速率,可以具体为:监听预设的第一窗口内所述目标边界交换机发送的第一请求消息;计算所述第一请求消息的请求速率,并将计算出的所述请求速率作为所述目标边界交换机针对所述第一请求消息的当前请求速率。也就是说,在对边界交换机进行DDoS攻击检测时,可通过监听该SDN网络中该目标边界交换机的在当前时间窗或数量窗内发送给控制器的第一请求消息,如PacketIN消息,来计算得到该目标边界交换机在该时间窗或数量窗对该第一请求消息的请求速率即当前请求速率。其中,该 目标边界交换机可以是该SDN中的任一边界交换机。
可选的,所述目标设备还可以为该SDN网络中的控制器;则所述监听预设的第一窗口内的第一请求消息,并计算所述SDN中的目标设备针对所述第一请求消息的当前请求速率,可以具体为:监听预设的第一窗口内所述SDN中每一个边界交换机发送的第一请求消息;分别统计得到所述第一窗口内每一个边界交换机发送的第一请求消息的请求速率;根据每一个边界交换机的请求速率统计得到所述第一窗口内所述SDN中所有边界交换机所确定的边界网络的当前请求速率,并将所述边界网络的当前请求速率作为所述控制器对应的当前请求速率。也就是说,在对控制器进行DDoS攻击检测时,可通过监听该SDN网络中该每一个边界交换机的在当前时间窗或数量窗内向控制器发送的第一请求消息,如PacketIN消息,分别计算得到该每一个边界交换机在该时间窗或数量窗对该第一请求消息的请求速率,并根据每一个边界交换机的请求速率,比如将每一个边界交换机的请求速率的和作为该边界交换机对应的边界网络的当前请求速率,从而计算机到控制对应的当前请求速率(即该边界网络的当前请求速率)。
S102:以所述当前请求速率为依据,判断所述目标设备是否处于异常状态。
具体实施例中,可通过检测该目标设备的当前请求速率是否满足预设规则,来判断该目标设备是否处于异常状态。
可选的,所述以所述当前请求速率为依据,判断所述目标设备是否处于异常状态,可以具体为:判断所述当前请求速率是否高于预置的与所述目标设备对应的第一阈值;若高于所述第一阈值,则确定所述目标设备处于异常状态。其中,所述第一阈值可以是根据预设的第二窗口内的第一请求消息的请求速率确定出的。该第二窗口也可以是指时间窗或数量窗,即可通过监听一定时间窗或数量窗内的第一请求消息,并计算得到该窗口内第一请求消息对应的历史请求速率,从而根据该历史请求速率确定出该第一阈值。进一步的,该目标设备可为边界交换机或控制器,该边界交换机对应的第一阈值为根据监听到的该边界交换机在第二窗口内的第一请求消息而计算出的历史请求速率确定出的,该控制器对应的第一阈值则为根据监听到的该SDN中每一个边界交换机在第二窗口内的第一请求消息而计算出的边界网络的历史请求速率确定出的。
进一步可选的,还可预先设置为连续多次统计到第一窗口对应的当前请求速率均高于该第一阈值时,再确定该目标设备处于异常状态。具体的,可统计第一窗口对应的当前请求速率,并判断该当前请求速率是否高于预置的与所述目标设备对应的第一阈值;若高于所述第一阈值,则继续监听该第一窗口内的第一请求消息,统计该第一窗口对应的新的当前请求速率,并判断该新的当前请求速率是否高于该第一阈值;重复执行该监听该第一窗口内的第一请求消息,统计该第一窗口对应的新的当前请求速率的步骤,直至连续m次判断得到该当前请求速率高于该第一阈值,则可确定该目标设备处于异常状态。
S103:若所述目标设备处于异常状态,则查询所述目标设备对应的流表匹配信息。
具体的,所述目标设备对应的流表匹配信息可包括根据所述第一窗口内监听到的该目标设备对应的第一请求消息生成的流表匹配信息,还可以进一步包括该第一窗口前就已经存在于该目标设备对应的边界交换机内的流表匹配信息,具体可以为当前一定时间窗或数量窗的流表匹配信息。该流表匹配信息中可包括秒级持续时间duration_sec和匹配包数packet_count等字段信息。
S104:以所述流表匹配信息为依据,确定所述目标设备是否受到DDoS攻击。
具体实施例中,所述查询所述目标设备对应的流表匹配信息,可以具体为:向所述目标设备对应的边界交换机发送流表信息查询指令;接收所述目标设备对应的边界交换机响应所述流表信息查询指令返回的流表匹配信息。进一步的,所述以所述流表匹配信息为依据,确定所述目标设备是否受到DDoS攻击,可以具体为:以所述流表匹配信息为依据,计算所述目标设备对应的当前流表匹配效率;判断所述当前流表匹配效率是否超过预置的与所述目标设备对应的第二阈值;若不超过所述第二阈值,则确定所述目标设备受到DDoS攻击。
其中,所述第二阈值是根据预设的第三窗口内的流表匹配信息统计得到的流表匹配效率而确定出的。该第三窗口也可以是指时间窗口或数量窗口,即可根据一定时间窗或数量窗内的流表匹配信息确定出该第二阈值。进一步的,该目标设备可为边界交换机或控制器,该边界交换机对应的第二阈值为根据该边界交换机在第三窗口内的流表匹配信息而计算出的流表匹配效率确定出的,该 控制器对应的第二阈值则为根据该SDN中每一个边界交换机在第三窗口内的流表匹配信息而计算出的边界网络的流表匹配效率确定出的。
可选的,所述目标设备可以为所述至少一个边界交换机中的目标边界交换机;所述以所述流表匹配信息为依据,计算所述目标设备对应的当前流表匹配效率,可以具体为:根据所述目标边界交换机返回的流表匹配信息,计算所述流表匹配信息对应的流表匹配效率,并将计算出的所述流表匹配效率作为所述目标边界交换机的当前流表匹配效率。
可选的,所述目标设备还可以为所述控制器,所述目标设备对应的边界交换机包括所述SDN中的所有边界交换机;则所述以所述流表匹配信息为依据,计算所述目标设备对应的当前流表匹配效率,可以具体为:根据所述SDN中每一个边界交换机返回的流表匹配信息,分别计算每一个边界交换机返回的流表匹配信息对应的流表匹配效率;计算得到所述每一个边界交换机对应的流表匹配效率的平均值,并将所述平均值作为所述控制器对应的当前流表匹配效率。
进一步可选的,所述流表匹配信息包括秒级持续时间和匹配包数;则计算流表匹配信息对应的流表匹配效率,可以具体为:将所述匹配包数与所述秒级持续时间的商值作为所述流表匹配信息对应的流表匹配效率。
进一步的,还可根据目标设备对应的边界交换机的历史流表请求速率设置得到该第二阈值。具体的,可监听所述目标设备对应的边界交换机的第二请求消息,所述第二请求消息是根据预设的第三窗口内的流表匹配信息生成的;以所述第二请求消息为依据,计算所述目标设备对应的历史流表匹配效率;根据所述目标设备对应的历史流表匹配效率,确定出所述目标设备对应的第二阈值。具体的,所述第二请求消息可包括原因信息、秒级持续时间和匹配包数;所述以所述第二请求消息为依据,计算所述目标设备对应的历史流表匹配效率,可以具体为:解析所述原因信息;若所述原因信息包括闲置超时信息,则将所述匹配包数与目标差值的商值作为所述目标设备对应的历史流表匹配效率,所述目标差值是所述秒级持续时间与所述闲置超时信息对应的闲置时间的差值;若所述原因信息包括硬性超时信息,则将所述匹配包数与所述秒级持续时间的商值作为所述目标设备对应的历史流表匹配效率。
具体实施例中,若判断结果为该目标设备没有受到DDoS攻击,则控制器可进行常规的负载均衡优化。若判断结果为该目标设备受到DDoS攻击,则可按照预设的防护规则进一步对该DDoS攻击进行防护。
在本发明实施例中,可通过监听到的第一请求消息计算得到SDN网络中目标设备对应的当前请求速率,并根据该当前请求速率判断该目标设备是否处于异常状态,从而在该目标设备处于异常状态时,通过进一步查询当前流表匹配信息,实现确定该目标设备是否遭受DDoS攻击。本发明实施例的DDoS攻击检测方法无需依赖正常数据流和攻击数据流的随机性,从而提升了DDoS攻击检测的准确性,而且,本发明实施例的DDoS攻击检测方法能够检测交换机及控制器的DDoS攻击,解决了现有技术中无法检测交换机是否受到DDoS攻击的问题。
进一步的,在检测到当前SDN受到DDoS攻击,如SDN中的控制器或交换机受到DDoS攻击之后,则可按照预先配置的防护规则对该DDoS攻击进行防护。具体的,请参见图3,是本发明实施例的提供的一种DDoS攻击防护方法的流程示意图,如图3所示,本发明实施例的所述防护方法包括以下步骤:
S201:若确定目标设备受到DDoS攻击,则从所述目标设备对应的边界交换机的至少一个物理端口中确定出目标物理端口。
其中,每个边界交换机包括至少一个物理端口,所述目标物理端口为所述至少一个物理端口中所述第一窗口内所述第一请求消息对应的数据流密度最大的物理端口,也即该第一窗口内单位时间第一请求消息请求数量最多的物理端口。
可选的,所述目标设备可以为所述至少一个边界交换机中的目标边界交换机,即检测到该SDN网络中受到DDoS攻击的设备为边界交换机时,则所述从目标设备对应的边界交换机的至少一个物理端口中确定出目标物理端口,可以具体为:以所述第一请求消息为依据,将所述目标边界交换机的至少一个物理端口中所述第一请求消息对应的数据流密度最大的物理端口确定为目标物理端口。
可选的,所述目标设备还可以为所述SDN中的控制器,即检测到该SDN 网络中受到DDoS攻击的设备为控制器时,所述从目标设备对应的边界交换机的至少一个物理端口中确定出目标物理端口,可以具体为:获取所述SDN中每一个边界交换机的当前流表匹配效率,并将所述当前流表匹配效率低于所述SDN对应的边界网络的当前流表匹配效率的边界交换机作为目标交换机,所述SDN对应的边界网络是由所述SDN中所述至少一个边界交换机所确定出的;以所述目标交换机对应的第一请求消息为依据,将所述目标交换机的至少一个物理端口中所述第一请求消息对应的数据流密度最大的物理端口确定为目标物理端口。
S202:对所述目标物理端口传输的目标数据流进行标记。
其中,所述目标数据流可以具体为所述软件定义网络SDN中交换机与交换机之间的数据流,即该SDN网络中用户(包括攻击者)的数据流。
可选的,所述对所述目标物理端口的目标数据流进行标记,可以具体为:在所述目标物理端口的目标数据流对应的数据包空闲字段填写所述目标设备对应的边界交换机的硬件地址哈希Hash值;或者,采用通用封装技术对所述目标物理端口的目标数据流进行数据包封装。此外,还可将该标记的目标数据流的优先级设置为最高,以便于及时的将该目标数据流重定向至与目标设备绑定的数据过滤设备。
S203:将所述标记后的目标数据流重定向至预先与所述目标设备对应的边界交换机绑定的数据过滤设备,以使所述数据过滤设备对所述标记后的目标数据流进行处理。
具体实施例中,可分别获取所述SDN中的边界交换机和数据过滤设备的地址信息;获取所述SDN的拓扑结构信息;根据所述拓扑结构信息为所述边界交换机确定至少一个数据过滤设备,并将确定出的数据过滤设备的地址信息与所述边界交换机的地址信息绑定。具体的,可为每一个边界交换机绑定至少一个数据过滤设备,比如根据该SDN网络的拓扑结构和/或各个数据过滤设备的负载情况为该每一个边界交换机绑定数据过滤设备,用于当目标设备受到DDoS攻击时对该目标设备对应的边界交换机重定向的数据流进行处理,从而实现DDoS攻击防护。
进一步的,若在预设的一定时间窗(或数量窗)之后,该目标设备仍然处 于DDoS攻击状态,则可根据新接收到的第一请求消息和流表匹配信息,确定出该目标设备对应的边界交换机中的多个物理端口中除上一次确定的目标物理端口以外的该第一请求消息对应的数据流密度最大的物理端口作为新的目标物理端口,并对该新的目标物理端口的目标数据流进行标记后重定向至该绑定的数据过滤设备。以此类推,从而实现将攻击较集中的端口数据流逐步重定向至数据过滤设备,以实现DDoS攻击的防护。
当遭到DDoS攻击的目标设备在进行此次重定向防护后恢复正常状态,不再处于异常状态,则可停止攻击数据流密度最大的目标物理端口的数据流标记和重定向处理。
在本发明实施例中,可在检测到SDN网络中的目标设备如交换机或者控制器受到DDoS攻击时,通过确定出该目标设备对应的边界交换机中受到DDoS攻击的数据流密度最大的目标物理端口,并对该目标物理端口的目标数据流进行标记后重定向至该绑定的数据过滤设备,来实现对该目标设备的DDoS攻击的防护。相对于现有技术中配置多个控制器,在当前使用的控制器的数据处理量超过预设数据量阈值时,再启用其他的空闲控制器,并利用数据包报头分析的方法对超过阈值控制器收到的数据包进行攻击特征的提取,从而采取下发流表在交换机端丢弃、拦截、阻断数据流的防护方式,本发明实施例的技术方案能够通过将攻击较集中的数据流重定向至绑定的数据过滤设备,不仅能够对该目标设备的DDoS攻击进行有效防护,还解决了上述现有技术的防护方法中易造成正常数据流误伤以及流表空间溢出的问题。
请参见图4,是本发明实施例提供的一种DDoS攻击检测和防护的应用场景图。具体的,如图4所示,本发明实施例的SDN中包括控制器、边界交换机X、边界交换机Y、内部交换机以及分别与边界交换机X和Y绑定的数据过滤设备(这里假设该边界交换机X和Y绑定同一个数据过滤设备,图4中仅示出了边界交换机X与该数据过滤设备的连接关系),其中,该边界交换机X和Y确定该SDN对应的边界网络。该控制器和各交换机(包括边界交换机和内部交换机)之间通过控制链路(如图中虚线所示)进行通信,包括传输交换机产生的请求数据包,以及传输控制器和交换机之间的查询与应答信息等 等。该各交换机之间可通过通信链路(如图中实线所示)进行通信,比如传输当前网络中的用户(包括攻击者)的数据流。以下分别以目标设备为交换机和控制器为例,对本发明实施例的DDoS攻击检测和防护方法进行详细说明。
结合图4,并一并参见图5,是本发明实施例提供的一种DDoS攻击检测和防护方法的流程示意图,在本发明实施例中,该目标设备为SDN网络中的边界交换机,即需要对某一边界交换机(以下称为目标边界交换机)进行DDoS攻击检测和防护时,如图5所示,本发明实施例的DDoS攻击检测和防护方法包括:
S301:预置目标边界交换机对应的第一阈值和第二阈值。
具体实施例中,可通过监听一段时间如一周内该目标边界交换机(该目标边界交换机为SDN中的任一边界交换机,即既可以为边界交换机X,也可以为边界交换机Y,还可同时监听该边界交换机X和Y,本发明实施例以将边界交换机X作为目标边界交换机,对边界交换机X进行监听为例进行说明)发送给控制器的第一请求消息如PacketIN消息,用以计算该目标边界交换机对该PacketIN消息的历史请求速率,从而根据该历史请求速率为该目标边界交换机设置第一阈值。由于边界交换机和内部交换机都会产生源地址为自身地址的PacketIN消息,即边界交换机X只会产生源地址为自身地址的PacketIN消息,而不会产生源地址为内网交换机的地址的PacketIN消息。因此,当控制器收到PacketIN请求消息时,可通过判断该PacketIN的源地址是否为边界交换机X的地址来进行统计。具体的,当控制器监听PacketIN消息的源地址为内网交换机的地址时,则不作统计处理;当监听到的PacketIN消息的源地址为该边界交换机X的地址时,则进行统计,记录该消息的源地址、到达时间和到达数量。根据记录的该边界交换机X的PacketIN消息,可选取一个或多个预设窗口如数量窗N(第二窗口),例如N=100,计算每收到100个PacketIN消息时该边界交换机X的请求速率即历史请求速率(N/t,该t为该数量窗对应的时间,即收到该N个PacketIN消息的时间,不同窗口的t值一般不同)。也就是说,该统计的用于计算请求速率的PacketIN消息为该目标边界交换机发送给控制器的、且源地址为该目标边界交换机的PacketIN消息。进一步的,可根据一段时间内计算得到的该边界交换机X的多个历史请求速率,并结合 其硬件条件、业务特点等实际情况,来为该边界交换机X设置得到用于确定该边界交换机X是否处于异常状态对应的第一阈值。
此外,还可通过预设的第三窗口内的流表匹配信息统计得到的流表匹配效率确定出该第二阈值,比如通过监听一段时间如一周内由该边界交换机X发送给控制器的FlowRemoved流表删除消息(第二请求消息),用以计算该目标边界交换机的历史流表匹配效率,从而根据该历史流表匹配效率为该目标边界交换机设置用于确定该目标边界交换机是否处于DDoS攻击状态的第二阈值。其中,该FlowRemoved消息是根据该边界交换机X对应的流表匹配信息生成的,具体为该边界交换机X删除其内部某条数据流表时对应产生的消息。具体的,当监听到的FlowRemoved消息的源地址为内网交换机的地址时,则不提取记录该消息内容;当监听到的FlowRemoved消息的源地址为该边界交换机X的地址时,则提取该消息中的原因reason、秒级持续时间duration_sec和匹配包数packet_count字段内的信息。若原因reason字段内的信息为闲置超时IDLE_TIMEOUT,则该数据流的历史流表匹配效率的计算方法可为,流表匹配效率=匹配包数packet_count÷(秒级持续时间duration_sec-闲置时间idle time);若原因reason字段内的信息为硬性超时HARD_TIMEOUT或删除DELETE,则该数据流的流表匹配效率的计算方法可为,流表匹配效率=匹配包数packet_count÷秒级持续时间duration_sec。根据该边界交换机X在预设窗口如预设数量窗N(第三窗口)内的多个历史流表匹配效率,统计处理得到该边界交换机X的历史流表匹配效率分布,并结合其安全风险、业务特点等实际情况,则可为该边界交换机X设置得到该第二阈值。
S302:监听预设的第一窗口内所述目标边界交换机发送的第一请求消息。
S303:计算所述第一请求消息的请求速率,并将计算出的所述请求速率作为所述目标边界交换机针对所述第一请求消息的当前请求速率。
具体实施例中,可实时监听该边界交换机X发送给控制器的PacketIN消息即第一请求消息,记录该消息的源地址、到达时间和到达数量。确定预设的第一窗口如数量窗口N,比如N=100,即可在控制器每接收到100个到来自于该边界交换机X的PacketIN消息时,计算一次该边界交换机X的请求速率即当前请求速率。
S304:判断所述当前请求速率是否高于所述第一阈值。
S305:若高于所述第一阈值,则确定所述目标边界交换机处于异常状态。
具体实施例中,可在该边界交换机X的当前请求速率连续m次高于该第一阈值时将该边界交换机X的状态确定为异常状态,其中,m为大于0的整数。具体的,可将该边界交换机X的当前请求速率与该边界交换机X对应的第一阈值进行比较,若该目标边界交换机的当前请求速率高于(或等于)该第一阈值,该边界交换机X对应的计数器加一,若该边界交换机X低于该第一阈值,则将该计数器清零。当检测到该边界交换机X对应的计数器累计到m时,则可确定该目标边界交换机处于异常状态。
S306:向所述目标边界交换机发送流表信息查询指令。
S307:接收所述目标边界交换机响应所述流表信息查询指令返回的流表匹配信息,并计算所述目标边界交换机对应的当前流表匹配效率。
具体实施例中,当检测到该边界交换机X处于异常状态时,为了进一步确定该异常是由突发大业务量导致,还是由DDoS攻击导致,控制器可向处于异常状态的边界交换机X发送流表信息查询指令(该指令为OpenFlow协议规定的标准信令),用于查询其内部流表当前的匹配信息即边界交换机X对应的流表匹配信息,包括秒级持续时间duration_sec和匹配包数packet_count信息等。以确定该异常是否由攻击导致。
根据查询结果,则可计算得到当前处于异常状态的该边界交换机X的当前流表匹配效率,如:当前流表匹配效率=匹配包数packet_count÷秒级持续时间duration_sec。
S308:判断所述当前流表匹配效率是否超过所述第二阈值。
S309:若不超过所述第二阈值,则确定所述目标边界交换机受到DDoS攻击。
具体实施例中,可将计算出的该边界交换机X的当前流表匹配效率和该边界交换机X对应的第二阈值进行比较,若该当前流表匹配效率高于该第二阈值,则可表明该边界交换机X未遭到DDoS攻击,该异常可能由突发大业务量导致;若该当流表匹配效率低于或等于该第二阈值,则可表明该边界交换机X遭到DDoS攻击。
当确定该边界交换机X遭到DDoS攻击时,则可根据攻击相关检测信息,包括该m个窗口N内的PacketIN统计消息、流表匹配信息等,进一步实现DDoS攻击的防护;若未遭到DDoS攻击,则该控制器可进行常规的复杂均衡等优化。
S310:以所述第一请求消息为依据,将所述目标边界交换机的至少一个物理端口中所述第一请求消息对应的数据流密度最大的物理端口确定为目标物理端口。
其中,该目标边界交换机包括至少一个物理端口。如图4所示,假设该目标边界交换机即边界交换机X包括A、B、C和D四个物理端口。具体的,当确定该边界交换机X遭到DDoS攻击时,则可根据产生该异常告警的m个窗口N内的PacketIN统计消息,确定出该四个物理端口中PacketIN消息所占比例最大的物理端口即目标物理端口,比如为端口D。
S311:对所述目标物理端口的目标数据流进行标记。
具体实施例中,当确定出攻击数据流密度最大的目标物理端口如上述的端口D之后,控制器即可下发重定向流表指令到该边界交换机X,该流表指令对应的匹配域规则为所有由端口D进入的目标数据流(具体可以是交换机与交换机之间的数据流)的优先级为最高级,动作为对由端口D进入的数据流进行统一标记,例如在数据包空闲字段填写该边界交换机X的硬件地址哈希Hash值或采用通用封装技术进行数据包封装。此外,还可下发流表指令到该边界交换机X和与其绑定的数据过滤设备之间的交换机(若没有中间交换机则不发送该流表指令),其流表指令对应的匹配域规则为所有空闲字段为该边界交换机X的硬件地址Hash值或采用通用封装技术的数据包,优先级为最高级,动作为转发到该绑定的数据过滤设备。
S312:将所述标记后的目标数据流重定向至预先与所述目标边界交换机绑定的数据过滤设备,以使所述数据过滤设备对所述标记后的目标数据流进行处理。
具体的,在进行边界交换机X与数据过滤设备的绑定时,可根据网络部署记录或拓扑分析,获取该边界交换机X和数据过滤设备的地址信息,例如设备的硬件地址和IP地址。此外,根据该边界交换机X和数据过滤设备之间 的拓扑关系,通过最短路径或负载均衡等方法,计算该边界交换机X和数据过滤设备之间的信息交互代价,选择出信息交互代价较小(如与该边界交换机X之间路径最短、中间节点最少和/或负载较轻)的至少一个数据过滤设备,并将该选择出的数据过滤设备的地址信息与该边界交换机X进行绑定。
进一步的,可保持实时监听该目标边界交换机的攻击相关检测信息(包括PacketIN统计消息、流表匹配信息等),并根据该攻击相关检测信息确定该边界交换机X是否仍在遭受DDoS攻击。若仍遭受DDoS攻击,则可根据新的攻击相关检测信息,确定出该边界交换机X的四个物理端口中除端口D之外当前攻击数据流最为密集的物理端口,比如为端口C,并将该端口C的目标数据流重定向至该绑定的数据过滤设备。若不再受到DDoS攻击,如在进行此次重定向防护后该边界交换机X不再处于异常状态,则可停止数据流标记和重定向处理,具体可按照预设时间间隔依次删除该边界交换机X上的重定向流表指令,或者还可根据数据过滤设备进行处理后的检测结果决定是否删除该边界交换机X上的重定向流表指令。
在本发明实施例中,可通过监听到的第一请求消息计算得到SDN网络中的交换机的当前请求速率,并根据该当前请求速率判断该交换机是否处于异常状态,从而在该交换机处于异常状态时,通过进一步查询当前流表匹配信息,实现检测该交换机是否遭受DDoS攻击,而无需依赖正常数据流和攻击数据流的随机性,从而提升了DDoS攻击检测的准确性。此外,本发明实施例还解决了现有技术中无法检测交换机是否受到DDoS攻击的问题。进一步的,本发明实施例还可在检测到SDN网络中的某一交换机受到DDoS攻击时,通过确定出该交换机中受到DDoS攻击的数据流密度最大的目标物理端口,并对该目标物理端口的目标数据流进行标记后重定向至与该交换机绑定的数据过滤设备,来实现对该交换机的DDoS攻击的有效防护,并解决了现有的DDoS攻击防护中造成的正常数据流误伤以及流表空间溢出的问题。
请参见图6,是本发明实施例提供的另一种DDoS攻击检测和防护方法的流程示意图,在本发明实施例中,该目标设备为SDN网络中的控制器,即需要对控制器进行DDoS攻击检测和防护时,如图6所示,本发明实施例的DDoS 攻击检测和防护方法包括:
S401:预置控制器对应的第一阈值和第二阈值。
具体实施例中,可通过监听该SDN网络中每一个边界交换机发送给控制器的第一请求消息如PacketIN消息,用以计算该控制器对应的历史请求速率,从而根据该历史请求速率为该控制器设置第一阈值。具体的,如图4所示,可根据每一个边界交换机(包括交换机X和Y)在预设窗口如预设数量窗N(第二窗口)发送的PacketIN消息分别统计得到交换机X和Y的历史请求速率分布,将所有边界交换机即交换机X和Y的历史请求速率分布作求和处理,从而得到交换机X和Y确定的边界网络的历史请求速率分布,则可将该边界网络的历史请求速率作为该控制器对应的历史请求速率。其中,该边界交换机的历史请求速率的计算方法可参照上述实施例的相关描述,此处不再赘述。进一步的,可根据该边界网络的历史请求速率分布,结合控制器的硬件条件、网络业务特点等实际情况,来为该控制器设置得到用于确定该控制器是否处于异常状态对应的第一阈值。
此外,还可通过监听由该每一个边界交换机发送给控制器的FlowRemoved消息(第二请求消息),用以计算每一个边界交换机的历史流表匹配效率,从而根据该历史流表匹配效率为该控制器设置用于确定该控制器是否处于DDoS攻击状态的第二阈值。具体的,根据每一个边界交换机的历史流表匹配效率信息,则可统计得到每一个边界交换机的历史流表匹配效率分布,将所有边界交换机的历史匹配效率分布作平均处理,即可得到边界网络的历史流表匹配效率分布。根据边界网络的历史流表匹配效率分布,结合控制器的安全风险、业务特点等实际情况,则可为该控制器设置得到该第二阈值。其中,该边界交换机的历史流表匹配效率的计算方法可参照上述实施例的相关描述,此处不再赘述。
S402:监听预设的第一窗口内当前SDN中每一个边界交换机发送的第一请求消息。
S403:分别统计得到所述第一窗口内每一个边界交换机发送的第一请求消息的请求速率。
S404:根据每一个边界交换机的请求速率统计得到所述第一窗口内所述 SDN中所有边界交换机所确定的边界网络的当前请求速率,并将所述边界网络的当前请求速率作为所述控制器针对所述第一请求消息的当前请求速率。
具体实施例中,可实时监听该每一个边界交换机发送给控制器的PacketIN消息即第一请求消息,记录该消息的源地址、到达时间和到达数量。确定预设的第一窗口如数量窗口N,则可在控制器每接收N个到来自于该SDN中的边界交换机的PacketIN消息,即在所有边界交换机发送的PacketIN消息的和为N时,计算一次该控制器对应的当前请求速率(也即边界网络的当前请求速率)。
S405:判断所述当前请求速率是否高于所述第一阈值。
S406:若高于所述第一阈值,则确定所述控制器处于异常状态。
具体实施例中,可在该控制器对应的当前请求速率连续m次高于该控制器对应的第一阈值时将该控制器的状态确定为异常状态,其中,m为大于0的整数。具体的,可将该控制器对应的当前请求速率与该控制器对应的第一阈值进行比较,若该控制器的当前请求速率高于(或等于)该第一阈值,该控制器对应的计数器加一,若该控制器低于该第一阈值,则将该计数器清零。当检测到该控制器对应的计数器累计到m时,则可确定该控制器处于异常状态。
S407:向所述控制器对应的边界交换机发送流表信息查询指令。
S408:接收所述控制器对应的边界交换机响应所述流表信息查询指令返回的流表匹配信息,并计算所述控制器对应的当前流表匹配效率。
其中,该控制器对应的边界交换机为该SDN中的所有边界交换机。
具体实施例中,若检测到该控制器处于异常状态,则控制器可向该SDN中的每一个边界交换机(包括边界交换机X和Y)发送流表信息查询指令,用于查询其内部流表当前的匹配信息即该控制器对应的流表匹配信息,包括秒级持续时间duration_sec和匹配包数packet_count信息等,并根据查询结果计算得到该每一个边界交换机的当前流表匹配效率,如:当前流表匹配效率=匹配包数packet_count÷秒级持续时间duration_sec。并对该每一个边界交换机的当前流表匹配效率进行平均处理,得到处于异常状态的边界网络的当前流表匹配效率,则可将该边界网络的当前流表匹配效率作为该控制器对应的当前流表匹配效率。
S409:判断所述当前流表匹配效率是否超过所述第二阈值。
S410:若不超过所述第二阈值,则确定所述控制器受到DDoS攻击。
具体实施例中,可将计算出的该控制器对应的当前流表匹配效率和该控制器对应的第二阈值进行比较,若该控制器对应的当前流表匹配效率高于该第二阈值,则可表明该控制器未遭到DDoS攻击;若该当流表匹配效率低于或等于该第二阈值,则可表明该控制器遭到DDoS攻击。
当确定该控制器遭到DDoS攻击时,则可根据攻击相关检测信息,包括该m个窗口N内的PacketIN统计消息、流表匹配信息等,进一步实现DDoS攻击的防护;若未遭到DDoS攻击,则该控制器可进行常规的复杂均衡等优化。
S411:获取所述SDN中每一个边界交换机的当前流表匹配效率,并将所述当前流表匹配效率低于所述边界网络的当前流表匹配效率的边界交换机作为目标交换机。
S412:以所述目标交换机对应的第一请求消息为依据,将所述目标交换机的至少一个物理端口中所述第一请求消息对应的数据流密度最大的物理端口确定为目标物理端口。
其中,该目标交换机包括至少一个物理端口。具体的,当确定该控制器遭到DDoS攻击时,则可确定得到当前流表匹配效率低于边界网络的当前流表匹配效率(即控制器对应的当前流表匹配效率)的边界交换机即目标交换机,假设该确定出的流表匹配效率较低的目标交换机为边界交换机X,则可根据产生该异常告警的m个窗口N内的PacketIN统计消息,确定出该边界交换机X的各个物理端口中PacketIN消息所占比例最大的物理端口即目标物理端口。如图4所示,假设该边界交换机X包括A、B、C和D四个物理端口,且该确定出的目标物理端口为端口D。
S413:对所述目标物理端口的目标数据流进行标记。
具体实施例中,当确定出攻击数据流密度最大的目标物理端口如上述的端口D之后,控制器即可下发重定向流表指令到该目标交换机即边界交换机X,该流表指令对应的匹配域规则为所有由端口D进入的目标数据流(具体可以是交换机与交换机之间的数据流)的优先级为最高级,动作为对由端口D进入的数据流进行统一标记,例如在数据包空闲字段填写该边界交换机X的硬 件地址哈希Hash值或采用通用封装技术进行数据包封装。此外,还可下发流表指令到该目标交换机和与其绑定的数据过滤设备之间的交换机,其流表指令对应的匹配域规则为所有空闲字段为该目标交换机的硬件地址Hash值或采用通用封装技术的数据包,优先级为最高级,动作为转发到该绑定的数据过滤设备。
S414:将所述标记后的目标数据流重定向至预先与所述目标交换机绑定的数据过滤设备,以使所述数据过滤设备对所述标记后的目标数据流进行处理。
具体的,该目标交换机和数据过滤设备的绑定方式可参照上述实施例中的相关描述,此处不再赘述。
进一步的,可保持实时监听每一个边界交换机的攻击相关检测信息(包括PacketIN统计消息、流表匹配信息等),并根据该攻击相关检测信息确定该控制器是否仍在遭受DDoS攻击。若仍遭受DDoS攻击,则可根据新的攻击相关检测信息,确定出该流表匹配效率低于边界网络的流表匹配效率的目标交换机如边界交换机X的四个物理端口中除上一次数据流密度最大的端口D之外当前攻击数据流最为密集的物理端口,比如为端口C,并将该端口C的目标数据流重定向至该绑定的数据过滤设备。若不再受到DDoS攻击,如在进行此次重定向防护后该控制器不再处于异常状态,则可停止数据流标记和重定向处理,具体可按照预设时间间隔依次删除该边界交换机X上的重定向流表指令,或者还可根据数据过滤设备进行处理后的检测结果决定是否删除该边界交换机X上的重定向流表指令。
需要说明的是,在该SDN网络中,可预先为每一个边界交换机和控制器分别预置得到其对应的第一阈值和第二阈值,从而可同时对该每一个边界交换机和控制器进行DDoS攻击检测和防护,此处不再赘述。
在本发明实施例中,可通过监听到的第一请求消息计算得到SDN网络中控制器对应的当前请求速率,并根据该当前请求速率判断该控制器是否处于异常状态,从而在该控制器处于异常状态时,通过进一步查询当前流表匹配信息,实现检测该控制器是否遭受DDoS攻击,而无需依赖正常数据流和攻击数据流的随机性,从而提升了DDoS攻击检测的准确性。进一步的,本发明实施例还可在检测到SDN网络中的控制器受到DDoS攻击时,通过确定出该流表匹配 效率较低的目标交换机中受到DDoS攻击的数据流密度最大的目标物理端口,并对该目标物理端口的目标数据流进行标记后重定向至与该目标交换机绑定的数据过滤设备,来实现对该控制器的DDoS攻击的有效防护,并解决了现有的DDoS攻击防护中造成的正常数据流误伤以及流表空间溢出的问题。
请参见图7,是本发明实施例提供的一种DDoS攻击检测装置的结构示意图,所述装置可应用于软件定义网络SDN,所述SDN包括控制器和至少一个边界交换机。具体的,所述DDoS攻击检测装置包括计算模块11、异常判断模块12、查询模块13以及攻击确定模块14。其中,
所述计算模块11,用于监听预设的第一窗口内的第一请求消息,并计算所述SDN中的目标设备针对所述第一请求消息的当前请求速率,所述第一请求消息为所述目标设备对应的边界交换机发送给所述控制器的需要所述控制器处理的请求数据流。
需要说明的是,本发明实施例的所述装置可具体设置于网络设备如该SDN中的控制器或其他独立设置的检测设备中,本发明实施例不做限定。
其中,所述第一请求消息为所述SDN中的目标设备对应的边界交换机发送给所述控制器的需要所述控制器处理的请求数据流,如PacketIN数据流。该第一请求消息具体为该SDN中控制器和交换机之间的数据流。所述目标设备可以具体为该SDN中的控制器或者任一边界交换机,即本发明实施例能够实现对SDN网络中的控制器的DDoS攻击检测,也可以实现对该SDN中边界交换机的DDoS攻击检测,还可以实现同时对该SDN中的控制器和边界交换机的DDoS攻击进行检测。
具体的,所述第一窗口可以是指时间窗或数量窗,也即,该当前请求速率是根据当前某一时间窗内的第一请求消息计算出的,或者根据当前某一数量窗口内的第一请求消息计算出的。
所述异常判断模块12,用于以所述当前请求速率为依据,判断所述目标设备是否处于异常状态。
具体实施例中,在计算模块11计算得到该目标设备对应的当前请求速率之后,异常判断模块12可通过检测该目标设备的当前请求速率是否满足预设 规则,比如该当前请求速率是否超过某一预设的第一阈值,来判断该目标设备是否处于异常状态。
所述查询模块13,用于在所述异常判断模块12的判断结果为所述目标设备处于异常状态时,查询所述目标设备对应的流表匹配信息。
具体的,所述目标设备对应的流表匹配信息可包括根据所述第一窗口内监听到的该目标设备对应的第一请求消息生成的流表匹配信息,还可以进一步包括该第一窗口前就已经存在于该目标设备对应的边界交换机内的流表匹配信息,具体可以为当前一定时间窗或数量窗的流表匹配信息。该流表匹配信息中可包括秒级持续时间duration_sec和匹配包数packet_count等字段信息。
所述攻击确定模块14,用于以所述流表匹配信息为依据,确定所述目标设备是否受到DDoS攻击。
具体实施例中,攻击确定模块14可通过检测该查询模块13获取的流表匹配信息是否满足预设的匹配规则,比如该流表匹配信息对应的流表匹配效率是否超过某一预设的第二阈值,来确定该目标设备是否受到DDoS攻击。
进一步的,若攻击确定模块14确定该目标设备没有受到DDoS攻击,则该控制器可进行常规的负载均衡优化。若攻击确定模块14确定该目标设备受到DDoS攻击,则可按照预设的防护规则进一步对该DDoS攻击进行防护。
进一步的,请参见图8,是本发明实施例提供的另一种DDoS攻击检测装置的结构示意图,具体的,本发明实施例的所述装置包括上述的DDoS攻击检测装置的计算模块11、异常判断模块12、查询模块13以及攻击确定模块14。进一步的,在本发明实施例中,所述装置还可包括:
端口确定模块15,用于在确定所述目标设备受到DDoS攻击时,从所述目标设备对应的边界交换机的至少一个物理端口中确定出目标物理端口,所述目标物理端口为所述至少一个物理端口中所述第一窗口内所述第一请求消息对应的数据流密度最大的物理端口。
其中,每个边界交换机包括至少一个物理端口,所述目标物理端口为所述至少一个物理端口中所述第一窗口内所述第一请求消息对应的数据流密度最大的物理端口,也即该第一窗口内单位时间第一请求消息请求数量最多的物理端口。
标记模块16,用于对所述目标物理端口传输的目标数据流进行标记。
其中,所述目标数据流可以具体为所述软件定义网络SDN中交换机与交换机之间的数据流,即该SDN网络中用户(包括攻击者)的数据流。
重定向模块17,用于将所述标记后的目标数据流重定向至预先与所述目标设备对应的边界交换机绑定的数据过滤设备,以使所述数据过滤设备对所述标记后的目标数据流进行处理。
进一步的,在可选的实施例中,所述目标设备可以为所述至少一个边界交换机中的目标边界交换机;则所述计算模块11可包括(图中未示出):
第一监听单元111,用于监听预设的第一窗口内所述目标边界交换机发送的第一请求消息;
第一计算单元112,用于计算所述第一请求消息的请求速率,并将计算出的所述请求速率作为所述目标边界交换机针对所述第一请求消息的当前请求速率。
具体实施例中,第一监听单元111可实时监听该目标边界交换机发送给控制器的第一请求消息如PacketIN消息,并记录该消息的源地址、到达时间和到达数量。则第一计算单元112可在第一监听单元11监听到预设的第一窗口如数量窗口N个到来自于该目标边界交换机的PacketIN消息时,计算一次该目标边界交换机的请求速率即当前请求速率。
进一步的,在可选的实施例中,所述目标设备还可以为所述控制器;则所述计算模块11可包括(图中未示出):
第二监听单元113,用于监听预设的第一窗口内所述SDN中每一个边界交换机发送的第一请求消息;
第二计算单元114,用于分别统计得到所述第一窗口内每一个边界交换机发送的第一请求消息的请求速率;
所述第二计算单元115,还用于根据每一个边界交换机的请求速率统计得到所述第一窗口内所述SDN中所有边界交换机所确定的边界网络的当前请求速率,并将所述边界网络的当前请求速率作为所述控制器针对所述第一请求消息的当前请求速率。
具体实施例中,第二监听单元113可实时监听该SDN中的每一个边界交 换机发送给控制器的PacketIN消息即第一请求消息,记录该消息的源地址、到达时间和到达数量。第二计算单元114可在第二监听单元113每监听到预设的第一窗口如数量窗口N个到来自于该SDN中的边界交换机的PacketIN消息时,即在所有边界交换机发送的PacketIN消息的数量和为N时,计算每个边界交换机对该PacketIN消息的请求速率,并将每个边界交换机的请求速率的和作为该控制器对应的当前请求速率(也即边界网络的当前请求速率)。
进一步的,所述异常判断模块12可具体包括(图中未示出):
第一判断单元121,用于判断所述当前请求速率是否高于预置的与所述目标设备对应的第一阈值,其中,所述第一阈值是根据预设的第二窗口内的第一请求消息的请求速率确定出的;
第一确定单元122,用于在所述第一判断单元121的判断结果为高于所述第一阈值时,确定所述目标设备处于异常状态。
具体的,第一确定单元122可在该目标设备对应的当前请求速率连续m次高于该目标设备对应的第一阈值时将该目标设备的状态确定为异常状态,其中,m为大于0的整数。
进一步的,所述查询模块13可具体包括(图中未示出):
指令发送单元131,用于在所述目标设备处于异常状态时,向所述目标设备对应的边界交换机发送流表信息查询指令;
信息接收单元132,用于接收所述目标设备对应的边界交换机响应所述流表信息查询指令返回的流表匹配信息;
所述攻击确定模块14可具体包括(图中未示出):
效率计算单元141,用于以所述流表匹配信息为依据,计算所述目标设备对应的当前流表匹配效率;
第二判断单元142,用于判断所述当前流表匹配效率是否超过预置的与所述目标设备对应的第二阈值,其中,所述第二阈值是根据预设的第三窗口内的流表匹配信息统计得到的流表匹配效率而确定出的;
第二确定单元143,用于在所述第二判断单元142的判断结果为所述当前流表匹配效率不超过所述第二阈值时,确定所述目标设备受到DDoS攻击。
进一步的,在可选的实施例中,所述目标设备可以为所述至少一个边界交 换机中的目标边界交换机;所述效率计算单元141可具体用于:
根据所述目标边界交换机返回的流表匹配信息,计算所述流表匹配信息对应的流表匹配效率,并将计算出的所述流表匹配效率作为所述目标边界交换机的当前流表匹配效率。
所述端口确定模块15可具体用于:
在确定所述目标边界交换机受到DDoS攻击时,以所述第一请求消息为依据,将所述目标边界交换机的至少一个物理端口中所述第一请求消息对应的数据流密度最大的物理端口确定为目标物理端口。
其中,该目标边界交换机包括至少一个物理端口。具体的,当攻击确定模块14确定该目标边界交换机遭到DDoS攻击时,则端口确定模块15可根据产生该异常告警的m个窗口N内的PacketIN统计消息,确定出该至少一个物理端口中PacketIN消息所占比例最大的物理端口作为目标物理端口。
进一步的,在可选的实施例中,所述目标设备还可以为所述控制器,所述目标设备对应的边界交换机包括所述SDN中的所有边界交换机;所述效率计算单元141还可具体用于:
根据所述SDN中每一个边界交换机返回的流表匹配信息,分别计算每一个边界交换机返回的流表匹配信息对应的流表匹配效率;计算得到所述每一个边界交换机对应的流表匹配效率的平均值,并将所述平均值作为所述控制器对应的当前流表匹配效率。
所述端口确定模块15可具体用于:
在确定所述控制器受到DDoS攻击时,获取所述SDN中每一个边界交换机的当前流表匹配效率,并将所述当前流表匹配效率低于所述SDN对应的边界网络的当前流表匹配效率的边界交换机作为目标交换机,所述SDN对应的边界网络是由所述SDN中所述至少一个边界交换机所确定出的;
以所述目标交换机对应的第一请求消息为依据,将所述目标交换机的至少一个物理端口中所述第一请求消息对应的数据流密度最大的物理端口确定为目标物理端口。
其中,该目标交换机包括至少一个物理端口。具体的,当攻击确定模块14确定该控制器遭到DDoS攻击时,则端口确定模块15可确定得到当前流表 匹配效率低于边界网络的当前流表匹配效率(即控制器对应的当前流表匹配效率)的边界交换机即目标交换机,并可根据产生该异常告警的m个窗口N内的PacketIN统计消息,确定出该目标交换机的各个物理端口中PacketIN消息所占比例最大的物理端口作为目标物理端口。
进一步可选的,所述标记模块16可具体用于:
在所述目标物理端口的目标数据流对应的数据包空闲字段填写所述目标设备对应的边界交换机的硬件地址哈希Hash值;或者,
采用通用封装技术对所述目标物理端口的目标数据流进行数据包封装。
进一步的,在可选的实施例中,所述装置还包括(图中未示出):
效率确定模块18,用于监听所述目标设备对应的边界交换机的第二请求消息,并以所述第二请求消息为依据,计算所述目标设备对应的历史流表匹配效率,所述第二请求消息是根据预设的第三窗口内的流表匹配信息生成的;
阈值确定模块19,用于根据所述目标设备对应的历史流表匹配效率,确定出所述目标设备对应的第二阈值。
进一步可选的,所述第二请求消息包括原因信息、秒级持续时间和匹配包数;所述效率确定模块18可包括(图中未示出):
解析单元181,用于解析所述原因信息;
第三确定单元182,用于在所述解析单元181解析结果为所述原因信息包括闲置超时信息时,将所述匹配包数与目标差值的商值作为所述目标设备对应的历史流表匹配效率,所述目标差值是所述秒级持续时间与所述闲置超时信息对应的闲置时间的差值;
所述第三确定单元182,还用于在所述解析单元181解析结果为所述原因信息包括硬性超时信息时,将所述匹配包数与所述秒级持续时间的商值作为所述目标设备对应的历史流表匹配效率。
进一步的,在可选的实施例中,所述装置还可包括(图中未示出):
获取模块20,用于分别获取所述SDN中的边界交换机和数据过滤设备的地址信息;
所述获取模块20,还用于获取所述SDN的拓扑结构信息;
绑定确定模块21,用于根据所述拓扑结构信息为所述边界交换机确定至 少一个数据过滤设备,并将确定出的数据过滤设备的地址信息与所述边界交换机的地址信息绑定。
具体的,在进行边界交换机与数据过滤设备的绑定时,获取模块20可根据网络部署记录或拓扑分析,获取该边界交换机和数据过滤设备的地址信息,例如设备的硬件地址和IP地址。此外,绑定确定模块21还可根据该边界交换机和数据过滤设备之间的拓扑关系,通过最短路径或负载均衡等方法,计算该边界交换机和数据过滤设备之间的信息交互代价,选择出信息交互代价较小(如与该边界交换机之间路径最短、中间节点最少和/或负载较轻)的至少一个数据过滤设备,并将该选择出的数据过滤设备的地址信息与该边界交换机X进行绑定。
在本发明实施例中,可通过监听到的第一请求消息计算得到SDN网络中目标设备对应的当前请求速率,并根据该当前请求速率判断该目标设备是否处于异常状态,从而在该目标设备处于异常状态时,通过进一步查询当前流表匹配信息,实现确定该目标设备是否遭受DDoS攻击。本发明实施例的DDoS攻击检测方法无需依赖正常数据流和攻击数据流的随机性,从而提升了DDoS攻击检测的准确性,而且,本发明实施例的DDoS攻击检测方法能够检测交换机及控制器的DDoS攻击,解决了现有技术中无法检测交换机是否受到DDoS攻击的问题。进一步的,当检测到SDN网络中的目标设备如交换机或者控制器受到DDoS攻击时,通过确定出该目标设备对应的边界交换机受到DDoS攻击的数据流密度最大的目标物理端口,并对该目标物理端口的目标数据流进行标记后重定向至该绑定的数据过滤设备,使得能够实现对该目标设备的DDoS攻击的防护。相对于现有技术中配置多个控制器,在当前使用的控制器的数据处理量超过预设数据量阈值时,再启用其他的空闲控制器,并利用数据包报头分析的方法对超过阈值控制器收到的数据包进行攻击特征的提取,从而采取下发流表在交换机端丢弃、拦截、阻断数据流的防护方式,本发明实施例的技术方案能够通过将攻击较集中的数据流重定向至绑定的数据过滤设备,不仅能够对该目标设备的DDoS攻击进行有效防护,还解决了上述现有技术的防护方法中易造成正常数据流误伤以及流表空间溢出的问题。
进一步的,请参见图9,是本发明实施例提供的一种网络设备的结构示意图,该网络设备可应用于软件定义网络SDN,所述SDN包括控制器和至少一个边界交换机。具体的,本发明实施例的所述网络设备包括:通信接口300、存储器200和处理器100,所述处理器100分别与所述通信接口300及所述存储器200连接。所述存储器200可以是高速RAM存储器,也可以是非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器。所述通信接口300、存储器200以及处理器100之间可以通过总线进行数据连接,也可以通过其他方式数据连接。本实施例中以总线连接进行说明。其中,
所述存储器200用于存储驱动软件;
所述处理器100从所述存储器200读取所述驱动软件并在所述驱动软件的作用下执行:
通过所述通信接口300监听预设的第一窗口内的第一请求消息,并计算所述SDN中的目标设备针对所述第一请求消息的当前请求速率,所述第一请求消息为所述目标设备对应的边界交换机发送给所述控制器的需要所述控制器处理的请求数据流;
以所述当前请求速率为依据,判断所述目标设备是否处于异常状态;
若所述目标设备处于异常状态,则查询所述目标设备对应的流表匹配信息;
以所述流表匹配信息为依据,确定所述目标设备是否受到DDoS攻击。
需要说明的是,本发明实施例的所述网络设备可以具体为该SDN中的控制器或者其他独立设置的检测设备。
进一步的,所述处理器100从所述存储器读取所述驱动软件并在所述驱动软件的作用下,还执行以下步骤:
若确定所述目标设备受到DDoS攻击,则从所述目标设备对应的边界交换机的至少一个物理端口中确定出目标物理端口,所述目标物理端口为所述至少一个物理端口中所述第一窗口内所述第一请求消息对应的数据流密度最大的物理端口;
对所述目标物理端口传输的目标数据流进行标记,所述目标数据流为所述SDN中交换机与交换机之间的数据流;
通过所述通信接口300将所述标记后的目标数据流重定向至预先与所述目标设备对应的边界交换机绑定的数据过滤设备,以使所述数据过滤设备对所述标记后的目标数据流进行处理。
可选的,所述目标设备为所述至少一个边界交换机中的目标边界交换机;所述处理器100在执行所述监听预设的第一窗口内的第一请求消息,并计算所述SDN中的目标设备针对所述第一请求消息的当前请求速率时,具体执行以下步骤:
监听预设的第一窗口内所述目标边界交换机发送的第一请求消息;
计算所述第一请求消息的请求速率,并将计算出的所述请求速率作为所述目标边界交换机针对所述第一请求消息的当前请求速率。
可选的,所述目标设备为所述控制器;所述处理器100在执行所述监听预设的第一窗口内的第一请求消息,并计算所述SDN中的目标设备针对所述第一请求消息的当前请求速率时,具体执行以下步骤:
监听预设的第一窗口内所述SDN中每一个边界交换机发送的第一请求消息;
分别统计得到所述第一窗口内每一个边界交换机发送的第一请求消息的请求速率;
根据每一个边界交换机的请求速率统计得到所述第一窗口内所述SDN中所有边界交换机所确定的边界网络的当前请求速率,并将所述边界网络的当前请求速率作为所述控制器针对所述第一请求消息的当前请求速率。
进一步的,所述处理器100在执行所述以所述当前请求速率为依据,判断所述目标设备是否处于异常状态时,具体执行以下步骤:
判断所述当前请求速率是否高于预置的与所述目标设备对应的第一阈值,其中,所述第一阈值是根据预设的第二窗口内的第一请求消息的请求速率确定出的;
若高于所述第一阈值,则确定所述目标设备处于异常状态。
进一步可选的,所述处理器100在执行所述查询所述目标设备对应的流表匹配信息时,具体执行以下步骤:
通过所述通信接口300向所述目标设备对应的边界交换机发送流表信息 查询指令;
通过所述通信接口300接收所述目标设备对应的边界交换机响应所述流表信息查询指令返回的流表匹配信息;
所述处理器100在执行所述以所述流表匹配信息为依据,确定所述目标设备是否受到DDoS攻击时,具体执行以下步骤:
以所述流表匹配信息为依据,计算所述目标设备对应的当前流表匹配效率;
判断所述当前流表匹配效率是否超过预置的与所述目标设备对应的第二阈值,其中,所述第二阈值是根据预设的第三窗口内的流表匹配信息统计得到的流表匹配效率而确定出的;
若不超过所述第二阈值,则确定所述目标设备受到DDoS攻击。
可选的,所述目标设备为所述至少一个边界交换机中的目标边界交换机;所述处理器100在执行所述以所述流表匹配信息为依据,计算所述目标设备对应的当前流表匹配效率时,具体执行以下步骤:
根据所述目标边界交换机返回的流表匹配信息,计算所述流表匹配信息对应的流表匹配效率,并将计算出的所述流表匹配效率作为所述目标边界交换机的当前流表匹配效率。
可选的,所述目标设备为所述控制器,所述目标设备对应的边界交换机包括所述SDN中的所有边界交换机;所述处理器100在执行所述以所述流表匹配信息为依据,计算所述目标设备对应的当前流表匹配效率时,具体执行以下步骤:
根据所述SDN中每一个边界交换机返回的流表匹配信息,分别计算每一个边界交换机返回的流表匹配信息对应的流表匹配效率;
计算得到所述每一个边界交换机对应的流表匹配效率的平均值,并将所述平均值作为所述控制器对应的当前流表匹配效率。
进一步可选的,所述流表匹配信息包括秒级持续时间和匹配包数;所述处理器100在执行计算流表匹配信息对应的流表匹配效率时,具体执行以下步骤:
将所述匹配包数与所述秒级持续时间的商值作为所述流表匹配信息对应 的流表匹配效率。
进一步的,所述处理器100还用于执行以下步骤:
监听所述目标设备对应的边界交换机的第二请求消息,所述第二请求消息是根据预设的第三窗口内的流表匹配信息生成的;
以所述第二请求消息为依据,计算所述目标设备对应的历史流表匹配效率;
根据所述目标设备对应的历史流表匹配效率,确定出所述目标设备对应的第二阈值。
进一步可选的,所述第二请求消息包括原因信息、秒级持续时间和匹配包数;所述处理器100在执行所述以所述第二请求消息为依据,计算所述目标设备对应的历史流表匹配效率时,具体执行以下步骤:
解析所述原因信息;
若所述原因信息包括闲置超时信息,则将所述匹配包数与目标差值的商值作为所述目标设备对应的历史流表匹配效率,所述目标差值是所述秒级持续时间与所述闲置超时信息对应的闲置时间的差值;
若所述原因信息包括硬性超时信息,则将所述匹配包数与所述秒级持续时间的商值作为所述目标设备对应的历史流表匹配效率。
可选的,所述目标设备为所述至少一个边界交换机中的目标边界交换机;所述处理器100在执行所述从所述目标设备对应的边界交换机的至少一个物理端口中确定出目标物理端口时,具体执行以下步骤:
以所述第一请求消息为依据,将所述目标边界交换机的至少一个物理端口中所述第一请求消息对应的数据流密度最大的物理端口确定为目标物理端口。
可选的,所述目标设备为所述控制器;所述处理器100在执行所述从所述目标设备对应的边界交换机的至少一个物理端口中确定出目标物理端口时,具体执行以下步骤:
获取所述SDN中每一个边界交换机的当前流表匹配效率,并将所述当前流表匹配效率低于所述SDN对应的边界网络的当前流表匹配效率的边界交换机作为目标交换机,所述SDN对应的边界网络是由所述SDN中所述至少一个边界交换机所确定出的;
以所述目标交换机对应的第一请求消息为依据,将所述目标交换机的至少一个物理端口中所述第一请求消息对应的数据流密度最大的物理端口确定为目标物理端口。
进一步可选的,所述处理器100在执行所述对所述目标物理端口的目标数据流进行标记时,具体执行以下步骤:
在所述目标物理端口的目标数据流对应的数据包空闲字段填写所述目标设备对应的边界交换机的硬件地址哈希Hash值;或者,
采用通用封装技术对所述目标物理端口的目标数据流进行数据包封装。
进一步的,所述处理器100从所述存储器读取所述驱动软件并在所述驱动软件的作用下,还执行以下步骤:
通过所述通信接口300分别获取所述SDN中的边界交换机和数据过滤设备的地址信息;
获取所述SDN的拓扑结构信息;
根据所述拓扑结构信息为所述边界交换机确定至少一个数据过滤设备,并
将确定出的数据过滤设备的地址信息与所述边界交换机的地址信息绑定。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
在本发明所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述该作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中, 也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。
上述以软件功能单元的形式实现的集成的单元,可以存储在一个计算机可读取存储介质中。上述软件功能单元存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本发明各个实施例所述方法的部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
本领域技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的装置的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。

Claims (44)

  1. 一种分布式拒绝服务DDoS攻击检测方法,应用于软件定义网络SDN中,所述SDN包括控制器和至少一个边界交换机,其特征在于,包括:
    监听预设的第一窗口内的第一请求消息,并计算所述SDN中的目标设备针对所述第一请求消息的当前请求速率,所述第一请求消息为所述目标设备对应的边界交换机发送给所述控制器的需要所述控制器处理的请求数据流;
    以所述当前请求速率为依据,判断所述目标设备是否处于异常状态;
    若所述目标设备处于异常状态,则查询所述目标设备对应的流表匹配信息;
    以所述流表匹配信息为依据,确定所述目标设备是否受到DDoS攻击。
  2. 根据权利要求1所述的方法,其特征在于,在所述方法还包括:
    若确定所述目标设备受到DDoS攻击,则从所述目标设备对应的边界交换机的至少一个物理端口中确定出目标物理端口,所述目标物理端口为所述至少一个物理端口中所述第一窗口内所述第一请求消息对应的数据流密度最大的物理端口;
    对所述目标物理端口传输的目标数据流进行标记,所述目标数据流为所述SDN中交换机与交换机之间的数据流;
    将所述标记后的目标数据流重定向至预先与所述目标设备对应的边界交换机绑定的数据过滤设备,以使所述数据过滤设备对所述标记后的目标数据流进行处理。
  3. 根据权利要求1或2所述的方法,其特征在于,所述目标设备为所述至少一个边界交换机中的目标边界交换机;所述监听预设的第一窗口内的第一请求消息,并计算所述SDN中的目标设备针对所述第一请求消息的当前请求速率,包括:
    监听预设的第一窗口内所述目标边界交换机发送的第一请求消息;
    计算所述第一请求消息的请求速率,并将计算出的所述请求速率作为所述 目标边界交换机针对所述第一请求消息的当前请求速率。
  4. 根据权利要求1或2所述的方法,其特征在于,所述目标设备为所述控制器;所述监听预设的第一窗口内的第一请求消息,并计算所述SDN中的目标设备针对所述第一请求消息的当前请求速率,包括:
    监听预设的第一窗口内所述SDN中每一个边界交换机发送的第一请求消息;
    分别统计得到所述第一窗口内每一个边界交换机发送的第一请求消息的请求速率;
    根据每一个边界交换机的请求速率统计得到所述第一窗口内所述SDN中所有边界交换机所确定的边界网络的当前请求速率,并将所述边界网络的当前请求速率作为所述控制器针对所述第一请求消息的当前请求速率。
  5. 根据权利要求1-4任一项所述的方法,其特征在于,所述以所述当前请求速率为依据,判断所述目标设备是否处于异常状态,包括:
    判断所述当前请求速率是否高于预置的与所述目标设备对应的第一阈值,其中,所述第一阈值是根据预设的第二窗口内的第一请求消息的请求速率确定出的;
    若高于所述第一阈值,则确定所述目标设备处于异常状态。
  6. 根据权利要求1-5任一项所述的方法,其特征在于,所述查询所述目标设备对应的流表匹配信息,包括:
    向所述目标设备对应的边界交换机发送流表信息查询指令;
    接收所述目标设备对应的边界交换机响应所述流表信息查询指令返回的流表匹配信息;
    所述以所述流表匹配信息为依据,确定所述目标设备是否受到DDoS攻击,包括:
    以所述流表匹配信息为依据,计算所述目标设备对应的当前流表匹配效率;
    判断所述当前流表匹配效率是否超过预置的与所述目标设备对应的第二阈值,其中,所述第二阈值是根据预设的第三窗口内的流表匹配信息统计得到的流表匹配效率而确定出的;
    若不超过所述第二阈值,则确定所述目标设备受到DDoS攻击。
  7. 根据权利要求6所述的方法,其特征在于,所述目标设备为所述至少一个边界交换机中的目标边界交换机;所述以所述流表匹配信息为依据,计算所述目标设备对应的当前流表匹配效率,包括:
    根据所述目标边界交换机返回的流表匹配信息,计算所述流表匹配信息对应的流表匹配效率,并将计算出的所述流表匹配效率作为所述目标边界交换机的当前流表匹配效率。
  8. 根据权利要求6所述的方法,其特征在于,所述目标设备为所述控制器,所述目标设备对应的边界交换机包括所述SDN中的所有边界交换机;所述以所述流表匹配信息为依据,计算所述目标设备对应的当前流表匹配效率,包括:
    根据所述SDN中每一个边界交换机返回的流表匹配信息,分别计算每一个边界交换机返回的流表匹配信息对应的流表匹配效率;
    计算得到所述每一个边界交换机对应的流表匹配效率的平均值,并将所述平均值作为所述控制器对应的当前流表匹配效率。
  9. 根据权利要求7或8所述的方法,其特征在于,所述流表匹配信息包括秒级持续时间和匹配包数;所述计算流表匹配信息对应的流表匹配效率,包括:
    将所述匹配包数与所述秒级持续时间的商值作为所述流表匹配信息对应的流表匹配效率。
  10. 根据权利要求6所述的方法,其特征在于,所述方法还包括:
    监听所述目标设备对应的边界交换机的第二请求消息,所述第二请求消息 是根据预设的第三窗口内的流表匹配信息生成的;
    以所述第二请求消息为依据,计算所述目标设备对应的历史流表匹配效率;
    根据所述目标设备对应的历史流表匹配效率,确定出所述目标设备对应的第二阈值。
  11. 根据权利要求10所述的方法,其特征在于,所述第二请求消息包括原因信息、秒级持续时间和匹配包数;所述以所述第二请求消息为依据,计算所述目标设备对应的历史流表匹配效率,包括:
    解析所述原因信息;
    若所述原因信息包括闲置超时信息,则将所述匹配包数与目标差值的商值作为所述目标设备对应的历史流表匹配效率,所述目标差值是所述秒级持续时间与所述闲置超时信息对应的闲置时间的差值;
    若所述原因信息包括硬性超时信息,则将所述匹配包数与所述秒级持续时间的商值作为所述目标设备对应的历史流表匹配效率。
  12. 根据权利要求2所述的方法,其特征在于,所述目标设备为所述至少一个边界交换机中的目标边界交换机;所述从所述目标设备对应的边界交换机的至少一个物理端口中确定出目标物理端口,包括:
    以所述第一请求消息为依据,将所述目标边界交换机的至少一个物理端口中所述第一请求消息对应的数据流密度最大的物理端口确定为目标物理端口。
  13. 根据权利要求2所述的方法,其特征在于,所述目标设备为所述控制器;所述从所述目标设备对应的边界交换机的至少一个物理端口中确定出目标物理端口,包括:
    获取所述SDN中每一个边界交换机的当前流表匹配效率,并将所述当前流表匹配效率低于所述SDN对应的边界网络的当前流表匹配效率的边界交换机作为目标交换机,所述SDN对应的边界网络是由所述SDN中所述至少一个边界交换机所确定出的;
    以所述目标交换机对应的第一请求消息为依据,将所述目标交换机的至少一个物理端口中所述第一请求消息对应的数据流密度最大的物理端口确定为目标物理端口。
  14. 根据权利要求2所述的方法,其特征在于,所述对所述目标物理端口的目标数据流进行标记,包括:
    在所述目标物理端口的目标数据流对应的数据包空闲字段填写所述目标设备对应的边界交换机的硬件地址哈希Hash值;或者,
    采用通用封装技术对所述目标物理端口的目标数据流进行数据包封装。
  15. 根据权利要求2所述的方法,其特征在于,所述方法还包括:
    分别获取所述SDN中的边界交换机和数据过滤设备的地址信息;
    获取所述SDN的拓扑结构信息;
    根据所述拓扑结构信息为所述边界交换机确定至少一个数据过滤设备,并将确定出的数据过滤设备的地址信息与所述边界交换机的地址信息绑定。
  16. 一种分布式拒绝服务DDoS攻击检测装置,应用于软件定义网络SDN,所述SDN包括控制器和至少一个边界交换机,其特征在于,包括:
    计算模块,用于监听预设的第一窗口内的第一请求消息,并计算所述SDN中的目标设备针对所述第一请求消息的当前请求速率,所述第一请求消息为所述目标设备对应的边界交换机发送给所述控制器的需要所述控制器处理的请求数据流;
    异常判断模块,用于以所述当前请求速率为依据,判断所述目标设备是否处于异常状态;
    查询模块,用于在所述异常判断模块的判断结果为所述目标设备处于异常状态时,查询所述目标设备对应的流表匹配信息;
    攻击确定模块,用于以所述流表匹配信息为依据,确定所述目标设备是否受到DDoS攻击。
  17. 根据权利要求16所述的装置,其特征在于,所述装置还包括:
    端口确定模块,用于在确定所述目标设备受到DDoS攻击时,从所述目标设备对应的边界交换机的至少一个物理端口中确定出目标物理端口,所述目标物理端口为所述至少一个物理端口中所述第一窗口内所述第一请求消息对应的数据流密度最大的物理端口;
    标记模块,用于对所述目标物理端口传输的目标数据流进行标记,所述目标数据流为所述SDN中交换机与交换机之间的数据流;
    重定向模块,用于将所述标记后的目标数据流重定向至预先与所述目标设备对应的边界交换机绑定的数据过滤设备,以使所述数据过滤设备对所述标记后的目标数据流进行处理。
  18. 根据权利要求16或17所述的装置,其特征在于,所述目标设备为所述至少一个边界交换机中的目标边界交换机;所述计算模块包括:
    第一监听单元,用于监听预设的第一窗口内所述目标边界交换机发送的第一请求消息;
    第一计算单元,用于计算所述第一请求消息的请求速率,并将计算出的所述请求速率作为所述目标边界交换机针对所述第一请求消息的当前请求速率。
  19. 根据权利要求16或17所述的装置,其特征在于,所述目标设备为所述控制器;所述计算模块包括:
    第二监听单元,用于监听预设的第一窗口内所述SDN中每一个边界交换机发送的第一请求消息;
    第二计算单元,用于分别统计得到所述第一窗口内每一个边界交换机发送的第一请求消息的请求速率;
    所述第二计算单元,还用于根据每一个边界交换机的请求速率统计得到所述第一窗口内所述SDN中所有边界交换机所确定的边界网络的当前请求速率,并将所述边界网络的当前请求速率作为所述控制器针对所述第一请求消息的当前请求速率。
  20. 根据权利要求16-19任一项所述的装置,其特征在于,所述异常判断模块包括:
    第一判断单元,用于判断所述当前请求速率是否高于预置的与所述目标设备对应的第一阈值,其中,所述第一阈值是根据预设的第二窗口内的第一请求消息的请求速率确定出的;
    第一确定单元,用于在所述第一判断单元的判断结果为高于所述第一阈值时,确定所述目标设备处于异常状态。
  21. 根据权利要求16-20任一项所述的装置,其特征在于,所述查询模块包括:
    指令发送单元,用于在所述目标设备处于异常状态时,向所述目标设备对应的边界交换机发送流表信息查询指令;
    信息接收单元,用于接收所述目标设备对应的边界交换机响应所述流表信息查询指令返回的流表匹配信息;
    所述攻击确定模块包括:
    效率计算单元,用于以所述流表匹配信息为依据,计算所述目标设备对应的当前流表匹配效率;
    第二判断单元,用于判断所述当前流表匹配效率是否超过预置的与所述目标设备对应的第二阈值,其中,所述第二阈值是根据预设的第三窗口内的流表匹配信息统计得到的流表匹配效率而确定出的;
    第二确定单元,用于在所述第二判断单元的判断结果为所述当前流表匹配效率不超过所述第二阈值时,确定所述目标设备受到DDoS攻击。
  22. 根据权利要求21所述的装置,其特征在于,所述目标设备为所述至少一个边界交换机中的目标边界交换机;所述效率计算单元具体用于:
    根据所述目标边界交换机返回的流表匹配信息,计算所述流表匹配信息对应的流表匹配效率,并将计算出的所述流表匹配效率作为所述目标边界交换机的当前流表匹配效率。
  23. 根据权利要求21所述的装置,其特征在于,所述目标设备为所述控制器,所述目标设备对应的边界交换机包括所述SDN中的所有边界交换机;所述效率计算单元具体用于:
    根据所述SDN中每一个边界交换机返回的流表匹配信息,分别计算每一个边界交换机返回的流表匹配信息对应的流表匹配效率;计算得到所述每一个边界交换机对应的流表匹配效率的平均值,并将所述平均值作为所述控制器对应的当前流表匹配效率。
  24. 根据权利要求21所述的装置,其特征在于,所述装置还包括:
    效率确定模块,用于监听所述目标设备对应的边界交换机的第二请求消息,并以所述第二请求消息为依据,计算所述目标设备对应的历史流表匹配效率,所述第二请求消息是根据预设的第三窗口内的流表匹配信息生成的;
    阈值确定模块,用于根据所述目标设备对应的历史流表匹配效率,确定出所述目标设备对应的第二阈值。
  25. 根据权利要求24所述的装置,其特征在于,所述第二请求消息包括原因信息、秒级持续时间和匹配包数;所述效率确定模块包括:
    解析单元,用于解析所述原因信息;
    第三确定单元,用于在所述解析单元解析结果为所述原因信息包括闲置超时信息时,将所述匹配包数与目标差值的商值作为所述目标设备对应的历史流表匹配效率,所述目标差值是所述秒级持续时间与所述闲置超时信息对应的闲置时间的差值;
    所述第三确定单元,还用于在所述解析单元解析结果为所述原因信息包括硬性超时信息时,将所述匹配包数与所述秒级持续时间的商值作为所述目标设备对应的历史流表匹配效率。
  26. 根据权利要求17所述的装置,其特征在于,所述目标设备为所述至少一个边界交换机中的目标边界交换机;所述端口确定模块具体用于:
    在确定所述目标边界交换机受到DDoS攻击时,以所述第一请求消息为依 据,将所述目标边界交换机的至少一个物理端口中所述第一请求消息对应的数据流密度最大的物理端口确定为目标物理端口。
  27. 根据权利要求17所述的装置,其特征在于,所述目标设备为所述控制器;所述端口确定模块具体用于:
    在确定所述控制器受到DDoS攻击时,获取所述SDN中每一个边界交换机的当前流表匹配效率,并将所述当前流表匹配效率低于所述SDN对应的边界网络的当前流表匹配效率的边界交换机作为目标交换机,所述SDN对应的边界网络是由所述SDN中所述至少一个边界交换机所确定出的;
    以所述目标交换机对应的第一请求消息为依据,将所述目标交换机的至少一个物理端口中所述第一请求消息对应的数据流密度最大的物理端口确定为目标物理端口。
  28. 根据权利要求17所述的装置,其特征在于,所述标记模块具体用于:
    在所述目标物理端口的目标数据流对应的数据包空闲字段填写所述目标设备对应的边界交换机的硬件地址哈希Hash值;或者,
    采用通用封装技术对所述目标物理端口的目标数据流进行数据包封装。
  29. 根据权利要求17所述的装置,其特征在于,所述装置还包括:
    获取模块,用于分别获取所述SDN中的边界交换机和数据过滤设备的地址信息;
    所述获取模块,还用于获取所述SDN的拓扑结构信息;
    绑定确定模块,用于根据所述拓扑结构信息为所述边界交换机确定至少一个数据过滤设备,并将确定出的数据过滤设备的地址信息与所述边界交换机的地址信息绑定。
  30. 一种网络设备,应用于软件定义网络SDN,所述SDN包括控制器和至少一个边界交换机,其特征在于,包括:通信接口、存储器和处理器,所述处理器分别与所述通信接口及所述存储器连接;其中,
    所述存储器用于存储驱动软件;
    所述处理器从所述存储器读取所述驱动软件并在所述驱动软件的作用下执行:
    通过所述通信接口监听预设的第一窗口内的第一请求消息,并计算所述SDN中的目标设备针对所述第一请求消息的当前请求速率,所述第一请求消息为所述目标设备对应的边界交换机发送给所述控制器的需要所述控制器处理的请求数据流;
    以所述当前请求速率为依据,判断所述目标设备是否处于异常状态;
    若所述目标设备处于异常状态,则查询所述目标设备对应的流表匹配信息;
    以所述流表匹配信息为依据,确定所述目标设备是否受到DDoS攻击。
  31. 根据权利要求30所述的网络设备,其特征在于,所述处理器从所述存储器读取所述驱动软件并在所述驱动软件的作用下,还执行以下步骤:
    若确定所述目标设备受到DDoS攻击,则从所述目标设备对应的边界交换机的至少一个物理端口中确定出目标物理端口,所述目标物理端口为所述至少一个物理端口中所述第一窗口内所述第一请求消息对应的数据流密度最大的物理端口;
    对所述目标物理端口传输的目标数据流进行标记,所述目标数据流为所述SDN中交换机与交换机之间的数据流;
    通过所述通信接口将所述标记后的目标数据流重定向至预先与所述目标设备对应的边界交换机绑定的数据过滤设备,以使所述数据过滤设备对所述标记后的目标数据流进行处理。
  32. 根据权利要求30或31所述的网络设备,其特征在于,所述目标设备为所述至少一个边界交换机中的目标边界交换机;所述处理器在执行所述监听预设的第一窗口内的第一请求消息,并计算所述SDN中的目标设备针对所述第一请求消息的当前请求速率时,具体执行以下步骤:
    监听预设的第一窗口内所述目标边界交换机发送的第一请求消息;
    计算所述第一请求消息的请求速率,并将计算出的所述请求速率作为所述目标边界交换机针对所述第一请求消息的当前请求速率。
  33. 根据权利要求30或31所述的网络设备,其特征在于,所述目标设备为所述控制器;所述处理器在执行所述监听预设的第一窗口内的第一请求消息,并计算所述SDN中的目标设备针对所述第一请求消息的当前请求速率时,具体执行以下步骤:
    监听预设的第一窗口内所述SDN中每一个边界交换机发送的第一请求消息;
    分别统计得到所述第一窗口内每一个边界交换机发送的第一请求消息的请求速率;
    根据每一个边界交换机的请求速率统计得到所述第一窗口内所述SDN中所有边界交换机所确定的边界网络的当前请求速率,并将所述边界网络的当前请求速率作为所述控制器针对所述第一请求消息的当前请求速率。
  34. 根据权利要求30-33任一项所述的网络设备,其特征在于,所述处理器在执行所述以所述当前请求速率为依据,判断所述目标设备是否处于异常状态时,具体执行以下步骤:
    判断所述当前请求速率是否高于预置的与所述目标设备对应的第一阈值,其中,所述第一阈值是根据预设的第二窗口内的第一请求消息的请求速率确定出的;
    若高于所述第一阈值,则确定所述目标设备处于异常状态。
  35. 根据权利要求30-34任一项所述的网络设备,其特征在于,所述处理器在执行所述查询所述目标设备对应的流表匹配信息时,具体执行以下步骤:
    通过所述通信接口向所述目标设备对应的边界交换机发送流表信息查询指令;
    通过所述通信接口接收所述目标设备对应的边界交换机响应所述流表信息查询指令返回的流表匹配信息;
    所述处理器在执行所述以所述流表匹配信息为依据,确定所述目标设备是否受到DDoS攻击时,具体执行以下步骤:
    以所述流表匹配信息为依据,计算所述目标设备对应的当前流表匹配效率;
    判断所述当前流表匹配效率是否超过预置的与所述目标设备对应的第二阈值,其中,所述第二阈值是根据预设的第三窗口内的流表匹配信息统计得到的流表匹配效率而确定出的;
    若不超过所述第二阈值,则确定所述目标设备受到DDoS攻击。
  36. 根据权利要求35所述的网络设备,其特征在于,所述目标设备为所述至少一个边界交换机中的目标边界交换机;所述处理器在执行所述以所述流表匹配信息为依据,计算所述目标设备对应的当前流表匹配效率时,具体执行以下步骤:
    根据所述目标边界交换机返回的流表匹配信息,计算所述流表匹配信息对应的流表匹配效率,并将计算出的所述流表匹配效率作为所述目标边界交换机的当前流表匹配效率。
  37. 根据权利要求35所述的网络设备,其特征在于,所述目标设备为所述控制器,所述目标设备对应的边界交换机包括所述SDN中的所有边界交换机;所述处理器在执行所述以所述流表匹配信息为依据,计算所述目标设备对应的当前流表匹配效率时,具体执行以下步骤:
    根据所述SDN中每一个边界交换机返回的流表匹配信息,分别计算每一个边界交换机返回的流表匹配信息对应的流表匹配效率;
    计算得到所述每一个边界交换机对应的流表匹配效率的平均值,并将所述平均值作为所述控制器对应的当前流表匹配效率。
  38. 根据权利要求36或37所述的网络设备,其特征在于,所述流表匹配信息包括秒级持续时间和匹配包数;所述处理器在执行计算流表匹配信息对应的流表匹配效率时,具体执行以下步骤:
    将所述匹配包数与所述秒级持续时间的商值作为所述流表匹配信息对应的流表匹配效率。
  39. 根据权利要求35所述的网络设备,其特征在于,所述处理器还用于执行以下步骤:
    监听所述目标设备对应的边界交换机的第二请求消息,所述第二请求消息是根据预设的第三窗口内的流表匹配信息生成的;
    以所述第二请求消息为依据,计算所述目标设备对应的历史流表匹配效率;
    根据所述目标设备对应的历史流表匹配效率,确定出所述目标设备对应的第二阈值。
  40. 根据权利要求39所述的网络设备,其特征在于,所述第二请求消息包括原因信息、秒级持续时间和匹配包数;所述处理器在执行所述以所述第二请求消息为依据,计算所述目标设备对应的历史流表匹配效率时,具体执行以下步骤:
    解析所述原因信息;
    若所述原因信息包括闲置超时信息,则将所述匹配包数与目标差值的商值作为所述目标设备对应的历史流表匹配效率,所述目标差值是所述秒级持续时间与所述闲置超时信息对应的闲置时间的差值;
    若所述原因信息包括硬性超时信息,则将所述匹配包数与所述秒级持续时间的商值作为所述目标设备对应的历史流表匹配效率。
  41. 根据权利要求31所述的网络设备,其特征在于,所述目标设备为所述至少一个边界交换机中的目标边界交换机;所述处理器在执行所述从所述目标设备对应的边界交换机的至少一个物理端口中确定出目标物理端口时,具体执行以下步骤:
    以所述第一请求消息为依据,将所述目标边界交换机的至少一个物理端口中所述第一请求消息对应的数据流密度最大的物理端口确定为目标物理端口。
  42. 根据权利要求31所述的网络设备,其特征在于,所述目标设备为所述控制器;所述处理器在执行所述从所述目标设备对应的边界交换机的至少一个物理端口中确定出目标物理端口时,具体执行以下步骤:
    获取所述SDN中每一个边界交换机的当前流表匹配效率,并将所述当前流表匹配效率低于所述SDN对应的边界网络的当前流表匹配效率的边界交换机作为目标交换机,所述SDN对应的边界网络是由所述SDN中所述至少一个边界交换机所确定出的;
    以所述目标交换机对应的第一请求消息为依据,将所述目标交换机的至少一个物理端口中所述第一请求消息对应的数据流密度最大的物理端口确定为目标物理端口。
  43. 根据权利要求31所述的网络设备,其特征在于,所述处理器在执行所述对所述目标物理端口的目标数据流进行标记时,具体执行以下步骤:
    在所述目标物理端口的目标数据流对应的数据包空闲字段填写所述目标设备对应的边界交换机的硬件地址哈希Hash值;或者,
    采用通用封装技术对所述目标物理端口的目标数据流进行数据包封装。
  44. 根据权利要求31所述的网络设备,其特征在于,所述处理器从所述存储器读取所述驱动软件并在所述驱动软件的作用下,还执行以下步骤:
    通过所述通信接口分别获取所述SDN中的边界交换机和数据过滤设备的地址信息;
    获取所述SDN的拓扑结构信息;
    根据所述拓扑结构信息为所述边界交换机确定至少一个数据过滤设备,并将确定出的数据过滤设备的地址信息与所述边界交换机的地址信息绑定。
PCT/CN2015/088458 2015-08-29 2015-08-29 一种分布式拒绝服务DDoS攻击检测方法及相关设备 WO2017035717A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2015/088458 WO2017035717A1 (zh) 2015-08-29 2015-08-29 一种分布式拒绝服务DDoS攻击检测方法及相关设备
CN201580031751.2A CN108028828B (zh) 2015-08-29 2015-08-29 一种分布式拒绝服务DDoS攻击检测方法及相关设备

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/088458 WO2017035717A1 (zh) 2015-08-29 2015-08-29 一种分布式拒绝服务DDoS攻击检测方法及相关设备

Publications (1)

Publication Number Publication Date
WO2017035717A1 true WO2017035717A1 (zh) 2017-03-09

Family

ID=58186954

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/088458 WO2017035717A1 (zh) 2015-08-29 2015-08-29 一种分布式拒绝服务DDoS攻击检测方法及相关设备

Country Status (2)

Country Link
CN (1) CN108028828B (zh)
WO (1) WO2017035717A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111327590A (zh) * 2020-01-19 2020-06-23 中国联合网络通信集团有限公司 一种攻击处理方法及装置
CN111885092A (zh) * 2020-09-10 2020-11-03 中国联合网络通信集团有限公司 一种边缘节点的DDoS攻击检测方法、处理方法及SDN
CN114448728A (zh) * 2022-04-07 2022-05-06 中国人民解放军战略支援部队航天工程大学 用于调整交换机流表项的方法、装置和计算机可读介质

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109040113B (zh) * 2018-09-04 2021-03-19 海南大学 基于多核学习的分布式拒绝服务攻击检测方法及装置
CN109617931B (zh) * 2019-02-20 2020-11-06 电子科技大学 一种SDN控制器的DDoS攻击防御方法及防御系统
CN112910536B (zh) * 2019-11-19 2023-01-24 北京最终前沿深空科技有限公司 一种卫星网络的控制切换方法和装置

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101212302A (zh) * 2007-12-21 2008-07-02 华中科技大学 一种在P2P流媒体系统中防御DDoS攻击的方法
US7788718B1 (en) * 2002-06-13 2010-08-31 Mcafee, Inc. Method and apparatus for detecting a distributed denial of service attack
US20140283051A1 (en) * 2013-03-14 2014-09-18 Radware, Ltd. System and method thereof for mitigating denial of service attacks in virtual networks
CN104378380A (zh) * 2014-11-26 2015-02-25 南京晓庄学院 一种基于SDN架构的识别与防护DDoS攻击的系统及方法
CN104506511A (zh) * 2014-12-15 2015-04-08 蓝盾信息安全技术股份有限公司 一种sdn网络动态目标防御系统及方法
CN104539594A (zh) * 2014-12-17 2015-04-22 南京晓庄学院 融合DDoS威胁过滤与路由优化的SDN架构、系统及工作方法
CN104539595A (zh) * 2014-12-17 2015-04-22 南京晓庄学院 一种集威胁处理和路由优化于一体的sdn架构及工作方法
CN104660582A (zh) * 2014-12-17 2015-05-27 南京晓庄学院 DDoS识别、防护和路径优化的软件定义的网络架构

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101106518B (zh) * 2006-07-10 2011-10-26 中兴通讯股份有限公司 为中央处理器提供负载保护的拒绝服务方法
CN101325588A (zh) * 2007-06-11 2008-12-17 华为技术有限公司 一种网络设备防攻击的方法以及网络设备
CN101083563B (zh) * 2007-07-20 2010-08-11 杭州华三通信技术有限公司 一种防分布式拒绝服务攻击的方法及设备
CN101567812B (zh) * 2009-03-13 2011-12-21 华为技术有限公司 对网络攻击进行检测的方法和装置
US9167004B2 (en) * 2011-02-17 2015-10-20 Sable Networks, Inc. Methods and systems for detecting and mitigating a high-rate distributed denial of service (DDoS) attack
CN104506559B (zh) * 2015-01-09 2018-01-23 重庆蓝岸通讯技术有限公司 一种基于Android系统的DDoS防御系统和方法

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7788718B1 (en) * 2002-06-13 2010-08-31 Mcafee, Inc. Method and apparatus for detecting a distributed denial of service attack
CN101212302A (zh) * 2007-12-21 2008-07-02 华中科技大学 一种在P2P流媒体系统中防御DDoS攻击的方法
US20140283051A1 (en) * 2013-03-14 2014-09-18 Radware, Ltd. System and method thereof for mitigating denial of service attacks in virtual networks
CN104378380A (zh) * 2014-11-26 2015-02-25 南京晓庄学院 一种基于SDN架构的识别与防护DDoS攻击的系统及方法
CN104506511A (zh) * 2014-12-15 2015-04-08 蓝盾信息安全技术股份有限公司 一种sdn网络动态目标防御系统及方法
CN104539594A (zh) * 2014-12-17 2015-04-22 南京晓庄学院 融合DDoS威胁过滤与路由优化的SDN架构、系统及工作方法
CN104539595A (zh) * 2014-12-17 2015-04-22 南京晓庄学院 一种集威胁处理和路由优化于一体的sdn架构及工作方法
CN104660582A (zh) * 2014-12-17 2015-05-27 南京晓庄学院 DDoS识别、防护和路径优化的软件定义的网络架构

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111327590A (zh) * 2020-01-19 2020-06-23 中国联合网络通信集团有限公司 一种攻击处理方法及装置
CN111885092A (zh) * 2020-09-10 2020-11-03 中国联合网络通信集团有限公司 一种边缘节点的DDoS攻击检测方法、处理方法及SDN
CN114448728A (zh) * 2022-04-07 2022-05-06 中国人民解放军战略支援部队航天工程大学 用于调整交换机流表项的方法、装置和计算机可读介质
CN114448728B (zh) * 2022-04-07 2022-07-01 中国人民解放军战略支援部队航天工程大学 用于调整交换机流表项的方法、装置和计算机可读介质

Also Published As

Publication number Publication date
CN108028828B (zh) 2020-10-27
CN108028828A (zh) 2018-05-11

Similar Documents

Publication Publication Date Title
WO2017035717A1 (zh) 一种分布式拒绝服务DDoS攻击检测方法及相关设备
CN108040057B (zh) 适于保障网络安全、网络通信质量的sdn系统的工作方法
KR101917062B1 (ko) 소프트웨어 정의 네트워크에서 링크 플러딩 공격을 완화하기 위한 허니넷 방법, 시스템 및 컴퓨터 프로그램
US9998357B2 (en) Multipath transmission based packet traffic control method and apparatus
EP3516833B1 (en) Methods, systems, and computer readable media for discarding messages during a congestion event
US9819590B2 (en) Method and apparatus for notifying network abnormality
US11032205B2 (en) Flow control method and switching device
JP5880560B2 (ja) 通信システム、転送ノード、受信パケット処理方法およびプログラム
EP3105906B1 (en) Denial of service prevention in a software defined network
WO2018108052A1 (zh) 一种DDoS攻击的防御方法、系统及相关设备
CN108737447B (zh) 用户数据报协议流量过滤方法、装置、服务器及存储介质
US10313238B2 (en) Communication system, communication method, and non-transitiory computer readable medium storing program
JP2017152852A (ja) 通信システム、通信装置、および通信システムの通信制御方法
KR101712168B1 (ko) 패킷 입력 메시지 제어 방법, 이를 수행하는 스위치 및 컨트롤러
Chi et al. Design and implementation of cloud platform intrusion prevention system based on SDN
WO2024021495A1 (zh) 云平台中的泛洪攻击的识别方法、装置、设备及存储介质
RU2576488C1 (ru) СПОСОБ ПОСТРОЕНИЯ СЕТЕЙ ПЕРЕДАЧИ ДАННЫХ С ПОВЫШЕННЫМ УРОВНЕМ ЗАЩИТЫ ОТ DDоS-АТАК
CN107147585B (zh) 一种流量控制方法及装置
WO2017070965A1 (zh) 一种基于软件定义网络的数据处理方法及相关设备
CN105812274B (zh) 一种业务数据的处理方法和相关设备
KR101564228B1 (ko) 이동통신망에서 시그널링 DoS 트래픽을 탐지하기 위한 시스템 및 그 방법
Singh et al. Comparative analysis of state-of-the-art EDoS mitigation techniques in cloud computing environment
US20100157806A1 (en) Method for processing data packet load balancing and network equipment thereof
CN105959242B (zh) 一种报文发送方法和装置
Lotlikar et al. A Defense Mechanism for DoS Attacks in SDN (Software Defined Network)

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15902524

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15902524

Country of ref document: EP

Kind code of ref document: A1