1 Introduction

Wireless Sensor Networks (WSNs) have ascended to a position of significance in contemporary technology, forming self-organizing systems characterized by the presence of numerous energy-constrained microsensors and at least one central node [1,2,3]. Within the intricate architecture of a WSN, intelligent, low-power sensor nodes collaborate with high-power sinks to establish connections, relying on specific transmission protocols. The continuous advancement of WSN technology stands as a linchpin for modern applications, acting as a catalyst that propels the Internet of Things (IoT) into the forefront and facilitates the widespread adoption of intelligent IoT devices [2].

The expansive realm of the Internet of Things encompasses a myriad of innovations, providing a seamless network presence virtually anywhere it extends [4]. This transformative influence has manifested in various domains, including but not limited to smart buildings, military applications, agriculture, smart cities, and monitoring systems, underscoring the versatility and impact of IoT technologies [5, 6]. Recent strides in ad hoc wireless technology have further augmented the capabilities of WSNs, empowering them to establish arbitrary connections between devices, regardless of their affiliation with existing infrastructures [7].

The instrumental role of WSNs extends to the evolution of smart city environments within the IoT landscape. In this context, WSNs deploy smart systems that possess the remarkable ability to be automatically and custom-built. These wireless sensor networks facilitate the seamless transmission, storage, and sharing of information within confined areas, thereby playing a pivotal role in shaping the transformative potential of the IoT [1]. As a technology with far-reaching implications, the multifaceted applications of WSNs continue to unfold, solidifying their status as a cornerstone in the ever-expanding domain of the Internet of Things.

The anticipated evolution of wireless technologies in the next generation is poised to support an extensive number of connections, deliver the fastest transmission rates, and significantly reduce energy consumption and transmit delays [8,9,10,11,12,13,14,15,16]. The widespread implementation of Internet of Things (IoT) systems in smart sectors is attributed to the concurrent development of Wireless Sensor Networks (WSNs) and IoT technologies [17,18,19,20,21]. However, the progress of IoT devices is hindered by limitations in processing power and energy resources [22,23,24,25,26,27], presenting formidable challenges to the overall advancement of IoT systems.

In many IoT networks, sensor nodes play a pivotal role by transmitting sensor data to a base station for subsequent processing [28]. Addressing the challenges faced by IoT devices and striving to enhance connectivity, profitability, data transfer, flexibility, and efficiency, the implementation of effective multipath routing in WSNs becomes imperative. Despite this recognition, the development of efficient connectivity and innovative routing algorithms for WSNs and IoT constitutes a complex undertaking. Overcoming challenges such as the inherent instability of low-power wireless systems and resource constraints is crucial, as these factors often lead to deficiencies in meeting Quality of Service (QoS) parameters.

The dynamic nature of WSNs introduces complexities where wireless channel connections among devices and conventional routing techniques become impractical due to the high degree of topology flexibility. Consequently, existing models tend to focus on the most fundamental routing requirements, necessitating innovative approaches to overcome the difficulties encountered in creating routing protocols [29,30,31,32,33]. To maximize system reliability, enhance fundamental QoS standards, and implement new services, researchers need to consider additional features such as achieving a high packet delivery ratio, minimizing latency, ensuring data protection, optimizing energy efficiency, and incorporating dynamic communication protocols [29]. Thus, a multifaceted approach to routing protocols, encompassing multiple routing methods based on artificial intelligence (AI) optimization techniques, remains an essential requirement for numerous IoT systems, complementing the aforementioned necessities [34,35,36]. This holistic perspective ensures that routing protocols not only meet the foundational requirements but also address the intricate challenges posed by the dynamic and resource-constrained nature of IoT environments.

In the emerging field of swarm intelligence [30], a "swarm" represents a distributed system inspired by the collective behavior observed in insect societies. In the context of sensor appliances, there is a current demand for networking solutions that are not only simple and cost-effective but also enhance reliability. A challenging aspect of this endeavor involves addressing a multimodal optimization problem where performance needs to be maximized while minimizing delays, providing an alternative perspective on the complexities of routing.

To determine optimal paths in Wireless Sensor Network (WSN)-based Internet of Things (IoT) devices, bio-inspired evolutionary techniques, particularly swarm intelligence, have gained prominence. Two notable examples of such techniques are Ant Colony Optimization (ACO) and Particle Swarm Optimization (PSO) [37,38,39,40,41]. The fundamental concept underlying these algorithms involves iterative cost evaluation. Initially, a function is applied to a group, and subsequently, the cost or fitness is updated based on the modifications made to the group, typically through group operations. Through this iterative process, each choice is compared to the best choice, allowing for the determination of the most favorable course of action.

The effectiveness of these algorithms lies in their ability to derive optimal values from the population, ultimately leading to the identification of the best routing path. By leveraging the collective intelligence and adaptability inherent in swarm behaviors, ACO and PSO provide robust solutions for optimizing routing in WSN-based IoT devices. The iterative nature of these algorithms, mimicking the iterative decision-making processes observed in natural swarms, contributes to their capability to converge towards efficient and effective routing solutions in dynamic and resource-constrained environments.

In this work, the Capuchin Search Optimization (CSO) method takes center stage, contributing to the development of a groundbreaking multipath routing protocol designed to generate a diverse array of paths. This protocol, named Capuchin Search Optimization Routing Protocol (CSORP), is specifically tailored to enhance Quality of Service (QoS) in Wireless Sensor Networks (WSN) for Internet of Things (IoT) devices. Figure 1 illustrates the structure of a WSN for IoT devices, showcasing a multihop path and the strategic use of gateways to facilitate the delivery of sensed data from the source to the end user.

