Error Detection and Reliable Transmission EECS 122: Lecture 24 Department of Electrical Engineering and Computer Sciences University of California Berkeley.

Slides:



Advertisements
Similar presentations
EE 4272Spring, 2003 Chapter 7 Data Link Control Objectives: Effective & reliable data communication between two directly connected transmitting-receiving.
Advertisements

CSE 461: Error Detection and Correction. Next Topic  Error detection and correction  Focus: How do we detect and correct messages that are garbled during.
EEC-484/584 Computer Networks
Spring 2002CS 4611 Outline Encoding Framing Error Detection Sliding Window Algorithm Point-to-Point Links.
EEC-484/584 Computer Networks Lecture 7 Wenbing Zhao
Fundamentals of Computer Networks ECE 478/578 Lecture #4: Error Detection and Correction Instructor: Loukas Lazos Dept of Electrical and Computer Engineering.
EEC-484/584 Computer Networks Lecture 6 Wenbing Zhao
PART III DATA LINK LAYER. Position of the Data-Link Layer.
EE 122: Error detection and reliable transmission Ion Stoica September 16, 2002.
1 Outline Encoding Framing Error Detection Sliding Window Algorithm Point-to-Point Links.
EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao
Error detection and correction
Chapter 2 : Direct Link Networks (Continued). So far... Modulation and Encoding Link layer protocols Error Detection -- Parity Check.
EEC-484/584 Computer Networks Lecture 7 Wenbing Zhao (Part of the slides are based on materials supplied by Dr. Louise Moser at UCSB and.
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.
EEC-484/584 Computer Networks Lecture 7 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
EEC-484/584 Computer Networks Lecture 7 Wenbing Zhao
Error Detection and Correction Rizwan Rehman Centre for Computer Studies Dibrugarh University.
Lecture 10: Error Control Coding I Chapter 8 – Coding and Error Control From: Wireless Communications and Networks by William Stallings, Prentice Hall,
Data Link Layer - 1 Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS School of Computing, UNF.
1 Data Link Layer Lecture 20 Imran Ahmed University of Management & Technology.
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.
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 14.
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)
CS3505: DATA LINK LAYER. data link layer  phys. layer subject to errors; not reliable; and only moves information as bits, which alone are not meaningful.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Data Link Layer PART III.
Computer Science Division
T. S. Eugene Ngeugeneng at cs.rice.edu Rice University1 COMP/ELEC 429 Introduction to Computer Networks Lecture 12: Reliability Slides used with permissions.
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.
Computer Communication & Networks Lecture 9 Datalink Layer: Error Detection Waleed Ejaz
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.
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.
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.
ERROR DETECTION AND CORRECTION Chapter 8 Data Communications & Networking ERROR DETECTION AND CORRECTION Chapter 8 First Semester 2007/2008.
1 University of Calgary CS 441 Part 3 The Data Link Layer 3.1 Framing & Error Control 3.2 Error & Flow Control.
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.
Data Link Layer.
Communication Networks: Technology & Protocols
Advanced Computer Networks
CIS 321 Data Communications & Networking
Chapter 10 Error Detection And Correction
Detecting and Correcting Bit Errors
Packetizing Error Detection
Packetizing Error Detection
Chapter 7 Error Detection and Correction
EEC-484/584 Computer Networks
Packetizing Error Detection
EEC-484/584 Computer Networks
Error Detection and Correction
Types of Errors Data transmission suffers unpredictable changes because of interference The interference can change the shape of the signal Single-bit.
EECS 122: EE122: Error Detection and Reliable Transmission
Data Link Layer. Position of the data-link layer.
Presentation transcript:

Error Detection and Reliable Transmission EECS 122: Lecture 24 Department of Electrical Engineering and Computer Sciences University of California Berkeley

April 17, 2003 A. Parekh, EE122 S2003. Revised and enhanced F'02 Lectures 2 Today Focus on a Link Layer function  Bits need to be sent over a link in frames  Bits may be corrupted in transit E.g. send 111 but 110 is received Issues:  How can the destination tell that bits have been corrupted? Error Detection  What schemes will ensure that the correct bits are received? Retransmission Schemes (already covered this)  Stop and Wait  Go back n Error Correcting Codes

April 17, 2003 A. Parekh, EE122 S2003. Revised and enhanced F'02 Lectures 3 Two hosts, want to communicate over a bidirectional link Physical Medium → Virtual Bit Pipe XXXXXX Modem RS232-C Interface Interface wires Modem RS232-C Interface Interface wires Synchronous unreliable bit pipe Physical Layer Physical Medium Synchronous But… Communication must be reliable Bits generated asynchronously Example: Manchester Encoding

