Fuzzy based hybrid BAT and firefly algorithm for optimal path selection and security in wireless sensor network

Nodes are deployed randomly in the network area of the WSN. data transmission from source to destination via intermediate nodes should be done in a secure fashion. Due to the large size of packet loss and energy consumption of sensor nodes, a secure and energy-efficient path must be required. The main objective of this research is to provide secure data transmission among node-to-node for efficient delivery of data packets to the destination. The system uses a novel hybrid firefly and BAT algorithm for path selection, an innovative trust value generation, and optimal neighborhood selection using fuzzy logic. The research employs Elliptic Curve Cryptography (ECC) combined with Diffie-Hellman exchange for key generation and key exchange. Path selection is done by fuzzy logic and optimization of selection has been carried out by hybrid BAT and Firefly algorithms. Key generation includes a time-based randomness factor that increases the complexity of cryptanalysis, thereby providing the most security. The performance of the simulation is analyzed and depicted in terms of delay, throughput, energy, and processing time. The research has been carried out using a network simulator with nodes deployed randomly in the network area with mobility as the primary concern that requires dynamic path selection.


Introduction
Wireless Sensor Network (WSN) is a group of nodes/ devices that are connected as a network that can transfer and share the data collected from an environment via intermediate links. In such a scenario, security is the significant factor to be considered for the transmission of data. Security, Computation, Privacy, Reliability, and Energy constraints are the several challenges to be taken into account mainly at the time of routing in WSN [1][2][3][4][5]. Various researchers suggested a clustering algorithm based on Particle Swarm Optimization (PSO) for WSNs with mobile sinks. Many simulations have been undertaken to determine the system's productivity. The results have shown that the system is found to be efficient in terms of network lifetime, energy consumption, and transmission delay. The research reduced the node's energy consumption, improved network lifetime, and reduced transmission delay using hybrid BAT and Firefly algorithms [6][7][8]. The research work, utilized LEACH along with an enhanced BAT algorithm (BA) to decrease the energy cost of the system in WSN. The performance analysis has shown that the system is more effective than the other state-of-the-art methods in improving the network lifetime and reducing energy consumption. Modified BA has to be employed yet for related problem optimization [9][10][11].
The research work used a dual assurance scheme and a two-stage security mechanism for the identification and prevention of attacks including selective forwarding and black hole attack with active trust in a clustered WSN. It has been observed that this research has established the trust path thereby providing data transmission in a secured manner. Several experiments have been performed and the results revealed that the system guarantees network lifetime in a prolonged manner and a high probability of secure routing in WSN [12][13][14][15]. To aggregate various types of data packets and increase energy efficiency, FAJIT primarily focuses on solving the parent node selection problem [16]. The distribution-adaptive protocol TTDFP is effective at running and scaling sensor network systems. An optimization framework to fine-tune the parameters utilized in the cluster analysis tier to optimize the performance of a particular WSN in addition to the two-tier protocol based on fuzzy logic [17]. The foundation of a Wireless Mesh Network (WMN), when a mesh router's mobility is limited, is made up of mesh clients and routers [18]. Spam frequently floods the network with extra versions of the same message that are continually delivered to different users without their permission or encouragement to open them. In this study, we compare the effectiveness of various machine learning methods even without feature selection methods to find the most accurate classifier for identifying spam mail [19]. The research employed the firefly algorithm in addition to adaptive PSO for secure routing based on the cluster in WSNs. The research has been evaluated using the NS3 simulation tool. Various metrics have been taken into account for evaluation. The metrics include decryption and encryption time, network lifetime, and Packet DropRate (PDR). Performance analysis of this research exhibits that the system performed and sustained better than the other conventional methods. This research has been planned to enhance further by executing it in a large-scale environment of WSN [20]. The research creates a Hybrid method of Firefly Algorithm with Particle Swarm Optimization (HFA-PSO) in WSN for cluster head selection in an optimal and energyefficient manner. The research work has been assessed in terms of metrics including residual energy, number of alive nodes, and throughput. The attained results revealed that the proposed methodology enhanced the lifetime of the network and decreased the utilization of energy. Comparative analysis of various parameters has shown that the system accomplished better residual energy and throughput. The network lifetime has to be improved further by the use of nature-inspired algorithms and firefly algorithm [21]. The demand that WSNs have minimal deployment and manufacturing costs mandates the use of simple equipment in the sensor network.
As a result, academics have begun to look for solutions in this new field. An important feature of WSN security is described in this work. A variety of encryption techniques are investigated, including symmetric and public keys, as also Elliptic Curve Cryptography (ECC), Pairing Basis Cryptography (PBC), and Identity Based Cryptography (IBC). Because information is delivered across an unpredictable connection, information security is a key priority in every sector. Cryptographic techniques aid in the transformation of comprehensible data into incomprehensible data. Asymmetric keys and usually indicators are two major techniques of cryptography. The symmetric key employs only one secret for both encrypting and decrypting, which saves time and energy. The asymmetrical key is made up of 2 keys: a secret key for decryption and a public key for encryption. Since it uses two keys, the asymmetric encryption approach is substantially safer than the symmetrical approach. The production of two keys requires a lot of energy, time, and memory. Block and stream ciphers are two types of cryptographic techniques.
Three new innovative ideas have been presented in this to overcome the higher energy consumption, throughput, and lower network lifetime. The major contributions of the proposed work are the following: Trust value generation and neighborhood selection using fuzzy logic, hybrid firefly and bat algorithm, and ECC with Diffie Hellman for secure transmission is the innovative ideas explored in this research. Trust value is generated to ensure trustworthy communication between various nodes in WSN.
Fuzzy logic is utilized to enhance decision-making and performance and decreases the consumption of resources. Here, Fuzzy logic is used for neighbor discovery based on historic information of the particular node. This historic information is analyzed to choose the efficient neighboring node. In addition, fuzzy logic also analyses the distance and energy of the node. Finally, an optimized path is selected via the Hybrid firefly and Bat algorithm.
The Hybrid firefly and Bat algorithm initializes the population and calculates intensity and fitness value to choose the best suitable path for data transmission. This optimized path provides secure data transfer from the source node to the sink node.
The strength of this research lies in providing effective ideal neighborhood discovery using Novel fuzzy-based optimal path selection with randomness (FPS-R) and finalization of the optimized path using a hybrid firefly and BAT algorithm (H-FBA).
The research work ensures integrity, availability, confidentiality, and authenticity of all packets in the existence of resourceful adversaries.
The upcoming section II describes several existing works about the secure transmission of data from the source node to the destination node in WSN. Section III describes the research methodology in which a novel hybrid firefly and bat algorithm, trust value generation and neighborhood selection using fuzzy logic has been implemented for secure data transmission. The results of the research work have been discussed in section IV. Finally, the entire proposed system is concluded in section V.

