Reliability and Channel Coding

Slides:



Advertisements
Similar presentations
Computer Networking Error Control Coding
Advertisements

10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Introduction to Information Technologies
Chapter 10 Error Detection and Correction
Digital Fundamentals Floyd Chapter 2 Tenth Edition
7/2/2015Errors1 Transmission errors are a way of life. In the digital world an error means that a bit value is flipped. An error can be isolated to a single.
Reliability and Channel Coding
Unit 1 Protocols Learning Objectives: Understand the need to detect and correct errors in data transmission.
Error Detection and Correction
Hamming It Up with Hamming Codes CSE 461 Section Week 3.
Shashank Srivastava Motilal Nehru National Institute Of Technology, Allahabad Error Detection and Correction : Data Link Layer.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
COM342 Networks and Data Communications
Error Detection and Correction
PART III DATA LINK LAYER. Position of the Data-Link Layer.
Error Control Code. Widely used in many areas, like communications, DVD, data storage… In communications, because of noise, you can never be sure that.
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Practical Session 10 Error Detecting and Correcting Codes.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
COSC 3213: Computer Networks I Instructor: Dr. Amir Asif Department of Computer Science York University Section M Topics: 1. Error Detection Techniques:
Error Control Code. Widely used in many areas, like communications, DVD, data storage… In communications, because of noise, you can never be sure that.
AS Computing Data Transmission and Networks. Transmission error Detecting errors in data transmission is very important for data integrity. There are.
Error Detection and Correction
Overview All data can be corrupted, for reliable communications we must be able to detect and correct errors implemented at the data link and transport.
Error Detection and Correction
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Error Detection and Correction – Hamming Code
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 PART III: DATA LINK LAYER ERROR DETECTION AND CORRECTION 7.1 Chapter 10.
David Wetherall Professor of Computer Science & Engineering Introduction to Computer Networks Error Coding Overview (§3.2)
Transmission Errors Error Detection and Correction.
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Network Layer4-1 Chapter 5: The Data Link Layer Our goals: r understand principles behind data link layer services: m error detection, correction m sharing.
Data Link Layer 1. 2 Single-bit error 3 Multiple-bit error 4.
Practical Session 10 Computer Architecture and Assembly Language.
ERROR DETECTION AND CORRECTION Chapter 8 Data Communications & Networking ERROR DETECTION AND CORRECTION Chapter 8 First Semester 2007/2008.
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
Data Transmission and Networks Transmission error checking & correcting.
CS4470 Computer Networking Protocols
Simple Parity Check The simplest form of error detection is the parity check used with ASCII codes, originally on asynchronous modem links Each 7 bit ASCII.
Computer Architecture and Assembly Language
Introduction to Information Technologies
ERROR DETECTION AND CORRECTION
ERROR CORRECTING CODES
Subject Name: COMPUTER NETWORKS-1
Error Correcting Code.
Advanced Computer Networks
CIS 321 Data Communications & Networking
Representing characters
Even/odd parity (1) Computers can sometimes make errors when they transmit data. Even/odd parity: is basic method for detecting if an odd number of bits.
Part III Datalink Layer 10.
Packetizing Error Detection
Packetizing Error Detection
Chapter 3 Digital Transmission Fundamentals
Chapter 9 Error Detection and Correction
Dr. Clincy Professor of CS
Introduction to Information Technologies
Packetizing Error Detection
Protocols and the TCP/IP Suite
EEC-484/584 Computer Networks
COMPUTER NETWORKS CS610 Lecture-5 Hammad Khalid Khan.
Chapter 9 Error Detection and Correction
Error Detection and Correction
CS 325: CS Hardware and Software Organization and Architecture
Error Detection and Correction
Reliability and Channel Coding
Computer Architecture and Assembly Language
Error Detection and Correction
Error Detection and Correction
Error Detection Learning Objectives:
Presentation transcript:

