You are on page 1of 4

The 7th IEEE International Conference on Intelligent Data Acquisition and Advanced Computing Systems: Technology and Applications

12-14 September 2013, Berlin, Germany

The Use of Modified Correction Code Based on


Residue Number System in WSN
Vasyl Yatskiv 1, Nataliya Yatskiv 1, Su Jun 1, Anatoly Sachenko 1, Hu Zhengbing 2
1
Ternopil National Economic University, 11 Lvivska St., Ternopil, Ukraine, 46020, jazkiv@ukr.net
2
Huazhong Normal University, China hzb@mail.ccnu.edu.cn

Abstract—The WSN standard IEEE802.15.4 basically – low complexity of coding/decoding;


uses frequency of 2,4 GHz for data transmission. This – low hardware requirements for the algorithm
unlicensed frequency band is used by a variety of devices, implementation (microcontroller speed, memory
standards and applications: IEEE802.11, Bluetooth and etc. capacity);
In this paper is considered the increase of data
transmission reliability increasing in WSN with the use of
– adaptive change of the number of check symbols in
Residue Number System error correcting code. These codes accordance with the change of channel parameters.
have high correcting characteristics and simplified coding
procedure.

Keywords—Wireless Sensor Networks; IEEE 802.15.4;


Residue Number System; Correcting Code.

I. INTRODUCTION Figure 1. IEEE 802.15.4 Data Frame structure


Wireless Sensor Networks (WSN) are used in
ecological, technical and medical monitoring systems [1]. In [2, 5] the Reed Solomon codes are proposed to be
The main constraint of WSN implementation in the used for error correction in WSN. But there is a problem
industrial automation systems is low reliability of data of change (increase/ decrease) of the check symbols
transmission that is primarily caused by the high amount number in these codes. For instance, if the number of
of obstacles in industrial enterprises. Therefore, the check symbols r  n  k , increases to the value
increase of reliability and decreasing of delay time of data r '  n '  k we must re-count all check symbols [6].
transmission are fundamental requirements for the In this work the modified RNS codes are proposed to
successful work of WSN in the real-time industrial be used for increase of data transmission reliability in
applications. The retransmission or error correction codes WSN.
are used to increase reliability of WSN. However, the use
of packet retransmission over the channel with high error II. RESIDUE NUMBER SYSTEM CORRECTION CODES
probability causes the decrease of general capacity and Data processing and data transmission in residue
couldn't guarantee stringent requirements to delay time [2, number system have some advantages, due to
3]. independence, small capacity, equality of residues and the
The check of data packets integrity in the WSN possibility to perform parallel mathematical calculations.
respectively to the IEEE 802.15.4 standard is made on the But now RNS is used only for solving specialized
basis of Cyclic Redundancy Check (CRC) code. The problems, because of transformation necessity of binary
frame check sequence (FCS) has capacity 16 bits and code, which is used by versatile computers into residue
calculated over the MAC header (MHR) and MAC number system code and after processing, we must
payload parts of the frame (Fig.1). The FCS calculation is convert data into binary code back to submit information
used on the basis of standard polynomial generator of for the user. Besides the above mentioned advantages of
degree 16 [4]: residue number system that are used for data processing,
G16 ( x )  x 16  x 12  x 5  1 . there are also effective error correction codes that are able
to detect and correct errors [7, 8]. But for the
A Cyclic Redundancy Check code simply detects the implementation of these codes in data transmission
presence of an error in the blocks of data. In the presence systems, particularly in WSN, it is necessary to convert
of error a request for the retransmission of distorted packet data into Residue Number System that requires additional
is sent. time and computing facilities. So considering the above
The following requirements for the correcting codes in mentioned the use of modified correction codes based on
the WSN are established: RNS is more expedient.

978-1-4799-1429-6/13/$31.00 ©2013 IEEE 513


