Winter 2007CS244a Handout 141 CS244a: An Introduction to Computer Networks Handout 14: Error Detection and Correction Nick McKeown Professor of Electrical.

Slides:



Advertisements
Similar presentations
Noise, Information Theory, and Entropy (cont.) CS414 – Spring 2007 By Karrie Karahalios, Roger Cheng, Brian Bailey.
Advertisements

Computer Interfacing and Protocols
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Introduction to Information Technologies
Data and Computer Communications
CSE 461: Error Detection and Correction. Next Topic  Error detection and correction  Focus: How do we detect and correct messages that are garbled during.
Reliability & Channel Coding
Transmission Errors Error Detection and Correction
Chapter 10 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.
CSCI 4550/8556 Computer Networks Comer, Chapter 7: Packets, Frames, And Error Detection.
PART III DATA LINK LAYER. Position of the Data-Link Layer.
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 12 Introduction to Computer Networks.
EE 122: Error detection and reliable transmission Ion Stoica September 16, 2002.
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 11 Introduction to Computer Networks.
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.
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
Error Detection and Reliable Transmission EECS 122: Lecture 24 Department of Electrical Engineering and Computer Sciences University of California Berkeley.
Error Detection and Correction Rizwan Rehman Centre for Computer Studies Dibrugarh University.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 PART III: DATA LINK LAYER ERROR DETECTION AND CORRECTION 7.1 Chapter 10.
Transmission Errors Error Detection and Correction
Data link layer: services
Lecture 10: Error Control Coding I Chapter 8 – Coding and Error Control From: Wireless Communications and Networks by William Stallings, Prentice Hall,
PART III DATA LINK LAYER. Position of the Data-Link Layer.
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.
Part 2: Packet Transmission Packets, frames Local area networks (LANs) Wide area networks (LANs) Hardware addresses Bridges and switches Routing and protocols.
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 Link Layer. Data Link Layer Design Issues Services Provided to the Network Layer Framing Error Control Flow Control.
Data and Computer Communications by William Stallings Eighth Edition Digital Data Communications Techniques Digital Data Communications Techniques Click.
ECE453 – Introduction to Computer Networks Lecture 4 – Data Link Layer (I)
David Wetherall Professor of Computer Science & Engineering Introduction to Computer Networks Error Detection (§3.2.2)
Computer Science Division
Computer Networks Lecture 2: Data Link Based on slides from D. Choffnes Northeastern U. and P. Gill from StonyBrook University Revised Autumn 2015 by S.
Error Detection and Correction
Computer Communication & Networks Lecture 9 Datalink Layer: Error Detection Waleed Ejaz
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 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.
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.
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
Chi-Cheng Lin, Winona State University CS412 Introduction to Computer Networking & Telecommunication Error Correction/Detection.
ERROR DETECTION AND CORRECTION Chapter 8 Data Communications & Networking ERROR DETECTION AND CORRECTION Chapter 8 First Semester 2007/2008.
Introduction to Information Technologies
Error Detection and Correction
Subject Name: COMPUTER NETWORKS-1
Communication Networks: Technology & Protocols
: An Introduction to Computer Networks
Advanced Computer Networks
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.
Introduction to Information Technologies
Error Detection Neil Tang 9/26/2008
Protocols and the TCP/IP Suite
Error Detection and Correction
Chapter 10 Error Detection and Correction
Presentation transcript:

Winter 2007CS244a Handout 141 CS244a: An Introduction to Computer Networks Handout 14: Error Detection and Correction Nick McKeown Professor of Electrical Engineering and Computer Science, Stanford University

Winter 2007CS244a Handout 142 Outline  Basic ideas: BER, PER and Hamming Distance  Parity  Error Detection: Cyclic Redundancy Codes  Error Correction  Error Detection versus Correction

Winter 2007CS244a Handout 143 Errors  A bit error occurs when a source sends a bit, b, and the destination receives NOT b.  The error can take place on the link (e.g. EM interference, or signal loss), in a (malfunctioning) switch or router along the path, or in the source or destination (e.g. failed hardware, or bit errors in memories).  The bit error rate (BER) tells us the probability of any given bit being in error. Typical values are BER = for an electrical link, and for an optical link.

Winter 2007CS244a Handout 144 Bit error rate An example Assume an N-bit packet, with known BER and independent errors: Packet Error Rate = PER = 1 – (1 – BER) N PER ~= N (BER) if N (BER) << 1 e.g. N = 10 4, BER = = PER = In practice, bit errors occur in bursts:  Perhaps caused by mechanical switches that switch slowly relative to a bit-time.  If a bit is in error, it is likely that the next bit is in error too. Therefore, bit errors are not independent.  So for a given BER, PER < N (BER)

Winter 2007CS244a Handout 145 Detecting and Correcting Errors  When we transmit a message, we typically append a checksum to the message.  The checksum is calculated by performing a function over all the bits in the message.  For example, the Internet (IP and TCP) checksum is a 16-bit ones-complement sum of the data.  What sort of errors can we expect it to catch?

Winter 2007CS244a Handout 146 Detecting Errors  The IP and TCP checksum will catch any burst error or 15 or fewer bits.  In general, it will catch approximately 1 in 2 16 of all possible errors. (Why?)  As we will see, stronger checksums are possible.  Q: In general, can we design a checksum that will always catch errors?

Winter 2007CS244a Handout 147 Encoding to detect errors  We use codes to help us detect errors.  The set of possible messages is mapped by a function onto the set of codes.  We pick the mapping function so that it is easy to detect errors among the resulting codes.  Example: Consider the function that duplicates each bit in the message. E.g. the message would be mapped to the code , and then transmitted by the sender. The receiver knows that bits always come in pairs. If the two bits in a pair are different, it declares that there was a bit error.  Of course, this code is quite inefficient…

