Software-Defined Networks (SDN) are becoming a trending technology in the modern Internet by splitting control and data planes and using a central controller. A SDN controller provides flexible flows management at wire-speed packet forwarding. The centralized control gives an opportunity to implement detection and mitigation security attacks inside the SDN controller. Typically, Distributed Denial of Service (DDoS) attacks poses an immense threat to the Internet security. However, the prediction and prevention of DDoS attacks in SDN environments are a huge challenge. In this paper, we introduce a mechanism to mitigate DDoS attacks in SDN using statistical analysis and traffic entropy. To validate the proposal, a prototype was built in Mininet tool. The accuracy and training time were compared against different Machine Learning algorithms. Finally, we expound about the effectiveness and limitation of the proposed solution as well indicate further research opportunities.