cse555-lec-2-2

Upload: aditya-shukla

Post on 05-Apr-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/31/2019 CSE555-Lec-2-2

    1/25

  • 7/31/2019 CSE555-Lec-2-2

    2/25

    Error Control

  • 7/31/2019 CSE555-Lec-2-2

    3/25

    CSE555-SqalliTerm 032 2-2-3

    Why Error Control

    Number of errors due to data transmission are orders ofmagnitude 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 operation10-4 one error every second!

  • 7/31/2019 CSE555-Lec-2-2

    4/25

    CSE555-SqalliTerm 032 2-2-4

    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

  • 7/31/2019 CSE555-Lec-2-2

    5/25

    CSE555-SqalliTerm 032 2-2-5

    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 oferror-free seconds

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

    Provides an indication of performance

  • 7/31/2019 CSE555-Lec-2-2

    6/25

    CSE555-SqalliTerm 032 2-2-6

    Effective Error Control Mechanism

    Should match the error characteristics of the channel

    If channel introduces insertion errors, no need for a protocol thatprotects 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 performancedegradation

    No error control method should be expected to catch all errors Goal is to increase the reliability of transmissions up to a required

    level

  • 7/31/2019 CSE555-Lec-2-2

    7/25CSE555-SqalliTerm 032 2-2-7

    Error Model

    Assume that probability of error is randomly distributed over asequence of bits Let a long-term average bit error rate of a channel =p

    Probability ofnsubsequent bit errors in a message =pn

    Probability of one or more bit errors in a message with nbits = 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 distinctsignal levels

    Memoryless: because the probability of an error is assumed to beindependent 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 nbits were in error, thenext few bits will likely be in error too

  • 7/31/2019 CSE555-Lec-2-2

    8/25CSE555-SqalliTerm 032 2-2-8

    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 ncontiguous error-free bittransmissions

    Using binary symmetric channel model with long-term average bit errorrate ofb, 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 canuse Poisson distribution as:

  • 7/31/2019 CSE555-Lec-2-2

    9/25CSE555-SqalliTerm 032 2-2-9

    EFI (Contd)

    Which model is more realistic: binary or Poisson

    Need empirical studies

    Such studies show that Poisson model gives a better errorprediction

    A still better match can be found by adding a correction factor Benoit Mandelbrot approximation:

    The parameter adetermines 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

  • 7/31/2019 CSE555-Lec-2-2

    10/25CSE555-SqalliTerm 032 2-2-10

    Types of Transmission Errors Five general types:

    Insertion

    Deletion

    Duplication

    Distortion

    Reordering

    Insertions and deletions may be caused by the temporary loss ofsynchronization 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 messagesand 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 solvedby proper flow control Schemes

    In case ofdata distortion or insertion, we need methods to verify theconsistency of the data

  • 7/31/2019 CSE555-Lec-2-2

    11/25CSE555-SqalliTerm 032 2-2-11

    Redundancy

    Redundancy in messages is required for error detection

    Two approaches: Forward error control

    Large redundancy in message to help receiver reconstruct originalmessage

    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 =pandfraction of errors caught by the error control method = f, Then, residual error rate =p(1-f)

  • 7/31/2019 CSE555-Lec-2-2

    12/25CSE555-SqalliTerm 032 2-2-12

    How To Select An Error Control Scheme

    General rule:

    Ifp0, an error-correcting code is a bad choice

    It merely slows down data transfer

    Ifp1, 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

    Ifpis small and cost of retransmission is high, a forward errorcontrol 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

  • 7/31/2019 CSE555-Lec-2-2

    13/25CSE555-SqalliTerm 032 2-2-13

    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, andsystematic codes

  • 7/31/2019 CSE555-Lec-2-2

    14/25

    CSE555-SqalliTerm 032 2-2-14

    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 originalmessage unaltered, either preceded or followed by a group of checkbits

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

    Code rate = d/(d+e)

    Improving quality of a code high redundancy lower code rate

  • 7/31/2019 CSE555-Lec-2-2

    15/25

    CSE555-SqalliTerm 032 2-2-15

    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 ofall bits equal to 1

    Overhead of only one bit Error detection:

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

  • 7/31/2019 CSE555-Lec-2-2

    16/25

    CSE555-SqalliTerm 032 2-2-16

    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+1bits message = q(n+1)

    Probability of a single bit error in n+1bits = (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

  • 7/31/2019 CSE555-Lec-2-2

    17/25

    CSE555-SqalliTerm 032 2-2-17

    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 ratep When p0, parity check code significantly reduces error rate

    Difference between corrected and uncorrected code ismaximum at p = 0.06

    n=15

    Error rate without parity bit: 1-q

    n

    Prob.of 1-bit error: (n+1)pqn

  • 7/31/2019 CSE555-Lec-2-2

    18/25

    CSE555-SqalliTerm 032 2-2-18

    Forward Error Correction

    Forward error control scheme uses a small subset of availablebit combinations to encode messages

    Codes are chosen such that it takes relatively large number of biterrors to convert one valid message into another

    Receiver tries to correct a distorted message by mapping it ontothe 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-detectingcode

    Useful when communication of control messages from receiverback to sender is difficult:

    A very long transmission delay

    Absence of a return channel

    High bit-error rate

  • 7/31/2019 CSE555-Lec-2-2

    19/25

    CSE555-SqalliTerm 032 2-2-19

    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 ncode words

    Example: ASCII coding for n=4:

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

  • 7/31/2019 CSE555-Lec-2-2

    20/25

    CSE555-SqalliTerm 032 2-2-20

    Hamming distance

    Minimum difference between two words in a code

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

    A code with a hamming distance ofn

    any combination of up to n-1bit errors can be detected

    any combination of up to (n-1)/2errors per code word can becorrected (if receiver interprets a non-valid code as the closest validcode)

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

  • 7/31/2019 CSE555-Lec-2-2

    21/25

    CSE555-SqalliTerm 032 2-2-21

    Linear Block Code

    Based on inserting a block ofccheck bits to protect mbits:

    nmessages to be encoded

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

    Example: Hamming code

  • 7/31/2019 CSE555-Lec-2-2

    22/25

    CSE555-SqalliTerm 032 2-2-22

    Bursts and Code Interleaving

    In practice, transmission errors tend to come in bursts

    Code interleaving is used to counter burst errors

    Assume messages ofnbits each, protected against single bit errors

    Assume traffic is non-interactive

    Sender buffers each block ofksubsequent messages

    Sender places these kmessages 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 ofkbits

  • 7/31/2019 CSE555-Lec-2-2

    23/25

    CSE555-SqalliTerm 032 2-2-23

    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) isdivisible by a given factor

    Division method and factor used determine range of transmissionerrors that can be detected

    A generator polynomial is used to form the checksum for a codeword

    Example: Code word 10011 defines the polynomialx4+x+1.

    Several standardized generator polynomials are available (e.g., CRC-12)

  • 7/31/2019 CSE555-Lec-2-2

    24/25

    CSE555-SqalliTerm 032 2-2-24

    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 protocolstandard (TP4)

  • 7/31/2019 CSE555-Lec-2-2

    25/25

    CSE555-SqalliTerm 032 2-2-25

    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