Energy-Efficient Routing Algorithms Based on OVSF Code and Priority in Clustered Wireless Sensor Networks

. Energy awareness is a vital design issue in wireless sensor networks. Since the amount of sensing data may be large and sensor nodes are usually battery-powered, it is critical to design energy-efficient routing algorithms to prolong network lifetime. Given a certain sensor deployment, the routing strategy of sensor data would have profound effects on the communication cost. In this paper, based on low-energy adaptive clustering hierarchy (LEACH) series protocols which are low-energy consumption adaptive clustering routing protocols, we propose the OVSF mechanism based routing protocol and EERPP (Energy-Efficient Routing Protocol based on Priority). Simulation results of OVSF mechanism based protocol and EERPP demonstrate a significant improvement on the network metrics such as the lifetime and the end-to-end delay.


Introduction
Wireless sensor network (WSN) in which sensor nodes, sink, and management node are deployed, is a new kind of data-centric wireless network. It has been the focus of a lot of recent research and development. As widely used in military, biology, transportation, environmental science, health monitoring and space exploration, and so forth, it has been recognized as one of the most important technologies in the 21st century [1].
The primary purpose of a wireless sensor network is to sense the environment and collect or relay the collected information. Many routing, power management, and data dissemination protocols have been specifically designed for WSNs where energy awareness is an essential design issue [2,3].
To prolong the lifetime of wireless sensor network, innovative techniques that improve energy efficiency are highly required. The above constraints combined with a typical deployment of a large number of sensor nodes pose many challenges to the design and management of WSNs and necessitate energy awareness at all layers of the networking protocol stack. At the network layer, it is highly desirable to find solutions for energy-efficient route discovery and relaying of data from the sensor nodes to a sink or basestation (BS) so that the lifetime of the network is maximized.
Routing in WSNs is very challenging due to its inherent characteristics that distinguish them from contemporary communication and wireless ad hoc networks. First, it is not possible to generate a global addressing scheme for the deployment of sensor nodes. Therefore, classical IP-based protocols cannot be directly applied to sensor networks. Second, in contrast to typical communication networks almost all applications of sensor networks require the transmission of sensed data from multiple sources to a particular sink. Third, the generated data traffic has significant redundancy since multiple sensors may generate same data within the vicinity of an event. Such redundancy needs to be well handled 2 International Journal of Distributed Sensor Networks by the routing protocols to improve energy and bandwidth utilization. Fourth, sensor nodes are constrained in terms of transmission power, energy, processing capacity, and storage. Thus, they require careful resource management.
Due to such differences, many new algorithms have been proposed for the routing problem in WSNs [4,[6][7][8][9][10][11][12][13][14][15][16][17]. One of the famous hierarchical network routing protocols is lowenergy adaptive clustering hierarchy (LEACH), which has been widely utilized for its energy efficiency and simplicity [18]. In the clustering environment, sensing data gathered by the nodes is transmitted to BS through cluster heads (CHs). As the nodes will communicate data over shorter distances in such an environment, the energy spent in the network is likely to be substantially lower compared to when every sensor communicates directly to BS. To this end, various clustering algorithms have been proposed in different context. Most algorithms aim at generating the minimum number of clusters and minimum transmission distance. These algorithms also distinguish themselves by how the CHs are elected. The LEACH algorithm and its related extension [19] are based on continuous cycle of cluster reconstruction which can be described using "round" concept. Each cycle is divided into two stages: cluster building stage and the stability of the data transmission stage. The protocol is by means of selecting new CH to balance the energy of the nodes to improve the wireless sensor network lifetime. At the same time, to realize the irrelevant data transmission among nodes, it uses the TDMA (Time Division Multiple Address) mechanism [20]. To some extent, it improves the performance of wireless sensor network. However, the TDMA mechanism incises a transmission time frame into several slots which request the routing protocol to do time synchronization on the total system. It has higher delay and not very efficient if we put forward higher requirements on the energy utilization. Moreover, in TDMA based mechanism, the node always transmits the data in its time slot but ignores its own requirement, which may cause unnecessary energy consumption, while OVSF based mechanism solves this problem by checking the nodes' own requirement, for example, whether the nodes have sensed interesting information or not.
In this paper, we propose (1) an improved protocol based on LEACH series protocols which we select instead of the TDMA mechanism, and (2) a new transmission algorithm which is EERPP (Energy-Efficient Routing Protocol based on Priority) for each CH to transmit their own cluster members data or relay the data.
The remainder of the paper is organized as follows. Section 2 presents related work. Section 3 explains the improved mechanism based on OVSF code. Section 4 describes the proposed new transmission algorithm EERPP. In Section 5, we evaluate the performance of improved protocol by simulation. Section 6 concludes the paper.

Related Work
Many researchers have devoted themselves to the optimal routing protocol in WSNs. The proposed routing protocol can be divided into two categories: one is the plain routing protocol, such as direct diffusion (DD) [21] and security protocol for sensor networks, and the other is the clustering routing protocol, such as low-energy adaptive clustering hierarchy (LEACH). In this paper, we focus on the clustering routing category.
To address the issue of limited communication bandwidth and energy in WSN, Heinzelman et al. firstly propose a low-energy adaptive clustering hierarchy (LEACH) application-specific protocol [18]. It improves system lifetime compared with general-purpose multihop approaches. Recently, a variety routing protocols have been proposed which were improvement version of LEACH protocol. Younis et al. [22] propose REED (Robust Energy-Efficient-Distributed clustering) for clustering sensors deployed in hostile environments in an interleaved manner with low complexity. REED is a self-organized clustering method which constructs independent sets of CH overlays on the top of the physical network to achieve fault tolerance. Each sensor must reach at least one CH from each overlay. Attea and Khalil proposed a new evolutionary based routing protocol for clustered heterogeneous WSNs [23]. The aim was to alleviate the undesirable behavior of the Evolutionary Algorithms (EAs) when dealing with clustered routing problem in WSN by formulating a new fitness function that incorporates two clustering aspects, namely, cohesion and separation error. Cheng et al. proposed NHRPA, a novel hierarchical routing protocol algorithm for WSNs in [24]. The proposed routing protocol adopts routing technology for the nodes based on the distance of nodes to the base station, density of nodes distribution, and residual energy of nodes. The evaluation results show that the proposed routing protocol algorithm is more efficient for wireless sensor networks in terms of the energy usage, packet latency, and security in the presence of node compromise attacks. Jiang et al. present a QoS-guaranteed coverage precedence routing algorithm in [25] to accommodate both energy-balance and coverage-preservation for sensor nodes in WSNs. The energy consumption for radio transmissions and the residual energy over the network are taken into account when the proposed protocol determines an energy-efficient route for a packet. The proposed protocol is able to increase the duration of the on-duty network and provide extra service time with full sensing coverage compared with LEACH and the LEACH-Coverage-U protocols, respectively. Sun and Gu [26] propose an energy-efficient clustering scheme based on LEACH (lowenergy adaptive clustering hierarchy), that is, LEACH-Energy Distance (LEACH-ED). In LEACH-ED, CHs are selected by a probability based on the ratio between residual energy of node and the total current energy of all of the sensor nodes in the network. LEACH-ED is a kind of self-organized protocol based on LEACH. Almost all these improvements based on LEACH are to research a better clustering method to improve the performance of WSNs. However, the TDMA (Time Division Multiple Access) mechanism used or assumed in these protocols may cause long end-to-end delay and consequently high energy consumption because nodes have to send data to the sink at its own distribution time slot. To address this issue, we propose an improved routing protocol based on OVSF code transmission instead of TDMA. Compared with TDMA based protocol, the proposed OVSF based routing protocol greatly reduces time delay and improves the network energy utilization efficiency. Moreover, it also facilitates sensor nodes localization. As we know, LEACH is based on "round" and there are two stages in each "round. " If we only consider the CH selection methods and ignore other aspects, it is not efficient on the performance improvement of WSNs. Thus we propose a new OVSF code based protocol to replace TDMA which greatly improves the utilization ratio of energy and the delay of WSNs. We do not focus on the clustering mechanism but the data transmission mechanism.

Improved Mechanism Based on OVSF
3.1. The Principle and Mathematical Theory of OVSF. OVSF (orthogonal variable spreading factor) which is firstly proposed in 1997 by Adachi is a variable spread spectrum factors based on orthogonal code [27][28][29][30][31][32]. Taking advantage of its orthogonal and inherence, it perfectly complete the data transmission in wireless communication.
The mathematical theory of OVSF is as follows. Set { ( )} where = 1, . . . , is a collection of orthogonal spread spectrum code which has length . If the orthogonal ( ) is regarded as a row vector with length , the row vector forms an * matrix which can be recursively generated according to the following formula by . . . ] .
The orthogonal code of variable length also can be formed with the structure of recursive tree. The spanning tree is shown in Figure 1.
The proposed mechanism based on OVSF code realizes the optimal transmission by selecting better code when the number of cluster members is smaller than the vector length. At the beginning of the data transmission, the mechanism selects an optimal as the layer of OVSF code spanning tree. The selection algorithm is shown in Figure 2.

