SlideShare uma empresa Scribd logo
1 de 53
Data Link Layer:
Error Detection and
Correction
Data Communication and
Computer Networks
Adapted from lecture slides by Behrouz A. Forouzan
© The McGraw-Hill Companies, Inc. All rights reserved
2
Outline
 Overview of Data Link Layer
 Types of errors
 Redundancy
 Correction vs. detection
 Coding
3
Data Link Layer
4
Error Control
 Detecting errors
 Correcting errors
 Forward error correction
 Automatic repeat request
5
Types of Errors
 Single-bit errors
 Burst errors
6
Redundancy
 To detect or correct errors, redundant bits
of data must be added
7
Coding
 Process of adding redundancy for error detection
or correction
 Two types:
 Block codes
 Divides the data to be sent into a set of blocks
 Extra information attached to each block
 Memoryless
 Convolutional codes
 Treats data as a series of bits, and computes a code over a
continuous series
 The code computed for a set of bits depends on the current
and previous input
8
XOR Operation
 Main operation for computing error
detection/correction codes
 Similar to modulo-2 addition
9
Block Coding
 Message is divided into k-bit blocks
 Known as datawords
 r redundant bits are added
 Blocks become n=k+r bits
 Known as codewords
10
Example: 4B/5B Block Coding
Data Code Data Code
0000 11110 1000 10010
0001 01001 1001 10011
0010 10100 1010 10110
0011 10101 1011 10111
0100 01010 1100 11010
0101 01011 1101 11011
0110 01110 1110 11100
0111 01111 1111 11101
k = ?
r = ?
n = ?
11
Error Detection in Block Coding
12
Notes
 An error-detecting code can detect
only the types of errors for which it is
designed
 Other types of errors may remain undetected.
 There is no way to detect every possible
error
13
Error Correction
14
Example: Error Correction Code
The receiver receives 01001, what is the original dataword?
k, r, n = ?
15
Hamming Distance
 d(01, 00) = ?
 d(11, 00) = ?
 d(010, 100) = ?
 d(0011, 1000) = ?
 How many 8-bit words are n bits away
from 10000111?
Hamming Distance between two words is the
number of differences between corresponding bits.
16
Minimum Hamming Distance
 Find the minimum Hamming Distance of
the following codebook
The minimum Hamming distance is the
smallest Hamming distance between
all possible pairs in a set of words.
00000
01011
10101
11110
17
Detection Capability of Code
 To guarantee the detection of up to s-bit
errors, the minimum Hamming distance in
a block code must be
dmin = s + 1
18
Correction Capability of Code
 To guarantee the correction of up to t-bit
errors, the minimum Hamming distance in
a block code must be
dmin = 2t + 1
19
Example: Hamming Distance
 A code scheme has a Hamming distance
dmin = 4. What is the error detection and
correction capability of this scheme?
20
Common Detection Methods
 Parity check
 Cyclic Redundancy Check
 Checksum
21
Parity Check
 Most common, least complex
 Single bit is added to a block
 Two schemes:
 Even parity – Maintain even number of 1s
 E.g., 1011  10111
 Odd parity – Maintain odd number of 1s
 E.g., 1011  10110
22
Example: Parity Check
Suppose the sender wants to send the word world. In
ASCII the five characters are coded (with even parity) as
1110111 1101111 1110010 1101100 1100100
The following shows the actual bits sent
11101110 11011110 11100100 11011000 11001001
23
Example: Parity Check
Receiver receives this sequence of words:
11111110 11011110 11101100 11011000 11001001
Which blocks are accepted? Which are rejected?
24
Parity-Check: Encoding/Decoding
25
Performance of Parity Check
 Can 1-bit errors be detected?
 Can 2-bit errors be detected?
 :
26
2D Parity Check
What is its performance?
27
2D Parity Check: Performance
28
2D Parity Check: Performance
29
Cyclic Redundancy Check
 In a cyclic code, rotating a codeword
always results in another codeword
 Example:
30
CRC Encoder/Decoder
31
CRC Generator
32
Checking CRC
33
Polynomial Representation
 More common representation than binary form
 Easy to analyze
 Divisor is commonly called generator polynomial