Fig. 1
figure 1

Assembly of wireless sensor network based Internet of Things devices

The diagram provides a visual representation of the WSN architecture, highlighting the interconnected nodes and the path traversal facilitated through multiple hops. The introduction of gateways plays a crucial role in ensuring efficient data transmission, allowing end users to access information seamlessly from any location at any time. The system's architecture empowers a source node to make informed decisions by selecting the optimal route for information transfer. This decision-making process involves evaluating a set of alternative paths, which are defined by calculating a feature subset. The feature subset serves as a crucial parameter in determining the best optimal route for data transfer within the WSN [31].

By leveraging the capabilities of the CSO method, CSORP aims to optimize the routing process in WSNs for IoT devices. The multipath approach, depicted in Fig. 1, not only enhances the robustness of data transmission but also contributes to improved QoS metrics. The integration of CSO into the routing protocol signifies a departure from traditional methods, emphasizing the adaptability and efficiency inspired by the social behaviors of capuchin monkeys. This innovative approach aligns with the broader goal of addressing the challenges posed by dynamic WSN environments, offering a promising solution to achieve optimal routing and elevate the overall performance of IoT devices within wireless networks.

Routing protocols in wireless transmission play a crucial role in determining energy efficiency by influencing how data is forwarded in a network. Traditional protocols like Ad Hoc On-Demand Distance Vector (AODV) and Destination Sequenced Distance Vector (DSDV) focus on establishing and maintaining routes, impacting energy efficiency by contributing to overhead and control message exchange. Energy-Efficient Ad Hoc Distance Vector (EEADV) and Energy-Aware Routing (EAR) protocols aim to enhance energy efficiency by considering residual energy levels when selecting routes, prolonging the network's overall lifetime. Additionally, multipath routing protocols, such as Ad Hoc On-Demand Multipath Distance Vector (AOMDV), distribute traffic across multiple paths, reducing congestion on individual routes and potentially improving energy efficiency. The choice of routing protocol is crucial, as it determines how nodes communicate, exchange information, and use energy, directly impacting the performance and longevity of wireless networks, especially in resource-constrained scenarios like sensor networks or IoT applications.

The innovative approach of the Capuchin Search Optimization Routing Protocol (CSORP) introduces the concept of multiple pathways, deviating from the reliance on a single route, thus enhancing the conventional Destination Sequenced Distance Vector (DSDV) method. CSORP stands out by incorporating a sophisticated optimization mechanism that empowers users to select the most suitable route to target nodes, with the overarching goals of achieving load balancing, ensuring high-quality service, and conserving power.

In contrast to structured networks, the Mobile Adhoc Network (MANET) lacks a predefined organizational structure [32]. However, by leveraging computational intelligence-based methods such as swarm-based algorithms, MANETs can be rendered as self-organized as possible. This inherent flexibility addresses the challenges posed by the dynamic nature of MANETs, enabling adaptive and efficient routing.

The CSORP proposal presents a novel and improved routing technique explicitly designed to enhance Quality of Service (QoS) metrics in Wireless Sensor Network (WSN)-based Internet of Things (IoT) devices. By optimizing features such as the ratio of packet delivery, packet loss, average delay on end-to-end transmission, and bandwidth, CSORP addresses the multifaceted challenges inherent in WSN environments. The integration of the Capuchin Search Optimization (CSO) method into CSORP further enriches its capabilities, infusing adaptability inspired by the social behaviors of capuchin monkeys.

Wireless Sensor Network (WSN)-based Internet of Things (IoT) devices encounter significant challenges, encompassing heightened bandwidth demands, minimal latency requirements, real-time data delivery, acceptable noise levels, and low loss rates. These challenges compound the intrinsic difficulties faced by WSNs, including resource constraints, implementation complexities, availability concerns, and the imperative for dependable operation. The constraints extend to critical resources such as energy consumption, memory, bandwidth, and computing power, posing a complex landscape for effective operation [33].

Given the alignment of these challenges with the objectives of the paper, the chosen approach involves a population-based searching algorithm inspired by the social behavior of flocking birds. This innovative algorithm aims to address the multifaceted constraints imposed by WSN-based IoT environments, presenting a solution that accounts for the intricate interplay of various resources and operational parameters.

The proposed algorithm was subjected to rigorous evaluation by comparing its performance against established routing protocols, namely Destination Sequenced Distance Vector (DSDV), Dynamic Source Routing Protocol (DSR), Adhoc On-Demand Distance Vector (AODV), and Improved Destination Sequenced Distance Vector (I-DSDV). The evaluation process employed the Network Simulator-3, a robust simulation tool, to comprehensively assess and compare the outcomes [34, 42].

This comparative analysis serves to validate the efficacy of the proposed algorithm by benchmarking it against established routing protocols. The choice of these protocols for comparison reflects a comprehensive evaluation, considering both proactive and reactive approaches in the realm of routing strategies. The outcomes of this evaluation provide insights into the algorithm's performance, shedding light on its potential advantages and contributions to addressing the complex challenges faced by WSN-based IoT devices.

