Detection Of DDoS In SDN Environment Using Entropy-based Detection - CPP

Transcription

1Detection of DDoS in SDN Environment UsingEntropy-based DetectionTamer Omar, Anthony Ho, Brian Urbina,Department of Electrical and Computer Engineering, California State Polytechnic University, ned networking shifts the currentparadigm of network infrastructures by providing a centralcontrol layer, improves network management, and implementsprogrammability for flexibility. However, recent studies haveshown the vulnerabilities that emerge within this architecturethat can prove detrimental to the overall network infrastructure.In this work we analyze the effects of Distributed Denial of Service attacks on a software-defined networking environment andproposes an entropy-based approach to detect these attacks. Thestudy uses the flexibility of OpenFlow protocol, and an OpenFlowcontroller (POX) to mitigate the attacks upon detection. Initially,through simulation the results of the detection algorithm wasobserved, and then implemented into a small-scaled networktest bed, and finally the results of the proposed algorithm werepresented and analyzed.Index Terms—SDN, OpenFlow, POX, Entropy, DDOS.I. I NTRODUCTIONAs technology matures, traditional networking is slowlytransitioning to Software-Defined Networking, or SDN. It isfound that SDN has a lot of benefits because of it providesprogrammability in networks, which helps contain operationalcosts and enable business growth. However, security is oneof the limiting factor that is preventing real world SDNdeployment. Although SDN is adopted by large web scaleproviders like Google, Amazon, and ATT, it is not adopted on alarge scale by enterprises due to the lack of security solutions,standardization, and low level of maturity of SDN. Using thegranular control provided by SDN, the security solutions needto be developed as to encourage the adoption and use of SDN.The current networking paradigm involves switches, routersand gateways where these networking devices constitute bothlogical thinking as well as routing of packets. Traditionallythe network administrator is responsible for configuring andmanaging these devices manually and at all times, whichmakes it a tedious task. Although these traditional networksare widely-used and popular, they have several drawbacks.Traditional networks are not programmable, which meansthey are static and inflexible network. They possess littleagility and flexibility during deployment. SDN can removethe drawbacks of traditional networking. SDN is all aboutbringing programmability, automation, and superior controlin the network to increase scalability and flexibility. Unliketraditional networks, the processing of the packets is notdone by the switches. The architecture of SDN decouples thenetwork control plane from the data or forwarding plane whichconsists of network devices forwarding traffic based on thecontrol plane policy as shown in Fig.1.Figure 1: Traditional vs Software-Defined NetworkingFor the control plane and the data plane to communicate,OF is one of the protocol used to establish the communicationbetween the separated data plane and control plan in an SDNenvironment. The controller is a software running on a serverwhich acts as the network operating system of the SDN. Thedevices in the data use secure transport layer to communicatesecurely with the controller using the OF protocol. When apacket arrives at a switch, the header of the packet is checkedwith the fields in the flow entries. If a match is found, thenthe corresponding action associated with the flow entry isexecuted. Otherwise, the packet is forward to the controllerto make the next decision and processing. The controller willdetermine if the packet will be forwarded by the switch, or itwill be dropped. With this in mind, the controller plays a bigrole in the SDN.The logically centralized controller can lead to many security challenges. Without the controller, the whole SDNarchitecture is lost. One of the main reason for a controller tobe become unavailable is due to cybersecurity attacks such asDDoS. If a DDoS attack is launched, every incoming packetswill be sent to the controller for processing which will exhaustthe computing resources of the controller. Thus, the controllercan become unavailable for processing of legitimate packets.To address the vulnerabilities in the SDN controller, the goalof this project is study and utilize a statistical method, Entropy,to address and recognized the difference between a normal andmalicious network traffic. The effectiveness of attack detectionsolution will be studied and realized. The best solution will beproposed and implemented in our SDN architecture. A serverwill be running the POX controller, one client as the malicioususer who be responsible of sending the DDoS attacks, andanother client will be the victim of the attacks.II. R ELATED W ORKAs mentioned previously, the most vital component in SDNis the controller, which resides in the control plane of theSDN architecture. The separation of the control plane and

