ECE 4450:427/527 - Computer Networks Spring 2017

Similar documents
Multimedia Systems WS 2010/2011

Getting Connected. Chapter 2, Part 2. Networking CS 3470, Section 1 Sarah Diesburg

EECS Components and Design Techniques for Digital Systems. Lec 26 CRCs, LFSRs (and a little power)

Error Detection & Correction

Information redundancy

Outline. EECS Components and Design Techniques for Digital Systems. Lec 18 Error Coding. In the real world. Our beautiful digital world.

Introduction to Wireless & Mobile Systems. Chapter 4. Channel Coding and Error Control Cengage Learning Engineering. All Rights Reserved.

Optical Storage Technology. Error Correction

Assume that the follow string of bits constitutes one of the segments we which to transmit.

Linear Feedback Shift Registers (LFSRs) 4-bit LFSR

CSE 123: Computer Networks

Cyclic codes: overview

Error Correction Review

x n k m(x) ) Codewords can be characterized by (and errors detected by): c(x) mod g(x) = 0 c(x)h(x) = 0 mod (x n 1)

EECS150 - Digital Design Lecture 21 - Design Blocks

Objective: To become acquainted with the basic concepts of cyclic codes and some aspects of encoder implementations for them.

VHDL Implementation of Reed Solomon Improved Encoding Algorithm

EECS150 - Digital Design Lecture 26 Error Correction Codes, Linear Feedback Shift Registers (LFSRs)

EECS150 - Digital Design Lecture 27 - misc2

B. Cyclic Codes. Primitive polynomials are the generator polynomials of cyclic codes.

2013/Fall-Winter Term Monday 12:50 Room# or 5F Meeting Room Instructor: Fire Tom Wada, Professor

Dr. Cathy Liu Dr. Michael Steinberger. A Brief Tour of FEC for Serial Link Systems

Modular numbers and Error Correcting Codes. Introduction. Modular Arithmetic.

EECS150 - Digital Design Lecture 23 - FFs revisited, FIFOs, ECCs, LSFRs. Cross-coupled NOR gates

Fault Tolerant Computing CS 530 Information redundancy: Coding theory. Yashwant K. Malaiya Colorado State University

Chapter 7. Error Control Coding. 7.1 Historical background. Mikael Olofsson 2005

Lecture on Sensor Networks

Error Correction Code (1)

Cyclic Codes. Saravanan Vijayakumaran August 26, Department of Electrical Engineering Indian Institute of Technology Bombay

Lecture 12. Block Diagram

BINARY CODES. Binary Codes. Computer Mathematics I. Jiraporn Pooksook Department of Electrical and Computer Engineering Naresuan University

A field F is a set of numbers that includes the two numbers 0 and 1 and satisfies the properties:

FPGA BASED DESIGN OF PARALLEL CRC GENERATION FOR HIGH SPEED APPLICATION

1 Reed Solomon Decoder Final Project. Group 3 Abhinav Agarwal S Branavan Grant Elliott. 14 th May 2007

A Brief Encounter with Linear Codes

MATH3302 Coding Theory Problem Set The following ISBN was received with a smudge. What is the missing digit? x9139 9

Chapter 5. Cyclic Codes

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Discussion 6A Solution

Error Correction and Trellis Coding

Error Correction Methods

Convolutional Coding LECTURE Overview

Top Ten Algorithms Class 6

Cyclic Redundancy Check Codes

Error Detection, Correction and Erasure Codes for Implementation in a Cluster File-system

Coding for loss tolerant systems

Error Detection and Correction: Hamming Code; Reed-Muller Code

7.5 CRC. 12 March r0 SAS-2 CRC fixes

7.5 CRC. 20 March r2 SAS-2 CRC fixes

Coping with disk crashes

ECEN 604: Channel Coding for Communications

An Enhanced (31,11,5) Binary BCH Encoder and Decoder for Data Transmission

Discrete Mathematics for CS Spring 2007 Luca Trevisan Lecture 11. Error Correcting Codes Erasure Errors

1. How many errors may be detected (not necessarily corrected) if a code has a Hamming Distance of 6?

Chapter 6. BCH Codes

Physical Layer and Coding

