International Journal of Computer Applications (0975 – 8887) Volume 177 – No.1, November 2017 Implementation of Modified in Wireless Sensor Networks

M. Malleswari B. Ananda Krishna N. Madhuri M. Kalpana Chowdary B.Tech. IV year Professor, ECE, Assistant Professor Assistant Professor Department of ECE Chalapathi Institute of Department of ECE Department of ECE Chalapathi Institute of Engineering & Chalapathi Institute of Chalapathi Institute of Engineering & Technology, Guntur, AP, Engineering & Engineering & Technology, Guntur, AP, India Technology, Guntur, AP Technology, Guntur, AP, India India India

ABSTRACT power efficient, different solutions have been proposed by WSNs are composed of many autonomous devices using many authors and some of them are listed below. sensors that are capable of interacting, processing information, and communicating wirelessly with their  & decompression algorithms. neighbors. Though there are many constraints in design of  Minimization of control packets by reducing link WSNs, the main limitation is the energy consumption. For failures, results low power consumption. most applications, the WSN is inaccessible or it is unfeasible  Specially designed power control techniques to replace the batteries of the sensor nodes makes the network  By modifying encryption & decryption algorithms power inefficient. Because of this, the lifetime of the network which has maximum operational time is also reduces. To Among many techniques/proposals, the authors make the network power efficient, different power Ruxanayasmin, et al, proposed LZW compression technique saving/reduction algorithms are proposed by different authors. to minimize the power consumption [1]. Lempel-Ziv-Welch Some of the authors have achieved the low power (LZW) compression algorithm is fast, simple to apply and consumption by modifying like encryption & decryption works best for files containing lots of repetitive data. LZW algorithms, Routing algorithms, Energy Efficient Algorithms, algorithm is efficient because the output resembles numerical Compression and decompression algorithms, minimizing data and also it doesn’t need to pass the string table to the control packets, and many other different power reduction decompression code. Due to compression, the number of bits algorithms. Among many algorithms, we have chosen data can be reduced to maximum extend so that the need of compression techniques aiming different targets like memory, memory and bandwidth are very less. Also, the compressed power & bandwidth reduction. To achieve our objectives, we text resembles a scramble message and an attacker in middle have worked on Huffman coding - compression algorithm and cannot able to understand. Therefore, the data compression updated the algorithm by including one’s complement, XOR not only reduces the size of the original text, but also gives operations and finally named as Modified Huffman Coding. data security. The performance of the proposed model is analyzed and it is Section-II describes the related work on power consumption observed that, information is maximum compressed which techniques proposed by different authors and description of consumes less computational power, thereby increasing the the Huffman Coding in Section-III. Section IV describes the battery life. Problem statement and Overview of proposed algorithm.

Implementation and simulation results are observed in Keywords section-V and section-VI concludes the work with future WSN, Power Consumption, Security, Huffman Compression, enhancement. Decompression. 2. RELATED WORK 1. INTRODUCTION The authors Shahina Sheikh, Ms. Hemlata Dakhore proposed A sensor network is an infrastructure comprised of sensing Data Compression Techniques for Wireless Sensor Networks. (measuring), computing and communication elements that They proposed modified Huffman Coding for Wireless Sensor gives an administrator the ability to instrument, observe and Networks which does not require the statistics of the sensed react to events and phenomena in a specified environment. data and it encodes the difference of the current and the The administrator typically is a civil, governmental, previous value of the sensed data. By this algorithm, a good commercial or industrial entity. Sensors are typically compression ratio for both highly correlated and medially deployed in a high-density manner and in large quantities. correlated sensor node data is achieved [2]. WSNs typically transmit information to collecting (monitoring) stations that aggregate some or all of the The authors Karl Skretting, et al, proposed Improved Huffman information. WSNs have unique characteristics, such as, Coding Using Recursive Splitting. The proposed scheme takes power constraints and limited battery life, redundant data an advantage of some dependencies in the symbol sequence acquisition, low duty cycle, security and many-to-one flows. and exploits this in the Huffman coding procedure. They In some cases it is challenging to collect data from WSNs splitted the original symbol sequence into two sequences in because of irregular connectivity due to a low-battery status. such a way that the symbol statistics are, hopefully, different Low power consumption is a key factor in ensuring long for the two sequences. Individual Huffman coding for each of operating horizons for non-power-fed systems. To make WSN these sequences will reduce the average . This split is

