FEBSRA: Fuzzy Trust Based Energy Aware Balanced Secure Routing Algorithm for Secured Communications in WSNs

Energy efficiency playsa major role in designing a sensor network to improve network lifetime. Trust is also important for providing security to the data communication process. Delay is also a major challenge today due to the enormous volume of network users. To overcome all these issues, many researchers have developed energy-efficient security mechanisms for fulfilling the requirements. Even though they are not able to satisfy the current requirements and users in terms of energy consumption, delay, and security. For this purpose, this paper proposes a new algorithm called Fuzzy Trust-Based Energy-Aware Balanced Secure Routing Algorithm, which can provide the effective delay constrained secure routing. It uses fuzzy logic as a form of many-valued logic. In this method, the truth values of variables may be any real number between 0 and 1, both inclusive for making a final decision over sensor nodes. Considering the number of hops between the source and destination nodes, the energy level of the nodes, the trust scores. Moreover, a new trust model has introduced a new formula for calculating trust scores with the energy level of the communication delay, which is calculated by using the number of hops used for the specific communication, taking into account the number of hops between the source and destination nodes. The experimental results of the proposed secured routing algorithm demonstrated that the performance in terms of energy consumption, less delay, and high throughput with security is better when compared to the existing systems.


Introduction
In recent years, Wireless Sensor Networks (WSNs) have achieved reasonable appreciation in our life. The majority of applications use different sensors to provide society with sophisticated facilities. In this scenario, the secure routing algorithms were used to ensure secure data communication, safeguard the WSN, and maintain network lifetime performance [1]. Furthermore, the majority of secure routing algorithms employ cryptographic methods for data exchange between nodes and authentication schemes that are incompatible with WSN. Here, the misbehavior of each sensor node is assumed that the participating sensor nodes are cooperative and trustworthy. Therefore, this assumption is not reliable for the inner attacks or the node misbehavior [2]. Usually, all these traditional security mechanisms require a single administration for managing the security that is not available for ad-hoc networks.
Moreover, existing network security techniques cannot meet the user's expectations in terms of high processing, memory usage, and energy consumption, limiting the system's deployment in sensor nodes with limited resources [3]. Energy is an essential resource for sensor-oriented networks ineffective communications with delay. For this aim, many academics have developed energy-aware routing algorithms for successful data transfer in WSNs [4]. However, many sensor-based applications can transmit data from the source node to the destination node in a relatively short amount of time. So, the main objective to provide better service in wireless sensor networks is to minimize the energy consumption and the communication delay between the nodes. The clustering process is a strategy for achieving energy efficiency in sensor networks that have proven efficient. In the clustering process, the sensor nodes select themselves as cluster heads according to the probability values. The optimized cluster-head values are known as probability values. In WSNs, a sensor is only able to contact other sensors present in the network topology within the limited frequency range. Here, the sensor must create a multi-hop network to communicate between the network's two sensors. When the WSN uses a clustering algorithm, every cluster must have Cluster Head (CH) individually, and it is used to collect all of the sensing data from CHs. It is also used to transfer the data to a specific destination.
Besides, the CH and destination communication consumes more Energy than usual when their distance is far. Here, the energy consumption is exponential to the distance [5] to minimize the delay. Generally, multi-hop communication is Energy efficient, but it increases the communication delay [6].
Generally, trust is a belief of sincerity in each other Rathore et al. [7]. The trust score of the particular node is used to identify the right node for transferring the data between the nodes in a network environment. Trust management technique is the right and easy way to solve the security issues available in the networks. Recently, various researchers have widely used a Trust-based routing mechanism for secured communications in wireless networks to monitor the nodes' behaviours in the network scenario at different times and situations. The genuineness of the nodes and the data security are to be finalized based on changes in node behaviour without using any cryptographic algorithms. Trust score is considered as a reliability level of the node in wireless network communications. The Trustbased mechanisms provide the facility to predict the future movement of the participating nodes in the network according to their earlier activities observed by the admin. It is also used for making effective decisions for identifying the malicious nodes among the participating nodes in the network topology. Moreover, trust-based routing algorithms achieve better performance in energy consumption, delay, and security than other techniques [3], even though the presence of layers in the sensor node cannot supply a holistic security algorithm for detecting allt ypes of attacks in a network.
However, trust-based routing algorithms cannot fully ensure the security of multihop communications because trust can only handle inherent attacks and cannot predict new attacks. Furthermore, the trust score only considers data transmission and ignores the standard quality of service metrics such as Energy, distance, and the number of hops. Finally, most of the trust-based routing algorithm uses existing routing algorithms only. For all these reasons, the existing trust-based routing algorithms are not able to achieve better performance. This paper introduces a new Fuzzy Trust-Based Energy-Aware, Balanced Secure Routing Algorithm (FEBSRA), to resolve communication overhead and multi-hop communication issues. The proposed FEBSRA can improve the security level of the network and ensure data security over the multi-hop communication-based network. Moreover, it reduces the communication delay and communication overhead. In addition, it considered the traditional QoS metrics. It took care of new attacks that have occurred in the future with the help of the dynamic trust scores and generated the new types of fuzzy rules that can check the node's genuineness in terms of all the properties.
The rest of this paper is organized as follows: Sect. 2 discusses the related works of the proposed model, such as wireless sensor networks, multi-hop communication, trust-based routing, energy efficiency, and delay. Section 3 provides the overall architecture of the proposed system. Section 4 shows a better explanation of the proposed FEBSRA and provides a sufficient explanation too. Section 5 demonstrated the efficiency of the proposed FEB-SRA through the various experiments focused on the metrics such as energy efficiency, communication delay, communication overhead, and security. The paper presented the conclusion of the FEBSRA with highlighting the achievement and the future directions in Sect. 6.