The selection of the Capuchin Search Optimization (CSO) technique for this inquiry is underpinned by several compelling reasons, as articulated in the following statements:

  • Inspiration from Real Capuchins: CSO's quantitative estimates draw inspiration from the behaviors of real capuchin monkeys, aligning closely with the specific problem at hand. This unique inspiration enhances the algorithm's suitability for addressing the challenges inherent in the wireless system optimization for multi-path routing in WSN-based IoT devices.

  • Social Hierarchy of Capuchins: The organizational structure of capuchins, where a dominant male (∝ male) and sometimes females lead others to a food source, provides a foundation for the CSO technique. The initial random placement of capuchins at the first level mimics this hierarchical structure, contributing to the algorithm's adaptability and efficiency.

  • Advantages over Other Optimization Algorithms: Comparative evaluations indicate that CSO outperforms other optimization algorithms in terms of reliability, resolution, and computational time. The leader–follower dynamics inherent in the algorithm contribute to enhanced solution quality with each iteration, showcasing the efficacy of the Capuchin Search Algorithm (CSA).

  • Validation through Simulation Studies: Recent simulation studies have demonstrated the validity of CSO as a technique for optimizing wireless systems, particularly in the context of multi-path routing. CSO's ability to achieve higher throughput and provide more precise outcomes surpasses other optimization approaches such as Ant Colony Optimization, Artificial Neural Networks, Genetic Algorithms, and Genetic Algorithms (ACO).

  • Straightforward, Practical, and Effective: CSO stands out as an extremely straightforward, practical, and effective optimization technique. Its ease of implementation, coupled with its utility for both engineering and scientific research, positions it as a versatile tool. The algorithm's efficiency in optimization tasks, quick task completion, and adaptability make it a favorable choice for addressing the complexities of WSN-based IoT device routing.

In summary, the selection of CSO for this inquiry is grounded in its biologically inspired foundations, demonstrated advantages over other algorithms, and its practical applicability, collectively making it a promising and effective solution for optimizing wireless systems in the context of multi-path routing for WSN-based IoT devices.

The remaining article is structured as follows: Section 2: Explore existing routing protocols in WSNs and their limitations in meeting QoS requirements and discuss related research on optimization algorithms and their applications in WSNs. Section 3: Present the system model for WSN-based IoT devices, including the arrangement of sensor nodes and high-power sinks and illustrate the architecture of CSORP, emphasizing its multipath routing capabilities and optimization features. Section 4: Describe the experimental setup using the Network Simulator-3 (NS-3) and specify the parameters, settings, and variables used in the evaluation. Section 5: Present the findings from the experimental evaluation, including packet delivery ratio, latency, mobility speed, packet loss, and routing load and compare the performance of CSORP with other routing protocols, highlighting its advantages. Section 6: Highlight the effectiveness of CSORP in addressing the identified challenges.

2 Related works

The conventional techniques mentioned above are indeed effective for sensor node localization; however, their drawback lies in the substantial processing power they require. As the computational complexity of these techniques increases, so does the demand for processing power. To mitigate this challenge, researchers have turned to bio-inspired meta-heuristic techniques, known for rapidly uncovering optimal or nearly ideal solutions while minimizing computational costs. These techniques are recognized for their efficiency in terms of reduced memory usage and processing time.

In a recent comprehensive review by the authors [43], the conceptual landscape of bio-inspired meta-heuristic techniques was explored. These algorithms, drawing inspiration from nature, have emerged as some of the most effective tools for solving various optimization problems [44]. Their appeal lies in their ability to mimic natural processes, allowing them to efficiently navigate complex problem spaces.

In the context of a wireless sensor network, node localization is considered an unrestricted optimization problem [45]. The challenges inherent in node localization, coupled with the resource constraints of sensor nodes, make the adoption of bio-inspired meta-heuristic algorithms particularly relevant. By leveraging these nature-inspired approaches, researchers aim to strike a balance between achieving high localization accuracy and conserving the limited resources of the sensor nodes.

Several studies [46,47,48] have extensively assessed and compared the performance of bio-inspired algorithms in tackling the node localization problem. Among these, the authors have proposed a wireless sensor network (WSN) localization approach based on Particle Swarm Optimization (PSO) in their works [49, 50]. This PSO-based approach draws inspiration from the genetic algorithm, simulating the flocking behavior patterns observed in birds. Notably, the simplicity of implementing this computational technique [51,52,53] adds to its appeal and practicality.

The suggested localization technique operates under the assumption that WSNs feature a centralized architecture, enabling all nearby base stations to connect with a single centralized authority where PSO can be executed. However, a notable limitation of this approach is its susceptibility to premature convergence, potentially getting stuck in a local optimum. This aspect highlights a challenge in the proposed method, emphasizing the need for further refinement to address convergence issues and enhance the robustness of the localization technique in WSNs.

The Flower Pollination (FP) algorithm, introduced in [54], stands as an optimization method inspired by the pollination process observed in flowers. This algorithm leverages the natural behavior of flowers pollinating each other with the fundamental goal of determining the optimal positions of unknown nodes. Through iterative processes, the algorithm gradually brings particles closer to the optimum, aiming to enhance the overall optimization.

Initially evaluated in a smaller region with a large number of access nodes, the results of this approach were deemed insufficient to demonstrate its scalability. The algorithm's complexity was further heightened by the inclusion of numerous rules, warranting careful consideration of its applicability and efficiency in different scenarios.