34
Division Using Polynomial
35
Strength of CRC
 Can be analyzed using polynomial
 M(x) – Original message
 G(x) – Generator polynomial of degree n
 R(x) – Generated CRC
 Transmitted message is
M(x)xn – R(x)
which is divisible by G(x)
M(x)xn = Q(x)G(x) + R(x)
36
Strength of CRC
 Received message is
M(x)xn – R(x) + E(x)
where E(x) represents bit errors
 Receiver does not detect any error when
E(x) is divisible by G(x), which means
either:
 E(x) 0  No error
 E(x)  0  Undetectable error
37
Strength of CRC
 If G(x) contains at least two terms, then
all single-bit errors can be detected
 If G(x) cannot divide xt + 1 (0 t < n), then
all isolated double errors can be detected
 If G(x) contains a factor of (x+1), all odd-
numbered errors can be detected
38
Properties of Good Polynomial
 It should have at least two terms
 The coefficient of the term x0 should be 1
 It should not divide xt + 1, for t between 2
and n − 1
 It should have the factor x + 1
39
CRC's Strength Summary
 All burst errors with L ≤ n will be detected
 All burst errors with L = n + 1 will be
detected with probability 1 – (1/2)n–1
 All burst errors with L > n + 1 will be
detected with probability 1 – (1/2)n
40
Example: CRC Generators
 Which of the following polynomials
guarantees that a single-bit error can be
detected
(a) x+1
(b) x3
(c) 1
41
Example: CRC Generators
 Criticize the following CRC generators
 x3
 x10 + x9 + x5
 x6+1
42
Standard Polynomials
43
Error Correction
 Two methods
 Retransmission after detecting error
 Forward error correction (FEC)
44
Forward Error Correction
 Consider only a single-bit error in k bits of data
 k possibilities for an error
 One possibility for no error
 #possibilities = k + 1
 Add r redundant bits to distinguish these
possibilities; we need
2r  k+1
 But the r bits are also transmitted along with
data; hence
2r  k+r+1
45
Number of Redundant Bits
Number of
data bits
k
Number of
redundancy bits
r
Total
bits
k + r
1 2 3
2 3 5
3 3 6
4 3 7
5 4 9
6 4 10
7 4 11
46
Hamming Code
 Simple, powerful FEC
 Widely used in computer memory
 Known as ECC memory
error-correcting bits
47
Redundant Bit Calculation
48
Example: Hamming Code
49
Example: Correcting Error
 Receiver receives 10010100101
50
Strength of Hamming Code
 Minimum Hamming Distance is 3
 It can correct at most 1 bit error
 It can detect at most 2 bit error
 But… not both!!! (Why?)
 SECDED – Extended Hamming code with
one extra parity bit
 Achieves minimum Hamming distance of 4
 Can distinguish between one bit and two bit
errors
51
Burst Error Correction
Assignment 4
52
Problem Set:
P10-3, P10-7, P10-9, P10-15
Due on Next Lecture 10-09-2016
Assignment 5
53
Try hamming code given in Chapter 10
Due on Next Lecture 10-06-2015

Mais conteúdo relacionado

Semelhante a 13-DataLink_02.ppt

DCN Error Detection & Correction
DCN Error Detection & CorrectionDCN Error Detection & Correction
DCN Error Detection & CorrectionRohan Bhatkar
 
Error Detection and correction concepts in Data communication and networks
Error Detection and correction concepts in Data communication and networksError Detection and correction concepts in Data communication and networks
Error Detection and correction concepts in Data communication and networksNt Arvind
 
Digital Communication: Channel Coding
Digital Communication: Channel CodingDigital Communication: Channel Coding
Digital Communication: Channel CodingDr. Sanjay M. Gulhane
 
M.TECH, ECE 2nd SEM LAB RECORD
M.TECH, ECE 2nd SEM LAB RECORD M.TECH, ECE 2nd SEM LAB RECORD
M.TECH, ECE 2nd SEM LAB RECORD Arif Ahmed
 
第四次课程 Chap8
第四次课程 Chap8第四次课程 Chap8
第四次课程 Chap8Emma2013
 