MATH3302. Coding and Cryptography. Coding Theory

Implementation of Galois Field Arithmetic. Nonbinary BCH Codes and Reed-Solomon Codes

Some math for embedded algorithms

Optimization of the Hamming Code for Error Prone Media

Formal Verification of the CRC Algorithm Properties

Making Error Correcting Codes Work for Flash Memory

Example: sending one bit of information across noisy channel. Effects of the noise: flip the bit with probability p.

Coding theory: Applications

Optimization of the Hamming Code for Error Prone Media

The Pennsylvania State University. The Graduate School. Department of Computer Science and Engineering

6.1.1 What is channel coding and why do we use it?

channel of communication noise Each codeword has length 2, and all digits are either 0 or 1. Such codes are called Binary Codes.

ECE8771 Information Theory & Coding for Digital Communications Villanova University ECE Department Prof. Kevin M. Buckley Lecture Set 2 Block Codes

Linear Cyclic Codes. Polynomial Word 1 + x + x x 4 + x 5 + x x + x

3x + 1 (mod 5) x + 2 (mod 5)

CSE 20: Discrete Mathematics

9 THEORY OF CODES. 9.0 Introduction. 9.1 Noise

Simplification of Procedure for Decoding Reed- Solomon Codes Using Various Algorithms: An Introductory Survey

2. Polynomials. 19 points. 3/3/3/3/3/4 Clearly indicate your correctly formatted answer: this is what is to be graded. No need to justify!

Communication Theory II

Design and Implementation of High Speed CRC Generators

Coding Theory: Linear-Error Correcting Codes Anna Dovzhik Math 420: Advanced Linear Algebra Spring 2014

3. Coding theory 3.1. Basic concepts

Math 512 Syllabus Spring 2017, LIU Post

NUMBERS AND CODES CHAPTER Numbers

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Discussion 6B Solution

Chapter 3 Linear Block Codes

Review. EECS Components and Design Techniques for Digital Systems. Lec 26 CRCs, LFSRs (and a little power)

Modeling and Simulation NETW 707

Coding Theory and Applications. Solved Exercises and Problems of Cyclic Codes. Enes Pasalic University of Primorska Koper, 2013

Fully-parallel linear error block coding and decoding a Boolean approach

Fault Tolerance & Reliability CDA Chapter 2 Cyclic Polynomial Codes

16.36 Communication Systems Engineering

CS 70 Discrete Mathematics and Probability Theory Summer 2016 Dinh, Psomas, and Ye Discussion 8A Sol

Mathematical Foundations of Cryptography

Outline. EECS150 - Digital Design Lecture 26 Error Correction Codes, Linear Feedback Shift Registers (LFSRs) Simple Error Detection Coding

CSCI 2570 Introduction to Nanocomputing

EECS150 - Digital Design Lecture 26 - Faults and Error Correction. Types of Faults in Digital Designs


Information Redundancy: Coding

Chapter 4 Finite Fields

Linear Algebra. F n = {all vectors of dimension n over field F} Linear algebra is about vectors. Concretely, vectors look like this:

Binary Primitive BCH Codes. Decoding of the BCH Codes. Implementation of Galois Field Arithmetic. Implementation of Error Correction

MATH 433 Applied Algebra Lecture 21: Linear codes (continued). Classification of groups.

A Novel Modification of Cyclic Redundancy Check for Message Length Detection

Transcription:

ECE 4450:427/527 - Computer Networks Spring 2017 Dr. Nghi Tran Department of Electrical & Computer Engineering Lecture 5.2: Error Detection & Correction Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 1

Link Layer: Five Common Problems Basic problem: you can t just send IP datagrams over the link! We first consider how to encode bits into the signal at the source and recover bits at the receiving node Once it is possible to transmit bits, we need to figure out how to package these bits into FRAME Assume each node is able to recognize the collections of bits making up a frame, the third problem is to determine if those bits are in error: Error Detection and Correction If frames arriving at destination contain errors, how to recover from such losses: ARQ Final problem related to multiple-access link: how mediate access to a shared link so that all nodes have a chance to transmit: We focus on Ethernet Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 2

