Abstract
In the current health care scenario, security is the major concern in IoT-WSN with more devices or nodes. Attack or anomaly detection in the IoT infrastructure is increasing distress in the field of medical IoT. With the enormous usage of IoT infrastructure in every province, threats and attacks in these infrastructures are also mounting commensurately. This paper intends to develop a security mechanism to detect and prevent the black hole and selective forwarding attack from medical IoT-WSN. The proposed secure strategy is developed in five stages: First is selecting the cluster heads, second is generating k-routing paths, third is security against black hole attack, fourth is security against the selective forwarding attack, and the last is optimal shortest route path selection. Initially, a topology is developed for finding the cluster heads and discovering the best route. In the next phase, the black hole attacks are detected and prevented by the bait process. For detecting the selective forwarding attacks, the packet validation is done by checking the transmitted packet and the received packet. For promoting the packet security, Elliptic Curve Cryptography (ECC)-based hashing function is deployed. As the main contribution of this paper, optimal shortest route path is determined by the proposed hybrid algorithm with the integration of Deer Hunting Optimization Algorithm (DHOA), and DragonFly Algorithm (DA) termed Dragonfly-based DHOA (D-DHOA) by concerting the parameters like trust, distance, delay or latency and packet loss ratio in the objective model. Hence, the entire phases will be very active in detecting and preventing the two fundamental attacks like a black hole and selective forwarding from IoT-WSN in the health care sector.
Keywords
Nomenclature
Elliptic Curve Cryptography Deer Hunting Optimization Algorithm Dragon Fly Algorithm Dragonfly-based DHOA Wireless Sensor Network Internet of Things Medium Access Control Channel-aware Reputation System by Adaptive detection threshold Cuckoo Search Route Request Route Reply Intrusion Detection System Jensen-Shannon Divergence Based Independent Component Analysis Integrated Bloom Filter with Watchdog Algorithm Certificate Authority Multicast Ad-hoc On Demand Distance Vector Routing
Introduction
WSN is a self-organized system, which consists of low-priced devices. For reducing human interaction, these devices make use of actuators and sensors. In general, the WSN devices are employed in different places like health care, homes, military, etc. [12]. The thing that is considered in the IoT can be smart home appliances, a smartphone, human, smart grid Stations, autonomous cars, a health care monitoring device, smartwatches, and body sensing devices. The WSN devices are extended over a huge geographic surface. Despite its wireless connectivity and vulnerable nature of the network, it is open to various forms of attacks. Black holes, wormhole, selective forwarding, sinkhole, hello flood, jamming, sybil, and grey hole are some of the attacks that affect the WSN. Among the various attacks listed above, the black hole is considered the most hazardous and is the doorway for all remaining attacks [12].
In the WSN devices, the nodes that are attacked by the black hole are named as malicious nodes. The bad node shows the incorrect path as the best and shortest path to the target end in the black hole attacked network. The main aim of these intruder nodes is to cause huge traffic in the network and then to drop the packets without forwarding [12,18]. The black hole attack is a DOS attack that leads to cause humiliation of the network performance [13,17,28]. Thus, the malicious activity of the node that claims to have the minimum route path to the destination is called a black hole [5,22]. Moreover, the selective forwarding attack is another hugely challenging attack. A node affected with a selective forwarding attack purposely rejects the received packets that should be communicated, to obstruct with data transmission between nodes [14,35]. This obstruction of data badly affects the data-centric networks in the case of data fusion and data collection. Based on the research [20], few attacks are extraordinary cases of the selective forwarding attack like a black hole in which the node does not cooperate with data transmission, it drops the received data rather than sending it to the receiver [9,27,31]. Also, another variety of selective forwarding attacks is an On-off attack, in which the node works good and bad alternatively for hiding and avoiding itself from the reorganization during the attack [6]. The impacts on the MAC layer and inbuilt volatility and unreliability of the wireless channel unavoidably leads to normal packet losses which make difficulty in finding the difference between the losses caused by normal and malicious packets. Due to the loss of normal packet, the selective forwarding attacks are hidden causing difficulties in the detection of attacks. Hence it is essential to find selective forwarding attacks and to increase the network performance. In the existing works, more contributions have focused on observing the packet losses and disconnect the node with huge packet losses from the data sending path [2,8,24,32]. The techniques used in the previous works could help in increasing the packet delivery ratio or the throughput of the network but have difficulties in finding the selective forwarding attacks. Mainly, healthcare WSN is vulnerable to various attacks, in which the black hole attack is very difficult to find and resist.
The major part of the study done related to WSN security [7,33] consists of routing security, location security, intrusions key management, and prevention [19]. Conventionally, different approaches have been used to prevent malicious nodes from the clustered network by identifying the alternate routing way with intrusion detection and trust-based systems. Although the above-discussed methods have some advantages, yet the WSN networks are facing trouble in getting the trusted node in the clustered network with high energy efficiency and security.
The key contributions of the paper are as follows:
To detect and prevent the two basic attacks like a black hole and selective forwarding attacks in IoT-WSN using the bait process, and packet validation, respectively, after framing the network topology with selected cluster heads and generated route paths.
To employ the ECC-based packet security model to perform the secure data packet transmission from source to destination.
To frame an optimal shortest route path selection using the novel hybrid algorithms termed as D-DHOA, which focuses the objective parameters like trust, distance, latency, and packet loss ratio.
The entire paper is designed in the following manner: Section 2 specifies the literature review and the features and challenges of existing black hole and selective forwarding attacks detection and prevention methodologies. Architectural representation of proposed black hole and selective forwarding attack detection and prevention is shown in Section 3. Section 4 describes the adopted stages for black hole and selective forwarding attack detection. Selection of secure routing paths: shortest path determination using the proposed hybrid algorithm is given in Section 5. Results and discussions of the paper are given in Section 6. The entire paper conclusion is given in Section 7.
Literature review
Related works
In 2016, Ren et al. [30] offered CRS-A for identifying selective forwarding attacks in WSNs. This method has validated the transmitting behaviours of sensor nodes based on the variation of the loss of packet that was observed and guess the common loss. Also, the optimal threshold was derived from optimizing the detection accuracy of CRS-A. The attack-tolerant information forwarding strategy was introduced for integrating with CRS-A to activate the forwarding assistance of weakens nodes and enhances the information distribution ratio of the network. The simulation outcomes of the proposed system revealed that CRS-A was detecting selective forwarding attacks and recognizing the weaken sensor nodes accurately, where the attacks-tolerant data transmission system was extensively increasing the data distribution ratio of the network.
In 2016, Mathur et al. [23] focused on two risks like a black hole and Selective Forwarding attacks, which caused because of wireless routing among the nodes and access points of medical WSN. To solve the existing challenge, cryptographic hashes were eagerly offered, whereas the last-mentioned problem utilized the neighbourhood watch and threshold-based evaluation for detecting and preventing selective forwarding attacks. Here, the suggested system was able to spot the selective forwarding attack with an accuracy of 96% and effectively recognizing the unauthorized node with an accuracy of 83%.
In 2019, Mehetre et al. [24] proposed a trustworthy and secure routing algorithm utilizing a two-stage security model, and twin assurance method, to choose the node and protecting the information packet in WSN. The methods were dependent on Active Trust to secure many types of attacks like black hole attack, and selective forwarding attack, throughout the routing. Hence, the proposed system recognized the trusted path and produced the protective routing paths via a trust and CS algorithm. The developed system considered energy as the performance parameter. The test results have verified that the recommended approach produced the guarantee for extending the lifetime of the network as well as the possibility of a secure routing path in the network.
In 2019, Delkesh and Jamali [8] suggested a routing algorithm that depends on the delivery of forged packets to improve the detection accuracy and eliminate the malignant nodes. By the suggested approach, malignant nodes present in the network were identified by transferring forged RREQ and RREP routing packets that consist of the address of an imaginary destination node. By sending an RREP message, the nodes were removed from the routing tables. The developed technique was capable of enhancing the traffic load in the network, recognizing a feasible and secure route, identifying the count of malignant nodes, and optimizing few parameters. Moreover, test outcomes demonstrated that the percentage of the delivered data packets by the suggested method was superior to the IDS algorithm.
In 2019, Sunder and Shanmugam [32] introduced the JDICA method for diagnosing the black hole attack. The JDICA approach recognized the black hole attack by examining the physiological information collected from biomedical sensors. Moreover, attack detection was performed based on the behaviors of the sensor nodes. The divergence result has shown that the suggested JDICA approach has detected the black hole attack with extreme accuracy and also assists to quarantine the malignant node from the network by transmitting the isolation information to entire sensor nodes in the network. Therefore, it has been proved that the JDICA approach improved the detection of black hole attack nodes when compared to conventional techniques, thus improving the packet delivery ratio and decreasing the delay.
In 2012, Arunmozhi and Venkataramani [2] recommended a defence approach to identify black hole node, based on the timely data and objective series numbers preserved in the Neighbourhood Route Monitoring Table that documents the time of reply. The decreased reply time was utilized to find the black hole node. The end series number was verified with the threshold value for enhancing the security that was rationalized vigorously. Hence, the experimental outcomes confirmed that the protocol identifies the black hole attack and enhances the network’s lifetime.
In 2017, Kollati and Somasundaram [16] introduced IBFWA for shunning loss of the packet. At the time of key generation, the node was evaluated by the CA. Later, it examined that the node was either normal or attacker. If it was a black hole node, then that will be jammed and communication through that node was avoided or if the node was undermined and reversed as a normal node, then it was connected to the network and through that, node communication was authorized. Finally, the test results of the suggested approach were validated based on the performance regarding lower node outage, residual energy, end-to-end delay, high detection probability, throughput, packet transmission rate, and packet distribution ratio.
In 2009, Anita and Vasudevan [1] suggested an improved certificate dependent authentication method, in which the nodes validate each other by providing certificates to adjacent nodes and creating a public key without using online authority. Moreover, the MAODV protocol acts as assistance for certification. Therefore, the efficiency of the developed approach was clarified by simulations done via network simulator ns-2.
Features and challenges of existing black hole and selective forwarding attack detection and prevention methodologies
Features and challenges of existing black hole and selective forwarding attack detection and prevention methodologies
Although there would be many detection and prevention methodologies for black hole and selective forwarding attack, there are few challenges that need to be overcome in the future. Table 1 describes some of the pros and cons of conventional methodologies for black hole and selective forwarding attack detection and prevention in IoT using WSN. Among them, the Adaptive detection threshold [30] validates long-term forwarding behaviors, and has the best performance. But, it loses more data. Cryptographic Hashes [23] protects the data from unauthorized users, and digital signatures are used to secure the data. Though, it is difficult to access the data even for a valid user. CS [24] is simple and easy to implement and deals with multi-criteria optimization problems. Still, it is having some defects like it simply falls into the local optimal solution, and has a slow rate of convergence. AODV [2,8] responds fast to the topological alterations that affect the active routes, has lower setup delay for connections, it can support both unicast as well as multicast packet diffusions, even for nodes in constant movement, and route discovery process is more effective in dynamic nature. However, it is having some defects like if the size of the network increases, then different performance metrics start reducing, takes more share of bandwidth, takes more time to build routing table, and has high processing demand. JDICA [32] increases the detection rate and reduces the time of detection. Still, the false alarm rate is not detected effectively. IBFWA [16] is capable of tracing an attack after a long time of its completion and supports a high degree of node mobility and improves the network performance. Yet, it requires fine-tuning. MAODV [1] reduces the network load when the packets are transferred to a group of nodes and have high efficiency, but it consumes more memory. Thence, the above-specified defects are considered and the early detection and prevention of attacks need to be improved in upcoming researches.
Architectural representation of proposed black hole and selective forwarding attack detection and prevention
Proposed model
The proposed architecture of the clustered IoT-WSN model in the health care sector is shown in Fig. 1. The main intention of the proposed model is to accomplish the shortest route path for node communication, which leads to maximize the lifetime of sensor nodes and networks as well. Hence, a trustable secure routing scheme is implemented in clustered IoT-WSN with attack detection and prevention mechanisms to attain secure communication. The proposed model involves five stages: (1) Cluster head selection (2) k-paths generation (3) Detection and prevention of black hole attack (4) Detection and prevention of selective forwarding attack, and (5) Optimal shortest route path selection. Initially, a set of nodes in the network are randomly selected as cluster heads. Once the cluster heads are selected, the next step is to select the k-paths between the cluster heads to the base station or sink node. Before finding the optimal path from generated k-paths, the third stage undergoes the detection and prevention of a black hole attack. The bait process is used to detect the black hole attack, and the concerned malicious node is eliminated by the system. In the bait process, the attack node is detected from the feedback packets replied from all destination nodes. The next stage process with the identification of selective forwarding attacks, which is detected by packet validation. The malicious node by selective forwarding attack may drop some of the data packets and forward remaining to the next node. These types of nodes will also be prohibited by the system after detection and even use ECC-based packet security further to perform efficient communication without any packet loss. After confirming the security of the network with proper detection and prevention of attack mechanisms, the optimal shortest path is selected in the entire path transmission using the new hybrid D-DHOA model, which considers the objective constraints like the trust of the node, the distance between the nodes, delay of transmission, and packet loss ratio. Finally, energy dissipation has to be computed for the cluster heads involved in communication, and the number of alive nodes will be calculated in each round. Hence, the optimal shortest route path is accomplished in IoT-WSN by protecting the network from the black hole and selective forwarding attacks.