Literature Survey
Many works have been done in the past by many researchers in Wireless Sensor Networks, Secure Routing, Energy Efficient Routing, Clustering, Multi-hop Routing, and Trust. Among them, Liangyin et al. [8] demonstrated that the (n + 1)th hop anchor neighbours are more useful when was compared with the nth-hop anchor neighbours for performing localization which is range-free in WSNs. Moreover, their model mentioned that the localization accuracy could not be unlimitedly enhanced by increasing hop counts. In practice, the hop count 'n' is a set between 2 and 4 based on the real scenarios to the desired localization accuracy. Adnan et al. [9] propose a new trust and energy-conscious routing protocol (TERP) to boost protection for WSN in the presence of several malicious and unreliable nodes. TERP focuses on two crucial trustworthiness and energy efficiency considerations most important to WSN's survival in hostile environments and intense attacks. TERP guides the sensor nodes through the shortest paths to forward packets consisting of trusted and energy-efficient nodes that balance energy consumption between trusted nodes. The weights implemented in trust estimation and in composite routing metrics allow for versatile adjustment and configuration, fine algorithm tuning, and the trade-off between different parameters. The combined trust and energy management principle allows TERP to record participating nodes' trustworthiness and energy levels. This multifaceted strategy helps pick a safe and energy-efficient route that is essential to WSN's lifetime network. The results of the simulation show better TERP efficiency as opposed to current schemes.
Trong et al. [10] presented a wake-up variation reduction PM model to resolve the wireless networks issues. Their model applied for the wireless sensor nodes powered by a sequence and the periodic energy source over a constant cycle of the whole day. Their model follows ENO condition and reduces the wake-up interval variations of the wireless sensor nodes. Ahmed et al. [6] presented a new low-cost localization algorithm that accounts for the heterogeneous nature of the wireless sensor networks. Moreover, their algorithm can locate the wireless sensor nodes, owning accurately for a new low-cost implementation that avoids additional energy consumption. Furthermore, a correction mechanism has been developed that considers the heterogeneous nature of wireless sensor nodes to improve localization accuracy without incurring any further expenditures. Their model performed well than other models in the direction of Energy efficient communications.
Slim et al. [11] developed a new localization algorithm that exploits that in addition to that the hop-based information. Moreover, the average location estimation between the two different anchor nodes of the network topology is derived in the closed form and compared. They have shown the performance of the proposed model by conducting the experiments in terms of accuracy. Moreover, they have proved that confirms the unambiguousness with higher accuracy. Ganapathy et al. [12] presented a new classifier that uses the clustering algorithm that performs the clustering process using K-Means clustering andthe Minkowski distance measurement formula and achieved better performance. Trong et al. [3] developed a new clustering technique thatwas distributed in nature to determine the best cluster-head for all clusters in wireless sensor networks to reduce the energy consumption level and the communication delay between the nodes. They've added a new cost-effective function to their technique, which uses the new clustering method to do inter-cluster multihop routing. Since they have proposed a multi-hop routing process between any two CHs to the base station with less energy conservation based on the communication delay. Moreover, they have conducted various experiments for the comparative analysis and identified the optimal parameter values to the trade-off from power consumption and the communication delay between the nodes in the particular size of network topology.
Danyang et al. [2] presented a new trust sensing-based secure routing mechanism with lightweight features and the capability to simultaneously resist many general types of intrusions. In addition, they optimized the route selection process by considering the trust level and the quality of service metrics into account. They have improved the security level and the overall efficiency of the WSN. Muthurajkumar et al. [13] presented an intelligent secured and Energy-efficient routing algorithm for mobile ad-hoc networks. They have applied intelligence for deciding on the routing process. Selvi et al. [14] developed a rulebased Energy efficient method that is delay constrained for effective routing and data communication in WSN. They have applied effective rules generated based on the delay and energy level of the sensor nodes. Their experimental results proved that the effectiveness of WSN in terms of a minor delay.
Xiaofeng et al. [15] presented a multi-hop connected clustering problem for the particular wireless network, a homogenous network formed as finding a minimum d-hop connected dominating set problem for a given graph. Moreover, they have proposed a distributed approximation algorithm named Connected Sparse Clustering Scheme for resolving the issue. Moreover, their system consists of three stages: dominator selection, connector insertion, and redundancy elimination. Their experimental results revealed that they outperformed existing research in this field. Thangaramya et al. [16] presented a new and Energy-efficient clustering approach using spectral graph theory in WSNs. They have used a spectral graph theory to decide the clustering process in the proposed model. Boyun and Donghui [17] categorized the wireless sensor network threats into two types and also analyzed that the defensive capacity of trust-aware secure routing models that various researchers introduced in the past for identifying and detecting the various types of malicious attacks. Furthermore, they have presented a new trust-based routing method that was robust when multi-valued qualities are taken into account in terms of communication costwhile designing the sliding window time method which combines with attack frequency detection the data overhead, energy level for assisting the wireless sensor nodes in the process of establishing the reliable routes. Their experimental results show the wireless network that deployed the proposed model that achieved better performance over the different routing paths or detected various attacks. Logambigai et al. [4] presented a new routing algorithm called Energy Efficient Grid-based routing algorithm that uses intelligent fuzzy rules. They have achieved better performance in terms of energy efficiency.
Singh et al. [18] presented a Clustered WSN Overhead Analysis and a Lightweight Trust Mechanism. In addition, a self-adaptive weighted approach for trust aggregation is defined to avoid error of judgement of aggregated trust calculation. Furthermore, our model delivers better resilience in a large-scale network with 35% hostile nodes, demonstrating that our approach is far more resistant to diverse malicious attacks. The drawback was, when 40-50% of malicious nodes are injected, the detection percentage reduces.
Xiao et al. [19] presented a new trust-based scheme for improving the data packet arrival ratio. In their method, abstract information of the data packet was transmitted to the sink node when the source nodes transferred a data packet into the sink node. In this model, the malicious nodes are dropping the data packets, but the abstract of the data packet was received from the source node and received by the sink nodes. In this scenario, the sink node knows the route and the malicious node location, and the sink node reduces its evaluation trust score of the node in the specific route. End of many data packets transmission, the participating nodes of the networks will contact each other. Now, the malicious nodes have been identified according to the node's trust values and declared as malicious nodes. This method has been achieved better performance in terms of security. Philip et al. [20] presented and explained that a newly developed decentralized trust management scheme for filtering out the malicious nodes over the delay tolerant networks. In their method, the acknowledgement for the successful transformation is merged that the energy level of the nodes that are used to formulate the direct trust. Then, the recommendation score is calculated from the indirect trust score, the recommendation credentials and the recommendation familiarity. The recommendation credentials increase the overall trust score by filtering out the dishonest recommendations. They have compared their new model with the cooperative watchdog method which was a recommendation score based model. The experimental results of their model handling the malicious behaviour nodes effectively in delay tolerant networks including all the Trust based attacks.
Yaw-Wen et al. [21] designed a new IoT based system which is useful for the wide area and the various heterogeneous applications. Their system is capable of controlling the timing errors and it permit us for relaxing the synchronize time period that is used to reduce the wasted Energy in WSNs. Their system is able to increase the efficiency of the protocol. Moreover, it was able to accommodate the sensor nodes which have high throughput and rate. The experimental results of their system that have been implemented and evaluated their system special characteristics and it also creates a secured connection with the database over the Internet. Yimei and Yao [22] designed a new compressed sensing method that is able to recover the sensing data at the destination node with the high delight when the situation arises to collect very less number of data packets that leads to reduce the network transmission time and enhance the network lifetime. Moreover, their method is efficient and easy to implement over the resource limited motes that are used to store any part of the random projection matrix. In addition, a new systematic approach by applying machine learning algorithms for finding a suitable representation in WSNs. Finally, they have validated their approach and also evaluated the performance by applying real time and outdoor multi-hop sensor networks. They have achieved the better performance than other existing systems in terms of reducing the data recovery errors and wireless communication costs.
Farhad et al. [23] introduced two new network methods that are used to manage the trust in static and distributed environment of WSNs. Their methods are capable of adopting the logic for generating and adjusting the trust scores for each node in WSN based on node observations. Moreover, it exploits the spatio-temporal related information that exists in the sensed data in wireless sensor networks by deploying a sliding window concept. Moreover, their method uses the location and data of each node that was used to find the trust score for each node in the network. Their experiments show the efficiency of their system in terms of detection rate with high reliability and energy conservation. Shilpa and Sangeeta [24] proposed a new hybrid data aggregation model which deploys the optimal number of hops. Moreover, their system improved the effectiveness of finding the routes with optimal number of hops for the possible routes from the source node to the destination node. Their system performance is proved that in terms of energy consumption and also compared with the individual other data aggregation schemes that are available in the literature by conducting the experiments. Zengwei et al. [25] proposed a new Hybrid Particle Swarm Optimization with Genetic Algorithm (HPSOGA) for resolving the NP-Hard problem. They have conducted many experiments which proved that the periodic charging planning is able to avoid the node deaths and also keeps the energy level of the wireless sensor nodes that are varying periodically. Their hybrid approach performed well than the Genetic Algorithm (GA) and Particle Swarm Optimization (PSO). Daiya et al. [26] presented MaSS and emphasizes that based on the implementation approach, the technology has the potential to provide security at the PHY of wireless devices. They've also concentrated their research on distorting mapping logic, dubbed Mapping Obfuscation (MO). Morover, the chance of incorrect FCS detection in MO-based MaSS is 30 times higher than the probability of real FCS detection. To limit the possibility of false FCS, attackers must examine many radio frequency (RF) packets in order to find a valid mapping key, which increased calculation time.

