1 Introduction

A WSN is a system of sensor nodes that transmits the information needed by the network. For the collecting of secure data, WSN is utilized in a variety of contexts, including weather forecasting, the military, underwater research, etc. [1,2,3]. Transceivers, external memory, microcontroller, power source, and one or more sensors are the components of a sensor node. The sensor node’s battery cannot be replaced once it has been deployed. The node’s functionality is impacted as the energy level decreases. The sensor node with the empty battery eventually dies and is unable to communicate with any other nodes in the network. Network lifetime is shortened as a result of increased energy usage [4, 5]. Usage of Energy increases and Lifetime of Network Decreases. Energy should be conserved to boost network efficiency and consequently lengthen the network’s useful life. Now a days lifetime concern is one of the major aspects that must be taken into consideration in WSN. Several measures are taken in order to enhance the lifetime of batteries associated with sensor nodes so that networks can work under harsh environmental conditions. Lifetime is perhaps the most important problem in the design of sensor networks because the aim of most WSN applications is to deploy unattended nodes for months or years in the sensing sector. The lifetime of sensor network is the time from the start of the operation of the network until a fraction of the nodes drains from their power, resulting in a network routing hole or disconnected network, or a network with insufficient coverage. The life of a network of sensors is essentially hindered by the power consumption of nodes. In order to optimize proper usage of battery life, each node must control its own local power supply. It is not the typical node life that counts in many implementations but rather the minimum node life. Lifetime is a time period in which nodes in the network are functional and transfer the data. According to researchers, lifetime is

Lifetime = S (Total functional time of node) that is \(\sum_{i=1}^{n}St\) where S is the Serving Time [24].

Energy and lifetime are the two major concerns which should be taken into consideration while working in Wireless Sensor Networks as both have a great impact on the working of the network. There is requirement of battery for power consumption while deploying any node in the network. The basic principle of any network is to transfer the data from source to destination. During data transfer, three things should be taken into consideration which are transferred packets (Tx), Received packets (Rx), and Data Aggregation (Ax). The power in watts associated with the nodes in the form of batteries is converted into energy in joules or millijoules that is consumed while the data is transferred from the input source to the receiver node. So, E is used for Energy Consumption as shown in equation

$$E = \mathop \int \limits_{0}^{t} Power\;\left( {time} \right)$$

The energy associated with the node as per the attached battery is called the Residual Energy. One of the problems occurs in WSN during network deployment is that the battery cannot be changed during the simulation. In this situation, the nodes are required to continue operation with the available battery. Hence the node’s energy consumption and lifetime are inversely proportional to each other as the more the energy consumed, the lesser the lifetime of that particular node [25].

$${\text{Energy}}\;{\text{consumption}} \uparrow {\text{life}}\;{\text{time}} \downarrow$$

When the node is functional in the network, then it is called the Alive node, and when the battery of the node gets finished, then it is called Dead node. WSN can be homogenous where similar nodes have equal attributes in terms of memory, residual energy, etc., and heterogeneous where different residual energies are associated with different nodes. If the nodes having smaller residual energy for data transfer in lieu of the nodes having larger residual energy, then the previous ones will be dead, thereby increasing the number of dead nodes in the network. This is also one of the major issues in WSN known as scalability. Nodes will participate at the given time according to their residual energy known as Active Nodes and which should be at the resting mode at the given time known as Normal nodes with the help of finding the Average Residual Energy of the nodes in the network. There are numerous methods for improving longevity and energy efficiency. The management of the trust is one strategy.

1.1 System of trust management

The first question is: What does the word “trust” mean? Trust can be defined as a conviction or assurance that something is true. Belief in the goodness, talent, or organization of something or someone. The possibility that nodes whose behaviours cannot be controlled may be behaving in a way that is in favours of the network is another definition of trust. One may say that the relationship between the node that one can trust and the other node that one can trust is positive [7, 8]. The concept of trust management contains two main entities: Trustor, the one who trusts in something, and Trustee, the one who can be trusted on. Every node in the network needs to be examined to see whether it is reliable or not, and every node needs to be involved in this process. Differentiating between reliable and unreliable nodes in the network is the primary goal of a trust management system. The network only keeps the reliable nodes while eliminating the faulty nodes. This exclusion is justified by the possibility that unreliable nodes will increase network latency, energy use, throughput, and longevity. If network services are based on reliable data, they can be provided with no problem. As a result, before a data item is processed further and sent over the network, a system must assess whether it is reliable. Unreliable data is disregarded, and the source is given a lower reliability rating. It is vital to evaluate the veracity of data as soon as feasible to prevent mistrust information from being processed further, hence minimizing potential harm. Big networks may encounter poor performance and an excessive concentration of network traffic as a result of a dedicated node’s centralized analysis. Each node in the network is expected to participate in the assessment of credibility and make judgments about trust [9, 10].

From the viewpoint of a WSN, trust is the action of accepting a message after determining if the data and its origin are trustworthy. A node in the network can operate as both a trustee and a trustor: for departing data, it assumes the role of a trustee, enabling other nodes to determine if it can be accepted; for arriving communication, it can act as a trustor, determining the sender’s reliability in real-time. Since the receiving node (the trustor) determines if the message is trustworthy and authentic at the time of delivery, a trustee is always a notification sent by one node to another.

1.2 Trust management model working