In a related context, [55] proposes a node localization technique based on a CS algorithm. However, this method faced challenges related to the slow convergence to the ideal value, attributed to constants in the randomized walk scale factor and mutation probability. This highlights a crucial aspect that demands attention for further refinement, indicating the need for adjustments to enhance the convergence speed and overall performance of the proposed CS algorithm for node localization.

In a distinct study [56], researchers introduced modifications to the randomized walk scale factor and mutation probability of the standard Cuckoo Search (CS) algorithm [57] to enhance the effectiveness of global exploration. Meta-heuristic approaches, known for selecting the optimal solution from a set of possibilities, were employed in this study. In each iteration, the algorithm replaces the worst candidate solutions with new ones, and the likelihood of replacement is determined by the mutation probability. This strategic adjustment resulted in an accelerated convergence rate for the problem at hand.

Comparative analysis with well-known meta-heuristic algorithms, including Genetic Algorithms (GA), Simulated Annealing (SA), Cuckoo Search (CS), and Particle Swarm Optimization (PSO), demonstrated the superior performance of the modified algorithm. Even after achieving a rapid convergence rate, the algorithm continues iterating until it reaches the maximum rate of convergence, effectively utilizing the constrained capabilities of the nodes responsible for data collection. This sustained performance showcases the algorithm's robustness and efficiency compared to established meta-heuristic counterparts.

Multipath routing has traditionally been employed in earlier studies to mitigate data packet dropout rates and extend network lifetimes. However, the effectiveness of multipath protocols for routing on the network has often been overlooked in previous research. In this study, our focus shifts to the frequent use of mobile Wireless Sensor Networks (WSNs) in accommodating various Internet of Things (IoT) application environments. Upon reviewing several background strategies employed to address the challenge of efficient route selection in routing algorithms, it becomes evident that further research is warranted in this domain.

For instance, in WSN-based IoT applications, the objective is to discover multiple paths for transporting information from one source to another while minimizing energy consumption. This poses a critical consideration for enhancing the overall efficiency of routing protocols in dynamically changing environments, such as those encountered in mobile WSNs supporting diverse IoT applications. The study underscores the need for advancements in routing algorithms to ensure optimal path selection, energy conservation, and robust performance in the context of evolving IoT application scenarios.

The paper makes several notable contributions to the field, including:

  1. 1.

    Design and Development of an Effective Scheduling Algorithm: Introducing a novel scheduling algorithm that systematically identifies the optimal path for data transfer within a network. The algorithm takes various factors into consideration to optimize the decision-making process associated with routing.

  2. 2.

    Selection of the Best Route Based on Effective Outcomes: The proposed method incorporates a mechanism for selecting the most optimal route, guided by predefined criteria. Factors such as reliability, efficiency, and other relevant metrics are considered, ensuring the algorithm identifies routes expected to yield the best results.

  3. 3.

    Enhancement of Quality of Service (QoS) Metrics: The suggested approach focuses on improving key QoS metrics, including end-to-end delay, packet delivery rate, and bandwidth utilization. By optimizing resource distribution and routing decisions, the algorithm aims to elevate the overall effectiveness and efficiency of the network.

  4. 4.

    Performance Evaluation Using Network Simulator-3 (NS-3): The proposed approach undergoes thorough evaluation through simulations conducted with the Network Simulator-3 (NS-3) tool. This evaluation not only provides insights into the algorithm's performance but also facilitates a comparative analysis with other existing approaches, aiding in the assessment of its efficacy and superiority.

In summary, this paper focuses on the development of an efficient scheduling approach, optimal route selection, QoS metric improvement, and performance evaluation through simulations conducted with NS-3. The primary goal is to propose a robust routing recovery method that accommodates the movement of a mobile sink while continuously evaluating and updating the optimal transmission path. This approach is designed to enhance network stability, improve efficiency, reduce power consumption, extend the system's lifecycle, and bolster overall network reliability and stability. The study achieves these objectives by developing fault-tolerant routing models.

To achieve a comprehensive solution, the study aims to propose a potent routing recovery method that facilitates the movement of a mobile sink, enhances multi-path routing algorithms, employs a Capuchin Search Optimization (CSO)-based routing protocol, incorporates sink mobility, and addresses routing concerns such as reliability, delay, and energy constraints. The holistic approach outlined in the study seeks to contribute to advancements in routing protocols, particularly in the context of mobile sink scenarios, with the ultimate goal of improving the overall performance and reliability of wireless sensor networks.

3 System model

In this section, the proposed routing strategies for WSNs with mobile sinks are presented and discussed. The routing problem is approached from a multifunctional perspective, aiming to achieve an optimal solution that enhances performance and reduces delay. The suggested method attempts to efficiently transfer data between sinks and sources through a wireless channel with maximum bandwidth, reduced latency, communication cost, and power consumption. Mobile networks are used as destination nodes for information collection because of their mobility. To create a mobile sensor network environment, it is based on both the proactive routing environment and the conventional clustering model. Fault—tolerant technique for routing algorithms is used to create a number of transmitting paths between the sources and sink node in order to improve the consistency of transmission of data. Although this approach increases the network's ability to help with task scheduling and communication bandwidth, it appears to boost energy usage and route structure intricacy. Additionally, it increases the reliability and dependability of transmission of data. It is convenient way that is frequently employed to achieve error detection at the protocol stack.

3.1 CSO algorithm

