Multimedia Systems WS 2010/2011 15.11.2010 M. Rahamatullah Khondoker (Room # 36/410 ) University of Kaiserslautern Department of Computer Science Integrated Communication Systems ICSY http://www.icsy.de
Outline Error Detection and Correction Why error occurs? Attenuation Distortion Noise Error Detection Mechanisms Parity Checks Checksum Cyclic Redundancy Check Error Correction Mechanism FEC: Hamming Code 2
Error Detection and Correction Causes of impairment Attenuation: Loss of energy to overcome the resistance of the medium Distortion: Signal changes its shape because of having different delays of composite signals Noise: Addition of unwanted signals Thermal noise, induced noise, cross talk, impulse noise 3
Error Detection and Correction Error occurs because of Attenuation, distortion, noise and interference Error types Single-bit error: changes of one bit Happens in: Parallel transmission Example: 10110101 10110111 Burst error: changes of more than one bit Reason: Noise duration is more than one bit data duration Happens in: Serial transmission Example: 10110101 10100111 4
Error Detection and Correction Error Detection: Detection of one or more corrupted bits in a bit string Error Correction: Detection and correction of those corrupted bits Redundant bits are added to detect and correct errors Error detection mechanisms Parity check (one or two dimensional) Checksum Cyclic Redundancy Check Error correction mechanism Hamming code 5
Error Detection Mechanisms
Error Detection Parity Check Simplest error detection scheme Used for a single bit error detection A parity bit is added at the end of a block of data Example: ASCII G: 111001 1110010 (even parity) Two dimensional parity check Improved over simple parity check 1110011 (odd parity) Data are arranged in a table and parity bits are calculated for both row and columns Example: 1 0 1 1 0 1 1 0 1 0 1 1 0 1 0 1 1 0 1 1 1 0 0 1 1 1 0 0 0 1 7
Error Detection Difference between single parity and double parity checks Single parity check Detect single bit error Less overhead Two dimensional parity check Detect some burst errors More overhead 8
Error Detection: Checksum Several protocols in the internet uses checksum For example: TCP/IP, ICMP Sender side: The message is divided into m bit words All words are added using one s complement arithmetic The sum is complemented and becomes the checksum The checksum is sent with the data Receiver side The message including checksum is divided into m bit words All words are added using one s complement arithmetic The sum is complemented and becomes the new checksum If the value of the checksum is 0, then the message is accepted, otherwise, rejected 9
Error Detection: Checksum Example: Data 10110110 11010101 01011011 Sender side: 1 0 1 1 0 1 1 0 0 1 1 0 0 0 1 0 1 1 Message sent: 10110110 11010101 01011011 00011000 1 1 0 0 0 1 1 0 0 0 1 0 1 1 0 1 1 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 0 Receiver side 1 0 1 1 0 1 1 0 0 1 1 0 0 0 1 0 1 1 1 1 0 0 0 1 1 0 0 0 1 0 1 1 0 1 1 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 No Error 10
Error Detection: Checksum Performance Cannot detect error when the value of one word is incremented and the value of another word is decremented by the same amount Several words value are incremented and the total change is a multiple of 65535 Now a days, checksum is usually replaced with Cyclic Redundancy Check (CRC) 11
Error Detection: CRC Most common and most powerful error detecting codes Usually used in data link layer It can detect 100% single and double bit errors (Message bits (k) + transmitter generated bits (n)) / predetermined number The receiver divides the incoming message with that predetermined number Zero reminder means no error 12
Error Detection: CRC k Data n 00..0 k Data n CRC n+1 bits Divisor Data CRC n+1 bits Divisor CRC n bits Reminder Zero accept Nonzero Reject Sender Receiver 13
Error Detection: CRC Modulo-2 Arithmetic Given, Data = 1010001101, Divisor = 110101, CRC bits? 1 0 1 0 0 0 1 1 0 1 110101 1 0 1 0 0 0 1 1 0 1 0 0 0 0 0 14
Error Detection: CRC Given, Data = 1010001101, Divisor = 110101, CRC bits? 1 0 1 0 0 0 1 1 0 1 110101 1 0 1 0 0 0 1 1 0 1 0 0 0 0 0 15
Error Detection: CRC Given, Data = 1010001101, Divisor = 110101, CRC bits? 1 0 1 0 0 0 1 1 0 1 110101 1 0 1 0 0 0 1 1 0 1 0 0 0 0 0 1 1 1 0 1 16
Error Detection: CRC Given, Data = 1010001101, Divisor = 110101, CRC bits? 1 0 1 0 0 0 1 1 0 1 110101 1 0 1 0 0 0 1 1 0 1 0 0 0 0 0 1 1 1 0 1 1 17
Error Detection: CRC Given, Data = 1010001101, Divisor = 110101, CRC bits? 1 0 1 0 0 0 1 1 0 1 110101 1 0 1 0 0 0 1 1 0 1 0 0 0 0 0 1 1 1 0 1 1 18
Error Detection: CRC Given, Data = 1010001101, Divisor = 110101, CRC bits? 1 0 1 0 0 0 1 1 0 1 110101 1 0 1 0 0 0 1 1 0 1 0 0 0 0 0 1 1 1 0 1 1 1 1 1 0 1 0 1 1 1 1 1 0 1 0 1 1 0 0 1 1 0 0 1 0 0 1 1 1 0 Transmitted bits 101000110101110 19
Error Detection: CRC Data received 101000110101110 110101 1 0 1 0 0 0 1 1 0 1 1 1 0 1 1 1 1 1 0 1 0 1 1 1 1 1 0 1 0 1 1 1 1 0 0 0 0 0 All zero means no error, data is accepted 20
Error Detection: CRC A second view of CRC is to express all values as polynomials in a dummy variable X, with binary coefficient If, M = 110011, M(X) = x5 + x4 + X + 1 CRC process can be expressed as Three versions of P(X) are widely used 21
Error Correction Mechanisms
Error Correction Error Correction Approaches Forward Error Correction (FEC): Redundancy bits are transmitted to correct the error in the receiver Example: Hamming code Add redundancy to transmitted data Well suited for channels with high error rate No reverse channel required Create high overhead Backward Error Correction (BEC): Sender retransmits the data upon requested by the receiver Example: Automatic Repeat Request (ARQ) Well suited for channels with low error rate Request and retransmission cause high delay Requires reverse channel FEC and BEC BEC is used when FEC cannot correct the error 23
FEC: Hamming Code Originally designed to detect 2 bit errors and to correct a single bit error Now, some hamming code can correct burst errors Here, only single bit error correction will be shown 24
FEC: Hamming Code For m data bits, k parity bits are added Total number of bits, n in the code is calculated as n = 2 k 1 Data bits, m = n k k parity bits are places in the positions 1, 2,, 2 k 1 Transmission end Calculates parity bits as described above Receiving end Calculates parity bits in the same way The decimal value of the result indicates the error position 25
FEC: Hamming Code For m = 4 data bits, k parity bits are added Now, how to get the appropriate k Taking different integers of k, we need to calculate n such that m = n k = 4 n = 2 k 1 = 2 1 1 = 1 m = n k = 1 1 = 0 n = 2 k 1 = 2 2 1 = 3 m = n k = 3 2 = 1 n = 2 k 1 = 2 3 1 = 7 m = n k = 7 3 = 4 n = 2 k 1 = 2 4 1 = 15 m = n k = 15 4 = 11 26
FEC: Hamming Code For example, data word, m = 1010 7 6 5 4 3 2 1 D 4 D 3 D 2 P 3 D 1 P 2 P 1 1 0 1 0 Error Position 0 (no error) 000 Position Number (C 3 C 2 C 1 ) 1 001 2 010 3 011 4 100 5 101 6 110 7 111 27
FEC: Hamming Code For example, data word, m = 1010 7 6 5 4 3 2 1 D 4 D 3 D 2 P 3 D 1 P 2 P 1 1 0 1 0 0 Error Position 0 (no error) 000 1 001 2 010 3 011 4 100 5 101 6 110 7 111 Position Number (C 3 C 2 C 1 ) 28
FEC: Hamming Code For example, data word, m = 1010 7 6 5 4 3 2 1 D 4 D 3 D 2 P 3 D 1 P 2 P 1 1 0 1 0 1 0 Error Position 0 (no error) 000 1 001 2 010 3 011 4 100 5 101 6 110 7 111 Position Number (C 3 C 2 C 1 ) 29
FEC: Hamming Code For example, data word, m = 1010 Transmitter sends 1010010 7 6 5 4 3 2 1 D 4 D 3 D 2 P 3 D 1 P 2 P 1 1 0 1 0 0 1 0 Error Position 0 (no error) 000 1 001 2 010 3 011 4 100 5 101 6 110 7 111 Position Number (C 3 C 2 C 1 ) 30
FEC: Hamming Code Transmitter sends 1010010 For example, receiver gets 1110010 1 1 0 7 6 5 4 3 2 1 D 4 D 3 D 2 P 3 D 1 P 2 P 1 1 1 1 0 0 1 0 Error Position 0 (no error) 000 1 001 2 010 3 011 4 100 5 101 6 110 7 111 Position Number (C 3 C 2 C 1 ) 31
FEC: Hamming Code 110 (6) number positions is in error Receiver inverts the bit from 1 to 0 1 1 0 7 6 5 4 3 2 1 D 4 D 3 D 2 P 3 D 1 P 2 P 1 1 1 1 0 0 1 0 Error Position 0 (no error) 000 1 001 2 010 3 011 4 100 5 101 6 110 7 111 Position Number (C 3 C 2 C 1 ) 32
Thanks for your attention Any questions, comments or concerns?
M. Rahamatullah Khondoker, M.Sc. Integrated Communication Systems ICSY University of Kaiserslautern Department of Computer Science P.O. Box 3049 D-67653 Kaiserslautern Phone: +49 (0)631 205-26 43 Fax: +49 (0)631 205-30 56 Email: Internet: khondoker@informatik.uni-kl.de http://www.icsy.de