2data plane in the SDN architecture allows the applicationplane to focus on developing network service applications thatcan utilize network resources provided by the control plane.Communication between the controller and forwarding devicesin the data plane is provided by a control-data plane interfacesuch as OpenFlow(OF), a growing standard within the SDNcommunity. In order to communicate, both the controllerand forwarding devices (i.e. switches) must support OF. OFswitches contain and utilize what are known as flow tables forpacket lookup and forwarding. The use of flow tables is thefundamental backbones between the OF switch and controllerrelationship. These flow tables contain flow entries whichconsists of rules, statistics and actions regarding the packet inquestion [1]. Likewise, OF enabled controllers include theirown flow table and flow entries regarding the current state ofthe network which OF switches rely on for decision makingevents and updating their flow tables based on the out messagesent by the controller.Typically, an OF switch within a SDN environment willdetermine the next path and action for any incoming packetsbased on the flow entries within its flow table or wait for thecontroller to transmit an output message that updates the flowtable of the switch [2]. This allows network administratorsand developers to construct policies that can be driven bythe controller and implemented through the switches. Thisis useful for structures that require a more dynamic networkwhere mobility and scalability is a core value [3]. However,the rise of 5G networks shows promise for SDN as mobilebroadband networks have begun to implement SDN withintheir 5G framework to aid in scalability and flexibility [4].Nevertheless, the improvements made by SDN also makeway for new security threats. With the separation of thecontrol and data plane, SDN switches rely on the controllerfor forwarding with no additional intelligence. This meansattackers can flood the switches with hundreds of requestsand overload the flow tables. Flow tables within OF switchesare of fixed length and therefore, each flow entry has its owntimeout length which can negatively affect the growth rate ofthe flow table, result in frequent overflows [5]. As a result,the SDN model begins to reach its limitations as networkapplications designate stateful processing intelligence to thecontroller. Flow states that have real time requirements willexperience latency due to the flow entry timeouts [6].On the contrary, it is possible to predefine the flow entrytimeout to be short which would be ideal to minimize latencyhowever, as presented in [5] short flow entry timeouts cancause flow tables to be congested more rapidly and renderthe controller and switch unresponsive. This can be due tomassive influx of request constructed by attackers to overloadthe network such as the a DDoS attack, which is primary focusof this project.A DDoS attack is a type of cyber-attack that causes abandwidth overload using the communication traffic within thenetwork and can be used to temporarily disable the networkservices. Several types of DDoS attacks exist. Direct attackswhich utilize one host within the network generate randomtraffic while changing the originating IP address. Reflectionattacks use more than one host that have been infectedwith malware programs to be controlled in an attempt toform a strategic attack on a particular target. Even thoughDDoS attacks have become avoidable in traditional networkinfrastructure the emergence of software defined networkinghas proven vulnerable to this form of attack.The increase of IoT devices within the past several yearshas multiplied and has now become a primary focus for attackgroups [7]. Therefore, the importance of security within SDNhas become a focal point in network communication research.Currently, there are several schemes to detect and defendSDN infrastructures. Most effective techniques thus far are byutilizing the programmability of SDN and implementing a detection algorithm within initialization of the controller. Usinga statistical approach for the basis of the algorithm providedresearches with a method of detecting certain anomalies withina cluster of traffic within a network [8].III. S YSTEM A RCHITECTUREA. Network TopologyThe network topology is shown in Fig.1 . During a normaltraffic between clients in an SDN network, the first packettransmitted from one client to another. Initially, the switchwill not have any entry in its flow table as to where itshould forward the incoming packet. The default route willbe forwarding the packet it to the controller. The controllerwill dictate the switch to forward the packet to respectivedestination port. The controller will also provide an entry rulein the flow table in the switch for that particular source anddestination. In the future, the packet with the same sourceand destination will be automatically forwarded without theintervention of the controller.1) Controller Modules : The detection program will run onPOX as stand-alone modules. Multiple modules will be used toallow the controller to perform different functionalities such asinstalling flows, forwarding packets, and validating the DDoSattacks.2) L3 Learning Module : This module, L3 learning, is themost important module in the POX controller. It is a simplelayer 3 learning module that provides connectivity betweenthe nodes in the network. L3 learning module handles theincoming packet and maintains a list of bindings ports OVSthe MAC addresses of the connected clients. It utilizes thisinformation to install the rule that replaces a destination MACwhile forwarding a packet to the destination port. If no bindingis found, the module instantiates ARP requests. Along withthe connectivity, it is integrated with the detection algorithmto detect a malicious traffic flow.B. Non-Functional Requirements1) Interface Requirements : 1- OF Protocol: Provides amedium for the SDN controller to direct traffic along theswitches within the network. 2- Northbound API’s:Allow theSDN controller to communicate between services and applications running over the network owing to programmatic natureof SDN. 3- Southbound API’s: Allow the SDN controller tocommunicate between the network devices within the network.4- Python 2.7: Programs and modules created for the POXcontroller will require Python 2.7 since that is the fundamental

