Transmission Errors Error Detection and Correction.

Slides:



Advertisements
Similar presentations
Introduction to Information Technologies
Advertisements

Reliability & Channel Coding
Error Detection and Correction
Transmission Errors Error Detection and Correction
Chapter 10 Error Detection and Correction
ELEN 602 Lecture 4 Review of last lecture –Communication basics More on transmission media Errors in Transmission.
Error Detection and Correction
Fundamentals of Computer Networks ECE 478/578 Lecture #4: Error Detection and Correction Instructor: Loukas Lazos Dept of Electrical and Computer Engineering.
Error Detection and Correction
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 12 Introduction to Computer Networks.
Transmission Errors1 Error Detection and Correction.
The Data Link Layer Chapter 3. Position of the data-link layer.
EE 122: Error detection and reliable transmission Ion Stoica September 16, 2002.
The OSI Reference Model
Error detection and correction
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.
Error Detection and Correction
Adapted from Tanenbaum's Slides for Computer Networking, 4e The Data Link Layer Chapter 3.
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.
Shashank Srivastava Motilal Nehru National Institute Of Technology, Allahabad Error Detection and Correction : Data Link Layer.
Transmission Errors Error Detection and Correction
18-Aug-154/598N: Computer Networks Overview Direct link networks –Error detection - Section 2.4 –Reliable transmission - Section 2.5.
Channel Coding and Error Control
Lecture 10: Error Control Coding I Chapter 8 – Coding and Error Control From: Wireless Communications and Networks by William Stallings, Prentice Hall,
1 Data Link Layer Lecture 20 Imran Ahmed University of Management & Technology.
PART III DATA LINK LAYER. Position of the Data-Link Layer.
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 1 Communication Reliability Asst. Prof. Chaiporn Jaikaeo, Ph.D.
CIT 307 Online Data Communications Error Detection Module 11 Kevin Siminski, Instructor.
Error Coding Transmission process may introduce errors into a message.  Single bit errors versus burst errors Detection:  Requires a convention that.
CSC 535 Communication Networks I Section 3.8 Error Detection and Correction Dr. Cheer-Sun Yang.
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 14.
Data Link Layer: Error Detection and Correction
Lecture 6: Framing and Error Detection-Data Link Layer Functions
Chapter 3 Digital Transmission Fundamentals Line Coding Error Detection and Correction.
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.
COSC 3213: Computer Networks I Instructor: Dr. Amir Asif Department of Computer Science York University Section M Topics: 1. Error Detection Techniques:
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Data Link Layer PART III.
Computer Communication & Networks Lecture 9 Datalink Layer: Error Detection Waleed Ejaz
CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.
1 © Unitec New Zealand CRC calculation and Hammings code.
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 Data can be corrupted during transmission. Some applications require that errors be detected and.
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.
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.
Practical Session 10 Computer Architecture and Assembly Language.
Coding and Error Control
Lecture 4 Error Detecting and Correcting Techniques Dr. Ghalib A. Shah
Introduction to Information Technologies
Data Link Layer Objective: to achieve reliable and efficient communication between 2 adjacent machines Data link layer design issues services provided.
Subject Name: COMPUTER NETWORKS-1
Part III Datalink Layer 10.
Chapter 3 Digital Transmission Fundamentals
Basic concepts Networks must be able to transfer data from one device to another with complete accuracy. Data can be corrupted during transmission. For.
Chapter 7 Error Detection and Correction
Introduction to Information Technologies
Data Link Layer Objective: to achieve reliable and efficient communication between 2 adjacent machines Data link layer design issues services provided.
Transmission Errors Error Detection and Correction
Error Detection Neil Tang 9/26/2008
Data Link Layer Objective: to achieve reliable and efficient communication between 2 adjacent machines Data link layer design issues services provided.
Error Detection and Correction
Error Detection and Correction
Error Detection and Correction
Transmission Errors Error Detection and Correction
Presentation transcript:

Transmission Errors Error Detection and Correction

Transmission Errors Outline Error Detection V.S. Error Correction Hamming Distances and Codes Parity Checksum Polynomial Codes Cyclic Redundancy Checking (CRC) Properties for Detecting Errors with Generating Polynomials Advanced Computer Networks Transmission Errors2

3 reliable delivery unreliable communication channels Error control mechanisms are techniques (e.g., Checksum, CRC) that enable reliable delivery of data over unreliable communication channels Error Control

