1 © Unitec New Zealand CRC calculation and Hammings code.

Slides:



Advertisements
Similar presentations
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Advertisements

Data and Computer Communications
NETWORKING CONCEPTS. ERROR DETECTION Error occures when a bit is altered between transmission& reception ie. Binary 1 is transmitted but received is binary.
Chapter 10 Error Detection and Correction
PART III DATA LINK LAYER. Position of the Data-Link Layer.
Practical Session 11 Codes. Hamming Distance General case: The distance between two code words is the amount of 1-bit changes required to reach from one.
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.
Unit 1 Protocols Learning Objectives: Understand the need to detect and correct errors in data transmission.
Error Detection and Correction
Error Detection and Correction Rizwan Rehman Centre for Computer Studies Dibrugarh University.
Chapter 10 Error Detection and Correction
Rutvi Shah1 ERROR CORRECTION & ERROR DETECTION Rutvi Shah2 Data can be corrupted during transmission. For reliable communication, errors must be detected.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 PART III: DATA LINK LAYER ERROR DETECTION AND CORRECTION 7.1 Chapter 10.
Shashank Srivastava Motilal Nehru National Institute Of Technology, Allahabad Error Detection and Correction : Data Link Layer.
Lecture 6 Topics Character codes Error Detection and Correction
It is physically impossible for any data recording or transmission medium to be 100% perfect 100% of the time over its entire expected useful life. As.
1 Data Link Layer Lecture 20 Imran Ahmed University of Management & Technology.
PART III DATA LINK LAYER. Position of the Data-Link Layer.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Data Link Layer PART III.
Error Coding Transmission process may introduce errors into a message.  Single bit errors versus burst errors Detection:  Requires a convention that.
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Data Link Layer: Error Detection and Correction
Lecture 6: Framing and Error Detection-Data Link Layer Functions
Data and Computer Communications Chapter 6 – Digital Data Communications Techniques.
Data and Computer Communications by William Stallings Eighth Edition Digital Data Communications Techniques Digital Data Communications Techniques Click.
Practical Session 10 Error Detecting and Correcting Codes.
Lecture 3-2: Coding and Error Control (Cont.) ECE
EEC4113 Data Communication & Multimedia System Chapter 5: Error Control by Muhazam Mustapha, October 2011.
Data Integrity © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Data Link Layer PART III.
COMPUTER NETWORKS Ms. Mrinmoyee Mukherjee Assistant Professor St. Francis Institute of Technology, Mount Poinsur, S.V.P Road, Borivli (west), Mumbai
Error Detection and Correction
Computer Communication & Networks Lecture 9 Datalink Layer: Error Detection Waleed Ejaz
CSCI 465 D ata Communications and Networks Lecture 9 Martin van Bommel CSCI 465 Data Communications & Networks 1.
Lecture Focus: Data Communications and Networking  Data Link Layer  Error Control Lecture 19 CSCS 311.
Error Detection.
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Review.
10.1 Chapter 10 Error Detection and Correction Data can be corrupted during transmission. Some applications require that errors be detected and.
Error Detection. Data can be corrupted during transmission. Some applications require that errors be detected and corrected. An error-detecting code can.
Error Detection and Correction
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 PART III: DATA LINK LAYER ERROR DETECTION AND CORRECTION 7.1 Chapter 10.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Data Link Layer PART III.
Hamming Distance & Hamming Code
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.
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.
Part III: Data Link Layer Error Detection and Correction
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.
Coding and Error Control
Dr. Clincy Professor of CS
Modulo-2 Digital coding uses modulo-2 arithmetic where addition becomes the following operations: 0+0= =0 0+1= =1 It performs the.
2.8 Error Detection and Correction
Error Detection & Correction
Computer Architecture and Assembly Language
ERROR DETECTION AND CORRECTION
Dr. Clincy Professor of CS
CIS 321 Data Communications & Networking
Error Detection and Correction
Part III Datalink Layer 10.
Error Detection Bit Error Rate(BER): It is the ratio of number Ne of errors appearing over a certain time interval t to the number Nt of 1 and 0 pulses.
EEC4113 Data Communication & Multimedia System Chapter 5: Error Control by Muhazam Mustapha, August 2010.
Error Detection and Correction
Computer Architecture and Assembly Language
Error Detection and Correction
2.8 Error Detection and Correction
Presentation transcript:

1 © Unitec New Zealand CRC calculation and Hammings code

CRC The cyclic redundancy check, or CRC, is a technique for detecting errors in digital data, but not for making corrections when errors are detected. It is used primarily in data transmission. The cyclic redundancy check, or CRC, is a technique for detecting errors in digital data, but not for making corrections when errors are detected. It is used primarily in data transmission 2 © Unitec New Zealand

CRC process 3 © Unitec New Zealand

Binary Division The CRC is based on binary division. In CRC a sequence of redundant bits, called the CRC or the CRC remainder is appended to the end of a data stream. The resulting data becomes exactly divisible by a second, predetermined binary number. In reference to the CRC data transmitted is termed frame transmitted 4 © Unitec New Zealand