Live capuchins served as inspiration for the CSO algorithm. The capuchin tribe is led by the dominant male. The male and female of some species lead other capuchins to a food source. The placement of capuchins is initially determined at random in the first level. In terms of reliability, stability, and time consumption, the CSO algorithm outperformed the other optimization algorithms. Followers receive information from the leaders. It is a benefit of the CSO algorithm. As a result, each iteration can produce solutions of higher quality. The starting position of the capuchins is determined using Eq. (1). The upper and lower bounds of different variables are employed in Eq. (1) to establish the starting position of capuchins.

$$X_i=U_j+n\times\left(U_j-L_j\right)$$
(1)

where, \({X}_{i}\) is the ith position of capuchin, \({U}_{j}\) is the upper limit of \({i}^{th}\) capuchin, \(n\) is the random number, \({L}_{j}\) is the lower limit of \({i}^{th}\) capuchin. The location of \(\alpha\) capuchins in the group is given by,

$${X}_{j}^{i}={F}_{j}+\frac{P{({v}_{j}^{i})}^{2}\text{sin}(2\theta )}{g}, 0.05\le n\le 0.1$$
(2)

where, \({X}_{j}^{i}\) is the location of \(\propto\) capuchins in the \({j}^{th}\) point, \({F}_{j}\) is the food location in the \({j}^{th}\) place, \(P\) is the possibility of equilibrium established by the capuchins tail, \(g\) is the gravitational pull, \(\theta\) is the change in angular position, \({v}_{j}^{i}\) is the velocity of \(\alpha\) capuchins in the \({j}^{th}\) point and \(n\) is the random number. In Eq. (2), the position of the \(\alpha\) capuchins is rationalized depend on the angular position \(\theta\), which represents the place of the food availability. The variables involved in calculating the rate of speed of the \(\alpha\) capuchins at the \({\text{j}}^{\text{th}}\) point, denoted as \({\text{vp}}_{\text{j}}^{\text{i}}\) are as follows:

$${vp}_{j}^{i}={C}_{I}{v}_{j}^{i}+{e}_{1}{(X}_{bj}^{i}-{X}_{j}^{i})n+{e}_{2}({F}_{j}-{X}_{j}^{i})$$
(3)
$$\theta =1.5 n$$
(4)

where, \({X}_{bj}^{i}\) is the best location of ith \(\alpha\) capuchins, \({e}_{1}\) and \({e}_{2}\) are the exponential functions, \({C}_{I}\) is the coefficient of inertia.

$${e}_{1}or {e}_{2}= {C}_{C}{e}^{-{C}_{C1}(\frac{I}{{I}_{maximum}}{C}_{C2})}$$
(5)

where,\(I\) is the no. of iteration, \({I}_{maximum}\) is the maximum no. of iteration, \({C}_{C}\) is the coefficient of constant. Each \(\alpha\) capuchin updates their locations by leaping, jumping, crawling, and moving in different directions. \({e}_{1}\) and \({e}_{2}\) are critical parameters for combining exploration and exploitation.

3.1.1 Mechanism of jump and walking

When leader capuchin can't get food on the trees, then they use jumping and crawling movements. They can jump from one location to another in this situation. Based on the leap movement, \(\propto\) capuchin's position as a leader has been upgraded as follows:

$${X}_{j}^{i}={F}_{j}+\frac{{P}_{e}P{({v}_{j}^{i})}^{2}\text{sin}(2\theta )}{g}, 0.1\le n\le 0.2$$
(6)

where, \({P}_{e}\) is the chance of capuchin flexibility from mobility for leaping from one end of a river to the other. The flexibility chance assists the CSO algorithm in doing a wide base search. Equation (6) employs the flexibility chance to improve the ground leaping range. Whenever \(\alpha\) capuchins are unable to obtain food in the trees, their position is recalculated as follows:

$${X}_{j}^{i}={X}_{j}^{i}+{v}_{j}^{i}, 0.2\le n\le 0.4$$
(7)

One benefit of the CSO approach is its capability to consider multiple strategies for updating the location of the \(\alpha\) male in the exploration area. This enables the \(\alpha\) male to effectively monitor the new groups by informing its position using various approaches.

3.1.2 Mechanism of swing

The \(\alpha\) capuchins can also find food by swinging. As a result, \(\alpha\) capuchins' locations are changed depend on swing action as follows:

$${Y}_{j}^{i}={F}_{j}P\times \text{sin}\left(2\theta \right), 0.2\le n\le 0.7$$
(8)

where, \({Y}_{j}^{i}\) is the updated position of \(\propto\) capuchins.

The \(\alpha\) capuchins can climb on other trees in search of their food. Thus, based on the climber function supplied in Eq. (9), the position of the \(\alpha\) capuchins can be upgraded.

$${X}_{j}^{i}={F}_{j}+P\left({v}_{j}^{i}-{v}_{j}^{i-1}\right), 0.7\le n\le 1.0$$
(9)

where \({v}_{j}^{i}\) is the current rate of speed of the ith capuchin and \({v}_{j}^{i-1}\) is the previous rate of speed of the capuchin.

3.1.3 Different paths of motion

The \(\alpha\) capuchins' most recent attempt to find food is migration in various new locations in search of a better source of food. As a result, this capability enables \(\alpha\) capuchin to precisely search the solution space. To fully exploit the search area and find optimal solutions, Eq. (10) is utilized:

$${X}_{j}^{i}={e}_{j}\times \left\{{L}_{j}+n \times ({U}_{j}-{L}_{j})\right\}$$
(10)