Related work
The following section describes the existing studies related to path selection approaches among the nodes and various optimization algorithms employed in wireless sensor networks.
The research compared and examined various data aggregation methods based on artificial intelligence (AI) in Wireless Sensor Networks (WSNs). Additionally, this study included the design and development of an enhanced protocol. An analysis has been made by comparing this protocol implementation with Particle Swarm Optimization (PSO) and Ant Colony Optimization (ACO). The results thus obtained from the comparative analysis showed that the proposed method guaranteed better results concerning throughput and network lifetime. Meta heuristic and AI-based methods can be used to surpass the current issues in WSN during data aggregation, which has to be done in near future [22]. In addition, [23] utilized a two-fish approach based on a novel hybrid routing algorithm in WSN to choose the right path for the safe transmission of messages from source to destination. Simulations have been carried out to assess the performance of the proposed work. Simulation results have shown that the proposed methodology showed better results in terms of monitoring and detection ratio for malicious attacks. The proposed method has to be extended further to be utilized in WSNs to assuring the authentication of security layers. Employed [24] interlock protocols and RSA cryptographic algorithm to prevent Denial-of-Service attacks for securing WSN. Simulations have been undertaken using the NS2 tool. Results obtained from simulation have shown that the proposed algorithm and protocol are found to be effective in terms of various metrics such as Packet Delivery Ratio (PDR), average throughput, average residual energy, detection ratio, and network lifetime. The research can be further improved by utilizing mobile sinks based on meta-heuristic algorithms for enhancing the network lifetime and energy consumption.
Furthermore, the research proposed an Effective Path Selection and Security Control Logic Scheme (EPSSCLS) and Dynamic Authentication Key Agreement Scheme (DAKAS) for secure data transmission and key verification in WSN. The results showed that the proposed method performed better in improved security in WSN [25]. The system used the jumper firefly algorithm for energy-efficient clustering in WSN. The proposed methodology has also been compared with the Low Energy Adaptive Clustering Hierarchy (LEACH) protocol which is one of the existing systems in which the proposed algorithm exhibited better results than the LEACH protocol. The hybrid Optimization method has to be implemented in WSN for clustering in near future [26].
The research exploited an MFA (multi-population firefly algorithm) in WSN for correlated data routing. Simulation has been undertaken and many existing methods have been compared with the proposed system by various metrics that includes energy consumption, packet delivery ratio, and network throughput. Thus, the proposed technique MFA has outperformed more efficiently than other traditional methods in terms of the mentioned metrics [27]. This study discussed a symmetric cryptography algorithm called Advanced Encryption Standard (AES) for the security of WSNs. Various findings revealed that the proposed methodology performs efficiently in WSNs. Further research has to be carried out regarding the execution of cryptographic circuit structures [28]. The research implemented a synchronous firefly algorithm in WSN for cluster head selection. Various simulations have been conducted to assess the effectiveness of the proposed method. The simulation results have shown that the proposed method outperformed other conventional methods by enhancing the network's energy efficiency and reducing the packet loss ratio [29]. Employed DHM (Dij-Huff Method) in WSNs for path optimization in an energy-efficient and secure manner. A network simulator has been used to validate the proposed approach. The simulation results have exhibited that the proposed method decreases the packet delay and loss thereby enhancing the network lifetime [30]. Utilized an algorithm called artificial bee colony in WSNs for path optimization based on the mobile sink. The proposed system has been simulated to examine its efficiency and effectiveness. The simulation results revealed that the proposed system has shown effective results in the performance of data collection in realtime and energy efficiency. Various study has yet to be conducted related to the strategy of mobile sink [31].
This research reviewed Ant Colony Optimization (ACO) algorithm for mobile and static sensor networks based on AI for path selection in an empowered manner. The research work has been summarized and various open challenges about the network design have been explored. The research contributes to the guidance of system design and enhancement in the performance of networks. Large transmission delay is a drawback in this study [32]. Proposed a Novel Fault Tolerance (NLFFT) model based on AI to enhance the performance of WSNs. The proposed model has been found to exhibit enhanced performance concerning end-toend delay, throughput, and power consumption. Here, the proposed model has been employed only for the sensor nodes that have been statistically deployed. The work has to be expanded further by employing the proposed model in sensor nodes that have been dynamically deployed [33]. Employed ECC (Elliptic Curve Cryptography) based on mutual authentication for the secure transmission of medical data in WSNs. The results have revealed that the proposed methodology solved all the existing problems and was verified to be the efficient cryptographic technique for the safe transmission of data in an environment with resource constraints. Investigators can develop a new method to decrease the computation of the proposed method in the near future [34]. The study suggested a TDP (Trust Disrupt Protocol) for energy-aware and secure routing protocol in WSNs. The proposed method has been tested in Self-Organizing Networks (SON). A comparative analysis of the proposed system with the existing LEACH protocol has been performed. The proposed method showed better efficiency than the traditional methods for routing in WSN in terms of reduced energy consumption and high security. Further improvement has to be done by utilizing an agent-based system instead of cluster-based routing in the routing of WSN [35].
The research proposed an improved BAT algorithm through the use of a diversity function for the optimization of routing in WSN. Simulation has been conducted using the NS2 tool where the traditional BAT algorithm and the improved BAT algorithm have been compared to determine the efficiency of the system. Results have been summarized by taking into account the various metrics of end-to-end delay, PDR, etc. The results have revealed that the proposed Improved BAT algorithm performed well than the traditional BAT method in terms of the mentioned metrics. Implementation of QoS has to be done yet with the BAT algorithm [36]. Recommended MDF (Multisensor Data Fusion) approach for choosing the suitable path in WSN by the integration of the gathered network metrics such as centrality and bandwidth. Many simulations have been implemented and the results obtained from the simulation of the proposed method showed efficient performance when compared with other state-of-theart methods. Application development has to be implemented in near future regarding the real-time issue through the use of the proposed method [37].
This research exploited Homomorphic encryption and ECC for safe data routing in WSN. It has been observed that the proposed system can function with various sensing environments that require capturing data in the image as well as textual format. The proposed system exhibited an effective outcome than the traditional methods regarding memory requirements, communication overhead, energy consumption, and network lifetime. It also prevents various attacks such as brute force attack, passive attack, and CH compromised attack [38]. Proposed re-encryption nodes for improvement of energy efficiency based on fuzzy logic for forwarding nodes selection in WSN. Simulation has been conducted to assess the performance of the proposed method. Thus, it has been found that the proposed method accomplishes improved conservation of energy at the en-route nodes. Further study has to be carried out to examine and execute the source authentication at intermediary nodes in a sensor network based on data aggregation [39].
The system suggested an outsourcing decryption method concerning novel partial to assure computational efficiency and data security for terminal equipment and resource-constrained WSNs. The proposed method has been compared with various existing methods. It has been found that the proposed methodology efficiently decrypts cipher text and improves data security. Simulation has also been performed to assess the proposed system's performance. The proposed system showed effective results in computation, and energy consumption when compared to traditional work. Multi-authorities and attribute key revocation for WSN have to be considered in the near future [40]. Recommended an Energy and Spectrum aware Unequal Cluster based Routing (ESUCR) to solve the challenges of routing and clustering in a Cognitive Radio Sensor Network (CRSN). Many simulations have been undertaken using the NS2 tool to determine the performance of the proposed method. The proposed method has also been compared with the existing system and it has been found that the proposed methodology works efficiently in terms of PDR, end-to-end delay, and reduction in energy consumption. The proposed algorithm has to be enhanced further to attain robust performance with adaption to several occupancy models of PU spectrum [41]. In WSN, [42] Proposed TSDDR (Trust-based Secure Directed Diffusion Routing) protocol. The proposed system has been analyzed and it has been found that the proposed TSDDR prohibits the impersonation of malicious attacks. It has also exhibited end-to-end communication securely.
The foregoing are the shortcomings or drawbacks of WSN: Because it is wireless, it is vulnerable to hacking. Because it is developed for low-speed purposes, this can be utilized for high-speed communications. The cost of constructing such a system is prohibitive for most people.