Reliability and Channel Coding Chapter 8 Reliability and Channel Coding © Bobby Hoggard, Department of Computer Science, East Carolina University These slides may not be used or duplicated without permission

Hamming Algorithm An error-correcting algorithm with low overhead, that can correct one single-bit error Data Bits Check Bits Overhead 1 2 200% 2 - 4 3 150 - 75% 5 - 11 4 80 - 36% 12 - 26 5 42 - 19% 27 - 57 6 22 - 11% 58 - 120 7 12 - 6% 121 - 247 8 7 - 3%

Hamming Algorithm Overlapping Bits Data bits are protected by overlapping patterns of check bits Example - encode the 4-bit data value: 1100 Each circle represents a check bit (A, B, C) Data bits are places in positions where the circles overlap (thus, being protected by multiple check bits) The value of the check bit is set so that the total number of 1's in each circle is even or odd – depending on the parity chosen. (this example uses even parity) C A 1 1 1 B

Hamming Algorithm Verification The receiver must verify the correct parity of each circle (this example uses even parity) If a circle has the wrong parity, then an error has occurred Parity of circle A = Parity of circle B = Parity of circle C = ODD EVEN C A 1 1 1 the problem bit is located where the wrong parity circles overlap 1 To correct the problem: Change the bit to the opposite value Remove the parity bits B Data: 1100

What If Parity Bit Is Bad? If a parity bit is bad, then there will be only one circle with the wrong parity since the parity bits are found in the non-overlapping areas of the circle Parity of circle A = Parity of circle B = Parity of circle C = EVEN ODD C A 1 1 the problem bit is located only in circle B 1 1 B

What If More Than One Bit Is Bad? The algorithm is designed to correct only a single bit error in a single block of data Break the data into multiple blocks if more protection is needed Parity of circle A = Parity of circle B = Parity of circle C = ODD C A 1 the algorithm indicates that the problem bit is located where all three circles overlap FAIL! B

Encoding Example Encode the data: 1011 1000 1011 1110 16-bits data + 5 parity bits = 21 bit codeword (although you do not need to know this in advance) Step #1: Number the bits from left to right, starting with 1 1 0 1 1 1 0 0 0 1 0 1 1 1 1 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

Encoding Example Encode the data: 1011 1000 1011 1110 16-bits data + 5 parity bits = 21 bit codeword (although you do not need to know this in advance) Step #2: Insert place holders for parity bits; they go in position #s which are powers of 2 1 0 1 1 1 0 0 0 1 0 1 1 1 1 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

Encoding Example Encode the data: 1011 1000 1011 1110 16-bits data + 5 parity bits = 21 bit codeword (although you do not need to know this in advance) Step #2: Insert place holders for parity bits; they go in position #s which are powers of 2 - 1 0 1 1 1 0 0 0 1 0 1 1 1 1 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

Encoding Example Encode the data: 1011 1000 1011 1110 16-bits data + 5 parity bits = 21 bit codeword (although you do not need to know this in advance) Step #2: Insert place holders for parity bits; they go in position #s which are powers of 2 - - 1 0 1 1 1 0 0 0 1 0 1 1 1 1 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

Encoding Example Encode the data: 1011 1000 1011 1110 16-bits data + 5 parity bits = 21 bit codeword (although you do not need to know this in advance) Step #2: Insert place holders for parity bits; they go in position #s which are powers of 2 - - 1 - 0 1 1 1 0 0 0 1 0 1 1 1 1 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

Encoding Example Encode the data: 1011 1000 1011 1110 16-bits data + 5 parity bits = 21 bit codeword (although you do not need to know this in advance) Step #2: Insert place holders for parity bits; they go in position #s which are powers of 2 - - 1 - 0 1 1 - 1 0 0 0 1 0 1 1 1 1 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Encoding Example - - 1 - 0 1 1 - 1 0 0 0 1 0 1 - 1 1 1 1 0 Encode the data: 1011 1000 1011 1110 16-bits data + 5 parity bits = 21 bit codeword (although you do not need to know this in advance) Step #2: Insert place holders for parity bits; they go in position #s which are powers of 2 - - 1 - 0 1 1 - 1 0 0 0 1 0 1 - 1 1 1 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