April 17, 2003 A. Parekh, EE122 S2003. Revised and enhanced F'02 Lectures 4 Physical Interface Synchronous unreliable bit pipe Data Link Control Layer Physical Medium → Virtual Bit Pipe → Data Link XXXXXX Data Link Control Data Link Control Asynchronous reliable bit pipe Data Link Protocol Two hosts, want to communicate asynchronously and reliably over a bidirectional link Physical Link FHData Bit Stream 1.Frame the data 2.Number frames 3.Send CRC 4.Retransmit if required Frames Example: SONET

April 17, 2003 A. Parekh, EE122 S2003. Revised and enhanced F'02 Lectures 5 Error Detection at higher layers Overlays: The “link” layer can actually involve many physical links When a network is considered to be reliable, it may make sense to do error detection end- to-end rather than on every link When a link is unreliable it makes sense to do error detection at layer 3 so that routers can check for bad headers without having to worry about the payload

April 17, 2003 A. Parekh, EE122 S2003. Revised and enhanced F'02 Lectures 6 Error detection The frame consists of a header and payload If all n-bit strings are valid payload strings, the error detection must occur in the header bits Break the header into two parts Error detecting code part contains bits that add redundancy Payload Header Payload EDCFH n bits k bits n bits

April 17, 2003 A. Parekh, EE122 S2003. Revised and enhanced F'02 Lectures 7 Error Detecting Codes Goals:  Reduce overhead, i.e., reduce the number of redundancy bits  Increase the number and the type of bit error patterns that can be detected Examples:  Even Parity  Rectangular Codes  Cyclic Redundancy Check (CRC)

April 17, 2003 A. Parekh, EE122 S2003. Revised and enhanced F'02 Lectures 8 Even Parity Check EDC field has 1 bit Sender: If number of 1’s in payload is odd, the check bit is 1, else it is 0 Receiver: Accept the packet if payload number of 1’s match the value of the check bit. Can detect an odd number of bit errors

April 17, 2003 A. Parekh, EE122 S2003. Revised and enhanced F'02 Lectures 9 Two-dimensional Parity Add one extra bit to a 7-bit code such that the number of 1’s in the resulting 8 bits is even (for even parity, and odd for odd parity) Add a parity byte for the packet Example: five 7-bit character packet, even parity

April 17, 2003 A. Parekh, EE122 S2003. Revised and enhanced F'02 Lectures 10 How Many Errors Can you Detect? All 1-bit errors Example: error bit odd number of 1’s Can detect AND correct 1-bit errors

April 17, 2003 A. Parekh, EE122 S2003. Revised and enhanced F'02 Lectures 11 How Many Errors Can you Detect? All 2-bit errors Example: error bits odd number of 1’s on column

April 17, 2003 A. Parekh, EE122 S2003. Revised and enhanced F'02 Lectures 12 How Many Errors Can you Detect? All 3-bit errors Example: error bits odd number of 1’s on column

April 17, 2003 A. Parekh, EE122 S2003. Revised and enhanced F'02 Lectures 13 How Many Errors Can you Detect? Most 4-bit errors Example of 4-bit error that is not detected: error bits

April 17, 2003 A. Parekh, EE122 S2003. Revised and enhanced F'02 Lectures 14 Burst Errors Often errors occur in bursts, i.e. successive bits are corrupted.  Many detecting/correcting schemes fail Use an interleaving trick… Suppose we 4 code words to send  , ,111111, Send position 1 of each codeword, then position 2 of each codeword etc.  A burst of 4 errors looks like 4 single bit errors to each of the code words!

April 17, 2003 A. Parekh, EE122 S2003. Revised and enhanced F'02 Lectures 15 Cyclic Redundancy Check Codes (CRC) Very popular error detection code Efficient Implementations in HW and SW Represent the payload as a polynomial The EDC bits are generated by dividing the payload polynomial by another special polynomial called the generator. The generator can be picked to ensure that a variety of different errors are detected.

April 17, 2003 A. Parekh, EE122 S2003. Revised and enhanced F'02 Lectures 16 Cyclic Redundancy Check (CRC) Represent a n-bit payload by an polynomial P(x)  E.g.,  P(x) = x 7 + x 5 + x 3 + x 2 + x 0 Choose a generator k-degree polynomial G(x) Compute remainder R(x) of P(x)*x k / G(x)  Note that P(x)*x k represents the the payload shifted to the left by k places  E.g. If P(x)=x 7 + x 5 + x 3 + x 2 + x 0 and k=2 then P(x)*x k = x 9 + x 7 + x 5 + x 4 + x 2  The EDC bits are derived from -R(x)  A-B in binary is a bitwise XOR  E.g. If k=2 and R(x)=1 then EDC bits are 00 – 01 = 01