The basic assumption of the trust management model is that a kind of scale is used by all the nodes known as the “Trust Scale”. A complete trust level node that is 100 percent reliable, the starting trust level, and the cut-off level are three typical values that can be taken into account concerning this scale [11]. The term "initial trust level" describes the amount of credit given to a node when it first joins the network and its trustors do not have any additional supporting information about its dependability. The "cut-off level" is the amount of confidence below which a node is deemed to be unreliable. Each node must participate in the trust management procedure, and current records of other nodes' reputations must be maintained. The Trust Table is created as a result of this data structure. Every entry in the trust database has a trust value assigned to it based on the trust scale. A dummy example of a Trust table based on the example network for node1 can be shown in Table 1.

Table 1 Dummy example of Trust values of different nodes in the network

Based on entries in the trust table, a node can approve any other node than itself. This process is referred to as recommendation [6]. Based on this, a model that contains details about each node in the network and generates the trust table can be created. Each node, message, a trust table item, and node’s reputation are further contained in the following entities, which might act as a part of the trust table.

The model execution is done through cycles and each cycle has two phases namely the data phase and the recommendation phase.

The contributions of this paper can be summarized as follows:

According to the reviewed literature, there is plenty of room for the use of machine learning architecture and the use of SI algorithm architecture to develop and advance sensor node trust.

  • The trust model that has been created against the sensor nodes is presented in this study together with its proposed work design and execution.

  • The goal is to create a network with a high trust factor so that resources are not squandered, and the network can operate for an extended period.

  • The proposed work is compared with a reward-based routing mechanism based on QoS parameters that are throughput, PDR, and delay.

The sensor nodes transfer data based on the requirement and to prevent the unwanted waste of resources within the network proper cluster arrangement of sensor nodes with higher trust level in the network is highly recommended. Various strategies have been used in order to provide solution but the problems still not encounter optimally. Hence in order to address the real time bottleneck issues related to network lifetime, we proposed an optimal solution which improves the ranking of the nodes with higher trust level. The proposed technique employed the statistical machine learning and swarm intelligence strategy with dragon fly algorithm in order to address the issues related effective rank generation of nodes and improving the network lifetime. The different QoS based parameters such as throughput, PDR and delay has been used in order to evaluate the efficacy of the proposed model.

Table 2 illustrates the notations used in the paper.

Table 2 Abbreviations

The rest of the article is written in the following way. Section 2 illustrates the related work. Section 3 states the problem statement. Section 4 presents the detailed work architecture of the proposed algorithm. Section 5 contains the result and analysis. Section 6 gives the conclusion and future scope.

2 Materials and methods

Over time, there has been a revolution in the way that WSN sensors are designed. The development of sensors is taken into account, including their lightweight, small size, and low power consumption. Battery depletion, which causes a delay in sensing and transmitting data, however, continues to be a major problem. The research into various ways to assure network stability and reduce consumption of energy and end-to-end delay throughout data transfer has accelerated because of the growing effect of WSN in practical applications. The concept of trust management also played an important role over time.

The existing work illustrates the various trust management techniques and models being used in the field of WSN. A dynamic protocol was suggested in this article to accommodate the requirements of varied applications. This protocol focuses on real-time large-data transmission, making it more effective to employ in IoT-based applications. The proposed protocol consists of algorithms for data transmission, neighbor discovery, and routing table creation. Five algorithms were demonstrated in this article. A neighbor finder algorithm is one of them. Each node’s cost to each of its neighbors as well as its cost to the BS are calculated. As a result, at the end of the procedure, each node can generate its own routing table. Pathfinder, the second approach, is suggested to discover the optimum path between sender and target (destination) nodes in the network. In contrast to many studies in the literature, this method operates more effectively because each node can modify its cost to target based on the information it acquired from nodes in its layer before broadcasting a packet to its neighbors. It effectively manages the CPU units and power. As a result, it behaves differently from greedy algorithms like Dijkstra and is more successful at locating optimized paths. Three additional data transmission techniques that can be used in a variety of situations and applications were also proposed. The three alternative mechanisms are suggested in order to demonstrate a dynamic routing system and broaden its usefulness. All of the proposed algorithms' performances were assessed both theoretically and experimentally [12].

An energy-saving dynamic clustering method for wireless sensor networks is proposed in this research. Our objective is to reduce the likelihood of missing the target and improve tracking accuracy. Cluster creation and cluster head selection make up the first phase. The following phase involves building a new cluster based on moving targets. Therefore, the cluster head determines the target’s present location. Target tracking in the environment will be done in a later phase by routing the target across nodes. This situation results in network-wide energy savings. We used the ns-2 simulator to implement our tracking technique. Our algorithm’s missing rate is 9% [13].

In order to identify the best paths, this article suggests two novel energy-efficient routing techniques based on the Incremental Grey Wolf Optimization (I-GWO) and Expanded Grey Wolf Optimization (Ex-GWO) algorithms. In addition, a general architecture has been suggested in this paper, allowing a variety of other metaheuristic algorithms to function adaptively alongside these algorithms. The new fitness function is defined in the proposed approaches to choose the next hop based on criteria including residual energy, traffic, distance, buffer size, and hop size. These measurements are crucial for making further node decisions. These techniques' primary goals are to reduce traffic, enhance associated systems' fault tolerance, and boost their dependability and lifetime. The ideal values for these parameters are determined using the two metaheuristic methods outlined above. The offered approaches determine the optimum path of any length between any source and destination node. The established network and system were used in this investigation, and a simulation environment was used instead of a ready dataset. The best path, as determined by the lowest cost of the best paths obtained using the suggested approaches, has thus been found. In distributed and decentralized peer-to-peer systems, these techniques can be highly helpful. Network lifetime, alive node ratio in the network, packet delivery ratio and lost data packets, routing overhead, throughput, and other metrics are used to evaluate and compare performance [14].

