Software Defined networking (SDN) is a new architecture for communication networks that provides central control in networking by separating control plane and data plane. Also, the ability of provisioning and managing of the network through high-level programming languages become available by providing the user interface for high-level control in SDN. The high-level control caused the wide and rapid development of novel approches in control and managing of the network. In the other hand, SDN centralized the network control by separate control plane and data plane but it distributes the development among researchers. Congestion control approaches in SDN are conceivable by using high-level languages and they will translate to low-level languages for switches and routers by OpenFlow protocol. In this thesis, a SDN controller is designed to avoid congestion in the network. this controller is composed of multiple modules such as collecting information, predicting network traffic, congestion detection, routing and a routeing algorithm to avoid congestion. In the prediction approach that uses neural networks, the aim is using just one neural network to predict all flows of the network. For this purpose, two kinds of neural network (Feed Forward and Recurrent) are made and tested. Both are able to predict traffic network in a short time slot. The routing module has tow different algorithm, a static algorithm for a light load of traffic and a dynamic one for high loaded links. The dynamic algorithm uses an optimization approach to find the best routes based traffic loads on the links. Normally this optimization is not calculatable in real time but by relaxing constraints, it's solved in real-time. The dataset used in this thesis is captured from a router of the Isfahan University of Technology and modified for use as SDN traffic data. Simulation results represent prediction and routing approaches are suitable to reduce the congestion on links. Key Words: Software-defined networking, congestion control, network traffic prediction, recurrent neural networks, LSTM, dynamic routing.