Encoding Example - - 1 - 0 1 1 - 1 0 0 0 1 0 1 - 1 1 1 1 0 Encode the data: 1011 1000 1011 1110 16-bits data + 5 parity bits = 21 bit codeword (although you do not need to know this in advance) Step #3: Set the values of the parity bits so that each group's parity is even (or odd) - - 1 - 0 1 1 - 1 0 0 0 1 0 1 - 1 1 1 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

Encoding Example - - 1 - 0 1 1 - 1 0 0 0 1 0 1 - 1 1 1 1 0 Encode the data: 1011 1000 1011 1110 16-bits data + 5 parity bits = 21 bit codeword (although you do not need to know this in advance) Step #3: Set the values of the parity bits so that each group's parity is even (or odd) - - 1 - 0 1 1 - 1 0 0 0 1 0 1 - 1 1 1 1 0 - - 1 - 0 1 1 - 1 0 0 0 1 0 1 - 1 1 1 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Parity bit 1 belongs to this group: # of 1's in the group: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21 7 Parity bit should be: 1

Encoding Example Encode the data: 1011 1000 1011 1110 16-bits data + 5 parity bits = 21 bit codeword (although you do not need to know this in advance) Step #3: Set the values of the parity bits so that each group's parity is even (or odd) 1 - 1 - 0 1 1 - 1 0 0 0 1 0 1 - 1 1 1 1 0 1 - 1 - 0 1 1 - 1 0 0 0 1 0 1 - 1 1 1 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Parity bit 1 belongs to this group: # of 1's in the group: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21 7 Parity bit should be: 1

Encoding Example Encode the data: 1011 1000 1011 1110 16-bits data + 5 parity bits = 21 bit codeword (although you do not need to know this in advance) Step #3: Set the values of the parity bits so that each group's parity is even (or odd) 1 - 1 - 0 1 1 - 1 0 0 0 1 0 1 - 1 1 1 1 0 1 - 1 - 0 1 1 - 1 0 0 0 1 0 1 - 1 1 1 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Parity bit 2 belongs to this group: # of 1's in the group: 2, 3, 6, 7, 10, 11, 14, 15, 18, 19 6 Parity bit should be:

Encoding Example Encode the data: 1011 1000 1011 1110 16-bits data + 5 parity bits = 21 bit codeword (although you do not need to know this in advance) Step #3: Set the values of the parity bits so that each group's parity is even (or odd) 1 0 1 - 0 1 1 - 1 0 0 0 1 0 1 - 1 1 1 1 0 1 0 1 - 0 1 1 - 1 0 0 0 1 0 1 - 1 1 1 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Parity bit 2 belongs to this group: # of 1's in the group: 2, 3, 6, 7, 10, 11, 14, 15, 18, 19 6 Parity bit should be:

Encoding Example Encode the data: 1011 1000 1011 1110 16-bits data + 5 parity bits = 21 bit codeword (although you do not need to know this in advance) Step #3: Set the values of the parity bits so that each group's parity is even (or odd) 1 0 1 - 0 1 1 - 1 0 0 0 1 0 1 - 1 1 1 1 0 1 0 1 - 0 1 1 - 1 0 0 0 1 0 1 - 1 1 1 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Parity bit 4 belongs to this group: # of 1's in the group: 4, 5, 6, 7, 12, 13, 14, 15, 20, 21 5 Parity bit should be: 1