3Python Scapy: Scapy allows users to create a custompacket with Python. Users can send a packet within a specificstructure or manipulation so that it can be tested on how aparticular machine or network will respond to that particulartype of packet.IV. S YSTEM D ESIGNA. System ArchitectureFigure 2: Network Topology2) Software Quality Attributes : The correctness of thisstudy depend upon the accuracy of our Entropy based application that will detect a DDoS attack. For this purpose,the Entropy based application will be trained in the SDNenvironment, so that we came find necessary constant value forour Entropy’s threshold. The second attribute is availability, ,slong as the network is up and running, this service would bealso be available continuously monitoring the network for anyanomalies. The last attribute is usability, when a DDoS attackis detected, a simple notification will appear within the serverthat is responsible for running the POX controller. It will notinvolve using complex application for monitoring purposes.No specific training of the user is needed for using this system.C. Software Requirement SpecificationsThe system uses a Raspberry Pi as OVS which has at leasttwo host connected to it. The following software are required:POX Software Defined Network Controller: The core of theSDN architecture is the controller. POX controller will be usedto setup our SDN. It is one of the most widely used SDN forearly-stage development across various platforms.Mininet: Mininet is a network emulator that will create avirtual SDN network, running real kernel, and switch on asingle machine within a matter of seconds. Custom topologiescan be written in Python. One of the main feature is thatit utilizes SDN. With OF protocol, the controller can beprogrammed to simulate any kind of network scenario.Open vSwitch (OVS): This is a multilayer virtual switch thatleverages OF and OVS database management protocol. UsingOVS for virtual networking is considered the core elementof any SDN deployment. In addition, Mininet uses OvS toforward packets across the interfaces and operates using theOF protocol.Wireshark: Wireshark is a packet analyzer used to capturenetwork packets and extract as details regarding incomingand outgoing traffic within a network. Just as multimeters areused to understand troubleshoot circuits, Wireshark is used totroubleshoot network and security problems, debug protocolimplementation and understand how network protocols work.Ubuntu: Ubuntu is an open-source Linux-based operatingsystem. It will be used to run our simulator network, Mininet.Python 2.7: Python is a high-level dynamic programminglanguage that allow us to deploy custom typologies on Mininetand develop Entropy based detection module for our POXcontroller.During a normal traffic between clients in a SDN network,the first packet transmitted from one client to another. Initially,the switch will not have any entry in its flow table as towhere it should forward the incoming packet. The default routewill be forwarding the packet to the controller. The controllerwill dictate the switch to forward the packet to respectivedestination port. The controller will also provide an entry rulein the flow table in the switch for that particular source anddestination. In the future, the packet with the same sourceand destination will be automatically forwarded without theintervention of the controller.B. Controller ModulesThe detection program will run on POX as stand-alonemodules. Multiple modules will be used to allow the controllerto perform different functionalities such as installing flows,forwarding packets, and validating the DDoS attacks.1) L3 Learning Module : This module, L3 learning, is themost important module in the POX controller. It is a simplelayer 3 learning module that provides connectivity betweenthe nodes in the network. L3 learning module handles theincoming packet and maintains a list of bindings between theOVS ports and the MAC addresses of the connected clients.It utilizes this information to install the rule that replaces adestination MAC while forwarding a packet to the destinationport. If no binding is found, the module instantiates ARPrequests. Along with the connectivity, it is integrated with thedetection algorithm to detect a malicious traffic flow.2) DDoS Detection Algorithm: The design of the detectionalgorithm is based on three main inputs which are flow entries,packet counts, and Entropy calculations. This design is writtenin Python (2.7) and will be implemented within the POXcontroller as an additional module. It will also feature analerting mechanism. If an attack is detected, a SMS notificationwill be sent to an administrator indicating that the SDN hasbeen breach.3) Flow Classification: Flows are sequence of packets thatshare similar characteristics. The characteristics are source IPaddress, destination IP address, source port number, destination port number,and protocol type. This flow classificationinformation can be extracted from the header of each packet.Each incoming flow based on TCP and UDP protocol usuallycontain these information. In a SDN architecture, the OVS hasa flow table that contains multiple flow entries. Each entry hasits own rule, this rule allows the switch to know how to handleeach incoming packet. An example would be a client tryingto communicate with other clients, and to communicate apacket is sent to the switch. The incoming packets are groupedtogether to form flows. The incoming flows will navigate

