###### Abstract  
The Internet of Things (IoT) is a significant technological advancement that allows for seamless device integration and data flow. The development of the IoT has led to the emergence of several solutions in various sectors. However, rapid popularization also has its challenges, and one of the most serious challenges is the security of the IoT. Security is a major concern, particularly routing attacks in the core network, which may cause severe damage due to information loss. Routing Protocol for Low-Power and Lossy Networks (RPL), a routing protocol used for IoT devices, is faced with selective forwarding attacks. In this paper, we present a federated learning-based detection technique for detecting selective forwarding attacks, termed FL-DSA. A lightweight model involving the IoT Routing Attack Dataset (IRAD), which comprises Hello Flood (HF), Decreased Rank (DR), and Version Number (VN), is used in this technique to increase the detection efficiency. The attacks on IoT threat the security of the IoT system since they mainly focus on essential elements of RPL. The components include control messages, routing topologies, repair procedures, and resources within sensor networks. Binary classification approaches have been used to assess the training efficiency of the proposed model. The training step includes the implementation of machine learning algorithms, including logistic regression (LR), K-nearest neighbors (KNN), support vector machine (SVM), and naive Bayes (NB). The comparative analysis illustrates that this study, with SVM and KNN classifiers, exhibits the highest accuracy during training and achieves the most efficient runtime performance. The proposed system demonstrates exceptional performance, achieving a prediction precision of 97.50%, an accuracy of 95%, a recall rate of 98.33%, and an F1 score of 97.01%. It outperforms the current leading research in this field, with its classification results, scalability, and enhanced privacy. Internet of Things (IoT); Linear Discriminant Analysis (LDA); IoT Routing Attack Dataset (IRAD); Hello Food (HF); Decreased Rank (DR); federated learning; deep learning +
Footnote †: journal: _Sensors_
the capacity to connect, communicate, and collaborate effortlessly [7]. This interconnected-edness offers extraordinary prospects for efficiency, productivity, and convenience across multiple disciplines. IoT allows for remote patient monitoring, individualized treatment plans, and predictive analytics in healthcare, eventually boosting healthcare outcomes and saving costs [8]. IoT provides intelligent infrastructure management, efficient resource allocation, and increased public safety in smart cities through real-time data insights [9; 10]. IoT revolutionizes industrial processes by allowing for predictive maintenance, supply chain optimization, and intelligent manufacturing, generating significant increases in operational efficiency and cost reductions [11; 12]. In addition, IoT has entered our personal living spaces, allowing us to use a variety of electronic gadgets at home while improving energy management and enhancing security systems. [13; 14]. The IoT has the capability to change various industries, make processes more efficient, and improve the living standards of different communities across the globe [15; 16]. The rapid growth of IoT has also been marked by several challenges, one of the most significant being the issue of cybersecurity [17; 18]. People utilize electronics extensively; hence, cyberattacks happen increasingly often. The general purity of IoT systems is in danger because of security loopholes, privacy issues, and attack opportunities [19; 20]. As it occurs, the possibility of launching attacks in the RPL is a serious security concern. These assaults may cause significant gaps and illegal access, undermining the stability of data transmission in networks. [21]. The increasing safety issues have been addressed by IoT collaborative learning [22; 23; 24].