Error Detection and Correction Error detection detectinggarbled messages ◦ Error detection refers to a class of techniques for detecting garbled messages ExtraOccurance ◦ Adding some Extra bits to detect Occurance of error ◦ Not enough to detect the position of errors Error correction ◦ Adding enough redundant bits to deduce what the correct bits are expensivehard ◦ Error Correction are too expensive and hard Advanced Computer Networks Transmission Errors4

Error Detection and Correction Error Detection +ARQ Error Detection + ARQ Automatic Repeat reQuest (ARQ) Automatic Repeat reQuest (ARQ) ◦ When only Error Detection is possible ◦ Error is detected ◦ At data link layer, information is automatically resent Types of ARQ protocols Types of ARQ protocols ◦ Stop-and-wait ARQ ◦ Go-Back-N ARQ ◦ Selective Repeat ARQ ◦ Sliding Window Advanced Computer Networks Transmission Errors5

Error Detection and Correction ARQ ARQ Automatic Repeat Query ◦ A.K.A Automatic Repeat Query Acknowledgement Ack ◦ Using Acknowledgement (Ack) (Ack is the messages sent by receiver indicating the correction of reception) Timeout ◦ Using Timeout (A specified time period of time allowed to elapse before an acknowledgment is to be received) automaticallyre-transmits ◦ Sender automatically re-transmits the frame/packet until the reception of acknowledgement (or exceeds a predefined number of re-transmissions) Advanced Computer Networks Transmission Errors6

Error Detection and Correction Single error V.S. Burst error Errors Errors ◦ Single-bit error  Only one bit  Only one bit in the given data is in error  Easy to correct ◦ Burst error  Two or more (continuous) first corrupted  Two or more (continuous) bits from a data are in error. The length of burst is measured from the first corrupted bit to the last one  Very common  Hard to correct Advanced Computer Networks Transmission Errors7

Error Detection and Correction Single error V.S. Burst error Example: Example: ◦ Error rate= ◦ Frame size=1000 bits 100 ◦ Message length= 100 frame 100 ◦ Burst error length=100 bits ◦ Single bit error  All frames  All frames might be corrupted averagely ◦ Burst error  Only one frame  Only one frame is corrupted averagely Advanced Computer Networks Transmission Errors8

Hamming Codes Code Word A legal data word consisting of m data bits and r redundant bits. Code System The set of all code words Code Word Distance The number of bit positions in which two code words differ Code System Distance Smallest The Smallest (minimum possible) distance between every pair of words of a code system. Advanced Computer Networks Transmission Errors9

Hamming Codes Error Detection Mechanism ◦ Comparison of received message with code system Matches ◦ If it Matches a code word There is no error (not always) Else Error is detected ◦ Some errors change a legal code to another legal code (not detected) ◦ Correction to the nearest legal code, if possible Advanced Computer Networks Transmission Errors10

x = codewords o = non-codewords x x x x x x x o o o o o o o o o o o o x x x x x x x o o o o o o o o o o o o poor A code with poor distance properties good A code with good distance properties (a) (b) Hamming Distance 11 a legal code word to an illegal Error detection is possible only if the error changes a legal code word to an illegal

Hamming Codes d To detect d single-bit errors, a (d+1) code distance is needed d(d-1) ◦ In a code system with distance d, (d-1)-bits errors can be detected at most. ◦ Example: Code distance= single bit error (illegal) two bit errors (illegal) three bit errors (illegal) legal four bit errors (legal) Advanced Computer Networks Transmission Errors12

Hamming Codes d(2d+1) To correct d single-bit errors, a (2d+1) code distance is needed. d  (d-1)/2  - ◦ In a code system with distance d,  (d-1)/2  -bits errors can be corrected at most. Example: Example: Code Distance= 5 Detect & Correct Can Detect & Correct 1, 2 errors Detect Not correct Can Detect but Not correct 3,4 errors Can't Detect Can't Detect 5 errors. Advanced Computer Networks Transmission Errors13

Error Detection mm+r r If data is m bit and total number of bits is m+r, then to correct single bit errors r is defined as 2 r  m + r + 1 (why?) Example: m =7smallest r 4 For m = 7(ASCII), the smallest r value that can satisfy above equation is  Advanced Computer Networks Transmission Errors14

Hamming Code Advanced Computer Networks Transmission Errors15 Positions of Redundant bits in Hamming Code Example for 7 bits data r 1 = bits [3, 5, 7, 9, 11] r 2 = bits [3, 6, 7, 10, 11] r 4 = bits [5, 6, 7] r 8 = bits [9, 10, 11]

Hamming Code Calculation of Redundant Bits Advanced Computer Networks Transmission Errors16

Hamming Code Calculation of Redundant Bits Advanced Computer Networks Transmission Errors17