The Process of Data Transmission Based on OVSF.
The proposed OVSF based mechanism follows the process below: (1) the CH sends the OVSF matrix to its cluster members; (2) the nodes add a group of OVSF code in front of the data; (3) at the CH, we use the same OVSF matrix multiplied by the received data. Transmission process and decoding principle are shown in Figure 3. For the OVSF code distribution mechanism, we select the DCA (Dynamic Code Allocation Scheme). As the name suggests, the allocated codes are dynamic in nature in the sense that a particular session may start transmitting with a particular OVSF code and end its session with a different code. The decision algorithm is shown in Figure 4. Through the DCA algorithm, while ensuring efficient use of the code resource the delay can be reduced and the throughput of WSNs can be improved. The proposed OVSF mechanism outperforms TDMA on the delay, energy consumption, and throughput.
As Figure 3 shows, the data flow ( ) is transmitted by multiplying its distributed OVSF code and when the data flow arrives at the CH they are multiplied by the same OVSF matrix . The CH identifies the data of its member through the OVSF code which is distributed at the stage of cluster building. As each OVSF code multiplies the matrix whose rows are orthogonal to each other, we can decode the signals using (2) which shows the decoding principle: The data transmission process can be represented by where is the serial number of the distribution of OVSF code and is the row number of the matrix which is multiplied by the data flows at the CH. The orthogonality and incoherence of each node has been utilized not only for indiscriminate data transmission, but also for reducing the delay and improving the energy consumption rate compared with the TDMA.

