On Wed, 12 Sep 2001, newlxuser wrote:

> checking built-in the app it-self. I suggested them of
> parity-bit key algo, which I had read some-where, but
> do'nt remember it now.

> The data will be mostly in the following form and with
> 1234-56 111-222 9876543210987 AX11200000009
> PPP123-12345 999999.99

> The sending machine will pass the data-file through my
> app to include the parity bit and
> the receiving end will filter the incomming data-file
> through my app ( which will be incorporating this
> parity-bit checking algo ).


hmmm there are lots of issues here, like

1) how's the data being transferred...meaning which protocol
2) Do you need error correction or error detection

for instance ppp has a error check suming built in (iirc) so it will
detect the errors that has crept in during the transmission. However it
will no get those that got in before or after.

the error corection/detection should be delegated to someone lower down,
rather than your application ( which i believe is at an higher level )

However still you want to do it, lets discuss 2 things:

error correction : error detection
==================================

you already mentioned parity bits, and md5 was mentioned on the thread (
this deserves to be at LIP ). Both of these are good for detecting. 

Parity bit is simple to implement. For each wordlength attach a single bit
to it. The bit is 1, if the original word had even no of 1's or else the
bit should be 0. Now verification is easy. Get the last bit and see if the
number of ones agree with what that bit says. You will be able to convince
yourself, that if any single bit got changed, that there will be a discrepancy,
even if that faulty bit was the parity bit itself.

cons: parity can detect error in one bit only. There can be errors in 2
locations which will get past this check


MD5: this is far superior than parity. If you append the MD5sum to the
original, it is very difficult to change the original without changing the
MD5. So this should be more than adequate for you.

Error correcting codes
======================

both parity and MD5 can detect the errors but not correct them. One can
devise schemes which can correct certain degrees of errors. For instance
a type of hamming code can detect and correct errors at one location,
while only detect errors at 2 locations with 3 code bits per byte. A
powerful error correcting code is the reed-sololmon code. You can get a
gpled library for doing that at

http://rscode.sourceforge.net

 
-- sreangsu


_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to