Polynomial generator The Polynomial Generator is used to calculate a binary equivalent. – Present powers are identified as 1 and a absent powers as 0. A CRC Generator uses modulo-2 division. 5 © Unitec New Zealand

Example 1 The following is the procedure for sending the data below with the given polynomial generator. Data to be sent: Polynomial generator: x 4 + x Take the polynomial generator and work out its corresponding binary representation by identifying the absent powers Polynomial = x 4 + x 2 +1 = x x Divisor = ;this is the digital representation of the polynomial generator. 6 © Unitec New Zealand

2. A Frame Check Sequence (FCS) which equates to the highest power of the polynomial generator – (4 in the example above and represented as four zeros -0000). The FCS is added to the data resulting in 3. Ok so we now have the data to be sent which is and the polynomial generator which is x x or in its binary form and the Frame Check Sequence (FCS) which is Now all we need to do is get the CRC. The CRC is calculated by dividing the binary representation of the polynomial into the DATA + FCS using modulo-2 arithmetic. On the next slide is a table, which will help you out with modulo-2 arithmetic 7 © Unitec New Zealand

Modulo 2 arithmetic 8 © Unitec New Zealand Modulo 2 arithmetic is an XOR computation

example 9 © Unitec New Zealand Note as X 4 is the highest power in the polynomial generator So we have four 0’s in the FCS

Checking the CRC We calculated the CRC by dividing the binary representation of the polynomial into the data and the FCS. So we end up with 1001 which is the CRC. Now we have the CRC for the data which has been sent all that is left to do is check the CRC and find out if the data has been received correctly. We do this exactly like the CRC Generator. If the remainder is all 0s, the CRC is dropped and the data is not corrupted, if the remainder is not = 0s, the data is corrupted. 10 © Unitec New Zealand

Example CRC check 11 © Unitec New Zealand Note the remainder is 0000 after this calculation

Practice problems 1: Data: 11011; Polynomial x3+x2+1. What is the checksum? 2: Data: 11001; Polynomial x3+x2+1. What is the checksum? 3: Data: ; Polynomial x4+x2+1. What is the checksum? 12 © Unitec New Zealand

Hammings error code Hamming Code is type of Error Correcting Code (ECC) Provides error detection and correction mechanism Adopt parity concept, but have more than one parity bit In general hamming code is code word of n bits with m data bits and r parity (or check bits) i.e. n = m + r Can detect D(min) – 1 errors Can correct errors Hence to correct k errors, need D(min) = 2k + 1 Need a least a distance of 3 to correct a single bit error 13 © Unitec New Zealand

Hammings use of parity bits Hamming Code for single-bit error correction is the most commonly used Experiments (IBM study) show 98% time there are single-bit errors Need determine r for m-data bits that provides code words of n-bits that has single-bit correction capabilities 14 © Unitec New Zealand

Example: Generation of 12-bit Code word 8-bit data needs 4 parity bits, total of 12-bit code word Using our code words of length 12, number each bit position starting with 1 in the low-order bit Each bit position corresponding to power of 2 will be occupied by a parity or check bit All other bit positions are for the data to be encoded Each parity bit calculates the parity for some of the bits in the code word 15 © Unitec New Zealand

Example: location of parity bits in 12-bit Code word We then write each bit position, 1 through 12, in powers of 2 1 (= 20) contributes to all of the odd-numbered digits Hence parity at position 1 will based on bits in position 3, 5, 7,9, 11 And so on… 16 © Unitec New Zealand

Example: 12-bit Code word 17 © Unitec New Zealand 2 (= 21) contributes to positions 2, 3, 6, 7, 10, and 11 Position 2 will contain the parity for bits 3, 6, 7, 10, and 11 For the bit values shown, we have a parity value of 0 in the second bit position using even parity Even parity = XOR i.e. 0 ^ 1 ^ 0 ^ 0 ^ 1 = 0

Example: 12-bit Code word The completed code word is shown above: Bit 1 checks the positions 3, 5, 7, 9, and 11, so its value is 1 Bit 2 checks the positions 3, 6, 7, 10, and 11, so its value is 0 Bit 4 checks the positions 5, 6, 7, and 12, so its value is 1 Bit 8 checks the positions 9, 10, 11, and 12, so its value is also 1 18 © Unitec New Zealand

Using Hammings to identify an error Suppose an error occurs in bit 5, as shown above Our parity bit values are: Bit 1 checks positions, 3, 5, 7, 9, and 11. Its value is 1, but should be 0. Bit 2 checks positions 3, 6, 7, 10, and 11. The zero is correct. Bit 4 checks positions 5, 6, 7, and 12. Its value is 1, but should be 0 Bit 8 checks positions 9, 10, 11, and 12. This bit is correct. 19 © Unitec New Zealand

Parity bits 1 and 4 both check position 5 and 7 Since parity bit 2 checks bit 7 and indicates no error occurred in the subset of bits it checked that means that error occurred in bit 5 If we change bit 5 to a 1, all parity bits check and our data is restored 20 © Unitec New Zealand Example: 12-bit Code word