24
Error DETECTION & CORRECTION

Error DETECTION & CORRECTION. Detection in oral communication Sender Receiver No, UCLA won today No, you see LA won today In verbal communication we use

  • View
    224

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Error DETECTION & CORRECTION. Detection in oral communication Sender Receiver No, UCLA won today No, you see LA won today In verbal communication we use

ErrorDETECTION

&CORRECTION

Page 2: Error DETECTION & CORRECTION. Detection in oral communication Sender Receiver No, UCLA won today No, you see LA won today In verbal communication we use

Detection in oral communication

Sender Receiver

No, UCLA won today

No, you see LA won today

In verbal communication we use the most likelyinterpretation and only question when there seemto be ambiguities or inconsistencies.

Page 3: Error DETECTION & CORRECTION. Detection in oral communication Sender Receiver No, UCLA won today No, you see LA won today In verbal communication we use

Detection in data communication

Sender Receiver

Program

Even a single bit in error can result in •loading from the wrong address•storing in the wrong address•executing the wrong op code•using the wrong data value

Page 4: Error DETECTION & CORRECTION. Detection in oral communication Sender Receiver No, UCLA won today No, you see LA won today In verbal communication we use

• Detection is probabilistic.

• We’ll never detect ALL errors, only optimize the likelihood of detecting it.

• Our focus is on techniques which detect communications-type errors with the highest probability.

• Correction will follow. Focus on detection.

“All” Errors must be detected

Page 5: Error DETECTION & CORRECTION. Detection in oral communication Sender Receiver No, UCLA won today No, you see LA won today In verbal communication we use

Parity

Databits Parity

___ ___ ___ ___ ___ ___ ___ ___ ___ 1 0 1 0 0 0 1 0

•Count the number of 1s.•For EVEN (ODD) parity, set the parity bit to either 1 or 0 to have the total number of 1s EVEN (ODD).E.g. for EVEN parity:

___ ___ ___ ___ ___ ___ ___ ___ ___ 1 0 1 0 0 0 1 0 1

___ ___ ___ ___ ___ ___ ___ ___ ___ 1 0 1 1 1 1 1 0 0

Page 6: Error DETECTION & CORRECTION. Detection in oral communication Sender Receiver No, UCLA won today No, you see LA won today In verbal communication we use

Detection with parity

___ ___ ___ ___ ___ ___ ___ ___ ___ 1 0 0 0 0 0 1 0 1

___ ___ ___ ___ ___ ___ ___ ___ ___ 1 0 1 0 0 0 1 0 1 Sendertransmits

Error Occurs

Receivergets

Receiver calculates parity. Should be 0! Is 1! … ERRORNo method to determine WHICH bit is in error.

But ONLY NEED TO DETECT.

Page 7: Error DETECTION & CORRECTION. Detection in oral communication Sender Receiver No, UCLA won today No, you see LA won today In verbal communication we use

Double Errors with parity

___ ___ ___ ___ ___ ___ ___ ___ ___ 1 0 0 0 0 0 1 1 1

___ ___ ___ ___ ___ ___ ___ ___ ___ 1 0 1 0 0 0 1 0 1 Sendertransmits

Error Occurs

Receivergets

Receiver calculates parity. Should be 1! Is 1! … ERROR NOT DETETED.

This is a PROBLEM!

Page 8: Error DETECTION & CORRECTION. Detection in oral communication Sender Receiver No, UCLA won today No, you see LA won today In verbal communication we use

So is parity useful?

• Probability– If two events (E1, E2) are independent of one

another, probability of simultaneous occurrence is P(E1) * P(E2).

– P(single bit error) = P(S) = 10-6, • P(two bits in error)= P(S)*P(S) = 10-12

• If two bit errors are independent.

• Parity is useful when bit errors are not independent.

• This is NOT typically true in communications environments.

A PROBLEM!

Page 9: Error DETECTION & CORRECTION. Detection in oral communication Sender Receiver No, UCLA won today No, you see LA won today In verbal communication we use

One more important concern!

• Communications errors are BURSTY.

• This means that neighboring bits are affected by each other and the independence assumption is invalid.

___ ___ ___ ___ ___ ___ ___ ___ ___ 1 0 1 0 0 0 1 0 1

___ ___ ___ ___ ___ ___ ___ ___ ___ 1 0 1 1 1 1 1 0 1

Page 10: Error DETECTION & CORRECTION. Detection in oral communication Sender Receiver No, UCLA won today No, you see LA won today In verbal communication we use

A similar approach