Let us consider a system with the bases of '
b k  1  ( v1  b1  v 2  b 2   .
p1 , p2 ,  , pi ,  , pn , where a number A is presented   v i  b i    v k  b k mod p 
'

by residues
The difference between check symbols can be
A  (b1 , b2 ,  , bi ,  , bn ) , '
expressed as   b k 1  bk 1 . So, if   0 – there is no
where bi  A mod pi  , and introduce additional error; if   0 – there is an error.
control base pn  p n1 . For the error detection in any block it is necessary that
for every value  corresponding one error value. To
In the correction codes of RNS (R – RNS codes) the
satisfy this condition the coefficients of linear form must
value of check number is defined by the formula
be coprime with p and the value of control modulo must
bn 1  A mod pn 1  . be equal to p  2 m , where m – is the number of binary
That is the calculation of check number requires the digits in the selected block (if we divide the packet into
initial value of number A . bytes: m  8 ).
R – codes RNS have limitations imposed by the choice To estimate the effectiveness of the correction code it
of increasing sequence of relatively prime modules. It is is necessary to know the correlation between redundancy
necessary for test modules to have identical digits. and error detection or error correction possibilities.
Otherwise, there is a problem of efficient maintaining of The minimal code distance of modified RNS code is
check symbols. expressed as d min  n  k  1 , where n – is code
length, where k - is the number of data blocks. Therefore
III. MODIFIED CORRECTION CODES RNS
the modified RNS code can detect all t errors under
In the proposed modified correction codes based on
condition that d min  t  1 ; if d min  2  t  1 , then code
RNS (M – RNS codes) the data packet in binary code
must be transmitted and divided into blocks of the equal can correct all of t or almost all errors. To provide
length (quaternion or bytes). assured error correction in one block we’ll introduce two
check numbers.
a1j  a12 a11 a01 , a 2j  a22 a12 a02 ,  If we introduce two or more check numbers, we can
. select;
 , a ij  a2i a1i a0i ,  , a kj  a 2k a1k a0k 1) equal control modules and different coefficients of
linear form;
Where a i – is binary digit, j  4, 8 . 2) different control modules and equal coefficients of
At that the value of check number is defined according linear form.
to the formula The values of the coefficients of linear form required
for the calculation of the check numbers are given in the
b k 1  (v1  b1  v2  b2   Table 1, according to (1). In this example we can see that
,
the modules pi are equal – so the linear forms
  vi  bi    vk  bk ) mod p 
coefficients must be different numbers relatively prime to
where vi – are coprime coefficients of linear form with pi .
p ; bi – byte of data in binary or decimal system, Let’s consider an example of error detection with the
use of modified RNS code. As a check modulo we select
bi  a7i  a3i a2i a1i a0i  p  16 ; coefficients of linear form are v1  3 , v2  5 ,
 a0  20  a1  21  a2  2 2  . v3  7 , data blocks in decimal system are: b1  2 ,
 a3  23    a7  27 b2  10 , b3  9 .
The value of check number is expressed as:
Let us assume, that in the process of data transmitting
the error occurs in one of the data blocks (from 1 to 8 b k 1  3  2  5  10  7  9  mod 16   7 ;
'
binary digits were distorted), and instead A we have A . let’s introduce an error in the first block b1'  4 , while the
value of check number can be expressed as follows
A'  (b1 , b2 ,  , bi' ,  , bk , b k 1 ) .
b k 1  3  4  5  10  7  9  mod 16   13 .
'

The value of check number is calculated according to Thus


the formula '
  b k  1  b k  1  13  7  6 .

514
TABLE I. THE VALUES OF THE COEFFICIENTS OF THE MODIFIED
RNS CODES TABLE II. ERROR VALUE FOR EACH DATA BLOCK
Сheck
numbers
Coefficients v1  v17 Module Misali-
Data block: bi
pi gnment
bk  j value:
b1 b2  bi  bk
7, 71, 151, 239, 13, 79, 163, 251, 17, 83, 256 
bk 1 167, 257, 67, 137, 227, 281, 41 1  
11, 73, 157, 89, 241, 19, 173, 263, 41, 109, 256
xb11 xb12 xb1i xb1n
bk  2 197, 277, 103, 163, 47, 127, 79 2  
13, 79, 163, 251, 23, 97, 179, 269, 43, 113, 256 xb21 xb22 xb2i xb2n
bk  3 199, 281, 107, 167, 17, 173, 101
      