Errors in Link Types of errors in frame Isolated errors: Bit errors that do not affect other bits Burst errors: A cluster of bits in which a number of errors occur Errors caused by: signal attenuation, noise, electrical interference etc. Burst errors increase with data rate 1μs of impulse noise or fading effect will affect At most 2 bits when data rate is 1Mbps At most 101 bits when data rate is 100Mbps Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 3

How Often Isolated Errors Occur? BER = 10-7, and a file is 10 4 long, then the probability of a single error is 10 4 x 10-7 = 10-3 Probability of exactly two errors. For two bits i, j the probability of error is 10-7 x 10-7 But how many possible cases of two errors? What is the probability of two errors then? Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 4

How to Deal with Errors? Receiver must be aware that an error occurred in a frame Need to have an ERROR DETECTION mechanism Receiver needs to receive the correct frame Two possible strategies to CORRECT ERRORS: Add information redundancy to correct errors (error correcting codes) Ask sender to re-send frame (retransmission strategies): Usually combined with Error Detection Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 5

Error Detection Basic Idea of Error Detection To add redundant information to a frame that can be used to determine if errors have been introduced Imagine (Extreme Case) Transmitting two complete copies of data Identical No error Differ Error Poor Scheme???» n bit message, n bit redundant information In general, we can provide strong error detection technique k redundant bits, n bits message, k << n In Ethernet, a frame carrying up to 12,000 bits of data requires only extra 32 bits Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 6

Error Detection Extra bits are redundant They add no new information to the message Derived from the original message using some algorithm Both the sender and receiver know the algorithm Sender Receiver m r m r Receiver computes r using m If they match, no error Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 7

Error Detection Single Parity Check Single parity checks Append a single parity bit at end of frame. Parity is 1 if # of ones is odd, and zero otherwise Example: 0 1 1 0 1 0 1 0 1 1 0 0 parity Single parity check can detect any odd # of errors Cannot tell where the error took place or how many occurred Not useful for burst errors Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 8

Error Detection Two-Dimensional Parity It is based on simple (one-dimensional) parity: adding one extra bit to a 7-bit code to balance the number of 1s in the byte. For example, Odd parity sets the eighth bit to 1 if needed to give an odd number of 1s in the byte, and Even parity sets the eighth bit to 1 if needed to give an even number of 1s in the byte Two-dimensional parity does a similar calculation for each bit position across each of the bytes contained in the frame This results in an extra parity byte for the entire frame, in addition to a parity bit for each byte Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 9

Two-Dimensional Parity: Example Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 10

How Good is Dimensional Parity? Error Detection? 1 0 0 1 0 1 0 1 0 1 1 1 0 1 0 0 1 1 1 0 0 0 1 0 1 0 0 0 1 1 1 0 0 0 1 1 0 0 1 1 1 0 1 1 1 1 1 0 1 0 0 1 0 1 0 1 0 1 1 1 0 1 0 0 1 1 0 0 1 0 1 0 1 0 0 0 1 1 1 0 0 0 0 1 1 0 1 1 1 0 1 1 1 1 1 0 Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 11

How Good is Dimensional Parity? Error Correction? 1 0 0 1 0 1 0 1 0 1 1 1 0 1 0 0 1 1 1 0 0 0 1 0 1 0 0 0 1 1 1 0 0 0 1 1 0 0 1 1 1 0 1 1 1 1 1 0 This column: 1 error 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 1 1 0 0 0 1 0 1 0 0 0 1 1 1 0 0 0 1 1 0 0 1 1 1 0 1 1 1 1 1 0 This row: 1 error Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 12

Internet Checksum Goal: detect errors (e.g., flipped bits) in transmitted segment. Note: Not used at link level. In fact, at Transport Layer, e.g, UDP!! Sender: treat segment contents as sequence of 16-bit integers Addition (1 s complement sum) of all segment contents Checksum: Previous result is complemented sender puts checksum value into UDP checksum field Receiver: compute checksum of received segment check if computed checksum equals checksum field value: NO - error detected YES - no error detected. But maybe errors nonetheless? More later. Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 13

1 s Complement Sum What is 1 s complement addition? 1. Sum the numbers normally 2. The carry of the sum is whatever bits are to the left of the rightmost 16 bits. 3. If carry=0 then the normal sum is the 1 s complement sum. If carry!=0 then add the carry back into normal sum to get 1 s complement sum. We will see some examples next!! Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 14