This equation calculates the current location, \({X}_{j}^{i}\), of the groups in the jth direction. It utilizes the random factor \({e}_{j}\) along with the lower bound \({L}_{j}\) and upper bound \({U}_{j}\), scaled by a factor \(n\).

Furthermore, the followers update their location using the following formula:

$${X}_{j}^{i}=\frac{{X}_{\alpha j}^{i}+{X}_{j}^{i-1}}{2}$$
(11)

where \({X}_{j}^{i}\) are the followers current position in the jth direction, \({X}_{j}^{i-1}\) is the former position of the followers in the jth direction, and \({X}_{\alpha j}^{i}\) is the location of \(\alpha\) leader. Figure 2 shows the flow chart of CSO algorithm and Algorithm 1 shows the pseudo code of proposed CSO.

Fig. 2
figure 2

Flow chart of CSO Algorithm

Algorithm 1
figure a

Pseudo code of Proposed CSO

In order to find the optimal route while minimizing energy consumption, we have employed the CSO algorithm. The algorithm begins by randomly selecting a set of solutions from a pool of options. These initial solutions serve as starting points for further exploration. To generate an initial solution, all available options in the set are considered. Each solution's fitness value is then calculated using Eq. (4), which helps evaluate its effectiveness. By comparing the fitness values, we can identify the solutions that provide the best starting points both globally and locally. Next, the nodes of the new solutions are calculated, and new solutions are generated based on the existing ones. Using these new solutions and their corresponding nodes, the optimal value of each solution is determined. This process continues for a specified number of iterations. Throughout the iterations, the algorithm keeps track of the superior solution among the alternatives. This is done by continuously evaluating the predicted value and comparing it to other solutions. If a superior solution is identified, it replaces the existing one. By repeating this iterative process and considering predicted values, the algorithm aims to converge towards the best solution that offers both optimal routing and minimal energy consumption.

During the optimization process, CSO creates sets of solution vectors (also referred to as new locations), which are subsequently used in simulation to gauge performance. CSO seeks to locate the ideal spot using the search space (solution vector). After receiving a location from CSO, the simulation model runs each solution into the Multipath Destination Sequenced Distance Vector one at a time. The WSN actual implementation and model parameters are now loaded into network simulator-3 and properly configured. To compare the default and optimised CSORP, we analysed system efficiency QoS taking into account the following five metrics:

Packet delivery ratio

It is the proportion of accurately and completely acquired packets with respect to the entire amount of data generated by the sources, indicating the effectiveness of data transmission in the intended direction.

Average end-to-end delay

It represents the actual period taken for incoming packets to transport from their source to their desired location, measuring the overall latency or delay experienced during packet transmission.

Throughput

Throughput is the measure of a receiver's capacity to receive packets from a transmitter. It is determined by breaking down the entire quantity of packets a recipient has received by the time it requires for them to start getting the last packet.

Packet loss

Packet loss indicates the amount of packets of data that fail to be successfully transmitted within a network, representing the loss of information during transmission.

Normalized routing load

It is the average number of packets required to transmit a one packet of data. It represents the load imposed on the routing system and is normalized to provide a comparative measure of the efficiency of routing protocols.

4 Simulation setup

The Linux OS-based Network Simulator-3 is used in this study's research to create the proposed CSORP. This study compares the routing protocols CSORP, AODV, DSDV, I-DSDV, and DSR. For simulation purposes, 30 randomly distributed deployment areas with a size of 200m X 200m are used in the trials. To facilitate the evaluation of transmission among widely dispersed nodes, a rectangular space is chosen as the communication environment. In this space, the Bluetooth protocol is utilized to manage the medium access and define the architectural level for Wireless Personal Area Networks (WPANs). Within this communication medium, Wireless Sensor Networks (WSNs) operate. Each data packet transmitted in this network has a maximum size limit of 30 bytes, ensuring efficient and concise data exchange.

Figure 3 depicts the suggested Internet model for the smart home system. With the initiation of the IoT, there is a vision of a highly interconnected world where various products and services are seamlessly connected. The IoT provider known as very high frequency communication have the potential to offer a completely new set of apps and services that were previously unavailable. Therefore, high frequency has been added to the radio spectrum for fifth generation connection by overcome.

Fig. 3
figure 3

Proposed Internet model for Smart home system

As illustrated in Fig. 3, we propose an internet model for smart home system in which a fraction of the peripheral processing capabilities are used as a peripheral storage (cloud) of obtained sensor information that reaches the shore on a regular basis. A central internet cloud eventually emerges from the edge clouds. For the benefit of the consumers, all of the sensor input is combined, removed, and analysed to offer real-time smart home monitoring. When the WSN identifies a significant demand, the collected information and sensor data are routinely stored at network edges near users. Data can be gathered for monitoring home appliances like lights, fans, thermostats, air conditioners, etc. using the system model in Fig. 3. The testing and simulation results demonstrate that the architecture successfully supports IoT ability to exchange the information. We successfully sent and collected a response from the installed sensory network to the path, which was then forwarded to a desktop and a phone linked to the conventional network through a 5G broadband Internet connection.

5 Results and discussion

Five performance metrics for the proposed CSORP are calculated and compared to the AODV, DSDV, I-DSDV, and DSR routing protocols. Packet Delivery Ratio, Throughput, Average End-to-End Delay, Packet Loss, and Normalizing Routing Load are these performance metrics.