April 17, 2003 A. Parekh, EE122 S2003. Revised and enhanced F'02 Lectures 17 CRC T(x) = M(x)*x k - R(x)  T(x) is divisible by C(x)  First n coefficients of T(x) represent M(x)  E.g. If P(x)=x 7 + x 5 + x 3 + x 2 + x 0,R(x)=x+1, k=2 then T(x) = x 9 + x 7 + x 5 + x 4 + x 2 +1 Sender:  Compute and send T(x), i.e., the coefficients of T(x) Receiver:  Let T’(x) is what he gets  If C(x) divides T’(x)  no errors; otherwise errors

April 17, 2003 A. Parekh, EE122 S2003. Revised and enhanced F'02 Lectures 18 Computing R(x) Compute the reminder R(x) of P(x)*x k / G(x) T(x) = P(x)*x k - R(x) Example: send packet , assume G(x) = 101  k = 2, P(x)*x K   Compute R(x)  T(x) = P(x)*x k - R(x)  xor 1 = ) R(x)

April 17, 2003 A. Parekh, EE122 S2003. Revised and enhanced F'02 Lectures 19 Check at the receiver 101) No errors

April 17, 2003 A. Parekh, EE122 S2003. Revised and enhanced F'02 Lectures 20 Properties of CRCs Detect all single-bit errors if coefficients of x k and x 0 of G(x) are one Detect all double-bit errors, if G(x) has a factor with at least three terms Detect all number of odd errors, if G(x) contains factor (x+1) Detect all burst of errors smaller than k bits

April 17, 2003 A. Parekh, EE122 S2003. Revised and enhanced F'02 Lectures 21 What’s going on? Think of the combination of the n payload bits and the k EDC bits as being a n+k bit codeword For any error correcting scheme, not all n+k bit strings will be valid code words Errors can be detected if and only if the received string is not a valid codeword  Example: Even parity check only detects an odd number of bit errors

April 17, 2003 A. Parekh, EE122 S2003. Revised and enhanced F'02 Lectures 22 Hamming Distance Given codewords A and B, the Hamming distance between them is the number of bits in A that need to be flipped to turn it into B  Example H(011101,000000)=4 If all codewords are at least d Hamming distance apart, then up to d-1 bit errors can be detected

April 17, 2003 A. Parekh, EE122 S2003. Revised and enhanced F'02 Lectures 23 Error Correction If all the codewords are at least a hamming distance of 2E+1 apart then up to E bit errors can be detected  Just pick the codeword closest to the one received! How many bits of EDC are required to correct d errors when there are n bits in the payload? Example: d=1: Suppose n=3. Then any payload can be transformed into 3 other payload strings (000 into 001, 010 or 100).  Need at least two bits in the ECD to differentiate between 4 possibilities  In general need at least k ≥ log 2 (n+1) bits  A scheme that is optimal is called a perfect parity code

April 17, 2003 A. Parekh, EE122 S2003. Revised and enhanced F'02 Lectures 24 Perfect Parity Codes Consider a code word of n+k bits  b 1 b 2 b 3 b 4 b 5 b 6 b 7 b 8 b 9 b 10 b 11… Parity bits are in positions 2 0, 2 1, 2 2,2 3,2 4 …  b 1 b 2 b 3 b 4 b 5 b 6 b 7 b 8 b 9 b 10 b 11… A parity bit in position 2 h, checks all data bits b p such that if you write out p in binary, the h th place is a one. Example: b 1 is a parity bit. It is applied over all data bits b p such that the zero th position of p is a one, i.e. p is odd

April 17, 2003 A. Parekh, EE122 S2003. Revised and enhanced F'02 Lectures 25 A (7,4)-Perfect Parity Code n=4, k=3  Since log(n+1)= 2.322, a code with k=3 that corrects one error is “perfect” Supposing the 6 th bit is corrupted in a codeword. The binary rep of 6 is 110, so the parity bits at positions 2 and 4 would fail. There is no other case when these two bits would fail together  Note 2+4 is 6 Suppose the 5 th bit fails. 5  101 so the parity bits at positions 1 and 4 would fail  Note 1+4 is 5 Suppose the 4 th bit is corrupted. 4  100 so the parity bit at position 4 would fail  Corrupted Parity bits can be identified as well

April 17, 2003 A. Parekh, EE122 S2003. Revised and enhanced F'02 Lectures 26 Reliable Transmission Problem: obtain correct information once errors are detected Solutions:  Use error correction codes (e.g. perfect parity codes)  Use retransmission (we have studied this already) Algorithmic challenges:  Achieve high link utilization, and low overhead

April 17, 2003 A. Parekh, EE122 S2003. Revised and enhanced F'02 Lectures 27 Error correction or Retransmission? Error Correction requires a lot of redundancy  Wasteful if errors are unlikely Retransmission strategies are more popular  As links get reliable this is just done at the transport layer Error correction is useful when retransmission is costly (satellite links, multicast)