CSE 555 Protocol Engineering

25
CSE 555 Protocol Engineering Dr. Mohammed H. Sqalli Computer Engineering Department King Fahd University of Petroleum & Minerals Credits: Dr. Abdul Waheed (KFUPM) Spring 2004 (Term 032)

description

CSE 555 Protocol Engineering. Dr. Mohammed H. Sqalli Computer Engineering Department King Fahd University of Petroleum & Minerals Credits: Dr. Abdul Waheed (KFUPM) Spring 2004 (Term 032). Error Control. Why Error Control. - PowerPoint PPT Presentation

Transcript of CSE 555 Protocol Engineering

Page 1: CSE 555 Protocol Engineering

CSE 555Protocol Engineering

Dr. Mohammed H. SqalliComputer Engineering Department

King Fahd University of Petroleum & Minerals

Credits: Dr. Abdul Waheed (KFUPM)

Spring 2004 (Term 032)

Page 2: CSE 555 Protocol Engineering

Error Control

Page 3: CSE 555 Protocol Engineering

Term 032 2-2-3 CSE555-Sqalli

Why Error Control Number of errors due to data transmission are orders of

magnitude greater than those caused by hardware failures

Probability of bit error for internal circuits < 10-15 Probability of errors on an optical fiber link ~ 10-9

6 orders of magnitude more than hardware errors Probability of errors on a coaxial cable link ~ 10-6 Probability of errors on a switched telephone line ~ 10-4--10-5

What is the difference between error rates of 10-15 and 10-4

At transmission rate of 9600 bits/sec: 10-15 one error every 3303 years of continuous operation 10-4 one error every second!

Page 4: CSE 555 Protocol Engineering

Term 032 2-2-4 CSE555-Sqalli

Effects and Causes of Errors Effects depend on line and network characteristics. Data may

be: Reordered Distorted Deleted Inserted (due to noisy lines)

Two main causes of errors: Linear distortion of the original data

E.g., caused by bandwidth limitations of the raw data channel Non-linear distortion

Caused by echoes, cross-talk, white noise, and impulse noise

Effect of these errors can be remedied to some extent Cable insulations Hardware compensation filters

Errors that remain have to be caught in software

Page 5: CSE 555 Protocol Engineering

Term 032 2-2-5 CSE555-Sqalli

Error Characteristics of a Data Line

Characteristics related to average behavior: Long-term average bit error rate

Characteristics related to overall line/network quality: Percentage of time that the average bit error rate does not

exceed a given threshold value Percentage of error-free seconds

Average bit error rate is commonly used to design an error control method

Provides an indication of performance

Page 6: CSE 555 Protocol Engineering

Term 032 2-2-6 CSE555-Sqalli

Effective Error Control Mechanism

Should match the error characteristics of the channel If channel introduces insertion errors, no need for a

protocol that protects against deletion errors If a channel produces independent, single bit errors, even

a simplest parity scheme will be effective If error rate of the channel is lower than peripheral

equipment, inclusion of any error control scheme results in performance degradation

No error control method should be expected to catch all errors

Goal is to increase the reliability of transmissions up to a required level

Page 7: CSE 555 Protocol Engineering

Term 032 2-2-7 CSE555-Sqalli

Error Model Assume that probability of error is randomly distributed over a

sequence of bits Let a long-term average bit error rate of a channel = p

Probability of n subsequent bit errors in a message = pn Probability of one or more bit errors in a message with n bits = 1-(1-

p)n Formal model of such a channel is called discrete memoryless

channel This model ignores the affect of impulse noise

Discrete: because channel recognizes only a finite number of distinct signal levels

Memoryless: because the probability of an error is assumed to be independent of all occurrences of previous errors

Memoryless channel is also called a symmetric channel Other type is asymmetric channel:

Probability of an error may depend on the value of signal transmitted Error distribution process may have memory i.e., if last n bits were in

error, the next few bits will likely be in error too

Page 8: CSE 555 Protocol Engineering

Term 032 2-2-8 CSE555-Sqalli

Error Free Interval of Symmetric Channel

We can predict error free interval (EFI) using an error model Expressed as probability of a series of at least n contiguous error-

free bit transmissions Using binary symmetric channel model with long-term average

bit error rate of b, the EFI is given as:

This means that the probability decreases linearly with length of interval

To express exponential decrease of probability with interval, we can use Poisson distribution as:

Page 9: CSE 555 Protocol Engineering

Term 032 2-2-9 CSE555-Sqalli

EFI (Cont’d) Which model is more realistic: binary or Poisson

Need empirical studies Such studies show that Poisson model gives a better error

prediction A still better match can be found by adding a correction

factor Benoit Mandelbrot approximation:

The parameter a determines the impact of clustering effect When a=0, model predicts same EFI as with Poisson

distribution For non-zero a, probability of longer EFIs decreases more than

the probability of shorter EFIs This affect is more pronounced with growing a

Page 10: CSE 555 Protocol Engineering

Term 032 2-2-10 CSE555-Sqalli

Types of Transmission Errors Five general types:

Insertion Deletion Duplication Distortion Reordering

Insertions and deletions may be caused by the temporary loss of synchronization between sender and receiver

Deletion errors may also be caused by inadequate flow control Example: receiver may run out of buffer space to hold incoming

messages and may have to discard them Duplication may be intentional

Example: a protocol that uses retransmissions Data reordering may occur if data are routed via many different

routes Sequencing problems (deletion, duplication, and reordering) are

solved by proper flow control Schemes In case of data distortion or insertion, we need methods to verify

the consistency of the data

Page 11: CSE 555 Protocol Engineering

Term 032 2-2-11 CSE555-Sqalli

Redundancy Redundancy in messages is required for error detection Two approaches:

Forward error control Large redundancy in message to help receiver reconstruct

original message Corresponding transmission codes are called error-correcting

codes Feedback error control

Based on retransmission request from receiver e.g., using NAK Corresponding transmission codes are called error-detecting

codes Purpose of error control: reduce channel error rate

Not all errors can be detected There is always a residual error rate If probability of a transmission error in a message = p and

fraction of errors caught by the error control method = f, Then, residual error rate = p(1-f)

Page 12: CSE 555 Protocol Engineering

Term 032 2-2-12 CSE555-Sqalli

How To Select An Error Control Scheme

General rule: If p≈0, an error-correcting code is a bad choice

It merely slows down data transfer If p≈1, a retransmission scheme is a bad choice

Almost every message will have to be retransmitted This includes retransmitted messages

Exceptions to this rule are possible If p is small and cost of retransmission is high, a forward

error control scheme may still be cost-effective A combination of forward and feedback schemes may be

used: Receiver corrects frequently occurring errors Receiver asks for retransmissions of messages with less

frequent errors

Page 13: CSE 555 Protocol Engineering

Term 032 2-2-13 CSE555-Sqalli

Types of Error-Correcting and Error-Detecting Codes

Two basic types: block and convolution codes Block codes

All code words have same length Encoding for each data message can statically be defined

Convolution codes Code word depends on data message and a given number

of previously encoded messages Encoder changes its state with processing of each message Length of the code words is usually constant

Other categorization of types of codes: linear, cyclic, and systematic codes

Page 14: CSE 555 Protocol Engineering

Term 032 2-2-14 CSE555-Sqalli

Linear, Cyclic, and Systematic Codes Linear codes:

Output is a linear combination of valid code words e.g., modulo-2 sum, produces another valid code word

Cyclic codes:A code in which every cyclic shift of a valid code word results in another valid code word

Systematic codes:A code in which each code word includes data bits from original message unaltered, either preceded or followed by a group of check bits

In all cases, code words are longer than original data Let number of original data bits = d and number of additional bits

= e Code rate = d/(d+e) Improving quality of a code high redundancy lower code rate

Page 15: CSE 555 Protocol Engineering

Term 032 2-2-15 CSE555-Sqalli

Parity Check

Effective when probability of multiple bit errors is low Useful for a binary symmetric channel

Add a single bit to every message that makes modulo-2 sum of all bits equal to 1

Overhead of only one bit Error detection:

If any bit, including the check bit, is distorted, parity at the receiver will come out to be wrong

Page 16: CSE 555 Protocol Engineering

Term 032 2-2-16 CSE555-Sqalli

Residual Error Rate of a 1-bit Parity Check

Residual error rate (RER) of a binary symmetric channel: Let probability of an error-free bit transmission = q = 1-p

Probability of error-free transmission of an n+1 bits message = q(n+1)

Probability of a single bit error in n+1 bits = (n+1).p. qn Residual error rate of a 1-bit parity check = 1 - q(n+1) -

