• No results found

An Application Example: Cyclic Redundancy Check Code for the Ethernet Standard

Cyclic Codes

3.8 An Application Example: Cyclic Redundancy Check Code for the Ethernet Standard

One of the most interesting applications of cyclic codes is the cyclic redundancy check (CRC) code utilized in the Ethernet protocol. The redundancy calculated by the systematic procedure of cyclic coding is placed in the so-called frame check sequence (FCS) field, which follows the data block in the data frame of that protocol. The cyclic code used in this case is a cyclic code that adds 32 redundancy bits, and its corresponding polynomial generator is

g(X )=X32+X26+X23+X22+X16+X12+X11+X10+X8+X7+X5+X4+X2+X+1 One interesting property of cyclic block codes is that the number of parity check bits the code adds to the message vector is equal to the degree of the generator polynomial. Thus, and independently of the size of the data packet to be transmitted, the CRC for the standard Ethernet, for instance, always adds 32 bits of redundancy.

In the case of the standard protocol Ethernet, the data packet size varies from k=512 to k=12,144 bits. The k information bits are the first part of the whole message, and are considered as a polynomial m(X ), which is followed by the nk=32 redundancy bits that result from the division of the shifted message polynomial Xnkm(X ) by g(X ). The receiver

does the same operation on the message bits, so that if the redundancy calculated at the receiver is equal to the redundancy sent in the FCS, then the packet is accepted as a valid one. A retransmission of the packet is required if the recalculated redundancy is different from the contents of the FCS.

Consider a simple example of this procedure, using the cyclic block code Ccyc(7,4) in-

troduced in Example 3.3. Assume that the message m=(1010) has to be transmitted. After encoding this message, the resulting code vector is c=(0011010), where the redundancy is in bold. One way of performing the decoding of this code vector is to recalculate at the receiver the redundancy obtained by encoding the message vector m=(1010), and by verifying that

Table 3.4 Minimum Hamming distance for different packet configurations in the standard protocol Ethernet

Code length n Minimum Hamming distance dmin

3007–12,144 4

301–3006 5

204–300 6

124–203 7

90–123 8

this redundancy is equal to (001). An equivalent decoding method consists of evaluating the syndrome vector over the whole code vector c=(0011010), in order to verify if this syndrome vector is the all- zero vector. In the case of the Ethernet protocol, the decoding is performed as in the former case.

The code length can be variable in the Ethernet protocol, as we have seen. This makes the error-detection capability also variable with the code length. In [6] the values of the minimum Hamming distance as a function of the code length are presented, in the case of the standard Ethernet protocol. Table 3.4 determines the minimum Hamming distance as a function of the code length.

This means that, depending on the packet length, three to seven random errors will always be detectable, as well as certain patterns of much larger numbers of random errors and many burst error patterns (in fact, any error pattern which is not a codeword).

Bibliography and References

[1] Lin, S. and Costello, D. J., Jr., Error Control Coding: Fundamentals and Applications, Prentice Hall, Englewood Cliffs, New Jersey, 1983.

[2] Carlson, B., Communication Systems: An Introduction to Signals and Noise in Electrical Communication, 3rd Edition, McGraw-Hill, New York, 1986.

[3] Sklar, B., Digital Communications, Fundamentals and Applications, Prentice Hall, En- glewood Cliffs, New Jersey, 1993.

[4] Berlekamp, E. R., Algebraic Coding Theory, McGraw-Hill, New York, 1968.

[5] Meggitt, J. E., “Error correcting codes and their implementation,” IRE Trans. Inf. Theory, vol. IT-7, pp. 232–244, October 1961.

[6] Ad´amek, J., Foundations of Coding: Theory and Applications of Error-Correcting Codes with an Introduction to Cryptography and Information Theory, Wiley Interscience, New York, 1991.

[7] Peterson, W. W. and Wledon, E. J., Jr., Error-Correcting Codes, 2nd Edition, MIY Press, Cambridge, Massachusetts, 1972.

[8] McEliece, R. J., The Theory of Information and Coding, Addison-Wesley, Massachusetts, 1977.

[9] MacWilliams, F. J. and Sloane, N. J. A., The Theory of Error-Correcting Codes, North- Holland, Amsterdam, The Netherlands, 1977.

[10] Baldini, R., Coded Modulation Based on Ring of Integers, PhD Thesis, University of Manchester, Manchester, 1992.

[11] Baldini, R. and Farrell, P. G., “Coded modulation based on rings of integers modulo-q. Part 1: Block codes,” IEE Proc. Commun., vol. 141, no. 3, pp.129–136, June 1994. [12] Piret, P., “Algebraic construction of cyclic codes over Z with a good Euclidean minimum

distance,” IEEE Trans. Inf. Theory, vol. 41, no. 3, May 1995.

[13] Hillma, A. P. and Alexanderson, G. L., A First Undergraduate Course in Abstract Algebra, 2nd Edition, Wadsworth, Belmont, California, 1978.

[14] Allenby, R. B. J., Rings, Fields and Groups: An Introduction to Abstract Algebra, Edward Arnold, London, 1983.

Problems

3.1 Determine if the polynomial 1+X+X3+X4 is a generator polynomial of a binary linear cyclic block code with code length n≤7.

3.2 Verify that the generator polynomial g(X)=1+X+X2+X3generates a binary cyclic code Ccyc(8, 5) and determine the code polynomial for the message vector m=(10101) in systematic form.

3.3 A binary linear cyclic code Ccyc(n, k) has code length n=7 and generator poly- nomial g(X)=1+X2+X3+X4.

(a) Find the code rate, the generator and parity check matrices of the code in systematic form, and its Hamming distance.

(b) If all the information symbols are ‘1’s, what is the corresponding code vector? (c) Find the syndrome corresponding to an error in the first information symbol,

and show that the code is capable of correcting this error. 3.4 Define what is meant by a cyclic error-control code.

3.5 A binary linear cyclic block code Ccyc(n, k) has code length n=14 and generator polynomial g(X)=1+X3+X4+X5.

(a) If all the information symbols are ‘1’s, what is the corresponding code vector? (b) Find the syndrome corresponding to an error in the last information symbol.

Is this code capable of correcting this error? (c) Can cyclic codes be non-linear?

3.6 (a) Determine the table of code vectors of the binary linear cyclic block code

Ccyc(6, 2) generated by the polynomial g(X)=1+X+X3+X4.

(b) Calculate the minimum Hamming distance of the code, and its error- correction capability.

3.7 A binary linear cyclic block code with a code length of n=14 has the generator polynomial g(X)=1+X2+X6.

(a) Determine the number of information and parity check bits in each code vector.

(b) Determine the number of code vectors in the code.

(c) Determine the generator and parity check matrices of the code. (d) Determine the minimum Hamming distance of the code. (e) Determine the burst error-correction capability of the code. (f) Describe briefly how to encode and decode this code.

3.8 For a given binary linear cyclic block code Ccyc(15, 11) generated by the poly- nomial g(X)=1+X+X4,

(a) determine the code vector in systematic form of the message vector m= (11001101011) and

(b) decode the received vectorr=(000010001101011).

4

BCH Codes

BCH (Bose, Chaudhuri [1], Hocquenghem [2]) codes are a class of linear and cyclic block codes that can be considered as a generalization of the Hamming codes, as they can be designed for any value of the error-correction capability t. These codes are defined in the binary field GF(2), and also in their non-binary version, over the Galois field GF(q). Included in this latter case is the most relevant family of non-binary codes, which is the family of Reed–Solomon codes [3], to be presented in Chapter 5.