Hamming Code Error Detection & Correction Advanced Computer Networks Transmission Errors18 R1R1 R2R2

Hamming Code Error Detection & Correction Advanced Computer Networks Transmission Errors19 R3R3 R4R4

Hamming Code Error Detection & Correction Advanced Computer Networks Transmission Errors20 R 4 R 3 R 2 R 1 (m+r) The binary number R 4 R 3 R 2 R 1 represents the position of the happened error in sequence (m+r) bit.

Row Parity bits for each Row Single Parity Check Code Horizontal Parity Check Advanced Computer Networks Transmission Errors21 Even Parity Check for each row XOR Parity bit=XOR of all data bits Odd Detection of all Odd bit errors Even Detection of Even bit errors is impossible Error detection rate=50%

Column Check bit for each Column Row check bits for each Row Two-dimensional Parity Check Code Horizontal Vertical Parity Check Advanced Computer Networks Transmission Errors22

Two errors One error Three errors Four errors Multiple Errors Advanced Computer Networks Transmission Errors23

Checksum Advanced Computer Networks Transmission Errors24 Kn Data is divided into K sections (words), each of n bits K All K sections are added (discarding any overflow) Checksum Checksum= Two's complement of the total Receiver adds all the words including the checksum no error If the result is a word full of zeros, there is no error Otherwise, error is detected.

Checksum Advanced Computer Networks Transmission Errors25 Example: ABC Data=ABC A=65 (0041), B=66(0042), C=67(0043) Checksum= =198 Or =00C6 003A Checksum= 003A 003A Transmitting data= 0041, 0042, 0043, 003A

Polynomial Codes A polynomial can be represented by a binary word Each bit from right to left is mapped onto a power term. The rightmost bit represents the “0” power term. The bit next to it the “1” power term, etc. If the bit is of value zero, the power term is deleted from the expression. Advanced Computer Networks Transmission Errors26

CRC Codeword n bit codeword Advanced Computer Networks Transmission Errors27 k information bits n-k check bits

Polynomial Codes k-1 k-bit A polynomial of degree k-1 can be represented by a k-bit bit string i At each position i Bit 0=Coefficient 0x Bit 1=Coefficient x (i-1) i k-1 i k-2 i 1 i 0 i(x) = i k-1 x k-1 + i k-2 x k-2 + … + i 1 x + i 0 Example: i(x) = x 6 + x 4 + x Advanced Computer Networks Transmission Errors28

Polynomial Notation check bits) Let the codeword be n bits with k bits information bits and n-k redundant bits (check bits). n-k We need a generator polynomial g(x) of degree n-k of the form g(x) = 1 x n-k + g n-k-1 x n-k-1 + g n-k-2 x n-k-2 +… + g 1 x + 1 first and last Note – the first and last coefficient are always 1. Advanced Computer Networks Transmission Errors29

Addition: Multiplication: Division: x 3 + x + 1 ) x 6 + x 5 x 3 + x 2 + x x 6 + x 4 + x 3 x 5 + x 4 + x 3 x 5 + x 3 + x 2 x 4 + x 2 x 4 + x 2 + x x = q(x) quotient = r(x) remainder divisor dividend Polynomial Arithmetic Module 2 Arithemetic Advanced Computer Networks Transmission Errors30

CRC Algorithm CRC Steps: 1) Multiply i(x) by x n-k Putting zeros in (n-k) low order positions i(x).x n-k 2) Dividing i(x).x n-k by g(x) i(x).x n-k 3) Adding remainder r(x) to i(x).x n-k i(x). x n-k + r(x) = g(x) q(x) Advanced Computer Networks Transmission Errors31 transmitted codeword b(x) = i(x). x n-k + r(x) quotient remainder i(x). x n-k = g(x) q(x) + r(x)

CRC Algorithm / b(x) / g(x)=0 b(x) is dividable by g(x) y(x) Let y(x) denotes the received Data at receiver e(x) Let e(x) denotes the Error mixed with sent data y(x)=b(x)+e(x) y(x)=b(x)+e(x) (message with error) y(x)/g(x)= b(x)/g(x)+e(x)/g(x) y(x)/g(x)= b(x)/g(x)+e(x)/g(x) b(x)/g(x) First term b(x)/g(x) is divisible by definition e(x)/g(x) e(x)/g(x) determines the error. Advanced Computer Networks Transmission Errors32