Proposed IoT-WSN model in health care environment: contribution towards shortest route path selection by detecting and preventing black hole and selective forwarding attack.
This section discusses the cluster head formation model in IoT-WSN, in which the system model is diagrammatically shown in Fig. 2. In general, WSN involves multiple numbers of sensor nodes represented as j, from which the data is transmitted to only one sink node or base station denoted as

Model of clustered IoT-WSN with cluster head selection.
If
K-paths generation
When the cluster head selection is ready in the IoT-WSN, the selection of the source node

K-paths route selection and attack node removal.
In Fig. 3, assume, there are 7 cluster heads, in which different k-paths are selected. Herein, A indicates the attack node, which tries to attack the whole network.
A black hole problem means that “one malicious node utilizes the routing protocol to claim itself of being the shortest path to the destination node, and drops the routing packets by not forwarding the packets to its neighbours”. The key objective of the bait process [4] is to detect the malicious node or black hole attack node while trying to send a reply
Here, the path length
Once the feedback packet or
Selective forwarding attack detection by packet validation
Selective forwarding [10,34] attack means “the attack node tries to stop the packets in the network by refusing to forward or drop the messages passing through them”, which is also termed grey hole attack. The packet Validation process is done for diagnosing the selective forwarding attack and the routing protocol removes such attack from the network, once it is detected. Consider the packet information as
If a node transmits the data packet to another node, the receiver node checks the data type and data size. If the data type is not matched with the data size, it is confirmed that the transmitted node drops some packets, considered as the malicious node. Further, this node will be removed from the system and thus could minimize the packet loss ratio of communication.
Packet security model using ECC
Even though the malicious nodes are detected by the packet validation process, ECC-based encryption [15] is also deployed here for providing more security to the data packets. When some information is transferred from one place to another place in the network, the information file is divided by the protocol into tiny sizes for a well-organized routine. Moreover, each packet is independently recognized by number, and it consists of the address of the target node in the network. The isolated data packets are transferred from different routes present in the network. The packets are recreated to a regular file once the overall data packets reached the destination. In the meanwhile, the loss of a packet has happened if there is any attacker in the node. Thus, the network model has offered the security technique for transferring the data packet without losing the information for keeping the network secure. Here, the security approach protects the information from the intruder using the ECC algorithm. The information is encrypted by the algorithm before routing. To verify the data integrity at the sensor node, the SHA-1 hashing technique is employed, which is functioned as follows.
The data present in the source node is transformed into packets. Later, every packet is encrypted by the ECC encryption algorithm. For the obtained encrypted packet, the hash value is generated by the SHA-1 hashing method. Consequently, the network forwards the encrypted packet and its related hash value in the chosen reliable path. At every receiving node, the hash value is computed for the received encrypted packet. The data is known to be secured when new hash values are the same as the received hash values, which represents that the node is safe from the intruder.
Selection of secure routing paths: Shortest path determination using proposed hybrid algorithm
Objective model for shortest path selection
The shortest route path selection is performed after detecting and preventing the black hole and selective forwarding attacks from the network. The main objective model of the secured IoT-WSN model considers trust, energy, latency, and packet loss ratio.
Trust: Trusty communication [21] between the nodes is validated by determining the relationship between two nodes. The value of trust can be defined as the scale that one node expects a certain service from another node. During the routing, trust computation is deployed to estimate the trust node for avoiding the black hole and selective forwarding attacks. Assume two nodes
Here,
Energy: The average energy of the cluster heads present for communication after its energy dissipation is computed here based on Eq. (5), where the cluster heads
Latency: Latency is defined as “the duration among the response and stimulation or a delay of time between the source and the target of the physical modification in the system being examined”. Energy loss can be mostly avoided by computing the latency. The mathematical formula for calculating latency is given in Eq. (6).
In Eq. (6),
Packet Loss Ratio: It is defined as “the ratio of data received at the destination to the data transmitted from the source”. The formulation is depicted in Eq. (7)
Here,
The overall objective function for the trusty shortest path computation is given below.
Here,
In addition, the other functions
Solution encoding
In order to find the secured shortest route path, the developed D-DHOA is used, which selects the best between the cluster heads from the IoT-WSN system. The solution pattern before encoding is shown in Fig. 4, in which

