our lives, connecting devices via the internet to provide customization and aptitude in various fields. The IPv6 routing protocol for Low-Power and Lossy Networks (RPL) was formally introduced as the default routing protocol for the IoT in 2012 in an effort to connect and support IPv6 for IoT devices [2]. The RPL was developed with resource-constrained devices in mind, making it capable of handling a wide range of IoT-LLN applications. An active source and distance vector routing technique is the RPL. It creates Directed Acyclic Graphs (DAGs) to represent the network topology. A destination-oriented DAG (DODAG) is a DAG that is connected to a single root destination in the RPL. The latest technologies, 5G and 6G, incorporate advanced security techniques to support a vast infrastructure of interconnected IoT and WSN devices designed to move data over networks. RPL is a routing protocol designed for Low-Power and Lossy Networks, which are typically used in IoT- and WSN-based devices to optimize traffic flow in network topology [3]. The study's primary focus on the wormhole attack within the RPL protocol highlights a foundational step in fortifying security for IoT and WSN devices. However, the limited scope may not fully encompass the diverse range of threats these networks face. Translating findings into practical implementation is hampered by hardware and energy constraints, while the dynamic nature of network topology poses adaptation challenges. As the model evolves to tackle multiple RPL attacks, scalability and trade-offs between security and efficiency must be carefully managed. Yet, assumptions, evolving attacks, and resource limitations may temper the model's real-world effectiveness. Navigating these complexities and aligning with regulatory and cost considerations will determine the model's overall impact on enhancing security for resource constrained IoT and WSN systems. The security of IoT nodes, networks, and infrastructure is the most important problem. IoT devices communicate with one another using the routing protocol for Low-power and Lossy Networks (RPL). RPL has a lightweight core, so it does not allow methods for implementing security that require a lot of computation or resources. As a result, security attacks, which may be roughly divided into RPL-specific and sensor-network-inherited assaults, can target both the IoT and the RPL. Rank attacks and wormhole assaults, which are attack types inherited from sensor networks, are among the most worrisome protocol-specific attacks. By consuming, they aim for the RPL components and resources, such as control messages, repair processes, routing topologies, and sensor network resources. The RPL protocol faces many key challenges, i.e., energy consumption, mobility, and density of nodes in terms of scalability. However, in this study, only the key issue of security has been addressed. However, the observation is that as the number of nodes increases in the network, the RPL protocol suffers in terms of quality services. The RPL protocol is commonly used for IoT network routing, but it has been found to be vulnerable to various attacks, including wormhole attacks [4]. However, RPL is vulnerable to multiple attacks due to the lack of a mechanism to monitor child behavior [5]. Three types of attacks against the RPL are the wastage of resources, the malicious alteration of RPL control messages, and the exploitation of network traffic transmission [6]. One of the most common attacks on the IoT and WSNs against the RPL is the wormhole attack, which changes the preferred parent of nodes and disrupts the DODAG tree topology [6]. These attacks can compromise the network and disrupt technology. PCC-RPL was used because it was state-of-the-art methodology at the time. The SLF-RPL is proposed to be an even better version of the PCC-RPL, considering the resource-constrained nature of the RPL in the IoT.