5.1 Packet delivery ratio

A comparison of packet distribution speeds among different routing protocols, namely DSDV, I-DSDV, AODV, DSR, and CSORP are showcased in Fig. 4. Among these protocols, AODV exhibited the lowest packet delivery ratio, indicating a lower efficiency in delivering packets to their intended destinations. On the other hand, the CSORP protocol achieved the highest packet delivery ratio, reaching an impressive rate of 88%. This suggests that CSORP demonstrates superior performance in terms of successfully delivering packets within the network. The access point in the smart home system can only move slowly at 0.5 m/sec due to the speed of data collection; as a result, the CSORP method offers a maximum packet distribution speed as shown in Fig. 4.

Fig. 4
figure 4

Performance of CSORP in Packet Delivery Ratio

5.2 Average of end-to-end delay

The statistical findings of a delay time, demonstrating its high efficacy as a powerful tool in Fig. 5. It proves that among all routing protocols, Bluetooth with CSORP has the minimal end-to-end delay. This demonstrates the CSORP's remarkable suitability for delay-sensitive applications, which is compliant with the Bluetooth standard. A proactive routing protocol like CSORP makes a lot of routes to a destination immediately accessible. To say it other way, router detection causes no delays. Instead, when estimating the duration it needs for a packet to go from the constant bit rate origin to the target, it accounts for the queuing for each packet distribution as well as the delay caused by the route discovery procedure. Even correctly delivered information packets those that totally reach the endpoints indicated by the protocol I-DSDV show the greatest preliminary setup latency, which is approximately 79 ms. While CSORP has the lowest latency, at only 35 ms, this may be ascribed to CSORP being a multi—path procedure built on databases, which requires route data to be maintained in order to reduce the time required for route identification. Mostly other practices, however, depend on on-demand route direction.

Fig. 5
figure 5

Performance of CSORP in End to End delay average

5.3 Throughput

In general, the network throughput shows a continuous increase throughout the simulation period. Among the routing protocols studied, CSORP achieves the highest throughput and demonstrates effective behavior across various mobility scenarios. Several factors contribute to the high throughput observed in CSORP. Firstly, when a packet is initially transmitted, it is delayed until the optimal route to the intended destination is determined. This helps ensure that the packet follows the most efficient path, thereby improving overall throughput. Additionally, CSORP implements a mechanism to postpone the broadcasting of routes which are prone to alter, thereby minimizing fluctuations in the databases. Reduce the number of route entries with a single identifier by delaying the broadcast of uncertain routes. This, in turn, enhances the accuracy of available routes and contributes to the improved performance of CSORP, particularly at a mobile speed of three packets per second, as depicted in Fig. 6.

Fig. 6
figure 6

Performance of CSORP in Throughput

5.4 Packet loss

Figure 7 presents a comparison of the five techniques based on the amount of data discarded by each method. AODV consistently exhibits the highest data loss rate due to its packet queuing mechanism. In the event of a node failure, AODV sends a request packet and waits for a reply to retrieve new data. However, if packets reach the end of the AODV queue without receiving a response within the timeout period, they are dropped. DSDV, on the other hand, experiences some data loss as it takes time to gather data. If a node using DSDV needs to transmit information but there is no available route, it may delay the transmissions. If the transmission stack is full, these delayed transmissions are eventually discarded. In sparse networks, CSORP exhibits relatively minimal data loss compared to the other methods. This is attributed to CSORP's ability to provide alternate routes in the event of network failures, reducing the likelihood of data loss. In the context of a smart home network, the proportion of packet losses can be significantly high. The sparseness of the network in the smart home setting contributes to the occurrence of dropped packets.

Fig. 7
figure 7

Performance of CSORP in Packet loss

5.5 Normalizing routing load

Figure 8 illustrates the effectiveness of CSORP in terms of normalized routing load and delay time. CSORP exhibits the highest routing load parameter due to the significant number of path requests made. On the other hand, DSDV and AODV show similar values in comparison, while the I-DSDV method has the lowest number of sent packets. This observation clearly indicates that a higher routing load is often associated with better packet delivery metrics. Despite the increased routing load in CSORP, it achieves superior packet delivery performance compared to other methods.

Fig. 8
figure 8

Performance of CSORP in Normalizing Routing load

While the CSORP (Capuchin Search Optimization-based Routing Protocol) demonstrates notable improvements in energy efficiency and QoS metrics for WSN-based IoT devices, certain limitations should be acknowledged. One potential limitation is the reliance on the assumption of static energy consumption for routers. In dynamic environments or scenarios where energy consumption patterns fluctuate rapidly, the algorithm's effectiveness might be compromised. Additionally, the proposed CSORP may face challenges in handling network scalability issues, particularly in large-scale deployments, where the optimization of multiple paths could become computationally demanding. The real-world implementation of CSORP may also be influenced by factors such as hardware constraints and environmental variations, which can impact the algorithm's adaptability. Furthermore, while the algorithm enhances packet delivery and reduces end-to-end delay, the actual performance could be influenced by the specific characteristics of the wireless channel, and the algorithm's effectiveness may vary accordingly. Addressing these potential limitations could pave the way for refining CSORP and ensuring its applicability across diverse and dynamic IoT deployment scenarios.

5.6 Energy consumption

