Increasing the Data Transmission Robustness in Wsn Using the Modified Error Correction Codes on Residue Number System

The WSN standard IEEE802.15.4 basically uses the unlicensed frequency of 2,4 GHz for data transmission in a variety of devices, standards and applications: IEEE802.11, Bluetooth and etc. In this paper we proposed modified correction codes – based on Residue Number System – to improve the data transmission robustness in WSN. These codes are characterized by high correction characteristics as well as the simplified coding procedure. There are given examples, and circuits of the both coder and decoder are designed for such modified correction codes using the Residue Number System and CPLD. DOI: http://dx.doi.org/10.5755/j01.eee.21.1.6657


I. INTRODUCTION
Wireless Sensor Networks (WSN) are used in ecological, technical and medical monitoring systems [1].WSN can control critical parameters of the industrial equipment such as a vibration, temperature, pressure enabling to avoid emergency cases.WSN have some advances including fast deployment, flexibility, self-organization and a possibility of the intelligent data processing.
The main constraint of WSN implementation is the low robustness of data transmission that is primarily caused by the high amount of obstacles in industrial enterprises.Therefore, increasing the robustness and decreasing the delay time of data transmission are fundamental issues for WSN.Retransmission or error correction codes are proposed to increase the robustness of WSN [2].However, using packet retransmission over the channel with the high error probability causes decreasing the general capacity and cannot guarantee stringent requirements for time delay [3].
The check of data packets integrity in the WSN respectively to the IEEE 802.15.4 standard is made on the 16 ( ) The CRC code simply detects the presence of an error in the blocks of data.In such case a request for the retransmission of distorted packet is sent.
The following requirements are established for WSN correction codes: low complexity of coding/decoding; low hardware requirements for algorithm implementation (microcontroller speed, memory capacity); adaptive change of check symbols number according to channel parameters.In [2], [5] the Reed Solomon codes are proposed for the error correction using in WSN.But there is a problem of changing (increasing/ decreasing) the check symbols number in those codes.For instance, if we need to turn from the number of check symbols r n k   to the bigger value ' ' r n k   we must re-count all check symbols [6].
Taking into account advantages of the Residue Number System (RNS), such as the independence, small capacity, equality of residues and the possibility to perform parallel mathematical calculations [7], it is expedient to study its implementation in correction codes.

II. RESIDUE NUMBER SYSTEM CORRECTION CODES
We should note the RNS is used now for solving the specialized problems only.It's conditioned by transformation necessity of the binary code -which is implemented by universal computers -into RNS code and reverse transformation to submit information for the user.
There are developed some correction codes to detect and correct errors in RNS [7].But for implementation of these codes in data transmission systems, particularly in WSN, it is necessary to convert data into Residue Number System that requires additional time and extra computing facilities.
Let's consider a system with the bases of ( , , , , , ), where , and let's introduce the additional check module In the existing correction codes of RNS (R -RNS codes) the value of the check number [7]   that is the calculation of check number requires the initial value of the number A .
There are the two existing approaches of errors correction using RNS correction codes [7], [8]:  Calculation of the number projection with a followed correction and two possible modes: 1.If received number is greater than the working range then an error exists; 2. There are calculated the number projection and basic numbers by turn throw of modules.If the number projection fits the working range then a given module has the error. Renewing the positional representation of the number from received residues on the Chinese Theorem of Residues with the three possible modes: 1.If received number is greater than the working range then an error exists; 2. Residues are thrown by turn.If received positional representation of the number is correct then the error exists at the thrown residue; 3. A correct number can be received using the residue from the number positional representation.Described steps above require essential computing costs that limit their implementation in WSN.
R -codes RNS have limitations imposed by the choice of increasing sequence of relatively prime modules.It is necessary for test modules to have identical digits.Otherwise, there is a problem of efficient maintaining of check symbols.Therefore authors proposed modified correction codes based on RNS and described below.