On the basis of energy conservation while facilitating communication between sensor nodes across the entire network, the Energy Effective-Accuracy Routing (EEAR) protocol is recommended for wireless sensor networks in this study. Through the use of the data center gradient diffusion routing protocol, EEAR can preserve energy while maintaining communication and pathways that go to the sink. By detecting and controlling radio frequency and other components of additional sensor nodes, this is realized. The Gradient-Based Routing (GBR) and Naps topology management protocols were combined to create EEAR, which maintains a nearly constant level of routing accuracy without the use of geographic position information. This protocol places additional nodes in a sleeping state after constructing communicative layers towards the sink while maintaining inter-layer connectivity. A node can actually enter a state of sleep in each layer by identifying some other nodes that can do its communication tasks in its place. EEAR produces significant results in continuous and event-driven models towards query-driven models despite conformance with all data delivery types. In this study, we applied EEAR and contrasted it with other approaches including GBR, Naps, and GAF. According to simulation studies, EEAR performs at least as well as location-based protocols in terms of topology control, routing, and energy conservation, as well as increasing packet delivery volume and lowering average packet delay [15].

The author discussed the trust models concept that is further categorized into three types namely “centralized” where the focus is on the head node of the network that undertakes the job of deciding the trustworthiness of the node based on the trust data collected on its own or by the data provided by all other nodes in the network, secondly, the “hierarchical” one in which network is divided into groups called clusters and it is the responsibility of cluster head to aggregate the data and calculating the trust and third one is “distributed” in which each node monitors its neighbour’s behaviour and their trustworthiness is calculated. In nutshell, this paper discusses the nodes' capabilities, the network restrictions, and the risks involved in terms of the lifetime and bandwidth of the network to design and implement the trust model for enhanced security [16].

Besides the fruitfulness gained by WSN through the trust model, various attacks on these trusted models are discussed. These attacks reduce the efficiency of the trust model. Bad mouthing attack, On–Off attack, selective behaviour attack, Sybil attack, newcomer attack, etc. A set of best practices is discussed for designing the trust model for WSN. A set of best practices can be identified as considering trust and reputation, trust and the base station, first-hand information gathering, second-hand information gathering, initial values, granularity, updating and aging, risk, and importance. Through the analysis of different techniques in trust management, it is concluded that the set of best practices should be taken into account to get a successful trust model for WSN [17].

The authors discussed the various trust models for ordinary WSNs and clustered WSNs.

For ordinary WSNs, two types of trust models are available i.e., Node trust models and Data trust models [7].

Authors proposed a new technique named ESRT, a new trust and energy-based routing protocol that gives efficient flexibility against the faulty nodes and their behaviours experienced while forwarding packets. This technique looks at the distributed trust. The simulation results in the performance improvement of ESRT against existing techniques like R-AODV and TLB-AODV when these are disclosed to various numbers of problematic nodes and fluctuating network demand [8]. The authors presented their work on the data trust model and used data correlation techniques to create defect detection and data restoration approaches. [18].

To improve network security for resource-constrained WSNs, this study suggests AF-TNS. To maintain the neighbours’ level of trustworthiness, AF-TNS operates in two phases: trust evaluation with constrained energy and metric-based node evaluation. The AF’s difficult decision-making process is made simpler by the random Tran sigmoid function’s use of trustworthiness to maintain network performance and untrusted nodes. According to the results of the simulation, AF-TNS increases the likelihood that malicious activity will be detected and extends the lifetime of the network. According to the experimental findings, the AF-TNS approach ensures a minimum of 8.5 s of latency, 8.53 J of energy, 149 kbps of throughput, and 390 s of network lifetime when delivering network information. It also has a lower false detective rate of 1.5% [19].

To provide WSNs with optimum and safe routing, the new secure routing algorithm EATSRA is presented and implemented in this study. In this approach, the decision tree-based routing algorithm is utilized to choose the best and most secure path, and the trust scores are used to more effectively detect attackers in WSN. Additionally, spatial–temporal restrictions have been employed to make routing decisions. Through simulation-based testing, it has been found that the proposed EATSRA performs better by consuming less energy and improving security and packet delivery ratio [20].

In this paper, an efficient BTEM technique is proposed whose purpose is to defend the faulty nodes and internal attacks. For gathering the direct and indirect trust values of all the sensor nodes, Bayesian estimation is applied, and the correlation of data is done for a further selection of trustworthy nodes to forward the data packets. Simulation results state that not only it identifies and then isolate the faulty nodes but also the false positive detection rate is improved. As compared to other algorithms like AF-TNS [15] and Trust Doc [17], it has a better ability to defend against attacks [18].

The system is now safe and secure thanks to the integration of ADT. It is anticipated that integrating Equation for Scheduler-based Node Trust will enhance performance in terms of transmission overhead, a clustered method Using the scheduling technique, interdependence has been built between trusted nodes. The ability of trustworthy nodes to manage resources and memory has improved with the integration of task-scheduling mechanisms. Nodes may now manage memory and compute resources thanks to this technique. Communication is more reliable when data trust and cryptography techniques are combined. The proposed method used the intra-cluster (CM) and inter-cluster (CH) approaches to reduce the packed transmission overhead [21].