System Architecture
WSN devices are typically used in untrustworthy situations and are not regularly monitored. WSN networks are particularly vulnerable to a variety of assaults, and important data can be quickly leaked to unauthorised parties, posing major security and privacy concerns. Key management techniques, cryptography algorithms, identity authentication, twoway authentication schemes, and other security procedures exist at various tiers of WSNs, on the other hand, these security techniques necessitate a large amount of computer power and Energy from WSN nodes.Routing mechanisms plays a major role in wireless sensor networks. There are numerous proactive and reactive routing protocols for selecting the best paths for packet routing. If an increase in data theft is truly helpful, the adversary may extend the routing execution time as long as possible. In this paper proposed a Fuzzy Trust Based Energy Aware Balanced Secure Routing Algorithm (FEBSRA) for Secured Communications in WSNs.
The overall architecture of the proposed Fuzzy Trust Based Energy Aware Balanced Secure Routing Algorithm (FEBSRA) is given in Fig. 1. The proposed FEBSRA structure consists of ten important components such as sensor nodes, data collection module, Energy efficient model, energy manager, trust model, routing model, clustering model, decision manager, rule manager, and knowledge base.
Sensor Nodes The collections of nodes are to be considered for collecting the necessary details such as nodes energy level and the trust score.
Data collection Module The data collection module is used to collect the necessary information that is available in the sensor nodes. The collected information is forwarded into the decision manager.
Energy Model The energy model is responsible for managing the Energy according to the requirement that uses standard energy formulae to compute the energy efficiency over the WSNs.
Energy Manager It is responsible for managing the energy level. The necessary information is forwarded into the energy model through the decision manager and it use for making effective decision over the energy balancing process.
Trust Model This model consists of three sub components such as trust score calculation, communication cost and dynamic trust score. In order to calculate the trust score, appropriate formulae are employed, which are based on direct Trust, indirect Trust, and reputation score. In communication cost, the communication cost is calculated according to the time taken for communicating a message between the nodes. In dynamic trust score calculation, dynamically trust scores are to be calculated for all the participated sensor nodes. For these purpose, three different formulae are introduced in this paper. Routing Model This routing model consists of three sub components such as route formation, secure routing process and the route maintenance. Here, a newly proposed FEB-SRA is deployed for performing routing process with the help of energy model, energy manager and the decision manager. The potential routes must be efficiently maintained earlier in the routing process.
Clustering Model The clustering model is responsible for grouping the nodes according to the distance similarity between the sensor nodes in this work. It consists of three sub components such as Cluster head selection, cluster formation and the cluster maintenance. Here, the cluster heads (CHs) are selected according to the distance, energy level and the individual nodes trust. Group the relevant nodes according to the energy level, trust score and the distance between the nodes. Finally, it maintains the route which we have been grouped as a cluster.
Decision Manager It is an overall responsible and more important model also for completing the tasks that are able to supply the necessary information to the energy model from this manager. It received the necessary information from the data collection module and it forwarded to the trust model for trust score calculation, transfer to the energy model for balancing the energy level, and transfer these all received nodes information for grouping the nodes and it able to route the data packets based on the routing model suggestion.
Rule Manager This rule manager is used to manage the rules that has to be finalized by the decision manager and also to store the necessary rules in the knowledge base.
Knowledge Base The knowledge base contains the rules and facts that are useful for making decision over the processes of energy efficiency, clustering process, routing process and the trust score calculation process in the network.

