###### Abstract  
Smart cities have experienced significant growth in recent years, transforming people's lives into a more futuristic version. The smart city initiative includes a diverse collection of specifications, encompassing a large number of users whose requirements vary significantly and heterogeneously. Each device in smart cities generates a significant amount of data, which places a load on the gateways. Smart cities face a major challenge due to the enormous amount of data they generate. Through software-defined networking (SDN), network information paths are optimized, ensuring that traffic flow is evenly distributed across all network nodes. A considerable number of IoT devices with limited resources are susceptible to various security threats, such as device hijacking, ransomware, man-in-the-middle (MiM) attacks, and distributed denial-of-service (DDoS) attacks. These threats can pose a severe challenge to network security. Additionally, DDoS attacks have disrupted web businesses, resulting in the loss of valuable data. To counter DDoS attacks in a smart city, several options exist, yet many challenges remain. This research presents a secure and intelligent system to combat DDoS attacks on smart cities. SDN security controllers and machine learning models with optimization are employed in this study to reduce the impact of common DDoS attacks on smart cities. This work utilizes an SDN based on security controllers and a detection mechanism rooted in a machine learning model with optimization to mitigate various types of prevalent DDoS attacks within smart cities. Employing binary classification, XGBoost achieved an accuracy of 99.99%, precision of 97%, recall of 99%, an F1 score of 98%, and a false-positive rate of 0.05. In multiclass classification, the average accuracy is 99.29%, precision is 97.7%, recall is 96.69%, and the F1 score is 97.51%. These results highlight the superiority of this approach over other existing machine learning techniques. smart city; software-defined networking; DDoS attack; cybersecurity +
Footnote †: journal: Applied  
nature of smart cities necessitates this requirement. These heterogeneous systems are designed independently of one another, and each one features a unique operating system, programming platform, and tier of service. These heterogeneous devices produce a significant amount of data on the network, thereby increasing the load on the gateways. The advancement of the internet of things (IoT) has spurred its adoption in domains like smart homes, smart cities, and related sectors, contributing to its exponential growth in recent years. Conversely, due to this development, IoT networks [3; 4; 5; 6] are witnessing an upswing in security concerns, notably botnet attacks, often appearing as network anomalies. In a similar vein, providing security solutions proves challenging due to the limited resources accessible to devices connected to IoT networks in general. This challenge has been addressed through the utilization of the software-defined networking (SDN) computing paradigm, creating an environment that offers extra resources and adaptability for any anomaly mitigation systems. This complexity and loading challenge can be surmounted by adopting SDN architecture for an efficient network management platform. The segregation of the control and data planes in SDN facilitates streamlined management, control, dynamic rule updates, analysis, and a broader network perspective from a centralized control point. Measurement stands out as one of the most pivotal and intricate aspects of centralized network management. The overarching objective is to identify DDoS attacks before smart city systems become inaccessible. DDoS attacks inundate a smart city device or a set of devices with a substantial number of packets, rendering them vulnerable. Smart city switches fail to identify a match if the incoming packet's source addresses are spoofed, which is commonly the case, necessitating the transmission of the packet to the controller.