The HRFCHE through the Semi-Markov scheme is a prediction method that integrates energy and trust assessment to extend the lifetime of the network. The results of HRFCHE show that it performs better than competing cluster head election techniques because it increases the lifetime of the network and decreases energy usage by 28% and 34%, respectively [22].

A reliable method for choosing the right CH based on the use of an opportunistic parameter is the suggested MPOTFEM. The Markov chain and Preventive Maintenance (PM) idea are included in this proposed MPOTFEM scheme for determining how well the network is maintained. By reducing the frequency of CH elections, it is found that evil nodes do not become CHs. According to the simulation results, the suggested mechanism outperforms the existing ones in maintaining the average percentage of live and dead nodes in the network at 10.82% and 11.36%, respectively. The findings demonstrate that, in comparison to the widely used CH election processes, the suggested mechanism is capable of providing average improvements in PDR and Throughput of 9.14% and 10.56% [11].

This paper’s contribution is the suggestion of LEACH-TM, an energy-efficient and trust management-based hierarchical routing system. The benefits of this technique include increasing the accessibility of the network, extending the network’s life, and improving the network’s capacity to fend off threats. The number of dynamic decision cluster head nodes, based on residual energy, and the density of neighbour nodes can all be used to better limit the cluster’s size to improve energy efficiency and prevent excessive node energy consumption. The simulation findings show that the LEACH-TM outperforms LEACH-SWDN and LEACH in terms of prolonging the life of the network and regulating energy usage. According to an investigation of the amount of transmitted data packets, the addition of trust value in the Beta-based trust control framework can effectively minimize the impact of compromised nodes on the choice of cluster heads and retain security third-party routing nodes, which can significantly improve network security [23].

In this study, the authors suggested a brand-new approach for assessing trust. This model combines behavioural information as well as historical information, in addition to being able to fully utilize sensor data. According to the data trust, it can determine a node’s state. The approach has a greater anomalous detection rate compared to the assessment model (which simply considers behaviour trust). Additionally, a straightforward weighted average method is used to determine the trust value. Thus, it is lightweight enough to work effectively with WSNs without having a lot of overhead. A trust evaluation model can also dynamically build and update a trust list at the same time. The data fusion only takes into account the data from a trusted node when using the trust list, which saves on communication costs and lowers energy usage. OMNET +  + simulation results demonstrate that the trust model can increase node survival time and provide a more accurate picture of their state. Furthermore, compared to the LDTS model, the trust model has a higher rate of anomaly detection [26]. Authors anticipate that our methodology for evaluating trust will contribute to the accuracy of sensor data [24].

The authors proposed a new ribbon structure associated with C-MAC along with data aggregation and multi-hoping techniques. The energy is saved by reducing the time slots for data aggregation thereby increasing the saved energy. The proposed work can be applied to event detection also [41].

Based on reinforcement learning’s Q learning model, the authors suggested an enhanced route discovery process. This is used to enhance the reward-based learning mechanism thereby improving the QoS parameters and decreasing the delay observed while overall communication is performed in WSN [42].

The concept of trust is discussed for providing security and privacy and reliable communication in the network whether a case of a distributed network is there, or a cloud is there [43].

An EEPC protocol has been proposed by engaging enhanced PSO and sensor data fusion techniques for enhancing the network lifetime and improvement in monitoring and tracking environment techniques [44]. A novel mechanism for the distribution of credits among nodes is proposed to eliminate the selfish behaviour prevailing in the network. An agent is allotted for the management of credits based on each node’s trust value [45]. Memory and energy are two resources that are scarce in wireless sensor networks. Enhancing network longevity has drawn more and more attention in recent years. The longevity of a network is significantly influenced by node energy. However, there is growing worry over network longevity along with this astonishing growth in wireless sensor networks. This study’s main goal is to better understand how various factors can affect the choice of a cluster head. A hybrid methodology that is normally based on the node’s energy was used in this investigation. The energy of the node, the energy of the node’s neighbors, the number of hops, and the number of links to neighbors have all been used by the authors to select the cluster head. Each of these factors influences how the cluster head is chosen. They precisely noted hop size, energy of each sensor node, average energy of sensor neighbors, linkages to sensor nodes (HEEL), and other parameters. ranking nodes Power-Efficient Gathering in Sensor Information System (PEGASIS), Energy-Aware Clustering Scheme with Transmission Power Control for Sensor Networks (EACLE), Low Energy Adaptive Clustering Hierarchy (Nr-LEACH), Modified Low Energy Adaptive Clustering Hierarchy (ModLEACH), Low Energy Adaptive Clustering Hierarchy-B (LEACH-B), Low Energy Adaptive Clustering Hierarchy (LEACH), and Hybrid Energy Efficient Distributed Cluster [46, 47]. In wireless sensor networks, effective resource use is a crucial problem. Energy is one of the most vital resources, and clustering structure has a significant impact on how effectively it is used. To fully utilize the advantages of these architectures, however, efficient and appropriate cluster head (CH) elements must be chosen. It is necessary to perform additional processing in order to solve the non-deterministic polynomial-time (NP-hard) problem of choosing the right CHs and determining the best coefficients for each parameter of a pertinent fitness function in CHs election. As a result, this paper’s goal is to address the connected challenges while also suggesting effective ways to reach the main objective [51,52,53,54] (Table 3).