Proposed Work
This section discusses about the proposed Fuzzy Trust Based Energy Aware Balanced Secure Routing Algorithm (FEBSRA) which is used for effective data communications in WSNs. The FEBSRA considered the energy level, delay, and trust scores, number of hops between the source and destination and with the nodes. Furthermore, new formulae for calculating various trust distances between the source and sink, as well as fuzzy rules for making final decisions over sensor trust models, have been introduced. Scores such as direct Trust, indirect Trust, reputation score, and data communication cost as a communication score have also been introduced. Moreover, an efficient energy model is used in this work. In addition to this, an existing clustering approach called K-Means clustering algorithm is also used for grouping the nodes that are useful for performing routing process. Finally, it generates the necessary fuzzy rules according to the trapezoidal fuzzy membership function for making final decision over the sensor nodes. The fuzzy rules are framed with the consideration of Energy, delay, number of hops and trust scores that are to be used for making final decision accurately.
The proposed FEBSRA is designed according to the trust scores and the sensor network design, fuzzy inference model and the cluster and trust based routing algorithm. For trust and network designing, the dynamic trust scores are calculated by using the dynamic rules over the sensor nodes and the links between the source and destination. For the effective network design, the rules over the positioning the wireless sensor nodes and the destination nodes are finalized by using the fuzzy rules. The newly generated fuzzy rules have been applied in this work for designing an inference model, cluster based routing, applying the rules over the trust score calculation, cluster formation, identifying the malicious nodes and unknown attacks, cluster head selection process and also performed the routing process.

Sensor Network Design
In this sensor network design process, the sensor node positioning and identifying the destination nodes are considered severely. The proposed model considers a sensor networking model that contains 'n' number of wireless sensor nodes which are deployed uniformly and randomly in a circular fashion with the radius value 'r' that must be less than 100 m distance and a destination node is initially positioned at the centre of the circular area. Initially, in this framed circular contains around 50 wireless sensor nodes as participating nodes that must be positioned randomly. This process is to be repeated for covering the specific area like (100 × 100) m where the m indicates the meters. In a wireless environment, the participating nodes of this wireless sensor node were connected utilising a connectionless link. These wireless sensor nodes are able to move forward from one position to another one position and also associated with the various destination nodes. Here, the possible destination nodes are able to communicate with each other nodes and also to do the data sharing also takes optimal and right decisions collaboratively.