14 International Journal of Computer Applications (0975 – 8887) Volume 177 – No.1, November 2017 done recursively for each sub-sequence until the cost symbols with less frequency. Here the symbols M associated with the split is larger than the gain [3]. and N have frequency 10 and 10, so combine those two frequencies. The authors Swati C.Pakhale, et al, proposed Data Compression Technique Using Huffman Code for Wireless Sensor Network. The objective of their proposed work is to minimize the total number of bits required to be transmitted from the sensor node to reduce the energy consumed by the sensor node. The proposed algorithm does not require the statistics of the sensed data though however encodes the difference of the current and the previous value of the sensed data [4]. The authors Chetna Bharat Mudgule, et al, surveyed different compression techniques in Wireless Sensor Network. In their analysis, Predictive coding is very helpful in reducing the data communication but needs to have a knowledge of statistics of data and thus in case of dynamic environment it can be highly • M and N have already been used, and the new node expensive and complex. Distributed Source Coding (DSC) is placed above them (named as M+N) has value 20. techniques provides high compression ratios but again it • The smallest values are L, M+N, and O, all of requires the correlation knowledge of data, it is quite which have value 20. expensive in that terms [5]. • Connect any two of these frequencies.

The authors Peng Jiang and Sheng-Qiang Li, proposed Data Compression Algorithm for Wireless Sensor Networks Based on an Optimal Order Estimation Model and Distributed Coding. They proposed a data compression algorithm for wireless sensor networks based on optimal order estimation and distributed coding. Sinks can obtain correlation parameters based on optimal order estimation by exploring time and space redundancy included in data which is obtained by sensors. Then the sink restores all data based on time and space correlation parameters and only a little necessary data needs to be transmitted by nodes. Because of the decrease of redundancy, the average energy cost per node is reduced and • The smallest value is O, while K and L+M+N all the life of the wireless sensor network is obviously be have value 40 extended as a result [6]. • Connect the symbol O to either of the others. Among different compression techniques, here we have • Connect the final two nodes modified existing Huffman Coding to increase its efficiency and also to obtain data security. 3. DESCRIPTION OF HUFFMAN CODING The concept of Huffman Coding is obtained from binary trees which are used for data compression. Huffman Coding is a statistical data compression technique used for standard text documents. The algorithm gives the reduction in the average code length used to represent the symbols of an alphabet. It produces variable length codes that are an integral length of bits and it is a method for the construction of Minimum- Redundancy Codes [7]. The Huffman coding comes under • Assign 0 to left branches, 1 to right branches Source coding in which less number of bits are assigned for • Each encoding is a path from the root the characters with highest probability of occurrence and vice- versa. This is also known as variable length coding. The important property is that coding is constructed in such a way that no two constructed codes are prefixes of each other and it is much helpful in deciphering the code. The algorithm is explained with an example.

• Assume five different symbols with relative frequencies are: – K: 40 – L: 20 – M: 10 – N: 10 – O: 20 • The bits assigned for the given symbols are • The Huffman tree is constructed by considering the • K = 0

15 International Journal of Computer Applications (0975 – 8887) Volume 177 – No.1, November 2017

L = 100 M = 1010 N = 1011 O = 11 At Transmitter • Each path terminates at a leaf. Step1: Let the original text : ABCD 4. PROBLEM STATEMENT AND OVERVIEW OF PROPOSED Step2: Binary Conversion of Original text – ALGORITHM 1000001100001010000111000100. In this example each character is assigned with 7 bits. The main objective of this work is to implement a novel Total 28 bits. scheme to eliminate the redundant hardware as well as the redundant transformed data which reduces system complexity, Step3: One’s Complement of step 2 – memory, bandwidth and power. Also, a secure 0111110 0111101 0111100 0111011 communication among nodes is necessary to allow the integrity of the delivered packets. To achieve this, we Step4: Rotate 14 bits to right – proposed a novel technique which is simple and easy to 0111100 0111011 0111110 0111101 implement is shown in the Fig.1.

Step5: binary to decimal conversion: 60 59 62 61

Step6: Output of Huffman Coder: 00101100011000100011. The output sequence of Huffman Coder is transmitted.