Solution pattern before encoding.

Solution pattern after encoding.
The DA algorithm [11] takes the inspiration from the static and dynamic swarming characteristics of the dragonfly. The exploitation and exploration are the two main steps in optimization which are alike to the two swarming behaviours of the dragonfly. In exploration (static swarm), the local movements along with abrupt changes in the flying pathway are the most important features. In exploitation (dynamic swarm), large numbers of dragonflies form a group for moving in a single direction for elongated distance. The important goal of any swarm is to survive so that it has to get attracted to the food and to repel from the enemies. Distraction, separation, alignment, attraction, and control cohesion are the five important factors seen during updating the position of individuals in the swarm when considering the two swarming behaviours of the dragonfly. The derivation that denotes the separation of the
Here, the position of the current individual is denoted by
In the Eq. (2)
The term
In Eq. (4) F denotes the position of the food resource.
In the Eq. (18) E denotes the position of the enemy.
Two vectors are considered for updating the position of the dragonflies in the search space and for simulating their movements: step vector
In the Eq. (19)
In the DA algorithm, during exploration, of search space, the low cohesion and high alignment weights are considered and during exploitation, the search space the high cohesion and low alignment weights are considered. A random walk (Levy flight) and the stochastic behaviour and exploration are used to fly around the search space when there is no nearby solution obtained. The Levy flight is used to improve the randomness. The mathematical derivation used to update the position of the dragonflies without any neighbours is given in the Eq. (8).
In the above Eq. (21), Eq. (22) and Eq. (23), the dimension of the position vector is denoted by g, the random numbers within the interval