CRC Algorithm In a cyclic code, e(x)/g(x) ≠ 0 ◦ If e(x)/g(x) ≠ 0, one or more bits is corrupted. e(x)/g(x) = 0 ◦ If e(x)/g(x) = 0,  No bit is corrupted generator failed  Some bits are corrupted, but the generator failed to detect them generator polynomial Choosing a generator polynomial by which a larger number of errors are detected is of great importance. Advanced Computer Networks Transmission Errors33

CRC Algorithm Generator polynomial Generator polynomial catch all single-bit errors, if It has more than one term Coefficient of x 0 is 1 Example (x+1)Note: x i (x + 1) (x + 1) No polynomial x i is divisible by (x + 1). Therefore, single-bit errors can be caught by the generator having factor (x + 1). ( why? ) Advanced Computer Networks Transmission Errors34

CRC Example Information: (1,1,0,0) i(x) = x 3 + x 2 g(x) = x 3 + x + 1 Generator polynomial: g(x) = x 3 + x + 1 Encoding: i(x).x 3 = x 6 + x 5 Advanced Computer Networks Transmission Errors ) x 3 + x + 1 x 3 + x + 1 ) x 6 + x 5 x 3 + x 2 + x x 6 + x 4 + x 3 x 5 + x 4 + x 3 x 5 + x 3 + x 2 x 4 + x 2 x 4 + x 2 + x x Transmitted codeword: b(x) = i(x).x 3 + r(x)= x 6 + x 5 + x b = ( 1,1,0,0,0,1,0 ) 010

Advanced Computer Networks Transmission Errors36 CRC Example Information: Generator: (x 4 +x+1) Transmitted Data:

e(x) = x i 0  i  n-1 1. Single bit errors: e(x) = x i 0  i  n-1 single-bit i th e(x) = x i b(x) If a single-bit error happens at i th position of the sent message, error e(x) = x i is added to the message b(x) y(x)=b(x)+ x i Received message y(x)=b(x)+ x i b(x) is dividable by g(x) b(x) is dividable by g(x) y(x)/g(x)=e(x)= x i y(x)/g(x)=e(x)= x i X i X i shows the position of the error position Advanced Computer Networks Transmission Errors37 Detecting Errors

Advanced Computer Networks Transmission Errors38 Detecting Errors Single–bit error CRC Coding Information=1001 g(x)=1011 r(x)=110 b(x)=

Advanced Computer Networks Transmission Errors39 Detecting Errors Single–bit error No Error y(x)= g(x)=1011 Y(x)/g(x)=0 e(x)=000

Advanced Computer Networks Transmission Errors40 Detecting Errors Single–bit error Single error at position 3 0 y(x)= g(x)=1011 y(x)/g(x)=011 e(x)=x 3

e(x)= x i +x j 0  i < j  n-1 2. Double bit errors: e(x)= x i +x j 0  i < j  n-1 What kind of generator polynomial is capable of detecting isolated double-bit errors? Why? Advanced Computer Networks Transmission Errors41 Detecting Errors

3. Odd number of bit errors: ◦ If an odd number of errors happen in the message, polynomial of the error has odd number of terms. ◦ ◦ For examplee(x)=x 5 +x 2 +1 ◦ For example: Error e(x)=x 5 +x 2 +1 (x+1) ◦ A generator that contains a factor of (x+1) can detect all odd-numbered errors ( why? ). Advanced Computer Networks Transmission Errors42 Detecting Errors

Burst errors: 4. Burst errors: r Let r be the number of redundant bits l Let l be the length of the burst error m and n m<n If burst error happens between bits m and n, where m<n e(x)=x n +…+x m (n-m+1=l) e(x)=x n +…+x m (n-m+1=l) All burst errors with length ◦ L ≤ r ◦ L ≤ r is always detected ◦ L=r+11–(1/2) r–1 ◦ L=r+1 is detected with probability 1–(1/2) r–1 ◦ L>r+11–(1/2) r ◦ L>r+1 is detected with probability 1–(1/2) r Advanced Computer Networks Transmission Errors43 Detecting Errors

Standard Generating Polynomials Advanced Computer Networks Transmission Errors44 A good polynomial generator needs to have the following characteristics: 1. It should have at least two terms. 2. The coefficient of the term x 0 should be 1. x t It should not divide x t + 1 (x + 1) 4. It should have the factor (x + 1).

Standard Generating Polynomials Advanced Computer Networks Transmission Errors45 CRC-8: CRC-10: CRC-16: CRC-CCITT: CRC-32:

Transmission Errors Summary Error Detection versus Error Correction Hamming Distances and Codes Parity Internet Checksum Polynomial Codes Cyclic Redundancy Checking (CRC) Properties for Detecting Errors with Generating Polynomials Advanced Computer Networks Transmission Errors46