At Receiver

Step1: Let the received data is 00101100011000100011

Step2: The received data is decompressed using Huffman Decompression 0111100 0111011 0111110 0111101

Step3: Rotate 14 bits to left 0111110 01111010111100 0111011

Step4: One’s Complement of Step3: 1000001100001010000111000100 Step5: Binary to String Conversion: ABCD Figure 1: Flow Chart of Proposed Algorithm The proposed work is the combination of one's complement, rotations and Huffman Coding algorithm, named as Modified Huffman Coding Algorithm. In the first stage, the incoming bit stream is divided into packets of size 128 bits each, and 5. IMPLEMENTATION AND performs one’s complement on the bits. The one’s complemented data is shifted 64 bits right and compressed SIMULATION RESULTS using Huffman Coding algorithm and transmitted. At receiver, The proposed work is implemented in Glomosim (Global the reverse operation is performed to get back the original Mobile Information System Simulation) and the performance data. By implementing this algorithm, is evaluated. It is a scalable simulation environment for large  The information can protect from attackers. wireless network systems are uses a parallel discrete event simulation capability provided by C-based Parallel Simulation  The transmission bandwidth and memory Environment for Complex System (PARSEC). The proposed requirement can minimize. method was simulated analyzed shown in table 1.  Transmitting less number of bits consumes less

power

The proposed algorithm is explained with a simple example.

Consider the text “ABCD”.

16 International Journal of Computer Applications (0975 – 8887) Volume 177 – No.1, November 2017

Figure 3: PSD of Original Data and Compressed data Table 1: Analysis of Existing & Proposed Model The figures 2 & 3 show the Power Spectral Density of the incoming data and compressed data. It is clear that the power required for the compressed data is less than the original message. Thus by implementation of our proposed work, it is observed that the delay and power consumption is reduced, there by requirement of Bandwidth reduces.

6. CONCLUSION AND FUTURE WORK In this paper, Modified Huffman Coding which is an efficient algorithm for compression with data security implemented successfully. Using this compression technique, any text or document file can be compressed more than 50% of its original size without any loss of data and the performance of the algorithm is analyzed before and after compression. In this, we have considered the data compression to improve the From the table 1, it is observed that the efficiency of existing battery life by transmitting compressed data to consume low and modified Huffman Coding is almost same. Huffman power. In future, other attributes in this limited battery life can Coding has good efficiency if the incoming text is large. The be addressed, so that the Quality of service in Wireless Sensor execution time of modified Huffman coding is little bit high Networks can be improved. In the future, the other and this is due to one’s complement and rotations. The main compression techniques are needed to implement and advantage of proposed work is reduction of battery compare their performance. consumption, thereby increasing battery life along with information security. 7. REFERENCES [1] B.Ruxanayasmin, B.Ananda Krishna and T.Subhashini, “Implementation of Data Compression Techniques in Mobile Ad hoc Networks”, International Journal of Computer Applications, Volume 80, No. 08, Oct.2013. [2] Shahina Sheikh, Ms. Hemlata Dakhore, "Data Compression Techniques for Wireless Sensor Network",International Journal of Computer Science and Information Technologies, Vol. 6 (1) , 2015, 818- 821 [3] Karl Skretting, John Hakon Husøy and Sven Ole Aase, "Improved Huffman Coding Using Recursive Spitting", Article · January 1999 . Karl Skretting. 1st Karl Skretting. 18.81 · University of Stavanger (UiS). [4] Swati C.Pakhale, et al, "Data Compression Technique Using Huffman Code for Wireless Sensor Network", Figure 2: PSD of Original Data and Compressed data International Journal Engineering Sciences & Research Technology,4(3): March, 2015. [5] Chetna Bharat Mudgule, et al, "Data Compression in Wireless Sensor Network: A Survey", International Journal of Innovative Research in Computer and Communication Engineering, Vol. 2, Issue 11, November 2014. [6] Peng Jiang and Sheng-Qiang Li, "A Data Compression Algorithm for Wireless Sensor Networks Based on an Optimal Order Estimation Model and Distributed Coding", Sensors 2010, 10, 9065-9083. [7] Lecture 19, "Compression and Huffman Coding", Supplemental reading in CLRS: Section 16.3.

17 IJCATM : www.ijcaonline.org