Presentation for the Project on VLSI and Embedded
Presentation for the Project on VLSI and EmbeddedPresentation for the Project on VLSI and Embedded
Presentation for the Project on VLSI and Embeddedlthanuja01
 
02 ldpc bit flipping_decoding_dark knight
02 ldpc bit flipping_decoding_dark knight02 ldpc bit flipping_decoding_dark knight
02 ldpc bit flipping_decoding_dark knightDevanshi Piprottar
 
Chapter 10: Error Correction and Detection
Chapter 10: Error Correction and DetectionChapter 10: Error Correction and Detection
Chapter 10: Error Correction and DetectionJeoffnaRuth
 
Encoder for (7,3) cyclic code using matlab
Encoder for (7,3) cyclic code using matlabEncoder for (7,3) cyclic code using matlab
Encoder for (7,3) cyclic code using matlabSneheshDutta
 
Review paper on Reed Solomon (204,188) Decoder for Digital Video Broadcasting...
Review paper on Reed Solomon (204,188) Decoder for Digital Video Broadcasting...Review paper on Reed Solomon (204,188) Decoder for Digital Video Broadcasting...
Review paper on Reed Solomon (204,188) Decoder for Digital Video Broadcasting...IRJET Journal
 
computer networks Error Detection Methods.pdf
computer networks Error Detection Methods.pdfcomputer networks Error Detection Methods.pdf
computer networks Error Detection Methods.pdfBalasubramanian699229
 
An Efficient Interpolation-Based Chase BCH Decoder
An Efficient Interpolation-Based Chase BCH DecoderAn Efficient Interpolation-Based Chase BCH Decoder
An Efficient Interpolation-Based Chase BCH Decoderijsrd.com
 
New error-detection (2)
New error-detection (2)New error-detection (2)
New error-detection (2)Nitesh Singh
 
New error-detection
New error-detectionNew error-detection
New error-detectionNitesh Singh
 
CRC implementation
CRC implementation CRC implementation
CRC implementation ajay singh
 

Semelhante a 13-DataLink_02.ppt (20)

DCN Error Detection & Correction
DCN Error Detection & CorrectionDCN Error Detection & Correction
DCN Error Detection & Correction
 
Error Detection and correction concepts in Data communication and networks
Error Detection and correction concepts in Data communication and networksError Detection and correction concepts in Data communication and networks
Error Detection and correction concepts in Data communication and networks
 
Digital Communication: Channel Coding
Digital Communication: Channel CodingDigital Communication: Channel Coding
Digital Communication: Channel Coding
 
M.TECH, ECE 2nd SEM LAB RECORD
M.TECH, ECE 2nd SEM LAB RECORD M.TECH, ECE 2nd SEM LAB RECORD
M.TECH, ECE 2nd SEM LAB RECORD
 
BCH Codes
BCH CodesBCH Codes
BCH Codes
 
第四次课程 Chap8
第四次课程 Chap8第四次课程 Chap8
第四次课程 Chap8
 
B0210714
B0210714B0210714
B0210714
 
ADC_13_Error_Corc.ppt
ADC_13_Error_Corc.pptADC_13_Error_Corc.ppt
ADC_13_Error_Corc.ppt
 
Hamming code system
Hamming code systemHamming code system
Hamming code system
 
Presentation for the Project on VLSI and Embedded
Presentation for the Project on VLSI and EmbeddedPresentation for the Project on VLSI and Embedded
Presentation for the Project on VLSI and Embedded
 
Chapter 10
Chapter 10Chapter 10
Chapter 10
 
02 ldpc bit flipping_decoding_dark knight
02 ldpc bit flipping_decoding_dark knight02 ldpc bit flipping_decoding_dark knight
02 ldpc bit flipping_decoding_dark knight
 
Chapter 10: Error Correction and Detection
Chapter 10: Error Correction and DetectionChapter 10: Error Correction and Detection
Chapter 10: Error Correction and Detection
 
Encoder for (7,3) cyclic code using matlab
Encoder for (7,3) cyclic code using matlabEncoder for (7,3) cyclic code using matlab
Encoder for (7,3) cyclic code using matlab
 