1 0 1 0 0 0 1 0 1

0 0 0 0 0 0 1 0 1

0 0 1 0 1 0 1 0 1

1 1 1 0 1 0 1 0 1

0 1 1 0 0 0 0 0 0

Vertical Parity

Catches MORE errors but still misses this one.

Page 11: Error DETECTION & CORRECTION. Detection in oral communication Sender Receiver No, UCLA won today No, you see LA won today In verbal communication we use

CRC Codes

• More complicated to calculate.

• Good at detecting bursty errors.

• Not intuitive.

• Standard and well-known codes.

• Uses a “binary” arithmetic technique

Page 12: Error DETECTION & CORRECTION. Detection in oral communication Sender Receiver No, UCLA won today No, you see LA won today In verbal communication we use

Representing a polynomial in binary

146 xxx

0123456 1100101 xxxxxxx IS

WHICH CAN BE VIEWED AS

1 1 1 10 0 0

Page 13: Error DETECTION & CORRECTION. Detection in oral communication Sender Receiver No, UCLA won today No, you see LA won today In verbal communication we use

A few new operations

ADDITION(No carry)

same as subtraction

11010101001000

0100010

Division(Will it divide?)

0100010 0100011YES

easy

1100010 0100011NOeasy

1100011 1100010YESnot easy

Will divide if the same length!

Page 14: Error DETECTION & CORRECTION. Detection in oral communication Sender Receiver No, UCLA won today No, you see LA won today In verbal communication we use

Put together for division

100010 100011000000

1

100010

Page 15: Error DETECTION & CORRECTION. Detection in oral communication Sender Receiver No, UCLA won today No, you see LA won today In verbal communication we use

Put together for division

100010 100011000000

1

100010

1

Page 16: Error DETECTION & CORRECTION. Detection in oral communication Sender Receiver No, UCLA won today No, you see LA won today In verbal communication we use

Put together for division

100010 100011000000

100001

100010

100000

Page 17: Error DETECTION & CORRECTION. Detection in oral communication Sender Receiver No, UCLA won today No, you see LA won today In verbal communication we use

Put together for division

100010 100011000000

100001

100010

100000100010

Page 18: Error DETECTION & CORRECTION. Detection in oral communication Sender Receiver No, UCLA won today No, you see LA won today In verbal communication we use

Put together for division

100010 100011000000

100001

100010

100000100010

000010

Page 19: Error DETECTION & CORRECTION. Detection in oral communication Sender Receiver No, UCLA won today No, you see LA won today In verbal communication we use

Put together for division

100010 100011000000

1000010

100010

100000100010

0000100Remainder

Page 20: Error DETECTION & CORRECTION. Detection in oral communication Sender Receiver No, UCLA won today No, you see LA won today In verbal communication we use

• A special polynomial named the GENERATOR is used as the divisor.

• The message appended parity bits are the dividend

• Initially the parity bits are all zero.

• After calculating the remainder(CRC), replace the parity bits with the remainder.

Relating this to CRC

Page 21: Error DETECTION & CORRECTION. Detection in oral communication Sender Receiver No, UCLA won today No, you see LA won today In verbal communication we use

Example message

Generator

Message

100010

1000110

PARITY (initially)

00000

Parity will be replaced with remainder.Remainder always ONE less that length of Generator.

100010 100011000000…...…...

100Remainder

100011000100

Message TransmittedOldMessage+NewParity

(same problem)

Page 22: Error DETECTION & CORRECTION. Detection in oral communication Sender Receiver No, UCLA won today No, you see LA won today In verbal communication we use

Receiver checks CRC

100010 100011000100

1000010

100010

100010100010

0Remainder

0 remainder indicates no error detected.Message is extracted and forwarded!

1000110Received message

Page 23: Error DETECTION & CORRECTION. Detection in oral communication Sender Receiver No, UCLA won today No, you see LA won today In verbal communication we use

SummaryUse generator and message to determine CRC

Generator Message Zeros

…….…….

Remainder

Append Remainder(CRC) to message and transmit.

Message Remainder

Receiver calculates remainder. Expects 0.

Generator Message

0

ACCEPTIF 0Remainder

Page 24: Error DETECTION & CORRECTION. Detection in oral communication Sender Receiver No, UCLA won today No, you see LA won today In verbal communication we use

CRC detection of errors

• Remember that CRC finds bursty (and other types of) errors with high probability.

• Although it is not obvious, this is also easy to calculate. … IMPORTANT not to slow the communication process.

• We’ll see how to CORRECT later.