Attack Design
In this work, old and new types of attacks are considered for detection and prevention. The dynamic trust scores are calculated for all the participated nodes in the uniform time interval according to the fuzzy rules. The nodes behaviour, traffic density level, nodes movement and the available neighbour nodes are considered while calculating the trust score and making decision over the sensor nodes. Here, the Denial of Service (DoS) based attacks that are belongs to flooding attacks and black hole attacks according to the nodes comparisons that are identified based on their trust scores. Dynamic trust scores have been calculated in this work according to the response time, energy consumption, number of packets dropped during the particular time period and reputation score of the nodes that is given by the neighbour nodes. The proposed trust model supplies the dynamic trust scores for all the participating nodes that are available in cluster links and entire networks that all will come under the base station and it also can be extended. This attack model considered the black hole attacks that are to be formulated by the compromising sensor nodes in WSNs. Moreover, these are eliminated with their data packets and also to minimize the capability of neighbour sensor nodes of the entire sensor network and especially the current nodes. These kinds of sensor nodes are identified and removed from all the activities of the sensor networks by using the dynamic trust score.

Energy Model
The proposed FEBSRA used in the existing energy model [4]. It is used in Eq. 1 for calculating the energy level for transmitting the data from source node to destination node in the network. In addition, the Eq. 2 is helpful for calculating the required Energy to receive the data packets. The standard symbols D1, D2 and E el are to be used for representing the transmission circuit loss, automatic energy reduction and the energy reduction due to the multipath fading process in WSN. In addition, the standard symbols ε fs and ε amp are also to 1 3 be used for representing the respective energy level that are required for energy strengthening in the two different energy models that are available already. Finally, the energy consumption is required to receive an l-bit data packet that is shown in the Eq. 2. In addition, the standard symbols such as 'd' and 'd 0 ' are indicating the real distance and the threshold distance values for the nodes from the base station.

Dynamic Trust Model
This subsection explains the dynamic trust score calculation process for each node present in the WSNs. Here, we have calculated the direct trust, indirect trust, reputation score and the communication trust score are to be considered as dynamic trust score that has been calculated during the particular period of time. This section is summarized one by one in detail.

Direct Trust
In general, the behavior of sensor nodes in wireless sensor networks is monitored by neighboring nodes. Hence, the wireless sensor nodes are considered more in the process of calculating the energy level of the node, current energy level of the node, available memory space and the network bandwidth and it is not sufficient for judging the trust scores of the participated sensor nodes only through monitoring the sensor nodes behaviour (Xu et al. 2014). Therefore, this work is combined the behaviour of the node with energy level for evaluating the degree of nodes trust worthiness. First, it calculates the direct behaviour trust of each participated nodes that are involved in the process of communication. This work is calculated the direct behaviour trust scores (DBTS) of all participated nodes by using the Eq. (3).
where DBTS p(b) (a, b) m−1 indicates that the direct behaviour trust score of the node a and the node b in the past,DBTS N(b) (a, b) m−1 represents that the direct behaviour trust score of b for a based on the worst attitude of the node b in earlier days. Here, n indicates the total number of available neighbour nodes and 1 denotes that the sequence number of the available records. Moreover, 1 and 2 represents that the self-adaptive exponential decay time factor of the positive evaluation and the negative evaluation respectively. CBN(a, b) l indicates that the evaluation for the nodes current behaviour trust of node b by applying instruction detection system [35]. In addition,CBN(a, b) is defined as per the given Eq. (4). (1) where P(b) and N(b) indicate that the positive evaluation and the negative evaluation for the sensor nodes behaviour respectively. Here, the sensor nodes behaviour is not to be accurate when the predicted score is in fuzzy state. So, the CBN(a, b) value is 0. In this situation, the value of 1 is reduced for normal character and the 2 value is increased the malicious behaviour that can be adjusted for ensuring the bad attitude is memorized from a long time than the good attitude.
Next, the sensor nodes energy trust score is calculated in this work. Normally, the sensor node which has highest trust score is to be selected for transferring the data in the secure routing algorithm. Here, it consumed more Energy of the sensor nodes with high trust score with uneven network load and the even network segmentation. The energy trust score is calculated by using the formula which is given in Eq. (5) and the Eq. (6) according to [36].
where L indicates the number of bits for a message, e represents the distance between the nodes a and b,E elec indicates that the volume of total consumed Energy for forwarding the messages through node b and E amp indicates that the consumed Energy for achieving better performance during data forwarding process. So that the total consumed Energy of the node b is for transferring the data is: Moreover, the network initial energy level is EnInit and the Energy EnS of the node b is: Here, the sensor node surplus energy is greater than the threshold value of the Energy Th En .
Otherwise, no matter how high the node's degree of behavioural trust, it cannot participate in the transmission of information. Node b Degree of Energy Trust EnTDb is classified as: The degree of direct behaviour trust score calculation of D _ DBTS(a, b) m is considered the sensor nodes behaviour and the energy trust score of the sensor nodes in the WSN as given in Eq. (10).
where the sensor nodes behaviour and the energy level of the sensor nodes that are equally important for computing the degree of nodes trust behaviour the value of D DBTS (a, b) m and the EnTD b that are assigned equally.