Review paper on Reed Solomon (204,188) Decoder for Digital Video Broadcasting...
Review paper on Reed Solomon (204,188) Decoder for Digital Video Broadcasting...Review paper on Reed Solomon (204,188) Decoder for Digital Video Broadcasting...
Review paper on Reed Solomon (204,188) Decoder for Digital Video Broadcasting...
 
computer networks Error Detection Methods.pdf
computer networks Error Detection Methods.pdfcomputer networks Error Detection Methods.pdf
computer networks Error Detection Methods.pdf
 
An Efficient Interpolation-Based Chase BCH Decoder
An Efficient Interpolation-Based Chase BCH DecoderAn Efficient Interpolation-Based Chase BCH Decoder
An Efficient Interpolation-Based Chase BCH Decoder
 
New error-detection (2)
New error-detection (2)New error-detection (2)
New error-detection (2)
 
New error-detection
New error-detectionNew error-detection
New error-detection
 
CRC implementation
CRC implementation CRC implementation
CRC implementation
 

Último

Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxRosabel UA
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxruthvilladarez
 

Último (20)

Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptx
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docx
 

13-DataLink_02.ppt

  • 1. Data Link Layer: Error Detection and Correction Data Communication and Computer Networks Adapted from lecture slides by Behrouz A. Forouzan © The McGraw-Hill Companies, Inc. All rights reserved
  • 2. 2 Outline  Overview of Data Link Layer  Types of errors  Redundancy  Correction vs. detection  Coding
  • 4. 4 Error Control  Detecting errors  Correcting errors  Forward error correction  Automatic repeat request
  • 5. 5 Types of Errors  Single-bit errors  Burst errors
  • 6. 6 Redundancy  To detect or correct errors, redundant bits of data must be added
  • 7. 7 Coding  Process of adding redundancy for error detection or correction  Two types:  Block codes  Divides the data to be sent into a set of blocks  Extra information attached to each block  Memoryless  Convolutional codes  Treats data as a series of bits, and computes a code over a continuous series  The code computed for a set of bits depends on the current and previous input
  • 8. 8 XOR Operation  Main operation for computing error detection/correction codes  Similar to modulo-2 addition
  • 9. 9 Block Coding  Message is divided into k-bit blocks  Known as datawords  r redundant bits are added  Blocks become n=k+r bits  Known as codewords
  • 10. 10 Example: 4B/5B Block Coding Data Code Data Code 0000 11110 1000 10010 0001 01001 1001 10011 0010 10100 1010 10110 0011 10101 1011 10111 0100 01010 1100 11010 0101 01011 1101 11011 0110 01110 1110 11100 0111 01111 1111 11101 k = ? r = ? n = ?
  • 11. 11 Error Detection in Block Coding
  • 12. 12 Notes  An error-detecting code can detect only the types of errors for which it is designed  Other types of errors may remain undetected.  There is no way to detect every possible error
  • 14. 14 Example: Error Correction Code The receiver receives 01001, what is the original dataword? k, r, n = ?
  • 15. 15 Hamming Distance  d(01, 00) = ?  d(11, 00) = ?  d(010, 100) = ?  d(0011, 1000) = ?  How many 8-bit words are n bits away from 10000111? Hamming Distance between two words is the number of differences between corresponding bits.
  • 16. 16 Minimum Hamming Distance  Find the minimum Hamming Distance of the following codebook The minimum Hamming distance is the smallest Hamming distance between all possible pairs in a set of words. 00000 01011 10101 11110
  • 17. 17 Detection Capability of Code  To guarantee the detection of up to s-bit errors, the minimum Hamming distance in a block code must be dmin = s + 1
  • 18. 18 Correction Capability of Code  To guarantee the correction of up to t-bit errors, the minimum Hamming distance in a block code must be dmin = 2t + 1
  • 19. 19 Example: Hamming Distance  A code scheme has a Hamming distance dmin = 4. What is the error detection and correction capability of this scheme?
  • 20. 20 Common Detection Methods  Parity check  Cyclic Redundancy Check  Checksum
  • 21. 21 Parity Check  Most common, least complex  Single bit is added to a block  Two schemes:  Even parity – Maintain even number of 1s  E.g., 1011  10111  Odd parity – Maintain odd number of 1s  E.g., 1011  10110
  • 22. 22 Example: Parity Check Suppose the sender wants to send the word world. In ASCII the five characters are coded (with even parity) as 1110111 1101111 1110010 1101100 1100100 The following shows the actual bits sent 11101110 11011110 11100100 11011000 11001001
  • 23. 23 Example: Parity Check Receiver receives this sequence of words: 11111110 11011110 11101100 11011000 11001001 Which blocks are accepted? Which are rejected?
  • 25. 25 Performance of Parity Check  Can 1-bit errors be detected?  Can 2-bit errors be detected?  :
  • 26. 26 2D Parity Check What is its performance?
  • 27. 27 2D Parity Check: Performance
  • 28. 28 2D Parity Check: Performance
  • 29. 29 Cyclic Redundancy Check  In a cyclic code, rotating a codeword always results in another codeword  Example:
  • 33. 33 Polynomial Representation  More common representation than binary form  Easy to analyze  Divisor is commonly called generator polynomial
  • 35. 35 Strength of CRC  Can be analyzed using polynomial  M(x) – Original message  G(x) – Generator polynomial of degree n  R(x) – Generated CRC  Transmitted message is M(x)xn – R(x) which is divisible by G(x) M(x)xn = Q(x)G(x) + R(x)
  • 36. 36 Strength of CRC  Received message is M(x)xn – R(x) + E(x) where E(x) represents bit errors  Receiver does not detect any error when E(x) is divisible by G(x), which means either:  E(x) 0  No error  E(x)  0  Undetectable error
  • 37. 37 Strength of CRC  If G(x) contains at least two terms, then all single-bit errors can be detected  If G(x) cannot divide xt + 1 (0 t < n), then all isolated double errors can be detected  If G(x) contains a factor of (x+1), all odd- numbered errors can be detected
  • 38. 38 Properties of Good Polynomial  It should have at least two terms  The coefficient of the term x0 should be 1  It should not divide xt + 1, for t between 2 and n − 1  It should have the factor x + 1
  • 39. 39 CRC's Strength Summary  All burst errors with L ≤ n will be detected  All burst errors with L = n + 1 will be detected with probability 1 – (1/2)n–1  All burst errors with L > n + 1 will be detected with probability 1 – (1/2)n
  • 40. 40 Example: CRC Generators  Which of the following polynomials guarantees that a single-bit error can be detected (a) x+1 (b) x3 (c) 1
  • 41. 41 Example: CRC Generators  Criticize the following CRC generators  x3  x10 + x9 + x5  x6+1
  • 43. 43 Error Correction  Two methods  Retransmission after detecting error  Forward error correction (FEC)
  • 44. 44 Forward Error Correction  Consider only a single-bit error in k bits of data  k possibilities for an error  One possibility for no error  #possibilities = k + 1  Add r redundant bits to distinguish these possibilities; we need 2r  k+1  But the r bits are also transmitted along with data; hence 2r  k+r+1
  • 45. 45 Number of Redundant Bits Number of data bits k Number of redundancy bits r Total bits k + r 1 2 3 2 3 5 3 3 6 4 3 7 5 4 9 6 4 10 7 4 11
  • 46. 46 Hamming Code  Simple, powerful FEC  Widely used in computer memory  Known as ECC memory error-correcting bits
  • 49. 49 Example: Correcting Error  Receiver receives 10010100101
  • 50. 50 Strength of Hamming Code  Minimum Hamming Distance is 3  It can correct at most 1 bit error  It can detect at most 2 bit error  But… not both!!! (Why?)  SECDED – Extended Hamming code with one extra parity bit  Achieves minimum Hamming distance of 4  Can distinguish between one bit and two bit errors
  • 52. Assignment 4 52 Problem Set: P10-3, P10-7, P10-9, P10-15 Due on Next Lecture 10-09-2016
  • 53. Assignment 5 53 Try hamming code given in Chapter 10 Due on Next Lecture 10-06-2015