Table 3 Existing Trust Management Techniques

2.1 Existing trust management techniques

Some of the existing approaches are TBGRS, TCFL, STE, BNWSN, RFSN, TTSN and many others [27,28,29,30,31,32,33,34,35,36,37,38,39,40]. Some of the existing approaches in Trust Management are discussed in the above table along with their methodology, performance metrics, advantages, disadvantages, simulation tools used, purpose, and trust values as key indicators to choose the suitable model according to the need [9].

2.2 The problem statement

A network can be characterized as a collection of sensor nodes that are dispersed at random. While some sensors serve as intermediate nodes, others are designated as the transmission source. Via their participation in route setup activities, malicious sensors try to hinder network performance. It is anticipated that every sensor will take part in the routing procedure. Every sensor has a preventive record that contains misbehaviour nodes and a reliable list that stores the nodes' trustworthy values. The routing table of each node will increase the number of entries to contain the value of the reliability of other nodes. The following queries can help to summarize the issue:

  • Which are the nodes in the deployed network that can be trusted?

  • How an accurate trust threshold can be specified to differentiate between malicious nodes and trustworthy nodes?

  • How the misbehaving nodes can be detected in the network?

  • Which nodes should be considered as the next best hop in the route thereby resulting in minimizing the power consumption and maximizing the network lifetime?

As related to literature survey [12,13,14,15,16,17,18,19,20], certain key concepts are employed in the proposed technique such as distance of node from the base station, cluster creation and cluster head selection, route discovery, AODV concept, trustworthiness of route as well as node.

2.3 The proposed technique

To find out the solution for increasing the security and trust factor in the network and in return, enhancing the network lifetime, a model can be proposed.

The model in Fig. 1 states the relationship between the Service Consumer and the Service Provider. The service consumer requests the service provider by sending the Route Request for the suitable route through which the consumer can transfer the information to the destination in a reliable way. In place of this, the service provider acknowledges the service consumer by sending an acknowledgment if any reliable route is free to transfer the data at the given time. In the territory of service providers, many jobs are taking place. There is a Node List that contains N number of nodes that are bound together within a structure known as Service Layer Structure. It is so called because every exchange of information done is in the form of service that is Requests are there and they are being served to result in fruitful communication.

Fig. 1
figure 1

Trustnet: System Model for Proposed Work

The offering Consumers submit requests for data access, and the architecture of the nodes that are linked to one another through service orientation comprises the provisioning blocks. The proposed technique deploys nodes in a heterogeneous environment where each sensor node has a variety of sensing and buffer capabilities. The nodes that have the data that the user has requested are known as the source nodes. Based on the evaluated QoS parameters, the node’s trust is assessed. It is difficult to implement the trust value at the node level since each node has a zero initial trust value and participates in many route formations. Based on the reviewed algorithms from the SI list in the related work section [48,49,50], the swarm intelligence algorithm was used in the suggested study. Due to MATLAB’s resources being readily available for wireless simulations, the entire project has been simulated on it.

The workflow of the entire procedure has been discussed in Fig. 2 followed by the Algorithm 1.

Fig. 2
figure 2

Trustnet proposed workflow

Algorithm 1
figure a

Trustnet: Proposed Algorithm

As stated in Algorithm 1, the network is deployed and cluster heads selection is done on the basis of LEACH algorithm. The source node and destination node are discovered in the network. CHs for source node and destination node are found out. Then AODV is initiated for broadcasting the RREQ and RREP is awaited from all the nearby CHs. Hence, Route Discovery is performed [51]. Once routes are discovered, QoS parameters are evaluated for all the routes thereby resulting in repository. K-means is applied for distinguishing the routes as Good, Bad and Moderate. Machine Learning helps in training and classifying the data, thereby resulting in the routes and nodes respectively, having higher ranks and lower ranks [52]. The lower ranks are avoided and higher ranks are considered in order to enhance the energy efficiency and lifetime of network. Figure 3 lights up the flow of the methodology being introduced in Trustnet. It is defined in detail in further section along with the figures.

Fig. 3
figure 3

Trustnet proposed methodology

The proposed work is comprised of heterogenous nodes that are deployed in the wireless field. To design the simulation environment, data acquisition toolbox has been utilized in MATLAB development environment (Fig. 4).

Fig. 4
figure 4

Deployed network with 50 nodes and 1000/1000 area

Initially the nodes were deployed using a network length and width of 1000/1000 m whereas the size of the network is increased to check the performance of the network and to check the possible elasticity in the designed network. In the first instance, the broadcasting node sends the data to its related CH for communication. To divide the data into multiple groups based on the locations. The CH is initially selected with the maximum battery in stock. The CH gets a rotational shift when it comes to selecting the CH viz. for a certain interval of time, a node can remain CH. Once a node becomes CH, all the nodes of the specific region will be sending data via. Its cluster head only. This concept has been borrowed from Least Energy Adaptive Routing Hierarchy (LEACH). The CH broadcasts the route requirements that includes the destination information and the direction of the destination. Now the seeker CH gets reply as Route Reply(R-REP) against the request made viz. Route Request(R-REQ).

The algorithm architecture to perform each single step that has been described here is popularly known as on demand distance vector routing protocol (ODV) [53] and if it is applied to mobile network, it would be termed as Ad-hoc-ODV(AODV) [54]. The proposed work uses the ODV architecture here and computes the following parameters in terms of QoS for the further computation (Table 4).

