Implementation of Modified Huffman Coding in Wireless Sensor Networks
Total Page:16
File Type:pdf, Size:1020Kb
International Journal of Computer Applications (0975 – 8887) Volume 177 – No.1, November 2017 Implementation of Modified Huffman Coding 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 Data compression & 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 bit rate. 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.