Winter 2007CS244a Handout 148

Winter 2007CS244a Handout 149 Hamming Distance Number of bits that differ between two codes e.g In our example code (replicated bits), all codes have at least two bits different from every other code. Therefore, it has a Hamming distance of 2. HD=3

Winter 2007CS244a Handout 1410 Hamming Distance To reliably detect a d-bit error: HD > d To reliably correct a d-bit error: HD > 2d HD = min (d ij ) d 23 ij Set of codes

Winter 2007CS244a Handout 1411 Parity: A simple error detecting code Parity added to 1s even/odd If parity is wrong ERROR If parity is rightNO ERROR (or an even number of errors has occurred) Q: What is the minimum Hamming distance for this code?

Winter 2007CS244a Handout 1412

Winter 2007CS244a Handout 1413

Error Detection CRC (Cyclic Redundancy Check) Winter 2007CS244a Handout 1414  A convenient representation:  If, for example, M = ,  then M(x) = x 3 + x + 1

Winter 2007CS244a Handout 1415

Winter 2007CS244a Handout 1416 Error Detection Cyclic Redundancy Code (CRC) T M m R MSB i.e. T = M.2 r + R Modulo-2 addition (XOR) r

Winter 2007CS244a Handout 1417 Cyclic Redundancy Code (CRC) 1.Choose R to maximize the Pr{detecting error} 2.Agree on G, a generator. 3.Choose R such that T = AxG, for some A. 4.Transmit T. 5.On reception, check that T = AxG. So, T = T + E = AxG + E R? OK? Additive Error, E Receive, T = T + E Message, M Or ErrorIndication Message, M Transmit, T = M.2 r + R

Winter 2007CS244a Handout 1418

Winter 2007CS244a Handout 1419

Winter 2007CS244a Handout 1420 Cyclic Redundancy Code (CRC) Choosing G is critical to detecting errors. In general, G is chosen to: 1.Detect single-bit errors. 2.Detect any 2 single-bit errors. 3.Detect burst errors. 4.Detect other errors not considered here… Since: T = T + E = AxG + E If E(mod)G = 0 then error is not detected.

Winter 2007CS244a Handout 1421Winter 2007CS244a Handout 1421 Transmitter T Since: T = T + E = AxG + E If E(mod)G = 0 then error is not detected. T Receiver

Winter 2007CS244a Handout 1422 Cyclic Redundancy Code (CRC) (i)Detecting Single-bit errors. Single-bit errors can be represented as: E(x) = x i If G(x) = x k + x j, i.e. G(x) has 2 terms, then since G(x) cannot divide E(x): ALL single bit errors can be detected.

Winter 2007CS244a Handout 1423 Cyclic Redundancy Code (CRC) (ii) Two isolated errors can be represented as: E(x) = x i + x j = x j (x i-j + 1), where i-j > 1 If (x k + 1) is not a factor of G(x) for any k>1 then G(x) does not divide E(x), and so ALL two-bit errors are detected. (iii) Detecting an odd number of errors Theorem: If (x + 1) is a factor of G(x) then: ALL odd errors are detected. Proof by contradiction: Assume E has odd # of 1’s and (x + 1) is a factor of E(x): i.e. E(x) = (x +1)E’ (x) for some E’ (x)

Winter 2007CS244a Handout 1424 Cyclic Redundancy Code (CRC) iii) Proof (cont.) We can evaluate E(x) for x=0 or x=1. Evaluating E(x) for x=1: E(1) = (1 + 1) E’(1) = 0 But E has an odd # of 1’s so : E (1) = 1 Therefore, if E has an odd # of 1’s, it is not divisible by (x + 1)

Winter 2007CS244a Handout 1425

Winter 2007CS244a Handout 1426 Cyclic Redundancy Code (CRC) (iv) Bursts up to length r (degree of G) Burst of length k: x i (x k-i + …+1) If G(x) is of the form …+x o then: x i is not a factor (v) Longer bursts are not guaranteed to be detected. (vi) In general, an r-bit generator can detect 1 in 2 r errors. An example of a widely used 16-bit CRC generator: CRC-CCITT = x 16 + x 12 + x 5 + 1

Winter 2007CS244a Handout 1427 Calculating a CRC Example: M= , G = R T =

Winter 2007CS244a Handout 1428 Circuit for Calculating CRC +++ g2g2 g1g1 g0g0 M T R G(x) = g 0 + g 1 x + … + g L-1 x L-1 Multiplier

Winter 2007CS244a Handout 1429 Error Correction Common code used: Bose-Chaudhuri-Hocquenghem (BCH) MR BCH (R + M, M, t) e.g. BCH (1023, 923, 10) Can detect all “t” bit errors If t=1 then the code is called Reed-Solomon and is used in CD players

Winter 2007CS244a Handout 1430 Detect or Correct? Advantages of Error Detection  Requires smaller number of bits/overhead.  Requires less/simpler processing. Advantages of Error Correction  Reduces number of retransmissions. Most data networks today use error detection, not error correction.

Winter 2007CS244a Handout 1431 Detect or Correct? An example Assume: 1. Packets are of lengths 923 bits 2. PER = Overhead of Error Correction: Assume we use: BCH (1023, 923, 10) Therefore, we send 923 data bits as 1023 bits. Overhead of Error Detection: Assume we use: 32-bit CRC; one retransmission per error. Therefore, we send 923 data bits as 955 bits. Transmission Overhead = ~= 10% Transmission Overhead = ~= 3% ( )