(n+1).p.qn This is equal to probability of non 1-bit errors

Example: n = 15 and p = 10-4 Then RER is of the order of 10-6 per message or about 10-7

per bit

Page 17: CSE 555 Protocol Engineering

Term 032 2-2-17 CSE555-Sqalli

RER of a 1-bit Parity Check: Example

Residual error rate of a binary symmetric channel per code word increases as a function of bit error rate p

When p≈0, parity check code significantly reduces error rate Difference between corrected and uncorrected code is

maximum at p = 0.06

n=15

Error rate without parity bit: 1-qn Prob.of 1-bit error: (n+1)pqn

Page 18: CSE 555 Protocol Engineering

Term 032 2-2-18 CSE555-Sqalli

Forward Error Correction Forward error control scheme uses a small subset of

available bit combinations to encode messages Codes are chosen such that it takes relatively large number

of bit errors to convert one valid message into another Receiver tries to correct a distorted message by mapping it

onto the closest valid message in that scheme Closest = one that differs from received code word in fewest # of

bits Code rate is generally lower than that of an error-

detecting code Useful when communication of control messages from

receiver back to sender is difficult: A very long transmission delay Absence of a return channel High bit-error rate

Page 19: CSE 555 Protocol Engineering

Term 032 2-2-19 CSE555-Sqalli

Correcting 1-bit Errors Using LRC and VRC Simple extensions of parity check per code word

Longitudinal Redundancy Check (LRC): Additional parity bit with a sequence of 7 bits new code word Parity bit is called LRC

Vertical Redundancy Check (VRC) An extra sequence of 8 bits after a series of n code words Each bit in this sequence works as parity for bits that occupy same

position in n code words Example: ASCII coding for n=4:

Code rate = 28/(12+28) = 0.7

Page 20: CSE 555 Protocol Engineering

Term 032 2-2-20 CSE555-Sqalli

Hamming distance Minimum difference between two words in a code

The difference between two code words is the number of bits in which they differ

A code with a hamming distance of n any combination of up to n-1 bit errors can be detected any combination of up to (n-1)/2 errors per code word can be

corrected (if receiver interprets a non-valid code as the closest valid code)

Receiver will guess wrong for higher numbers of bit errors (probability low overall error rate of channel may be reduced)

Page 21: CSE 555 Protocol Engineering

Term 032 2-2-21 CSE555-Sqalli

Linear Block Code

Based on inserting a block of c check bits to protect m bits:

n messages to be encoded

To be able to correct all single bit errors, we need Hamming distance of at least 3 m+c+1 = 2c

Example: Hamming code

Page 22: CSE 555 Protocol Engineering

Term 032 2-2-22 CSE555-Sqalli

Bursts and Code Interleaving In practice, transmission errors tend to come in bursts

Code interleaving is used to counter burst errors Assume messages of n bits each, protected against single bit

errors Assume traffic is non-interactive Sender buffers each block of k subsequent messages Sender places these k messages in a matrix of (k x n) bits Sender transmits the bits in this matrix column by column Receiver restores the matrix column by column Receiver read row by row from matrix to get messages

Intercept burst errors up to a length of k bits

Page 23: CSE 555 Protocol Engineering

Term 032 2-2-23 CSE555-Sqalli

Cyclic Redundancy Checks (CRC) Based on the addition of series of check bits to code words. In absence of transmission errors, (code word + check bits) is

divisible by a given factor Division method and factor used determine range of

transmission errors that can be detected A generator polynomial is used to form the checksum for a

code word Example: Code word 10011 defines the polynomial x4+x+1. Several standardized generator polynomials are available (e.g.,

CRC-12)

Page 24: CSE 555 Protocol Engineering

Term 032 2-2-24 CSE555-Sqalli

Arithmetic Codes

A simpler version of CRC that uses only arithmetic operations (addition and modulo operations)

Much less overhead to compute the checksum

Good error detection capability

A version has been adopted for the ISO Class 4 transport protocol standard (TP4)

Page 25: CSE 555 Protocol Engineering

Term 032 2-2-25 CSE555-Sqalli

Summary – Error Control

Motivation Error Model Types of Transmission Errors Redundancy Types of Error-Correcting and Error-Detecting Codes Linear, Cyclic, and Systematic Codes Parity Check and Residual Error Rate Forward Error Correction Linear Block Code Cyclic Redundancy Checks (CRC) Arithmetic Codes