Proposed work
In this research work, for secure path selection, the system proposes a novel fuzzy-based optimal path selection with randomness (FPS-R) to ensure the effective transmission of data. For an effective path selection, a newly formed hybrid firefly and bat algorithm (H-FBA) is developed. The system depends on asymmetric key generation and key exchange using Elliptic curve cryptography (ECC) combined with the Diffie-Hellman technique for providing maximum security. For data encryption, the system utilized ECC which provides integrity, authenticity, and confidentiality. The system uses a no-assumption-based methodology and relies on randomness and cryptographic algorithms to increase its complexity without compromising on security. A unique seed value is generated for each node that has no relevance to its neighbors. As no information is generated in common among sensor nodes, a compromised node produces no effect on its neighboring nodes. A detailed description of the proposed study is shown in below Figure 1.

Novel fuzzy-based optimal path selection with randomness (FPS-R)
Initially, the proposed system allocates a unique value for every sensor node before deployment. The values thus allocated possess no dependency among themselves. This unique node value is shared with the base station to prevent a masquerade attack. Each node after sensing its own defined value needs to perform a computation for the generation of a unique value called a seed value based on its allocated value. The computation is a modified form of Euler's identity and given below,
Here, a random value is taken from a pool of "n" prime numbers. This value is fed as input for the generation of private keys at sender and receiver. The complexity of the seed value lies in the chosen random prime number and node's sensed value which will be difficult for the intruder to predict and perform the cryptanalytic attack.
Further, Neighbour node discovery is accomplished using a fuzzy rule. For each nearby node, the following are calculated. Node's Distance Value (DV), Node's Energy Level (EL), and Node's Historic Information (HI) -(Success Ratio, Node's efficiency).