1 s Complement Sum 1 0 0 0 1 0 0 1 Word 1 1 0 1 1 1 0 0 0 Word 2 ------------------------------------- 1 0 1 0 0 0 0 0 1 Normal Sum (note carry to remove) 1 Remove carry and add it back ------------------------------------- 0 1 0 0 0 0 1 0 1 s complement sum 0 0 1 0 1 0 0 1 Word 1 1 0 1 1 1 0 0 0 Word 2 --------------------------------- 1 1 1 0 0 0 0 1 1 s complement sum Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 15

Internet Checksum Example Internet Checksum Note: when adding numbers, a carryout from the most significant bit needs to be added to the result: 1 s complement sum Example: add two 16-bit integers 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 wraparound 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 s compliment sum1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0 checksum 1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1 Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 16

Checksum: More than 2 Words/Sequences? Internet Checksum 1 0 0 0 1 0 0 1 Input Word 1 1 1 1 1 0 0 0 0 Input Word 2 0 0 1 1 1 1 0 0 Input Word 3 1 0 1 0 0 0 0 1 Input Word 4 1 0 0 0 1 0 0 1 W1 1 1 1 1 0 0 0 0 W2 --------------------------------------------------------------------- 1 0 1 1 1 1 0 0 1 Normal sum 1 Carry --------------------------------------------------------------------- 0 1 1 1 1 0 1 0 1 s Comp sum W1, W2 0 0 1 1 1 1 0 0 W3 --------------------------------------------------------------------- 1 0 1 1 0 1 1 0 1 s Comp sum W1, W2, W3 1 0 1 0 0 0 0 1 W4 --------------------------------------------------------------------- 1 0 1 0 1 1 0 0 1 Normal sum 1 Carry --------------------------------------------------------------------- 0 1 0 1 1 0 1 0 1 s Comp sum W1, W2, W3, W4 1 0 1 0 0 1 0 1 complement = checksum of W1-W4 Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 17

Some Notes Usually, the word checksum is often used to imprecisely to mean any form of error-detecting code But as we just learnt Internet checksum: Just use addition To avoid confusion When we talk about checksum: Only apply to codes using addition Error-detecting codes: General class Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 18

Cyclic Redundancy Check (CRC) Add r redundant bits on a n-bit message Design goal k<<n so that overhead is low Example: 32-bit CRC adequate for 12,000 bits (1,500) bytes In order to understand, let talk about Polynomial Arithmetic over Galois Field 2 first!!!!!!!! What do you know about Polynomial Arithmetic? Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 19

Polynomial Arithmetic over GF(2) Represent n-bit messages as (n-1) degree polynomials Example: 10001010 maps to x 7 + x 3 + x 1 The bits of the message to be transmitted become the coefficients of the polynomial: It can be either 0 or 1: Galois Field 2 (operations defined next). Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 20

Polynomial Arithmetic over GF(2) Basic operations: Addition: logical XOR Subtraction? Multiplication: logical AND How to add two polynomials? How to subtract two polynomials? How to multiply two polynomials? How to divide two polynomials (using long division) to find quotient and remainder? Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 21

Polynomial Arithmetic Ppolynomial division: B(x)/C(x) - deg(b) deg(c); C(x) is called the divisor If C(x) and B(x) are of the same degree, the remainder is obtained by subtracting C(x) from B(x) If the remainder is 0, we say B(x) is divisible by C(x). Modulo 2 arithmetic, subtraction is an XOR operation between coefficients Example B(x) = x 3 + 1, C(x) = x 3 + x 2 + 1 Remainder: R(x) = x 2 B(x) = 1001, C(x) =1101, R(x) = 0100 (XOR of B(x), C(x)) Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 22

How CRC work? Let our information M(x) be a frame with n bits Let C(x) be a the generator polynomial have less than n bits say equal to k+1, known at both sender and receiver (degree of k). Based on M(x) and C(x), CRC will generate P(x) of size n+k bits: Divisible by C(x). P(x) will be transmitted instead of M(x). At the receiver side, divide the received polynomial by C(x) If the remainder is 0, no error If not, error Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 23