The Energy-Efficient Routing Protocol
Based on Priority (EERPP) 4.1. The Model of EERPP. As mentioned above, during the stability of the data transmission stage, the CHs collect the sensing data of cluster members and transmit or relay messages to the sink. In this mechanism, the duty of CHs is to transmit the data of their own cluster members or act as a relay. When the CH acts as a relay, it transmits the data all the time until the sink receives the sensing data. Considering the possible high energy consumption due to the repetitive transmissions, it is obvious that this mechanism is not efficient enough and there is some space to improve. To solve the above inefficient mechanism, we propose the EERPP for CH to transmit or relay the data. With the EERPP, each CH is given a transmission priority according to the distance to the sink. In other words, the CH which is closer to the sink would have higher priority to send the data to sink and the other CHs would go to sleep stage to avoid the repetitive data transmission. The proposed EERPP is a transmission mechanism based on priority for better energy balance.
Firstly, we define a region to assign the transmission priority. According to the distance to the sink, we define the topology of WSNs to regions through (4). The illustration of the region division and transmission priority is shown in Figure 5, where the value of stands for the priority. As shown above, the topology of the wireless sensor network is divided into ( ≥ 1) areas. Then we assign the priority for every CH to send its own data or relay others' data. Under the EERPP, 1 has the highest priority to send data to sink than all the other CHs. To sum up, the CH has higher transmission priority when is lower than other CHs' priority. The value of each CH's index is computed in International Journal of Distributed Sensor Networks