III. MODIFIED CORRECTION CODES ON RNS
In the proposed modified correction codes on RNS (M -RNS codes) the data packet in binary code must be transmitted and divided into blocks of the equal length (quaternion or bytes) [9] where i a is the binary digit, 4, 8 j  .
At that the value of check number   where i v are coprimes coefficients of a linear form with p ; i b is the byte of data in binary or decimal system Let's assume, that in the process of data transmission the error occurs in one of the data blocks (the bit stream from 1 to 8 binary digits was distorted), and instead A we get , , , , , ).
Then we calculate the value of the check number The difference between check symbols can be expressed as then the error occurs.To detect the error in any data block it is necessary to provide a condition that every value  corresponds to one error value.To satisfy this condition the coefficients of linear form must be coprime with p and the value of check module must be equal to m p 2  , where m -is the number of binary digits in the selected block (if we divide the packet into bytes then
To estimate the effectiveness of the correction code it is necessary to know the correlation between redundancy and error detection or error correction possibilities.
The minimal code distance of the modified RNS code is expressed as , where n is the code length, k is the number of data blocks.The modified RNS code can detect therefore the all t errors under condition 1 min then this code can correct the all t errors.To provide the assured error correction in one data block we need to introduce the two check numbers.
If we introduce the two or more check numbers, we can select: 1. Equal check modules and different coefficients of the linear form; 2. Different check modules and equal coefficients of the linear form.
Values of the linear form coefficients -which are required for calculating the check numbers -are calculated according to (5) and illustrated in the Table I.Since modules i p are selected to be equal the coefficients must be different ones as well as be coprimes with i p .If this condition is broken then values of check numbers will be the same, i.e.Let's consider an example of error detection using the modified RNS code.We select as a check module 16 p  ; coefficients of the linear form Thus misalignment value ' 1 the error is detected.
Experiments for the check module value 3 8 2 2 P   were executed.It was established the modified RNS code with one check module can provide the 100 % of error detection in one data block, and the 87 % in two data blocks.Moreover the correction capabilities depend on check module also.

IV. ERROR CORRECTION
Let's use the concept of an alternative set for errors correction [10].The alternative set for modified RNS codes is the set of data blocks The error in position of each of them can lead to some misalignment value i  which is determined by the condition . The error value i i a x can be determined per each i b block (Table II).x  x According to [2] the misalignment value When the error (data distortion) occurs in the data block the misalignment value ' , where x is the error value.
The error value depends on data capacity m and can be expressed by the condition: Let's find the misalignment value at error in the data block i b using (12) 1 (mod ).
To provide the unambiguous correction of the single error (error in one data block) it is necessary to provide a condition: the alternative set  consists of one data block per each misalignment value.Then the value of the check module where n is a number of data blocks.Let's consider the example of alternative sets usage for errors localization.Let the data consist of three blocks with the capacity of three bits each.Coefficients of the linear form can be found experimentally (using designed software): 1 54   , 2 25   , 3 67   .According to (14) the minimal theoretical value of the check module and misalignments per each data block are equal to: Misalignments values are calculated (Table III) in a case when the error appears in the one date block only.As it can be seen from the Table III misalignment values at the 3 columns are so different, that enables to detect and correct the error in any data block.

V. THE EXPERIMENTAL RESEARCH OF MODIFIED CORRECTION CODES
Modified RNS error correction codes are proposed to be used for increasing the data transmission robustness in WSN.
It's reasoned in [2] that most appropriate to store the check numbers from all blocks in the end of the packet.Such check numbers location enables to receive data packets by wireless sensors which don't use the additional RNS coding scheme.
Let's divide data (MHR and MAC payload) into five blocks (D1 -D5) for the implementing the RNS error correction code at the MAC layer (Fig. 2).The code length 25  After receiving the packet we use the CRC code to check the packet integrity.If there is no error then we don't use the RNS code for the additional check.If the error is detected then we use the modified RNS code to correct the error.
Encoding time was studied in the Matlab environment for the following codes: RNS correction code (R -RNS codes), RNS modified correction code (M -RNS codes) and Reed Solomon code RS (127, 87) with parameters: 25 n  , 17 k  , 8 r  , 4 t  .The results are given in Table IV.As it can be seen from Table IV, the correction M -RNS code allows to reduce the encoding time in five times in comparison with the correction R-RNS code and Reed Solomon RS (127, 87) code at the about same code rate.E is the bit energy, 0 N is the spectral density of chaos power.Using the noiseless coding [11] we may determine the coding effectiveness where   Graphical curves (Fig. 3) are obtained for the modulation Offset Quadrature Phase-shift keying (OQPSK), which is used in the standard IEEE802.15.4,and the proposed correction code with a minimal coding distance min 9 d  .
On the base of the expression (18) a general scheme of the encoder is synthesized (Fig. 4).Encoder/decoder for the RNS Modified Correction codes with the three data blocks and the one check number is implemented on CPLD (Fig. 5).
The encoder scheme is described in the Verilog language within the environment of Quartus II and it's implemented on Altera CPLD, the integrated circuit family MAX II, EPM240T100C3.There are used the following hardware resources: the total logic elements 141/240 (59 %).The maximum delay of forming the check number is 25 ns.It has established experimentally the encoder implementationbased on (18) -decreases the delay of the check number calculation approximately in 30 %, due to the parallel operation of the modular p multiplication blocks.
The decoder consists of the two units: the unit of error detection and the unit of data correction (see Fig. 5).In the first unit the check numbers are formed and misalignment s is calculated on base of received data.Then, in the second unit, the data correction is running per each data block on the base of misalignment tables [10].
The decoder is implemented on Altera CPLD, Family MAX II, Device EPM570T100C3.There are used the following hardware resources: the total logic elements 334/570 (59 %).The maximum delay of the check number calculation is 49 ns.Fig. 5. CPLD implementation of the encoder/decoder for RNS modified correction codes: ЕО -input for error application; b1, b2, b3 -data inputs; bv1, bv2, bv3 -data outputs; s -misalignment; bk -received check number; b0k -calculated check number.Fig. 6.Timing charts of encoder/decoder running.
The unit of error input is designed for the encoder/decoder verification enabling to insert errors in any of data block.For simulating the data corruption it's necessary to introduce the error vector in the EO input of the appropriate channel (see Fig. 5).A singular bit of the error vector converts the appropriate digit in the data block.
Executed simulation and verification of designed devices confirmed their proper running which is illustrated by timing charts (Fig. 6).To make more compact the representation values the error vector is given in binary notation, and the rest of values are given in decimal notation.For example let data distortion occurred in the block b2: Authors developed the CPLD encoder/decoder for the modified correction codes based on Residue Number System which provide the correction of single errors (errors in the one block).Encoder and decoder schemes are described in the Verilog language within environment Quartus II and implemented on Altera CPLD, MAX II integrated circuit.There are used the following hardware encoder resources: the total logic elements equal 141 and the maximum delay of forming the check number is 25 ns.Hardware decoder resources are: the total logic elements -334 and the maximum delay of check number calculation -49 ns.
It should be noted the modified Residue Number System codes simplify the calculation of the check numbers.As a result we have the reduction of computational consumptions, which is very important for its implementation in self-contained power supply devices.
Proposed approach can be used for implementation of encoder/decoder with other code characteristics, in this case it's necessary to change check numbers and the number of data units in the correspondent block.Taking into account low hardware resources for the implementing the encoder/decoder -based on modified correction Residue Number System codes -the developed devices can be used in wireless sensor networks for increasing the data transmission robustness.

VIII. FUTURE WORK
In the future we plan to implement the encoding/decoding algorithms in the wireless microcontrollers JN5148 and investigate their hardware and software complexity.
check blocks R1 -R5 are formed into a corresponding data block and stored after the last data block.
coding and with coding correspondingly.Estimation of the coding effectiveness is executed in Communications Toolbox 3.0, Matlab using the graphical environment BERTool.

Fig. 3 .
Fig. 3. Comparison of the data transmission veracity using a circuit without coding and with coding: BER -a probability of the bit error.As it can be seen from a Fig. 3 (points А and В) the use of noiseless coding allows to reduce a relation 0 / b E N from 10.5 dB to 7.5 dB at retaining the given veracity of the data transmission, i.e., the coding effectiveness equals 3 dB.

2 i  corresponds to the error 3 ix
(see Fig.6).So according to TableIIIthe misalignment 2  , that is, for correcting the error it's necessary to provide: Authors designed the modified correction codes on Residue Number System which allow to reduce the encoding time in five times in comparison with Correction R-code based on Residue Number System and Reed Solomon codes RS (127, 87) at about same code rate.Moreover proposed codes enable to decrease a relation 0 / b E N in 3 dB at retaining the given veracity of the data transmission.

TABLE II .
ERROR VALUE PER EACH DATA BLOCK.

TABLE III .
MISALIGNMENT VALUES FOR ALL POSSIBLE ERRORS.

TABLE IV .
THE PARAMETERS OF THE CODES.