Indirect Trust
The indirect trust score is the confidence level between the nodes that can be provided by the neighboring nodes of the source nodes connected in the network.Similar to the direct trust model, the indirect trust level which is compose of the sensor nodes indirect behaviour trust degree and the indirect energy trust degree. Here, the energy consumption is serious consideration along with the trust score degree of the same node similar to the direct behaviour trust score calculation. Here, the indirect nodes behaviour trust degree is also considered. If the node b which is directly connected in the wireless sensor network that is C b , INBTD(a,b) m indicates the indirect nodes behaviour trust degree which is computed by using the nodes based on the recommendations that are provided by all other neighbour nodes in C b by using the Eq. (11).
This INBTD is used to identify and prevent the bad mouthing and collusion attacks by using the direct behaviour node trust score. By defult, this score of all the nodes must be verified by available and participating nodes in C b. The dissimilarity nodes trust degree of the target node 'b' for node 'a' by using the Eq. (12).
For any other neighbour node in the direct connected domain of target node b, INBTD k ( , b) m + cs (a, ) m k k > m, the recommended node is not to be adopted. Here, dissimilarity threshold checking process is fixed value that is related to the specific network topology and the relevant data. Finally, the malicious nodes in the set of credible nodes are identified and detected in this work and also considered the false positive rate of them and also to be excluded from the concern wireless sensor network environment. Similar to the procedure of calculating the direct nodes behaviour trust degree, the node 'a' is obtained the indirect nodes behaviour trust degree value of the specific node b: where the weightage of the INBTD(a, b) m and the EnTD b are also to be equal that areassigned like the Eq. (13).

Energy Trust
Energy is an important feature in sensor networks and it is determined the network life time. In addition, the energy consumption is used to find whether a misbehave node that launched the malicious attack which is able to arise the security problems or not. Therefore, this work uses two energy trust metrics such as residual energy ratio and the energy consumption rate ratio. In the residual energy ratio, the residual energy ratio of the object node which is added to the data packet information when the object node sends the data to the subject node. Suppose, the subject node finds the residual Energy of the object sensor node and that value is minimum of finalized threshold. Moreover, the object sensor node is considered as an ineligible sensor node that is not to appear in the process of normal data packet transmission anymore and also set this Energy is to 0. On the other hand, in the energy consumption rate differentiation transmits the current energy consumption with residual Energy sequentially by the object node. Here, energy rate is different from node to node and also not exactly the same value due to the presence of the sensor nodes and the availability of the neighbour nodes. Here, the number of hops also considered for finalizing the energy trust score. Some researchers introduced few techniques to measure the trustworthiness of the Energy [27] and it utilizes the energy consumption rate differentiation using the Eq. (1) for detecting the anomalous. The energy trustworthiness score of the object node is calculated by using the Eq. (14).
where EnTr i,j indicates that the energy trust score of the nodes i to j. Even though, no effective inspection technique is used for judging the accuracy of the Energy related data that is supplied by the object node in the current network topology. If a node gives an incorrect report on energy consumption and residual Energy, the sensor node chosen by the neighbour nodes that are available as reliable next hop nodes.This wrong report affects the attack detection. So, the malicious node must provide right data truthfully and it can be verified through experiments.

Data Communication Trust Score
The data communication trust score is a very basic data which is used for examining the credibility of the object node in the process of trust score evaluation. For detecting the black hole attacks and the grey whole attacks by using the data communication trust and also adopts two data communication trust metrics such as packet received feedback and the packet forwarding. Here, the feedback is received from the object node within the limited time duration then it is considered and also encountered the particular communication process is done successfully otherwise the particular communication process is considered as failed. In the packet forwarding metric, the particular node received the feedback from object node by the watchdog mechanism within the time duration then it is considered as a successfully to forwarded into the destination node otherwise the data communication process is encountered as failure. Moreover, the data communication trust is able to predict whether the object node is behaved normally or not in the future and also perform the trust where DCTS i,j indicates the data communication trust of the subject node i into the object node j while SDC i,j and UDC i,j indicate that the total numbers of successful data communication and the unsuccessful data communication process between the nodes i and j through the direct data communication trust metrics respectively.

Overall Trust Score
The overall trust score (OTS) is calculated by using the direct node behaviour trust score (DDBTS), indirect nodes behaviour trust score (INBTD), energy trust score (EnTr) and the data communication trust score (DCTS) by applying the Eq. (16).
where, t1 and t2 are indicating the starting time and the ending time. Here, the overall trust score is finalized for the particular time duration only by the results of the direct, indirect, Energy and data communication trust scores at the same time interval. The overall trust score is considered for finalizing whether the node is normal or malicious.