Encoding Example Encode the data: 1011 1000 1011 1110 16-bits data + 5 parity bits = 21 bit codeword (although you do not need to know this in advance) Step #3: Set the values of the parity bits so that each group's parity is even (or odd) 1 0 1 1 0 1 1 - 1 0 0 0 1 0 1 - 1 1 1 1 0 1 0 1 1 0 1 1 - 1 0 0 0 1 0 1 - 1 1 1 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Parity bit 4 belongs to this group: # of 1's in the group: 4, 5, 6, 7, 12, 13, 14, 15, 20, 21 5 Parity bit should be: 1

Encoding Example Encode the data: 1011 1000 1011 1110 16-bits data + 5 parity bits = 21 bit codeword (although you do not need to know this in advance) Step #3: Set the values of the parity bits so that each group's parity is even (or odd) 1 0 1 - 0 1 1 - 1 0 0 0 1 0 1 - 1 1 1 1 0 1 0 1 - 0 1 1 - 1 0 0 0 1 0 1 - 1 1 1 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Parity bit 8 belongs to this group: # of 1's in the group: 8, 9, 10, 11, 12, 13, 14, 15 3 Parity bit should be: 1

Encoding Example Encode the data: 1011 1000 1011 1110 16-bits data + 5 parity bits = 21 bit codeword (although you do not need to know this in advance) Step #3: Set the values of the parity bits so that each group's parity is even (or odd) 1 0 1 1 0 1 1 1 1 0 0 0 1 0 1 - 1 1 1 1 0 1 0 1 1 0 1 1 1 1 0 0 0 1 0 1 - 1 1 1 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Parity bit 8 belongs to this group: # of 1's in the group: 8, 9, 10, 11, 12, 13, 14, 15 3 Parity bit should be: 1

Encoding Example Encode the data: 1011 1000 1011 1110 16-bits data + 5 parity bits = 21 bit codeword (although you do not need to know this in advance) Step #3: Set the values of the parity bits so that each group's parity is even (or odd) 1 0 1 - 0 1 1 - 1 0 0 0 1 0 1 - 1 1 1 1 0 1 0 1 - 0 1 1 - 1 0 0 0 1 0 1 - 1 1 1 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Parity bit 16 belongs to this group: # of 1's in the group: 16, 17, 18, 19, 20, 21 4 Parity bit should be:

Encoding Example Encode the data: 1011 1000 1011 1110 16-bits data + 5 parity bits = 21 bit codeword (although you do not need to know this in advance) Step #3: Set the values of the parity bits so that each group's parity is even (or odd) 1 0 1 1 0 1 1 1 1 0 0 0 1 0 1 0 1 1 1 1 0 1 0 1 1 0 1 1 1 1 0 0 0 1 0 1 0 1 1 1 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Parity bit 16 belongs to this group: # of 1's in the group: 16, 17, 18, 19, 20, 21 4 Parity bit should be:

Encoding Example Encode the data: 1011 1000 1011 1110 16-bits data + 5 parity bits = 21 bit codeword (although you do not need to know this in advance) Hamming Codeword: 1 0 1 1 0 1 1 1 1 0 0 0 1 0 1 0 1 1 1 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

How To Determine The Bit Groups Method #1: Starting with the parity bit, put n bits in the group, then exclude the next n bits where n is the position number of the parity bit Hamming Codeword: 1 1 0 1 1 0 1 1 1 1 0 0 0 1 0 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 in 1 out 1 in 1 out 1 in 1 out 1 in 1 out 1 in 1 out 1 in 1 out 1 in 1 out 1 in 1 out 1 in 1 out 1 in 1 out 1 in Group 1: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21

How To Determine The Bit Groups Method #1: Starting with the parity bit, put n bits in the group, then exclude the next n bits where n is the position number of the parity bit Hamming Codeword: 1 1 0 1 1 0 1 1 1 1 0 0 0 1 0 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 in 2 out 2 in 2 out 2 in 2 out 2 in 2 out 2 in 2 out Group 1: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21 Group 2: 2, 3, 6, 7, 10, 11, 14, 15, 18, 19