Fuzzy logic
Before communicating to the base station every node must be authenticated based on authentication scores from 0 to 1. If a node is not authenticated then it indicates to 0 value and if it is fully authenticated then it indicates to 1 value. If the node is authenticated partially, it indicates the intermediate value. In this research work, the data is encrypted and decrypted and key generation is performed using ECC, and Diffie-Hellman exchange performs the key exchange. The data is allowed to be forwarded to the base station after performing the authentication checks. Fuzzy logic identifies the trustworthy nodes among "n" nodes. Each node calculates its nearby trustworthy nodes using fuzzy logic. The selection of optimal nodes among the identified trustworthy nodes for path selection is done using the Hybrid Firefly and BAT algorithms. The neighbor trust value on success rate and packet sending efficiency are shown in table 1. The trust value of nodes is calculated based on their historic information such as success ratio and efficiency. Instead of precise and fuzzy set concept derivation for reasoning, fuzzy logic is utilized which is a kind of logic with multiple approximate values. Uncertainty is considered a trust-based character within wireless sensor networks due to the prescribed rules and fuzzy verifications. In decision analysis, the logic trust model is established which is focused on uncertainties as probability values. The probability model is not utilized. By fuzzy rules set construction, certain fuzzy trust models handle the indecision in the trust management system. Based on fuzzy logic trust models, the patterns are identified and it follows if and then sequence rules. For moderating the rules of fuzzy logic, the result is evaluated and suitable feedback is obtained.