bk  4 17, 83, 167, 257, 29, 101, 181, 271, 47, 256
pk  1
 
127, 211, 239, 41, 79, 151, 13, 67 xbp1k 1 xbp2k 1 xbpi k 1 xbpnk 1
19, 89, 103, 173, 263, 37, 7, 71, 151, 239, 256
bk  5 17, 79, 157, 239, 43, 181, 59, 113
23, 97, 107, 179, 269, 271, 73, 157, 241, 256
bk  6 19, 71, 239, 151, 61, 229, 11, 131 value the alternative set  consist of one data block. The
bk  7 29, 101, 241, 59, 181, 271, 73, 163, 89, 256 value of the control module is selected from the
251, 23, 67, 43, 277, 19, 109, 137 condition [9]:
31, 277, 103, 113, 191, 257, 29, 101, 41, 256
bk  8 n
p k   pi  n  1 ,
193, 241, 97, 239, 19, 263, 13, 139
(2)
As   0 , the error is detected. The modified RNS 1

code with one check modulo provides 100 % of error n – number of data blocks.
detection in one data block and 87% - in two data blocks, Let’s consider the example of alternative sets usage for
moreover the corrective capabilities depend on check errors localization. Let the data consist of three blocks
modulo. with capacity of three bits each, ie n  3 , as the data are
three-digit we choose the module pi  8 . Choose the
IV. ERROR CORRECTION
Let’s use the concept of an alternative set for errors coefficients of the linear form:  1  3 , 2  5 ,  3  7 .
correction [9]. An alternative for modified RNS codes is Calculate the value of control module by condition (2)
the set of data blocks p k 1  (8  8  8  3  1)  22 and select the nearest

  b1 , b2 ,  , bk  prime number p k 1  23 .
Misalignment is calculated using the equation (1):
error in position of each of them can bring to some
misalignment value –  i . Misalignment value can be '
 i  b k 1  b k 1 
equal 0   i  p k 1 . For each bi block can be
i
3  b
1
'

 5  b2  7  b3 mod 23  ,
determined error value x ai (Table 2).
 3  b1  5  b2  7  b3  mod 23