How To Determine The Bit Groups Method #1: Starting with the parity bit, put n bits in the group, then exclude the next n bits where n is the position number of the parity bit Hamming Codeword: 1 0 1 1 0 1 1 1 1 0 0 0 1 0 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 4 in 4 out 4 in 4 out 4 in Group 1: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21 Group 2: 2, 3, 6, 7, 10, 11, 14, 15, 18, 19 Group 4: 4, 5, 6, 7, 12, 13, 14, 15, 20, 21

How To Determine The Bit Groups Method #1: Starting with the parity bit, put n bits in the group, then exclude the next n bits where n is the position number of the parity bit Hamming Codeword: 1 1 0 1 1 0 1 1 1 1 0 0 0 1 0 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 8 in 8 out Group 1: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21 Group 8: 8, 9, 10, 11, 12, 13, 14, 15 Group 2: 2, 3, 6, 7, 10, 11, 14, 15, 18, 19 Group 4: 4, 5, 6, 7, 12, 13, 14, 15, 20, 21

How To Determine The Bit Groups Method #1: Starting with the parity bit, put n bits in the group, then exclude the next n bits where n is the position number of the parity bit Hamming Codeword: 1 0 1 1 0 1 1 1 1 0 0 0 1 0 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 16 in 16 out Group 1: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21 Group 8: 8, 9, 10, 11, 12, 13, 14, 15 Group 2: 2, 3, 6, 7, 10, 11, 14, 15, 18, 19 Group 16: 16, 17, 18, 19, 20, 21 Group 4: 4, 5, 6, 7, 12, 13, 14, 15, 20, 21

How To Determine The Bit Groups Method #2: A bit, n, is in all parity bit groups where the parity bit position numbers add up to n A parity bit is in it's own group, and not found in any other groups Hamming Codeword: 1 0 1 1 0 1 1 1 1 0 0 0 1 0 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Group 1: 1 , 3 , 5 , 7 , 9 , 11 , 13 , 15 , 17 , 19 , 21 1 6=4+2 11=8+2+1 16 Group 2: 2 , 3 , 6 , 7 , 10 , 11 , 14 , 15 , 18 , 19 2 7=4+2+1 12=8+4 17=16+1 Group 4: 4 , 5 , 6 , 7 , 12 , 13 , 14 , 15 , 20 , 21 3=2+1 8 13=8+4+1 18=16+2 Group 8: 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 4 9=8+1 14=8+4+2 19=16+2+1 Group 16: 16 , 17 , 18 , 19 , 20 , 21 5=4+1 10=8+2 15=8+4+2+1 20=16+4 21=16+4+1

Reveiver Verification The receiver has received this Hamming codeword, and now needs to verify correctness Step #1: Check the parity of each group 1 1 0 1 1 0 1 1 1 0 0 0 0 1 0 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Group 1: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21 ODD

Reveiver Verification The receiver has received this Hamming codeword, and now needs to verify correctness Step #1: Check the parity of each group 1 0 1 1 0 1 1 1 0 0 0 0 1 0 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Group 1: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21 ODD Group 2: 2, 3, 6, 7, 10, 11, 14, 15, 18, 19 EVEN

Reveiver Verification The receiver has received this Hamming codeword, and now needs to verify correctness Step #1: Check the parity of each group 1 0 1 1 0 1 1 1 0 0 0 0 1 0 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Group 1: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21 ODD Group 2: 2, 3, 6, 7, 10, 11, 14, 15, 18, 19 EVEN Group 4: 4, 5, 6, 7, 12, 13, 14, 15, 20, 21 EVEN

Reveiver Verification The receiver has received this Hamming codeword, and now needs to verify correctness Step #1: Check the parity of each group 1 1 0 1 1 0 1 1 1 0 0 0 0 1 0 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Group 1: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21 ODD Group 2: 2, 3, 6, 7, 10, 11, 14, 15, 18, 19 EVEN Group 4: 4, 5, 6, 7, 12, 13, 14, 15, 20, 21 EVEN Group 8: 8, 9, 10, 11, 12, 13, 14, 15 ODD