CRC Calculation Let M(x) be a frame with n bits and let the generator polynomial have less than n bits say equal to k. Append k zero bits to the low-order end of the frame, so it now contains n+k bits and corresponds to the polynomial x k M(x). Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 24

CRC Calculation Divide the bit string corresponding to x k M(x) by the bit string corresponding to C(x) using modulo 2 division. Subtract the remainder (which is always k or fewer bits) from the string corresponding to x k M(x) using modulo 2 subtraction (addition and subtraction are the same in modulo 2). The result is the checksummed frame to be transmitted. Call it polynomial P(x). Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 25

CRC Example CRC Calculation using Polynomial Long Division Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 26

CRC: Another Example CRC Calculation using Polynomial Long Division Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 27

How to Select C(x) Properties of Generator Polynomial Let P(x) represent what the sender sent and P(x) + E(x) is the received string. A 1 in E(x) represents that in the corresponding position in P(x) the message the bit is flipped. We know that P(x)/C(x) leaves a remainder of 0, but if E(x)/C(x) leaves a remainder of 0, then either E(x) = 0 or C(x) is factor of E(x). When C(x) is a factor of E(x), we have problem? Errors go unnoticed. If there is a single bit error then E(x) = x i, where i determines the bit in error. If C(x) contains non-zero first and last terms x k and x 0, it will never divide E(x), so all single bit errors will be detected. Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 28

How to Select C(x) Properties of Generator Polynomial In general, it is possible to prove that the following types of errors can be detected by a C(x) with the stated properties All single-bit errors, as long as the x k and x 0 terms have nonzero coefficients. All double-bit errors, as long as C(x) has a factor with at least three terms. Any odd number of errors, as long as C(x) contains the factor (x+1). Any burst error (i.e., sequence of consecutive error bits) for which the length of the burst is less than k bits. (Most burst errors of larger than k bits can also be detected.) Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 29

C(x) CRC C(x) CRC-8 x 8 + x 2 + x + 1 CRC-10 x 10 + x 9 + x 5 + x 4 + x + 1 CRC-12 x 12 + x 11 + x 3 + x 2 + 1 CRC-16 x 16 + x 15 + x 2 + 1 CRC-CCITT x 16 + x 12 + x 5 + 1 CRC-32 x 32 + x 26 + x 23 + x 22 + x 16 + x 12 + x 11 + x 10 + x 8 + x 7 + x 5 + x 4 + x 2 + x +1 CCITT - Comité Consultatif International Téléphonique et Télégraphique ITU (International Telecommunication Union) Telecommunication Standardization Sector (ITU-T) Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 30

CRC: Implementation k bits CRC: k registers Label them from 0 to (k-1), left to right Add XOR gate in front of register nth if C(x) contains x^n When all message (appended with k 0s) shifted, registers contain CRC bits Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 31

Error Correcting: Some Discussions Error Detecting can only detect errors We can perform more powerful function: Correcting Errors. How can we do it? How do you back-up data at home? Repetition Code Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 32

Error Correcting: Repetition Code Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 33

How Good is Repetition Code? Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 34

How Good is Repetition Code? Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 35

How Good is Repetition Code? Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 36

Current and Future Codes Well-known codes: Hamming codes; Reed-Solomon codes: Used in DSL, CD, DVD, Blue-Ray Discs Almost all digital comm. and storage systems: already upgraded or being upgraded to include very powerfull error correcting codes: Turbo Code, Low-Density-Parity-Check (LDPC) Code Deep space and satellite communications: DVB-S2, DVB-RCS, Messenger to Mercury, Mars Reconnaissace Orbiter, Mars Telecomm Orbiter 2010 10GBASE-T or IEEE 802.3an (Ethernet) Wireless Communications: WiFi, LTE, LTE-Advanced Need to know more: Take Error Control Coding course Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 37

Error Detection or Error Correction? Look like Error Correction is always better? Requires extra bits all the time. Re-transmission: when only needed. Usually, error correction is preferred when errors are quite probable, wireless comm., or cost of transmission is too high Error Correction: Forward Error Correction Can be used together: minor errors are corrected without retransmission, and major errors are corrected via a request for retransmission: this is called hybrid automatic repeatrequest Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 38