Effective and optimized path selection using new hybrid firefly & Bat algorithm-H-FBA
In this research, the firefly algorithm and bat algorithm are combined as a hybrid form to perform the effective path selection.
The flashing (mating) action of fireflies served as inspiration for the creation of the firefly algorithm. Tiny insects called fireflies are skilled at producing light to attract prey (mates). Each firefly includes information about the path that consists of and has a maximum of k elements. They decide to organise many policy subsets and release brief, rhythmic light flashes in order to select the best course of action. The echolocation activity of microbats with varying frequencies and loudness served as the inspiration for the bat algorithm. A bat flies unpredictably, loudly, and at an unpredictable frequency at a given location (solution). It adjusts the frequency, loudness, and pulse emission rate as it searches for and finds the optimum route (per). By taking the specific stop requirement into account, the best route is identified. The hybrid firefly bat technique is similar, but a node's location vector is taken into account as a trail instead.

Firefly algorithm
Generally, every firefly is unisex and hence the attractiveness of one firefly to another firefly is based on distance and the intensity of brightness among the fireflies.
The attractiveness of fireflies is indirectly proportional to the distance between them and directly proportional to their brightness. Based on the attraction, one firefly can advance to follow the next firefly. In a sorted list, there exists a particular objective function. The objective function value is expected to be high and thus better transmission takes place. At every node, the objective function is evaluated as, From Eq. (2), brightness is β, delay is α and initial value is β 0 . The modified objective function is given below, Eq.
(3) & (4), denotes the ith firefly movement to another kth firefly. Density is k, free speed flow is μ f , jam density is k j and the Cartesian distance among ith and kth firefly is |X i − X k |.