Reveiver Verification The receiver has received this Hamming codeword, and now needs to verify correctness Step #1: Check the parity of each group 1 0 1 1 0 1 1 1 0 0 0 0 1 0 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Group 1: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21 ODD Group 2: 2, 3, 6, 7, 10, 11, 14, 15, 18, 19 EVEN Group 4: 4, 5, 6, 7, 12, 13, 14, 15, 20, 21 EVEN Group 8: 8, 9, 10, 11, 12, 13, 14, 15 ODD Group 16: 16, 17, 18, 19, 20, 21 EVEN

Reveiver Verification The receiver has received this Hamming codeword, and now needs to verify correctness Step #2: If any incorrect parities, the error bit is located where the groups overlap 1 0 1 1 0 1 1 1 0 0 0 0 1 0 1 0 1 1 1 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Group 1: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21 ODD Group 2: 2, 3, 6, 7, 10, 11, 14, 15, 18, 19 EVEN Bit Location: 9 8 + 1 = 9 Group 4: 4, 5, 6, 7, 12, 13, 14, 15, 20, 21 EVEN Group 8: 8, 9, 10, 11, 12, 13, 14, 15 ODD Group 16: 16, 17, 18, 19, 20, 21 EVEN

Reveiver Verification The receiver has received this Hamming codeword, and now needs to verify correctness Step #3: If there's an error bit, correct it by changing it to the opposite value 1 0 1 1 0 1 1 1 0 0 0 0 1 0 1 0 1 1 1 1 0 1 0 1 1 0 1 1 1 1 0 0 0 1 0 1 0 1 1 1 1 0 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Group 1: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21 ODD Group 2: 2, 3, 6, 7, 10, 11, 14, 15, 18, 19 EVEN Bit Location: 9 8 + 1 = 9 Group 4: 4, 5, 6, 7, 12, 13, 14, 15, 20, 21 EVEN Group 8: 8, 9, 10, 11, 12, 13, 14, 15 ODD Group 16: 16, 17, 18, 19, 20, 21 EVEN

Reveiver Verification The receiver has received this Hamming codeword, and now needs to verify correctness Step #4: Remove the parity bits 1 0 1 1 0 1 1 1 1 0 0 0 1 0 1 0 1 1 1 1 0 1 1 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 0 1 1 1 0 0 0 1 0 1 1 1 1 1 0 = original data

Row And Column (RAC) Parity Algorithm Another error-correcting algorithm that can correct one single-bit error Example - encode the 12-bit data value: 1011 0010 1010 using odd parity Step #1: Arrange the data bits into a 4 x 3 grid (grid size doesn't matter, as long as sender and receiver agree, and it should be relatively square) 1 0 1 1 0 0 1 0 1 0 1 0

RAC Parity Algorithm Another error-correcting algorithm that can correct one single-bit error Example - encode the 12-bit data value: 1011 0010 1010 using odd parity Step #2: Add a column of parity bits: the correct parity for each row 1 0 1 1 1 0 0 1 0 1 0 1 0

RAC Parity Algorithm Another error-correcting algorithm that can correct one single-bit error Example - encode the 12-bit data value: 1011 0010 1010 using odd parity Step #3: Add a row of parity bits: the correct parity for each column 1 0 1 1 1 0 0 1 0 1 0 1 0 1 1 Notice that there is no check bit for this row since the right most bit is the check bit for the parity column

RAC Parity Receiver Verification If any row or column has the wrong parity, then an error has occurred The error is located where the wrong parity row/column intersect Step #1: Check parity for each row and column 1 0 1 1 1 ODD 0 0 1 0 ODD 1 0 0 0 EVEN 1 1 ODD ODD ODD ODD EVEN