Table 4 Discovered routes

Considering the first route, there are a total number of 6 nodes in the list. As 42nd node is the source node that is associated with CH 2. The source node transfers the packets to the concerned CH and CH2 further broadcasts the requirement to other CHs. Based on the application of the algorithm illustrated earlier in this section, the proposed work chooses CH3 and CH4. CH4 further passes the data to 5 whose response time to acknowledge the data packet expires after a certain given threshold. In such a situation the respondent chooses CH9 which contains the destination node.

The proposed work aggregates the data for 10,000 simulations so that an analysis can be performed over the aggregated data. The proposed work reselects the data after the same threshold number of simulations. All the simulation architecture is done to attain maximum lifetime in the overall network. As it has been illustrated earlier also that lifetime refers to total amount of time that a node spends in the network. Here the lifetime of a sensor node is directly proportional to the power consumption as the total remaining power will evaluate the total time of survival of the sensor node.

The proposed work uses k-means clustering algorithm [55] to divide the data into 3 possible segments, namely good routes, moderate routes and bad routes. The purpose is to create a rank of the nodes based on the learning behavior of the node under given circumstances. As k-means is not able to label the divided groups due to its supervised behavior, the proposed work uses Fuzzy logic to label the divided segments [56]. The application of k-means algorithm has been done using statistical machine learning toolbox (SML)that is supplied in MATLAB for processing and communication of statistical data. As it has been illustrated earlier that k-means algorithm has been applied over the aggregated data to divide them into three categories namely good, moderate and bad, the deployment has been done using SML toolbox of MATLAB.

The data distribution, as in Fig. 5, has been done on the base of namely Throughput, PDR and Power Consumption. The fuzzy labelling has been done with the following pseudo code with Fuzzy inference engine. The proposed work has developed a Mamdani rule set. The inference engine has two sets of inputs and one set of output.

Fig. 5
figure 5

Data distribution in three clusters based on three parameters

As shown in Fig. 6, the fuzzy engine is made up of two input parameters namely the R-MSE and SE. Each input set is bonded with Shweta Mamdani rule engine the produces the class as the output function.

Fig. 6
figure 6

Fuzzy rule engine

As shown in Fig. 7, the surface viewer is the 3d mapping of the input and the output set. The input set that is MSE and SE are mapped via several membership function values that are associated as SE and MSE. The maximum and minimum range for both MSE and SE is between 0–1 whereas the output viz. the class lies in a membership value of 0.2 for minimum and 0.8 for maximum.

Fig. 7
figure 7

Surface viewer

As has been discussed, the trust model generation involves two processes. The first part aggregates the data based on the collected routes, the proposed trust generation mechanism divides the data into three segments and labels them as “Good”, “Moderate” and “Bad”. The section aims to further use the generated class objects viz. the route records to publicize the rank of the routes followed by the rank of the nodes. The node ranking procedure will help in selecting the CH when the route discovery process will be made. The proposed work generates two step trust generation post the application of fuzzy logic. The first phase and the second phase are for the generation of trust value based on the entire route and based on the node. Phase 1 aims to rank down the routes of each category and the second phase ranks down the nodes as per their categorization in the GTs formed.

The trust is calculated only for the classified GT value from a trained architecture that is attained by Levenberg Feed Forward and Back Propagation mechanism. The proposed work has been implemented on MATLAB simulation tool that supports the propagation behaviour utilizing Neural Networks (NN) toolbox. The toolbox supports a range of training algorithms that are based on neural engines, but as Levenberg supports the forward movement and the backward movement and hence it has been considered as the algorithm to be a part of the proposed work.

As shown in Fig. 8, the training model is supplied with three input values viz. the throughput, PDR and delay. The delay is one of the major reasons in WSN for reduced lifetime. Lifetime refers to the total amount of time which a sensor node spends in a network to transfer, receive and aggregate the data packets from one end to another end. More delay will consume more power from the sensor nodes as the nodes will be consuming idle time energy. The trained Neural Network will be used to categories the node based on its classified rank. Once the network is trained, the classification score of the route will act as an activator of the dataset. The trust generation process is attained using the Dragon fly algorithm. The algorithm iteratively evaluates the fitness of different dragonflies based on their alignment and cohesion with other dragonflies in the same group, as well as their distance to a global food value. The algorithm also includes a random population generation and simulates Levy flights to explore the search space. The algorithm initializes several variables, including the number of dragonflies, a list of selected dragonflies, and a counter for the number of selected dragonflies. It then loops over each dragonfly in the dataset and performs the dragonfly optimization process. During each iteration, the current dragonfly is selected, and its group order and global food value are determined. The algorithm generates a random population of dragonflies and simulates Levy flights. The alignment and cohesion of each dragonfly in the population are calculated, and a fitness value is computed based on the dragonfly’s alignment, cohesion, and distance to the global food value. The fitness values are used to determine which dragonflies are selected for the next iteration. If the average reward of the dragonflies in the current iteration is greater than 60, the current dragonfly is added to the list of selected dragonflies. The code also prints a message indicating whether the dragonfly was accepted or rejected. Overall, this code appears to be a working implementation of the dragonfly algorithm for optimization, although its effectiveness will depend on the specifics of the problem being solved and the parameter values used. The proposed SI algorithm helps to choose most appropriate CH based on the ranking of the node defined as per the cohesion and alignment of the dragonfly algorithm.