Pseudo code for DA [11]
The main goal of the DHOA [3] is to obtain the best position of the human to capture the deer. The deer also known as buck has some special characteristics, which help them in escaping from the predator like it has good visual sense, good smelling ability and can detect ultra-high-frequency sounds. The process of DHOA is carried out in four steps. The first step in the DHOA is to initialize the population of the hunters is shown in the Eq. (24).
In the Eq. (24) the total number of hunters is represented by r. The population of the hunters is represented by D.
The second step to be followed in the DHOA is to initialize the two important parameters that help in determining the optimal positions of the hunters: wind angle and position angle. The formula for wind angle is based on the circumference of the circle, which is given in the Eq. (25).
The wind angle is denoted by θ. The random number whose value ranges from
The position angle is denoted by φ in the Eq. (13). The third step in the DHOA is position propagation. Initially, the position of the optimal space is not known, so it is assumed to be near the best solution that is found through the fitness function. Two position are considered that is leader position (
Propagation through a leader’s position: The entire solution or individual is updated to attain the best position as reached by the leader. The mathematical formula for the encircling behaviour is given in the Eq. (27).
In the Eq. (27)
Here, the term
Propagation all the way through position angle: The DHOA is expanded by considering the position angle in the update process for improving the search space. To make the hunting process effective, consideration of position angle is essential. The mathematical formula for the angle of visualization
For updating the position angle, a new parameter
The formula for the next iteration in updating the position angle is given in the Eq. (32)
The position update formula derived with considering the position angle is given in the Eq. (33).
Propagation all the way through the position of the successor: Hereby adjusting the vector T, the encircling idea is been adopted in the exploration stage. Though random search is assumed initially, the value of the vector T is considered less than 1. The position update based on the position of the successor is given in the Eq. (34).
The search agent is selected randomly when the value of T is less than 1 and the best solution is selected when the value T is greater than or equal to 1, to update the agent’s position.
The last step in the DHOA is the termination of the process. Here the position update is done for all iteration till the best position is obtained. Algorithm 2 shows the algorithmic representation of conventional DHOA.

Pseudo code for DHOA [3]
Although lots of researchers have been done on a heuristic concept with several beneficial parts for solving the different application-oriented optimization problems, each optimization concept has to be enhanced for getting adaptable under various conditions. DHOA is an advanced well-performing optimization algorithm. However, it imposes limitations on some non-convex and unsmooth nature of the problems. To further improvise the performance of DHOA, another renowned algorithm called DA is merged with it in the current proposed model for finding the secured shortest route path. The main advantageous part of DA is its high probability of selecting the best solution from a set of solutions. In the conventional DHOA, the position is updated by Eq. (33) for the condition (

Pseudocode for proposed D-DHOA
The proposed system flow is shown in Fig. 6. The main objective of the developed IoT-WSN overview in the health care sector is to find the secure shortest route path based on the constraints like trust, energy, latency, and packet loss ratio of the cluster heads taken for communication to extend the network lifetime.

Flow chart representation of proposed system model.
Initially, every sensor node contains some initial energy, which is denoted as
Electronic energy depending on distinct factors such as modulation, amplifier, filtering, spreading, and digital coding is denoted as
Moreover, the numerical equation to ensure the energy value of each node after transferring and receiving of data is shown in Eq. (40), and Eq. (41).
Results and discussions
Experimental setup
The proposed detection and prevention of black hole and selective forwarding attacks in medical IoT-WSN was implemented in MATLAB 2018a, and the performance evaluation was performed. In the developed IoT-WSN system, 35 nodes are assigned as cluster heads, the initial energy of every node was fixed as 0.02 Joule, and the total number of rounds was 800. Once after the implementation, the performance evaluation of the developed D-DHOA model was compared over conventional PSO [29], GWO [26], WOA [25], DA [11], and DHOA [3] models. The convergence analysis was provided for ensuring the impact of the implemented model over existing models. Moreover, parameter analysis in terms of normalized energy, latency, and length of the shortest path was performed with respect to the count of nodes. Along with this, latency evaluation, shortest path evaluation, and normalized energy evaluation were also analyzed for the developed model with a prevented black hole and selective forwarding attacks of IoT-WSN in the healthcare sector.
Simulation results
The simulation results of attack detection and prevention in IoT-WSN is shown in Fig. 7. Here, Fig. 7(a) shows the sensor deployment with k-path selection. If no attack is present, the network model will be based on Fig. 7(b), and the shortest route path without any attack is shown in Fig. 7(c). Moreover, network with the attack, which is node 6 is detected as per Fig. 7(d), and the network with the shortest route path after removing the attack is shown in Fig. 7(e).

Simulation resuts for attack detection and prevention in medical-based IoT-WSN system (a) k-path generation (b) no attack (c) shorest path selection for no attack (d) network with attack (e) shorest path selection after removing attac.
The convergence analysis of the introduced D-DHOA-based IoT-WSN model was contrasted with conventional algorithms as given in Fig. 8. This analysis shows the effect of finding the shortest path after detecting and preventing the black hole and selective forwarding attacks on data communication in IoT-WSN. Figure 8 shows the cost functions of the proposed and the state-of-the-art models for various iterations. At 1st iteration, DHOA is minimum, next to that DA, followed by WOA, PSO, and D-DHOA model. In the 5th iteration, the proposed D-DHOA system is having the minimum cost function. DHOA is occupying the second position. Later, DA and WOA is having the minimum cost function. Based on the degree of improvement, at 10th iteration, the developed D-DHOA is 50% improved than DHOA, and 66.6% improved than WOA. Thus, the overall convergence analysis of determining the shortest path without any black hole and selective forwarding attacks in IoT-WSN using the proposed D-DHOA algorithm outperforms the conventional algorithms.

Convergence analysis of proposed and conventional IoT-WSN model.

Parameters analysis in IoT-WSN with respect to number of nodes (a) normalized energy (b) latency, and (c) length of shortest path.
The parameter analysis of the developed D-DHOA is evaluated based on the number of nodes regarding the normalized energy, latency, and the length of the shortest path is shown in Fig. 9. Figure 9(a) depicts the performance of normalized energy for the number of nodes. For 35 nodes, the proposed D-DHOA is having more energy when compared to all the other algorithms. Next to that, DA is having more energy followed by PSO, WOA, GWO, and DHOA. For 50 nodes, the implemented D-DHOA is still having more energy. After that, GWO is having more energy followed by PSO. Next, DA, WOA, and DHOA are having the least energy. In the 65th node, the proposed D-DHOA model tops all the other models. Here, the DHOA model is having more energy next to the proposed one followed by GWO, WOA, and PSO. Moreover, DA is having the least energy. Based on improvement, the proposed model is having more energy continuously from the 30th node when contrasted over other models. The D-DHOA is 1% better than DHOA, 5.8% better than WOA, 6.9% better than PSO, 8.1% better than GWO, and 13% better than DA. Therefore, it is concluded that the developed model is having more energy compared to conventional models. On evaluating the latency performance with respect to the number of nodes from Fig. 9(b), the proposed D-DHOA is 16.6% superior to WOA and DHOA, 30% superior to DA, 41.6% superior to PSO, and 50% superior to GWO at 35th node. Moreover, the length of the shortest path of the developed and the state-of-the-art algorithms is shown in Fig. 9(c). At 50th node, the proposed D-DHOA is 40% enhanced than WOA, 46.4% enhanced than DA, 53.1% enhanced than GWO, 60.5% enhanced than PSO, and 69.3% enhanced than DHOA. Thus, it is confirmed that the proposed D-DHOA model is having less latency and shortest path over existing models. Finally, from all the parameters it is proved that the developed D-DHOA algorithm is superior to conventional algorithms.
At 700th round, the length of the shortest path of the implemented D-DHOA model is 83.8% superior to DHOA, 85.7% superior to WOA, 33.3% superior to GWO, and 37.5% superior to PSO is shown in Fig. 10(c). Moreover, the length of the shortest path of the developed D-DHOA model at 500th round is 60% enhanced than DHOA, 58.3% enhanced than WOA, 33.3% enhanced than GWO, and 80% enhanced than PSO is given in Fig. 10(d). Finally, from the above calculations, it is confirmed that the presented D-DHOA model is having the minimum shortest path over the state-of-the-art models.

Analysis on shortest path length in IoT-WSN for varied network configurations for (a) number of cluster heads = 35 (b) number of cluster heads = 50 (c) number of cluster heads = 65 and number of cluster heads = 80.
With respect to the number of rounds, the evaluation of latency is given in Fig. 11 for the different number of cluster heads. The latency of the proposed D-DHOA is 62.5% improved than DA, 40% improved than WOA and PSO, and 50% improved than GWO that is given in Fig. 11(a) for 35 number of cluster heads. From Fig. 11(b), the latency at 800th round by the developed D-DHOA is 53.3% better than DHOA, 56.2% better than DA, 12.5% better than WOA, and 65% better than GWO for 50 number of cluster heads. The latency of the implemented D-DHOA at 700th round is 75% enhanced than DHOA, 14.2% enhanced than DA, 76.9% enhanced than WOA, and 25% enhanced than GWO, which is given in Fig. 11(c). In Fig. 11(d) for 80 number of cluster heads, at 100th round, the latency of the offered D-DHOA is 46.6% superior to DHOA, 38.4% superior to DA, 36.5% superior to WOA, 50% superior to GWO, and 55.5% superior to PSO. Thus, it is proved that the improved D-DHOA is performing well in detecting and preventing black hole and selective forwarding attacks in IoT-WSN, and continues data communication with less latency.

Analysis on latency in IoT-WSN for varied network configurations for (a) number of cluster heads = 35 (b) number of cluster heads = 50 (c) number of cluster heads = 65 and number of cluster heads = 80.
Figure 8 shows the normalized energy analysis of the proposed and the conventional algorithms for the count of the rounds. From Fig. 12(a), at 800th round the normalized energy of the introduced D-DHOA model is 2.9% better than DA, 6% better than PSO, 10.7% better than WOA, 12.9% better than GWO, and 25% better than DHOA. The normalized energy at 600th round, the proposed D-DHOA is 1.7%, 2.9%, 4.1%, 6%, and 6.7% improved than GWO, PSO, DA, WOA, and DHOA is given in Fig. 12(b). At 800th round, the normalized energy from Fig. 12(c) of the developed D-DHOA is 0.6% superior to GWO, 1.2% superior to GWO, WOA, and PSO, and 11.2% superior to DA. In Fig. 12(d), the normalized energy of the implemented D-DHOA is 0.4% enhanced than DHOA, 3.9% enhanced than WOA, PSO, and GWO, and 5% enhanced than DA. Thus, it is confirmed that the proposed method is having maximum energy when compared over the other algorithms in transferring the data on the IoT-WSN network.

Analysis on normalized energy in IoT-WSN for varied network configurations for (a) number of cluster heads = 35 (b) number of cluster heads = 50 (c) number of cluster heads = 65 and number of cluster heads = 80.
The aim of the paper was to introduce a security approach for detecting and preventing the black hole and selective forwarding attacks in medical IoT-WSN. Here, the developed security mechanism consisted of five stages: a selection of cluster heads, k-routing paths generation, security against black hole attack, security against selective forwarding attack, and finally minimum shortest path selection. At first, for determining the cluster heads, a topology was introduced, and further continued with choosing the k-routing paths. Later, detection and prevention of black hole attacks was done using bait procedure. To detect selective forwarding attacks, packet evaluation was performed by verifying the forwarded packet and the received packet. To promote packet security, the ECC-based hashing function was also established. The key role of the paper was to find the optimal shortest path using the proposed D-DHOA by considering the objective functions like trust, distance, delay or latency, and packet loss ratio. The convergence results of the proposed D-DHOA were 50% improved than DHOA, and 66.6% improved than WOA. The limitation includes that it is difficult to define initial parameters, difficult to solve problems, it can lead to abusive practices, and cost-prohibitive. Thus, it is confirmed that the proposed D-DHOA model was efficient for promoting the shortest path of communication after detecting and preventing the black hole and selective forwarding attacks in medical IoT-WSN.
Conflict of interest
None to report.