RAC Parity Receiver Verification If any row or column has the wrong parity, then an error has occurred The error is located where the wrong parity row/column intersect Step #2: Error bit is located where the wrong parity row/column intersect 1 0 1 1 1 ODD 0 0 1 0 ODD 1 0 0 0 EVEN 1 1 ODD ODD ODD ODD EVEN

RAC Parity Receiver Verification If any row or column has the wrong parity, then an error has occurred The error is located where the wrong parity row/column intersect Step #3: Change the bit to the opposite value 1 0 1 1 1 ODD 0 0 1 0 ODD 1 0 0 0 1 0 1 0 1 EVEN 1 1 ODD ODD ODD ODD EVEN

RAC Parity Receiver Verification If any row or column has the wrong parity, then an error has occurred The error is located where the wrong parity row/column intersect Step #4: Remove the parity bits 1 0 1 1 1 0 0 1 0 1 0 1 0 1 1

Which Is Better? Hamming Algorithm RAC Algorithm Analysis Both have the same capability but Hamming does it with less overhead Hamming Algorithm RAC Algorithm Can correct 1 single bit error Ability to correct errors Can correct 1 single bit error 5 # of check bits required for 12-bits of data 8 17 Codeword size for 12-bits of data 20 42% Overhead for 12-bits of data 67% 5 # of check bits required for 20-bits of data 10 25% Overhead for 20-bits of data 50%