Bat algorithm
Bat algorithm is defined as the experimental intelligent algorithm in which the echolocation principle is simulated and it is used in this algorithm. For resolving continuous optimization issues, the bat algorithm is approved from basic test functions and better results are further obtained. Based on the bat echolocation characteristics, the three idealized rules followed in the bat algorithm are, (i) To sense distance and the variations among the background barriers and food, all bats used echolocation. (ii) Usually bats fly randomly with xi position, vivelocity, loudness, and frequency for prey/food searching. Based on target proximity, the emitted pulse wavelength and pulse emission rate r ε [0, 1] are adjusted. (iii) In various ways, the loudness is differentiated from the highly positive to the reduced constant value.
The algorithm for Hybrid Firefly and Bat approach (H-FBA) is described below.
From, the description of the above algorithm, the fitness function is evaluated by following Eq. (5). Based on every node's distance, energy, and trust value of each solution, the fitness function is measured. If the fitness solution is at its lowest then it is considered the best node as shown in Eq. (6). The average fitness solution with a minimum amount is presented in the best solution index in Eq. (7). Get the selected number of nodes from network 2.
Generate initial population based on selected nodes 3.
Set number of iterations to process FBA 4.
For each iteration 5.
For each solution 6.
Generate initial frequency and initial velocity 7.
Update solutions based on best solution 10.
End for 11.
Choose the best node 12.
For each solution 13.
Update frequency, velocity, and solutions based on best solution 14.
End for 15.
End for 16.

Elliptic curve cryptography with diffie-hellman exchange
In ECC, even if the key size is smaller it provides compact implementations for provided security which are resulted in quicker cryptographic operations. In this research work, the data is encrypted and decrypted and key generation is performed using the ECC encryption and Diffie-Hellman exchange performing the key exchange. Currently, there were several kinds of (PKC) public-key cryptography like Diffie-Hellman, RSA, etc. Among them, ECC is a simple technique to encrypt and decrypt data only for specific authorized users. ECC utilizes 2 keys such as private and public keys for decryption and encryption purposes, so no one can easily hack or read encrypted information during the transmission process. The basic algorithm for this proposed study is shown below. For ECC 128 bits are generated and further, the bit values are converted into hexadecimal values.
Algorithm 2: ECC with key generation algorithm.
1. 128 bit key phrase set generated for ECC.

3.
Generation of two random prime numbers -PR 1 and PR 2 .

5.
Identification of source ID s and destination ID d seed value ID src(s) & Id dest(s) .

7.
A and B points shared with sender and receiver. 8.

Experimental results
The experimental results of the proposed methodology related to secure data transmission of data from source to destination in an optimized path with trust value generation, efficient neighbor discovery, and key generation are discussed in this section. Additionally, performance analysis is accomplished to determine the efficiency of the proposed system [45]. Simulation is carried out using a simulation tool called NS-3. The nodes are deployed randomly in the network area of WSN. Here, a hundred (100) sensor nodes are taken for deployment. The deployment of the sensor nodes is shown in Figure 2.
After deploying the sensor nodes, a source node is selected for initiating the data transmission. In this simulation, 82 is selected as a source node. Hence, from node 82, data transmission occurs as shown in Figure  3. After source node selection, the destination is also fixed. Here node 5 is chosen as the destination node which is also shown in figure 3. The source and destination nodes are selected for transmitting the data.
Once the source and destination nodes are identified, the neighbor node is discovered using fuzzy logic. The broadcast request is sent to all nodes and a response is received from all nodes accordingly. Neighbour node is discovered based on the energy of the node, distance value calculation, trust value generation, and historic information. Here, the historic information of the node  is analyzed based on the efficiency and success ratio of each node to select the best neighboring node for each node, and the discovery of the neighbor node is shown in Figure 4.
Initially, all the possible paths for data transmission from source to destination are computed using the hybrid firefly and BAT algorithm as shown in Figure 5 and then intensity and fitness values are calculated. After this calculation, the best-optimized path is obtained. Safe and trustworthy transmission of data from the source node to the destination node occurs through this path. In this simulation, the safe transmission of data occurs from the source node (82) to the destination node (5) through an identified optimized path. Here 82-81-14-15-5 is obtained as an optimized path that transmits data efficiently as shown in Figure 6.

