Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Error Detection and Correction Martin Weiss. Slide 2 Objectives of this Meeting u Describe the major error detection techniques u Describe forward error.

Similar presentations


Presentation on theme: "1 Error Detection and Correction Martin Weiss. Slide 2 Objectives of this Meeting u Describe the major error detection techniques u Describe forward error."— Presentation transcript:

1 1 Error Detection and Correction Martin Weiss

2 Slide 2 Objectives of this Meeting u Describe the major error detection techniques u Describe forward error correction

3 Slide 3 Review of the Last Meeting u Multiplexing u Topologies u Telephone network

4 Slide 4 Data Link Layer Issues u Error control u Flow control u Local addressing

5 Slide 5 Error Detection u Parity u Cyclical redundancy check

6 Slide 6 Vertical and Longitudinal Redundancy Checks Bit 1Bit 2 Bit n Parity Character 1 Character 2 Character m Parity b 11 b1mb1m C1C1 b2mb2m C2C2 b nm RmRm CnCn C n+1 b 21 bn1bn1 R1R1 b 12 b 22 bn2bn2 R2R2 LRC VRC

7 Slide 7 Cyclical Redundancy Check u Define –T = (n + k) bit frame to be transmitted (n<k) »k is the length of the message »n is the length of the error check, or frame check sequence –M = k bit message (First k Bits of T) –F = n bit Frame Check Sequence (FCS) –P = Generator polynomial

8 Slide 8 Cyclical Redundancy Check u T = 2 n M+F –2 n M has the effect of shifting M to the left by n bits –Then, the FCS (F) can be added to the end of the message

9 Slide 9 Cyclical Redundancy Check u T/P should have no remainder –2 n M/P = Q + R/P –T = 2 n M + R –T/P = 2 n M/P + R/P –T/P = Q + R/P + R/P = Q –Thus, there is no remainder because (R+R) mod 2 = 0 u Note that R will have at most n bits if P has n+1 bits

10 Slide 10 CRC Algorithm u Given –Message (M) –Pattern (P) –Length of Pattern (n+1) u Compute –2 n M –F = R/P –2 n M/P = Q + R/P

11 Slide 11 CRC Example M = 1010001101 (10 bits) P = 110101 (6 bits) n = 5 bits P = 110101 1 0 1 0 0 0 1 1 0 1 0 0 0 0 0 = 2 n M 1 1 0 1 0 1 1 1 0 1 0 1 0 1 1 0 1 1 1 0 1 1 1 1 0 1 0 1 1 1 1 0 1 0 1 1 0 1 0 1 1 1 1 1 1 0 1 1 0 1 0 1 1 0 1 1 0 0 1 1 0 1 0 1 1 1 0 0 1 0 1 1 0 1 0 1 1 1 1 0 = R/P F Must Be n Bits Long, So F = 01110

12 Slide 12 CRC Example (Receiver) Compute T/P = (2 n M + F )/P P = 110101 1 0 1 0 0 0 1 1 0 1 0 1 1 1 0 = 2 n M + F 1 1 0 1 0 1 1 1 0 1 0 1 0 1 1 0 1 1 1 0 1 1 1 1 0 1 0 1 1 1 1 0 1 0 1 1 0 1 0 1 1 1 1 1 1 0 1 1 0 1 0 1 1 0 1 1 1 1 1 1 0 1 0 1 0

13 Slide 13 CRC Receiver Example (With Error) Compute T/P = (2 n M + F )/P P = 110101 1 0 1 0 0 0 1 1 0 1 1 1 1 1 0 = 2 n M + F 1 1 0 1 0 1 1 1 0 1 0 1 0 1 1 0 1 1 1 0 1 1 1 1 0 1 0 1 1 1 1 0 1 0 1 1 0 1 0 1 1 1 1 1 1 0 1 0 1 1 0 1 0 1 1 1 1 0 1 0 1 1 1 1 1 0 1 1 1 0 1 0 1 1 0 0 0 0 R/P Is Non-Zero, So An Error Must Have Occured

14 Slide 14 Standard CRC Polynomials u P is the bit pattern, or Generator Polynomial u In the previous example, P = X 5 + X 4 + X 2 + 1 u Standard CRC generator polynomials –CRC-12 = X 12 + X 11 + X 3 + X 2 + X + 1 –CRC-16 = X 16 + X 15 + X 2 + 1 –CRC-CCITT = X 16 + X 12 + X 5 + 1

15 Slide 15 Error Correction u Automatic Response Request (ARQ) –Transmitter sends a message –Receiver acknowledges –In case of NAK, the transmitter retransmits the message

16 Slide 16 Forward Error Correction u Redundancy is built into the message u Detects and corrects errors u Example: Hamming Code

17 Slide 17 Hamming Codes u Developed by R.W. Hamming u Uses multiple parity bits to locate errors in a word u Theory –If n parity bits are used, there are 2 n possible combinations –We need to associate each bit position with a combination of parity bits –Thus, we must choose n so that 2 n > m (the number of bits in the message)

18 Slide 18 Hamming Code u Assume an 8 bit message –n > log 2 m –Choose n = 4 m1m1 m2m2 m3m3 m4m4 m5m5 m6m6 m7m7 m8m8 p1p1 p2p2 p3p3 p4p4 xxxxx xxxxx xxxx xxxx

19 Slide 19 Hamming Code m1m1 m2m2 m3m3 m4m4 m5m5 m6m6 m7m7 m8m8 p1p1 p2p2 p3p3 p4p4 xxxxx xxxxx xxxx xxxx m1m1 m2m2 m3m3 m4m4 m5m5 m6m6 m7m7 m8m8 p1p1 p2p2 p3p3 p4p4 Transmitted Sequence Even Parity Computation Table

20 Slide 20 Hamming Code Error (bit position) Parity Errors 1 2 3 4 5 6 7 8 9 10 11 12 p 1 p 2 p 1 & p 2 p 3 p 1 & p 3 p 2 & p 3 p 1, p 2, & p 3 p 4 p 1 & p 4 p 2 & p 4 p 1, p 2 & p 4 p 3 & p 4

21 Slide 21 Hamming Code u Consider the bit stream 10010011 u Parity bits are: –p 1 =1 –p 2 =1 –p 3 =0 –p 4 =0 u Transmitted bit stream is 111000100011

22 Slide 22 Hamming Code u If the received bit stream is –111010100011 »p 1 and p 3 fail –101000100011 »p 2 fails –111000100001 »p 1, p 2, and p 4 fail


Download ppt "1 Error Detection and Correction Martin Weiss. Slide 2 Objectives of this Meeting u Describe the major error detection techniques u Describe forward error."

Similar presentations


Ads by Google