Fig. 8
figure 8

The Levenberg training model

3 Results

In justify the research work, the section presents the evaluation of the proposed model and its performance analysis to claim its effectiveness. The simulation parameters used in the analysis are network throughput, packet delivery ratio and the observed network delay. The parameters used in the simulation analysis are listed in Table 5.

Table 5 Simulation Architecture

A comparative analysis-based evaluation is presented in the following section evaluating the proposed work for three performance measures namely, throughput, PDR and delay. To further, present a comparative analysis, the proposed “ Trustnet” scenario compared with reference to variation in the simulation rounds ranging to 100 against four existing studies such as “Improved CH selection using Q-Learning” based technique(RRM) proposed by Kaur et al. 2022, “Improved Bkd-Tree-Inspired Energy-Efficient Clustering-based Routing Protocol” (IBkd-Tree-IEFCRP) proposed by Janakiraman 2020, Fuzzy based “Ant colony optimization”(ACO) technique using hybrid protocol(FUCARH)” proposed by Arjunan and Sujatha 2018, “A multihop and data aggregation based modified media access control mechanism called co-operative MAC enhanced lifetime (C-MACEL)” proposed by Jothiprakasam and Muthial 2018 in order to obtain the significant outcomes in terms of performance parameters.

Throughput Analysis

In this analysis, the throughput has been computed for 150 nodes over different rounds of simulations such as 100. The proposed technique has been compared with other techniques such as RRM, IBkd-Tree-IEFCRP, FUCARH and C-MACEL, in order to find the optimal average throughput value.

It is observed from Table 6 that the average value of Throughput over 100 simulations for 150 nodes have been computed for techniques such as RRM, IBkd-Tree-IEFCRP, FUCARH, C-MACEL and Trustnet are 8451.6306 Mbps, 8250.0886 Mbps, 8213.467733 Mbps, 7991.8692 Mbps and 8564.634467 Mbps respectively. The obtained results showed that the proposed technique has the highest Throughput average value i.e., 8564.634467 Mbps over other techniques due to the integrated machine learning and SI strategy which enhance the performance of the QoS parameters.

Table 6 Throughput analysis at 100 simulations

In Fig. 9, the throughput improvement analysis is evaluated in order to find the best average value using 150 nodes against 100 rounds of simulations by comparing the proposed with other techniques.

Fig. 9
figure 9

Throughput improvement analysis at 100 simulations

Figure 9 represents the Throughput improvement analysis over 100 rounds of simulation. The proposed technique has shown a significant improvement in the throughput value as compared to other techniques such as RRM, IBkd-Tree-IEFCRP, FUCARH and C-MACEL. It is observed from the obtained results that the proposed technique has shown enhanced throughput with an increment in the simulation count. When 150 nodes are included for analysis, the proposed technique shown the average throughput improvement percentage value, 1.35% over RRM, 3.80% over IBkd-Tree-IEFCRP, 4.26% over FUCARH and 7.15% over C-MACEL. The obtained results showed that the proposed technique outperformed the other techniques due to the involvement of fuzzy logics which enhance the trust level of nodes.

PDR Analysis

In this analysis, the PDR has been computed for 150 nodes over different rounds of simulations such as 100. The proposed technique has been compared with other techniques in order to find the optimal average PDR value.

It is observed from Table 7 that the average value of PDR over 100 simulations for 150 nodes have been computed for techniques such as RRM, IBkd-Tree-IEFCRP, FUCARH, C-MACEL and Trustnet are 0.903066667, 0.874133333, 0.8366, 0.823866667 and 0.911 respectively. The obtained results showed that the proposed technique has the highest PDR average value i.e., 0.911 over other techniques due to the involvement of neural network with regression mechanism which improves the classification score of the routes.

Table 7 PDR analysis at 100 simulations

In Fig. 10, the PDR improvement analysis is evaluated to find the best average value using 150 nodes against 100 rounds of simulations by comparing the proposed with other techniques.

Fig. 10
figure 10

PDR improvement analysis at 100 simulations

Figure 10 represents the PDR improvement analysis of over 100 rounds of simulation. The proposed technique Trustnet has shown a significant improvement in the PDR value as compared to other techniques implemented RRM, IBkd-Tree-IEFCRP, FUCARH, C-MACEL. It is observed from the obtained results that the proposed technique has shown enhanced PDR with an increment in the simulation count. When 150 nodes are included for analysis, the proposed technique shown the average PDR improvement percentage value, 0.88% over RRM, 4.23% over IBkd-Tree-IEFCRP, 8.89% over FUCARH and 10.56% over C-MACEL. The obtained results showed that the proposed technique outperformed the other techniques due to the involvement of SI which improves the trust nodes during rank generation and increases the network lifetime.

Delay Analysis

In this analysis, the delay in seconds has been computed for 150 nodes over different rounds of simulations such as 100. The proposed technique has been compared with other techniques in order to find the minimum average delay value.

It is observed from Table 8 that the average value of delay over 100 simulations for 150 nodes have been computed for techniques implemented by Kaur et al. 2022, Janakiraman 2020, Arjunan and Sujatha 2018, Jothiprakasam and Muthial 2018 and proposed are 3.626933333 s, 3.725 s, 3.736533333 s, 3.8742 s and 3.238933333 s respectively. The obtained results showed that the proposed technique has the minimum delay average value i.e., 3.238933333 s over other techniques due to the involvement of fuzzy logics which enhance the trust level of nodes.