Clustering Model
This section explains in detail about the clustering model which uses in the proposed model for grouping the nodes that are available in WSNs. Here, the cluster is formed according to the distance between the nodes and the residual energy level of the node. Moreover, the distance between the nodes is calculated by using the Minkowski distance measurement formula [12]. In addition, this model uses the fuzzy rules that are generated newly in this work according to the values of energy level of the node and the distance between the node and the neighbours. After that, a cluster head (CH) is selected according to the nodes energy level and the position of the node in the sensor nodes of the sensor network. Here, the fuzzy logic has been used with fuzzy rules that have been generated according to the overall trust score, energy level and the distance. New fuzzy inference model is also introduced in this paper that contains the process of fuzzification, fuzzy inference engine, fuzzy rule firing and the defuzzification. In this fuzzification process, five fuzzy variables such as low, medium, high medium and high are applied over the trapezoidal fuzzy membership function to perform the decision making process. In addition, it avoids the malicious nodes during the routing process.

Routing Model
This section explains the proposed routing algorithm called Fuzzy Trust Based Energy Aware Balanced Secure Routing Algorithm (FEBSRA) for secured data communication in WSNs. The proposed FEBSRA used in the energy model, trust model, clustering model and the routing model. All these models are containing various newly proposed techniques that are useful for making effective decision over the sensor nodes in the routing process. The proposed FEBSRA consists of five phases such as clustering model, trust model, energy model, security model and the routing model. In this five phases, the necessary steps are available for performing the clustering process, calculates the trust scores such as direct trust score, indirect trust score and the data communication trust score. In third phase, energy trust is calculated for each node and checks whether the specific node is normal or attack by applying fuzzy rules that are generated by using the overall trust score and the energy level of the node and the number of hops in fourth phase of FEBSRA. Finally, the routing process is performed by using the eligible nodes. The various steps of the proposed secure routing algorithm are given below and also explained in detailed about the working process of the algorithm in this section.
Trust and Energy aware Secure Routing Algorithm Input: Wireless Sensor Nodes, Destination Node Output: Clusters and the Secured Routes

Phase 1: Clustering Model
Step 1: Locate the wireless sensor nodes within the area of circle randomly.
Step 2: Positioned the destination node at the centre of the circle which is fixed early.
Step 3: Create a new cluster by applying the standard clustering algorithm called K-Means clustering and mention the current density of the node.
Step 4: Assign the initial trust score for all the sensor nodes and the destination node to 0.6 each.
Step 5: Generate fuzzy rules that are based on the energy level, mobility and the trust score.
Step 6: Select the cluster head according to the particular node with better trust score, less movement and minimum distance to the neighbour nodes in the group. Step 7: Select the possible routes to reach the destination from the cluster heads.
Step 8: Initially, transmit a set of data packets from the specific sensor nodes to the destination node and also the base station of the network.
Step 9: Repeat the steps 10 to 17 until the sensor network has 'NO POSSIBLE TRUSTED ROUTE'

Phase 2: Trust Model
Step 10: Call the trust model () for calculating the trust scores. 10a. Calculate the direct trust score by using the formula 10b. Calculate the indirect trust score by applying the formula 10c. Calculate the data communication trust by using the formula 10d. Find the overall trust score by using the direct, indirect and data communication trust by applying the formula

Phase 3: Energy Model
Step 11: Calculate the energy cost of the participating nodes in the sensor network by using the formulae

Phase 4: Security Model
Step 12: Compare the trust scores of the cluster heads and the member nodes that are available in the sensor network.
Step 13: Apply fuzzy rules for identifying the DoS attacks and maintains the total number of attacks available in the sensor network.
Step 14: Apply fuzzy rules for finding the black hole attacks and also keep the numbers.
Step 15: Perform the re-clustering process by using the fuzzy rules and also to select the cluster heads if new clusters are formed during the re-clustering process.
Step 16: If the attacker is identified from DoS or Black hole attacks then those nodes must be de-activated and also change the network topology if necessary.
Step 17: Transmit a new set of data packets and calculate the new trust scores for the nodes once again by calling the trust model.
Step 18: List the nodes that are identified as unbelievable or not useful for the routing process.

Phase 5: Routing Model
Step 19: Route formation by using the eligible sensor nodes for reaching the destination node.
Step 21: Send the data packets through the finalized secure route.
The proposed FEBSRA uses the existing clustering algorithm called K-means clustering algorithm for grouping the nodes according to the distance that is calculated by using the distance measurement formula called Minkowski distance. Moreover, the energy level of the nodes is measured using the existing energy model. Here, the energy trust value is also calculated newly in this work. In addition, new trust model has been proposed in this work for calculating the direct trust, indirect trust, data communication trust and the overall trust score for all the nodes that are useful for classifying the nodes as normal or attack. In this FEBSRA, a new security model is also proposed by applying newly generated fuzzy rules by using the overall trust score and the energy trust score. Finally, send the ResEn s (1 − Δp)ResEn s ≥ and Δq ≤ r 0 ResEn s ⟨ orΔq⟩ data packets through the finalized routes and also produce a list which contains the nodes are not eligible for participating in the routing process.