Internet Checksum Algorithm Checksum: A sum computed from the bits in a data value for the purpose of detecting if an error has occurred during transmission The checksum is appended to the end of the data Checksums have the advantage that the sender and receiver can perform the same calculation on the data (don't have to write different algorithms for each end) The Internet checksum algorithm has the additional advantage that the checksum itself can be added into the computation on the receiving size, and if the computation produces an answer of zero, then no error has occurred

Internet Checksum Algorithm Checksum: A sum computed from the bits in a data value for the purpose of detecting if an error has occurred during transmission The checksum is appended to the end of the data Checksums have the advantage that the sender and receiver can perform the same calculation on the data (don't have to write different algorithms for each end) The Internet checksum algorithm has the additional advantage that the checksum itself can be added into the computation on the receiving size, and if the computation produces an answer of zero, then no error has occurred

Internet Checksum Algorithm Example - send this data: 0000 0000 1111 1110 0000 0000 0000 0101 (binary) 0 0 F E 0 0 0 5 (hexadecimal) Step #1: Group the data into 16-bit units 0000 0000 1111 1110 00FE 0000 0000 0000 0101 0005 (binary) (hex)

Internet Checksum Algorithm Example - send this data: 0000 0000 1111 1110 0000 0000 0000 0101 Step #2: Add the 16-bit groups 1 1 1 1 1 1 1 1 0000 0000 1111 1110 00FE + 0000 0000 0000 0101 0005 1 1 1 1 3

Internet Checksum Algorithm Example - send this data: 0000 0000 1111 1110 0000 0000 0000 0101 Step #3: If there's carry (>16-bit answer), add the carry to the sum 0000 0000 1111 1110 00FE + 0000 0000 0000 0101 0005 0000 0001 0000 0011 0103 There's no carry in this example

Internet Checksum Algorithm Example - send this data: 0000 0000 1111 1110 0000 0000 0000 0101 Step #4: Invert all the bits 0000 0001 0000 0011 0103 1111 1110 1111 1100 FEFC checksum

Internet Checksum Algorithm Example - send this data: 0000 0000 1111 1110 0000 0000 0000 0101 Step #5: Append checksum to end of data 0000 0000 1111 1110 0000 0000 0101 1111 1110 1111 1100 checksum 0 0 F E 0 0 0 5 F E F C

Internet Checksum Receiver Verification Example - Received data: 0000 0000 1111 1110 0000 0000 0000 0101 1111 1110 1111 1100 0 0 F E 0 0 0 5 F E F C Note: the verification algorithm is EXACTLY the same as the encoding algorithm Step #1: Group the data into 16-bit units (including the checksum) 0000 0000 1111 1110 00FE 0000 0000 0000 0101 0005 1111 1110 1111 1100 FEFC (binary) (hex)

Internet Checksum Receiver Verification Example - Received data: 0000 0000 1111 1110 0000 0000 0000 0101 1111 1110 1111 1100 0 0 F E 0 0 0 5 F E F C Step #2: Add the 16-bit groups 1 1 1 1 1 1 1 1 0000 0000 1111 1110 00FE 0000 0000 0000 0101 0005 + 1111 1110 1111 1100 FEFC 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 F F F F

Internet Checksum Receiver Verification Example - Received data: 0000 0000 1111 1110 0000 0000 0000 0101 1111 1110 1111 1100 0 0 F E 0 0 0 5 F E F C Step #3: If there's carry (>16-bit answer), add the carry to the sum 0000 0000 1111 1110 00FE 0000 0000 0000 0101 0005 + 1111 1110 1111 1100 FEFC 1111 1111 1111 1111 FFFF There's no carry in this example

Internet Checksum Receiver Verification Example - Received data: 0000 0000 1111 1110 0000 0000 0000 0101 1111 1110 1111 1100 0 0 F E 0 0 0 5 F E F C Step #4: Invert all the bits 1111 1111 1111 1111 FFFF 0000 0000 0000 0000 0000 If the answer is zero, then no error has occurred

Internet Checksum Algorithm Ex. 2 Example 2 - send this data: 0 1 0 0 F 2 0 3 F 4 F 5 F 6 F 7 Step #1: Group the data into 16-bit units 0100 F203 F4F5 F6F7

Internet Checksum Algorithm Ex. 2 Example 2 - send this data: 0 1 0 0 F 2 0 3 F 4 F 5 F 6 F 7 Step #2: Add the 16-bit groups 2 1 0100 F203 F4F5 + F6F7 2 D E E F

Internet Checksum Algorithm Ex. 2 Example 2 - send this data: 0 1 0 0 F 2 0 3 F 4 F 5 F 6 F 7 Step #3: If there's carry (>16-bit answer), add the carry to the sum 0100 F203 1 F4F5 DEEF + + F6F7 0002 2 D E E F D E F 1 carry sum

Internet Checksum Algorithm Ex. 2 Example 2 - send this data: 0 1 0 0 F 2 0 3 F 4 F 5 F 6 F 7 Step #4: Invert all the bits DEF1 1101 1110 1111 0001 210E 0010 0001 0000 1110

Internet Checksum Algorithm Ex. 2 Example 2 - send this data: 0 1 0 0 F 2 0 3 F 4 F 5 F 6 F 7 Step #5: Append checksum to end of data 0 1 0 0 F 2 0 3 F 4 F 5 F 6 F 7 2 1 0 E checksum

Internet Checksum Verification Ex. 2 Example 2 - received data: 0 1 0 0 F 2 0 3 F 4 F 5 F 6 F 7 2 1 0 E Step #1: Group the data into 16-bit units 0100 F203 F4F5 F6F7 210E Step #2: Add the 16-bit groups 0100 + F203 + F4F5 + F6F7 + 210E = 2 FFFD Step #3: If there's carry (>16-bit answer), add the carry to the sum 0002 + FFFD = FFFF Step #4: Invert all the bits FFFF 0000 No Error

Verification Ex. 3 – Multiple Bit Error Example 2 - received data: 0 1 0 7 F 2 0 3 E 4 F 5 F 6 F A 2 1 0 E (checksum didn't change) Step #1: Group the data into 16-bit units 0107 F203 E4F5 F6FA 210E Step #2: Add the 16-bit groups 0107 + F203 + E4F5 + F6FA + 210E = 2 F007 Step #3: If there's carry (>16-bit answer), add the carry to the sum 0002 + F007 = F009 Step #4: Invert all the bits F009 0FF6 This is a detection algorithm, not a correction algorithm – therefore, all we can do at this point is request the data again Error!