This section introduces the energy consumption model and considers some settings for WSN and at the end of this section, discuss the proposed method.
3.2 Energy consumption model
Here we use the same power consumption model presented in [21]for network radio components. In this model, nJ / bit is the Eelec unit of energy used in the electronic circuit of the receiver or transmitter to receive or send one bit of the data packet. The unit Eamp (pJ / bit / mn) show the energy consumption in the WSN, and send one bit of the data packet between the transmitter node and the receiver node. Figure 2 shows the energy consumption model.
Figure (2): Model used for energy consumption in radio performance
Power consumption of the proposed model is processed dependent on the model, which was presented in LEACH method. In this model, for communicating a data packet with k bit volume and d distance d (among sending and receiving nodes), the measure of consumed energy in the transmitting node is estimated by the following formula [22]:
$${E}_{tx}\left(i\right)=k ({E}_{elec}+{E}_{amp}*{d}^{2})$$
2
Where Eelec refers to the power consumption of the electronic circuit. Additionally, Eamp signifies the necessary power for enhancing the sent and received signals so as to send a data bit. Besides, for achieving a data packet with k bit volume, the amount of power consumption for the receiving node is measured by the following equation:
$${E}_{rx}\left(i\right)=k* {E}_{elec}$$
3
İt should be noted that power consumption for the nodes located between data transmitting node and the node which sends data is equal to the sum of the energy required for sending data and the energy needed for receiving data :
$${E}_{cons}\left(i\right)= \sum _{i=1}^{n}\left[{E}_{tx}\left(i\right)+ {E}_{rx}\left(i\right)\right]$$
4
İt should be noted that the power consumed by any nodes in the network, including both data sending and data receiving node, can be measured by the above-mentioned formula.
3.5 The ACO algorithm is used to routing
One of the methods used to solve routing problems in WSN is the ACO algorithm. This algorithm is inspired by the behavior of ants in nature[24]. Ants do useful things such as finding the shortest path to food and sharing information with their colonial members[25]. In fact, the ant alone is a simple, unconscious being, but a set of ants can do useful things and guide humans in many applications such as navigation. The ACO algorithm has been used successfully to solve optimization problems [26]. The main purpose of the ACO algorithm is to find the path with the lowest cost in the route, and the ACO algorithm involves a large number of ants that move along the graph and find the shortest path [27]. Ants typically do not have knowledge which path is shorter, so they can only find low quality path, but global coordination among ants in a colony leads to find optimal and short paths[28]. In the real world, ants release some pheromones along the way. The decision to move ants in a path is based on the pheromone concentration in that path[29]. Ants prefer to move in a direction where the amount of pheromone is high. On the other hand, artificial ants have properties not found in natural ants. Their movement is usually consistent with their previous operations, which are stored in a special data structure. When ants move from one node to another node, they release some pheromones proportional to the path. Therefore, short and suitable paths will have a high average pheromone, and on the other hand, if the path is weak, the amount of pheromone along the path will be low. In fact, the amount of pheromone remaining in the pathway is proportional to the pathway's quality. In this way, the ants find the shortest paths in a graph. Suppose there are four ants and two paths (path R1 and path R2) that lead to a food, so that path R1 is larger than path R2 (R1˃ R2). There are also 6 nodes in the paths, which, as shown in the figure: Fo, N4, N3, N2, N1, Ne
At first, the four ants A1, A2, A3, A4 are in the initial choice area in Ne, and they should choose among way R1 and way R2 to arrive at food on F0.
The steps are as follows:
-
In the initial node ”Ne” all the ants are unaware of the positon of the food “f0”, so they accidentally choose one between paths R1 and R2. Suppose ants A1, A2 choose path R1 and ants A3, A4 choose path R2.
-
A1, A2 pass through R1 and A3, A4 through R2, they leave a specific measure of pheromone in their way. In view of parameters, for example, the number of nodes that have been passed and the amount of path traffic, etc., the pheromone that must be placed is determined by updating the τRx parameter.
-
Since according to the Fig. 3 (R1˃ R2), A3 and A4 attain F0 before A1, A2.
When A3 and A4 follow the path R2 to reach F0, it passes through two nodes and sets the value of τR2 to 2, but A1, A2 have not yet reached F0 and τR1 = 1. Therefore, to get back to Ne from F0, A3 and A4 again need to choose between R1 and R2 to return. In A3 and A4 the pheromone is τR, and they find that (τR2 > τR1), therefore, they choose the R2 route with a higher probability. Because the pheromone concentration is higher in the R2 pathway, and it is best solution to selected this pathway. If an ant at some point has to choose between two paths in which a pheromone has not yet been placed. It selects one path at random and with equal probability, and when the pheromone is greater than one path, that path will be more likely to be chosen.
3.7 Proposed method
The k-means clustering algorithm divides the data set into k subset clusters so that each subsets components have the closest distance to the center of that subset. K-means (input sample) randomly selected as the centers of the clusters. (Input samples) selects the appropriate clusters based on the minimum Euclidean distance from the centers of the designated clusters. The average of each cluster is then calculated and considered as the new center of the clusters. This operation is repeated until the centers of the clusters do not change. The criteria that should be minimized in K-means algorithm:
E k−means = \(\frac{1}{C} \sum _{k=1}^{C}\sum _{xϵ Q}\left| \right|x-{c}_{k }\left|\right|\) (5)
In the above relation, C is the number of clusters, Q is the cluster and \({c}_{k }\) is the center of the cluster.
In this simulation, the number of clusters is constant. There are several significant parameters in the selection of clusters in the formed clusters. There are three criteria for choosing a sparkler:
-
CH sensor should have a high-energy level; Because the CH has higher overhead than other nodes, the node must be selected as the CH with enough energy; otherwise, the node will be disconnected from the base station due to the death of the node.
-
The CH sensor closest to the base station; the less energy it needs to send data packets.
-
The CH sensor closest to the center of the area; In fact, it is a sensor that the average distance between other nodes is minimal.
-
In fact, the centrality of the CH reduces the energy consumption for communication within the other nodes.
Data transfer stage
After the CH is selected, it is time to transfer the data. In this case, we have a series of inter-cluster and intra-cluster communications. In sending data, the normal node sends the data to the CH, and then the data is placed in the best path and sent to the sink station. This section uses the pheromone and the possible path selection function. To perform this step, we defined several messages, which are as follows.
Hello packets or routing packets are sent periodically as well as at the first start of the algorithm to all neighbors, so that the neighbors are known. When neighbors receive these packets, they will confirm their response with the packets. During the message sequence, these bandwidths as well as the path pheromone are updated.
When we have a path to send data, the path request packet or the ants ahead will be created to identify the paths. In all identified paths, nodes are seen along the way, as well as the number of steps to reach the destination, latency, energy stored in an array by routing ants.
As soon as the route request message arrives at the destination, the route request becomes the route response to ant packet. The path requested by the ant packets will be reversed, the stack node will be emptied and the path parameters will be updated.
When a node concludes that it is not reaching the destination. The wrong path message is sent and, defining such a massage will reduce the loss rate of packets.
The probability of selecting the path from the source node i to the destination d is calculated according to the following formula, given that node j is adjacent to the node i:
Pijd = \(\frac{\left({{\tau }}_{ijd}{)}^{{\alpha }}\right({\text{D}}_{ijd}{)}^{\text{ß}}\left({\text{ŋ}}_{ijd}{)}^{\text{ß}}\right({BP}_{ijd}{)}^{\mathcal{s}\mathcal{ }}({E}_{ijd}{)}^{\text{k} }}{\sum i ϵ{N}_{i} \left({{\tau }}_{ijd}{)}^{{\alpha }}\right({\text{D}}_{ijd}{)}^{\text{ß}} \left({\text{ŋ}}_{ijd}{)}^{\text{Ŷ}} \right({BP}_{ijd}{)}^{\mathcal{s}\mathcal{ }}({E}_{ijd}{)}^{\text{k} }}\) (6)
𝝰, ß, k, Ŷ, τ are weight regulators, which we consider here are related to energy, bandwidth, latency, number of steps and pheromones. We considered the number of steps as a heuristic function; also, Dijd shows bandwidth and EIJD as the energy parameter.
Initial pheromones are zero because no neighbors are known, and when they are known together, the initial pheromone changes slightly. When node j is known as neighbor i, this value changes to 0.1. When the path message is sent from node i to j the τij changed to the 0.1, This means that there is a path to destination (d) using the link (I, j), so the pheromone of this path must be updated. We have updated this pheromone based on the following relation.
τij = τij + Δ τij (7)
In the above relation we considered the amount of pheromone to be constant, although I can consider this relation as a function based on delay or bandwidth. In the above relation, we considered the amount of pheromone changes to be 0.5.
0.5 = Δ τij (8)
The idea of using a pheromone is based on path if a data transfer is appropriate, it will be used over time. On the other hand, we need a parameter that if a communication path is lost or a node is deleted, or data is not transmitted to the desired neighbor, the path is no longer amplified not to be selected in subsequent communications. That is why the pheromone evaporation factor is used here. This factor is called ρ. We include this value in τij as follows.
$${\tau }\text{i}\text{j}= \left\{\begin{array}{c} \left(1-p\right)\tau ij if \left(1-p\right) \tau ij>0.1\\ 0 if \left(1-p\right) \tau ij<1\\ 0.1 otherwise\end{array}\right.$$
9
According to the above formula, when node i loses the connection with node j, the pheromone of that link will be zero.
Ants move from S to D. This move is due to the neighbors who are known by the message of greetings. When the ants move to the destination, they store path information such as latency, number of steps, available capacity of each link. When the route request packets reaches to destination, the route response packets is created, and these packets follow exactly the same path as the requested packets. Therefore, each node can get the best chance of reaching the destination.
When data is transmitted, the path with the most amplification value and the greater probability of selection is considered the best path. In addition, when a route is always chosen to send, we will have the problem of delay. Nodes may lose energy due to the selection of fixed nodes to send data. In this method, because this parameter is considered in the probability function, the selection of this path is automatically reduced in the next steps and other paths are replaced.
In this step, the productivity is calculated by the weighting method for the routes. If one node is not connected to another node, it gets a value of zero. Otherwise, it contains a number that shows the percentage of productivity of that link. If N nodes exist in the network, the route from source to destination is obtained so that congestion is controlled.
A congestion matrix is formed whose dimensions are equal to "one". In the congestion matrix, the number of passes per link is placed. The array, which contains the largest number in this matrix, this link has the highest number of transfer in path.
In this step, the obtained link is checked. Is the link weight more than 70%. If the weight of this link is more than 70%, it will be included in the congestion list. Otherwise the link is ideal. In the formula 5 Xij means selecting the link i to j. if this link is selected the Xij =1 and if this link is not selected Xij =0. In the event that Xij is not selected the node I to j is not has link. The congestion parameter is called Cij. These parameters show the input data to the link capacity. The purpose of this problem is to find the best path called Z.
Minimize Z = \(\sum _{i=1}^{n}\sum _{j=1}^{n}{C}_{ij }{X}_{ij}\) (10)
Subject to :
\({X}_{ij}\) = 0 or 1 ( I = 1,2,…, n ; j = 1,2,…,n) (11)
In this method, the route is checked according to the efficiency of the route and the data reaching the CH. also, all nodes send their own data to the CH.
Each source node has a Tabu list. For routes that have passed through the congestion link, one of them is accidentally left out. That is, the banned list of the desired source node does not change. But for other routes, the congestion link is on the banned list. This means that it can not send data from this link.
After discovering the congestion route, the same nodes are routed again.