The Algorithm of EERPP.
The algorithm is divided into two stages. Firstly, we compute the value of region where is the distance from CH to sink and sensor is the sensor's detection distance. We calculate the number of region according to the sensor's sensing distance ( sensor ). To reduce the data replication, we select the sensor as the distance of one hop. As the result, the algorithm could guarantee the successful data transmission and reduce unnecessary energy cost.
Then we calculate the index of CH in (5) where is the weight value which affects the transmission priority so as to affect the performance of WSN. The reason of introducing is that the multipath fading is considered when the WSN is built in certain severe environment. At different working environment, we can adjust the value of to get the optimal energy consumption rate.
The procedure of the proposed algorithm for efficient data transmission from the CH to the sink is as follows.
Step 3: receive the members' data or other clusters' data.
Step 4: go to the transmission mechanism While the data is from its own members, transmit to next CH whose is +1 .
While the data is not from its own members, go to relay mechanism.
If ( == 1) transmits data to sink, else the ++ transmits data to next CH.
When the CHs are not at the stage of transmission, they would be turned into sleep to save energy. Through this priority based transmission mechanism it would prolong the lifetime of WSNs.

Simulation
In this paper, we select NS-2.34 based on Ubuntu as the simulation platform to evaluate the OVSF and priority based transmission mechanisms that we proposed. Details of the simulation environment are given in Table 1.  Figure 6: The delay of network [4,5].
Firstly, we compare the network delay and energy consumption between the TDMA and OVSF mechanism. In the simulation, we use the number of alive-nodes to represent the energy consumption. We stipulate that the protocol in which there are more alive-nodes has lower energy consumption in the network. This paper is an extension of our previously published papers [4,5] in which the relational results are shown in Figures 6 and 7 with initial random deployment of nodes in every time execution. It is clear that the OVSF mechanism outperforms TDMA mechanism which is applied in LEACH and its related extensions in terms of network lifetime and end-to-end delay.
Secondly, we apply the EERPP algorithm and compare the performance with the OVSF mechanism when we set = 1. The simulation result is shown in Figure 8. As we explained before, the protocol which has more remaining nodes has lower energy consumption, so EERPP outperforms OVSF based mechanism on energy consumption; furthermore, it outperforms LEACH series protocols.
Finally, we simulate the performance of EERPP while the value of is different from 0 to 1. The simulation result is   shown in Figure 9. The performance shows the best when is around 0.8.
To prove that the improved routing protocol has scalability, we reset the simulation parameters and simulate the remaining number of nodes. We set the simulation area as 200 * 200 (m 2 ) and the number of nodes is configured to 200. At the same time, we adjust the simulation time to 1000 (s). The value of is set to 0.8. The simulation result is shown in Figure 10 and shows similar characteristics with 100 * 100 (m 2 ) area which proves on some aspect the scalability of the proposed algorithms.
As shown above, the OVSF mechanism is better than the LEACH and its extensions which use TDMA mechanism in terms of the delay and energy consumption. The proposed  new CH transmission algorithm which is EERPP, the remaining number of nodes is higher than the OVSF mechanism while it is certainly higher than the TDMA mechanism. At the same time, we simulate the proposed mechanisms in the deployment area with different size to prove that the improved routing protocol based on OVSF and EERPP has scalability when evaluating the energy consumption rate. We also simulate with different values of to see how the weight values affect the energy consumption of nodes. Based on the above results, we can conclude that the improved protocol based on OVSF code and EERPP has significant advantages on the delay and energy consumption over LEACH series routing protocols.
International Journal of Distributed Sensor Networks 7

Conclusion
In this paper, we propose an improved protocol based on OVSF code and an Energy-Efficient Routing Protocol based on Priority (EERPP) in a cluster based sensor networks. From the simulation results, we can conclude that the OVSF code mechanism has advantages compared with the LEACH series protocols utilizing TDMA mechanism in terms of both network delay and lifetime, while the proposed EERPP is better than LEACH and OVSF based mechanism in terms of energy consumption. At the same time, we can also decide an optimal value of which is near 0.8 to improve the performance to adapt to different environment where WSNs are deployed.