24
1 Frame Error Detection รศ.ดร.อนันต์ ผลเพิ ่ม Asso. Prof. Anan Phonphoem, Ph.D. [email protected] http://www.cpe.ku.ac.th/~anan Computer Engineering Department Kasetsart University, Bangkok, Thailand

Frame Error Detection - Kasetsart Universityanan/myhomepage/wp... · ITU-16 x16 + x12 + x5 + 1 HDLC ITU-32 x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 +

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Frame Error Detection - Kasetsart Universityanan/myhomepage/wp... · ITU-16 x16 + x12 + x5 + 1 HDLC ITU-32 x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 +

1

Frame Error Detection

รศ.ดร.อนันต์ ผลเพิ่ม

Asso. Prof. Anan Phonphoem, [email protected]

http://www.cpe.ku.ac.th/~anan

Computer Engineering Department

Kasetsart University, Bangkok, Thailand

Page 2: Frame Error Detection - Kasetsart Universityanan/myhomepage/wp... · ITU-16 x16 + x12 + x5 + 1 HDLC ITU-32 x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 +

2

Outline

Transmission Errors

Error Detection Mechanism

Page 3: Frame Error Detection - Kasetsart Universityanan/myhomepage/wp... · ITU-16 x16 + x12 + x5 + 1 HDLC ITU-32 x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 +

3

Transmission Errors

``

Attenuation

Interference

Distortion

Page 4: Frame Error Detection - Kasetsart Universityanan/myhomepage/wp... · ITU-16 x16 + x12 + x5 + 1 HDLC ITU-32 x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 +

4

Single-bit error

Page 5: Frame Error Detection - Kasetsart Universityanan/myhomepage/wp... · ITU-16 x16 + x12 + x5 + 1 HDLC ITU-32 x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 +

5

Burst error (Multiple-bit error)

Page 6: Frame Error Detection - Kasetsart Universityanan/myhomepage/wp... · ITU-16 x16 + x12 + x5 + 1 HDLC ITU-32 x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 +

6

How do we know that data is corrupted (errors occur)?

How to detect the error?

Does not know at the signal level

Comparison…

Redundancy 2 copies of everything (slow, high overhead)

Extra info.

Page 7: Frame Error Detection - Kasetsart Universityanan/myhomepage/wp... · ITU-16 x16 + x12 + x5 + 1 HDLC ITU-32 x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 +

7

Redundancy

Page 8: Frame Error Detection - Kasetsart Universityanan/myhomepage/wp... · ITU-16 x16 + x12 + x5 + 1 HDLC ITU-32 x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 +

8

Parity Check

Page 9: Frame Error Detection - Kasetsart Universityanan/myhomepage/wp... · ITU-16 x16 + x12 + x5 + 1 HDLC ITU-32 x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 +

9

Example

Suppose the sender wants to send the word “world”.

In ASCII the five characters are coded as

1110111 1101111 1110010 1101100 1100100

w o r l d

The following shows the actual bits sent

11101110 11011110 11100100 11011000 11001001

Page 10: Frame Error Detection - Kasetsart Universityanan/myhomepage/wp... · ITU-16 x16 + x12 + x5 + 1 HDLC ITU-32 x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 +

10

Notes:•Segment•Add using one’s complement•Sum is complementedChecksum

Page 11: Frame Error Detection - Kasetsart Universityanan/myhomepage/wp... · ITU-16 x16 + x12 + x5 + 1 HDLC ITU-32 x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 +

11

16-bit checksum example

Page 12: Frame Error Detection - Kasetsart Universityanan/myhomepage/wp... · ITU-16 x16 + x12 + x5 + 1 HDLC ITU-32 x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 +

12

Cannot detect (all) errors

Page 13: Frame Error Detection - Kasetsart Universityanan/myhomepage/wp... · ITU-16 x16 + x12 + x5 + 1 HDLC ITU-32 x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 +

13

Cyclic Redundancy Check (CRC)

Page 14: Frame Error Detection - Kasetsart Universityanan/myhomepage/wp... · ITU-16 x16 + x12 + x5 + 1 HDLC ITU-32 x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 +

14

Binary Division in a CRC generator

Page 15: Frame Error Detection - Kasetsart Universityanan/myhomepage/wp... · ITU-16 x16 + x12 + x5 + 1 HDLC ITU-32 x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 +

15

Binary Division in a CRC checker

Page 16: Frame Error Detection - Kasetsart Universityanan/myhomepage/wp... · ITU-16 x16 + x12 + x5 + 1 HDLC ITU-32 x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 +

16

Polynomial

Page 17: Frame Error Detection - Kasetsart Universityanan/myhomepage/wp... · ITU-16 x16 + x12 + x5 + 1 HDLC ITU-32 x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 +

17

Polynomial and Divisor

Page 18: Frame Error Detection - Kasetsart Universityanan/myhomepage/wp... · ITU-16 x16 + x12 + x5 + 1 HDLC ITU-32 x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 +

18

Choosing the polynomial

• Cannot choose x (binary 10) or x2 + x (binary 110)

• Because both are divisible by x.

• Can choose x + 1 (binary 11)

• Because it is not divisible by x, but is divisible by x + 1.

• Also choose x2 + 1 (binary 101)

• Because it is divisible by x + 1 (binary division).

2 properties• Should not divisible by x• Should be divisible by (x+1)

Example

Page 19: Frame Error Detection - Kasetsart Universityanan/myhomepage/wp... · ITU-16 x16 + x12 + x5 + 1 HDLC ITU-32 x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 +

19

Standard Polynomials

Name Polynomial Application

CRC-8 x8 + x2 + x + 1 ATM header

CRC-10 x10 + x9 + x5 + x4 + x 2 + 1 ATM AAL

ITU-16 x16 + x12 + x5 + 1 HDLC

ITU-32

x32 + x26 + x23 + x22 + x16 + x12 +

x11 + x10 + x8 + x7 + x5 + x4 + x2 +

x + 1

LANs

Page 20: Frame Error Detection - Kasetsart Universityanan/myhomepage/wp... · ITU-16 x16 + x12 + x5 + 1 HDLC ITU-32 x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 +

20

CRC

Very effective detection method

Can detect all burst of length < degree of polynomial

Detect other errors high prob.

Page 21: Frame Error Detection - Kasetsart Universityanan/myhomepage/wp... · ITU-16 x16 + x12 + x5 + 1 HDLC ITU-32 x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 +

21

CRC implementation

Ex-OR

Shift Register

Page 22: Frame Error Detection - Kasetsart Universityanan/myhomepage/wp... · ITU-16 x16 + x12 + x5 + 1 HDLC ITU-32 x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 +

22

16-bit CRC Hardware Implementation

Page 23: Frame Error Detection - Kasetsart Universityanan/myhomepage/wp... · ITU-16 x16 + x12 + x5 + 1 HDLC ITU-32 x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 +

23

Data Frame

CRCDataHeader

CRC Data Header

Page 24: Frame Error Detection - Kasetsart Universityanan/myhomepage/wp... · ITU-16 x16 + x12 + x5 + 1 HDLC ITU-32 x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 +

24

Summary

Transmission Errors

Error Detection Mechanism

Parity

Checksum

CRC