Table 8 Delay analysis at 100 simulations (in Seconds)

In Fig. 11, the delay improvement analysis is evaluated in order to find the least average value using 150 nodes against 100 rounds of simulations by comparing the proposed with other techniques.

Fig. 11
figure 11

Delay improvement analysis at 100 simulations

Figure 11 represents the delay improvement analysis (in seconds) over 100 rounds of simulation. The proposed technique has shown a significant improvement in the delay value as compared to other techniques implemented by Kaur et al. 2022, Janakiraman 2020, Arjunan and Sujatha 2018, Jothiprakasam and Muthial 2018. When 150 nodes are included for analysis, the proposed technique shown the average delay improvement percentage value, 10.52% over Kaur et al. 2022, 12.56% over Janakiraman 2020, 12.69% over Arjunan and Sujatha 2018 and 15.96% over Jothiprakasam and Muthial 2018. The obtained results showed that the proposed technique outperformed the other techniques due to the involvement of ANN with fuzzy logics which enhanced the trust node ranking generation.

This section presented the results obtained while designing the efficient strategy for data delivery through optimal route. The proposed model employed machine learning and swarm intelligence-based neural network approach which has been evaluated and compared with other techniques as RRM, IBkd-Tree-IEFCRP, FUCARH, C-MACEL to find the higher level of trust node during the ranking generation process to increase the overall lifetime of the network. The results are obtained using the MATLAB simulation tool in terms of different QoS parameters such as Throughput, PDR, and Delay for different rounds of simulation (100).

4 Discussion and future scope

An enhanced version of the dragonfly optimization method can be applied in this study to achieve the best area coverage and energy consumption reduction. Throughput, PDR, and delay were the three measures this paper utilized to gauge its effectiveness. The outcomes of the proposed strategy were contrasted with those of some previously reported methods. Simulations demonstrated that, in terms of the given performance parameters, the suggested strategy outperformed the other evaluated methods. In this paper, SI can be implemented for finding reputation and trust management. The Levenberg Marquardt algorithm is used for training the network.

The performance analysis of Trustnet shows number of future prospects to address the trust and security in data transmission in WSN. Some of the notable future expansion involves fusion of deep learning, animal-based meta-heuristics, and fuzzy logic heralds a promising in resolving complex network challenges. Novel algorithms with deep learning’s prowess with meta-heuristics' efficiency will be tailored to specific networking contexts, optimizing network parameters while balancing exploration and exploitation. Real-time anomaly detection using deep learning models will support security by identifying threats within traffic patterns, complemented by fuzzy logic-driven adaptive security measures.

  • An enhanced node evaluation via deep learning’s historical data processing, paired with fuzzy logic trust assignments, promises more reliable node ranking.

  • Optimized route discovery, aided by meta-heuristics, and congestion prediction through deep learning foster efficient networking. These hybrid methods also extend network lifespan by predicting energy usage patterns and preempting failures.

  • With applications transcending networking, ethical considerations for increasingly autonomous algorithms will be addressed, ensuring responsible and privacy-centric operations in domains like IoT, smart cities, healthcare, and industrial automation.

5 Conclusion

The sensor nodes transfer data based on the requirement and to prevent the unwanted waste of resources within the network proper cluster arrangement of sensor nodes with higher trust level in the network is highly recommended. Various strategies have been used in order to provide solution but the problems still not encounter optimally. Hence in order to address the real time bottleneck issues related to network lifetime, we proposed an optimal solution which improves the ranking of the nodes with higher trust level. The Trustnet technique employed the statistical machine learning and swarm intelligence strategy with dragon fly algorithm in order to address the issues related effective rank generation of nodes and improving the network lifetime. The different QoS based parameters such as throughput, PDR and delay has been used in order to evaluate the efficacy of the proposed model. This presented the results obtained while designing the efficient strategy for data delivery through optimal route. The proposed model employed machine learning and swarm intelligence-based neural network approach which has been evaluated and compared with other techniques such as RRM, IBkd-Tree-IEFCRP, FUCARH, C-MACEL in order to find the higher level of trust node during the ranking generation process to increase the overall lifetime of the network. The results are obtained using the MATLAB simulation tool in terms of different QoS parameters such as Throughput, PDR, and Delay for different rounds of simulation (100, 200, 500 and 1000). (1) For 100 simulations, the average Throughput (Mbps) values for techniques such as RRM, IBkd-Tree-IEFCRP, FUCARH, C-MACEL and Trustnet are 8451.6306 Mbps, 8250.0886 Mbps, 8213.467733 Mbps, 7991.8692 Mbps and 8564.634467 Mbps respectively. (2) For 100 simulations, the average PDR values for techniques such as RRM, IBkd-Tree-IEFCRP, FUCARH, C-MACEL and Trustnet are 0.903066667, 0.874133333, 0.8366, 0.823866667 and 0.911 respectively. (3) For 100 simulations, the average Delay(sec) values for techniques such as RRM, IBkd-Tree-IEFCRP, FUCARH, C-MACEL and Trustnet are 3.626933333 s, 3.725 s, 3.736533333 s, 3.8742 s and 3.238933333 s respectively. With the involvement of deep learning and fuzzy logic techniques that enhances the security of complex networks from threats, along with the proposed technique can open new areas for research for exploring more in life time of network.