Misalignment value is calculated by equation
respectively, the misalignments for each data block is
'
 b  bk 1  (v1  b1  v 2  b2    v b  ' equal to:
k 1
 1i  3  xbi (mod 23) ;
i i

  v k  bk mod p k 1   (v1  b1  v 2  b2   (1)


 2i  5  xb (mod 23) ;
 v i bi'    v k bk mod p k 1  i

 3i  7  xb (mod 23) .
i
When an error occurs in the data block the value bi is
Alternative sets for each misalignments are listed in
bi'  bi  x , where x – the error value, Table 3.
1  x  2 m  1. As it is shown in Table 3 for eight misalignment
values (2, 6, 9, 10, 14, 18, 19, 20) alternative set consists
Let’s find the misalignment at error in the data block
of a single data block that allow fixing the problem
bi using equation (1) immediately.
For five misalignment values (3, 5, 7, 15, 21)
 i  vi  x (mod p k 1 ) . alternative set consists of two data blocks and for one
misalignment value (12) alternative set consists of three
To unambiguous correction of single error (errors in data blocks of data, ie errors in one of three data blocks
one data block) it is requires that for each misalignment bring to the same misalignment value. So, if an alternative

515
set consists of two or more data blocks then for error TABLE IV. THE PARAMETERS OF THE CODES.
localization the additional analysis of control numbers
Code Encoding time (ms) Code Rate, R  k
should be carried out, or the number of check-ins n
increasing is needed. R – RNS code 117,5 0,64
M – RNS code 22,5 0,68
TABLE III. ALTERNATIVE SETS FOR EACH MISALIGNMENTS RS (127, 87) 109,7 0,68
As can be seen from Table 4, the correcting M-code
Misalignment value: i Data blocks
based on RNS allows five times reduction of encoding
b1 b2 b3 time in comparison to the correcting R-code based on
1 – – – RNS and RS (127, 87) codes.
2 – 5 –
3 1 – 7 VI. CONCLUSIONS AND FUTURE WORK PERSPECTIVES
4 – – –
5 – 1 4 The use of error correcting codes in WSN will enable
6 2 – – to increase channel capacity due to reduction of
7 – 6 1 retransmissions number.
8 – – –
The research of the modified RNS codes is showed
9 3 – –
10 – 2 – almost five times decrease of the encoding time in
11 – – – comparison with other codes.
12 4 7 5 The modified RNS code simplifies the calculation of
13 – – – the check numbers, consequently we have the reduction of
14 – – 2 computational consumptions, which is very important for
15 5 3 –
16 – – –
the use of this code in self-contained power supply
17 – – – devices.
18 6 – – In the future we plan to implement the
19 – – 6 encoding/decoding algorithms in wireless
20 – 4 – microcontrollers JN5148 and to investigate their hardware
21 7 – 3
and software complexity.
22 – – –
ACKNOWLEDGMENTS
V. THE RESEARCH AND THE USE OF THE MODIFIED
CORRECTING CODE BASED ON RNS This work is supported by State Agency on Science,
Innovation and Informatization of Ukraine, Ukrainian
In the [2] is founded, that most appropriate to store the
China project No. М/23/2013.
check numbers from all blocks in a separate location in
the payload. Such check numbers location allows to
wireless sensors which have no RNS coding scheme to REFERENCES
receive data packets. [1] I.F. Akyildiz, W. Su, Y. Sapnkarasubramaniam, E. Cayirci,
“Wireless sensor networks: a survey,” Comput. Netw. 2002, 38,
Let us divide data (MHR field and MAC payload) into pp. 393–422.
five blocks (D1 –D5) for the implementation of correcting [2] Kan Yu, Mikael Gidlund, Johan Åkerberg, Mats Bjorkman,
RNS code at the MAC layer as shown in Figure 2. The “Reliable and low latency transmission in industrial wireless
sensor networks,” Procedia Computer Science, 5, 2011, pp. 866–
length of the data block is ni  25 bytes. The length of 873.
informational block is k i  17 bit. The check blocks R1 [3] A. Sikora, V. Groza, “Coexistence of IEEE 802.15.4 with other
systems in the 2.4 ghz-ism-band,” Instrumentation and
– R5 are formed into a corresponding data block and Measurement Technology Conference, 2005, IMTC 2005,
stored after the last data block. Proceedings of the IEEE 3, 2005, pp. 1786 –1791.
[4] IEEE Standard for Part 15.4: Wireless Medium Access Control
After the receiving of the packet we use CRC code to Layer(MAC) and Physical Layer (PHY) specifications for Low
check packet integrity. If there is no error we don’t use Rate Wireless Personal Area Networks (LR-WPANs), IEEE Std
RNS code for additional check. If an error is detected we 802.15.4™-2006.
use modified RNS code to correct it. [5] M. Vuran, I. Akyildiz, “Cross-layer analysis of error control in
wireless sensor networks,” Sensor and Ad Hoc Communications
and Networks, SECON’06, 3rd Annual IEEE Communications
Society, 2006, pp.585 –594.
[6] V. Varhauzin, “Antinoise coding in the networks with packet
switching,” TeleMultiMedia, 2005, №9, pp. 10-16 (in Russian).
[7] I.Y. Akushskiy, D.I. Yuditskiy, Machine Arithmetics in Residue
Figure 2. The data frame structure with the use of coding. Number System, Moscow, Soviet Radio, 1968, 460 p. (in Russian).
[8] Modular Parallel Computing Structures of Neuro Pprocessing
System, N.I. Chervyakov, P.A. Sakhnyuk, A.V. Shaposhnikov,
The Matlab software was used for the investigation of S.A. Ryadnov, Edited by N.I. Chervyakov, Moscow, Fizmatlit,
encoding time of: R – RNS codes, M – RNS codes and 2003, 288 p. (in Russian).
RS (127, 87) with the parameters: n  25 , k  17 , [9] I.Y. Akushskiy, I.T.Pak. Questions of error-correcting coding
position-independent code // Problems of Cybernetics. 1977, V.28,
r  8 , t  4 . The results are summarized in Table 4. pp.36-56 (in Russian).

516

You might also like