Results and Discussion
This work has been implemented by using the network simulation tool called Network Simulator version 2 (NS-2). The simulation parameters which are used to carry out this work are shown in Table 1. The performance of our proposed method is compared LEACH routing algorithm [28], HEED [1] LEACH with trust mechanism [29], LEACH with Trust and energy consideration [30], TSSRM [2], TRPM [17]. The packet delivery ratio analysis is shown in Fig. 2 which considered the proposed algorithm and also the existing routing protocols for the analysis. There are five different experiments have been conducted for this packet delivery ratio.
From Fig. 2, it can be noted that the use of the direct and indirect trust score which are improved the packet delivery ratio in the proposed model when it is compared to the other existing secured routing algorithms such as LEACH routing algorithm [28], HEED [1], LEACH with trust mechanism [29], LEACH with Trust and energy consideration [30], TSSRM [2] and TRPM [17] which are used trust mechanism and clustering technique for making clusters in the network. The reason for the better packet delivery ratio achieved in the proposed model is the use of trust score calculation, energy level consideration and the incorporation of new outlier detection algorithm. Figure 3 depicts the communication delay comparison between the routing algorithms namely LEACH routing algorithm [28], HEED [1], LEACH with trust mechanism [29], LEACH with Trust and energy consideration [30] TSSRM [2], TRPM [17] and the proposed TESRA.
From the experimental results shown in Fig. 3, many observations can be made. First, the clustering process reduces the delay by grouping the sensor nodes. Second, the use of trust values reduces the communication delay by preventing the malicious nodes from introducing intended delay. Finally, the use of clustering, fuzzy rules, energy trust along with trust modelling enhances the security by the application of fuzzy rules more efficiently leading to reduction in overall delay. Figure 4 is used to show the comparison of the number of packets delivered when the packets are routed using the exiting algorithms such as LEACH routing algorithm [28], HEED [1], LEACH with trust mechanism [29], LEACH with Trust and energy consideration [30], TSSRM [2], TRPM [17] and also the proposed secured routing model that uses fuzzy rules and trust modelling along with energy trust. In this process, five different experiments have been conducted by varying the mobility speeds of sensor nodes from 10 to 50 m/s. From the results shown in Fig. 4, it should be noted that in terms of the number of packets delivered with different mobility speeds, the performance of the routing algorithm with confidence modelling is better than the algorithms that do not consider trust modeling. The routing algorithm proposed also outperforms all other current routing algorithms considered in this work due to the use of fuzzy rules, clustering, trust management and energy trust. Figure 5 shows the comparative analysis between different existing routing algorithms namely LEACH routing algorithm [28], HEED [1], LEACH with trust mechanism [29], LEACH with Trust and energy consideration [30], TSSRM [2], TRPM [17] and the proposed secured routing algorithm that are tested by applying varying mobility speeds in each rounds.
From Fig. 5, it can be noted that the energy consumption is minimum when the packets are routed through the proposed FEBSRA than the other routing algorithms namely LEACH routing algorithm [28], HEED [1], LEACH with trust mechanism [29], LEACH with Trust and energy consideration [30], TSSRM [2] and TRPM [17]. Here, the performance improvement has been achieved not only through the application of fuzzy rules, trust mechanism, clustering and Energy Trust. Figure 6 shows the security level analysis for the newly proposed secured routing algorithm and the other routing algorithms namely LEACH routing algorithm [28], HEED [1] LEACH with trust mechanism [29] and LEACH with Trust and energy consideration [30], TSSRM [2] and TRPM [17]. Moreover, five different experiments have been carried out with various set of nodes in the sensor network scenario like 100, 200, 300, 400 and 500 for analyzing the security level of the proposed work.
From Fig. 6, it can be observed that the performance of the newly proposed secured routing algorithm is better when it is compared with the other routing protocols namely LEACH routing algorithm [28], HEED [1], LEACH with trust mechanism [29] and LEACH with Trust and energy consideration [30], TSSRM [2] and TRPM [17]. The reason for this improvement is to be the use of energy trust, intelligent fuzzy rules, effective direct, indirect, and communication trust and the consideration of Energy while making the effective decision over the routing process. The newly proposed intelligent weighted Fig. 5 Comparative analysis based on Energy Consumption fuzzy cluster based secured routing algorithm evaluates many performance criteria such as energy consumption, end-to-end delay, security, and packet delivery ratio. The overall performance of this proposed work is significantly improved when it is compared with other routing algorithms.

Conclusion and Future Work
The Fuzzy Trust Based Energy Aware Balanced Secure Routing Algorithm (FEBSRA) is designed and implemented for enabling effective secured data transfers in WSNs. The proposed FEBSRA considered the delay constrains, fuzzy logic and fuzzy rules for making final decision over sensor nodes with the consideration of number of hops between the source and destination nodes, energy level of the nodes and the trust scores. Moreover, a new dynamic trust model also has been proposed and implemented with the use of newly introduced formulae for calculating the trust scores dynamically with the consideration of energy level of the communication delay which is calculated by using number of hops used for the specific communication. The proposed FEBSRA achieved better performance in terms of energy consumption, delay, throughput, overhead and security is better when compared to the existing systems. Future works will be focus on introducing an intelligent agent for enhancing the decision making and communication processes.
Funding The authors have not disclosed any funding.

Conflict of interest The authors have not disclosed any competing interests.
Data availability Enquiries about data availability should be directed to the authors.  He has received an Award for Research and Contribution at Galgotias University. He has also received a certificate award on "Wipro Certified Faculty" and "Advance Technology program" on Java-J2ee from Wipro Limited. His research and publication interests include Artificial Intelligence, Machine Learning, Big data analytics and Networking. He has published several SCI, Scopus Indexed journals in his research carrier. Professionally he is member of many professional Bodies and held many positions including Keynote Speaker, Reviewer, and Program Chair for various Technical Conferences.