To address the challenges posed by traditional network architectures, the Software-Defined Network (SDN) architecture was introduced. However, SDNs are not immune to many security threats (e.g. Dos, Backdoors). In this paper, we present an advanced intrusion detection system that leverages federated learning (FL) and deep learning (DL) techniques to check whether attacks occur or not on SDN. FL has been employed as a collaborative learning technique, enabling various data planes to conduct local training on their respective client datasets. Following local training on each data plane, the local model parameters are securely transmitted to the controller server. At the controller server, these local training parameters are aggregated to construct a global model. The resulting aggregation outcome is then shared back with each local model to update them, enhancing their ability to detect attacks. Three datasets were used to evaluate the efficacy of the suggested method: UNSW-NB15, NF-UQ-NIDS-v2, and CICIDS2017. The obtained results demonstrate a strong performance in anomaly detection, with an accuracy value reach to 95.68%.