Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the hamming distance, and how do I determine it for a CRC scheme?

While studying for a class in computer networks, the prof talked about the hamming distance between 2 valid code words in a sample code. I have read about hamming distance, and it makes sense from the perspective of telling the difference distance between 2 strings. For example:

Code Word 1 = 10110 

The sender sends code word 1, and there is an error introduced, and the receiver receives 10100. So you see that the 4th bit was corrupted. This would result in the a hamming distance of 1 because:

Valid Code Word: 10110
Error Code Word: 10100
                 -----
XOR              00010

The XOR of the 2 strings results in one 1, so the hamming distance is 1. I understand it up to that point. But then the prof asks:

  • What is the hamming distance of the standard CRC-16 bit protocol?
  • What is the hamming distance of the standard CRC-32 bit protocol?

I'm a bit confused, and was wondering if someone could help. Thanks.

like image 840
naivedeveloper Avatar asked Sep 27 '10 02:09

naivedeveloper


People also ask

What is Hamming distance and how is it calculated?

To calculate the Hamming distance, you simply count the number of bits where two same-length messages differ. An example of Hamming distance 1 is the distance between 1101 and 1001 . If you increase the distance to 2 , we can give as an example 1001 and 1010 .

What is difference between CRC and Hamming code?

Hamming codes can be used both to detect and correct errors, while in crc errors can only be detected. CRC is used in communication while Hamming code is used to detect errors in memory disks.

What is Hamming distance explain with an example?

In particular, a code C is said to be k error detecting if, and only if, the minimum Hamming distance between any two of its codewords is at least k+1. For example, consider the code consisting of two codewords "000" and "111". The hamming distance between these two words is 3, and therefore it is k=2 error detecting.

Can CRC polynomial has Hamming distance of how many bits?

It features a Hamming distance of six. This means that five randomly distributed bit failures are detectable. The polynomial is also able to detect burst-errors up to 15 bit.


1 Answers

You probably figured it out by now, but what he asked for was most likely the minimum number of bit errors that a CRC code would not detect. The answer depends on the width, the polynomial and the length of the message. For instance, the best known CRC-32 polynomial (0x1EDC6F41) has a Hamming distance of 6 or better for messages of up to 5,275 bits (Castaglioni, Bräuer, Herrmann: Optimization of Cyclic Redundancy-Check Codes with 24 and 32 Parity Bits, IEEE Transactions on Communications, vol 41 no 6, June 1993) which means it is guaranteed to detect up to 5 flipped bits in a single message of 5,275 bits or less.

BTW, the code word includes the checksum, so your example is incorrect.

like image 112
DES Avatar answered Oct 03 '22 15:10

DES