Performance analysis
The performance analysis of secure data transmission through an optimized trustworthy path is evaluated in terms of delay calculation, throughput computation, energy consumption, and overall processing time.

Analysis of delay calculation
The delay calculation is shown in Figure 7. The analysis has shown that the proposed system provides data transmission without delay.

Analysis of throughput computation
Subsequently, the proposed system is analyzed in terms of throughput. The analysis of performance by throughput computation is shown in Figure 8. From the analysis, it has been found that the proposed system provides high throughput.

Analysis of energy consumption
The consumption of energy by various nodes during data transmission from source to destination is computed which is shown in Figure 9. The analytical   results reveal that the proposed system consumes less energy thereby increasing system efficiency.

Analysis of overall process time
Analysis of throughput computation.
Subsequently, the proposed system is analyzed in terms of throughput. The analysis of performance by throughput computation is shown in figure 8. From the analysis, it has been found that the proposed system provides high throughput Figure. 10 shows Performance analysis of overall process time ( Figure 10).
Through simulation carried out using NS-3, the attained execution time is 1.306473970413208 s, the  obtained noise power is 0.0006 dBm/Hz, the attained minimum packet drop rate is 8.33 and the signal power is 0.2039dBm. Thus, the final optimized path is [82, 81, 14, 15, and 5]. Hence, successful data transmission occurs from the source to the destination node via the proposed method.   [44] in terms of average delay.

Comparative analysis
This section discusses the comparative analysis of the proposed and existing methods in terms of various metrics. The proposed novel fuzzy-based optimal path selection with randomness (FPS-R) is compared with various existing methods to validate the efficiency of the introduced methodology.
From the above Figure 11, it is clear that the number of alive nodes decreases as the number of rounds increases. It is found that the nodes are alive for the maximum number of rounds when using the proposed FPS-R than the existing systems. This proves the efficiency of the proposed methodology in terms of the number of alive nodes. In addition, the performance of the proposed and existing systems is compared in terms of average residual energy. The obtained results are shown below in Figure 12.
Average Residual Energy is the important parameter necessary for a node to efficiently transmit and receive packets during data transmission. From the above figure 12, it is clear that the Average Residual Energy of a node decreases only when the number of  100  100  100  100  150  67  70  64  200  40  40  42  250  28  26  28  300  15  15  15  350  0  1  1 rounds increases. It is found that the Average Residual Energy decreases only at the 2500th round when using the proposed FPS-R. Thus, the Average Residual Energy decreases later when using the proposed system than the existing systems. This proves the efficiency of the proposed methodology in terms of Average Residual Energy. Additionally, the performance of the proposed and existing systems is compared in terms of average delay. The obtained results are shown below in Figure 13. From the above figure 13, it is clear that the average delay is minimum when using the proposed novel FPS-R than the existing methodologies. Thus, the proposed FPS-R transmits the data from source to destination quickly when compared to existing systems. This proves the efficiency of the proposed methodology in terms of Average Delay. Table 2 shows Comparison of alive nodes.

Conclusion and future work
In this proposed work, a novel fuzzy-based optimal path selection with randomness (FPS-R) to ensure effective transmission of data has been employed. For an effective path selection, a newly hybrid firefly and bat algorithm (H-FBA) is developed. For asymmetric key generation and key exchange, Elliptic curve cryptography-ECC combined with the Diffie-Hellman technique which provides maximum security has been used. Optimal neighborhood discovery is performed to choose the trustworthy nodes for data transfer. Subsequently, the various possible paths are attained and optimized using a hybrid firefly and BAT algorithm to choose the secure and efficient path for data transfer. The proposed analytical results revealed that the proposed system ensures minimum delay, high throughput, low energy consumption, and decreased overall processing time which is compared with the existing ECC approach. It has also provided an optimized path for securely transmitting the data. This system can be further enhanced by implementing it in real time.

Ethics approval and consent to participate:
No participation of humans takes place in this implementation process.

Human and animal rights:
No violation of Human and Animal Rights is involved.

Authorship contributions:
There is no authorship contribution.