4through the OVSs to find the rule associated with the entryflow. If there is no match, the switch will generate and send apacket to the controller to acquire a new flow rule. Then, thecontroller will implement a new flow rule in the flow table sothat the OVS can handle any new flows.With that in mind, attacks or malicious users can exploit theflow rule by sending a large amount flows that are not presented in the OVSs flow table. These new flows will consumethe OVS because the controller have to handle and establishnew rules for these incoming flows. This will overload thecontroller and possibly disrupt the entire network. Such attackis known as DDoS. Understanding the flow classificationallows us to design an algorithm to identify DDoS attacksfrom normal traffic through classifying these malicious flowsand normal flows. Let’s consider O, an observation sequenceof different flows F that injects to an interface i of the OVS.Assume X is a malicious flow if the total number of packetswithin this flow is lower than a certain threshold. The thresholdis predefined through data mining of flow classification. If Xis a normal flow, then the total number of packets within thisflow is equal to or greater than the threshold. X is defined asfollows:(1 # of packets T hresholdX Foi (1)0 # of packets T hresholdC. DDoS Detection with Entropy-based AlgorithmShannon Entropy [9] is an important concept for understanding the design of entropy-based detection algorithm.Entropy measures uncertainty or randomness associate with arandom variable [10]. In our case, the random variable is thedestination address. The entropy-based detection is similar toalgorithm used in [11]. To collect packets for entropy analysis,a fixed window size is defined. Incoming packets need tobe divided into two small groups (windows) based on theelapsed-time or the number of incoming packets. For eachwindow, the packets are classified into groups that based ontheir destination IP address. All of these incoming packets willbe coming from different source addresses. The destinationIP addresses will be monitored for every new flow. Thesemonitored flows are grouped into windows. Each windowcontains a hash table or a dictionary of two columns. The firstcolumn will state all the IP addresses, and the second columnwill show the number of times it has occurs. The windowequation can be calculated as shown in equation 2.Wwindow (X1 , Y1 ), (X2 , Y2 ), (X3 , Y3 ), ., (Xi , Yi )(2)Where i denotes each unique element in the window and nis the number of all IP destination addresses for each window.Then, the probability of each unique IP destination addresscan be calculated with Equation 3.Pi Yi /n(3)Each window is calculated as shown in equation 4. The entropy will compare to the predefined threshold. If the entropyvalue is larger than the predefined threshold, this will indicatethat there is no attack. Any value lower than the predefinedthreshold will indicate that there is a possibility of an attack. Ifan attack is not detected, the entropy threshold will be updatedto current calculated entropy to prevent further false analysis.This allows the detection algorithm to dynamically adjust tothe nature of traffic flow.ε nX Pi logPi(4)i 0The entropy-based algorithm is designed to detect an internal attack. The attacker and the victim are located within theinternal SDN. The attacker has the options of attacking thecontroller or clients within the network. In either scenario, theattack is most likely to have a spoofed source IP addresses.Therefore, the incoming packets will not match the flow tableso it will be forward to the controller. With this algorithmimplemented, the controller can determine if the network isunder attack through the drop in the entropy value due tothe large number of packets containing the same destinationaddress. The perfect example of such attack is UDP flooding.In a normal network, traffic is expected to spread out toevery client in the network. During a DDoS attack, the numberof packets destined for a targeted host will rise immediatelyand the entropy value decrease. A decrease in the entropy isan indication that the network may be under attack. It is vitalto have a fast and responsive detection because attackers couldseverely disrupt network service and possibility loss of data.To determine suiting window size , Oshima et al. [11] proposalis used based on entropy computation through calculatingentropy in small size windows. Their study proposed a windowsize ranging from 50 to 5000 and concluded that windowwidth of 50 and 500 successfully detect DoS/DDoS attacks.As proposed by Oshima et al., a window size of 50 is usedfor this research. The detection algorithm includes a functionthat collects incoming flow from the OVS. The flows will bestored in a file which will calculate the total number of packetsfor every destination IP in the current interval.D. Entropy Based Detection AlgorithmAlgorithm 1 shows the Entropy Based Detection Algorithm.The input, new packet in, correspond to a new packet that hasarrive with a new source address. The destination IP addressis also examined to see if it has an existing instance in thewindow. If it does exist, the count for that IP address willincremented. If the window gets full, the entropy is computedand then compared with the threshold. If the computed valuefor an entry is higher than the threshold for five consecutivecounts, it will be classified as an attack.E. Port Mitigation TechniqueIn order to prevent an attack after it has been detected weused the flexibility of the OpenFlow Protocol to mitigate theattack by modifying the flow-table of our OVS switch to outputthe incoming traffic from the attacker to a non-existing port.With the Pox controller, all incoming and outgoing traffic isanalyzed using the flow table of the controller which keeps

5Algorithm 1 Entropy Based Detection Algorithm1: Function ENTROPY2: Collect flow from switch and store in a file.3: Calculate total number of packets for every destination ipin current interval.4: Declare global variables5: End Function6: Function COLLECT STATISTICSPN7: Calculate the probability using, Pi Xi / i 0 Xi where,Pi Probability of ith destination ip, Xi Packet count on ithdestination ip, N Total number of destination ip8: Calculate entropy of network using, H(Sj ) Pn PlogPwhere,H(S)istheEntropyofjiijthi 1switch9: Calculate the difference between above calculated & normalentropy value10: End Function11: Function ENTROPY DETECTION12: Compare the above calculated dif f with predefinedthreshold value.13: if dif f threshold then14: Increment DDoS detected count15: if DDoS detected count min DDoS detected in particularwindow then16: Generate alert of DDoS attack18: else19: Increment program counter.20: end if21: end functionAlgorithm 2 Port Mitigation1: Function MITIGATION2: Collect Port and DPID of current flow3: Confirm Attack is occurring4: Collect Port and DPID of Attack5: if current low attack f low then6: Create new flow entry with attack parameters7: Update new flow entry output action where, output action port010: Send new flow entry to OVS switch11: else12: Do nothing13: end if14: end functiontrack of the ingress ports and switch ID or DPID. These twoparameters can also be used to modify any flow entry andimplement an action for the flow entry. Algorithm 2 shows theport mitigation technique used to defend the network againstattacks.After detection of an attack the detection algorithm willcollect the DPID and Port number associate with the attack andstore it in a list. Then, the mitigation algorithm will analyzecurrent traffic flow and compare its associated port numberand DPID with the collected attack parameters. If a matchoccurs a new flow entry will be created to install a new actionfor that associated attack location. This action will drop anyTable I: Traffic FlowSimulated TrafficNormalPacket TypeTraffic IntervalTraffic Rate0.5 sec2 packets/secMultipleVictims @ 25%attack rateUDP0.125 sec8 packets/secMultipleVictims @ 50%attack rate0.03 sec33.3 packets/sectraffic incoming or outgoing to this particular attack location.V. S IMULATION AND T EST R ESULTSMininet is used to emulate the network with POX as thecontroller platform. The detection program will be a standalone module integrated within the L3 Learning module. Thiswill allow the controller to perform additional functionalitiessuch as installing flows and validating DDoS attacks. In thistestbed, OF-switch is used to simulate the behavior of an edgeswitch in a SDN network. The Mininet network comprises avictim node that is the destination for both normal traffic andattack traffic generated from a client within the SDN network.By using Mininet, we can attack a virtual host and analyze theresults of our detection algorithm. The client’s IP addresses areassigned incrementally from 10.0.0.1.For this research, three hosts are implemented, one OVS,and controller in the physical testbed. Typical networks consistof thousands of devices; however due to resources limitationthe previous testbed is build to emulate the similar scenariosin large networks. To develop and validate the effectiveness ofour solution in a real time environment, we created a virtualnetwork with these exact constraints to better represent ourtestbed. Scapy is used to generate UDP packets with varyingpayloads and traffic interval. To fulfill our test case scenario,the time interval for the simulated traffic is defined. If an attacktraffic has 25% rate, then the traffic interval of 0.025 seconds.For a normal traffic, it will have an interval of 0.1 seconds.The simulations and evaluations were performed on multiple platforms. The main platform used to test our detectionalgorithm is iOS environment set up on a 1.4 GHz Intel Corei5 processor and a memory of 4GB RAM. Normal TrafficSimulation is used to determine the average entropy for anormal traffic, we launched three different traffic patterns.Normal traffic is defined as traffic with long duration flowsas compared to attack traffic which has short duration’s flowswith small numbers of packets. The goal is to determine theaverage normal entropy value for a network consisting of fournodes. A traffic was launched on the network with a trafficinterval of 0.5 seconds. The traffic rate is defined by (1/0.5 2 packets/sec). Table 1 summarizes the specifications of allsimulated traffic scenarios. In Figure 3, the chart describeshow the entropy varies during the traffic. The lowest thresholdcaptured during this traffic flow is 0.884 with the highest pointcaptured at 0.900. The average entropy value of this smallnetwork is 0.892.For attack traffic simulation with multiple victims, thetopology and parameters remain the same as the one use tosimulate the normal traffic. The only difference is the trafficinterval and rate. For the multiple victim attack, we testeda 25% attack rate. The attack traffic interval is defined by

6Figure 3: Entropy: Normal Trafficdifference between a normal and attack traffic. It is importantto remember that this simulation is specifically designed forthe used test-bed. In a real scenario, the network and its trafficwill grow. If so, the threshold must be adjusted accordinglyto avoid false positive detection.VI. C ONCLUSIONFigure 4: Entropy: Multiple Victims Attack TrafficUsing the Open vSwitch software developed for OF protocolproved simplicity in programming and integrating Linux-basedhardware into an OF switch. Additionally, the POX controllerproved to be simple and effective in establishing a test bedfor the Entropy-based detection and mitigation algorithm.During integration, testing, and hardware deployment phase,the accuracy of the proposed algorithm was presented indetecting a generated DDoS attack on single and multiplevictims. The attack was detected and mitigated within 3 to10 seconds of the entropy value reaching 0. Once mitigatedtraffic continued to flow normally without disturbance fromthe attacker(s). The flexibility that SDN provides to the overallrealm of networking has been proven to aid in programmabilityand management for network administrators. Even though thisnew paradigm leaves room for vulnerabilities, the flexibilityof SDN provides network administrators with new techniquesto protect and expand current and future networks.R EFERENCES(Normal Traffic x 25% 0.125 sec) with a traffic rate at 8packets/sec. In this multiple victim attack scenario, the trafficinterval of 0.125 sec will generate 8 packets a second per housealong with 2 packets/sec being generate for legitimate traffic.As expected, the attack was detected. For further analysis,we increased the attack to 50% to see how fast our detectionalgorithm is able detect the attack.As expected, the algorithm detects the attack under 10seconds. The 25% attack rate is detected at 9.71 seconds. Witha higher traffic rate of 33 packets/sec, the attack is detectedat 5.14 seconds. The entropy value for both test scenarios areapproxima

the network such as the a DDoS attack, which is primary focus of this project. A DDoS attack is a type of cyber-attack that causes a bandwidth overload using the communication traffic within the network and can be used to temporarily disable the network services. Several types of DDoS attacks exist. Direct attacks