Table 1 and Fig. 9 illustrate the relationship between energy consumption and the number of sensor nodes. In the proposed method, the Capuchin Search Optimization Algorithm (CSOA) forms clusters and selects cluster heads based on energy levels. This algorithm offers a rapid convergence rate, where the fitness function value, derived from multiple objective functions, drives the Capuchin Search Optimization Routing Protocol (CSORP) to find optimal paths quickly using the stochastic universal sampling selection procedure. This process identifies the best individuals with probability estimation, reducing complexity and thereby enhancing data transmission while minimizing energy consumption.

Table 1 Energy Consumption
Fig. 9
figure 9

Comparison of Energy Consumption

The results clearly show that the proposed CSORP method outperforms the two existing techniques. Specifically, CSORP reduces energy consumption by 8.3%, 26.6%, 10%, and 18.3% compared to DSDV, I-DSDV, AODV, and DSR, respectively. Consequently, the node's lifetime is extended by approximately 15%, which in turn supports the extension of the entire network's lifetime. Energy conservation is crucial in WSNs, as battery replacement is not feasible frequently.

5.7 Residual energy

As depicted in Fig. 10, the average residual energy increases with the number of sensor nodes across various network densities for the CSORP, DSDV, I-DSDV, AODV, and DSR routing schemes. Specifically, as the node density ranges from 20 to 200, the residual energy of nodes increases from 1.3 to 3 J for DSDV, from 1.42 to 3.04 J for I-DSDV, from 1.24 to 3.01 J for AODV, from 1.2 to 2.8 J for DSR, and from 1.52 to 3.3 J for CSORP. Among these, the DSR scheme exhibits the lowest residual energy, followed by DSDV and AODV.

Fig. 10
figure 10

Residual Energy

This trend occurs because the CSORP algorithm selects the shortest routes with minimal queue lengths while considering the distance between nodes. In contrast, a significant amount of energy is lost when data packets are transmitted through longer routes. The proposed CSORP scheme leverages backpressure algorithms and network coding methods to select optimal routes, thereby consuming less energy along these routes.

5.8 Dead nodes

The results depicted in Fig. 11 show the number of dead nodes for the proposed CSORP scheme compared with DSDV, I-DSDV, AODV, and DSR, indicating a continuous increase as the number of nodes grows. Specifically, the number of dead nodes rises from 16 to 53 for DSDV, 19 to 52 for I-DSDV, 18 to 51 for AODV, 15 to 49 for DSR, and 22 to 58 for CSORP. Despite the higher number of dead nodes for CSORP, the NCBPR routing scheme demonstrates superior performance compared to DRINA and INFRA in terms of dead nodes and network lifetime. This improvement is due to its ability to balance and distribute the network traffic load across classified routes, minimizing node exhaustion.

Fig. 11
figure 11

No. of Dead nodes

Conversely, DSR has a higher number of dead nodes compared to DSDV, primarily because it consumes more energy in balancing the data traffic load and uses nodes with lower energy for data transmission. Additionally, CSORP selects the cluster head based on energy parameters and the distance to the destination node, which helps to prolong the network lifetime and minimize the number of dead nodes in the network.

6 Conclusion and future work

6.1 Conclusion

The proposed CSORP (Capuchin Search Optimization-based Routing Protocol) is a multipath routing protocol designed to achieve high energy efficiency in WSN-based IoT devices. It selects the shortest path among multiple options while considering the energy consumption of routers, thus extending the network's lifetime. CSORP utilizes Capuchin Search Optimization to identify the best paths based on both distance and energy considerations. These paths are then optimized to choose a single optimal route, reducing overall energy usage. The CSORP algorithm significantly increases packet delivery ratio, lowers average end-to-end delay, and reduces overall energy consumption of WSN-based IoT devices. It also enhances other quality of service (QoS) metrics such as throughput, minimizes data packet losses, and normalizes routing load. The algorithm calculates and optimizes the route, leading to efficient and superior performance in extending the WSN's lifetime. The effectiveness of the proposed CSORP in terms of QoS when compared to other routing protocols (DSDV, I-DSDV, AODV, and DSR) is shown by simulation results. CSORP outperforms these protocols and achieves higher QoS levels. CSORP has number of benefits including an 88% packet delivery ratio, a minimum distribution speed of 0.5 m/s, a latency of 35 ms (compared to I-DSDV's 79 ms), mobility speed of three packets per second with less packet loss (0.7), a high routing load parameter of 92%, indicating potential energy savings and energy consumption reduced from 18.3% to 8.3%. Furthermore, real-time applications are made possible by multipath routing algorithms like CSORP, which improves quality of service in IoT environments.

6.2 Recommendation for future work

In future research, the study proposes enhancing the CSORP (Capuchin Search Optimization-based Routing Protocol) by investigating dynamic energy consumption models for routers, improving scalability for large-scale IoT deployments, validating its real-world applicability, integrating robust security mechanisms, exploring hybrid routing approaches, standardizing CSORP for interoperability, and incorporating edge computing principles. These efforts aim to boost adaptability, tackle scalability issues, ensure practical robustness, strengthen security measures, provide versatile solutions for different network scenarios, promote widespread adoption through standardization, and leverage edge computing for localized decision-making, making CSORP a more comprehensive solution for energy-efficient routing in WSN-based IoT environments.

7 Authorship contributions

Karthikeyan M: Writing- Original draft preparation: Writing- Reviewing and Editing. Manimegalai D: Software, Validity tests, Data curation. Karthikeyan R: Formal analysis, Investigation.